PageSourceSearch

https://panda-express-game.web.app/game.js

js panda-express-game.web.app collected 2026-10-03 12:32:19 UTC 1,966,067 bytes, 1,202 lines download raw bytes

1!function(){"use strict";var global=window;function getAugmentedNamespace(n){if(n.__esModule)return n;var a=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(n).forEach((function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:!0,get:function(){return n[k]}})})),a}
2/**
3	 * @author       Richard Davey <[email protected]>
4	 * @copyright    2020 Photon Storm Ltd.
5	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
6	 */var BlendModes$8={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27},ScaleModes_1={DEFAULT:0,LINEAR:0,NEAREST:1},_const$e={VERSION:"3.55.2",BlendModes:BlendModes$8,ScaleModes:ScaleModes_1,AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8},IsPlainObject_1=function(obj){if("object"!=typeof obj||obj.nodeType||obj===obj.window)return!1;try{if(obj.constructor&&!{}.hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}return!0},IsPlainObject$x=IsPlainObject_1,Extend$m=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[1]||{},i=2),length===i&&(target=this,--i);i<length;i++)if(null!=(options=arguments[i]))for(name in options)src=target[name],target!==(copy=options[name])&&(deep&&copy&&(IsPlainObject$x(copy)||(copyIsArray=Array.isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&Array.isArray(src)?src:[]):clone=src&&IsPlainObject$x(src)?src:{},target[name]=Extend$m(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target},Extend_1$1=Extend$m,_const$d={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12},GetBottom_1=function(gameObject){return gameObject.y+gameObject.height-gameObject.height*gameObject.originY},GetCenterX_1=function(gameObject){return gameObject.x-gameObject.width*gameObject.originX+.5*gameObject.width},SetCenterX_1=function(gameObject,x){var offsetX=gameObject.width*gameObject.originX;return gameObject.x=x+offsetX-.5*gameObject.width,gameObject},SetTop_1=function(gameObject,value){return gameObject.y=value+gameObject.height*gameObject.originY,gameObject},GetBottom$8=GetBottom_1,GetCenterX$4=GetCenterX_1,SetCenterX$4=SetCenterX_1,SetTop$7=SetTop_1,BottomCenter_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetCenterX$4(gameObject,GetCenterX$4(alignTo)+offsetX),SetTop$7(gameObject,GetBottom$8(alignTo)+offsetY),gameObject},GetLeft_1=function(gameObject){return gameObject.x-gameObject.width*gameObject.originX},SetLeft_1=function(gameObject,value){return gameObject.x=value+gameObject.width*gameObject.originX,gameObject},GetBottom$7=GetBottom_1,GetLeft$8=GetLeft_1,SetLeft$7=SetLeft_1,SetTop$6=SetTop_1,BottomLeft_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$7(gameObject,GetLeft$8(alignTo)-offsetX),SetTop$6(gameObject,GetBottom$7(alignTo)+offsetY),gameObject},GetRight_1=function(gameObject){return gameObject.x+gameObject.width-gameObject.width*gameObject.originX},SetRight_1=function(gameObject,value){return gameObject.x=value-gameObject.width+gameObject.width*gameObject.originX,gameObject},GetBottom$6=GetBottom_1,GetRight$8=GetRight_1,SetRight$7=SetRight_1,SetTop$5=SetTop_1,BottomRight_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$7(gameObject,GetRight$8(alignTo)+offsetX),SetTop$5(gameObject,GetBottom$6(alignTo)+offsetY),gameObject},SetBottom_1=function(gameObject,value){return gameObject.y=value-gameObject.height+gameObject.height*gameObject.originY,gameObject},GetBottom$5=GetBottom_1,GetLeft$7=GetLeft_1,SetBottom$7=SetBottom_1,SetRight$6=SetRight_1,LeftBottom_1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$6(gameObject,GetLeft$7(alignTo)-offsetX),SetBottom$7(gameObject,GetBottom$5(alignTo)+offsetY),gameObject},GetCenterY_1=function(gameObject){return gameObject.y-gameObject.height*gameObject.originY+.5*gameObject.height},SetCenterY_1=function(gameObject,y){var offsetY=gameObject.height*gameObject.originY;return gameObject.y=y+offsetY-.5*gameObject.height,gameObject},GetCenterY$4=GetCenterY_1,GetLeft$6=GetLeft_1,SetCenterY$4=SetCenterY_1,SetRight$5=SetRight_1,LeftCenter_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$5(gameObject,GetLeft$6(alignTo)-offsetX),SetCenterY$4(gameObject,GetCenterY$4(alignTo)+offsetY),gameObject},GetTop_1=function(gameObject){return gameObject.y-gameObject.height*gameObject.originY},GetLeft$5=GetLeft_1,GetTop$8=GetTop_1,SetRight$4=SetRight_1,SetTop$4=SetTop_1,LeftTop_1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$4(gameObject,GetLeft$5(alignTo)-offsetX),SetTop$4(gameObject,GetTop$8(alignTo)-offsetY),gameObject},GetBottom$4=GetBottom_1,GetRight$7=GetRight_1,SetBottom$6=SetBottom_1,SetLeft$6=SetLeft_1,RightBottom_1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$6(gameObject,GetRight$7(alignTo)+offsetX),SetBottom$6(gameObject,GetBottom$4(alignTo)+offsetY),gameObject},GetCenterY$3=GetCenterY_1,GetRight$6=GetRight_1,SetCenterY$3=SetCenterY_1,SetLeft$5=SetLeft_1,RightCenter_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$5(gameObject,GetRight$6(alignTo)+offsetX),SetCenterY$3(gameObject,GetCenterY$3(alignTo)+offsetY),gameObject},GetRight$5=GetRight_1,GetTop$7=GetTop_1,SetLeft$4=SetLeft_1,SetTop$3=SetTop_1,RightTop_1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$4(gameObject,GetRight$5(alignTo)+offsetX),SetTop$3(gameObject,GetTop$7(alignTo)-offsetY),gameObject},GetCenterX$3=GetCenterX_1,GetTop$6=GetTop_1,SetBottom$5=SetBottom_1,SetCenterX$3=SetCenterX_1,TopCenter_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetCenterX$3(gameObject,GetCenterX$3(alignTo)+offsetX),SetBottom$5(gameObject,GetTop$6(alignTo)-offsetY),gameObject},GetLeft$4=GetLeft_1,GetTop$5=GetTop_1,SetBottom$4=SetBottom_1,SetLeft$3=SetLeft_1,TopLeft_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$3(gameObject,GetLeft$4(alignTo)-offsetX),SetBottom$4(gameObject,GetTop$5(alignTo)-offsetY),gameObject},GetRight$4=GetRight_1,GetTop$4=GetTop_1,SetBottom$3=SetBottom_1,SetRight$3=SetRight_1,TopRight_1$1=function(gameObject,alignTo,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$3(gameObject,GetRight$4(alignTo)+offsetX),SetBottom$3(gameObject,GetTop$4(alignTo)-offsetY),gameObject},ALIGN_CONST$2=_const$d,AlignToMap=[];
7/**
8	 * @author       Richard Davey <[email protected]>
9	 * @copyright    2020 Photon Storm Ltd.
10	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
11	 */AlignToMap[ALIGN_CONST$2.BOTTOM_CENTER]=BottomCenter_1$1,AlignToMap[ALIGN_CONST$2.BOTTOM_LEFT]=BottomLeft_1$1,AlignToMap[ALIGN_CONST$2.BOTTOM_RIGHT]=BottomRight_1$1,AlignToMap[ALIGN_CONST$2.LE
11FT_BOTTOM]=LeftBottom_1,AlignToMap[ALIGN_CONST$2.LEFT_CENTER]=LeftCenter_1$1,AlignToMap[ALIGN_CONST$2.LEFT_TOP]=LeftTop_1,AlignToMap[ALIGN_CONST$2.RIGHT_BOTTOM]=RightBottom_1,AlignToMap[ALIGN_CONST$2.RIGHT_CENTER]=RightCenter_1$1,AlignToMap[ALIGN_CONST$2.RIGHT_TOP]=RightTop_1,AlignToMap[ALIGN_CONST$2.TOP_CENTER]=TopCenter_1$1,AlignToMap[ALIGN_CONST$2.TOP_LEFT]=TopLeft_1$1,AlignToMap[ALIGN_CONST$2.TOP_RIGHT]=TopRight_1$1;var QuickSet_1$1=function(child,alignTo,position,offsetX,offsetY){return AlignToMap[position](child,alignTo,offsetX,offsetY)},QuickSet$1=QuickSet_1$1,AlignTo_1=function(items,position,offsetX,offsetY){for(var target=items[0],i=1;i<items.length;i++){var item=items[i];QuickSet$1(item,target,position,offsetX,offsetY),target=item}return items},PropertyValueInc_1=function(items,key,value,step,index,direction){var i;void 0===step&&(step=0),void 0===index&&(index=0),void 0===direction&&(direction=1);var t=0,end=items.length;if(1===direction)for(i=index;i<end;i++)items[i][key]+=value+t*step,t++;else for(i=index;i>=0;i--)items[i][key]+=value+t*step,t++;return items},PropertyValueInc$8=PropertyValueInc_1,Angle_1$1=function(items,value,step,index,direction){return PropertyValueInc$8(items,"angle",value,step,index,direction)},Call_1=function(items,callback,context){for(var i=0;i<items.length;i++){var item=items[i];callback.call(context,item)}return items},GetFirst_1$1=function(items,compare,index){void 0===index&&(index=0);for(var i=index;i<items.length;i++){var item=items[i],match=!0;for(var property in compare)item[property]!==compare[property]&&(match=!1);if(match)return item}return null},GetLast_1=function(items,compare,index){void 0===index&&(index=0);for(var i=index;i<items.length;i++){var item=items[i],match=!0;for(var property in compare)item[property]!==compare[property]&&(match=!1);if(match)return item}return null},GetBottom$3=GetBottom_1,GetCenterX$2=GetCenterX_1,SetBottom$2=SetBottom_1,SetCenterX$2=SetCenterX_1,BottomCenter_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetCenterX$2(gameObject,GetCenterX$2(alignIn)+offsetX),SetBottom$2(gameObject,GetBottom$3(alignIn)+offsetY),gameObject},GetBottom$2=GetBottom_1,GetLeft$3=GetLeft_1,SetBottom$1=SetBottom_1,SetLeft$2=SetLeft_1,BottomLeft_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$2(gameObject,GetLeft$3(alignIn)-offsetX),SetBottom$1(gameObject,GetBottom$2(alignIn)+offsetY),gameObject},GetBottom$1=GetBottom_1,GetRight$3=GetRight_1,SetBottom=SetBottom_1,SetRight$2=SetRight_1,BottomRight_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$2(gameObject,GetRight$3(alignIn)+offsetX),SetBottom(gameObject,GetBottom$1(alignIn)+offsetY),gameObject},SetCenterX$1=SetCenterX_1,SetCenterY$2=SetCenterY_1,CenterOn_1$3=function(gameObject,x,y){return SetCenterX$1(gameObject,x),SetCenterY$2(gameObject,y)},CenterOn$5=CenterOn_1$3,GetCenterX$1=GetCenterX_1,GetCenterY$2=GetCenterY_1,Center_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),CenterOn$5(gameObject,GetCenterX$1(alignIn)+offsetX,GetCenterY$2(alignIn)+offsetY),gameObject},GetCenterY$1=GetCenterY_1,GetLeft$2=GetLeft_1,SetCenterY$1=SetCenterY_1,SetLeft$1=SetLeft_1,LeftCenter_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft$1(gameObject,GetLeft$2(alignIn)-offsetX),SetCenterY$1(gameObject,GetCenterY$1(alignIn)+offsetY),gameObject},GetCenterY=GetCenterY_1,GetRight$2=GetRight_1,SetCenterY=SetCenterY_1,SetRight$1=SetRight_1,RightCenter_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight$1(gameObject,GetRight$2(alignIn)+offsetX),SetCenterY(gameObject,GetCenterY(alignIn)+offsetY),gameObject},GetCenterX=GetCenterX_1,GetTop$3=GetTop_1,SetCenterX=SetCenterX_1,SetTop$2=SetTop_1,TopCenter_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetCenterX(gameObject,GetCenterX(alignIn)+offsetX),SetTop$2(gameObject,GetTop$3(alignIn)-offsetY),gameObject},GetLeft$1=GetLeft_1,GetTop$2=GetTop_1,SetLeft=SetLeft_1,SetTop$1=SetTop_1,TopLeft_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetLeft(gameObject,GetLeft$1(alignIn)-offsetX),SetTop$1(gameObject,GetTop$2(alignIn)-offsetY),gameObject},GetRight$1=GetRight_1,GetTop$1=GetTop_1,SetRight=SetRight_1,SetTop=SetTop_1,TopRight_1=function(gameObject,alignIn,offsetX,offsetY){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),SetRight(gameObject,GetRight$1(alignIn)+offsetX),SetTop(gameObject,GetTop$1(alignIn)-offsetY),gameObject},ALIGN_CONST$1=_const$d,AlignInMap=[];AlignInMap[ALIGN_CONST$1.BOTTOM_CENTER]=BottomCenter_1,AlignInMap[ALIGN_CONST$1.BOTTOM_LEFT]=BottomLeft_1,AlignInMap[ALIGN_CONST$1.BOTTOM_RIGHT]=BottomRight_1,AlignInMap[ALIGN_CONST$1.CENTER]=Center_1,AlignInMap[ALIGN_CONST$1.LEFT_CENTER]=LeftCenter_1,AlignInMap[ALIGN_CONST$1.RIGHT_CENTER]=RightCenter_1,AlignInMap[ALIGN_CONST$1.TOP_CENTER]=TopCenter_1,AlignInMap[ALIGN_CONST$1.TOP_LEFT]=TopLeft_1,AlignInMap[ALIGN_CONST$1.TOP_RIGHT]=TopRight_1,AlignInMap[ALIGN_CONST$1.LEFT_BOTTOM]=AlignInMap[ALIGN_CONST$1.BOTTOM_LEFT],AlignInMap[ALIGN_CONST$1.LEFT_TOP]=AlignInMap[ALIGN_CONST$1.TOP_LEFT],AlignInMap[ALIGN_CONST$1.RIGHT_BOTTOM]=AlignInMap[ALIGN_CONST$1.BOTTOM_RIGHT],AlignInMap[ALIGN_CONST$1.RIGHT_TOP]=AlignInMap[ALIGN_CONST$1.TOP_RIGHT];var QuickSet_1=function(child,alignIn,position,offsetX,offsetY){return AlignInMap[position](child,alignIn,offsetX,offsetY)},GetFastValue_1=function(source,key,defaultValue){var t=typeof source;return source&&"number"!==t&&"string"!==t&&source.hasOwnProperty(key)&&void 0!==source[key]?source[key]:defaultValue},NOOP_1=function(){};function getProperty(definition,k,isClassDescriptor){var def=isClassDescriptor?definition[k]:Object.getOwnPropertyDescriptor(definition,k);return!isClassDescriptor&&def.value&&"object"==typeof def.value&&(def=def.value),!(!def||!
12/**
13	 * @author       Richard Davey <[email protected]>
14	 * @copyright    2020 Photon Storm Ltd.
15	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
16	 */
17function(def){return!!def.get&&"function"==typeof def.get||!!def.set&&"function"==typeof def.set}(def))&&(void 0===def.enumerable&&(def.enumerable=!0),void 0===def.configurable&&(def.configurable=!0),def)}function hasNonConfigurable(obj,k){var prop=Object.getOwnPropertyDescriptor(obj,k);return!!prop&&(prop.value&&"object"==typeof prop.value&&(prop=prop.value),!1===prop.configurable)}function extend$1(ctor,definition,isClassDescriptor,extend){for(var k in definition)if(definition.hasOwnProperty(k)){var def=getProperty(definition,k,isClassDescriptor);if(!1!==def){if(hasNonConfigurable((extend||ctor).prototype,k)){if(Class$3z.ignoreFinals)continue;throw new Error("cannot override final property '"+k+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(ctor.prototype,k,def)}else ctor.prototype[k]=definition[k]}}function mixin(myClass,mixins){if(mixins){Array.isArray(mixins)||(mixins=[mixins]);for(var i=0;i<mixins.length;i++)extend$1(myClass,mixins[i].prototype||mixins[i])}}function Class$3z(definition){var initialize,Extends;if(definition||(definition={}),definition.initialize){if("function"!=typeof definition.initialize)throw new Error("initialize must be a function");initialize=definition.initialize,delete definition.initialize}else if(definition.Extends){var base=definition.Extends;initialize=function(){base.apply(this,arguments)}}else initialize=function(){};definition.Extends?(initialize.prototype=Object.create(definition.Extends.prototype),initialize.prototype.constructor=initialize,Extends=definition.Extends,delete definition.Extends):initialize.prototype.constructor=initialize;var mixins=null;return definition.Mixins&&(mixins=definition.Mixins,delete definition.Mixins),mixin(initialize,mixins),extend$1(initialize,definition,!0,Extends),initialize}Class$3z.extend=extend$1,Class$3z.mixin=mixin,Class$3z.ignoreFinals=!1;var Class_1=Class$3z,Contains_1$4=function(circle,x,y){return cir
17cle.radius>0&&x>=circle.left&&x<=circle.right&&y>=circle.top&&y<=circle.bottom&&(circle.x-x)*(circle.x-x)+(circle.y-y)*(circle.y-y)<=circle.radius*circle.radius},_const$c={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6},GEOM_CONST$7=_const$c,Point_1=new Class_1({initialize:function(x,y){void 0===x&&(x=0),void 0===y&&(y=x),this.type=GEOM_CONST$7.POINT,this.x=x,this.y=y},setTo:function(x,y){return void 0===x&&(x=0),void 0===y&&(y=x),this.x=x,this.y=y,this}}),Point$C=Point_1,CircumferencePoint_1$1=function(circle,angle,out){return void 0===out&&(out=new Point$C),out.x=circle.x+circle.radius*Math.cos(angle),out.y=circle.y+circle.radius*Math.sin(angle),out},Clamp_1=function(value,min,max){return Math.max(min,Math.min(max,value))},Clamp$k=Clamp_1,FromPercent_1=function(percent,min,max){return(max-min)*(percent=Clamp$k(percent,0,1))+min},_const$b={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991},CircumferencePoint$4=CircumferencePoint_1$1,FromPercent$3=FromPercent_1,MATH_CONST$j=_const$b,Point$B=Point_1,GetPoint_1$4=function(circle,position,out){void 0===out&&(out=new Point$B);var angle=FromPercent$3(position,0,MATH_CONST$j.PI2);return CircumferencePoint$4(circle,angle,out)},Circumference_1$1=function(circle){return Math.PI*circle.radius*2},Circumference$2=Circumference_1$1,CircumferencePoint$3=CircumferencePoint_1$1,FromPercent$2=FromPercent_1,MATH_CONST$i=_const$b,GetPoints_1$5=function(circle,quantity,stepRate,out){void 0===out&&(out=[]),!quantity&&stepRate>0&&(quantity=Circumference$2(circle)/stepRate);for(var i=0;i<quantity;i++){var angle=FromPercent$2(i/quantity,0,MATH_CONST$i.PI2);out.push(CircumferencePoint$3(circle,angle))}return out},Point$A=Point_1,Random_1$5=function(circle,out){void 0===out&&(out=new Point$A);var t=2*Math.PI*Math.random(),u=Math.random()+Math.random(),r=u>1?2-u:u,x=r*Math.cos(t),y=r*Math.sin(t);return out.x=circle.x+x*circle.radius,out.y=circle.y+y*circle.radius,out},Contains$i=Contains_1$4,GetPoint$9=GetPoint_1$4,GetPoints$b=GetPoints_1$5,GEOM_CONST$6=_const$c,Random$e=Random_1$5,Circle$7=new Class_1({initialize:function(x,y,radius){void 0===x&&(x=0),void 0===y&&(y=0),void 0===radius&&(radius=0),this.type=GEOM_CONST$6.CIRCLE,this.x=x,this.y=y,this._radius=radius,this._diameter=2*radius},contains:function(x,y){return Contains$i(this,x,y)},getPoint:function(position,point){return GetPoint$9(this,position,point)},getPoints:function(quantity,stepRate,output){return GetPoints$b(this,quantity,stepRate,output)},getRandomPoint:function(point){return Random$e(this,point)},setTo:function(x,y,radius){return this.x=x,this.y=y,this._radius=radius,this._diameter=2*radius,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(x,y){return void 0===y&&(y=x),this.x=x,this.y=y,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(value){this._radius=value,this._diameter=2*value}},diameter:{get:function(){return this._diameter},set:function(value){this._diameter=value,this._radius=.5*value}},left:{get:function(){return this.x-this._radius},set:function(value){this.x=value+this._radius}},right:{get:function(){return this.x+this._radius},set:function(value){this.x=value-this._radius}},top:{get:function(){return this.y-this._radius},set:function(value){this.y=value+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(value){this.y=value-this._radius}}}),Circle_1=Circle$7,Clamp$j=Clamp_1,Alpha_1={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(topLeft,topRight,bottomLeft,bottomRight){return void 0===topLeft&&(topLeft=1),void 0===topRight?this.alpha=topLeft:(this._alphaTL=Clamp$j(topLeft,0,1),this._alphaTR=Clamp$j(topRight,0,1),this._alphaBL=Clamp$j(bottomLeft,0,1),this._alphaBR=Clamp$j(bottomRight,0,1)),this},alpha:{get:function(){return this._alpha},set:function(value){var v=Clamp$j(value,0,1);this._alpha=v,this._alphaTL=v,this._alphaTR=v,this._alphaBL=v,this._alphaBR=v,0===v?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(value){var v=Clamp$j(value,0,1);this._alphaTL=v,0!==v&&(this.renderFlags|=2)}}
17,alphaTopRight:{get:function(){return this._alphaTR},set:function(value){var v=Clamp$j(value,0,1);this._alphaTR=v,0!==v&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(value){var v=Clamp$j(value,0,1);this._alphaBL=v,0!==v&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(value){var v=Clamp$j(value,0,1);this._alphaBR=v,0!==v&&(this.renderFlags|=2)}}},Clamp$i=Clamp_1,AlphaSingle_1={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(value){return void 0===value&&(value=1),this.alpha=value,this},alpha:{get:function(){return this._alpha},set:function(value){var v=Clamp$i(value,0,1);this._alpha=v,0===v?this.renderFlags&=-3:this.renderFlags|=2}}},BlendModes$7=BlendModes$8,BlendMode_1={_blendMode:BlendModes$7.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(value){"string"==typeof value&&(value=BlendModes$7[value]),(value|=0)>=-1&&(this._blendMode=value)}},setBlendMode:function(value){return this.blendMode=value,this}},ComputedSize_1={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(value){this.scaleX=value/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(value){this.scaleY=value/this.height}},setSize:function(width,height){return this.width=width,this.height=height,this},setDisplaySize:function(width,height){return this.displayWidth=width,this.displayHeight=height,this}},Crop_1={texture:null,frame:null,isCropped:!1,setCrop:function(x,y,width,height){if(void 0===x)this.isCropped=!1;else if(this.frame){if("number"==typeof x)this.frame.setCropUVs(this._crop,x,y,width,height,this.flipX,this.flipY);else{var rect=x;this.frame.setCropUVs(this._crop,rect.x,rect.y,rect.width,rect.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,
vendor: 5,963 bytes, lines 17-22
17ch:0}}},Depth_1={_depth:0,depth:{get:function(){return this._depth},set:function(value){this.displayList&&this.displayList.queueDepthSort(),this._depth=value}},setDepth:function(value){return void 0===value&&(value=0),this.depth=value,this}},Flip_1={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(value){return this.flipX=value,this},setFlipY:function(value){return this.flipY=value,this},setFlip:function(x,y){return this.flipX=x,this.flipY=y,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}},Contains_1$3=function(rect,x,y){return!(rect.width<=0||rect.height<=0)&&(rect.x<=x&&rect.x+rect.width>=x&&rect.y<=y&&rect.y+rect.height>=y)},Perimeter_1$2=function(rect){return 2*(rect.width+rect.height)},Perimeter$5=Perimeter_1$2,Point$z=Point_1,GetPoint_1$3=function(rectangle,position,out){if(void 0===out&&(out=new Point$z),position<=0||position>=1)return out.x=rectangle.x,out.y=rectangle.y,out;var p=Perimeter$5(rectangle)*position;return position>.5?(p-=rectangle.width+rectangle.height)<=rectangle.width?(out.x=rectangle.right-p,out.y=rectangle.bottom):(out.x=rectangle.x,out.y=rectangle.bottom-(p-rectangle.width)):p<=rectangle.width?(out.x=rectangle.x+p,out.y=rectangle.y):(out.x=rectangle.right,out.y=rectangle.y+(p-rectangle.width)),out},GetPoint$7=GetPoint_1$3,Perimeter$4=Perimeter_1$2,GetPoints_1$4=function(rectangle,quantity,stepRate,out){void 0===out&&(out=[]),!quantity&&stepRate>0&&(quantity=Perimeter$4(rectangle)/stepRate);for(var i=0;i<quantity;i++){var position=i/quantity;out.push(GetPoint$7(rectangle,position))}return out},Point$y=Point_1,GetPoint_1$2=function(line,position,out){return void 0===out&&(out=new Point$y),out.x=line.x1+(line.x2-line.x1)*position,out.y=line.y1+(line.y2-line.y1)*position,out},Length_1=function(line){return Math.sqrt((line.x2-line.x1)*(line.x2-line.x1)+(line.y2-line.y1)*(line.y2-line.y1))},Length$6=Length_1,Point$x=Point_1,GetPoints_1$3=function(line,quantity,stepRate,out){void 0===out&&(out=[]),!quantity&&stepRate>0&&(quantity=Length$6(line)/stepRate);for(var x1=line.x1,y1=line.y1,x2=line.x2,y2=line.y2,i=0;i<quantity;i++){var position=i/quantity,x=x1+(x2-x1)*position,y=y1+(y2-y1)*position;out.push(new Point$x(x,y))}return out},Point$w=Point_1,Random_1$4=function(line,out){void 0===out&&(out=new Point$w);var t=Math.random();return out.x=line.x1+t*(line.x2-line.x1),out.y=line.y1+t*(line.y2-line.y1),out},Equal_1=function(a,b,epsilon){return void 0===epsilon&&(epsilon=1e-4),Math.abs(a-b)<epsilon},FuzzyEqual$2=Equal_1,Vector2$U=new Class_1({initialize:function(x,y){this.x=0,this.y=0,"object"==typeof x?(this.x=x.x||0,this.y=x.y||0):(void 0===y&&(y=x),this.x=x||0,this.y=y||0)},clone:function(){return new Vector2$U(this.x,this.y)},copy:function(src){return this.x=src.x||0,this.y=src.y||0,this},setFromObject:function(obj){return this.x=obj.x||0,this.y=obj.y||0,this},set:function(x,y){return void 0===y&&(y=x),this.x=x,this.y=y,this},setTo:function(x,y){return this.set(x,y)},setToPolar:function(azimuth,radius){return null==radius&&(radius=1),this.x=Math.cos(azimuth)*radius,this.y=Math.sin(azimuth)*radius,this},equals:function(v){return this.x===v.x&&this.y===v.y},fuzzyEquals:function(v,epsilon){return FuzzyEqual$2(this.x,v.x,epsilon)&&FuzzyEqual$2(this.y,v.y,epsilon)},angle:function(){var angle=Math.atan2(this.y,this.x);return angle<0&&(angle+=2*Math.PI),angle},setAngle:function(angle){return this.setToPolar(angle,this.length())},add:function(src){return this.x+=src.x,this.y+=src.y,this},subtract:function(src){return this.x-=src.x,this.y-=src.y,this},multiply:function(src){return this.x*=src.x,this.y*=src.y,this},scale:function(value){return isFinite(value)?(this.x*=value,this.y*=value):(this.x=0,this.y=0),this},divide:function(src){return this.x/=src.x,this.y/=src.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(src){var dx=src.x-this.x,dy=src.y-this.y;return Math.sqrt(dx*dx+dy*dy)},distanceSq:function(src){var dx=src.x-this.x,dy=src.y-this.y;return dx*dx+dy*dy},length:function(){var x=this.x,y=this.y;return Math.sqrt(x*x+y*y)},setLength:function(length){return this.normalize().scale(length)},lengthSq:function(){var x=this.x,y=this.y;return x*x+y*y},normalize:function(){var x=this.x,y=this.y,len=x*x+y*y;return len>0&&(len=1/Math.sqrt(len),this.x=x*len,this.y=y*len),this},normalizeRightHand:function(){var x=this.x;return this.x=-1*this.y,this.y=x,this},normalizeLeftHand:function(){var x=this.x;return this.x=this.y,this.y=-1*x,this},dot:function(src){return this.x*src.x+this.y*src.y},cross:function(src){return this.x*src.y-this.y*src.x},lerp:function(src,t){void 0===t&&(t=0);var ax=this.x,ay=this.y;return this.x=ax+t*(src.x-ax),this.y=ay+t*(src.y-ay),this},transformMat3:function(mat){var x=this.x,y=this.y,m=mat.val;return this.x=m[0]*x+m[3]*y+m[6],this.y=m[1]*x+m[4]*y+m[7],this},transformMat4:function(mat){var x=this.x,y=this.y,m=mat.val;return this.x=m[0]*x+m[4]*y+m[12],this.y=m[1]*x+m[5]*y+m[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(max){var len=this.length();return len&&len>max&&this.scale(max/len),this},reflect:function(normal){return normal=normal.clone().normalize(),this.subtract(normal.scale(2*this.dot(normal)))},mirror:function(axis){return this.reflect(axis).negate()},rotate:function(delta){var cos=Math.cos(delta),sin=Math.sin(delta);return this.set(cos*this.x-sin*this.y,sin*this.x+cos*this.y)}});
18/**
19	 * @author       Richard Davey <[email protected]>
20	 * @copyright    2020 Photon Storm Ltd.
21	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
22	 */Vector2$U.ZERO=new Vector2$U,Vector2$U.RIGHT=new Vector2$U(1,0),Vector2$U.LEFT=new Vector2$U(-1,0),Vector2$U.UP=new Vector2$U(0,-1),Vector2$U.DOWN=new Vector2$U(0,1),Vector2$U.ONE=new Vector2$U(1,1);var Vector2_1=Vector2$U,GetPoint$5=GetPoint_1$2,GetPoints$8=GetPoints_1$3,G
22EOM_CONST$5=_const$c,Random$c=Random_1$4,Vector2$T=Vector2_1,Line$b=new Class_1({initialize:function(x1,y1,x2,y2){void 0===x1&&(x1=0),void 0===y1&&(y1=0),void 0===x2&&(x2=0),void 0===y2&&(y2=0),this.type=GEOM_CONST$5.LINE,this.x1=x1,this.y1=y1,this.x2=x2,this.y2=y2},getPoint:function(position,output){return GetPoint$5(this,position,output)},getPoints:function(quantity,stepRate,output){return GetPoints$8(this,quantity,stepRate,output)},getRandomPoint:function(point){return Random$c(this,point)},setTo:function(x1,y1,x2,y2){return void 0===x1&&(x1=0),void 0===y1&&(y1=0),void 0===x2&&(x2=0),void 0===y2&&(y2=0),this.x1=x1,this.y1=y1,this.x2=x2,this.y2=y2,this},getPointA:function(vec2){return void 0===vec2&&(vec2=new Vector2$T),vec2.set(this.x1,this.y1),vec2},getPointB:function(vec2){return void 0===vec2&&(vec2=new Vector2$T),vec2.set(this.x2,this.y2),vec2},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(value){this.x1<=this.x2?this.x1=value:this.x2=value}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(value){this.x1>this.x2?this.x1=value:this.x2=value}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(value){this.y1<=this.y2?this.y1=value:this.y2=value}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(value){this.y1>this.y2?this.y1=value:this.y2=value}}}),Line_1$1=Line$b,Point$v=Point_1,Random_1$3=function(rect,out){return void 0===out&&(out=new Point$v),out.x=rect.x+Math.random()*rect.width,out.y=rect.y+Math.random()*rect.height,out},Contains$g=Contains_1$3,GetPoint$4=GetPoint_1$3,GetPoints$7=GetPoints_1$4,GEOM_CONST$4=_const$c,Line$a=Line_1$1,Random$a=Random_1$3,Rectangle$v=new Class_1({initialize:function(x,y,width,height){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=0),void 0===height&&(height=0),this.type=GEOM_CONST$4.RECTANGLE,this.x=x,this.y=y,this.width=width,this.height=height},contains:function(x,y){return Contains$g(this,x,y)},getPoint:function(position,output){return GetPoint$4(this,position,output)},getPoints:function(quantity,stepRate,output){return GetPoints$7(this,quantity,stepRate,output)},getRandomPoint:function(point){return Random$a(this,point)},setTo:function(x,y,width,height){return this.x=x,this.y=y,this.width=width,this.height=height,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(x,y){return void 0===y&&(y=x),this.x=x,this.y=y,this},setSize:function(width,height){return void 0===height&&(height=width),this.width=width,this.height=height,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(line){return void 0===line&&(line=new Line$a),line.setTo(this.x,this.y,this.right,this.y),line},getLineB:function(line){return void 0===line&&(line=new Line$a),line.setTo(this.right,this.y,this.right,this.bottom),line},getLineC:function(line){return void 0===line&&(line=new Line$a),line.setTo(this.right,this.bottom,this.x,this.bottom),line},getLineD:function(line){return void 0===line&&(line=new Line$a),line.setTo(this.x,this.bottom,this.x,this.y),line},left:{get:function(){return this.x},set:function(value){value>=this.right?this.width=0:this.width=this.right-value,this.x=value}},right:{get:function(){return this.x+this.width},set:function(value){value<=this.x?this.width=0:this.width=value-this.x}},top:{get:function(){return this.y},set:function(value){value>=this.bottom?this.height=0:this.height=this.bottom-value,this.y=value}},bottom:{get:function(){return this.y+this.height},set:function(value){value<=this.y?this.height=0:this.height=value-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(value){this.x=value-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(value){this.y=value-this.height/2}}}),Rectangle_1$1=Rectangle$v,RotateAround_1$1=function(point,x,y,angle){var c=Math.cos(angle),s=Math.sin(angle),tx=point.x-x,ty=point.y-y;return point.x=tx*c-ty*s+x,point.y=tx*s+ty*c+y,point},Rectangle$u=Rectangle_1$1,RotateAround$1=RotateAround_1$1,Vector2$S=Vector2_1,GetBounds_1$3={prepareBoundsOutput:function(output,includeParent){(void 0===includeParent&&(includeParent=!1),0!==this.rotation&&RotateAroun
22d$1(output,this.x,this.y,this.rotation),includeParent&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(output.x,output.y,output);return output},getCenter:function(output){return void 0===output&&(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,output.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,output},getTopLeft:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX,output.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(output,includeParent)},getTopCenter:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,output.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(output,includeParent)},getTopRight:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX+this.displayWidth,output.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(output,includeParent)},getLeftCenter:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX,output.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(output,includeParent)},getRightCenter:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX+this.displayWidth,output.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(output,includeParent)},getBottomLeft:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX,output.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(output,includeParent)},getBottomCenter:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,output.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(output,includeParent)},getBottomRight:function(output,includeParent){return output||(output=new Vector2$S),output.x=this.x-this.displayWidth*this.originX+this.displayWidth,output.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(output,includeParent)},getBounds:function(output){var TLx,TLy,TRx,TRy,BLx,BLy,BRx,BRy;if(void 0===output&&(output=new Rectangle$u),this.parentContainer){var parentMatrix=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(output),parentMatrix.transformPoint(output.x,output.y,output),TLx=output.x,TLy=output.y,this.getTopRight(output),parentMatrix.transformPoint(output.x,output.y,output),TRx=output.x,TRy=output.y,this.getBottomLeft(output),parentMatrix.transformPoint(output.x,output.y,output),BLx=output.x,BLy=output.y,this.getBottomRight(output),parentMatrix.transformPoint(output.x,output.y,output),BRx=output.x,BRy=output.y}else this.getTopLeft(output),TLx=output.x,TLy=output.y,this.getTopRight(output),TRx=output.x,TRy=output.y,this.getBottomLeft(output),BLx=output.x,BLy=output.y,this.getBottomRight(output),BRx=output.x,BRy=output.y;return output.x=Math.min(TLx,TRx,BLx,BRx),output.y=Math.min(TLy,TRy,BLy,BRy),output.width=Math.max(TLx,TRx,BLx,BRx)-output.x,output.height=Math.max(TLy,TRy,BLy,BRy)-output.y,output}},events$k={BLUR:"blur",BOOT:"boot",CONTEXT_LOST:"contextlost",CONTEXT_RESTORED:"contextrestored",DESTROY:"destroy",FOCUS:"focus",HIDDEN:"hidden",PAUSE:"pause",POST_RENDER:"postrender",POST_STEP:"poststep",PRE_RENDER:"prerender",PRE_STEP:"prestep",READY:"ready",RESUME:"resume",STEP:"step",VISIBLE:"visible"},events$j={POST_RENDER:"postrender",PRE_RENDER:"prerender",RENDER:"render",RESIZE:"resize"},GameEvents$f=events$k,RenderEvents=events$j,BitmapMask$1=new Class_1({initialize:function(scene,renderable){var renderer=scene.sys.renderer;this.renderer=renderer,this.bitmapMask=renderable,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.createMask(),scene.sys.game.events.on(GameEvents$f.CONTEXT_RESTORED,this.createMask,this),renderer&&renderer.on(RenderEvents.RESIZE,this.createMask,this)},createMask:function(){var renderer=this.renderer;if(renderer&&renderer.gl){this.mainTexture&&this.clearMask();var width=renderer.width,height=renderer.height,pot=0==(width&width-1)&&0==(height&height-1),gl=renderer.gl,
22wrap=pot?gl.REPEAT:gl.CLAMP_TO_EDGE,filter=gl.LINEAR;this.mainTexture=renderer.createTexture2D(0,filter,filter,wrap,wrap,gl.RGBA,null,width,height),this.maskTexture=renderer.createTexture2D(0,filter,filter,wrap,wrap,gl.RGBA,null,width,height),this.mainFramebuffer=renderer.createFramebuffer(width,height,this.mainTexture,!0),this.maskFramebuffer=renderer.createFramebuffer(width,height,this.maskTexture,!0)}},clearMask:function(){var renderer=this.renderer;renderer&&renderer.gl&&this.mainTexture&&(renderer.deleteTexture(this.mainTexture),renderer.deleteTexture(this.maskTexture),renderer.deleteFramebuffer(this.mainFramebuffer),renderer.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(renderable){this.bitmapMask=renderable},preRenderWebGL:function(renderer,maskedObject,camera){renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this,maskedObject,camera)},postRenderWebGL:function(renderer,camera){renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this,camera)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.renderer&&this.renderer.off(RenderEvents.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}}),BitmapMask_1=BitmapMask$1,GeometryMask$1=new Class_1({initialize:function(scene,graphicsGeometry){this.geometryMask=graphicsGeometry,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(graphicsGeometry){return this.geometryMask=graphicsGeometry,this},setInvertAlpha:function(value){return void 0===value&&(value=!0),this.invertAlpha=value,this},preRenderWebGL:function(renderer,child,camera){var gl=renderer.gl;renderer.flush(),0===renderer.maskStack.length&&(gl.enable(gl.STENCIL_TEST),gl.clear(gl.STENCIL_BUFFER_BIT),renderer.maskCount=0),renderer.currentCameraMask.mask!==this&&(renderer.currentMask.mask=this),renderer.maskStack.push({mask:this,camera:camera}),this.applyStencil(renderer,camera,!0),renderer.maskCount++},applyStencil:function(renderer,camera,inc){var gl=renderer.gl,geometryMask=this.geometryMask,level=renderer.maskCount;gl.colorMask(!1,!1,!1,!1),inc?(gl.stencilFunc(gl.EQUAL,level,255),gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR)):(gl.stencilFunc(gl.EQUAL,level+1,255),gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR)),geometryMask.renderWebGL(renderer,geometryMask,camera),renderer.flush(),gl.colorMask(!0,!0,!0,!0),gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP),inc?this.invertAlpha?gl.stencilFunc(gl.NOTEQUAL,level+1,255):gl.stencilFunc(gl.EQUAL,level+1,255):this.invertAlpha?gl.stencilFunc(gl.NOTEQUAL,level,255):gl.stencilFunc(gl.EQUAL,level,255)},postRenderWebGL:function(renderer){var gl=renderer.gl;renderer.maskStack.pop(),renderer.maskCount--,renderer.flush();var current=renderer.currentMask;if(0===renderer.maskStack.length)current.mask=null,gl.disable(gl.STENCIL_TEST);else{var prev=renderer.maskStack[renderer.maskStack.length-1];prev.mask.applyStencil(renderer,prev.camera,!1),renderer.currentCameraMask.mask!==prev.mask?(current.mask=prev.mask,current.camera=prev.camera):current.mask=null}},preRenderCanvas:function(renderer,mask,camera){var geometryMask=this.geometryMask;renderer.currentContext.save(),geometryMask.renderCanvas(renderer,geometryMask,camera,null,null,!0),renderer.currentContext.clip()},postRenderCanvas:function(renderer){renderer.currentContext.restore()},destroy:function(){this.geometryMask=null}}),GeometryMask_1=GeometryMask$1,BitmapMask=BitmapMask_1,GeometryMask=GeometryMask_1,Mask={mask:null,setMask:function(mask){return this.mask=mask,this},clearMask:function(destroyMask){return void 0===destroyMask&&(destroyMask=!1),destroyMask&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(renderable){return void 0===renderable&&(this.texture||this.shader)&&(renderable=this),new BitmapMask(this.scene,renderable)},createGeometryMask:function(graphics){return void 0===graphics&&"Graphics"===this.type&&(graphics=this),new GeometryMask(this.scene,graphics)}},Mask_1=Mask,Origin_1={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX}
22,set:function(value){this._displayOriginX=value,this.originX=value/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(value){this._displayOriginY=value,this.originY=value/this.height}},setOrigin:function(x,y){return void 0===x&&(x=.5),void 0===y&&(y=x),this.originX=x,this.originY=y,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(x,y){return void 0===x&&(x=0),void 0===y&&(y=x),this.displayOriginX=x,this.displayOriginY=y,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}},CONST$1f=_const$b,DegToRad_1=function(degrees){return degrees*CONST$1f.DEG_TO_RAD},GetBoolean_1=function(source,key,defaultValue){return source&&source.hasOwnProperty(key)?source[key]:defaultValue},GetValue_1=function(source,key,defaultValue){if(source&&"number"!=typeof source){if(source.hasOwnProperty(key))return source[key];if(-1!==key.indexOf(".")){for(var keys=key.split("."),parent=source,value=defaultValue,i=0;i<keys.length;i++){if(!parent.hasOwnProperty(keys[i])){value=defaultValue;break}value=parent[keys[i]],parent=parent[keys[i]]}return value}return defaultValue}return defaultValue}
vendor: 3,823 bytes, line 22
22,_const$a={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26},DegToRad$9=DegToRad_1,GetBoolean$3=GetBoolean_1,GetValue$z=GetValue_1,TWEEN_CONST$3=_const$a,Vector2$R=Vector2_1,PathFollower_1$1={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:TWEEN_CONST$3.PLAYING_FORWARD,setPath:function(path,config){void 0===config&&(config=this.pathConfig);var tween=this.pathTween;return tween&&tween.isPlaying()&&tween.stop(),this.path=path,config&&this.startFollow(config),this},setRotateToPath:function(value,offset){return void 0===offset&&(offset=0),this.rotateToPath=value,this.pathRotationOffset=offset,this},isFollowing:function(){var tween=this.pathTween;return tween&&tween.isPlaying()},startFollow:function(config,startAt){void 0===config&&(config={}),void 0===startAt&&(startAt=0);var tween=this.pathTween;tween&&tween.isPlaying()&&tween.stop(),"number"==typeof config&&(config={duration:config}),config.from=GetValue$z(config,"from",0),config.to=GetValue$z(config,"to",1);var positionOnPath=GetBoolean$3(config,"positionOnPath",!1);this.rotateToPath=GetBoolean$3(config,"rotateToPath",!1),this.pathRotationOffset=GetValue$z(config,"rotationOffset",0);var seek=GetValue$z(config,"startAt",startAt);if(seek&&(config.onStart=function(tween){var tweenData=tween.data[0];tweenData.progress=seek,tweenData.elapsed=tweenData.duration*seek;var v=tweenData.ease(tweenData.progress);tweenData.current=tweenData.start+(tweenData.end-tweenData.start)*v,tweenData.target[tweenData.key]=tweenData.current}),this.pathOffset||(this.pathOffset=new Vector2$R(this.x,this.y)),this.pathVector||(this.pathVector=new Vector2$R),this.pathDelta||(this.pathDelta=new Vector2$R),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(config),this.path.getStartPoint(this.pathOffset),positionOnPath&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=TWEEN_CONST$3.PLAYING_FORWARD,this.rotateToPath){var nextPoint=this.path.getPoint(.1);this.rotation=Math.atan2(nextPoint.y-this.y,nextPoint.x-this.x)+DegToRad$9(this.pathRotationOffset)}return this.pathConfig=config,this},pauseFollow:function(){var tween=this.pathTween;return tween&&tween.isPlaying()&&tween.pause(),this},resumeFollow:function(){var tween=this.pathTween;return tween&&tween.isPaused()&&tween.resume(),this},stopFollow:function(){var tween=this.pathTween;return tween&&tween.isPlaying()&&tween.stop(),this},pathUpdate:function(){var tween=this.pathTween;if(tween){var tweenData=tween.data[0],pathDelta=this.pathDelta,pathVector=this.pathVector;if(pathDelta.copy(pathVector).negate(),tweenData.state===TWEEN_CONST$3.COMPLETE)return this.path.getPoint(1,pathVector),pathDelta.add(pathVector),pathVector.add(this.pathOffset),void this.setPosition(pathVector.x,pathVector.y);if(tweenData.state!==TWEEN_CONST$3.PLAYING_FORWARD&&tweenData.state!==TWEEN_CONST$3.PLAYING_BACKWARD)return;this.path.getPoint(tween.getValue(),pathVector),pathDelta.add(pathVector),pathVector.add(this.pathOffset);var oldX=this.x,oldY=this.y;this.setPosition(pathVector.x,pathVector.y);var speedX=this.x-oldX,speedY=this.y-oldY;if(0===speedX&&0===speedY)return;if(tweenData.state!==this._prevDirection)return void(this._prevDirection=tweenData.state);this.rotateToPath&&(this.rotation=Math.atan2(speedY,speedX)+DegToRad$9(this.pathRotationOffset))}}},DeepCopy$2=function(inObject){var outObject,value,key;if("object"!=typeof inObject||null===inObject)return inObject;for(key in outObject=Array.isArray(inObject)?[]:{}
22,inObject)value=inObject[key],outObject[key]=DeepCopy$2(value);return outObject},DeepCopy_1=DeepCopy$2,_const$9={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"},SpliceOne_1=function(array,index){if(!(index>=array.length)){for(var len=array.length-1,item=array[index],i=index;i<len;i++)array[i]=array[i+1];return array.length=len,item}},DeepCopy$1=DeepCopy_1,PIPELINE_CONST$2=_const$9,SpliceOne$5=SpliceOne_1,Pipeline$2={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(pipeline){void 0===pipeline&&(pipeline=PIPELINE_CONST$2.MULTI_PIPELINE);var renderer=this.scene.sys.renderer;if(!renderer)return!1;var pipelines=renderer.pipelines;if(this.postPipelines=[],this.pipelineData={},pipelines){var instance=pipelines.get(pipeline);if(instance)return this.defaultPipeline=instance,this.pipeline=instance,!0}return!1},setPipeline:function(pipeline,pipelineData,copyData){var renderer=this.scene.sys.renderer;if(!renderer)return this;var pipelines=renderer.pipelines;if(pipelines){var instance=pipelines.get(pipeline);instance&&(this.pipeline=instance),pipelineData&&(this.pipelineData=copyData?DeepCopy$1(pipelineData):pipelineData)}return this},setPostPipeline:function(pipelines,pipelineData,copyData){var renderer=this.scene.sys.renderer;if(!renderer)return this;var pipelineManager=renderer.pipelines;if(pipelineManager){Array.isArray(pipelines)||(pipelines=[pipelines]);for(var i=0;i<pipelines.length;i++){var instance=pipelineManager.getPostPipeline(pipelines[i],this);instance&&this.postPipelines.push(instance)}pipelineData&&(this.pipelineData=copyData?DeepCopy$1(pipelineData):pipelineData)}return this.hasPostPipeline=this.postPipelines.length>0,this},setPipelineData:function(key,value){var data=this.pipelineData;return void 0===value?delete data[key]:data[key]=value,this},getPostPipeline:function(pipeline){for(var pipelines=this.postPipelines,results=[],i=0;i<pipelines.length;i++){var instance=pipelines[i];("string"==typeof pipeline&&instance.name===pipeline||instance instanceof pipeline)&&results.push(instance)}return 1===results.length?results[0]:results},resetPipeline:function(resetPostPipelines,resetData){return void 0===resetPostPipelines&&(resetPostPipelines=!1),void 0===resetData&&(resetData=!1),this.pipeline=this.defaultPipeline,resetPostPipelines&&(this.postPipelines=[],this.hasPostPipeline=!1),resetData&&(this.pipelineData={}),null!==this.pipeline},resetPostPipeline:function(resetData){void 0===resetData&&(resetData=!1);for(var pipelines=this.postPipelines,i=0;i<pipelines.length;i++)pipelines[i].destroy();this.postPipelines=[],this.hasPostPipeline=!1,resetData&&(this.pipelineData={})},removePostPipeline:function(pipeline){for(var pipelines=this.postPipelines,i=pipelines.length-1;i>=0;i--){var instance=pipelines[i];("string"==typeof pipeline&&instance.name===pipeline||"string"!=typeof pipeline&&instance instanceof pipeline)&&(instance.destroy(),SpliceOne$5(pipelines,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}},Pipeline_1=Pipeline$2,ScrollFactor_1={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(x,y){return void 0===y&&(y=x),this.scrollFactorX=x,this.scrollFactorY=y,this}},Size_1$2={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(value){this.scaleX=value/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(value){this.scaleY=value/this.frame.realHeight}},setSizeToFrame:function(frame){return void 0===frame&&(frame=this.frame),this.width=frame.realWidth,this.height=frame.realHeight,this},setSize:function(width,height){return this.width=width,this.height=height,this},setDisplaySize:function(width,height){return this.displayWidth=width,this.displayHeight=height,this}},Texture$3={texture:null,frame:null,isCropped:!1,setTexture:function(key,frame){return this.texture=this.scene.sys.textures.get(key),this.setFrame
22(frame)},setFrame:function(frame,updateSize,updateOrigin){return void 0===updateSize&&(updateSize=!0),void 0===updateOrigin&&(updateOrigin=!0),this.frame=this.texture.get(frame),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&updateSize&&this.setSizeToFrame(),this._originComponent&&updateOrigin&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}},Texture_1$1=Texture$3,TextureCrop={texture:null,frame:null,isCropped:!1,setCrop:function(x,y,width,height){if(void 0===x)this.isCropped=!1;else if(this.frame){if("number"==typeof x)this.frame.setCropUVs(this._crop,x,y,width,height,this.flipX,this.flipY);else{var rect=x;this.frame.setCropUVs(this._crop,rect.x,rect.y,rect.width,rect.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(key,frame){return this.texture=this.scene.sys.textures.get(key),this.setFrame(frame)},setFrame:function(frame,updateSize,updateOrigin){return void 0===updateSize&&(updateSize=!0),void 0===updateOrigin&&(updateOrigin=!0),this.frame=this.texture.get(frame),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&updateSize&&this.setSizeToFrame(),this._originComponent&&updateOrigin&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,
22ch:0}}},TextureCrop_1=TextureCrop,Tint_1={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(topLeft,topRight,bottomLeft,bottomRight){return void 0===topLeft&&(topLeft=16777215),void 0===topRight&&(topRight=topLeft,bottomLeft=topLeft,bottomRight=topLeft),this.tintTopLeft=topLeft,this.tintTopRight=topRight,this.tintBottomLeft=bottomLeft,this.tintBottomRight=bottomRight,this.tintFill=!1,this},setTintFill:function(topLeft,topRight,bottomLeft,bottomRight){return this.setTint(topLeft,topRight,bottomLeft,bottomRight),this.tintFill=!0,this},tint:{set:function(value){this.setTint(value,value,value,value)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}},ToJSON_1=function(gameObject){var out={name:gameObject.name,type:gameObject.type,x:gameObject.x,y:gameObject.y,depth:gameObject.depth,scale:{x:gameObject.scaleX,y:gameObject.scaleY},origin:{x:gameObject.originX,y:gameObject.originY},flipX:gameObject.flipX,flipY:gameObject.flipY,rotation:gameObject.rotation,alpha:gameObject.alpha,visible:gameObject.visible,blendMode:gameObject.blendMode,textureKey:"",frameKey:"",data:{}};return gameObject.texture&&(out.textureKey=gameObject.texture.key,out.frameKey=gameObject.frame.name),out},MATH_CONST$h=_const$b,Vector2$Q=Vector2_1,TransformMatrix$g=new Class_1({initialize:function(a,b,c,d,tx,ty){void 0===a&&(a=1),void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=1),void 0===tx&&(tx=0),void 0===ty&&(ty=0),this.matrix=new Float32Array([a,b,c,d,tx,ty,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(value){this.matrix[0]=value}},b:{get:function(){return this.matrix[1]},set:function(value){this.matrix[1]=value}},c:{get:function(){return this.matrix[2]},set:function(value){this.matrix[2]=value}},d:{get:function(){return this.matrix[3]},set:function(value){this.matrix[3]=value}},e:{get:function(){return this.matrix[4]},set:function(value){this.matrix[4]=value}},f:{get:function(){return this.matrix[5]},set:function(value){this.matrix[5]=value}},tx:{get:function(){return this.matrix[4]},set:function(value){this.matrix[4]=value}},ty:{get:function(){return this.matrix[5]},set:function(value){this.matrix[5]=value}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var matrix=this.matrix,a=matrix[0],b=matrix[1],c=matrix[2],d=matrix[3];return a||b?b>0?Math.acos(a/this.scaleX):-Math.acos(a/this.scaleX):c||d?MATH_CONST$h.TAU-(d>0?Math.acos(-c/this.scaleY):-Math.acos(c/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var matrix=this.matrix;return matrix[0]=1,matrix[1]=0,matrix[2]=0,matrix[3]=1,matrix[4]=0,matrix[5]=0,this},translate:function(x,y){var matrix=this.matrix;return matrix[4]=matrix[0]*x+matrix[2]*y+matrix[4],matrix[5]=matrix[1]*x+matrix[3]*y+matrix[5],this},scale:function(x,y){var matrix=this.matrix;return matrix[0]*=x,matrix[1]*=x,matrix[2]*=y,matrix[3]*=y,this},rotate:function(angle){var sin=Math.sin(angle),cos=Math.cos(angle),matrix=this.matrix,a=matrix[0],b=matrix[1],c=matrix[2],d=matrix[3];return matrix[0]=a*cos+c*sin,matrix[1]=b*cos+d*sin,matrix[2]=a*-sin+c*cos,matrix[3]=b*-sin+d*cos,this},multiply:function(rhs,out){var matrix=this.matrix,source=rhs.matrix,localA=matrix[0],localB=matrix[1],localC=matrix[2],localD=matrix[3],localE=matrix[4],localF=matrix[5],sourceA=source[0],sourceB=source[1],sourceC=source[2],sourceD=source[3],sourceE=source[4],sourceF=source[5],destinationMatrix=void 0===out?this:out;return destinationMatrix.a=sourceA*localA+sourceB*localC,destinationMatrix.b=sourceA*localB+sourceB*localD,destinationMatrix.c=sourceC*localA+sourceD*localC,destinationMatrix.d=sourceC*localB+sourceD*localD,destinationMatrix.e=sourceE*localA+sourceF*localC+localE,destinationMatrix.f=sourceE*localB+sourceF*localD+localF,destinationMatrix},multiplyWithOffset:function(src,offsetX,offsetY){var matrix=this.matrix,otherMatrix=src.matrix,a0=matrix[0],b0=matrix[1],c0=matrix[2],d0=matrix[3],pse=offsetX*a0+offsetY*c0+matrix[4],psf=offsetX*b0+offsetY*d0+matrix[5],a1=otherMatrix[0],b1=otherMatrix[1],c1=otherMatrix[2],d1=otherMatrix[3],tx1=otherMatrix[4],t
vendor: 19,125 bytes, lines 22-33
22y1=otherMatrix[5];return matrix[0]=a1*a0+b1*c0,matrix[1]=a1*b0+b1*d0,matrix[2]=c1*a0+d1*c0,matrix[3]=c1*b0+d1*d0,matrix[4]=tx1*a0+ty1*c0+pse,matrix[5]=tx1*b0+ty1*d0+psf,this},transform:function(a,b,c,d,tx,ty){var matrix=this.matrix,a0=matrix[0],b0=matrix[1],c0=matrix[2],d0=matrix[3],tx0=matrix[4],ty0=matrix[5];return matrix[0]=a*a0+b*c0,matrix[1]=a*b0+b*d0,matrix[2]=c*a0+d*c0,matrix[3]=c*b0+d*d0,matrix[4]=tx*a0+ty*c0+tx0,matrix[5]=tx*b0+ty*d0+ty0,this},transformPoint:function(x,y,point){void 0===point&&(point={x:0,y:0});var matrix=this.matrix,a=matrix[0],b=matrix[1],c=matrix[2],d=matrix[3],tx=matrix[4],ty=matrix[5];return point.x=x*a+y*c+tx,point.y=x*b+y*d+ty,point},invert:function(){var matrix=this.matrix,a=matrix[0],b=matrix[1],c=matrix[2],d=matrix[3],tx=matrix[4],ty=matrix[5],n=a*d-b*c;return matrix[0]=d/n,matrix[1]=-b/n,matrix[2]=-c/n,matrix[3]=a/n,matrix[4]=(c*ty-d*tx)/n,matrix[5]=-(a*ty-b*tx)/n,this},copyFrom:function(src){var matrix=this.matrix;return matrix[0]=src.a,matrix[1]=src.b,matrix[2]=src.c,matrix[3]=src.d,matrix[4]=src.e,matrix[5]=src.f,this},copyFromArray:function(src){var matrix=this.matrix;return matrix[0]=src[0],matrix[1]=src[1],matrix[2]=src[2],matrix[3]=src[3],matrix[4]=src[4],matrix[5]=src[5],this},copyToContext:function(ctx){var matrix=this.matrix;return ctx.transform(matrix[0],matrix[1],matrix[2],matrix[3],matrix[4],matrix[5]),ctx},setToContext:function(ctx){var matrix=this.matrix;return ctx.setTransform(matrix[0],matrix[1],matrix[2],matrix[3],matrix[4],matrix[5]),ctx},copyToArray:function(out){var matrix=this.matrix;return void 0===out?out=[matrix[0],matrix[1],matrix[2],matrix[3],matrix[4],matrix[5]]:(out[0]=matrix[0],out[1]=matrix[1],out[2]=matrix[2],out[3]=matrix[3],out[4]=matrix[4],out[5]=matrix[5]),out},setTransform:function(a,b,c,d,tx,ty){var matrix=this.matrix;return matrix[0]=a,matrix[1]=b,matrix[2]=c,matrix[3]=d,matrix[4]=tx,matrix[5]=ty,this},decomposeMatrix:function(){var decomposedMatrix=this.decomposedMatrix,matrix=this.matrix,a=matrix[0],b=matrix[1],c=matrix[2],d=matrix[3],determ=a*d-b*c;if(decomposedMatrix.translateX=matrix[4],decomposedMatrix.translateY=matrix[5],a||b){var r=Math.sqrt(a*a+b*b);decomposedMatrix.rotation=b>0?Math.acos(a/r):-Math.acos(a/r),decomposedMatrix.scaleX=r,decomposedMatrix.scaleY=determ/r}else if(c||d){var s=Math.sqrt(c*c+d*d);decomposedMatrix.rotation=.5*Math.PI-(d>0?Math.acos(-c/s):-Math.acos(c/s)),decomposedMatrix.scaleX=determ/s,decomposedMatrix.scaleY=s}else decomposedMatrix.rotation=0,decomposedMatrix.scaleX=0,decomposedMatrix.scaleY=0;return decomposedMatrix},applyITRS:function(x,y,rotation,scaleX,scaleY){var matrix=this.matrix,radianSin=Math.sin(rotation),radianCos=Math.cos(rotation);return matrix[4]=x,matrix[5]=y,matrix[0]=radianCos*scaleX,matrix[1]=radianSin*scaleX,matrix[2]=-radianSin*scaleY,matrix[3]=radianCos*scaleY,this},applyInverse:function(x,y,output){void 0===output&&(output=new Vector2$Q);var matrix=this.matrix,a=matrix[0],b=matrix[1],c=matrix[2],d=matrix[3],tx=matrix[4],ty=matrix[5],id=1/(a*d+c*-b);return output.x=d*id*x+-c*id*y+(ty*c-tx*d)*id,output.y=a*id*y+-b*id*x+(-ty*a+tx*b)*id,output},getX:function(x,y){return x*this.a+y*this.c+this.e},getY:function(x,y){return x*this.b+y*this.d+this.f},getXRound:function(x,y,round){var v=this.getX(x,y);return round&&(v=Math.round(v)),v},getYRound:function(x,y,round){var v=this.getY(x,y);return round&&(v=Math.round(v)),v},getCSSMatrix:function(){var m=this.matrix;return"matrix("+m[0]+","+m[1]+","+m[2]+","+m[3]+","+m[4]+","+m[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}}),TransformMatrix_1=TransformMatrix$g,Vector2$P=Vector2_1,TransformXY_1=function(x,y,positionX,positionY,rotation,scaleX,scaleY,output){void 0===output&&(output=new Vector2$P);var radianSin=Math.sin(rotation),radianCos=Math.cos(rotation),a=radianCos*scaleX,b=radianSin*scaleX,c=-radianSin*scaleY,d=radianCos*scaleY,id=1/(a*d+c*-b);return output.x=d*id*x+-c*id*y+(positionY*c-positionX*d)*id,output.y=a*id*y+-b*id*x+(-positionY*a+positionX*b)*id,output},Wrap_1$1=function(value,min,max){var range=max-min;return min+((value-min)%range+range)%range},MathWrap=Wrap_1$1,Wrap_1=function(angle){return MathWrap(angle,-Math.PI,Math.PI)},Wrap$5=Wrap_1$1,WrapDegrees_1=function(angle){return Wrap$5(angle,-180,180)},MATH_CONST$g=_const$b,TransformMatrix$f=TransformMatrix_1,TransformXY$1=TransformXY_1,WrapAngle$1=Wrap_1,WrapAngleDegrees$1=WrapDegrees_1,Vector2$O=Vector2_1,Transform$1={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(value){this._scaleX=value,this._scaleY=value,0===value?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(value){this._scaleX=value,0===value?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(value){this._scaleY=value,0===value?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return WrapAngleDegrees$1(this._rotation*MATH_CONST$g.RAD_TO_DEG)},set:function(value){this.rotation=WrapAngleDegrees$1(value)*MATH_CONST$g.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(value){this._rotation=WrapAngle$1(value)}},setPosition:function(x,y,z,w){return void 0===x&&(x=0),void 0===y&&(y=x),void 0===z&&(z=0),void 0===w&&(w=0),this.x=x,this.y=y,this.z=z,this.w=w,this},copyPosition:function(source){return void 0!==source.x&&(this.x=source.x),void 0!==source.y&&(this.y=source.y),void 0!==source.z&&(this.z=source.z),void 0!==source.w&&(this.w=source.w),this},setRandomPosition:function(x,y,width,height){return void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=this.scene.sys.scale.width),void 0===height&&(height=this.scene.sys.scale.height),this.x=x+Math.random()*width,this.y=y+Math.random()*height,this},setRotation:function(radians){return void 0===radians&&(radians=0),this.rotation=radians,this},setAngle:function(degrees){return void 0===degrees&&(degrees=0),this.angle=degrees,this},setScale:function(x,y){return void 0===x&&(x=1),void 0===y&&(y=x),this.scaleX=x,this.scaleY=y,this},setX:function(value){return void 0===value&&(value=0),this.x=value,this},setY:function(value){return void 0===value&&(value=0),this.y=value,this},setZ:function(value){return void 0===value&&(value=0),this.z=value,this},setW:function(value){return void 0===value&&(value=0),this.w=value,this},getLocalTransformMatrix:function(tempMatrix){return void 0===tempMatrix&&(tempMatrix=new TransformMatrix$f),tempMatrix.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(tempMatrix,parentMatrix){void 0===tempMatrix&&(tempMatrix=new TransformMatrix$f),void 0===parentMatrix&&(parentMatrix=new TransformMatrix$f);var parent=this.parentContainer;if(!parent)return this.getLocalTransformMatrix(tempMatrix);for(tempMatrix.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);parent;)parentMatrix.applyITRS(parent.x,parent.y,parent._rotation,parent._scaleX,parent._scaleY),parentMatrix.multiply(tempMatrix,tempMatrix),parent=parent.parentContainer;return tempMatrix},getLocalPoint:function(x,y,point,camera){point||(point=new Vector2$O),camera||(camera=this.scene.sys.cameras.main);var csx=camera.scrollX,csy=camera.scrollY,px=x+csx*this.scrollFactorX-csx,py=y+csy*this.scrollFactorY-csy;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(px,py,point):TransformXY$1(px,py,this.x,this.y,this.rotation,this.scaleX,this.scaleY,point),this._originComponent&&(point.x+=this._displayOriginX,point.y+=this._displayOriginY),point},getParentRotation:function(){for(var rotation=0,parent=this.parentContainer;parent;)rotation+=parent.rotation,parent=parent.parentContainer;return rotation}},Transform_1$1=Transform$1,Visible_1={_visible:!0,visible:{get:function(){return this._visible},set:function(value){value?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(value){return this.visible=value,this}},components$3={Alpha:Alpha_1,AlphaSingle:AlphaSingle_1,BlendMode:BlendMode_1,ComputedSize:ComputedSize_1,Crop:Crop_1,Depth:Depth_1,Flip:Flip_1,GetBounds:GetBounds_1$3,Mask:Mask_1,Origin:Origin_1,PathFollower:PathFollower_1$1,Pipeline:Pipeline_1,ScrollFactor:ScrollFactor_1,Size:Size_1$2,Texture:Texture_1$1,TextureCrop:TextureCrop_1,Tint:Tint_1,ToJSON:ToJSON_1,Transform:Transform_1$1,TransformMatrix:TransformMatrix_1,Visible:Visible_1},events$i={CHANGE_DATA:"changedata",CHANGE_DATA_KEY:"changedata-",DESTROY:"destroy",REMOVE_DATA:"removedata",SET_DATA:"setdata"},Events$T=events$i,DataManager$4=new Class_1({initialize:function(parent,eventEmitter){this.parent=parent,this.events=eventEmitter,eventEmitter||(this.events=parent.events?parent.events:parent),this.list={},this.values={},this._frozen=!1,!parent.hasOwnProperty("sys")&&this.events&&this.events.once(Events$T.DESTROY,this.destroy,this)},get:function(key){var list=this.list;if(Array.isArray(key)){for(var output=[],i=0;i<key.length;i++)output.push(list[key[i]]);return output}return list[key]},getAll:function(){var results={};for(var key in this.list)this.list.hasOwnProperty(key)&&(results[key]=this.list[key]);return results},query:function(search){var results={};for(var key in this.list)this.list.hasOwnProperty(key)&&key.match(search)&&(results[key]=this.list[key]);return results},set:function(key,data){if(this._frozen)return this;if("string"==typeof key)return this.setValue(key,data);for(var entry in key)this.setValue(entry,key[entry]);return this},inc:function(key,data){if(this._frozen)return this;void 0===data&&(data=1);var value=this.get(key);return void 0===value&&(value=0),this.set(key,value+data),this},toggle:function(key){return this._frozen||this.set(key,!this.get(key)),this},setValue:function(key,data){if(this._frozen)return this;if(this.has(key))this.values[key]=data;else{var _this=this,list=this.list,events=this.events,parent=this.parent;Object.defineProperty(this.values,key,{enumerable:!0,configurable:!0,get:function(){return list[key]},set:function(value){if(!_this._frozen){var previousValue=list[key];list[key]=value,events.emit(Events$T.CHANGE_DATA,parent,key,value,previousValue),events.emit(Events$T.CHANGE_DATA_KEY+key,parent,value,previousValue)}}}),list[key]=data,events.emit(Events$T.SET_DATA,parent,key,data)}return this},each:function(callback,context){for(var args=[this.parent,null,void 0],i=1;i<arguments.length;i++)args.push(arguments[i]);for(var key in this.list)args[1]=key,args[2]=this.list[key],callback.apply(context,args);return this},merge:function(data,overwrite){for(var key in void 0===overwrite&&(overwrite=!0),data)data.hasOwnProperty(key)&&(overwrite||!overwrite&&!this.has(key))&&this.setValue(key,data[key]);return this},remove:function(key){if(this._frozen)return this;if(!Array.isArray(key))return this.removeValue(key);for(var i=0;i<key.length;i++)this.removeValue(key[i]);return this},removeValue:function(key){if(this.has(key)){var data=this.list[key];delete this.list[key],delete this.values[key],this.events.emit(Events$T.REMOVE_DATA,this.parent,key,data)}return this},pop:function(key){var data=void 0;return!this._frozen&&this.has(key)&&(data=this.list[key],delete this.list[key],delete this.values[key],this.events.emit(Events$T.REMOVE_DATA,this.parent,key,data)),data},has:function(key){return this.list.hasOwnProperty(key)},setFreeze:function(value){return this._frozen=value,this},reset:function(){for(var key in this.list)delete this.list[key],delete this.values[key];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(Events$T.CHANGE_DATA),this.events.off(Events$T.SET_DATA),this.events.off(Events$T.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(value){this._frozen=!!value}},count:{get:function(){var i=0;for(var key in this.list)void 0!==this.list[key]&&i++;return i}}}),DataManager_1=DataManager$4,eventemitter3={exports:{}};
23/**
24	 * @author       Richard Davey <[email protected]>
25	 * @copyright    2020 Photon Storm Ltd.
26	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
27	 */!function(module){var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function addListener(emitter,event,fn,context,once){if("function"!=typeof fn)throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){0==--emitter._eventsCount?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function(){var events,name,names=[];if(0===this._eventsCount)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names},EventEmitter.prototype.listeners=function(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i<l;i++)ee[i]=handlers[i].fn;return ee},EventEmitter.prototype.listenerCount=function(event){var evt=prefix?prefix+event:event,listeners=this._events[evt];return listeners?listeners.fn?1:listeners.length:0},EventEmitter.prototype.emit=function(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return!1;var args,i,listeners=this._events[evt],len=arguments.length;if(listeners.fn){switch(listeners.once&&this.removeListener(event,listeners.fn,void 0,!0),len){case 1:return listeners.fn.call(listeners.context),!0;case 2:return listeners.fn.call(listeners.context,a1),!0;case 3:return listeners.fn.call(listeners.context,a1,a2),!0;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),!0;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),!0;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),!0}for(i=1,args=new Array(len-1);i<len;i++)args[i-1]=arguments[i];listeners.fn.apply(listeners.context,args)}else{var j,length=listeners.length;for(i=0;i<length;i++)switch(listeners[i].once&&this.removeListener(event,listeners[i].fn,void 0,!0),len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++)args[j-1]=arguments[j];listeners[i].fn.apply(listeners[i].context,args)}}return!0},EventEmitter.prototype.on=function(event,fn,context){return addListener(this,event,fn,context,!1)},EventEmitter.prototype.once=function(event,fn,context){return addListener(this,event,fn,context,!0)},EventEmitter.prototype.removeListener=function(event,fn,context,once){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn)return clearEvent(this,evt),this;var listeners=this._events[evt];if(listeners.fn)listeners.fn!==fn||once&&!listeners.once||context&&listeners.context!==context||clearEvent(this,evt);else{for(var i=0,events=[],length=listeners.length;i<length;i++)(listeners[i].fn!==fn||once&&!listeners[i].once||context&&listeners[i].context!==context)&&events.push(listeners[i]);events.length?this._events[evt]=1===events.length?events[0]:events:clearEvent(this,evt)}return this},EventEmitter.prototype.removeAllListeners=function(event){var evt;return event?(evt=prefix?prefix+event:event,this._events[evt]&&clearEvent(this,evt)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=prefix,EventEmitter.EventEmitter=EventEmitter,module.exports=EventEmitter}(eventemitter3);
28/**
29	 * @author       Richard Davey <[email protected]>
30	 * @copyright    2020 Photon Storm Ltd.
31	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
32	 */
33var events$h={ADDED_TO_SCENE:"addedtoscene",DESTROY:"destroy",REMOVED_FROM_SCENE:"removedfromscene",VIDEO_COMPLETE:"complete",VIDEO_CREATED:"created",VIDEO_ERROR:"error",VIDEO_LOOP:"loop",VIDEO_PLAY:"play",VIDEO_SEEKED:"seeked",VIDEO_SEEKING:"seeking",VIDEO_STOP:"stop",VIDEO_TIMEOUT:"timeout",VIDEO_UNLOCKED:"unlocked"},events$g={ADDED_TO_SCENE:"addedtoscene",BOOT:"boot",CREATE:"create",DESTROY:"destroy",PAUSE:"pause",POST_UPDATE:"postupdate",PRE_RENDER:"prerender",PRE_UPDATE:"preupdate",READY:"ready",REMOVED_FROM_SCENE:"removedfromscene",RENDER:"render",RESUME:"resume",SHUTDOWN:"shutdown",SLEEP:"sleep",START:"start",TRANSITION_COMPLETE:"transitioncomplete",TRANSITION_INIT:"transitioninit",TRANSITION_OUT:"transitionout",TRANSITION_START:"transitionstart",TRANSITION_WAKE:"transitionwake",UPDATE:"update",WAKE:"wake"},ComponentsToJSON$1=ToJSON_1,DataManager$3=DataManager_1,EventEmitter$u=eventemitter3.exports,Events$S=events$h,SceneEvents$g=events$g,GameObject$n=new Class_1({Extends:EventEmitter$u,initialize:function(scene,type){EventEmitter$u.call(this),this.scene=scene,this.displayList=null,this.type=type,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(Events$S.ADDED_TO_SCENE,this.addedToScene,this),this.on(Events$S.REMOVED_FROM_SCENE,this.removedFromScene,this),scene.sys.queueDepthSort()},setActive:function(value){return this.active=value,this},setName:function(value){return this.name=value,this},setState:function(value){return this.state=value,this},setDataEnabled:function(){return this.data||(this.data=new DataManager$3(this)),this},setData:function(key,value){return this.data||(this.data=new DataManager$3(this)),this.data.set(key,value),this},incData:function(key,value){return this.data||(this.data=new DataManager$3(this)),this.data.inc(key,value),this},toggleData:function(key){return this.data||(this.data=new DataManager$3(this)),this.data.toggle(key),this},getData:function(key){return this.data||(this.data=new DataManager$3(this)),this.data.get(key)},setInteractive:function(hitArea,hitAreaCallback,dropZone){return this.scene.sys.input.enable(this,hitArea,hitAreaCallback,dropZone),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return ComponentsToJSON$1(this)},willRender:function(camera){return!(GameObject$n.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&camera.id
33)},getIndexList:function(){for(var child=this,parent=this.parentContainer,indexes=[];parent&&(indexes.unshift(parent.getIndex(child)),child=parent,parent.parentContainer);)parent=parent.parentContainer;return this.displayList?indexes.unshift(this.displayList.getIndex(child)):indexes.unshift(this.scene.sys.displayList.getIndex(child)),indexes},addToDisplayList:function(displayList){return void 0===displayList&&(displayList=this.scene.sys.displayList),this.displayList&&this.displayList!==displayList&&this.removeFromDisplayList(),displayList.exists(this)||(this.displayList=displayList,displayList.add(this,!0),displayList.queueDepthSort(),this.emit(Events$S.ADDED_TO_SCENE,this,this.scene),displayList.events.emit(SceneEvents$g.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var displayList=this.displayList||this.scene.sys.displayList;return displayList.exists(this)&&(displayList.remove(this,!0),displayList.queueDepthSort(),this.displayList=null,this.emit(Events$S.REMOVED_FROM_SCENE,this,this.scene),displayList.events.emit(SceneEvents$g.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(fromScene){this.scene&&!this.ignoreDestroy&&(void 0===fromScene&&(fromScene=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(Events$S.DESTROY,this,fromScene),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});
34/**
35	 * @author       Richard Davey <[email protected]>
36	 * @copyright    2020 Photon Storm Ltd.
37	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
38	 */GameObject$n.RENDER_MASK=15;var GameObject_1=GameObject$n,BlendModes$6=BlendModes$8,Circle$6=Circle_1,CircleContains$2=Contains_1$4,Class$3o=Class_1,Components$v=components$3,GameObject$m=GameObject_1,Rectangle$t=Rectangle_1$1,RectangleContains$4=Contains_1$3,Zone$3=new Class$3o({Extends:GameObject$m,Mixins:[Components$v.Depth,Components$v.GetBounds,Components$v.Origin,Components$v.Transform,Components$v.ScrollFactor,Components$v.Visible],initialize:function(scene,x,y,width,height){void 0===width&&(width=1),void 0===height&&(height=width),GameObject$m.call(this,scene,"Zone"),this.setPosition(x,y),this.width=width,this.height=height,this.blendMode=BlendModes$6.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(value){this.scaleX=value/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(value){this.scaleY=value/this.height}},setSize:function(width,height,resizeInput){void 0===resizeInput&&(resizeInput=!0),this.width=width,this.height=height,this.updateDisplayOrigin();var input=this.input;return resizeInput&&input&&!input.customHitArea&&(input.hitArea.width=width,input.hitArea.height=height),this},setDisplaySize:function(width,height){return this.displayWidth=width,this.displayHeight=height,this},setCircleDropZone:function(radius){return this.setDropZone(new Circle$6(0,0,radius),CircleContains$2)},setRectangleDropZone:function(width,height){return this.setDropZone(new Rectangle$t(0,0,width,height),RectangleContains$4)},setDropZone:function(hitArea,hitAreaCallback){return void 0===hitArea?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(hitArea,hitAreaCallback,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(renderer,src,camera){camera.addToRenderList(src)},renderWebGL:function(renderer,src,camera){camera.addToRenderList(src)}}),Zone_1=Zone$3,AlignIn=QuickSet_1,CONST$1e=_const$d,GetFastValue$1j=GetFastValue_1,NOOP$q=NOOP_1,Zone$2=Zone_1,tempZone=new Zone$2({sys:{queueDepthSort:NOOP$q,events:{once:NOOP$q}}},0,0,1,1),GridAlign_1=function(items,options){void 0===options&&(options={});var widthSet=options.hasOwnProperty("width"),heightSet=options.hasOwnProperty("height"),width=GetFastValue$1j(options,"width",-1),height=GetFastValue$1j(options,"height",-1),cellWidth=GetFastValue$1j(options,"cellWidth",1),cellHeight=GetFastValue$1j(options,"cellHeight",cellWidth),position=GetFastValue$1j(options,"position",CONST$1e.TOP_LEFT),x=GetFastValue$1j(options,"x",0),y=GetFastValue$1j(options,"y",0),cx=0,cy=0,w=width*cellWidth,h=height*cellHeight;
vendor: 6,184 bytes, line 38
38tempZone.setPosition(x,y),tempZone.setSize(cellWidth,cellHeight);for(var i=0;i<items.length;i++)if(AlignIn(items[i],tempZone,position),widthSet&&-1===width)tempZone.x+=cellWidth;else if(heightSet&&-1===height)tempZone.y+=cellHeight;else if(heightSet&&!widthSet){if(cy+=cellHeight,tempZone.y+=cellHeight,cy===h&&(cy=0,cx+=cellWidth,tempZone.y=y,tempZone.x+=cellWidth,cx===w))break}else if(cx+=cellWidth,tempZone.x+=cellWidth,cx===w&&(cx=0,cy+=cellHeight,tempZone.x=x,tempZone.y+=cellHeight,cy===h))break;return items},PropertyValueInc$7=PropertyValueInc_1,IncAlpha_1=function(items,value,step,index,direction){return PropertyValueInc$7(items,"alpha",value,step,index,direction)},PropertyValueInc$6=PropertyValueInc_1,IncX_1=function(items,value,step,index,direction){return PropertyValueInc$6(items,"x",value,step,index,direction)},PropertyValueInc$5=PropertyValueInc_1,IncXY_1=function(items,x,y,stepX,stepY,index,direction){return null==y&&(y=x),PropertyValueInc$5(items,"x",x,stepX,index,direction),PropertyValueInc$5(items,"y",y,stepY,index,direction)},PropertyValueInc$4=PropertyValueInc_1,IncY_1=function(items,value,step,index,direction){return PropertyValueInc$4(items,"y",value,step,index,direction)},PlaceOnCircle_1=function(items,circle,startAngle,endAngle){void 0===startAngle&&(startAngle=0),void 0===endAngle&&(endAngle=6.28);for(var angle=startAngle,angleStep=(endAngle-startAngle)/items.length,i=0;i<items.length;i++)items[i].x=circle.x+circle.radius*Math.cos(angle),items[i].y=circle.y+circle.radius*Math.sin(angle),angle+=angleStep;return items},PlaceOnEllipse_1=function(items,ellipse,startAngle,endAngle){void 0===startAngle&&(startAngle=0),void 0===endAngle&&(endAngle=6.28);for(var angle=startAngle,angleStep=(endAngle-startAngle)/items.length,a=ellipse.width/2,b=ellipse.height/2,i=0;i<items.length;i++)items[i].x=ellipse.x+a*Math.cos(angle),items[i].y=ellipse.y+b*Math.sin(angle),angle+=angleStep;return items},GetPoints$6=GetPoints_1$3,PlaceOnLine_1=function(items,line){for(var points=GetPoints$6(line,items.length),i=0;i<items.length;i++){var item=items[i],point=points[i];item.x=point.x,item.y=point.y}return items},Perimeter$3=Perimeter_1$2,Point$u=Point_1,MarchingAnts_1=function(rect,step,quantity,out){if(void 0===out&&(out=[]),!step&&!quantity)return out;step?quantity=Math.round(Perimeter$3(rect)/step):step=Perimeter$3(rect)/quantity;for(var x=rect.x,y=rect.y,face=0,i=0;i<quantity;i++)switch(out.push(new Point$u(x,y)),face){case 0:(x+=step)>=rect.right&&(face=1,y+=x-rect.right,x=rect.right);break;case 1:(y+=step)>=rect.bottom&&(face=2,x-=y-rect.bottom,y=rect.bottom);break;case 2:(x-=step)<=rect.left&&(face=3,y-=rect.left-x,x=rect.left);break;case 3:(y-=step)<=rect.top&&(face=0,y=rect.top)}return out},RotateLeft_1$1=function(array,total){void 0===total&&(total=1);for(var element=null,i=0;i<total;i++)element=array.shift(),array.push(element);return element},RotateRight_1$1=function(array,total){void 0===total&&(total=1);for(var element=null,i=0;i<total;i++)element=array.pop(),array.unshift(element);return element},MarchingAnts=MarchingAnts_1,RotateLeft$2=RotateLeft_1$1,RotateRight$2=RotateRight_1$1,PlaceOnRectangle_1=function(items,rect,shift){void 0===shift&&(shift=0);var points=MarchingAnts(rect,!1,items.length);shift>0?RotateLeft$2(points,shift):shift<0&&RotateRight$2(points,Math.abs(shift));for(var i=0;i<items.length;i++)items[i].x=points[i].x,items[i].y=points[i].y;return items},BresenhamPoints_1=function(line,stepRate,results){void 0===stepRate&&(stepRate=1),void 0===results&&(results=[]);var x1=Math.round(line.x1),y1=Math.round(line.y1),x2=Math.round(line.x2),y2=Math.round(line.y2),dx=Math.abs(x2-x1),dy=Math.abs(y2-y1),sx=x1<x2?1:-1,sy=y1<y2?1:-1,err=dx-dy;results.push({x:x1,y:y1});for(var i=1;x1!==x2||y1!==y2;){var e2=err<<1;e2>-dy&&(err-=dy,x1+=sx),e2<dx&&(err+=dx,y1+=sy),i%stepRate==0&&results.push({x:x1,y:y1}),i++}return results},BresenhamPoints=BresenhamPoints_1,PlaceOnTriangle_1=function(items,triangle,stepRate){var p1=BresenhamPoints({x1:triangle.x1,y1:triangle.y1,x2:triangle.x2,y2:triangle.y2},stepRate),p2=BresenhamPoints({x1:triangle.x2,y1:triangle.y2,x2:triangle.x3,y2:triangle.y3},stepRate),p3=BresenhamPoints({x1:triangle.x3,y1:triangle.y3,x2:triangle.x1,y2:triangle.y1},stepRate);p1.pop(),p2.pop(),p3.pop();for(var step=(p1=p1.concat(p2,p3)).length/items.length,p=0,i=0;i<items.length;i++){var item=items[i],point=p1[Math.floor(p)];item.x=point.x,item.y=point.y,p+=step}return items},PlayAnimation_1=function(items,key,ignoreIfPlaying){for(var i=0;i<items.length;i++){var gameObject=items[i];gameObject.anims&&gameObject.anims.play(key,ignoreIfPlaying)}return items},PropertyValueSet_1=function(items,key,value,step,index,direction){var i;void 0===step&&(step=0),void 0===index&&(index=0),void 0===direction&&(direction=1);var t=0,end=items.length;if(1===direction)for(i=index;i<end;i++)items[i][key]=value+t*step,t++;else for(i=index;i>=0;i--)items[i][key]=value+t*step,t++;return items},Random$9=Random_1$5,RandomCircle_1=function(items,circle){for(var i=0;i<items.length;i++)Random$9(circle,items[i]);return items},Point$t=Point_1,Random_1$2=function(ellipse,out){void 0===out&&(out=new Point$t);var p=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return out.x=ellipse.x+s*Math.cos(p)*ellipse.width/2,out.y=ellipse.y+s*Math.sin(p)*ellipse.height/2,out},Random$7=Random_1$2,RandomEllipse_1=function(items,ellipse){for(var i=0;i<items.length;i++)Random$7(ellipse,items[i]);return items},Random$6=Random_1$4,RandomLine_1=function(items,line){for(var i=0;i<items.length;i++)Random$6(line,items[i]);return items},Random$5=Random_1$3,RandomRectangle_1=function(items,rect){for(var i=0;i<items.length;i++)Random$5(rect,items[i]);return items},Point$s=Point_1,Random_1$1=function(triangle,out){void 0===out&&(out=new Point$s);var ux=triangle.x2-triangle.x1,uy=triangle.y2-triangle.y1,vx=triangle.x3-triangle.x1,vy=triangle.y3-triangle.y1,r=Math.random(),s=Math.random();return r+s>=1&&(r=1-r,s=1-s),out.x=triangle.x1+(ux*r+vx*s),out.y=triangle.y1+(uy*r+vy*s),out},Random$3=Random_1$1,RandomTriangle_1=function(items,triangle){for(var i=0;i<items.length;i++)Random$3(triangle,items[i]);return items}
38,PropertyValueInc$3=PropertyValueInc_1,RotateAroundDistance_1$1=function(point,x,y,angle,distance){var t=angle+Math.atan2(point.y-y,point.x-x);return point.x=x+distance*Math.cos(t),point.y=y+distance*Math.sin(t),point},DistanceBetween_1=function(x1,y1,x2,y2){var dx=x1-x2,dy=y1-y2;return Math.sqrt(dx*dx+dy*dy)},RotateAroundDistance$1=RotateAroundDistance_1$1,DistanceBetween$7=DistanceBetween_1,RotateAround_1=function(items,point,angle){for(var x=point.x,y=point.y,i=0;i<items.length;i++){var item=items[i];RotateAroundDistance$1(item,x,y,angle,Math.max(1,DistanceBetween$7(item.x,item.y,x,y)))}return items},MathRotateAroundDistance=RotateAroundDistance_1$1,RotateAroundDistance_1=function(items,point,angle,distance){var x=point.x,y=point.y;if(0===distance)return items;for(var i=0;i<items.length;i++)MathRotateAroundDistance(items[i],x,y,angle,distance);return items},PropertyValueInc$2=PropertyValueInc_1,PropertyValueInc$1=PropertyValueInc_1,PropertyValueInc=PropertyValueInc_1,PropertyValueSet$e=PropertyValueSet_1,PropertyValueSet$d=PropertyValueSet_1,PropertyValueSet$c=PropertyValueSet_1,SetHitArea_1=function(items,hitArea,hitAreaCallback){for(var i=0;i<items.length;i++)items[i].setInteractive(hitArea,hitAreaCallback);return items},PropertyValueSet$b=PropertyValueSet_1,PropertyValueSet$a=PropertyValueSet_1,PropertyValueSet$9=PropertyValueSet_1,PropertyValueSet$8=PropertyValueSet_1,PropertyValueSet$7=PropertyValueSet_1,PropertyValueSet$6=PropertyValueSet_1,PropertyValueSet$5=PropertyValueSet_1,PropertyValueSet$4=PropertyValueSet_1,SetTint_1=function(items,topLeft,topRight,bottomLeft,bottomRight){for(var i=0;i<items.length;i++)items[i].setTint(topLeft,topRight,bottomLeft,bottomRight);return items},PropertyValueSet$3=PropertyValueSet_1,PropertyValueSet$2=PropertyValueSet_1,PropertyValueSet$1=PropertyValueSet_1,PropertyValueSet=PropertyValueSet_1,Vector2$N=Vector2_1,ShiftPosition_1=function(items,x,y,direction,output){var px,py,i,cx,cy,cur;if(void 0===direction&&(direction=0),void 0===output&&(output=new Vector2$N),items.length>1)if(0===direction){var len=items.length-1;for(px=items[len].x,py=items[len].y,i=len-1;i>=0;i--)cx=(cur=items[i]).x,cy=cur.y,cur.x=px,cur.y=py,px=cx,py=cy;items[len].x=x,items[len].y=y}else{for(px=items[0].x,py=items[0].y,i=1;i<items.length;i++)cx=(cur=items[i]).x,cy=cur.y,cur.x=px,cur.y=py,px=cx,py=cy;items[0].x=x,items[0].y=y}else px=items[0].x,py=items[0].y,items[0].x=x,items[0].y=y;return output.x=px,output.y=py,output},Shuffle_1$2=function(array){for(var i=array.length-1;i>0;i--){var j=Math.floor(Math.random()*(i+1)),temp=array[i];array[i]=array[j],array[j]=temp}return array},ArrayShuffle=Shuffle_1$2,SmootherStep_1$1=function(x,min,max){return(x=Math.max(0,Math.min(1,(x-min)/(max-min))))*x*x*(x*(6*x-15)+10)},MathSmootherStep=SmootherStep_1$1,SmootherStep_1=function(items,property,min,max,inc){void 0===inc&&(inc=!1);var i,step=Math.abs(max-min)/items.length;if(inc)for(i=0;i<items.length;i++)items[i][property]+=MathSmootherStep(i*step,min,max);else for(i=0;i<items.length;i++)items[i][property]=MathSmootherStep(i*step,min,max);return items},SmoothStep_1$1=function(x,min,max){return x<=min?0:x>=max?1:(x=(x-min)/(max-min))*x*(3-2*x)},MathSmoothStep=SmoothStep_1$1,SmoothStep_1=function(items,property,min,max,inc){void 0===inc&&(inc=!1);var i,step=Math.abs(max-min)/items.length;if(inc)for(i=0;i<items.length;i++)items[i][property]+=MathSmoothStep(i*step,min,max);else for(i=0;i<items.length;i++)items[i][property]=MathSmoothStep(i*step,min,max);return items},Spread_1=function(items,property,min,max,inc){void 0===inc&&(inc=!1);var i,step=Math.abs(max-min)/items.length;if(inc)for(i=0;i<items.length;i++)items[i][property]+=i*step+min;else for(i=0;i<items.length;i++)items[i][property]=i*step+min;return items},ToggleVisible_1=function(items){for(var i=0;i<items.length;i++)items[i].visible=!items[i].visible;return items},Wrap$4=Wrap_1$1,WrapInRectangle_1=function(items,rect,padding){void 0===padding&&(padding=0);for(var i=0;i<items.length;i++){var item=items[i];item.x=Wrap$4(item.x,rect.left-padding,rect.right+padding),item.y=Wrap$4(item.y,rect.top-padding,rect.bottom+padding)}return items},actions={AlignTo:AlignTo_1,Angle:Angle_1$1,Call:Call_1,GetFirst:GetFirst_1$1,GetLast:GetLast_1,GridAlign:GridAlign_1,IncAlpha:IncAlpha_1,IncX:IncX_1,IncXY:IncXY_1,IncY:IncY_1,PlaceOnCircle:PlaceOnCircle_1,PlaceOnEllipse:PlaceOnEllipse_1,PlaceOnLine:PlaceOnLine_1,PlaceOnRectangle:PlaceOnRectangle_1,PlaceOnTriangle:PlaceOnTriangle_1,PlayAnimation:PlayAnimation_1,PropertyValueInc:PropertyValueInc_1,PropertyValueSet:PropertyValueSet_1,RandomCircle:RandomCircle_1,RandomEllipse:RandomEllipse_1,RandomLine:RandomLine_1,RandomRectangle:RandomRectangle_1,RandomTriangle:RandomTriangle_1,Rotate:function(items,value,step,index,direction){return PropertyValueInc$3(items,"rotation",value,step,index,direction)}
vendor: 14,546 bytes, line 38
38,RotateAround:RotateAround_1,RotateAroundDistance:RotateAroundDistance_1,ScaleX:function(items,value,step,index,direction){return PropertyValueInc$2(items,"scaleX",value,step,index,direction)},ScaleXY:function(items,scaleX,scaleY,stepX,stepY,index,direction){return null==scaleY&&(scaleY=scaleX),PropertyValueInc$1(items,"scaleX",scaleX,stepX,index,direction),PropertyValueInc$1(items,"scaleY",scaleY,stepY,index,direction)},ScaleY:function(items,value,step,index,direction){return PropertyValueInc(items,"scaleY",value,step,index,direction)},SetAlpha:function(items,value,step,index,direction){return PropertyValueSet$e(items,"alpha",value,step,index,direction)},SetBlendMode:function(items,value,index,direction){return PropertyValueSet$d(items,"blendMode",value,0,index,direction)},SetDepth:function(items,value,step,index,direction){return PropertyValueSet$c(items,"depth",value,step,index,direction)},SetHitArea:SetHitArea_1,SetOrigin:function(items,originX,originY,stepX,stepY,index,direction){return null==originY&&(originY=originX),PropertyValueSet$b(items,"originX",originX,stepX,index,direction),PropertyValueSet$b(items,"originY",originY,stepY,index,direction),items.forEach((function(item){item.updateDisplayOrigin()})),items},SetRotation:function(items,value,step,index,direction){return PropertyValueSet$a(items,"rotation",value,step,index,direction)},SetScale:function(items,scaleX,scaleY,stepX,stepY,index,direction){return null==scaleY&&(scaleY=scaleX),PropertyValueSet$9(items,"scaleX",scaleX,stepX,index,direction),PropertyValueSet$9(items,"scaleY",scaleY,stepY,index,direction)},SetScaleX:function(items,value,step,index,direction){return PropertyValueSet$8(items,"scaleX",value,step,index,direction)},SetScaleY:function(items,value,step,index,direction){return PropertyValueSet$7(items,"scaleY",value,step,index,direction)},SetScrollFactor:function(items,scrollFactorX,scrollFactorY,stepX,stepY,index,direction){return null==scrollFactorY&&(scrollFactorY=scrollFactorX),PropertyValueSet$6(items,"scrollFactorX",scrollFactorX,stepX,index,direction),PropertyValueSet$6(items,"scrollFactorY",scrollFactorY,stepY,index,direction)},SetScrollFactorX:function(items,value,step,index,direction){return PropertyValueSet$5(items,"scrollFactorX",value,step,index,direction)},SetScrollFactorY:function(items,value,step,index,direction){return PropertyValueSet$4(items,"scrollFactorY",value,step,index,direction)},SetTint:SetTint_1,SetVisible:function(items,value,index,direction){return PropertyValueSet$3(items,"visible",value,0,index,direction)},SetX:function(items,value,step,index,direction){return PropertyValueSet$2(items,"x",value,step,index,direction)},SetXY:function(items,x,y,stepX,stepY,index,direction){return null==y&&(y=x),PropertyValueSet$1(items,"x",x,stepX,index,direction),PropertyValueSet$1(items,"y",y,stepY,index,direction)},SetY:function(items,value,step,index,direction){return PropertyValueSet(items,"y",value,step,index,direction)},ShiftPosition:ShiftPosition_1,Shuffle:function(items){return ArrayShuffle(items)},SmootherStep:SmootherStep_1,SmoothStep:SmoothStep_1,Spread:Spread_1,ToggleVisible:ToggleVisible_1,WrapInRectangle:WrapInRectangle_1},events$f={ADD_ANIMATION:"add",ANIMATION_COMPLETE:"animationcomplete",ANIMATION_COMPLETE_KEY:"animationcomplete-",ANIMATION_REPEAT:"animationrepeat",ANIMATION_RESTART:"animationrestart",ANIMATION_START:"animationstart",ANIMATION_STOP:"animationstop",ANIMATION_UPDATE:"animationupdate",PAUSE_ALL:"pauseall",REMOVE_ANIMATION:"remove",RESUME_ALL:"resumeall"},FindClosestInSorted_1=function(value,array,key){if(!array.length)return NaN;if(1===array.length)return array[0];var low,high,i=1;if(key){if(value<array[0][key])return array[0];for(;array[i][key]<value;)i++}else for(;array[i]<value;)i++;return i>array.length&&(i=array.length),key?(low=array[i-1][key],(high=array[i][key])-value<=value-low?array[i]:array[i-1]):(low=array[i-1],(high=array[i])-value<=value-low?high:low)},AnimationFrame_1=new Class_1({initialize:function(textureKey,textureFrame,index,frame,isKeyFrame){void 0===isKeyFrame&&(isKeyFrame=!1),this.textureKey=textureKey,this.textureFrame=textureFrame,this.index=index,this.frame=frame,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=isKeyFrame},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}}),SortByDigits_1=function(array){var re=/\D/g;return array.sort((function(a,b){return parseInt(a.replace(re,""),10)-parseInt(b.replace(re,""),10)})),array},Clamp$h=Clamp_1,Events$R=events$f,FindClosestInSorted=FindClosestInSorted_1,Frame$5=AnimationFrame_1,GetValue$y=GetValue_1,SortByDigits=SortByDigits_1,Animation$2=new Class_1({initialize:function(manager,key,config){this.manager=manager,this.key=key,this.type="frame",this.frames=this.getFrames(manager.textureManager,GetValue$y(config,"frames",[]),GetValue$y(config,"defaultTextureKey",null),GetValue$y(config,"sortFrames",!0)),this.frameRate=GetValue$y(config,"frameRate",null),this.duration=GetValue$y(config,"duration",null),this.msPerFrame,this.skipMissedFrames=GetValue$y(config,"skipMissedFrames",!0),this.delay=GetValue$y(config,"delay",0),this.repeat=GetValue$y(config,"repeat",0),this.repeatDelay=GetValue$y(config,"repeatDelay",0),this.yoyo=GetValue$y(config,"yoyo",!1),this.showOnStart=GetValue$y(config,"showOnStart",!1),this.hideOnComplete=GetValue$y(config,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(Events$R.PAUSE_ALL,this.pause,this),this.manager.on(Events$R.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(target,totalFrames,duration,frameRate){null===duration&&null===frameRate?(target.frameRate=24,target.duration=24/totalFrames*1e3):duration&&null===frameRate?(target.duration=duration,target.frameRate=totalFrames/(duration/1e3)):(target.frameRate=frameRate,target.duration=totalFrames/frameRate*1e3),target.msPerFrame=1e3/target.frameRate},addFrame:function(config){return this.addFrameAt(this.frames.length,config)},addFrameAt:function(index,config){var newFrames=this.getFrames(this.manager.textureManager,config);if(newFrames.length>0){if(0===index)this.frames=newFrames.concat(this.frames);else if(index===this.frames.length)this.frames=this.frames.concat(newFrames);else{var pre=this.frames.slice(0,index),post=this.frames.slice(index);this.frames=pre.concat(newFrames,post)}this.updateFrameSequence()}return this},checkFrame:function(index){return index>=0&&index<this.frames.length},getFirstTick:function(state){state.accumulator=0,state.nextTick=state.msPerFrame+state.currentFrame.duration},getFrameAt:function(index){return this.frames[index]},getFrames:function(textureManager,frames,defaultTextureKey,sortFrames){void 0===sortFrames&&(sortFrames=!0);var prev,animationFrame,i,textureKey,out=[],index=1;if("string"==typeof frames){textureKey=frames;var frameKeys=textureManager.get(textureKey).getFrameNames();sortFrames&&SortByDigits(frameKeys),frames=[],frameKeys.forEach((function(value){frames.push({key:textureKey,frame:value})}))}if(!Array.isArray(frames)||0===frames.length)return out;for(i=0;i<frames.length;i++){var item=frames[i],key=GetValue$y(item,"key",defaultTextureKey);if(key){var frame=GetValue$y(item,"frame",0),textureFrame=textureManager.getFrame(key,frame);(animationFrame=new Frame$5(key,frame,index,textureFrame)).duration=GetValue$y(item,"duration",0),animationFrame.isFirst=!prev,prev&&(prev.nextFrame=animationFrame,animationFrame.prevFrame=prev),out.push(animationFrame),prev=animationFrame,index++}}if(out.length>0){animationFrame.isLast=!0,animationFrame.nextFrame=out[0],out[0].prevFrame=animationFrame;var slice=1/(out.length-1);for(i=0;i<out.length;i++)out[i].progress=i*slice}return out},getNextTick:function(state){state.accumulator-=state.nextTick,state.nextTick=state.msPerFrame+state.currentFrame.duration},getFrameByProgress:function(value){return value=Clamp$h(value,0,1),FindClosestInSorted(value,this.frames,"progress")},nextFrame:function(state){var frame=state.currentFrame;frame.isLast?state.yoyo?this.handleYoyoFrame(state,!1):state.repeatCounter>0?state.inReverse&&state.forward?state.forward=!1:this.repeatAnimation(state):state.complete():this.updateAndGetNextTick(state,frame.nextFrame)},handleYoyoFrame:function(state,isReverse){if(isReverse||(isReverse=!1),state.inReverse===!isReverse&&state.repeatCounter>0)return(0===state.repeatDelay||state.pendingRepeat)&&(state.forward=isReverse),void this.repeatAnimation(state);if(state.inReverse===isReverse||0!==state.repeatCounter){state.forward=isReverse;var frame=isReverse?state.currentFrame.nextFrame:state.currentFrame.prevFrame;this.updateAndGetNextTick(state,frame)}else state.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(state){var frame=state.currentFrame;frame.isFirst?state.yoyo?this.handleYoyoFrame(state,!0):state.repeatCounter>0?(state.inReverse&&!state.forward||(state.forward=!0),this.repeatAnimation(state)):state.complete():this.updateAndGetNextTick(state,frame.prevFrame)},updateAndGetNextTick:function(state,frame){state.setCurrentFrame(frame),this.getNextTick(state)},removeFrame:function(frame){var index=this.frames.indexOf(frame);return-1!==index&&this.removeFrameAt(index),this},removeFrameAt:function(index){return this.frames.splice(index,1),this.updateFrameSequence(),this},repeatAnimation:function(state){if(2===state._pendingStop){if(0===state._pendingStopValue)return state.stop();state._pendingStopValue--}state.repeatDelay>0&&!state.pendingRepeat?(state.pendingRepeat=!0,state.accumulator-=state.nextTick,state.nextTick+=state.repeatDelay):(state.repeatCounter--,state.forward?state.setCurrentFrame(state.currentFrame.nextFrame):state.setCurrentFrame(state.currentFrame.prevFrame),state.isPlaying&&(this.getNextTick(state),state.handleRepeat()))},toJSON:function(){var output={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(frame){output.frames.push(frame.toJSON())})),output},updateFrameSequence:function(){for(var frame,len=this.frames.length,slice=1/(len-1),i=0;i<len;i++)(frame=this.frames[i]).index=i+1,frame.isFirst=!1,frame.isLast=!1,frame.progress=i*slice,0===i?(frame.isFirst=!0,1===len?(frame.isLast=!0,frame.nextFrame=frame,frame.prevFrame=frame):(frame.isLast=!1,frame.prevFrame=this.frames[len-1],frame.nextFrame=this.frames[i+1])):i===len-1&&len>1?(frame.isLast=!0,frame.prevFrame=this.frames[len-2],frame.nextFrame=this.frames[0]):len>1&&(frame.prevFrame=this.frames[i-1],frame.nextFrame=this.frames[i+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(Events$R.PAUSE_ALL,this.pause,this),this.manager.off(Events$R.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var i=0;i<this.frames.length;i++)this.frames[i].destroy();this.frames=[],this.manager=null}}),Animation_1=Animation$2,Map$1=new Class_1({initialize:function(elements){if(this.entries={},this.size=0,Array.isArray(elements))for(var i=0;i<elements.length;i++)this.set(elements[i][0],elements[i][1])},set:function(key,value){return this.has(key)||this.size++,this.entries[key]=value,this},get:function(key){if(this.has(key))return this.entries[key]},getArray:function(){var output=[],entries=this.entries;for(var key in entries)output.push(entries[key]);return output},has:function(key){return this.entries.hasOwnProperty(key)},delete:function(key){return this.has(key)&&(delete this.entries[key],this.size--),this},clear:function(){return Object.keys(this.entries).forEach((function(prop){delete this.entries[prop]}),this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var output=[],entries=this.entries;for(var key in entries)output.push(entries[key]);return output},dump:function(){var entries=this.entries;for(var key in console.group("Map"),entries)console.log(key,entries[key]);console.groupEnd()},each:function(callback){var entries=this.entries;for(var key in entries)if(!1===callback(key,entries[key]))break;return this},contains:function(value){var entries=this.entries;for(var key in entries)if(entries[key]===value)return!0;return!1},merge:function(map,override){void 0===override&&(override=!1);var local=this.entries,source=map.entries;for(var key in source)local.hasOwnProperty(key)&&override?local[key]=source[key]:this.set(key,source[key]);return this}}),_Map=Map$1,Pad_1=function(str,len,pad,dir){void 0===len&&(len=0),void 0===pad&&(pad=" "),void 0===dir&&(dir=3);var padlen=0;if(len+1>=(str=str.toString()).length)switch(dir){case 1:str=new Array(len+1-str.length).join(pad)+str;break;case 3:var right=Math.ceil((padlen=len-str.length)/2);str=new Array(padlen-right+1).join(pad)+str+new Array(right+1).join(pad);break;default:str+=new Array(len+1-str.length).join(pad)}return str},NumberArray_1=function(start,end,prefix,suffix){var i,result=[],asString=!1;if((prefix||suffix)&&(asString=!0,prefix||(prefix=""),suffix||(suffix="")),end<start)for(i=start;i>=end;i--)asString?result.push(prefix+i.toString()+suffix):result.push(i);else for(i=start;i<=end;i++)asString?result.push(prefix+i.toString()+suffix):result.push(i);return result},Animation$1=Animation_1,CustomMap$3=_Map,EventEmitter$t=eventemitter3.exports,Events$Q=events$f,GameEvents$e=events$k,GetFastValue$1i=GetFastValue_1,GetValue$x=GetValue_1,Pad$1=Pad_1,NumberArray=NumberArray_1,AnimationManager$1=new Class_1({Extends:EventEmitter$t,initialize:function(game){EventEmitter$t.call(this),this.game=game,this.textureManager=null,this.globalTimeScale=1,this.anims=new CustomMap$3,this.mixes=new CustomMap$3,this.paused=!1,this.name="AnimationManager",game.events.once(GameEvents$e.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(GameEvents$e.DESTROY,this.destroy,this)},addMix:function(animA,animB,delay){var anims=this.anims,mixes=this.mixes,keyA="string"==typeof animA?animA:animA.key,keyB="string"==typeof animB?animB:animB.key;if(anims.has(keyA)&&anims.has(keyB)){var mixObj=mixes.get(keyA);
38mixObj||(mixObj={}),mixObj[keyB]=delay,mixes.set(keyA,mixObj)}return this},removeMix:function(animA,animB){var mixes=this.mixes,keyA="string"==typeof animA?animA:animA.key,mixObj=mixes.get(keyA);if(mixObj)if(animB){var keyB="string"==typeof animB?animB:animB.key;mixObj.hasOwnProperty(keyB)&&delete mixObj[keyB]}else animB||mixes.delete(keyA);return this},getMix:function(animA,animB){var mixes=this.mixes,keyA="string"==typeof animA?animA:animA.key,keyB="string"==typeof animB?animB:animB.key,mixObj=mixes.get(keyA);return mixObj&&mixObj.hasOwnProperty(keyB)?mixObj[keyB]:0},add:function(key,animation){return this.anims.has(key)?(console.warn("Animation key exists: "+key),this):(animation.key=key,this.anims.set(key,animation),this.emit(Events$Q.ADD_ANIMATION,key,animation),this)},exists:function(key){return this.anims.has(key)},createFromAseprite:function(key,tags){var output=[],data=this.game.cache.json.get(key);if(!data)return output;var _this=this,meta=GetValue$x(data,"meta",null),frames=GetValue$x(data,"frames",null);meta&&frames&&GetValue$x(meta,"frameTags",[]).forEach((function(tag){var animFrames=[],name=GetFastValue$1i(tag,"name",null),from=GetFastValue$1i(tag,"from",0),to=GetFastValue$1i(tag,"to",0),direction=GetFastValue$1i(tag,"direction","forward");if(name&&(!tags||tags&&tags.indexOf(name)>-1)){for(var tempFrames=[],minDuration=Number.MAX_SAFE_INTEGER,i=from;i<=to;i++){var frameKey=i.toString(),frame=frames[frameKey];if(frame){var frameDuration=GetFastValue$1i(frame,"duration",Number.MAX_SAFE_INTEGER);frameDuration<minDuration&&(minDuration=frameDuration),tempFrames.push({frame:frameKey,duration:frameDuration})}}tempFrames.forEach((function(entry){animFrames.push({key:key,frame:entry.frame,duration:minDuration-entry.duration})}));var totalDuration=minDuration*animFrames.length;"reverse"===direction&&(animFrames=animFrames.reverse());var createConfig={key:name,frames:animFrames,duration:totalDuration,yoyo:"pingpong"===direction},result=_this.create(createConfig);result&&output.push(result)}}));return output},create:function(config){var key=config.key,anim=!1;return key&&((anim=this.get(key))||(anim=new Animation$1(this,key,config),this.anims.set(key,anim),this.emit(Events$Q.ADD_ANIMATION,key,anim))),anim},fromJSON:function(data,clearCurrentAnimations){void 0===clearCurrentAnimations&&(clearCurrentAnimations=!1),clearCurrentAnimations&&this.anims.clear(),"string"==typeof data&&(data=JSON.parse(data));var output=[];if(data.hasOwnProperty("anims")&&Array.isArray(data.anims)){for(var i=0;i<data.anims.length;i++)output.push(this.create(data.anims[i]));data.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=data.globalTimeScale)}else data.hasOwnProperty("key")&&"frame"===data.type&&output.push(this.create(data));return output},generateFrameNames:function(key,config){var i,prefix=GetValue$x(config,"prefix",""),start=GetValue$x(config,"start",0),end=GetValue$x(config,"end",0),suffix=GetValue$x(config,"suffix",""),zeroPad=GetValue$x(config,"zeroPad",0),out=GetValue$x(config,"outputArray",[]),frames=GetValue$x(config,"frames",!1),texture=this.textureManager.get(key);if(!texture)return out;if(config)for(frames||(frames=NumberArray(start,end)),i=0;i<frames.length;i++){var frame=prefix+Pad$1(frames[i],zeroPad,"0",1)+suffix;texture.has(frame)?out.push({key:key,frame:frame}):console.warn("generateFrameNames: Frame missing: "+frame+" from texture: "+key)}else for(frames=texture.getFrameNames(),i=0;i<frames.length;i++)out.push({key:key,frame:frames[i]});return out},generateFrameNumbers:function(key,config){var start=GetValue$x(config,"start",0),end=GetValue$x(config,"end",-1),first=GetValue$x(config,"first",!1),out=GetValue$x(config,"outputArray",[]),frames=GetValue$x(config,"frames",!1),texture=this.textureManager.get(key);if(!texture)return out;first&&texture.has(first)&&out.push({key:key,frame:first}),frames||(-1===end&&(end=texture.frameTotal-2),frames=NumberArray(start,end));for(var i=0;i<frames.length;i++)texture.has(frames[i])?out.push({key:key,frame:frames[i]}):console.warn("generateFrameNumbers: Frame "+i+" missing from texture: "+key);return out},get:function(key){return this.anims.get(key)},pauseAll:function(){return this.paused||(this.paused=!0,this.emit
vendor: 18,609 bytes, line 38
38(Events$Q.PAUSE_ALL)),this},play:function(key,children){Array.isArray(children)||(children=[children]);for(var i=0;i<children.length;i++)children[i].anims.play(key);return this},staggerPlay:function(key,children,stagger,staggerFirst){void 0===stagger&&(stagger=0),void 0===staggerFirst&&(staggerFirst=!0),Array.isArray(children)||(children=[children]);var len=children.length;staggerFirst||len--;for(var i=0;i<children.length;i++){var time=stagger<0?Math.abs(stagger)*(len-i):stagger*i;children[i].anims.playAfterDelay(key,time)}return this},remove:function(key){var anim=this.get(key);return anim&&(this.emit(Events$Q.REMOVE_ANIMATION,key,anim),this.anims.delete(key),this.removeMix(key)),anim},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(Events$Q.RESUME_ALL)),this},toJSON:function(key){var output={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==key&&""!==key?output.anims.push(this.anims.get(key).toJSON()):this.anims.each((function(animationKey,animation){output.anims.push(animation.toJSON())})),output},destroy:function(){this.anims.clear(),this.mixes.clear(),this.textureManager=null,this.game=null}}),AnimationManager_1=AnimationManager$1,CustomMap$2=_Map,GetFastValue$1h=GetFastValue_1,Events$P=events$f,Animation=Animation_1,AnimationState$3=new Class_1({initialize:function(parent){this.parent=parent,this.animationManager=parent.scene.sys.anims,this.animationManager.on(Events$P.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(key){var parent=this.parent;if(void 0===key)return this.nextAnimsQueue.length=0,this.nextAnim=null,parent;Array.isArray(key)||(key=[key]);for(var i=0;i<key.length;i++){var anim=key[i];null===this.nextAnim?this.nextAnim=anim:this.nextAnimsQueue.push(anim)}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(key){this.isPlaying&&this.stop();var manager=this.animationManager,animKey="string"==typeof key?key:GetFastValue$1h(key,"key",null),anim=this.exists(animKey)?this.get(animKey):manager.get(animKey);if(anim){this.currentAnim=anim;var totalFrames=anim.getTotalFrames(),frameRate=GetFastValue$1h(key,"frameRate",anim.frameRate),duration=GetFastValue$1h(key,"duration",anim.duration);anim.calculateDuration(this,totalFrames,duration,frameRate),this.delay=GetFastValue$1h(key,"delay",anim.delay),this.repeat=GetFastValue$1h(key,"repeat",anim.repeat),this.repeatDelay=GetFastValue$1h(key,"repeatDelay",anim.repeatDelay),this.yoyo=GetFastValue$1h(key,"yoyo",anim.yoyo),this.showOnStart=GetFastValue$1h(key,"showOnStart",anim.showOnStart),this.hideOnComplete=GetFastValue$1h(key,"hideOnComplete",anim.hideOnComplete),this.skipMissedFrames=GetFastValue$1h(key,"skipMissedFrames",anim.skipMissedFrames),this.timeScale=GetFastValue$1h(key,"timeScale",this.timeScale);var startFrame=GetFastValue$1h(key,"startFrame",0);startFrame>anim.getTotalFrames()&&(startFrame=0);var frame=anim.frames[startFrame];0!==startFrame||this.forward||(frame=anim.getLastFrame()),this.currentFrame=frame}else console.warn("Missing animation: "+animKey);return this.parent},pause:function(atFrame){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==atFrame&&this.setCurrentFrame(atFrame),this.parent},resume:function(fromFrame){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==fromFrame&&this.setCurrentFrame(fromFrame),this.parent},playAfterDelay:function(key,delay){if(this.isPlaying){var nextAnim=this.nextAnim,queue=this.nextAnimsQueue;nextAnim&&queue.unshift(nextAnim),this.nextAnim=key,this._pendingStop=1,this._pendingStopValue=delay}else this.delayCounter=delay,this.play(key,!0);return this.parent},playAfterRepeat:function(key,repeatCount){if(void 0===repeatCount&&(repeatCount=1),this.isPlaying){var nextAnim=this.nextAnim,queue=this.nextAnimsQueue;nextAnim&&queue.unshift(nextAnim),-1!==this.repeatCounter&&repeatCount>this.repeatCounter&&(repeatCount=this.repeatCounter),this.nextAnim=key,this._pendingStop=2,this._pendingStopValue=repeatCount}else this.play(key);return this.parent},play:function(key,ignoreIfPlaying){void 0===ignoreIfPlaying&&(ignoreIfPlaying=!1);var currentAnim=this.currentAnim,parent=this.parent,animKey="string"==typeof key?key:key.key;if(ignoreIfPlaying&&this.isPlaying&&currentAnim.key===animKey)return parent;if(currentAnim&&this.isPlaying){var mix=this.animationManager.getMix(currentAnim.key,key);if(mix>0)return this.playAfterDelay(key,mix)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(key)},playReverse:function(key,ignoreIfPlaying){void 0===ignoreIfPlaying&&(ignoreIfPlaying=!1);var animKey="string"==typeof key?key:key.key;return ignoreIfPlaying&&this.isPlaying&&this.currentAnim.key===animKey?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(key))},startAnimation:function(key){this.load(key);var anim=this.currentAnim,gameObject=this.parent;return anim?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,anim.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),gameObject):gameObject},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(Events$P.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(Events$P.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(Events$P.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(Events$P.ANIMATION_COMPLETE,Events$P.ANIMATION_COMPLETE_KEY)},emitEvents:function(event,keyEvent){var anim=this.currentAnim,frame=this.currentFrame,gameObject=this.parent,frameKey=frame.textureFrame;gameObject.emit(event,anim,frame,gameObject,frameKey),keyEvent&&gameObject.emit(keyEvent+anim.key,anim,frame,gameObject,frameKey)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var frame=this.currentFrame;if(!frame)return 0;var p=frame.progress;return this.inReverse&&(p*=-1),p},setProgress:function(value){return this.forward||(value=1-value),this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)),this.parent},setRepeat:function(value){return this.repeatCounter=-1===value?Number.MAX_VALUE:value,this.parent},globalRemove:function(key,animation){void 0===animation&&(animation=this.currentAnim),this.isPlaying&&animation.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(includeDelay,resetRepeats){void 0===includeDelay&&(includeDelay=!1),void 0===resetRepeats&&(resetRepeats=!1);var anim=this.currentAnim,gameObject=this.parent;return anim?(resetRepeats&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),anim.getFirstTick(this),this.emitEvents(Events$P.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!includeDelay,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(anim.frames[0]),this.parent):gameObject},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var key=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(key)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var key=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(key)}return this.parent},stopAfterDelay:function(delay){return this._pendingStop=1,this._pendingStopValue=delay,this.parent},stopAfterRepeat:function(repeatCount){return void 0===repeatCount&&(repeatCount=1),-1!==this.repeatCounter&&repeatCount>this.repeatCounter&&(repeatCount=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=repeatCount,this.parent},stopOnFrame:function(frame){return this._pendingStop=3,this._pendingStopValue=frame,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(time,delta){var anim=this.currentAnim;if(this.isPlaying&&anim&&!anim.paused){if(this.accumulator+=delta*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=delta,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?anim.nextFrame(this):anim.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var safetyNet=0;do{this.forward?anim.nextFrame(this):anim.previousFrame(this),safetyNet++}while(this.isPlaying&&this.accumulator>this.nextTick&&safetyNet<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(animationFrame){var gameObject=this.parent;return this.currentFrame=animationFrame,gameObject.texture=animationFrame.frame.texture,gameObject.frame=animationFrame.frame,gameObject.isCropped&&gameObject.frame.updateCropUVs(gameObject._crop,gameObject.flipX,gameObject.flipY),animationFrame.setAlpha&&(gameObject.alpha=animationFrame.alpha),gameObject.setSizeToFrame(),gameObject._originComponent&&(animationFrame.frame.customPivot?gameObject.setOrigin(animationFrame.frame.pivotX,animationFrame.frame.pivotY):gameObject.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(Events$P.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===animationFrame&&this.stop()),gameObject},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(key){return this.anims?this.anims.get(key):null},exists:function(key){return!!this.anims&&this.anims.has(key)},create:function(config){var key=config.key,anim=!1;return key&&((anim=this.get(key))||(anim=new Animation(this,key,config),this.anims||(this.anims=new CustomMap$2),this.anims.set(key,anim))),anim},generateFrameNames:function(key,config){return this.animationManager.generateFrameNames(key,config)},generateFrameNumbers:function(key,config){return this.animationManager.generateFrameNumbers(key,config)},remove:function(key){var anim=this.get(key);return anim&&(this.currentAnim===anim&&this.stop(),this.anims.delete(key)),anim},destroy:function(){this.animationManager.off(Events$P.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}}),AnimationState_1=AnimationState$3,animations={Animation:Animation_1,AnimationFrame:AnimationFrame_1,AnimationManager:AnimationManager_1,AnimationState:AnimationState_1,Events:events$f},events$e={ADD:"add",REMOVE:"remove"},CustomMap$1=_Map,EventEmitter$s=eventemitter3.exports,Events$O=events$e,BaseCache$1=new Class_1({initialize:function(){this.entries=new CustomMap$1,this.events=new EventEmitter$s},add:function(key,data){return this.entries.set(key,data),this.events.emit(Events$O.ADD,this,key,data),this},has:function(key){return this.entries.has(key)},exists:function(key){return this.entries.has(key)},get:function(key){return this.entries.get(key)},remove:function(key){var entry=this.get(key);return entry&&(this.entries.delete(key),this.events.emit(Events$O.REMOVE,this,key,entry.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}}),BaseCache_1=BaseCache$1,BaseCache=BaseCache_1,GameEvents$d=events$k,CacheManager$1=new Class_1({initialize:function(game){this.game=game,this.binary=new BaseCache,this.bitmapFont=new BaseCache,this.json=new BaseCache,this.physics=new BaseCache,this.shader=new BaseCache,this.audio=new BaseCache,this.video=new BaseCache,this.text=new BaseCache,this.html=new BaseCache,this.obj=new BaseCache,this.tilemap=new BaseCache,this.xml=new BaseCache,this.custom={},this.game.events.once(GameEvents$d.DESTROY,this.destroy,this)},addCustom:function(key){return this.custom.hasOwnProperty(key)||(this.custom[key]=new BaseCache),this.custom[key]},destroy:function(){for(var keys=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],i=0;i<keys.length;i++)this[keys[i]].destroy(),this[keys[i]]=null;for(var key in this.custom)this.custom[key].destroy();this.custom=null,this.game=null}}),CacheManager_1=CacheManager$1,cache={BaseCache:BaseCache_1,CacheManager:CacheManager_1,Events:events$e},GetValue$w=GetValue_1,FixedKeyControl=new Class_1({initialize:function(config){this.camera=GetValue$w(config,"camera",null),this.left=GetValue$w(config,"left",null),this.right=GetValue$w(config,"right",null),this.up=GetValue$w(config,"up",null),this.down=GetValue$w(config,"down",null),this.zoomIn=GetValue$w(config,"zoomIn",null),this.zoomOut=GetValue$w(config,"zoomOut",null),this.zoomSpeed=GetValue$w(config,"zoomSpeed",.01),this.minZoom=GetValue$w(config,"minZoom",.001),this.maxZoom=GetValue$w(config,"maxZoom",1e3),this.speedX=0,this.speedY=0;var speed=GetValue$w(config,"speed",null);"number"==typeof speed?(this.speedX=speed,this.speedY=speed):(this.speedX=GetValue$w(config,"speed.x",0),this.speedY=GetValue$w(config,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(camera){return this.camera=camera,this},update:function(delta){if(this.active){void 0===delta&&(delta=1);var cam=this.camera;this.up&&this.up.isDown?cam.scrollY-=this.speedY*delta|0:this.down&&this.down.isDown&&(cam.scrollY+=this.speedY*delta|0),this.left&&this.left.isDown?cam.scrollX-=this.speedX*delta|0:this.right&&this.right.isDown&&(cam.scrollX+=this.speedX*delta|0),this.zoomIn&&this.zoomIn.isDown?(cam.zoom-=this.zoomSpeed,cam.zoom<this.minZoom&&(cam.zoom=this.minZoom)):this.zoomOut&&this.zoomOut.isDown&&(cam.zoom+=this.zoomSpeed,cam.zoom>this.maxZoom&&(cam.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}}),GetValue$v=GetValue_1,controls={FixedKeyControl:FixedKeyControl,SmoothedKeyControl:new Class_1({initialize:function(config){this.camera=GetValue$v(config,"camera",null),this.left=GetValue$v(config,"left",null),this.right=GetValue$v(config,"right",null),this.up=GetValue$v(config,"up",null),this.down=GetValue$v(config,"down",null),this.zoomIn=GetValue$v(config,"zoomIn",null),this.zoomOut=GetValue$v(config,"zoomOut",null),this.zoomSpeed=GetValue$v(config,"zoomSpeed",.01),this.minZoom=GetValue$v(config,"minZoom",.001),this.maxZoom=GetValue$v(config,"maxZoom",1e3),this.accelX=0,this.accelY=0;var accel=GetValue$v(config,"acceleration",null);"number"==typeof accel?(this.accelX=accel,this.accelY=accel):(this.accelX=GetValue$v(config,"acceleration.x",0),this.accelY=GetValue$v(config,"acceleration.y",0)),this.dragX=0,this.dragY=0;var drag=GetValue$v(config,"drag",null);"number"==typeof drag?(this.dragX=drag,this.dragY=drag):(this.dragX=GetValue$v(config,"drag.x",0),this.dragY=GetValue$v(config,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var maxSpeed=GetValue$v(config,"maxSpeed",null);"number"==typeof maxSpeed?(this.maxSpeedX=maxSpeed,this.maxSpeedY=maxSpeed):(this.maxSpeedX=GetValue$v(config,"maxSpeed.x",0),this.maxSpeedY=GetValue$v(config,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(camera){return this.camera=camera,this},update:function(delta){if(this.active){void 0===delta&&(delta=1);var cam=this.camera;this._speedX>0?(this._speedX-=this.dragX*delta,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*delta,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*delta,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*delta,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(cam.scrollX-=this._speedX*delta|0),0!==this._speedY&&(cam.scrollY-=this._speedY*delta|0),0!==this._zoom&&(cam.zoom+=this._zoom,cam.zoom<this.minZoom?cam.zoom=this.minZoom:cam.zoom>this.maxZoom&&(cam.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}})},events$d={DESTROY:"cameradestroy",FADE_IN_COMPLETE:"camerafadeincomplete",FADE_IN_START:"camerafadeinstart",FADE_OUT_COMPLETE:"camerafadeoutcomplete",FADE_OUT_START:"camerafadeoutstart",FLASH_COMPLETE:"cameraflashcomplete",FLASH_START:"cameraflashstart",FOLLOW_UPDATE:"followupdate",PAN_COMPLETE:"camerapancomplete",PAN_START:"camerapanstart",POST_RENDER:"postrender",PRE_RENDER:"prerender",ROTATE_COMPLETE:"camerarotatecomplete",ROTATE_START:"camerarotatestart",SHAKE_COMPLETE:"camerashakecomplete",
38SHAKE_START:"camerashakestart",ZOOM_COMPLETE:"camerazoomcomplete",ZOOM_START:"camerazoomstart"},GetColor_1=function(red,green,blue){return red<<16|green<<8|blue},GetColor32_1=function(red,green,blue,alpha){return alpha<<24|red<<16|green<<8|blue},GetColor$3=GetColor_1;
39/**
40	 * @author       Richard Davey <[email protected]>
41	 * @copyright    2020 Photon Storm Ltd.
42	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
43	 */function ConvertValue(n,h,s,v){var k=(n+6*h)%6,min=Math.min(k,4-k,1);return Math.round(255*(v-v*s*Math.max(0,min)))}var HSVToRGB_1=function(h,s,v,out){void 0===s&&(s=1),void 0===v&&(v=1);var r=ConvertValue(5,h,s,v),g=ConvertValue(3,h,s,v),b=ConvertValue(1,h,s,v);return out?out.setTo?out.setTo(r,g,b,out.alpha,!1):(out.r=r,out.g=g,out.b=b,out.color=GetColor$3(r,g,b),out):{r:r,g:g,b:b,color:GetColor$3(r,g,b)}},RGBToHSV_1=function(r,g,b,out){void 0===out&&(out={h:0,s:0,v:0}),r/=255,g/=255,b/=255;var min=Math.min(r,g,b),max=Math.max(r,g,b),d=max-min,h=0,s=0===max?0:d/max,v=max;return max!==min&&(max===r?h=(g-b)/d+(g<b?6:0):max===g?h=(b-r)/d+2:max===b&&(h=(r-g)/d+4),h/=6),out.hasOwnProperty("_h")?(out._h=h,out._s=s,out._v=v):(out.h=h,out.s=s,out.v=v),out}
43,GetColor$2=GetColor_1,GetColor32=GetColor32_1,HSVToRGB$1=HSVToRGB_1,RGBToHSV=RGBToHSV_1,Color$c=new Class_1({initialize:function(red,green,blue,alpha){void 0===red&&(red=0),void 0===green&&(green=0),void 0===blue&&(blue=0),void 0===alpha&&(alpha=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(red,green,blue,alpha)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(red,green,blue,alpha,updateHSV){return void 0===alpha&&(alpha=255),void 0===updateHSV&&(updateHSV=!0),this._locked=!0,this.red=red,this.green=green,this.blue=blue,this.alpha=alpha,this._locked=!1,this.update(updateHSV)},setGLTo:function(red,green,blue,alpha){return void 0===alpha&&(alpha=1),this._locked=!0,this.redGL=red,this.greenGL=green,this.blueGL=blue,this.alphaGL=alpha,this._locked=!1,this.update(!0)},setFromRGB:function(color){return this._locked=!0,this.red=color.r,this.green=color.g,this.blue=color.b,color.hasOwnProperty("a")&&(this.alpha=color.a),this._locked=!1,this.update(!0)},setFromHSV:function(h,s,v){return HSVToRGB$1(h,s,v,this)},update:function(updateHSV){if(void 0===updateHSV&&(updateHSV=!1),this._locked)return this;var r=this.r,g=this.g,b=this.b,a=this.a;return this._color=GetColor$2(r,g,b),this._color32=GetColor32(r,g,b,a),this._rgba="rgba("+r+","+g+","+b+","+a/255+")",updateHSV&&RGBToHSV(r,g,b,this),this},updateHSV:function(){var r=this.r,g=this.g,b=this.b;return RGBToHSV(r,g,b,this),this},clone:function(){return new Color$c(this.r,this.g,this.b,this.a)},gray:function(shade){return this.setTo(shade,shade,shade)},random:function(min,max){void 0===min&&(min=0),void 0===max&&(max=255);var r=Math.floor(min+Math.random()*(max-min)),g=Math.floor(min+Math.random()*(max-min)),b=Math.floor(min+Math.random()*(max-min));return this.setTo(r,g,b)},randomGray:function(min,max){void 0===min&&(min=0),void 0===max&&(max=255);var s=Math.floor(min+Math.random()*(max-min));return this.setTo(s,s,s)},saturate:function(amount){return this.s+=amount/100,this},desaturate:function(amount){return this.s-=amount/100,this},lighten:function(amount){return this.v+=amount/100,this},darken:function(amount){return this.v-=amount/100,this},brighten:function(amount){var r=this.r,g=this.g,b=this.b;return r=Math.max(0,Math.min(255,r-Math.round(-amount/100*255))),g=Math.max(0,Math.min(255,g-Math.round(-amount/100*255))),b=Math.max(0,Math.min(255,b-Math.round(-amount/100*255))),this.setTo(r,g,b)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(value){this.gl[0]=Math.min(Math.abs(value),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(value){this.gl[1]=Math.min(Math.abs(value),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(value){this.gl[2]=Math.min(Math.abs(value),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(value){this.gl[3]=Math.min(Math.abs(value),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(value){value=Math.floor(Math.abs(value)),this.r=Math.min(value,255),this.gl[0]=value/255,this.update(!0)}},green:{get:function(){return this.g},set:function(value){value=Math.floor(Math.abs(value)),this.g=Math.min(value,255),this.gl[1]=value/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(value){value=Math.floor(Math.abs(value)),this.b=Math.min(value,255),this.gl[2]=value/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(value){value=Math.floor(Math.abs(value)),this.a=Math.min(value,255),this.gl[3]=value/255,this.update()}},h:{get:function(){return this._h},set:function(value){this._h=value,HSVToRGB$1(value,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(value){this._s=value,HSVToRGB$1(this._h,value,this._v,this)}},v:{get:function(){return this._v},set:function(value){this._v=value,HSVToRGB$1(this._h,this._s,value,this)}}}),Color_1=Color$c,Color$b=Color_1,HexStringToColor_1=function(hex){var color=new Color$b;hex=hex.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(m,r,g,b){return r+r+g+g+b+b}));var result=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);if(result){var r=parseInt(result[1],16),g=parseInt(result[2],16),b=parseInt(result[3],16);color.setTo(r,g,b)}return color},IntegerToRGB_1=function(color){return color>16777215?{a:color>>>24,r:color>>16&255,g:color>>8&255,b:255&color}:{a:255,r:color>>16&255,g:color>>8&255,b:255&color}},Color$a=Color_1,IntegerToRGB=IntegerToRGB_1,IntegerToColor_1=function(input){var rgb=IntegerToRGB(input);return new Color$a(rgb.r,rgb.g,rgb.b,rgb.a)},Color$9=Color_1,ObjectToColor_1=function(input){return new Color$9(input.r,input.g,input.b,input.a)},Color$8=Color_1,RGBStringToColor_1=function(rgb){var color=new Color$8,result=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(rgb.toLowerCase());if(result){var r=parseInt(result[1],10),g=parseInt(result[2],10),b=parseInt(result[3],10),a=void 0!==result[4]?parseFloat(result[4]):1;color.setTo(r,g,b,255*a)}return color},HexStringToColor=HexStringToColor_1,IntegerToColor$1=IntegerToColor_1,ObjectToColor=ObjectToColor_1,RGBStringToColor=RGBStringToColor_1,ValueToColor_1=function(input){switch(typeof input){case"string":return"rgb"
43===input.substr(0,3).toLowerCase()?RGBStringToColor(input):HexStringToColor(input);case"number":return IntegerToColor$1(input);case"object":return ObjectToColor(input)}},DegToRad$8=DegToRad_1,EventEmitter$r=eventemitter3.exports,Events$N=events$d,Rectangle$s=Rectangle_1$1,TransformMatrix$e=TransformMatrix_1,ValueToColor$1=ValueToColor_1,Vector2$M=Vector2_1,BaseCamera$2=new Class_1({Extends:EventEmitter$r,Mixins:[components$3.Alpha,components$3.Visible],initialize:function(x,y,width,height){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=0),void 0===height&&(height=0),EventEmitter$r.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new Rectangle$s,this.dirty=!0,this._x=x,this._y=y,this._width=width,this._height=height,this._bounds=new Rectangle$s,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new TransformMatrix$e,this.transparent=!0,this.backgroundColor=ValueToColor$1("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new Vector2$M(width/2,height/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(child){this.renderList.push(child)},setOrigin:function(x,y){return void 0===x&&(x=.5),void 0===y&&(y=x),this.originX=x,this.originY=y,this},getScroll:function(x,y,out){void 0===out&&(out=new Vector2$M);var originX=.5*this.width,originY=.5*this.height;return out.x=x-originX,out.y=y-originY,this.useBounds&&(out.x=this.clampX(out.x),out.y=this.clampY(out.y)),out},centerOnX:function(x){var originX=.5*this.width;return this.midPoint.x=x,this.scrollX=x-originX,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(y){var originY=.5*this.height;return this.midPoint.y=y,this.scrollY=y-originY,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(x,y){return this.centerOnX(x),this.centerOnY(y),this},centerToBounds:function(){if(this.useBounds){var bounds=this._bounds,originX=.5*this.width,originY=.5*this.height;this.midPoint.set(bounds.centerX,bounds.centerY),this.scrollX=bounds.centerX-originX,this.scrollY=bounds.centerY-originY}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(renderableObjects){if(this.disableCull)return renderableObjects;var cameraMatrix=this.matrix.matrix,mva=cameraMatrix[0],mvb=cameraMatrix[1],mvc=cameraMatrix[2],mvd=cameraMatrix[3],determinant=mva*mvd-mvb*mvc;if(!determinant)return renderableObjects;var mve=cameraMatrix[4],mvf=cameraMatrix[5],scrollX=this.scrollX,scrollY=this.scrollY,cameraW=this.width,cameraH=this.height,cullTop=this.y,cullBottom=cullTop+cameraH,cullLeft=this.x,cullRight=cullLeft+cameraW,culledObjects=this.culledObjects,length=renderableObjects.length;determinant=1/determinant,culledObjects.length=0;for(var index=0;index<length;++index){var object=renderableObjects[index];if(object.hasOwnProperty("width")&&!object.parentContainer){var objectW=object.width,objectH=object.height,objectX=object.x-scrollX*object.scrollFactorX-objectW*object.originX,objectY=object.y-scrollY*object.scrollFactorY-objectH*object.originY;(objectX+objectW)*mva+(objectY+objectH)*mvc+mve>cullLeft&&objectX*mva+objectY*mvc+mve<cullRight&&(objectX+objectW)*mvb+(objectY+objectH)*mvd+mvf>cullTop&&objectX*mvb+objectY*mvd+mvf<cullBottom&&culledObjects.push(object)}else culledObjects.push(object)}return culledObjects},getWorldPoint:function(x,y,output){void 0===output&&(output=new Vector2$M);var cameraMatrix=this.matrix.matrix,mva=cameraMatrix[0],mvb=cameraMatrix[1],mvc=cameraMatrix[2],mvd=cameraMatrix[3],mve=cameraMatrix[4],mvf=cameraMatrix[5],determinant=mva*mvd-mvb*mvc;if(!determinant)return output.x=x,output.y=y,output;var ima=mvd*(determinant=1/determinant),imb=-mvb*determinant,imc=-mvc*determinant,imd=mva*determinant,ime=(mvc*mvf-mvd*mve)*determinant,imf=(mvb*mve-mva*mvf)*determinant,c=Math.cos(this.rotation),s=Math.sin(this.rotation),zoomX=this.zoomX,zoomY=this.zoomY,scrollX=this.scrollX,scrollY=this.scrollY,sx=x+(scrollX*c-scrollY*s)*zoomX,sy=y+(scrollX*s+scrollY*c)*zoomY;return output.x=sx*ima+sy*imc+ime,output.y=sx*imb+sy*imd+imf,output},ignore:function(entries){var id=this.id;
43Array.isArray(entries)||(entries=[entries]);for(var i=0;i<entries.length;i++){var entry=entries[i];Array.isArray(entry)?this.ignore(entry):entry.isParent?this.ignore(entry.getChildren()):entry.cameraFilter|=id}return this},preRender:function(){this.renderList.length=0;var width=this.width,height=this.height,halfWidth=.5*width,halfHeight=.5*height,zoomX=this.zoomX,zoomY=this.zoomY,matrix=this.matrix,originX=width*this.originX,originY=height*this.originY,sx=this.scrollX,sy=this.scrollY;this.useBounds&&(sx=this.clampX(sx),sy=this.clampY(sy)),this.roundPixels&&(originX=Math.round(originX),originY=Math.round(originY)),this.scrollX=sx,this.scrollY=sy;var midX=sx+halfWidth,midY=sy+halfHeight;this.midPoint.set(midX,midY);var displayWidth=width/zoomX,displayHeight=height/zoomY;this.worldView.setTo(midX-displayWidth/2,midY-displayHeight/2,displayWidth,displayHeight),matrix.applyITRS(this.x+originX,this.y+originY,this.rotation,zoomX,zoomY),matrix.translate(-originX,-originY)},clampX:function(x){var bounds=this._bounds,dw=this.displayWidth,bx=bounds.x+(dw-this.width)/2,bw=Math.max(bx,bx+bounds.width-dw);return x<bx?x=bx:x>bw&&(x=bw),x},clampY:function(y){var bounds=this._bounds,dh=this.displayHeight,by=bounds.y+(dh-this.height)/2,bh=Math.max(by,by+bounds.height-dh);return y<by?y=by:y>bh&&(y=bh),y},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(value){return void 0===value&&(value=0),this.rotation=DegToRad$8(value),this},setBackgroundColor:function(color){return void 0===color&&(color="rgba(0,0,0,0)"),this.backgroundColor=ValueToColor$1(color),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(x,y,width,height,centerOn){return void 0===centerOn&&(centerOn=!1),this._bounds.setTo(x,y,width,height),this.dirty=!0,this.useBounds=!0,centerOn?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(out){void 0===out&&(out=new Rectangle$s);var source=this._bounds;return out.setTo(source.x,source.y,source.width,source.height),out},setName:function(value){return void 0===value&&(value=""),this.name=value,this},setPosition:function(x,y){return void 0===y&&(y=x),this.x=x,this.y=y,this},setRotation:function(value){return void 0===value&&(value=0),this.rotation=value,this},setRoundPixels:function(value){return this.roundPixels=value,this},setScene:function(scene){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=scene;var sys=scene.sys;return this.sceneManager=sys.game.scene,this.scaleManager=sys.scale,this.cameraManager=sys.cameras,this.updateSystem(),this},setScroll:function(x,y){return void 0===y&&(y=x),this.scrollX=x,this.scrollY=y,this},setSize:function(width,height){return void 0===height&&(height=width),this.width=width,this.height=height,this},setViewport:function(x,y,width,height){return this.x=x,this.y=y,this.width=width,this.height=height,this},setZoom:function(x,y){return void 0===x&&(x=1),void 0===y&&(y=x),0===x&&(x=.001),0===y&&(y=.001),this.zoomX=x,this.zoomY=y,this},setMask:function(mask,fixedPosition){return void 0===fixedPosition&&(fixedPosition=!0),this.mask=mask,this._maskCamera=fixedPosition?this.cameraManager.default:this,this},clearMask:function(destroyMask){return void 0===destroyMask&&(destroyMask=!1),destroyMask&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var output={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(output.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),output},update:function(){},updateSystem:function(){if(this.scaleManager){var custom=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,sceneManager=this.sceneManager;custom&&!this._customViewport?sceneManager.customViewports++:!custom&&this._customViewport&&sceneManager.customViewports--,this.dirty=!0,this._customViewport=custom}}
vendor: 2,651 bytes, line 43
43,destroy:function(){this.emit(Events$N.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(value){this._x=value,this.updateSystem()}},y:{get:function(){return this._y},set:function(value){this._y=value,this.updateSystem()}},width:{get:function(){return this._width},set:function(value){this._width=value,this.updateSystem()}},height:{get:function(){return this._height},set:function(value){this._height=value,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(value){this._scrollX=value,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(value){this._scrollY=value,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(value){this._zoomX=value,this._zoomY=value,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(value){this._zoomX=value,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(value){this._zoomY=value,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(value){this._rotation=value,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}}),BaseCamera_1=BaseCamera$2,CenterOn_1$2=function(rect,x,y){return rect.x=x-rect.width/2,rect.y=y-rect.height/2,rect},Clamp$g=Clamp_1,Events$M=events$d,Fade_1=new Class_1({initialize:function(camera){this.camera=camera,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(direction,duration,red,green,blue,force,callback,context){if(void 0===direction&&(direction=!0),void 0===duration&&(duration=1e3),void 0===red&&(red=0),void 0===green&&(green=0),void 0===blue&&(blue=0),void 0===force&&(force=!1),void 0===callback&&(callback=null),void 0===context&&(context=this.camera.scene),!force&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=duration,this.direction=direction,this.progress=0,this.red=red,this.green=green,this.blue=blue,this.alpha=direction?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=callback,this._onUpdateScope=context;var eventName=direction?Events$M.FADE_OUT_START:Events$M.FADE_IN_START;
43return this.camera.emit(eventName,this.camera,this,duration,red,green,blue),this.camera},update:function(time,delta){this.isRunning&&(this._elapsed+=delta,this.progress=Clamp$g(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:(this.alpha=this.direction?1:0,this.effectComplete()))},postRenderCanvas:function(ctx){if(!this.isRunning&&!this.isComplete)return!1;var camera=this.camera;return ctx.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",ctx.fillRect(camera.x,camera.y,camera.width,camera.height),!0},postRenderWebGL:function(pipeline,getTintFunction){if(!this.isRunning&&!this.isComplete)return!1;var camera=this.camera,red=this.red/255,green=this.green/255,blue=this.blue/255;return pipeline.drawFillRect(camera.x,camera.y,camera.width,camera.height,getTintFunction(blue,green,red,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var eventName=this.direction?Events$M.FADE_OUT_COMPLETE:Events$M.FADE_IN_COMPLETE;
43this.camera.emit(eventName,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}}),Clamp$f=Clamp_1,Events$L=events$d,Flash_1=new Class_1({initialize:function(camera){this.camera=camera,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(duration,red,green,blue,force,callback,context){return void 0===duration&&(duration=250),void 0===red&&(red=255),void 0===green&&(green=255),void 0===blue&&(blue=255),void 0===force&&(force=!1),void 0===callback&&(callback=null),void 0===context&&(context=this.camera.scene),!force&&this.isRunning||(this.isRunning=!0,this.duration=duration,this.progress=0,this.red=red,this.green=green,this.blue=blue,this.alpha=1,this._elapsed=0,this._onUpdate=callback,this._onUpdateScope=context,this.camera.emit(Events$L.FLASH_START,this.camera,this,duration,red,green,blue)),this.camera},update:function(time,delta){this.isRunning&&(this._elapsed+=delta,this.progress=Clamp$f(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(ctx){if(!this.isRunning)return!1;var camera=this.camera;return ctx.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",ctx.fillRect(camera.x,camera.y,camera.width,camera.height),!0},postRenderWebGL:function(pipeline,getTintFunction){if(!this.isRunning)return!1;var camera=this.camera,red=this.red/255,green=this.green/255,blue=this.blue/255;return pipeline.drawFillRect(camera.x,camera.y,camera.width,camera.height,getTintFunction(blue,green,red,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit
43(Events$L.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}}),back={In:function(v,overshoot){return void 0===overshoot&&(overshoot=1.70158),v*v*((overshoot+1)*v-overshoot)},Out:function(v,overshoot){return void 0===overshoot&&(overshoot=1.70158),--v*v*((overshoot+1)*v+overshoot)+1},InOut:function(v,overshoot){void 0===overshoot&&(overshoot=1.70158);var s=1.525*overshoot;return(v*=2)<1?v*v*((s+1)*v-s)*.5:.5*((v-=2)*v*((s+1)*v+s)+2)}},bounce={In:function(v){return(v=1-v)<1/2.75?1-7.5625*v*v:v<2/2.75?1-(7.5625*(v-=1.5/2.75)*v+.75):v<2.5/2.75?1-(7.5625*(v-=2.25/2.75)*v+.9375):1-(7.5625*(v-=2.625/2.75)*v+.984375)},Out:function(v){return v<1/2.75?7.5625*v*v:v<2/2.75?7.5625*(v-=1.5/2.75)*v+.75:v<2.5/2.75?7.5625*(v-=2.25/2.75)*v+.9375:7.5625*(v-=2.625/2.75)*v+.984375},InOut:function(v){var reverse=!1;return v<.5?(v=1-2*v,reverse=!0):v=2*v-1,v<1/2.75?v*=7.5625*v:v=v<2/2.75?7.5625*(v-=1.5/2.75)*v+.75:v<2.5/2.75?7.5625*(v-=2.25/2.75)*v+.9375:7.5625*(v-=2.625/2.75)*v+.984375,reverse?.5*(1-v):.5*v+.5}},circular={In:function(v){return 1-Math.sqrt(1-v*v)},Out:function(v){return Math.sqrt(1- --v*v)},InOut:function(v){return(v*=2)<1?-.5*(Math.sqrt(1-v*v)-1):.5*(Math.sqrt(1-(v-=2)*v)+1)}},cubic={In:function(v){return v*v*v},Out:function(v){return--v*v*v+1},InOut:function(v){return(v*=2)<1?.5*v*v*v:.5*((v-=2)*v*v+2)}},elastic={In:function(v,amplitude,period){if(void 0===amplitude&&(amplitude=.1),void 0===period&&(period=.1),0===v)return 0;if(1===v)return 1;var s=period/4;return amplitude<1?amplitude=1:s=period*Math.asin(1/amplitude)/(2*Math.PI),-amplitude*Math.pow(2,10*(v-=1))*Math.sin((v-s)*(2*Math.PI)/period)},Out:function(v,amplitude,period){if(void 0===amplitude&&(amplitude=.1),void 0===period&&(period=.1),0===v)return 0;if(1===v)return 1;var s=period/4;return amplitude<1?amplitude=1:s=period*Math.asin(1/amplitude)/(2*Math.PI),amplitude*Math.pow(2,-10*v)*Math.sin((v-s)*(2*Math.PI)/period)+1},InOut:function(v,amplitude,period){if(void 0===amplitude&&(amplitude=.1),void 0===period&&(period=.1),0===v)return 0;if(1===v)return 1;var s=period/4;return amplitude<1?amplitude=1:s=period*Math.asin(1/amplitude)/(2*Math.PI),(v*=2)<1?amplitude*Math.pow(2,10*(v-=1))*Math.sin((v-s)*(2*Math.PI)/period)*-.5:amplitude*Math.pow(2,-10*(v-=1))*Math.sin((v-s)*(2*Math.PI)/period)*.5+1}},expo={In:function(v){return Math.pow(2,10*(v-1))-.001},Out:function(v){return 1-Math.pow(2,-10*v)},InOut:function(v){return(v*=2)<1?.5*Math.pow(2,10*(v-1)):.5*(2-Math.pow(2,-10*(v-1)))}},linear=function(v){return v},quadratic={In:function(v){return v*v},Out:function(v){return v*(2-v)},InOut:function(v){return(v*=2)<1?.5*v*v:-.5*(--v*(v-2)-1)}},quartic={In:function(v){return v*v*v*v},Out:function(v){return 1- --v*v*v*v},InOut:function(v){return(v*=2)<1?.5*v*v*v*v:-.5*((v-=2)*v*v*v-2)}},quintic={In:function(v){return v*v*v*v*v},Out:function(v){return--v*v*v*v*v+1},InOut:function(v){return(v*=2)<1?.5*v*v*v*v*v:.5*((v-=2)*v*v*v*v+2)}},sine={In:function(v){return 0===v?0:1===v?1:1-Math.cos(v*Math.PI/2)},Out:function(v){return 0===v?0:1===v?1:Math.sin(v*Math.PI/2)},InOut:function(v){return 0===v?0:1===v?1:.5*(1-Math.cos(Math.PI*v))}},stepped=function(v,steps){return void 0===steps&&(steps=1),v<=0?0:v>=1?1:1/steps*(1+(steps*v|0))},EaseMap$4={Power0:linear,Power1:quadratic.Out,Power2:cubic.Out,Power3:quartic.Out,Power4:quintic.Out,Linear:linear,Quad:quadratic.Out,Cubic:cubic.Out,Quart:quartic.Out,Quint:quintic.Out,Sine:sine.Out,Expo:expo.Out,Circ:circular.Out,Elastic:elastic.Out,Back:back.Out,Bounce:bounce.Out,Stepped:stepped,"Quad.easeIn":quadratic.In,"Cubic.easeIn":cubic.In,"Quart.easeIn":quartic.In,"Quint.easeIn":quintic.In,"Sine.easeIn":sine.In,"Expo.easeIn":expo.In,"Circ.easeIn":circular.In,"Elastic.easeIn":elastic.In,"Back.easeIn":back.In,"Bounce.easeIn":bounce.In,"Quad.easeOut":quadratic.Out,"Cubic.easeOut":cubic.Out,"Quart.easeOut":quartic.Out,"Quint.easeOut":quintic.Out,"Sine.easeOut":sine.Out,"Expo.easeOut":expo.Out,"Circ.easeOut":circular.Out,"Elastic.easeOut":elastic.Out,"Back.easeOut":back.Out,"Bounce.easeOut":bounce.Out,"Quad.easeInOut":quadratic.InOut,"Cubic.easeInOut":cubic.InOut,"Quart.easeInOut":quartic.InOut,"Quint.easeInOut":quintic.InOut,"Sine.easeInOut":sine.InOut,"Expo.easeInOut":expo.InOut,"Circ.easeInOut":circular.InOut,"Elastic.easeInOut":elastic.InOut,"Back.easeInOut":back.InOut,"Bounce.easeInOut":bounce.InOut},Clamp$e=Clamp_1,EaseMap$3=EaseMap$4,Events$K=events$d,Vector2$L=Vector2_1,Pan_1=new Class_1({initialize:function(camera){this.camera=camera,this.isRunning=!1,this.duration=0,this.source=new Vector2$L,this.current=ne
vendor: 1,593 bytes, line 43
43w Vector2$L,this.destination=new Vector2$L,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(x,y,duration,ease,force,callback,context){void 0===duration&&(duration=1e3),void 0===ease&&(ease=EaseMap$3.Linear),void 0===force&&(force=!1),void 0===callback&&(callback=null),void 0===context&&(context=this.camera.scene);var cam=this.camera;return!force&&this.isRunning||(this.isRunning=!0,this.duration=duration,this.progress=0,this.source.set(cam.scrollX,cam.scrollY),this.destination.set(x,y),cam.getScroll(x,y,this.current),"string"==typeof ease&&EaseMap$3.hasOwnProperty(ease)?this.ease=EaseMap$3[ease]:"function"==typeof ease&&(this.ease=ease),this._elapsed=0,this._onUpdate=callback,this._onUpdateScope=context,this.camera.emit(Events$K.PAN_START,this.camera,this,duration,x,y)),cam},update:function(time,delta){if(this.isRunning){this._elapsed+=delta;var progress=Clamp$e(this._elapsed/this.duration,0,1);this.progress=progress;var cam=this.camera;if(this._elapsed<this.duration){var v=this.ease(progress);cam.getScroll(this.destination.x,this.destination.y,this.current);var x=this.source.x+(this.current.x-this.source.x)*v,y=this.source.y+(this.current.y-this.source.y)*v;cam.setScroll(x,y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,cam,progress,x,y)}else cam.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,cam,progress,cam.scrollX,cam.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit
43(Events$K.PAN_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}}),Clamp$d=Clamp_1,Events$J=events$d,Vector2$K=Vector2_1,Shake_1=new Class_1({initialize:function(camera){this.camera=camera,this.isRunning=!1,this.duration=0,this.intensity=new Vector2$K,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(duration,intensity,force,callback,context){return void 0===duration&&(duration=100),void 0===intensity&&(intensity=.05),void 0===force&&(force=!1),void 0===callback&&(callback=null),void 0===context&&(context=this.camera.scene),!force&&this.isRunning||(this.isRunning=!0,this.duration=duration,this.progress=0,"number"==typeof intensity?this.intensity.set(intensity):this.intensity.set(intensity.x,intensity.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=callback,this._onUpdateScope=context,this.camera.emit
43(Events$J.SHAKE_START,this.camera,this,duration,intensity)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(time,delta){if(this.isRunning)if(this._elapsed+=delta,this.progress=Clamp$d(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var intensity=this.intensity,width=this.camera.width,height=this.camera.height,zoom=this.camera.zoom;this._offsetX=(Math.random()*intensity.x*width*2-intensity.x*width)*zoom,this._offsetY=(Math.random()*intensity.y*height*2-intensity.y*height)*zoom,this.camera.roundPixels&&(this._offsetX=Math.round(this._offsetX),this._offsetY=Math.round(this._offsetY))}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(Events$J.SHAKE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}}),Clamp$c=Clamp_1,Events$I=events$d,EaseMap$2=EaseMap$4,RotateTo$2=new Class_1({initialize:function(camera){this.camera=camera,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(radians,shortestPath,duration,ease,force,callback,context){void 0===duration&&(duration=1e3),void 0===ease&&(ease=EaseMap$2.Linear),void 0===force&&(force=!1),void 0===callback&&(callback=null),void 0===context&&(context=this.camera.scene),void 0===shortestPath&&(shortestPath=!1),this.shortestPath=shortestPath;var tmpDestination=radians;radians<0?(tmpDestination=-1*radians,this.clockwise=!1):this.clockwise=!0;var maxRad=360*Math.PI/180;tmpDestination-=Math.floor(tmpDestination/maxRad)*maxRad;var cam=this.camera;if(!force&&this.isRunning)return cam;if(this.isRunning=!0,this.duration=duration,this.progress=0,this.source=cam.rotation,this.destination=tmpDestination,"string"==typeof ease&&EaseMap$2.hasOwnProperty(ease)?this.ease=EaseMap$2[ease]:"function"==typeof ease&&(this.ease=ease),this._elapsed=0,this._onUpdate=callback,this._onUpdateScope=context,this.shortestPath){var cwDist=0,acwDist=0;(cwDist=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+maxRad)-this.source)<(acwDist=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+maxRad)-this.destination)?this.clockwise=!0:cwDist>acwDist&&(this.clockwise=!1)}
43return this.camera.emit(Events$I.ROTATE_START,this.camera,this,duration,tmpDestination),cam},update:function(time,delta){if(this.isRunning){this._elapsed+=delta;var progress=Clamp$c(this._elapsed/this.duration,0,1);this.progress=progress;var cam=this.camera;if(this._elapsed<this.duration){var v=this.ease(progress);this.current=cam.rotation;var distance=0,maxRad=360*Math.PI/180,target=this.destination,current=this.current;!1===this.clockwise&&(target=this.current,current=this.destination),distance=target>=current?Math.abs(target-current):Math.abs(target+maxRad)-current;var r=0;r=this.clockwise?cam.rotation+distance*v:cam.rotation-distance*v,cam.rotation=r,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,cam,progress,r)}else cam.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,cam,progress,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(Events$I.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}}),Clamp$b=Clamp_1,EaseMap$1=EaseMap$4,Events$H=events$d,effects={Fade:Fade_1,Flash:Flash_1,Pan:Pan_1,Shake:Shake_1,RotateTo:RotateTo$2,Zoom:new Class_1({initialize:function(camera){this.camera=camera,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(zoom,duration,ease,force,callback,context){void 0===duration&&(duration=1e3),void 0===ease&&(ease=EaseMap$1.Linear),void 0===force&&(force=!1),void 0===callback&&(callback=null),void 0===context&&(context=this.camera.scene);var cam=this.camera;return!force&&this.isRunning||(this.isRunning=!0,this.duration=duration,this.progress=0,this.source=cam.zoom,this.destination=zoom,"string"==typeof ease&&EaseMap$1.hasOwnProperty(ease)?this.ease=EaseMap$1[ease]:"function"==typeof ease&&(this.ease=ease),this._elapsed=0,this._onUpdate=callback,this._onUpdateScope=context,this.camera.emit
43(Events$H.ZOOM_START,this.camera,this,duration,zoom)),cam},update:function(time,delta){this.isRunning&&(this._elapsed+=delta,this.progress=Clamp$b(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(Events$H.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}})},Linear_1=function(p0,p1,t){return(p1-p0)*t+p0},BaseCamera$1=BaseCamera_1,CenterOn$3=CenterOn_1$2,Clamp$a=Clamp_1,Effects=effects,Events$G=events$d,Linear$2=Linear_1,Rectangle$r=Rectangle_1$1,Vector2$J=Vector2_1,Camera$2=new Class_1({Extends:BaseCamera$1,Mixins:[components$3.Flip,components$3.Tint,components$3.Pipeline],initialize:function(x,y,width,height){BaseCamera$1.call(this,x,y,width,height),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new Effects.Fade(this),this.flashEffect=new Effects.Flash(this),this.shakeEffect=new Effects.Shake(this),this.panEffect=new Effects.Pan(this),this.rotateToEffect=new Effects.RotateTo(this),this.zoomEffect=new Effects.Zoom(this),this.lerp=new Vector2$J(1,1),this.followOffset=new Vector2$J,this.deadzone=null,this._follow=null},setDeadzone:function(width,height){if(void 0===width)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=width,this.deadzone.height=height):this.deadzone=new Rectangle$r(0,0,width,height),this._follow){var originX=this.width/2,originY=this.height/2,fx=this._follow.x-this.followOffset.x,fy=this._follow.y-this.followOffset.y;this.midPoint.set(fx,fy),this.scrollX=fx-originX,this.scrollY=fy-originY}CenterOn$3(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(duration,red,green,blue,callback,context){return this.fadeEffect.start(!1,duration,red,green,blue,!0,callback,context)},fadeOut:function(duration,red,green,blue,callback,context){return this.fadeEffect.start(!0,duration,red,green,blue,!0,callback,context)},fadeFrom:function(duration,red,green,blue,force,callback,context){return this.fadeEffect.start(!1,duration,red,green,blue,force,callback,context)},fade:function(duration,red,green,blue,force,callback,context){return this.fadeEffect.start(!0,duration,red,green,blue,force,callback,context)},flash:function(duration,red,green,blue,force,callback,context){return this.flashEffect.start(duration,red,green,blue,force,callback,context)},shake:function(duration,intensity,force,callback,context){return this.shakeEffect.start(duration,intensity,force,callback,context)},pan:function(x,y,duration,ease,force,callback,context){return this.panEffect.start(x,y,duration,ease,force,callback,context)},rotateTo:function(radians,shortestPath,duration,ease,force,callback,context){return this.rotateToEffect.start(radians,shortestPath,duration,ease,force,callback,context)},zoomTo:function(zoom,duration,ease,force,callback,context){return this.zoomEffect.start(zoom,duration,ease,force,callback,context)},preRender:function(){this.renderList.length=0;var width=this.width,height=this.height,halfWidth=.5*width,halfHeight=.5*height,zoom=this.zoom,matrix=this.matrix,originX=width*this.originX,originY=height*this.originY,follow=this._follow,deadzone=this.deadzone,sx=this.scrollX,sy=this.scrollY;deadzone&&CenterOn$3(deadzone,this.midPoint.x,this.midPoint.y);var emitFollowEvent=!1;if(follow&&!this.panEffect.isRunning){var fx=follow.x-this.followOffset.x,fy=follow.y-this.followOffset.y;deadzone?(fx<deadzone.x?sx=Linear$2(sx,sx-(deadzone.x-fx),this.lerp.x):fx>deadzone.right&&(sx=Linear$2(sx,sx+(fx-deadzone.right),this.lerp.x)),fy<deadzone.y?sy=Linear$2(sy,sy-(deadzone.y-fy),this.lerp.y):fy>deadzone.bottom&&(sy=Linear$2(sy,sy+(fy-deadzone.bottom),this.lerp.y))):(sx=Linear$2(sx,fx-originX,this.lerp.x),sy=Linear$2(sy,fy-originY,this.lerp.y)),emitFollowEvent=!0}this.useBounds&&(sx=this.clampX(sx),sy=this.clampY(sy)),this.roundPixels&&(originX=Math.round(originX),originY=Math.round(originY),sx=Math.round(sx),sy=Math.round(sy)),this.scrollX=sx,this.scrollY=sy;var midX=sx+halfWidth,midY=sy+halfHeight;this.midPoint.set(midX,midY);var displayWidth=width/zoom,displayHeight=height/zoom,vwx=midX-displayWidth/2,vwy=midY-displayHeight/2;this.roundPixels&&(vwx=Math.round(vwx),vwy=Math.round(vwy)),this.worldView.setTo(vwx,vwy,displayWidth,displayHeight),matrix.applyITRS(this.x+originX,this.y+originY,this.rotation,zoom,zoom),matrix.translate(-originX,-originY),this.shakeEffect.preRender(),emitFollowEvent&&this.emit
vendor: 7,093 bytes, line 43
43(Events$G.FOLLOW_UPDATE,this,follow)},setLerp:function(x,y){return void 0===x&&(x=1),void 0===y&&(y=x),this.lerp.set(x,y),this},setFollowOffset:function(x,y){return void 0===x&&(x=0),void 0===y&&(y=0),this.followOffset.set(x,y),this},startFollow:function(target,roundPixels,lerpX,lerpY,offsetX,offsetY){void 0===roundPixels&&(roundPixels=!1),void 0===lerpX&&(lerpX=1),void 0===lerpY&&(lerpY=lerpX),void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=offsetX),this._follow=target,this.roundPixels=roundPixels,lerpX=Clamp$a(lerpX,0,1),lerpY=Clamp$a(lerpY,0,1),this.lerp.set(lerpX,lerpY),this.followOffset.set(offsetX,offsetY);var originX=this.width/2,originY=this.height/2,fx=target.x-offsetX,fy=target.y-offsetY;return this.midPoint.set(fx,fy),this.scrollX=fx-originX,this.scrollY=fy-originY,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(time,delta){this.visible&&(this.rotateToEffect.update(time,delta),this.panEffect.update(time,delta),this.zoomEffect.update(time,delta),this.shakeEffect.update(time,delta),this.flashEffect.update(time,delta),this.fadeEffect.update(time,delta))},destroy:function(){this.resetFX(),BaseCamera$1.prototype.destroy.call(this),this._follow=null,this.deadzone=null}}),Camera_1=Camera$2,corePlugins={},customPlugins={},PluginCache$h={register:function(key,plugin,mapping,custom){void 0===custom&&(custom=!1),corePlugins[key]={plugin:plugin,mapping:mapping,custom:custom}},registerCustom:function(key,plugin,mapping,data){customPlugins[key]={plugin:plugin,mapping:mapping,data:data}},hasCore:function(key){return corePlugins.hasOwnProperty(key)},hasCustom:function(key){return customPlugins.hasOwnProperty(key)},getCore:function(key){return corePlugins[key]},getCustom:function(key){return customPlugins[key]},getCustomClass:function(key){return customPlugins.hasOwnProperty(key)?customPlugins[key].plugin:null},remove:function(key){corePlugins.hasOwnProperty(key)&&delete corePlugins[key]},removeCustom:function(key){customPlugins.hasOwnProperty(key)&&delete customPlugins[key]},destroyCorePlugins:function(){for(var key in corePlugins)corePlugins.hasOwnProperty(key)&&delete corePlugins[key]},destroyCustomPlugins:function(){for(var key in customPlugins)customPlugins.hasOwnProperty(key)&&delete customPlugins[key]}},PluginCache_1=PluginCache$h,events$c={ENTER_FULLSCREEN:"enterfullscreen",FULLSCREEN_FAILED:"fullscreenfailed",FULLSCREEN_UNSUPPORTED:"fullscreenunsupported",LEAVE_FULLSCREEN:"leavefullscreen",ORIENTATION_CHANGE:"orientationchange",RESIZE:"resize"},Camera$1=Camera_1,GetFastValue$1g=GetFastValue_1,PluginCache$g=PluginCache_1,RectangleContains$3=Contains_1$3,ScaleEvents$2=events$c,SceneEvents$f=events$g,CameraManager=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.roundPixels=scene.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,scene.sys.events.once(SceneEvents$f.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$f.START,this.start,this)},boot:function(){var sys=this.systems;sys.settings.cameras?this.fromJSON(sys.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new Camera$1(0,0,sys.scale.width,sys.scale.height).setScene(this.scene),sys.game.scale.on(ScaleEvents$2.RESIZE,this.onResize,this),this.systems.events.once(SceneEvents$f.DESTROY,this.destroy,this)},start:function(){if(!this.main){var sys=this.systems;sys.settings.cameras?this.fromJSON(sys.settings.cameras):this.add(),this.main=this.cameras[0]}var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents$f.UPDATE,this.update,this),eventEmitter.once(SceneEvents$f.SHUTDOWN,this.shutdown,this)},add:function(x,y,width,height,makeMain,name){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=this.scene.sys.scale.width),void 0===height&&(height=this.scene.sys.scale.height),void 0===makeMain&&(makeMain=!1),void 0===name&&(name="");var camera=new Camera$1(x,y,width,height);return camera.setName(name),camera.setScene(this.scene),camera.setRoundPixels(this.roundPixels),camera.id=this.getNextID(),this.cameras.push(camera),makeMain&&(this.main=camera),camera},addExisting:function(camera,makeMain){return void 0===makeMain&&(makeMain=!1),-1===this.cameras.indexOf(camera)?(camera.id=this.getNextID(),camera.setRoundPixels(this.roundPixels),this.cameras.push(camera),makeMain&&(this.main=camera),camera):null},getNextID:function(){for(var cameras=this.cameras,testID=1,t=0;t<32;t++){for(var found=!1,i=0;i<cameras.length;i++){var camera=cameras[i];camera&&camera.id===testID&&(found=!0)}if(!found)return testID;testID<<=1}return 0},getTotal:function(isVisible){void 0===isVisible&&(isVisible=!1);for(var total=0,cameras=this.cameras,i=0;i<cameras.length;i++){var camera=cameras[i];(!isVisible||isVisible&&camera.visible)&&total++}return total},fromJSON:function(config){Array.isArray(config)||(config=[config]);for(var gameWidth=this.scene.sys.scale.width,gameHeight=this.scene.sys.scale.height,i=0;i<config.length;i++){var cameraConfig=config[i],x=GetFastValue$1g(cameraConfig,"x",0),y=GetFastValue$1g(cameraConfig,"y",0),width=GetFastValue$1g(cameraConfig,"width",gameWidth),height=GetFastValue$1g(cameraConfig,"height",gameHeight),camera=this.add(x,y,width,height);camera.name=GetFastValue$1g(cameraConfig,"name",""),camera.zoom=GetFastValue$1g(cameraConfig,"zoom",1),camera.rotation=GetFastValue$1g(cameraConfig,"rotation",0),camera.scrollX=GetFastValue$1g(cameraConfig,"scrollX",0),camera.scrollY=GetFastValue$1g(cameraConfig,"scrollY",0),camera.roundPixels=GetFastValue$1g(cameraConfig,"roundPixels",!1),camera.visible=GetFastValue$1g(cameraConfig,"visible",!0);var backgroundColor=GetFastValue$1g(cameraConfig,"backgroundColor",!1);backgroundColor&&camera.setBackgroundColor(backgroundColor);var boundsConfig=GetFastValue$1g(cameraConfig,"bounds",null);if(boundsConfig){var bx=GetFastValue$1g(boundsConfig,"x",0),by=GetFastValue$1g(boundsConfig,"y",0),bwidth=GetFastValue$1g(boundsConfig,"width",gameWidth),bheight=GetFastValue$1g(boundsConfig,"height",gameHeight);camera.setBounds(bx,by,bwidth,bheight)}}return this},getCamera:function(name){for(var cameras=this.cameras,i=0;i<cameras.length;i++)if(cameras[i].name===name)return cameras[i];return null},getCamerasBelowPointer:function(pointer){for(var cameras=this.cameras,x=pointer.x,y=pointer.y,output=[],i=0;i<cameras.length;i++){var camera=cameras[i];camera.visible&&camera.inputEnabled&&RectangleContains$3(camera,x,y)&&output.unshift(camera)}return output},remove:function(camera,runDestroy){void 0===runDestroy&&(runDestroy=!0),Array.isArray(camera)||(camera=[camera]);for(var total=0,cameras=this.cameras,i=0;i<camera.length;i++){var index=cameras.indexOf(camera[i]);-1!==index&&(runDestroy?cameras[index].destroy():cameras[index].renderList=[],cameras.splice(index,1),total++)}return!this.main&&cameras[0]&&(this.main=cameras[0]),total}
43,render:function(renderer,displayList){for(var scene=this.scene,cameras=this.cameras,i=0;i<this.cameras.length;i++){var camera=cameras[i];if(camera.visible&&camera.alpha>0){camera.preRender();var visibleChildren=this.getVisibleChildren(displayList.getChildren(),camera);renderer.render(scene,visibleChildren,camera)}}},getVisibleChildren:function(children,camera){for(var visible=[],i=0;i<children.length;i++){var child=children[i];child.willRender(camera)&&visible.push(child)}return visible},resetAll:function(){for(var i=0;i<this.cameras.length;i++)this.cameras[i].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(time,delta){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(time,delta)},onResize:function(gameSize,baseSize,displaySize,previousWidth,previousHeight){for(var i=0;i<this.cameras.length;i++){var cam=this.cameras[i];0===cam._x&&0===cam._y&&cam._width===previousWidth&&cam._height===previousHeight&&cam.setSize(baseSize.width,baseSize.height)}},resize:function(width,height){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(width,height)},shutdown:function(){this.main=void 0;for(var i=0;i<this.cameras.length;i++)this.cameras[i].destroy();this.cameras=[];var eventEmitter=this.systems.events;eventEmitter.off(SceneEvents$f.UPDATE,this.update,this),eventEmitter.off(SceneEvents$f.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.scene.sys.events.off(SceneEvents$f.START,this.start,this),this.scene=null,this.systems=null}});PluginCache$g.register("CameraManager",CameraManager,"cameras");var cameras={Controls:controls,Scene2D:{Camera:Camera_1,BaseCamera:BaseCamera_1,CameraManager:CameraManager,Effects:effects,Events:events$d}},OS$4={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};
44/**
45	 * @author       Richard Davey <[email protected]>
46	 * @copyright    2020 Photon Storm Ltd.
47	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
48	 */var OS_1=function(){if("function"==typeof importScripts)return OS$4;var ua=navigator.userAgent;/Windows/.test(ua)?OS$4.windows=!0:/Mac OS/.test(ua)&&!/like Mac OS/.test(ua)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(OS$4.iOS=!0,OS$4.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),OS$4.iOSVersion=parseInt(RegExp.$1,10)):OS$4.macOS=!0:/Android/.test(ua)?OS$4.android=!0:/Linux/.test(ua)?OS$4.linux=!0:/iP[ao]d|iPhone/i.test(ua)?(OS$4.iOS=!0,navigator.appVersion.match(/OS (\d+)/),OS$4.iOSVersion=parseInt(RegExp.$1,10),OS$4.iPhone=-1!==ua.toLowerCase().indexOf("iphone"),OS$4.iPad=-1!==ua.toLowerCase().indexOf("ipad")):/Kindle/.test(ua)||/\bKF[A-Z][A-Z]+/.test(ua)||/Silk.*Mobile Safari/.test(ua)?OS$4.kindle=!0:/CrOS/.test(ua)&&(OS$4.chromeOS=!0),(/Windows Phone/i.test(ua)||/IEMobile/i.test(ua))&&(OS$4.android=!1,OS$4.iOS=!1,OS$4.macOS=!1,OS$4.windows=!0,OS$4.windowsPhone=!0);var silk=/Silk/.test(ua);return(OS$4.windows||OS$4.macOS||OS$4.linux&&!silk||OS$4.chromeOS)&&(OS$4.desktop=!0),(OS$4.windowsPhone||/Windows NT/i.test(ua)&&/Touch/i.test(ua))&&(OS$4.desktop=!1),navigator.standalone&&(OS$4.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(OS$4.cordova=!0),void 0!==window.ejecta&&(OS$4.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(OS$4.node=!0),OS$4.node&&"object"==typeof process.versions&&(OS$4.nodeWebkit=!!process.versions["node-webkit"],OS$4.electron=!!process.versions.electron),/Crosswalk/.test(ua)&&(OS$4.crosswalk=!0),OS$4.pixelRatio=window.devicePixelRatio||1,OS$4}(),OS$3=OS_1,Browser$3={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};
49/**
50	 * @author       Richard Davey <[email protected]>
51	 * @copyright    2020 Photon Storm Ltd.
52	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
53	 */var ua,getPrefix,Browser_1=(ua=navigator.userAgent,/Edge\/\d+/.test(ua)?Browser$3.edge=!0:/Chrome\/(\d+)/.test(ua)&&!OS$3.windowsPhone?(Browser$3.chrome=!0,Browser$3.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(ua)?(Browser$3.firefox=!0,Browser$3.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWeb
53Kit/.test(ua)&&OS$3.iOS?Browser$3.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(ua)?(Browser$3.ie=!0,Browser$3.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(ua)?Browser$3.opera=!0:/Safari/.test(ua)&&!OS$3.windowsPhone?Browser$3.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(ua)&&(Browser$3.ie=!0,Browser$3.trident=!0,Browser$3.tridentVersion=parseInt(RegExp.$1,10),Browser$3.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(ua)&&(Browser$3.silk=!0),Browser$3),prefix="",Smoothing_1=(getPrefix=function(context){for(var vendors=["i","webkitI","msI","mozI","oI"],i=0;i<vendors.length;i++){var s=vendors[i]+"mageSmoothingEnabled";if(s in context)return s}return null},{disable:function(context){return""===prefix&&(prefix=getPrefix(context)),prefix&&(context[prefix]=!1),context},enable:function(context){return""===prefix&&(prefix=getPrefix(context)),prefix&&(context[prefix]=!0),context},getPrefix:getPrefix,isEnabled:function(context){return null!==prefix?context[prefix]:null}}),CONST$1d=_const$e,Smoothing$1=Smoothing_1,pool=[],_disableContextSmoothing=!1,CanvasPool_1=function(){var create=function(parent,width,height,canvasType,selfParent){var canvas;void 0===width&&(width=1),void 0===height&&(height=1),void 0===canvasType&&(canvasType=CONST$1d.CANVAS),void 0===selfParent&&(selfParent=!1);var container=first(canvasType);return null===container?(container={parent:parent,canvas:document.createElement("canvas"),type:canvasType},canvasType===CONST$1d.CANVAS&&pool.push(container),canvas=container.canvas):(container.parent=parent,canvas=container.canvas),selfParent&&(container.parent=canvas),canvas.width=width,canvas.height=height,_disableContextSmoothing&&canvasType===CONST$1d.CANVAS&&Smoothing$1.disable(canvas.getContext("2d")),canvas},first=function(canvasType){if(void 0===canvasType&&(canvasType=CONST$1d.CANVAS),canvasType===CONST$1d.WEBGL)return null;for(var i=0;i<pool.length;i++){var container=pool[i];if(!container.parent&&container.type===canvasType)return container}return null},total=function(){var c=0;return pool.forEach((function(container){container.parent&&c++})),c};return{create2D:function(parent,width,height){return create(parent,width,height,CONST$1d.CANVAS)},create:create,createWebGL:function(parent,width,height){return create(parent,width,height,CONST$1d.WEBGL)},disableSmoothing:function(){_disableContextSmoothing=!0},enableSmoothing:function(){_disableContextSmoothing=!1},first:first,free:function(){return pool.length-total()},pool:pool,remove:function(parent){var isCanvas=parent instanceof HTMLCanvasElement;pool.forEach((function(container){(isCanvas&&container.canvas===parent||!isCanvas&&container.parent===parent)&&(container.parent=null,container.canvas.width=1,container.canvas.height=1)}))},total:total}}(),OS$2=OS_1,Browser$2=Browser_1,CanvasPool$c=CanvasPool_1,Features$2={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};
54/**
55	 * @author       Richard Davey <[email protected]>
56	 * @copyright    2020 Photon Storm Ltd.
57	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
58	 */var Features_1=function(){if("function"==typeof importScripts)return Features$2;Features$2.canvas=!!window.CanvasRenderingContext2D;try{Features$2.localStorage=!!localStorage.getItem}catch(error){Features$2.localStorage=!1}Features$2.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),Features$2.fileSystem=!!window.requestFileSystem;var a,b,c,isUint8=!1;return Features$2.webGL=function(){if(window.WebGLRenderingContext)try{var canvas=CanvasPool$c.createWebGL(this),ctx=canvas.getContext("webgl")||canvas.getContext("experimental-webgl"),canvas2D=CanvasPool$c.create2D(this),image=canvas2D.getContext("2d").createImageData(1,1);return isUint8=image.data instanceof Uint8ClampedArray,CanvasPool$c.remove(canvas),CanvasPool$c.remove(canvas2D),!!ctx}catch(e){return!1}return!1}(),Features$2.worker=!!window.Worker,Features$2.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,Features$2.getUserMedia=Features$2.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,Browser$2.firefox&&Browser$2.firefoxVersion<21&&(Features$2.getUserMedia=!1),!OS$2.iOS&&(Browser$2.ie||Browser$2.firefox||Browser$2.chrome)&&(Features$2.canvasBitBltShift=!0),(Browser$2.safari||Browser$2.mobileSafari)&&(Features$2.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(Features$2.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(Features$2.littleEndian=(a=new ArrayBuffer(4),b=new Uint8Array(a),c=new Uint32Array(a),b[0]=161,b[1]=178,b[2]=195,b[3]=212,3569595041===c[0]||2712847316!==c[0]&&null)),Features$2.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==Features$2.littleEndian&&isUint8,Features$2}(),Browser$1=Browser_1,Input$1={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};
59/**
60	 * @author       Richard Davey <[email protected]>
61	 * @copyright    2020 Photon Storm Ltd.
62	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
63	 */var Input_1=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(Input$1.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(Input$1.mspointer=!0),navigator.getGamepads&&(Input$1.gamepads=!0),"onwheel"in window||Browser$1.ie&&"WheelEvent"in window?Input$1.wheelEvent="wheel":"onmousewheel"in window?Input$1.wheelEvent="mou
63sewheel":Browser$1.firefox&&"MouseScrollEvent"in window&&(Input$1.wheelEvent="DOMMouseScroll")),Input$1),Browser=Browser_1,Audio$1={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};
64/**
65	 * @author       Richard Davey <[email protected]>
66	 * @copyright    2020 Photon Storm Ltd.
67	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
68	 */var Audio_1=function(){if("function"==typeof importScripts)return Audio$1;Audio$1.audioData=!!window.Audio,Audio$1.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var audioElement=document.createElement("audio"),result=!!audioElement.canPlayType;try{if(result&&(audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(Audio$1.ogg=!0),(audioElement.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||audioElement.canPlayType("audio/opus;").replace(/^no$/,""))&&(Audio$1.opus=!0),audioElement.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(Audio$1.mp3=!0),audioElement.canPlayType("audio/wav").replace(/^no$/,"")&&(Audio$1.wav=!0),(audioElement.canPlayType("audio/x-m4a;")||audioElement.canPlayType("audio/aac;").replace(/^no$/,""))&&(Audio$1.m4a=!0),audioElement.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(Audio$1.webm=!0),""!==audioElement.canPlayType('audio/mp4;codecs="ec-3"')))if(Browser.edge)Audio$1.dolby=!0;else if(Browser.safari&&Browser.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var major=parseInt(RegExp.$1,10),minor=parseInt(RegExp.$2,10);(10===major&&minor>=11||major>10)&&(Audio$1.dolby=!0)}}catch(e){}return Audio$1}(),Video$3={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};
69/**
70	 * @author       Richard Davey <[email protected]>
71	 * @copyright    2020 Photon Storm Ltd.
72	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
73	 */var Video_1$1=function(){if("function"==typeof importScripts)return Video$3;var videoElement=document.createElement("video"),result=!!videoElement.canPlayType;try{result&&(videoElement.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(Video$3.ogg=!0),videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(Video$3.h264=!0,Video$3.mp4=!0),videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(Video$3.webm=!0),videoElement.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(Video$3.vp9=!0),videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(Video$3.hls=!0))}catch(e){}return Video$3}(),Fullscreen={available:!1,cancel:"",keyboard:!1,request:""};
74/**
75	 * @author       Richard Davey <[email protected]>
76	 * @copyright    2020 Photon Storm Ltd.
77	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
78	 */var Fullscreen_1=function(){if("function"==typeof importScripts)return Fullscreen;var i,suffix1="Fullscreen",suffix2="FullScreen",fs=["request"+suffix1,"request"+suffix2,"webkitRequest"+suffix1,"webkitRequest"+suffix2,"msRequest"+suffix1,"msRequest"+suffix2,"mozRequest"+suffix2,"mozRequest"+suffix1];for(i=0;i<fs.length;i++)if(document.documentElement[fs[i]]){Fullscreen.available=!0,Fullscreen.request=fs[i];break}var cfs=["cancel"+suffix2,"exit"+suffix1,"webkitCancel"+suffix2,"webkitExit"+suffix1,"msCancel"+suffix2,"msExit"+suffix1,"mozCancel"+suffix2,"mozExit"+suffix1];if(Fullscreen.available)for(i=0;i<cfs.length;i++)if(document[cfs[i]]){Fullscreen.cancel=cfs[i];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(Fullscreen.keyboard=!0),Object.defineProperty(Fullscreen,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),Fullscreen}(),CanvasPool$b=CanvasPool_1,CanvasFeatures$1={supportInverseAlpha:!1,supportNewBlendModes:!1};
79/**
80	 * @author       Richard Davey <[email protected]>
81	 * @copyright    2020 Photon Storm Ltd.
82	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
83	 */var pngHead,pngEnd,magenta,CanvasFeatures_1=("function"!=typeof importScripts&&void 0!==document&&(CanvasFeatures$1.supportNewBlendModes=(pngHead="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",pngEnd="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(magenta=new Image).onload=function(){var yellow=new Image;yellow.onload=function(){var context=CanvasPool$b.create(yellow,6,1).getContext("2d");if(context.globalCompositeOperation="multiply",context.drawImage(magenta,
830,0),context.drawImage(yellow,2,0),!context.getImageData(2,0,1,1))return!1;var data=context.getImageData(2,0,1,1).data;CanvasPool$b.remove(yellow),CanvasFeatures$1.supportNewBlendModes=255===data[0]&&0===data[1]&&0===data[2]},yellow.src=pngHead+"/wCKxvRF"+pngEnd},magenta.src=pngHead+"AP804Oa6"+pngEnd,!1),CanvasFeatures$1.supportInverseAlpha=function(){var context=CanvasPool$b.create(this,2,1).getContext("2d");context.fillStyle="rgba(10, 20, 30, 0.5)",context.fillRect(0,0,1,1);var s1=context.getImageData(0,0,1,1);if(null===s1)return!1;context.putImageData(s1,1,0);var s2=context.getImageData(1,0,1,1);return s2.data[0]===s1.data[0]&&s2.data[1]===s1.data[1]&&s2.data[2]===s1.data[2]&&s2.data[3]===s1.data[3]}()),CanvasFeatures$1),device={os:OS_1,browser:Browser_1,features:Features_1,input:Input_1,audio:Audio_1,video:Video_1$1,fullscreen:Fullscreen_1,canvasFeatures:CanvasFeatures_1},Between_1$1=function(x1,y1,x2,y2){return Math.atan2(y2-y1,x2-x1)},BetweenPoints_1=function(point1,point2){return Math.atan2(point2.y-point1.y,point2.x-point1.x)},CONST$1c=_const$b,CounterClockwise_1=function(angle){return angle>Math.PI&&(angle-=CONST$1c.PI2),Math.abs(((angle+CONST$1c.TAU)%CONST$1c.PI2-CONST$1c.PI2)%CONST$1c.PI2)},Normalize_1=function(angle){return(angle%=2*Math.PI)>=0?angle:angle+2*Math.PI},FloatBetween_1=function(min,max){return Math.random()*(max-min)+min},FloatBetween$2=FloatBetween_1,FloatBetween$1=FloatBetween_1,Normalize=Normalize_1,Reverse_1$2=function(angle){return Normalize(angle+Math.PI)},MATH_CONST$f=_const$b,angle={Between:Between_1$1,BetweenPoints:BetweenPoints_1,BetweenPointsY:function(point1,point2){return Math.atan2(point2.x-point1.x,point2.y-point1.y)},BetweenY:function(x1,y1,x2,y2){return Math.atan2(x2-x1,y2-y1)},CounterClockwise:CounterClockwise_1,Normalize:Normalize_1,Random:function(){return FloatBetween$2(-Math.PI,Math.PI)},RandomDegrees:function(){return FloatBetween$1(-180,180)},Reverse:Reverse_1$2,RotateTo:function(currentAngle,targetAngle,lerp){return void 0===lerp&&(lerp=.05),currentAngle===targetAngle||(Math.abs(targetAngle-currentAngle)<=lerp||Math.abs(targetAngle-currentAngle)>=MATH_CONST$f.PI2-lerp?currentAngle=targetAngle:(Math.abs(targetAngle-currentAngle)>Math.PI&&(targetAngle<currentAngle?targetAngle+=MATH_CONST$f.PI2:targetAngle-=MATH_CONST$f.PI2),targetAngle>currentAngle?currentAngle+=lerp:targetAngle<currentAngle&&(currentAngle-=lerp))),currentAngle},ShortestBetween:function(angle1,angle2){var difference=angle2-angle1;return 0===difference?0:difference-360*Math.floor((difference- -180)/360)},Wrap:Wrap_1,WrapDegrees:WrapDegrees_1},DistanceBetweenPoints_1=function(a,b){var dx=a.x-b.x,dy=a.y-b.y;return Math.sqrt(dx*dx+dy*dy)},DistanceSquared_1=function(x1,y1,x2,y2){var dx=x1-x2,dy=y1-y2;return dx*dx+dy*dy},distance={Between:DistanceBetween_1,BetweenPoints:DistanceBetweenPoints_1,BetweenPointsSquared:function(a,b){var dx=a.x-b.x,dy=a.y-b.y;return dx*dx+dy*dy},Chebyshev:function(x1,y1,x2,y2){return Math.max(Math.abs(x1-x2),Math.abs(y1-y2))},Power:function(x1,y1,x2,y2,pow){return void 0===pow&&(pow=2),Math.sqrt(Math.pow(x2-x1,pow)+Math.pow(y2-y1,pow))},Snake:function(x1,y1,x2,y2){return Math.abs(x1-x2)+Math.abs(y1-y2)},Squared:DistanceSquared_1},easing={Back:back,Bounce:bounce,Circular:circular,Cubic:cubic,Elastic:elastic,Expo:expo,Linear:linear,Quadratic:quadratic,Quartic:quartic,Quintic:quintic,Sine:sine,Stepped:stepped},GreaterThan_1=function(a,b,epsilon){return void 0===epsilon&&(epsilon=1e-4),a>b-epsilon},LessThan_1=function(a,b,epsilon){return void 0===epsilon&&(epsilon=1e-4),a<b+epsilon},fuzzy={Ceil:function(value,epsilon){return void 0===epsilon&&(epsilon=1e-4),Math.ceil(value-epsilon)},Equal:Equal_1,Floor:function(value,epsilon){return void 0===epsilon&&(epsilon=1e-4),Math.floor(value+epsilon)},GreaterThan:GreaterThan_1,LessThan:LessThan_1},Factorial_1=function(value){if(0===value)return 1;for(var res=value;--value;)res*=value;return res},Factorial=Factorial_1,Bernstein_1=function(n,i){return Factorial(n)/Factorial(i)/Factorial(n-i)},Bernstein=Bernstein_1,BezierInterpolation_1=function(v,k){for(var b=0,n=v.length-1,i=0;i<=n;i++)b+=Math.pow(1-k,n-i)*Math.pow(k,i)*v[i]*Bernstein(n,i);return b},CatmullRom_1=function(t,p0,p1,p2,p3){var v0=.5*(p2-p0),v1=.5*(p3-p1),t2=t*t;return(2*p1-2*p2+v0+v1)*(t*t2)+(-3*p1+3*p2-2*v0-v1)*t2+v0*t+p1},CatmullRom$1=CatmullRom_1,CatmullRomInterpolation_1=function(v,k){var m=v.length-1,f=m*k,i=Math.floor(f);return v[0]===v[m]?(k<0&&(i=Math.floor(f=m*(1+k))),CatmullRom$1(f-i,v[(i-1+m)%m],v[i],v[(i+1)%m],v[(i+2)%m])):k<0?v[0]-(CatmullRom$1(-f,v[0],v[0],v[1],v[1])-v[0]):k>1?v[m]-(CatmullRom$1(f-m,v[m],v[m],v[m-1],v[m-1])-v[m]):CatmullRom$1(f-i,v[i?i-1:0],v[i],v[m<i+1?m:i+1],v[m<i+2?m:i+2])};
84/**
85	 * @author       Richard Davey <[email protected]>
86	 * @copyright    2020 Photon Storm Ltd.
87	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
88	 */var CubicBezierInterpolation_1=function(t,p0,p1,p2,p3){
89/**
90	 * @author       Richard Davey <[email protected]>
91	 * @copyright    2020 Photon Storm Ltd.
92	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
93	 */
94return function(t,p){var k=1-t;return k*k*k*p}(t,p0)+function(t,p){var k=1-t;return 3*k*k*t*p}(t,p1)+function(t,p){return 3*(1-t)*t*t*p}(t,p2)+function(t,p){return t*t*t*p}(t,p3)},Linear$1=Linear_1,LinearInterpolation_1=function(v,k){var m=v.length-1,f=m*k,i=Math.floor(f);return k<0?Linear$1(v[0],v[1],f):k>1?Linear$1(v[m],v[m-1],m-f):Linear$1(v[i],v[i+1>m?m:i+1],f-i)};var QuadraticBezierInterpolation_1=function(t,p0,p1,p2){
95/**
96	 * @author       Richard Davey <[email protected]>
97	 * @copyright    2020 Photon Storm Ltd.
98	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
99	 */
100return function(t,p){var k=1-t;return k*k*p}(t,p0)+function(t,p){return 2*(1-t)*t*p}(t,p1)+function(t,p){return t*t*p}(t,p2)},SmoothStep=SmoothStep_1$1,SmoothStepInterpolation_1=function(t,min,max){return min+(max-min)
100*SmoothStep(t,0,1)},SmootherStep=SmootherStep_1$1,interpolation={Bezier:BezierInterpolation_1,CatmullRom:CatmullRomInterpolation_1,CubicBezier:CubicBezierInterpolation_1,Linear:LinearInterpolation_1,QuadraticBezier:QuadraticBezierInterpolation_1,SmoothStep:SmoothStepInterpolation_1,SmootherStep:function(t,min,max){return min+(max-min)*SmootherStep(t,0,1)}},GetPowerOfTwo_1=function(value){var index=Math.log(value)/.6931471805599453;return 1<<Math.ceil(index)},IsSizePowerOfTwo_1=function(width,height){return width>0&&0==(width&width-1)&&height>0&&0==(height&height-1)},pow2={GetNext:GetPowerOfTwo_1,IsSize:IsSizePowerOfTwo_1,IsValue:function(value){return value>0&&0==(value&value-1)}},SnapCeil_1=function(value,gap,start,divide){return void 0===start&&(start=0),0===gap?value:(value-=start,value=gap*Math.ceil(value/gap),divide?(start+value)/gap:start+value)},SnapFloor_1=function(value,gap,start,divide){return void 0===start&&(start=0),0===gap?value:(value-=start,value=gap*Math.floor(value/gap),divide?(start+value)/gap:start+value)},snap={Ceil:SnapCeil_1,Floor:SnapFloor_1,To:function(value,gap,start,divide){return void 0===start&&(start=0),0===gap?value:(value-=start,value=gap*Math.round(value/gap),divide?(start+value)/gap:start+value)}},RandomDataGenerator=new Class_1({initialize:function(seeds){void 0===seeds&&(seeds=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],seeds&&this.init(seeds)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(data){var h,n=this.n;data=data.toString();for(var i=0;i<data.length;i++)h=.02519603282416938*(n+=data.charCodeAt(i)),h-=n=h>>>0,n=(h*=n)>>>0,n+=4294967296*(h-=n);return this.n=n,2.3283064365386963e-10*(n>>>0)},init:function(seeds){"string"==typeof seeds?this.state(seeds):this.sow(seeds)},sow:function(seeds){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,seeds)for(var i=0;i<seeds.length&&null!=seeds[i];i++){var seed=seeds[i];this.s0-=this.hash(seed),this.s0+=~~(this.s0<0),this.s1-=this.hash(seed),this.s1+=~~(this.s1<0),this.s2-=this.hash(seed),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(min,max){return Math.floor(this.realInRange(0,max-min+1)+min)},between:function(min,max){return Math.floor(this.realInRange(0,max-min+1)+min)},realInRange:function(min,max){return this.frac()*(max-min)+min},normal:function(){return 1-2*this.frac()},uuid:function(){var a="",b="";for(b=a="";a++<36;b+=~a%5|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(array){return array[this.integerInRange(0,array.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(array){return array[~~(Math.pow(this.frac(),2)*(array.length-1)+.5)]},timestamp:function(min,max){return this.realInRange(min||9466848e5,max||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(state){return"string"==typeof state&&state.match(/^!rnd/)&&(state=state.split(","),this.c=parseFloat(state[1]),this.s0=parseFloat(state[2]),this.s1=parseFloat(state[3]),this.s2=parseFloat(state[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(array){for(var i=array.length-1;i>0;i--){var randomIndex=Math.floor(this.frac()*(i+1)),itemAtIndex=array[randomIndex];array[randomIndex]=array[i],array[i]=itemAtIndex}return array}}),RandomDataGenerator_1=RandomDataGenerator,Average_1=function(values){for(var sum=0,i=0;i<values.length;i++)sum+=+values[i];return sum/values.length},Between_1=function(min,max){return Math.floor(Math.random()*(max-min+1)+min)},CeilTo_1=function(value,place,base){void 0===place&&(place=0),void 0===base&&(base=10);var p=Math.pow(base,-place);return Math.ceil(value*p)/p},Difference_1=function(a,b){return Math.abs(a-b)},Vector3$a=new Class_1({initialize:function(x,y,z){this.x=0,this.y=0,this.z=0,"object"==typeof x?(this.x=x.x||0,this.y=x.y||0,this.z=x.z||0
vendor: 17,287 bytes, line 100
100):(this.x=x||0,this.y=y||0,this.z=z||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(v){return this.x=Math.min(this.x,v.x),this.y=Math.min(this.y,v.y),this.z=Math.min(this.z,v.z),this},max:function(v){return this.x=Math.max(this.x,v.x),this.y=Math.max(this.y,v.y),this.z=Math.max(this.z,v.z),this},clone:function(){return new Vector3$a(this.x,this.y,this.z)},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this},crossVectors:function(a,b){var ax=a.x,ay=a.y,az=a.z,bx=b.x,by=b.y,bz=b.z;return this.x=ay*bz-az*by,this.y=az*bx-ax*bz,this.z=ax*by-ay*bx,this},equals:function(v){return this.x===v.x&&this.y===v.y&&this.z===v.z},copy:function(src){return this.x=src.x,this.y=src.y,this.z=src.z||0,this},set:function(x,y,z){return"object"==typeof x?(this.x=x.x||0,this.y=x.y||0,this.z=x.z||0):(this.x=x||0,this.y=y||0,this.z=z||0),this},setFromMatrixPosition:function(m){return this.fromArray(m.val,12)},setFromMatrixColumn:function(mat4,index){return this.fromArray(mat4.val,4*index)},fromArray:function(array,offset){return void 0===offset&&(offset=0),this.x=array[offset],this.y=array[offset+1],this.z=array[offset+2],this},add:function(v){return this.x+=v.x,this.y+=v.y,this.z+=v.z||0,this},addScalar:function(s){return this.x+=s,this.y+=s,this.z+=s,this},addScale:function(v,scale){return this.x+=v.x*scale,this.y+=v.y*scale,this.z+=v.z*scale||0,this},subtract:function(v){return this.x-=v.x,this.y-=v.y,this.z-=v.z||0,this},multiply:function(v){return this.x*=v.x,this.y*=v.y,this.z*=v.z||1,this},scale:function(scale){return isFinite(scale)?(this.x*=scale,this.y*=scale,this.z*=scale):(this.x=0,this.y=0,this.z=0),this},divide:function(v){return this.x/=v.x,this.y/=v.y,this.z/=v.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(v){var dx=v.x-this.x,dy=v.y-this.y,dz=v.z-this.z||0;return Math.sqrt(dx*dx+dy*dy+dz*dz)},distanceSq:function(v){var dx=v.x-this.x,dy=v.y-this.y,dz=v.z-this.z||0;return dx*dx+dy*dy+dz*dz},length:function(){var x=this.x,y=this.y,z=this.z;return Math.sqrt(x*x+y*y+z*z)},lengthSq:function(){var x=this.x,y=this.y,z=this.z;return x*x+y*y+z*z},normalize:function(){var x=this.x,y=this.y,z=this.z,len=x*x+y*y+z*z;return len>0&&(len=1/Math.sqrt(len),this.x=x*len,this.y=y*len,this.z=z*len),this},dot:function(v){return this.x*v.x+this.y*v.y+this.z*v.z},cross:function(v){var ax=this.x,ay=this.y,az=this.z,bx=v.x,by=v.y,bz=v.z;return this.x=ay*bz-az*by,this.y=az*bx-ax*bz,this.z=ax*by-ay*bx,this},lerp:function(v,t){void 0===t&&(t=0);var ax=this.x,ay=this.y,az=this.z;return this.x=ax+t*(v.x-ax),this.y=ay+t*(v.y-ay),this.z=az+t*(v.z-az),this},applyMatrix3:function(mat3){var x=this.x,y=this.y,z=this.z,m=mat3.val;return this.x=m[0]*x+m[3]*y+m[6]*z,this.y=m[1]*x+m[4]*y+m[7]*z,this.z=m[2]*x+m[5]*y+m[8]*z,this},applyMatrix4:function(mat4){var x=this.x,y=this.y,z=this.z,m=mat4.val,w=1/(m[3]*x+m[7]*y+m[11]*z+m[15]);return this.x=(m[0]*x+m[4]*y+m[8]*z+m[12])*w,this.y=(m[1]*x+m[5]*y+m[9]*z+m[13])*w,this.z=(m[2]*x+m[6]*y+m[10]*z+m[14])*w,this},transformMat3:function(mat){var x=this.x,y=this.y,z=this.z,m=mat.val;return this.x=x*m[0]+y*m[3]+z*m[6],this.y=x*m[1]+y*m[4]+z*m[7],this.z=x*m[2]+y*m[5]+z*m[8],this},transformMat4:function(mat){var x=this.x,y=this.y,z=this.z,m=mat.val;return this.x=m[0]*x+m[4]*y+m[8]*z+m[12],this.y=m[1]*x+m[5]*y+m[9]*z+m[13],this.z=m[2]*x+m[6]*y+m[10]*z+m[14],this},transformCoordinates:function(mat){var x=this.x,y=this.y,z=this.z,m=mat.val,tx=x*m[0]+y*m[4]+z*m[8]+m[12],ty=x*m[1]+y*m[5]+z*m[9]+m[13],tz=x*m[2]+y*m[6]+z*m[10]+m[14],tw=x*m[3]+y*m[7]+z*m[11]+m[15];return this.x=tx/tw,this.y=ty/tw,this.z=tz/tw,this},transformQuat:function(q){var x=this.x,y=this.y,z=this.z,qx=q.x,qy=q.y,qz=q.z,qw=q.w,ix=qw*x+qy*z-qz*y,iy=qw*y+qz*x-qx*z,iz=qw*z+qx*y-qy*x,iw=-qx*x-qy*y-qz*z;return this.x=ix*qw+iw*-qx+iy*-qz-iz*-qy,this.y=iy*qw+iw*-qy+iz*-qx-ix*-qz,this.z=iz*qw+iw*-qz+ix*-qy-iy*-qx,this},project:function(mat){var x=this.x,y=this.y,z=this.z,m=mat.val,a00=m[0],a01=m[1],a02=m[2],a03=m[3],a10=m[4],a11=m[5],a12=m[6],a13=m[7],a20=m[8],a21=m[9],a22=m[10],a23=m[11],a30=m[12],a31=m[13],a32=m[14],lw=1/(x*a03+y*a13+z*a23+m[15]);return this.x=(x*a00+y*a10+z*a20+a30)*lw,this.y=(x*a01+y*a11+z*a21+a31)*lw,this.z=(x*a02+y*a12+z*a22+a32)*lw,this},projectViewMatrix:function(viewMatrix,projectionMatrix){return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix)},unprojectViewMatrix:function(projectionMatrix,worldMatrix){return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix)},unproject:function(viewport,invProjectionView){var viewX=viewport.x,viewY=viewport.y,viewWidth=viewport.z,viewHeight=viewport.w,x=this.x-viewX,y=viewHeight-this.y-1-viewY,z=this.z;return this.x=2*x/viewWidth-1,this.y=2*y/viewHeight-1,this.z=2*z-1,this.project(invProjectionView)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});Vector3$a.ZERO=new Vector3$a,Vector3$a.RIGHT=new Vector3$a(1,0,0),Vector3$a.LEFT=new Vector3$a(-1,0,0),Vector3$a.UP=new Vector3$a(0,-1,0),Vector3$a.DOWN=new Vector3$a(0,1,0),Vector3$a.FORWARD=new Vector3$a(0,0,1),Vector3$a.BACK=new Vector3$a(0,0,-1),Vector3$a.ONE=new Vector3$a(1,1,1);var Vector3_1=Vector3$a,Vector3$9=Vector3_1,Matrix4$7=new Class_1({initialize:function(m){this.val=new Float32Array(16),m?this.copy(m):this.identity()},clone:function(){return new Matrix4$7(this)},set:function(src){return this.copy(src)},setValues:function(m00,m01,m02,m03,m10,m11,m12,m13,m20,m21,m22,m23,m30,m31,m32,m33){var out=this.val;return out[0]=m00,out[1]=m01,out[2]=m02,out[3]=m03,out[4]=m10,out[5]=m11,out[6]=m12,out[7]=m13,out[8]=m20,out[9]=m21,out[10]=m22,out[11]=m23,out[12]=m30,out[13]=m31,out[14]=m32,out[15]=m33,this},copy:function(src){var a=src.val;return this.setValues(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])},fromArray:function(a){return this.setValues(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(position,scale,rotation){var rm=_tempMat1.fromQuat(rotation).val,sx=scale.x,sy=scale.y,sz=scale.z;return this.setValues(rm[0]*sx,rm[1]*sx,rm[2]*sx,0,rm[4]*sy,rm[5]*sy,rm[6]*sy,0,rm[8]*sz,rm[9]*sz,rm[10]*sz,0,position.x,position.y,position.z,1)},xyz:function(x,y,z){this.identity();var out=this.val;return out[12]=x,out[13]=y,out[14]=z,this},scaling:function(x,y,z){this.zero();var out=this.val;return out[0]=x,out[5]=y,out[10]=z,out[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var a=this.val,a01=a[1],a02=a[2],a03=a[3],a12=a[6],a13=a[7],a23=a[11];return a[1]=a[4],a[2]=a[8],a[3]=a[12],a[4]=a01,a[6]=a[9],a[7]=a[13],a[8]=a02,a[9]=a12,a[11]=a[14],a[12]=a03,a[13]=a13,a[14]=a23,this},getInverse:function(m){return this.copy(m),this.invert()},invert:function(){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15],b00=a00*a11-a01*a10,b01=a00*a12-a02*a10,b02=a00*a13-a03*a10,b03=a01*a12-a02*a11,b04=a01*a13-a03*a11,b05=a02*a13-a03*a12,b06=a20*a31-a21*a30,b07=a20*a32-a22*a30,b08=a20*a33-a23*a30,b09=a21*a32-a22*a31,b10=a21*a33-a23*a31,b11=a22*a33-a23*a32,det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;return det?(det=1/det,this.setValues((a11*b11-a12*b10+a13*b09)*det,(a02*b10-a01*b11-a03*b09)*det,(a31*b05-a32*b04+a33*b03)*det,(a22*b04-a21*b05-a23*b03)*det,(a12*b08-a10*b11-a13*b07)*det,(a00*b11-a02*b08+a03*b07)*det,(a32*b02-a30*b05-a33*b01)*det,(a20*b05-a22*b02+a23*b01)*det,(a10*b10-a11*b08+a13*b06)*det,(a01*b08-a00*b10-a03*b06)*det,(a30*b04-a31*b02+a33*b00)*det,(a21*b02-a20*b04-a23*b00)*det,(a11*b07-a10*b09-a12*b06)*det,(a00*b09-a01*b07+a02*b06)*det,(a31*b01-a30*b03-a32*b00)*det,(a20*b03-a21*b01+a22*b00)*det)):this},adjoint:function(){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15];return this.setValues(a11*(a22*a33-a23*a32)-a21*(a12*a33-a13*a32)+a31*(a12*a23-a13*a22),-(a01*(a22*a33-a23*a32)-a21*(a02*a33-a03*a32)+a31*(a02*a23-a03*a22)),a01*(a12*a33-a13*a32)-a11*(a02*a33-a03*a32)+a31*(a02*a13-a03*a12),-(a01*(a12*a23-a13*a22)-a11*(a02*a23-a03*a22)+a21*(a02*a13-a03*a12)),-(a10*(a22*a33-a23*a32)-a20*(a12*a33-a13*a32)+a30*(a12*a23-a13*a22)),a00*(a22*a33-a23*a32)-a20*(a02*a33-a03*a32)+a30*(a02*a23-a03*a22),-(a00*(a12*a33-a13*a32)-a10*(a02*a33-a03*a32)+a30*(a02*a13-a03*a12)),a00*(a12*a23-a13*a22)-a10*(a02*a23-a03*a22)+a20*(a02*a13-a03*a12),a10*(a21*a33-a23*a31)-a20*(a11*a33-a13*a31)+a30*(a11*a23-a13*a21),-(a00*(a21*a33-a23*a31)-a20*(a01*a33-a03*a31)+a30*(a01*a23-a03*a21)),a00*(a11*a33-a13*a31)-a10*(a01*a33-a03*a31)+a30*(a01*a13-a03*a11),-(a00*(a11*a23-a13*a21)-a10*(a01*a23-a03*a21)+a20*(a01*a13-a03*a11)),-(a10*(a21*a32-a22*a31)-a20*(a11*a32-a12*a31)+a30*(a11*a22-a12*a21)),a00*(a21*a32-a22*a31)-a20*(a01*a32-a02*a31)+a30*(a01*a22-a02*a21),-(a00*(a11*a32-a12*a31)-a10*(a01*a32-a02*a31)+a30*(a01*a12-a02*a11)),a00*(a11*a22-a12*a21)-a10*(a01*a22-a02*a21)+a20*(a01*a12-a02*a11))},determinant:function(){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15];return(a00*a11-a01*a10)*(a22*a33-a23*a32)-(a00*a12-a02*a10)*(a21*a33-a23*a31)+(a00*a13-a03*a10)*(a21*a32-a22*a31)+(a01*a12-a02*a11)*(a20*a33-a23*a30)-(a01*a13-a03*a11)*(a20*a32-a22*a30)+(a02*a13-a03*a12)*(a20*a31-a21*a30)},multiply:function(src){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15],b=src.val,b0=b[0],b1=b[1],b2=b[2],b3=b[3];return a[0]=b0*a00+b1*a10+b2*a20+b3*a30,a[1]=b0*a01+b1*a11+b2*a21+b3*a31,a[2]=b0*a02+b1*a12+b2*a22+b3*a32,a[3]=b0*a03+b1*a13+b2*a23+b3*a33,b0=b[4],b1=b[5],b2=b[6],b3=b[7],a[4]=b0*a00+b1*a10+b2*a20+b3*a30,a[5]=b0*a01+b1*a11+b2*a21+b3*a31,a[6]=b0*a02+b1*a12+b2*a22+b3*a32,a[7]=b0*a03+b1*a13+b2*a23+b3*a33,b0=b[8],b1=b[9],b2=b[10],b3=b[11],a[8]=b0*a00+b1*a10+b2*a20+b3*a30,a[9]=b0*a01+b1*a11+b2*a21+b3*a31,a[10]=b0*a02+b1*a12+b2*a22+b3*a32,a[11]=b0*a03+b1*a13+b2*a23+b3*a33,b0=b[12],b1=b[13],b2=b[14],b3=b[15],a[12]=b0*a00+b1*a10+b2*a20+b3*a30,a[13]=b0*a01+b1*a11+b2*a21+b3*a31,a[14]=b0*a02+b1*a12+b2*a22+b3*a32,a[15]=b0*a03+b1*a13+b2*a23+b3*a33,this},multiplyLocal:function(src){var a=this.val,b=src.val;return this.setValues(a[0]*b[0]+a[1]*b[4]+a[2]*b[8]+a[3]*b[12],a[0]*b[1]+a[1]*b[5]+a[2]*b[9]+a[3]*b[13],a[0]*b[2]+a[1]*b[6]+a[2]*b[10]+a[3]*b[14],a[0]*b[3]+a[1]*b[7]+a[2]*b[11]+a[3]*b[15],a[4]*b[0]+a[5]*b[4]+a[6]*b[8]+a[7]*b[12],a[4]*b[1]+a[5]*b[5]+a[6]*b[9]+a[7]*b[13],a[4]*b[2]+a[5]*b[6]+a[6]*b[10]+a[7]*b[14],a[4]*b[3]+a[5]*b[7]+a[6]*b[11]+a[7]*b[15],a[8]*b[0]+a[9]*b[4]+a[10]*b[8]+a[11]*b[12],a[8]*b[1]+a[9]*b[5]+a[10]*b[9]+a[11]*b[13],a[8]*b[2]+a[9]*b[6]+a[10]*b[10]+a[11]*b[14],a[8]*b[3]+a[9]*b[7]+a[10]*b[11]+a[11]*b[15],a[12]*b[0]+a[13]*b[4]+a[14]*b[8]+a[15]*b[12],a[12]*b[1]+a[13]*b[5]+a[14]*b[9]+a[15]*b[13],a[12]*b[2]+a[13]*b[6]+a[14]*b[10]+a[15]*b[14],a[12]*b[3]+a[13]*b[7]+a[14]*b[11]+a[15]*b[15])},premultiply:function(m){return this.multiplyMatrices(m,this)},multiplyMatrices:function(a,b){var am=a.val,bm=b.val,a11=am[0],a12=am[4],a13=am[8],a14=am[12],a21=am[1],a22=am[5],a23=am[9],a24=am[13],a31=am[2],a32=am[6],a33=am[10],a34=am[14],a41=am[3],a42=am[7],a43=am[11],a44=am[15],b11=bm[0],b12=bm[4],b13=bm[8],b14=bm[12],b21=bm[1],b22=bm[5],b23=bm[9],b24=bm[13],b31=bm[2],b32=bm[6],b33=bm[10],b34=bm[14],b41=bm[3],b42=bm[7],b43=bm[11],b44=bm[15];return this.setValues(a11*b11+a12*b21+a13*b31+a14*b41,a21*b11+a22*b21+a23*b31+a24*b41,a31*b11+a32*b21+a33*b31+a34*b41,a41*b11+a42*b21+a43*b31+a44*b41,a11*b12+a12*b22+a13*b32+a14*b42,a21*b12+a22*b22+a23*b32+a24*b42,a31*b12+a32*b22+a33*b32+a34*b42,a41*b12+a42*b22+a43*b32+a44*b42,a11*b13+a12*b23+a13*b33+a14*b43,a21*b13+a22*b23+a23*b33+a24*b43,a31*b13+a32*b23+a33*b33+a34*b43,a41*b13+a42*b23+a43*b33+a44*b43,a11*b14+a12*b24+a13*b34+a14*b44,a21*b14+a22*b24+a23*b34+a24*b44,a31*b14+a32*b24+a33*b34+a34*b44,a41*b14+a42*b24+a43*b34+a44*b44)},translate:function(v){return this.translateXYZ(v.x,v.y,v.z)},translateXYZ:function(x,y,z){var a=this.val;return a[12]=a[0]*x+a[4]*y+a[8]*z+a[12],a[13]=a[1]*x+a[5]*y+a[9]*z+a[13],a[14]=a[2]*x+a[6]*y+a[10]*z+a[14],a[15]=a[3]*x+a[7]*y+a[11]*z+a[15],this},scale:function(v){return this.scaleXYZ(v.x,v.y,v.z)},scaleXYZ:function(x,y,z){var a=this.val;return a[0]=a[0]*x,a[1]=a[1]*x,a[2]=a[2]*x,a[3]=a[3]*x,a[4]=a[4]*y,a[5]=a[5]*y,a[6]=a[6]*y,a[7]=a[7]*y,a[8]=a[8]*z,a[9]=a[9]*z,a[10]=a[10]*z,a[11]=a[11]*z,this},makeRotationAxis:function(axis,angle){var c=Math.cos(angle),s=Math.sin(angle),t=1-c,x=axis.x,y=axis.y,z=axis.z,tx=t*x,ty=t*y;return this.setValues(tx*x+c,tx*y-s*z,tx*z+s*y,0,tx*y+s*z,ty*y+c,ty*z-s*x,0,tx*z-s*y,ty*z+s*x,t*z*z+c,0,0,0,0,1)},rotate:function(rad,axis){var a=this.val,x=axis.x,y=axis.y,z=axis.z,len=Math.sqrt(x*x+y*y+z*z);if(Math.abs(len)<1e-6)return this;x*=len=1/len,y*=len,z*=len;var s=Math.sin(rad),c=Math.cos(rad),t=1-c,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15],b00=x*x*t+c,b01=y*x*t+z*s,b02=z*x*t-y*s,b10=x*y*t-z*s,b11=y*y*t+c,b12=z*y*t+x*s,b20=x*z*t+y*s,b21=y*z*t-x*s,b22=z*z*t+c;return this.setValues(a00*b00+a10*b01+a20*b02,a01*b00+a11*b01+a21*b02,a02*b00+a12*b01+a22*b02,a03*b00+a13*b01+a23*b02,a00*b10+a10*b11+a20*b12,a01*b10+a11*b11+a21*b12,a02*b10+a12*b11+a22*b12,a03*b10+a13*b11+a23*b12,a00*b20+a10*b21+a20*b22,a01*b20+a11*b21+a21*b22,a02*b20+a12*b21+a22*b22,a03*b20+a13*b21+a23*b22,a30,a31,a32,a33)},rotateX:function(rad){var a=this.val,s=Math.sin(rad),c=Math.cos(rad),a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11];return a[4]=a10*c+a20*s,a[5]=a11*c+a21*s,a[6]=a12*c+a22*s,a[7]=a13*c+a23*s,a[8]=a20*c-a10*s,a[9]=a21*c-a11*s,a[10]=a22*c-a12*s,a[11]=a23*c-a13*s,this},rotateY:function(rad){var a=this.val,s=Math.sin(rad),c=Math.cos(rad),a00=a[0],a01=a[1],a02=a[2],a03=a[3],a20=a[8],a21=a[9],a22=a[10],a23=a[11];return a[0]=a00*c-a20*s,a[1]=a01*c-a21*s,a[2]=a02*c-a22*s,a[3]=a03*c-a23*s,a[8]=a00*s+a20*c,a[9]=a01*s+a21*c,a[10]=a02*s+a22*c,a[11]=a03*s+a23*c,this},rotateZ:function(rad){var a=this.val,s=Math.sin(rad),c=Math.cos(rad),a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7];return a[0]=a00*c+a10*s,a[1]=a01*c+a11*s,a[2]=a02*c+a12*s,a[3]=a03*c+a13*s,a[4]=a10*c-a00*s,a[5]=a11*c-a01*s,a[6]=a12*c-a02*s,a[7]=a13*c-a03*s,this},fromRotationTranslation:function(q,v){var x=q.x,y=q.y,z=q.z,w=q.w,x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;return this.setValues(1-(yy+zz),xy+wz,xz-wy,0,xy-wz,1-(xx+zz),yz+wx,0,xz+wy,yz-wx,1-(xx+yy),0,v.x,v.y,v.z,1)},fromQuat:function(q){var x=q.x,y=q.y,z=q.z,w=q.w,x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2;return this.setValues(1-(yy+zz),xy+wz,xz-wy,0,xy-wz,1-(xx+zz),yz+wx,0,xz+wy,yz-wx,1-(xx+yy),0,0,0,0,1)},frustum:function(left,right,bottom,top,near,far){var rl=1/(right-left),tb=1/(top-bottom),nf=1/(near-far);return this.setValues(2*near*rl,0,0,0,0,2*near*tb,0,0,(right+left)*rl,(top+bottom)*tb,(far+near)*nf,-1,0,0,far*near*2*nf,0)},perspective:function(fovy,aspect,near,far){var f=1/Math.tan(fovy/2),nf=1/(near-far);return this.setValues(f/aspect,0,0,0,0,f,0,0,0,0,(far+near)*nf,-1,0,0,2*far*near*nf,0)},perspectiveLH:function(width,height,near,far){return this.setValues(2*near/width,0,0,0,0,2*near/height,0,0,0,0,-far/(near-far),1,0,0,near*far/(near-far),0)},ortho:function(left,right,bottom,top,near,far){var lr=left-right,bt=bottom-top,nf=near-far;return lr=0===lr?lr:1/lr,bt=0===bt?bt:1/bt,nf=0===nf?nf:1/nf,this.setValues(-2*lr,0,0,0,0,-2*bt,0,0,0,0,2*nf,0,(left+right)*lr,(top+bottom)*bt,(far+near)*nf,1)},lookAtRH:function(eye,target,up){var m=this.val;return _z.subVectors(eye,target),0===_z.getLengthSquared()&&(_z.z=1),_z.normalize(),_x.crossVectors(up,_z),0===_x.getLengthSquared()&&(1===Math.abs(up.z)?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(up,_z)),_x.normalize(),_y.crossVectors(_z,_x),m[0]=_x.x,m[1]=_x.y,m[2]=_x.z,m[4]=_y.x,m[5]=_y.y,m[6]=_y.z,m[8]=_z.x,m[9]=_z.y,m[10]=_z.z,this},lookAt:function(eye,center,up){var eyex=eye.x,eyey=eye.y,eyez=eye.z,upx=up.x,upy=up.y,upz=up.z,centerx=center.x,centery=center.y,centerz=center.z;if(Math.abs(eyex-centerx)<1e-6&&Math.abs(eyey-centery)<1e-6&&Math.abs(eyez-centerz)<1e-6)return this.identity();var z0=eyex-centerx,z1=eyey-centery,z2=eyez-centerz,len=1/Math.sqrt(z0*z0+z1*z1+z2*z2),x0=upy*(z2*=len)-upz*(z1*=len),x1=upz*(z0*=len)-upx*z2,x2=upx*z1-upy*z0;(len=Math.sqrt(x0*x0+x1*x1+x2*x2))?(x0*=len=1/len,x1*=len,x2*=len):(x0=0,x1=0,x2=0);var y0=z1*x2-z2*x1,y1=z2*x0-z0*x2,y2=z0*x1-z1*x0;return(len=Math.sqrt(y0*y0+y1*y1+y2*y2))?(y0*=len=1/len,y1*=len,y2*=len):(y0=0,y1=0,y2=0),this.setValues(x0,y0,z0,0,x1,y1,z1,0,x2,y2,z2,0,-(x0*eyex+x1*eyey+x2*eyez),-(y0*eyex+y1*eyey+y2*eyez),-(z0*eyex+z1*eyey+z2*eyez),1)},yawPitchRoll:function(yaw,pitch,roll){this.zero(),_tempMat1.zero(),_tempMat2.zero();var m0=this.val,m1=_tempMat1.val,m2=_tempMat2.val,s=Math.sin(roll),c=Math.cos(roll);
100return m0[10]=1,m0[15]=1,m0[0]=c,m0[1]=s,m0[4]=-s,m0[5]=c,s=Math.sin(pitch),c=Math.cos(pitch),m1[0]=1,m1[15]=1,m1[5]=c,m1[10]=c,m1[9]=-s,m1[6]=s,s=Math.sin(yaw),c=Math.cos(yaw),m2[5]=1,m2[15]=1,m2[0]=c,m2[2]=-s,m2[8]=s,m2[10]=c,this.multiplyLocal(_tempMat1),this.multiplyLocal(_tempMat2),this},setWorldMatrix:function(rotation,position,scale,viewMatrix,projectionMatrix){return this.yawPitchRoll(rotation.y,rotation.x,rotation.z),_tempMat1.scaling(scale.x,scale.y,scale.z),_tempMat2.xyz(position.x,position.y,position.z),this.multiplyLocal(_tempMat1),this.multiplyLocal(_tempMat2),viewMatrix&&this.multiplyLocal(viewMatrix),projectionMatrix&&this.multiplyLocal(projectionMatrix),this},multiplyToMat4:function(src,out){var a=this.val,b=src.val,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15],b00=b[0],b01=b[1],b02=b[2],b03=b[3],b10=b[4],b11=b[5],b12=b[6],b13=b[7],b20=b[8],b21=b[9],b22=b[10],b23=b[11],b30=b[12],b31=b[13],b32=b[14],b33=b[15];return out.setValues(b00*a00+b01*a10+b02*a20+b03*a30,b01*a01+b01*a11+b02*a21+b03*a31,b02*a02+b01*a12+b02*a22+b03*a32,b03*a03+b01*a13+b02*a23+b03*a33,b10*a00+b11*a10+b12*a20+b13*a30,b10*a01+b11*a11+b12*a21+b13*a31,b10*a02+b11*a12+b12*a22+b13*a32,b10*a03+b11*a13+b12*a23+b13*a33,b20*a00+b21*a10+b22*a20+b23*a30,b20*a01+b21*a11+b22*a21+b23*a31,b20*a02+b21*a12+b22*a22+b23*a32,b20*a03+b21*a13+b22*a23+b23*a33,b30*a00+b31*a10+b32*a20+b33*a30,b30*a01+b31*a11+b32*a21+b33*a31,b30*a02+b31*a12+b32*a22+b33*a32,b30*a03+b31*a13+b32*a23+b33*a33)},fromRotationXYTranslation:function(rotation,position,translateFirst){var x=position.x,y=position.y,z=position.z,sx=Math.sin(rotation.x),cx=Math.cos(rotation.x),sy=Math.sin(rotation.y),cy=Math.cos(rotation.y),a30=x,a31=y,a32=z,b21=-sx,c01=0-b21*sy,c02=0-cx*sy,c21=b21*cy,c22=cx*cy;return translateFirst||(a30=cy*x+sy*z,a31=c01*x+cx*y+c21*z,a32=c02*x+sx*y+c22*z),this.setValues(cy,c01,c02,0,0,cx,sx,0,sy,c21,c22,0,a30,a31,a32,1)},getMaxScaleOnAxis:function(){var m=this.val,scaleXSq=m[0]*m[0]+m[1]*m[1]+m[2]*m[2],scaleYSq=m[4]*m[4]+m[5]*m[5]+m[6]*m[6],scaleZSq=m[8]*m[8]+m[9]*m[9]+m[10]*m[10];return Math.sqrt(Math.max(scaleXSq,scaleYSq,scaleZSq))}}),_tempMat1=new Matrix4$7,_tempMat2=new Matrix4$7,_x=new Vector3$9,_y=new Vector3$9,_z=new Vector3$9,Matrix4_1=Matrix4$7,Clamp$9=Clamp_1,Class$31=Class_1,NOOP$p=NOOP_1,tempMatrix$5=new Matrix4_1,Euler=new Class$31({initialize:function Euler(x,y,z,order){void 0===x&&(x=0),void 0===y&&(y=0),void 0===z&&(z=0),void 0===order&&(order=Euler.DefaultOrder),this._x=x,this._y=y,this._z=z,this._order=order,this.onChangeCallback=NOOP$p},x:{get:function(){return this._x},set:function(value){this._x=value,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(value){this._y=value,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(value){this._z=value,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(value){this._order=value,this.onChangeCallback(this)}},set:function(x,y,z,order){return void 0===order&&(order=this._order),this._x=x,this._y=y,this._z=z,this._order=order,this.onChangeCallback(this),this},copy:function(euler){return this.set(euler.x,euler.y,euler.z,euler.order)},setFromQuaternion:function(quaternion,order,update){return void 0===order&&(order=this._order),void 0===update&&(update=!1),tempMatrix$5.fromQuat(quaternion),this.setFromRotationMatrix(tempMatrix$5,order,update)},setFromRotationMatrix:function(matrix,order,update){void 0===order&&(order=this._order),void 0===update&&(update=!1);var elements=matrix.val,m11=elements[0],m12=elements[4],m13=elements[8],m21=elements[1],m22=elements[5],m23=elements[9],m31=elements[2],m32=elements[6],m33=elements[10],x=0,y=0,z=0;switch(order){case"XYZ":y=Math.asin(Clamp$9(m13,-1,1)),Math.abs(m13)<.99999?(x=Math.atan2(-m23,m33),z=Math.atan2(-m12,m11)):x=Math.atan2(m32,m22);break;case"YXZ":x=Math.asin(-Clamp$9(m23,-1,1)),Math.abs(m23)<.99999?(y=Math.atan2(m13,m33),z=Math.atan2(m21,m22)):y=Math.atan2(-m31,m11);break;case"ZXY":x=Math.asin(Clamp$9(m32,-1,1)),Math.abs(m32)<.99999?(y=Math.atan2(-m31,m33),z=Math.atan2(-m12,m22)):z=Math.atan2(m21,m11);break;case"ZYX":y=Math.asin(-Clamp$9(m31,-1,1)),Math.abs(m31)<.99999?(x=Math.atan2(m32,m33),z=Math.atan2(m21,m11)):z=Math.atan2(-m12,m22);break;case"YZX":z=Math.asin(Clamp$9(m21,-1,1)),Math.abs(m21)<.99999?(x=Math.atan2(-m23,m22),y=Math.atan2(-m31,m11)):y=Math.atan2(m13,m33);break;case"XZY":z=Math.asin(-Clamp$9(m12,-1,1)),Math.abs(m12)<.99999?(x=Math.atan2(m32,m22),y=Math.atan2(m13,m11)):x=Math.atan2(-m23,m33)}return this._x=x,this._y=y,this._z=z,this._order=order,update&&this.onChangeCallback(this),this}});
101/**
102	 * @author       Richard Davey <[email protected]>
103	 * @copyright    2020 Photon Storm Ltd.
104	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
105	 */Euler.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],Euler.DefaultOrder="XYZ";var Euler_1=Euler,FloorTo_1=function(value,place,base){void 0===place&&(place=0),void 0===base&&(base=10);var p=Math.pow(base,-place);return Math.floor(value*p)/p},GetSpeed_1=function(distance,time){return distance/time/1e3},IsEven_1=function(value){return value==parseFloat(value)?!(value%2):void 0},IsEvenStrict_1=function(value){return value===parseFloat(value)?!(value%2):void 0},MaxAdd_1=function(value,amount,max){return Math.min(value+amount,max)},Median_1=function(values){var valuesNum=values.length;if(0===valuesNum)return 0;values.sort((function(a,b){return a-b}));var halfIndex=Math.floor(valuesNum/2);return valuesNum%2==0?(values[halfIndex]+values[halfIndex-1])/2:values[halfIndex]},MinSub_1=function(value,amount,min){return Math.max(value-amount,min)},Percent_1=function(value,min,max,upperMax){void 0===max&&(max=min+1);var percentage=(value-min)/(max-min);return percentage>1?void 0!==upperMax?(percentage=(upperMax-value)/(upperMax-max))<0&&(percentage=0):percentage=1:percentage<0&&(percentage=0),percentage},CONST$1b=_const$b,RadToDeg_1=function(radians){return radians*CONST$1b.RAD_TO_DEG},RandomXY_1=function(vector,scale){void 0===scale&&(scale=1);var r=2*Math.random()*Math.PI;return vector.x=Math.cos(r)*scale,vector.y=Math.sin(r)*scale,vector},RandomXYZ_1=function(vec3,radius){void 0===radius&&(radius=1);var r=2*Math.random()*Math.PI,z=2*Math.random()-1,zScale=Math.sqrt(1-z*z)*radius;return vec3.x=Math.cos(r)*zScale,vec3.y=Math.sin(r)*zScale,vec3.z=z*radius,vec3},RandomXYZW_1=function(vec4,scale){return void 0===scale&&(scale=1),vec4.x=(2*Math.random()-1)*scale,vec4.y=(2*Math.random()-1)*scale,vec4.z=(2*Math.random()-1)*scale,vec4.w=(2*Math.random()-1)*scale,vec4},Rotate_1$2=function(point,angle){var x=point.x,y=point.y;return point.x=x*Math.cos(angle)-y*Math.sin(angle),point.y=x*Math.sin(angle)+y*Math.cos(angle),point},RotateTo_1=function(point,x,y,angle,distance){return point.x=x+distance*Math.cos(angle),point.y=y+distance*Math.sin(angle),point},RoundAwayFromZero_1=function(value){return value>0?Math.ceil(value):Math.floor(value)},RoundTo_1=function(value,place,base){void 0===place&&(place=0),void 0===base&&(base=10);var p=Math.pow(base,-place);return Math.round(value*p)/p},SinCosTableGenerator_1=function(length,sinAmp,cosAmp,frequency){void 0===sinAmp&&(sinAmp=1),void 0===cosAmp&&(cosAmp=1),void 0===frequency&&(frequency=1),frequency*=Math.PI/length;for(var cos=[],sin=[],c=0;c<length;c++)sinAmp+=(cosAmp-=sinAmp*frequency)*frequency,cos[c]=cosAmp,sin[c]=sinAmp;return{sin:sin,cos:cos,length:length}},Vector2$I=Vector2_1,ToXY_1=function(index,width,height,out){void 0===out&&(out=new Vector2$I);var x=0,y=0;return index>0&&index<=width*height&&(x=index>
vendor: 14,313 bytes, lines 105-110
105width-1?index-(y=Math.floor(index/width))*width:index),out.set(x,y)},Within_1=function(a,b,tolerance){return Math.abs(a-b)<=tolerance},Vector4$3=new Class_1({initialize:function(x,y,z,w){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof x?(this.x=x.x||0,this.y=x.y||0,this.z=x.z||0,this.w=x.w||0):(this.x=x||0,this.y=y||0,this.z=z||0,this.w=w||0)},clone:function(){return new Vector4$3(this.x,this.y,this.z,this.w)},copy:function(src){return this.x=src.x,this.y=src.y,this.z=src.z||0,this.w=src.w||0,this},equals:function(v){return this.x===v.x&&this.y===v.y&&this.z===v.z&&this.w===v.w},set:function(x,y,z,w){return"object"==typeof x?(this.x=x.x||0,this.y=x.y||0,this.z=x.z||0,this.w=x.w||0):(this.x=x||0,this.y=y||0,this.z=z||0,this.w=w||0),this},add:function(v){return this.x+=v.x,this.y+=v.y,this.z+=v.z||0,this.w+=v.w||0,this},subtract:function(v){return this.x-=v.x,this.y-=v.y,this.z-=v.z||0,this.w-=v.w||0,this},scale:function(scale){return this.x*=scale,this.y*=scale,this.z*=scale,this.w*=scale,this},length:function(){var x=this.x,y=this.y,z=this.z,w=this.w;return Math.sqrt(x*x+y*y+z*z+w*w)},lengthSq:function(){var x=this.x,y=this.y,z=this.z,w=this.w;return x*x+y*y+z*z+w*w},normalize:function(){var x=this.x,y=this.y,z=this.z,w=this.w,len=x*x+y*y+z*z+w*w;return len>0&&(len=1/Math.sqrt(len),this.x=x*len,this.y=y*len,this.z=z*len,this.w=w*len),this},dot:function(v){return this.x*v.x+this.y*v.y+this.z*v.z+this.w*v.w},lerp:function(v,t){void 0===t&&(t=0);var ax=this.x,ay=this.y,az=this.z,aw=this.w;return this.x=ax+t*(v.x-ax),this.y=ay+t*(v.y-ay),this.z=az+t*(v.z-az),this.w=aw+t*(v.w-aw),this},multiply:function(v){return this.x*=v.x,this.y*=v.y,this.z*=v.z||1,this.w*=v.w||1,this},divide:function(v){return this.x/=v.x,this.y/=v.y,this.z/=v.z||1,this.w/=v.w||1,this},distance:function(v){var dx=v.x-this.x,dy=v.y-this.y,dz=v.z-this.z||0,dw=v.w-this.w||0;return Math.sqrt(dx*dx+dy*dy+dz*dz+dw*dw)},distanceSq:function(v){var dx=v.x-this.x,dy=v.y-this.y,dz=v.z-this.z||0,dw=v.w-this.w||0;return dx*dx+dy*dy+dz*dz+dw*dw},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(mat){var x=this.x,y=this.y,z=this.z,w=this.w,m=mat.val;return this.x=m[0]*x+m[4]*y+m[8]*z+m[12]*w,this.y=m[1]*x+m[5]*y+m[9]*z+m[13]*w,this.z=m[2]*x+m[6]*y+m[10]*z+m[14]*w,this.w=m[3]*x+m[7]*y+m[11]*z+m[15]*w,this},transformQuat:function(q){var x=this.x,y=this.y,z=this.z,qx=q.x,qy=q.y,qz=q.z,qw=q.w,ix=qw*x+qy*z-qz*y,iy=qw*y+qz*x-qx*z,iz=qw*z+qx*y-qy*x,iw=-qx*x-qy*y-qz*z;return this.x=ix*qw+iw*-qx+iy*-qz-iz*-qy,this.y=iy*qw+iw*-qy+iz*-qx-ix*-qz,this.z=iz*qw+iw*-qz+ix*-qy-iy*-qx,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});
106/**
107	 * @author       Richard Davey <[email protected]>
108	 * @copyright    2020 Photon Storm Ltd.
109	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
110	 */Vector4$3.prototype.sub=Vector4$3.prototype.subtract,Vector4$3.prototype.mul=Vector4$3.prototype.multiply,Vector4$3.prototype.div=Vector4$3.prototype.divide,Vector4$3.prototype.dist=Vector4$3.prototype.distance,Vector4$3.prototype.distSq=Vector4$3.prototype.distanceSq,Vector4$3.prototype.len=Vector4$3.prototype.length,Vector4$3.prototype.lenSq=Vector4$3.prototype.lengthSq;var Vector4_1=Vector4$3,Matrix3$1=new Class_1({initialize:function(m){this.val=new Float32Array(9),m?this.copy(m):this.identity()},clone:function(){return new Matrix3$1(this)},set:function(src){return this.copy(src)},copy:function(src){var out=this.val,a=src.val;return out[0]=a[0],out[1]=a[1],out[2]=a[2],out[3]=a[3],out[4]=a[4],out[5]=a[5],out[6]=a[6],out[7]=a[7],out[8]=a[8],this},fromMat4:function(m){var a=m.val,out=this.val;return out[0]=a[0],out[1]=a[1],out[2]=a[2],out[3]=a[4],out[4]=a[5],out[5]=a[6],out[6]=a[8],out[7]=a[9],out[8]=a[10],this},fromArray:function(a){var out=this.val;return out[0]=a[0],out[1]=a[1],out[2]=a[2],out[3]=a[3],out[4]=a[4],out[5]=a[5],out[6]=a[6],out[7]=a[7],out[8]=a[8],this},identity:function(){var out=this.val;return out[0]=1,out[1]=0,out[2]=0,out[3]=0,out[4]=1,out[5]=0,out[6]=0,out[7]=0,out[8]=1,this},transpose:function(){var a=this.val,a01=a[1],a02=a[2],a12=a[5];return a[1]=a[3],a[2]=a[6],a[3]=a01,a[5]=a[7],a[6]=a02,a[7]=a12,this},invert:function(){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a10=a[3],a11=a[4],a12=a[5],a20=a[6],a21=a[7],a22=a[8],b01=a22*a11-a12*a21,b11=-a22*a10+a12*a20,b21=a21*a10-a11*a20,det=a00*b01+a01*b11+a02*b21;return det?(det=1/det,a[0]=b01*det,a[1]=(-a22*a01+a02*a21)*det,a[2]=(a12*a01-a02*a11)*det,a[3]=b11*det,a[4]=(a22*a00-a02*a20)*det,a[5]=(-a12*a00+a02*a10)*det,a[6]=b21*det,a[7]=(-a21*a00+a01*a20)*det,a[8]=(a11*a00-a01*a10)*det,this):null},adjoint:function(){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a10=a[3],a11=a[4],a12=a[5],a20=a[6],a21=a[7],a22=a[8];return a[0]=a11*a22-a12*a21,a[1]=a02*a21-a01*a22,a[2]=a01*a12-a02*a11,a[3]=a12*a20-a10*a22,a[4]=a00*a22-a02*a20,a[5]=a02*a10-a00*a12,a[6]=a10*a21-a11*a20,a[7]=a01*a20-a00*a21,a[8]=a00*a11-a01*a10,this},determinant:function(){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a10=a[3],a11=a[4],a12=a[5],a20=a[6],a21=a[7],a22=a[8];return a00*(a22*a11-a12*a21)+a01*(-a22*a10+a12*a20)+a02*(a21*a10-a11*a20)},multiply:function(src){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a10=a[3],a11=a[4],a12=a[5],a20=a[6],a21=a[7],a22=a[8],b=src.val,b00=b[0],b01=b[1],b02=b[2],b10=b[3],b11=b[4],b12=b[5],b20=b[6],b21=b[7],b22=b[8];return a[0]=b00*a00+b01*a10+b02*a20,a[1]=b00*a01+b01*a11+b02*a21,a[2]=b00*a02+b01*a12+b02*a22,a[3]=b10*a00+b11*a10+b12*a20,a[4]=b10*a01+b11*a11+b12*a21,a[5]=b10*a02+b11*a12+b12*a22,a[6]=b20*a00+b21*a10+b22*a20,a[7]=b20*a01+b21*a11+b22*a21,a[8]=b20*a02+b21*a12+b22*a22,this},translate:function(v){var a=this.val,x=v.x,y=v.y;return a[6]=x*a[0]+y*a[3]+a[6],a[7]=x*a[1]+y*a[4]+a[7],a[8]=x*a[2]+y*a[5]+a[8],this},rotate:function(rad){var a=this.val,a00=a[0],a01=a[1],a02=a[2],a10=a[3],a11=a[4],a12=a[5],s=Math.sin(rad),c=Math.cos(rad);return a[0]=c*a00+s*a10,a[1]=c*a01+s*a11,a[2]=c*a02+s*a12,a[3]=c*a10-s*a00,a[4]=c*a11-s*a01,a[5]=c*a12-s*a02,this},scale:function(v){var a=this.val,x=v.x,y=v.y;return a[0]=x*a[0],a[1]=x*a[1],a[2]=x*a[2],a[3]=y*a[3],a[4]=y*a[4],a[5]=y*a[5],this},fromQuat:function(q){var x=q.x,y=q.y,z=q.z,w=q.w,x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2,out=this.val;return out[0]=1-(yy+zz),out[3]=xy+wz,out[6]=xz-wy,out[1]=xy-wz,out[4]=1-(xx+zz),out[7]=yz+wx,out[2]=xz+wy,out[5]=yz-wx,out[8]=1-(xx+yy),this},normalFromMat4:function(m){var a=m.val,out=this.val,a00=a[0],a01=a[1],a02=a[2],a03=a[3],a10=a[4],a11=a[5],a12=a[6],a13=a[7],a20=a[8],a21=a[9],a22=a[10],a23=a[11],a30=a[12],a31=a[13],a32=a[14],a33=a[15],b00=a00*a11-a01*a10,b01=a00*a12-a02*a10,b02=a00*a13-a03*a10,b03=a01*a12-a02*a11,b04=a01*a13-a03*a11,b05=a02*a13-a03*a12,b06=a20*a31-a21*a30,b07=a20*a32-a22*a30,b08=a20*a33-a23*a30,b09=a21*a32-a22*a31,b10=a21*a33-a23*a31,b11=a22*a33-a23*a32,det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;return det?(det=1/det,out[0]=(a11*b11-a12*b10+a13*b09)*det,out[1]=(a12*b08-a10*b11-a13*b07)*det,out[2]=(a10*b10-a11*b08+a13*b06)*det,out[3]=(a02*b10-a01*b11-a03*b09)*det,out[4]=(a00*b11-a02*b08+a03*b07)*det,out[5]=(a01*b08-a00*b10-a03*b06)*det,out[6]=(a31*b05-a32*b04+a33*b03)*det,out[7]=(a32*b02-a30*b05-a33*b01)*det,out[8]=(a30*b04-a31*b02+a33*b00)*det,this):null}}),Matrix3_1=Matrix3$1,Class$2_=Class_1,Matrix3=Matrix3_1,NOOP$o=NOOP_1,Vector3$8=Vector3_1,siNext=new Int8Array([1,2,0]),tmp$1=new Float32Array([0,0,0]),xUnitVec3=new Vector3$8(1,0,0),yUnitVec3=new Vector3$8(0,1,0),tmpvec=new Vector3$8,tmpMat3=new Matrix3,Quaternion$1=new Class$2_({initialize:function(x,y,z,w){this.onChangeCallback=NOOP$o,this.set(x,y,z,w)},x:{get:function(){return this._x},set:function(value){this._x=value,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(value){this._y=value,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(value){this._z=value,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(value){this._w=value,this.onChangeCallback(this)}},copy:function(src){return this.set(src)},set:function(x,y,z,w,update){return void 0===update&&(update=!0),"object"==typeof x?(this._x=x.x||0,this._y=x.y||0,this._z=x.z||0,this._w=x.w||0):(this._x=x||0,this._y=y||0,this._z=z||0,this._w=w||0),update&&this.onChangeCallback(this),this},add:function(v){return this._x+=v.x,this._y+=v.y,this._z+=v.z,this._w+=v.w,this.onChangeCallback(this),this},subtract:function(v){return this._x-=v.x,this._y-=v.y,this._z-=v.z,this._w-=v.w,this.onChangeCallback(this),this},scale:function(scale){return this._x*=scale,this._y*=scale,this._z*=scale,this._w*=scale,this.onChangeCallback(this),this},length:function(){var x=this.x,y=this.y,z=this.z,w=this.w;return Math.sqrt(x*x+y*y+z*z+w*w)},lengthSq:function(){var x=this.x,y=this.y,z=this.z,w=this.w;return x*x+y*y+z*z+w*w},normalize:function(){var x=this.x,y=this.y,z=this.z,w=this.w,len=x*x+y*y+z*z+w*w;return len>0&&(len=1/Math.sqrt(len),this._x=x*len,this._y=y*len,this._z=z*len,this._w=w*len),this.onChangeCallback(this),this},dot:function(v){return this.x*v.x+this.y*v.y+this.z*v.z+this.w*v.w},lerp:function(v,t){void 0===t&&(t=0);var ax=this.x,ay=this.y,az=this.z,aw=this.w;return this.set(ax+t*(v.x-ax),ay+t*(v.y-ay),az+t*(v.z-az),aw+t*(v.w-aw))},rotationTo:function(a,b){var dot=a.x*b.x+a.y*b.y+a.z*b.z;return dot<-.999999?(tmpvec.copy(xUnitVec3).cross(a).length()<1e-6&&tmpvec.copy(yUnitVec3).cross(a),tmpvec.normalize(),this.setAxisAngle(tmpvec,Math.PI)):dot>.999999?this.set(0,0,0,1):(tmpvec.copy(a).cross(b),this._x=tmpvec.x,this._y=tmpvec.y,this._z=tmpvec.z,this._w=1+dot,this.normalize())},setAxes:function(view,right,up){var m=tmpMat3.val;return m[0]=right.x,m[3]=right.y,m[6]=right.z,m[1]=up.x,m[4]=up.y,m[7]=up.z,m[2]=-view.x,m[5]=-view.y,m[8]=-view.z,this.fromMat3(tmpMat3).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(axis,rad){rad*=.5;var s=Math.sin(rad);return this.set(s*axis.x,s*axis.y,s*axis.z,Math.cos(rad))},multiply:function(b){var ax=this.x,ay=this.y,az=this.z,aw=this.w,bx=b.x,by=b.y,bz=b.z,bw=b.w;return this.set(ax*bw+aw*bx+ay*bz-az*by,ay*bw+aw*by+az*bx-ax*bz,az*bw+aw*bz+ax*by-ay*bx,aw*bw-ax*bx-ay*by-az*bz)},slerp:function(b,t){var ax=this.x,ay=this.y,az=this.z,aw=this.w,bx=b.x,by=b.y,bz=b.z,bw=b.w,cosom=ax*bx+ay*by+az*bz+aw*bw;cosom<0&&(cosom=-cosom,bx=-bx,by=-by,bz=-bz,bw=-bw);var scale0=1-t,scale1=t;if(1-cosom>1e-6){var omega=Math.acos(cosom),sinom=Math.sin(omega);scale0=Math.sin((1-t)*omega)/sinom,scale1=Math.sin(t*omega)/sinom}return this.set(scale0*ax+scale1*bx,scale0*ay+scale1*by,scale0*az+scale1*bz,scale0*aw+scale1*bw)},invert:function(){var a0=this.x,a1=this.y,a2=this.z,a3=this.w,dot=a0*a0+a1*a1+a2*a2+a3*a3,invDot=dot?1/dot:0;return this.set(-a0*invDot,-a1*invDot,-a2*invDot,a3*invDot)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(rad){rad*=.5;var ax=this.x,ay=this.y,az=this.z,aw=this.w,bx=Math.sin(rad),bw=Math.cos(rad);return this.set(ax*bw+aw*bx,ay*bw+az*bx,az*bw-ay*bx,aw*bw-ax*bx)},rotateY:function(rad){rad*=.5;var ax=this.x,ay=this.y,az=this.z,aw=this.w,by=Math.sin(rad),bw=Math.cos(rad);return this.set(ax*bw-az*by,ay*bw+aw*by,az*bw+ax*by,aw*bw-ay*by)},rotateZ:function(rad){rad*=.5;var ax=this.x,ay=this.y,az=this.z,aw=this.w,bz=Math.sin(rad),bw=Math.cos(rad);return this.set(ax*bw+ay*bz,ay*bw-ax*bz,az*bw+aw*bz,aw*bw-az*bz)},calculateW:function(){var x=this.x,y=this.y,z=this.z;return this.w=-Math.sqrt(1-x*x-y*y-z*z),this},setFromEuler:function(euler,update){var x=euler.x/2,y=euler.y/2,z=euler.z/2,c1=Math.cos(x),c2=Math.cos(y),c3=Math.cos(z),s1=Math.sin(x),s2=Math.sin(y),s3=Math.sin(z);switch(euler.order){case"XYZ":this.set(s1*c2*c3+c1*s2*s3,c1*s2*c3-s1*c2*s3,c1*c2*s3+s1*s2*c3,c1*c2*c3-s1*s2*s3,update);break;case"YXZ":this.set(s1*c2*c3+c1*s2*s3,c1*s2*c3-s1*c2*s3,c1*c2*s3-s1*s2*c3,c1*c2*c3+s1*s2*s3,update);break;case"ZXY":this.set(s1*c2*c3-c1*s2*s3,c1*s2*c3+s1*c2*s3,c1*c2*s3+s1*s2*c3,c1*c2*c3-s1*s2*s3,update);break;case"ZYX":this.set(s1*c2*c3-c1*s2*s3,c1*s2*c3+s1*c2*s3,c1*c2*s3-s1*s2*c3,c1*c2*c3+s1*s2*s3,update);break;case"YZX":this.set(s1*c2*c3+c1*s2*s3,c1*s2*c3+s1*c2*s3,c1*c2*s3-s1*s2*c3,c1*c2*c3-s1*s2*s3,update);break;case"XZY":this.set(s1*c2*c3-c1*s2*s3,c1*s2*c3-s1*c2*s3,c1*c2*s3+s1*s2*c3,c1*c2*c3+s1*s2*s3,update)}return this},setFromRotationMatrix:function(mat4){var s,m=mat4.val,m11=m[0],m12=m[4],m13=m[8],m21=m[1],m22=m[5],m23=m[9],m31=m[2],m32=m[6],m33=m[10],trace=m11+m22+m33;return trace>0?(s=.5/Math.sqrt(trace+1),this.set((m32-m23)*s,(m13-m31)*s,(m21-m12)*s,.25/s)):m11>m22&&m11>m33?(s=2*Math.sqrt(1+m11-m22-m33),this.set(.25*s,(m12+m21)/s,(m13+m31)/s,(m32-m23)/s)):m22>m33?(s=2*Math.sqrt(1+m22-m11-m33),this.set((m12+m21)/s,.25*s,(m23+m32)/s,(m13-m31)/s)):(s=2*Math.sqrt(1+m33-m11-m22),this.set((m13+m31)/s,(m23+m32)/s,.25*s,(m21-m12)/s)),this},fromMat3:function(mat){var fRoot,m=mat.val,fTrace=m[0]+m[4]+m[8];if(fTrace>0)fRoot=Math.sqrt(fTrace+1),this.w=.5*fRoot,fRoot=.5/fRoot,this._x=(m[7]-m[5])*fRoot,this._y=(m[2]-m[6])*fRoot,this._z=(m[3]-m[1])*fRoot;else{var i=0;m[4]>m[0]&&(i=1),m[8]>m[3*i+i]&&(i=2);var j=siNext[i],k=siNext[j];fRoot=Math.sqrt(m[3*i+i]-m[3*j+j]-m[3*k+k]+1),tmp$1[i]=.5*fRoot,fRoot=.5/fRoot,tmp$1[j]=(m[3*j+i]+m[3*i+j])*fRoot,tmp$1[k]=(m[3*k+i]+m[3*i+k])*fRoot,this._x=tmp$1[0],this._y=tmp$1[1],this._z=tmp$1[2],this._w=(m[3*k+j]-m[3*j+k])*fRoot}return this.onChangeCallback(this),this}}),Quaternion_1=Quaternion$1,Vector3$7=Vector3_1,Quaternion=Quaternion_1,tmpMat4=new Matrix4_1,tmpQuat=new Quaternion,tmpVec3=new Vector3$7,PhaserMath$1={Angle:angle,Distance:distance,Easing:easing,Fuzzy:fuzzy,Interpolation:interpolation,Pow2:pow2,Snap:snap,RandomDataGenerator:RandomDataGenerator_1,Average:Average_1,Bernstein:Bernstein_1,Between:Between_1,CatmullRom:CatmullRom_1,CeilTo:CeilTo_1,Clamp:Clamp_1,DegToRad:DegToRad_1,Difference:Difference_1,Euler:Euler_1,Factorial:Factorial_1,FloatBetween:FloatBetween_1,FloorTo:FloorTo_1,FromPercent:FromPercent_1,GetSpeed:GetSpeed_1,IsEven:IsEven_1,IsEvenStrict:IsEvenStrict_1,Linear:Linear_1,MaxAdd:MaxAdd_1,Median:Median_1,MinSub:MinSub_1,Percent:Percent_1,RadToDeg:RadToDeg_1,RandomXY:RandomXY_1,RandomXYZ:RandomXYZ_1,RandomXYZW:RandomXYZW_1,Rotate:Rotate_1$2,RotateAroun
110d:RotateAround_1$1,RotateAroundDistance:RotateAroundDistance_1$1,RotateTo:RotateTo_1,RoundAwayFromZero:RoundAwayFromZero_1,RoundTo:RoundTo_1,SinCosTableGenerator:SinCosTableGenerator_1,SmootherStep:SmootherStep_1$1,SmoothStep:SmoothStep_1$1,ToXY:ToXY_1,TransformXY:TransformXY_1,Within:Within_1,Wrap:Wrap_1$1,Vector2:Vector2_1,Vector3:Vector3_1,Vector4:Vector4_1,Matrix3:Matrix3_1,Matrix4:Matrix4_1,Quaternion:Quaternion_1,RotateVec3:function(vec,axis,radians){return tmpQuat.setAxisAngle(axis,radians),tmpMat4.fromRotationTranslation(tmpQuat,tmpVec3.set(0,0,0)),vec.transformMat4(tmpMat4)}},math=PhaserMath$1=Extend_1$1(!1,PhaserMath$1,_const$b),DefaultPlugins_1={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]},CONST$19=_const$e,Device$1=device,GetFastValue$1f=GetFastValue_1,GetValue$u=GetValue_1,IsPlainObject$w=IsPlainObject_1,PhaserMath=math,NOOP$n=NOOP_1,DefaultPlugins$1=DefaultPlugins_1,ValueToColor=ValueToColor_1,Config$1=new Class_1({initialize:function(config){void 0===config&&(config={});this.width=GetValue$u(config,"width",1024),this.height=GetValue$u(config,"height",768),this.zoom=GetValue$u(config,"zoom",1),this.parent=GetValue$u(config,"parent",void 0),this.scaleMode=GetValue$u(config,"scaleMode",0),this.expandParent=GetValue$u(config,"expandParent",!0),this.autoRound=GetValue$u(config,"autoRound",!1),this.autoCenter=GetValue$u(config,"autoCenter",0),this.resizeInterval=GetValue$u(config,"resizeInterval",500),this.fullscreenTarget=GetValue$u(config,"fullscreenTarget",null),this.minWidth=GetValue$u(config,"minWidth",0),this.maxWidth=GetValue$u(config,"maxWidth",0),this.minHeight=GetValue$u(config,"minHeight",0),this.maxHeight=GetValue$u(config,"maxHeight",0);var scaleConfig=GetValue$u(config,"scale",null);scaleConfig&&(this.width=GetValue$u(scaleConfig,"width",this.width),this.height=GetValue$u(scaleConfig,"height",this.height),this.zoom=GetValue$u(scaleConfig,"zoom",this.zoom),this.parent=GetValue$u(scaleConfig,"parent",this.parent),this.scaleMode=GetValue$u(scaleConfig,"mode",this.scaleMode),this.expandParent=GetValue$u(scaleConfig,"expandParent",this.expandParent),this.autoRound=GetValue$u(scaleConfig,"autoRound",this.autoRound),this.autoCenter=GetValue$u(scaleConfig,"autoCenter",this.autoCenter),this.resizeInterval=GetValue$u(scaleConfig,"resizeInterval",this.resizeInterval),this.fullscreenTarget=GetValue$u(scaleConfig,"fullscreenTarget",this.fullscreenTarget),this.minWidth=GetValue$u(scaleConfig,"min.width",this.minWidth),this.maxWidth=GetValue$u(scaleConfig,"max.width",this.maxWidth),this.minHeight=GetValue$u(scaleConfig,"min.height",this.minHeight),this.maxHeight=GetValue$u(scaleConfig,"max.height",this.maxHeight)),this.renderType=GetValue$u(config,"type",CONST$19.AUTO),this.canvas=GetValue$u(config,"canvas",null),this.context=GetValue$u(config,"context",null),this.canvasStyle=GetValue$u(config,"canvasStyle",null),this.customEnvironment=GetValue$u(config,"customEnvironment",!1),this.sceneConfig=GetValue$u(config,"scene",null),this.seed=GetValue$u(config,"seed",[(Date.now()*Math.random()).toString()]),PhaserMath.RND=new PhaserMath.RandomDataGenerator(this.seed),this.gameTitle=GetValue$u(config,"title",""),this.gameURL=GetValue$u(config,"url","https://phaser.io"),this.gameVersion=GetValue$u(config,"version",""),this.autoFocus=GetValue$u(config,"autoFocus",!0),this.domCreateContainer=GetValue$u(config,"dom.createContainer",!1),this.domBehindCanvas=GetValue$u(config,"dom.behindCanvas",!1),this.domPointerEvents=GetValue$u(config,"dom.pointerEvents","none"),this.inputKeyboard=GetValue$u(config,"input.keyboard",!0),this.inputKeyboardEventTarget=GetValue$u(config,"input.keyboard.target",window),this.inputKeyboardCapture=GetValue$u(config,"input.keyboard.capture",[]),this.inputMouse=GetValue$u(config,"input.mouse",!0),this.inputMouseEventTarget=GetValue$u(config,"input.mouse.target",null),this.inputMousePreventDefaultDown=GetValue$u(config,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=GetValue$u(config,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=GetValue$u(config,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=GetValue$u(config,"input.mouse.preventDefaultWheel",!0),this.inputTouch=GetValue$u(config,"input.touch",Device$1.input.touch),this.inputTouchEventTarget=GetValue$u(config,"input.touch.target",null),this.inputTouchCapture=GetValue$u(config,"input.touch.capture",!0),this.inputActivePointers=GetValue$u(config,"input.activePointers",1),this.inputSmoothFactor=GetValue$u(config,"input.smoothFactor",0),this.inputWindowEvents=GetValue$u(config,"input.windowEvents",!0),this.inputGamepad=GetValue$u(config,"input.gamepad",!1),this.inputGamepadEventTarget=GetValue$u(config,"input.gamepad.target",window),this.disableContextMenu=GetValue$u(config,"disableContextMenu",!1),this.audio=GetValue$u(config,"audio",{}),this.hideBanner=!1===GetValue$u(config,"banner",null),this.hidePhaser=GetValue$u(config,"banner.hidePhaser",!1),this.bannerTextColor=GetValue$u(config,"banner.text","#ffffff"),this.bannerBackgroun
110dColor=GetValue$u(config,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=GetValue$u(config,"fps",null);var renderConfig=GetValue$u(config,"render",config);this.pipeline=GetValue$u(renderConfig,"pipeline",null),this.antialias=GetValue$u(renderConfig,"antialias",!0),this.antialiasGL=GetValue$u(renderConfig,"antialiasGL",!0),this.mipmapFilter=GetValue$u(renderConfig,"mipmapFilter","LINEAR"),this.desynchronized=GetValue$u(renderConfig,"desynchronized",!1),this.roundPixels=GetValue$u(renderConfig,"roundPixels",!1),this.pixelArt=GetValue$u(renderConfig,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=GetValue$u(renderConfig,"transparent",!1),this.clearBeforeRender=GetValue$u(renderConfig,"clearBeforeRender",!0),this.preserveDrawingBuffer=GetValue$u(renderConfig,"preserveDrawingBuffer",!1),this.premultipliedAlpha=GetValue$u(renderConfig,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=GetValue$u(renderConfig,"failIfMajorPerformanceCaveat",!1),this.powerPreference=GetValue$u(renderConfig,"powerPreference","default"),this.batchSize=GetValue$u(renderConfig,"batchSize",4096),this.maxTextures=GetValue$u(renderConfig,"maxTextures",-1),this.maxLights=GetValue$u(renderConfig,"maxLights",10);var bgc=GetValue$u(config,"backgroundColor",0);this.backgroundColor=ValueToColor(bgc),this.transparent&&(this.backgroundColor=ValueToColor(0),this.backgroundColor.alpha=0),this.preBoot=GetValue$u(config,"callbacks.preBoot",NOOP$n),this.postBoot=GetValue$u(config,"callbacks.postBoot",NOOP$n),this.physics=GetValue$u(config,"physics",{}),this.defaultPhysicsSystem=GetValue$u(this.physics,"default",!1),this.loaderBaseURL=GetValue$u(config,"loader.baseURL",""),this.loaderPath=GetValue$u(config,"loader.path","");var defaultParallel=Device$1.os.android?6:32;this.loaderMaxParallelDownloads=GetValue$u(config,"loader.maxParallelDownloads",defaultParallel),this.loaderCrossOrigin=GetValue$u(config,"loader.crossOrigin",void 0),this.loaderResponseType=GetValue$u(config,"loader.responseType",""),this.loaderAsync=GetValue$u(config,"loader.async",!0),this.loaderUser=GetValue$u(config,"loader.user",""),this.loaderPassword=GetValue$u(config,"loader.password",""),this.loaderTimeout=GetValue$u(config,"loader.timeout",0),this.loaderWithCredentials=GetValue$u(config,"loader.withCredentials",!1),this.installGlobalPlugins=[],this.installScenePlugins=[];var plugins=GetValue$u(config,"plugins",null),defaultPlugins=DefaultPlugins$1.DefaultScene;plugins&&(Array.isArray(plugins)?this.defaultPlugins=plugins:IsPlainObject$w(plugins)&&(this.installGlobalPlugins=GetFastValue$1f(plugins,"global",[]),this.installScenePlugins=GetFastValue$1f(plugins,"scene",[]),Array.isArray(plugins.default)?defaultPlugins=plugins.default:Array.isArray(plugins.defaultMerge)&&(defaultPlugins=defaultPlugins.concat(plugins.defaultMerge)))),this.defaultPlugins=defaultPlugins;var pngPrefix="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=GetValue$u(config,"images.default",pngPrefix+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=GetValue$u(config,"images.missing",pngPrefix+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=GetValue$u(config,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=CONST$19.WEBGL:window.FORCE_CANVAS&&(this.renderType=CONST$19.CANVAS))}}),Config_1=Config$1,CanvasInterpolation_1={setCrisp:function(canvas){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(type){canvas.style["image-rendering"]=type})),canvas.style.msInterpolationMode="nearest-neighbor",canvas},setBicubic:function(canvas){return canvas.style["image-rendering"]="auto",canvas.style.msInterpolationMode="bicubic",canvas}},CanvasPool$a=CanvasPool_1,Color$7=Color_1,GetFastValue$1e=GetFastValue_1,CanvasSnapshot_1=function(canvas,config){var callback=GetFastValue$1e(config,"callback"),type=GetFastValue$1e(config,"type","image/png"),encoderOptions=GetFastValue$1e(config,"encoder",.92),x=Math.abs(Math.round(GetFastValue$1e(config,"x",0))),y=Math.abs(Math.round(GetFastValue$1e(config,"y",0))),width=GetFastValue$1e(config,"width",canvas.width),height=GetFastValue$1e(config,"height",canvas.height);if(GetFastValue$1e(config,"getPixel",!1)){var data=canvas.getContext("2d").getImageData(x,y,1,1).data;callback.call(null,new Color$7(data[0],data[1],data[2],data[3]/255))}else if(0!==x||0!==y||width!==canvas.width||height!==canvas.height){var copyCanvas=CanvasPool$a.createWebGL(this,width,height);copyCanvas.getContext("2d").drawImage(canvas,x,y,width,height,0,0,width,height);var image1=new Image;image1.onerror=function(){callback.call(null),CanvasPool$a.remove(copyCanvas)},image1.onload=function(){callback.call(null,image1),CanvasPool$a.remove(copyCanvas)},image1.src=copyCanvas.toDataURL(type,encoderOptions)}else{var image2=new Image;image2.onerror=function(){callback.call(null)},image2.onload=function(){callback.call(null,image2)},image2.src=canvas.toDataURL(type,encoderOptions)}}
110,modes=BlendModes$8,CanvasFeatures=CanvasFeatures_1,GetBlendModes_1=function(){var output=[],useNew=CanvasFeatures.supportNewBlendModes,so="source-over";return output[modes.NORMAL]=so,output[modes.ADD]="lighter",output[modes.MULTIPLY]=useNew?"multiply":so,output[modes.SCREEN]=useNew?"screen":so,output[modes.OVERLAY]=useNew?"overlay":so,output[modes.DARKEN]=useNew?"darken":so,output[modes.LIGHTEN]=useNew?"lighten":so,output[modes.COLOR_DODGE]=useNew?"color-dodge":so,output[modes.COLOR_BURN]=useNew?"color-burn":so,output[modes.HARD_LIGHT]=useNew?"hard-light":so,output[modes.SOFT_LIGHT]=useNew?"soft-light":so,output[modes.DIFFERENCE]=useNew?"difference":so,output[modes.EXCLUSION]=useNew?"exclusion":so,output[modes.HUE]=useNew?"hue":so,output[modes.SATURATION]=useNew?"saturation":so,output[modes.COLOR]=useNew?"color":so,output[modes.LUMINOSITY]=useNew?"luminosity":so,output[modes.ERASE]="destination-out",output[modes.SOURCE_IN]="source-in",output[modes.SOURCE_OUT]="source-out",output[modes.SOURCE_ATOP]="source-atop",output[modes.DESTINATION_OVER]="destination-over",output[modes.DESTINATION_IN]="destination-in",output[modes.DESTINATION_OUT]="destination-out",output[modes.DESTINATION_ATOP]="destination-atop",output[modes.LIGHTER]="lighter",output[modes.COPY]="copy",output[modes.XOR]="xor",output},events$b={ADD:"addtexture",ERROR:"onerror",LOAD:"onload",READY:"ready",REMOVE:"removetexture"},CameraEvents$1=events$d,CanvasSnapshot=CanvasSnapshot_1,CONST$18=_const$e,EventEmitter$q=eventemitter3.exports,Events$F=events$j,GetBlendM
110odes=GetBlendModes_1,ScaleEvents$1=events$c,TextureEvents$2=events$b,TransformMatrix$d=TransformMatrix_1,CanvasRenderer=new Class_1({Extends:EventEmitter$q,initialize:function(game){EventEmitter$q.call(this);var gameConfig=game.config;this.config={clearBeforeRender:gameConfig.clearBeforeRender,backgroundColor:gameConfig.backgroundColor,antialias:gameConfig.antialias,roundPixels:gameConfig.roundPixels},this.game=game,this.type=CONST$18.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=game.canvas;var contextOptions={alpha:game.config.transparent,desynchronized:game.config.desynchronized};this.gameContext=gameConfig.context?gameConfig.context:this.gameCanvas.getContext("2d",contextOptions),this.currentContext=this.gameContext,this.antialias=game.config.antialias,this.blendModes=GetBlendModes(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new TransformMatrix$d,this._tempMatrix2=new TransformMatrix$d,this._tempMatrix3=new TransformMatrix$d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(TextureEvents$2.READY,this.boot,this)},boot:function(){var game=this.game,baseSize=game.scale.baseSize;this.width=baseSize.width,this.height=baseSize.height,this.isBooted=!0,game.scale.on(ScaleEvents$1.RESIZE,this.onResize,this),this.resize(baseSize.width,baseSize.height)},onResize:function(gameSize,baseSize){baseSize.width===this.width&&baseSize.height===this.height||this.resize(baseSize.width,baseSize.height)},resize:function(width,height){this.width=width,this.height=height,this.emit(Events$F.RESIZE,width,height)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(blendMode){return this.currentContext.globalCompositeOperation=blendMode,this},setContext:function(ctx){return this.currentContext=ctx||this.gameContext,this},setAlpha:function(alpha){return this.currentContext.globalAlpha=alpha,this},preRender:function(){var ctx=this.gameContext,config=this.config,width=this.width,height=this.height;ctx.globalAlpha=1,ctx.globalCompositeOperation="source-over",ctx.setTransform(1,0,0,1,0,0),config.clearBeforeRender&&(ctx.clearRect(0,0,width,height),config.transparent||(ctx.fillStyle=config.backgroundColor.rgba,ctx.fillRect(0,0,width,height))),ctx.save(),this.drawCount=0,this.emit(Events$F.PRE_RENDER)},render:function(scene,children,camera){var childCount=children.length;this.emit(Events$F.RENDER,scene,camera);var cx=camera.x,cy=camera.y,cw=camera.width,ch=camera.height,ctx=camera.renderToTexture?camera.context:scene.sys.context;ctx.save(),this.game.scene.customViewports&&(ctx.beginPath(),ctx.rect(cx,cy,cw,ch),ctx.clip()),this.currentContext=ctx;var mask=camera.mask;mask&&mask.preRenderCanvas(this,null,camera._maskCamera),camera.transparent||(ctx.fillStyle=camera.backgroundColor.rgba,ctx.fillRect(cx,cy,cw,ch)),ctx.globalAlpha=camera.alpha,ctx.globalCompositeOperation="source-over",this.drawCount+=childCount,camera.renderToTexture&&camera.emit
110(CameraEvents$1.PRE_RENDER,camera),camera.matrix.copyToContext(ctx);for(var i=0;i<childCount;i++){var child=children[i];child.mask&&child.mask.preRenderCanvas(this,child,camera),child.renderCanvas(this,child,camera),child.mask&&child.mask.postRenderCanvas(this,child,camera)}ctx.setTransform(1,0,0,1,0,0),ctx.globalCompositeOperation="source-over",ctx.globalAlpha=1,camera.flashEffect.postRenderCanvas(ctx),camera.fadeEffect.postRenderCanvas(ctx),camera.dirty=!1,mask&&mask.postRenderCanvas(this),ctx.restore(),camera.renderToTexture&&(camera.emit(CameraEvents$1.POST_RENDER,camera),camera.renderToGame&&scene.sys.context.drawImage(camera.canvas,cx,cy))},postRender:function(){this.gameContext.restore(),this.emit(Events$F.POST_RENDER);var state=this.snapshotState;state.callback&&(CanvasSnapshot(this.gameCanvas,state),state.callback=null)},snapshotCanvas:function(canvas,callback,getPixel,x,y,width,height,type,encoderOptions){void 0===getPixel&&(getPixel=!1),this.snapshotArea(x,y,width,height,callback,type,encoderOptions);var state=this.snapshotState;return state.getPixel=getPixel,CanvasSnapshot(this.canvas,state),state.callback=null,this},snapshot:function(callback,type,encoderOptions){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,callback,type,encoderOptions)},snapshotArea:function(x,y,width,height,callback,type,encoderOptions){var state=this.snapshotState;return state.callback=callback,state.type=type,state.encoder=encoderOptions,state.getPixel=!1,state.x=x,state.y=y,state.width=Math.min(width,this.gameCanvas.width),state.height=Math.min(height,this.gameCanvas.height),this},snapshotPixel:function(x,y,callback){return this.snapshotArea(x,y,1,1,callback),this.snapshotState.getPixel=!0,this},batchSprite:function(sprite,frame,camera,parentTransformMatrix){var alpha=camera.alpha*sprite.alpha;if(0!==alpha){var ctx=this.currentContext,camMatrix=this._tempMatrix1,spriteMatrix=this._tempMatrix2,cd=frame.canvasData,frameX=cd.x,frameY=cd.y,frameWidth=frame.cutWidth,frameHeight=frame.cutHeight,customPivot=frame.customPivot,res=frame.source.resolution,displayOriginX=sprite.displayOriginX,displayOriginY=sprite.displayOriginY,x=-displayOriginX+frame.x,y=-displayOriginY+frame.y;if(sprite.isCropped){var crop=sprite._crop;crop.flipX===sprite.flipX&&crop.flipY===sprite.flipY||frame.updateCropUVs(crop,sprite.flipX,sprite.flipY),frameWidth=crop.cw,frameHeight=crop.ch,frameX=crop.cx,frameY=crop.cy,x=-displayOriginX+crop.x,y=-displayOriginY+crop.y,sprite.flipX&&(x>=0?x=-(x+frameWidth):x<0&&(x=Math.abs(x)-frameWidth)),sprite.flipY&&(y>=0?y=-(y+frameHeight):y<0&&(y=Math.abs(y)-frameHeight))}var flipX=1,flipY=1;sprite.flipX&&(customPivot||(x+=-frame.realWidth+2*displayOriginX),flipX=-1),sprite.flipY&&(customPivot||(y+=-frame.realHeight+2*displayOriginY),flipY=-1),spriteMatrix.applyITRS(sprite.x,sprite.y,sprite.rotation,sprite.scaleX*flipX,sprite.scaleY*flipY),camMatrix.copyFrom(camera.matrix),parentTransformMatrix?(camMatrix.multiplyWithOffset(parentTransformMatrix,-camera.scrollX*sprite.scrollFactorX,-camera.scrollY*sprite.scrollFactorY),spriteMatrix.e=sprite.x,spriteMatrix.f=sprite.y):(spriteMatrix.e-=camera.scrollX*sprite.scrollFactorX,spriteMatrix.f-=camera.scrollY*sprite.scrollFactorY),camMatrix.multiply(spriteMatrix),ctx.save(),camMatrix.setToContext(ctx),ctx.globalCompositeOperation=this.blendModes[sprite.blendMode],ctx.globalAlpha=alpha,ctx.imageSmoothingEnabled=!(!this.antialias||frame.source.scaleMode),sprite.mask&&sprite.mask.preRenderCanvas(this,sprite,camera),ctx.drawImage(frame.source.image,frameX,frameY,frameWidth,frameHeight,x,y,frameWidth/res,frameHeight/res),sprite.mask&&sprite.mask.postRenderCanvas(this,sprite,camera),ctx.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}}),CanvasRenderer_1=CanvasRenderer,SpliceOne$4=SpliceOne_1,Remove_1=function(array,item,callback,context){var index;if(void 0===context&&(context=array),!Array.isArray(item))return-1!==(index=array.indexOf(item))?(SpliceOne$4(array,index),callback&&callback.call(context,item),item):null;for(var itemLength=item.length-1,removed=[];itemLength>=0;){var entry=item[itemLength];-1!==(index=array.indexOf(entry))&&(SpliceOne$4(array,index),removed.push(entry),callback&&callback.call(context,entry)),itemLength--}return removed},BitmapMaskFrag=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{","    vec2 uv = gl_FragCoord.xy / uResolution;","    vec4 mainColor = texture2D(uMainSampler, uv);","    vec4 maskColor = texture2D(uMaskSampler, uv);","    float alpha = mainColor.a;","","    if (!uInvertMaskAlpha)","    {","        alpha *= (maskColor.a);","    }","    else","    {","        alpha *= (1.0 - maskColor.a);","    }
110","","    gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n"),BitmapMaskVert=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{","    gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n"),_const$8={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}},events$a={AFTER_FLUSH:"pipelineafterflush",BEFORE_FLUSH:"pipelinebeforeflush",BIND:"pipelinebind",BOOT:"pipelineboot",DESTROY:"pipelinedestroy",REBIND:"pipelinerebind",RESIZE:"pipelineresize"},Events$E=events$j,RenderTarget$3=new Class_1({initialize:function(renderer,width,height,scale,minFilter,autoClear,autoResize){void 0===scale&&(scale=1),void 0===minFilter&&(minFilter=0),void 0===autoClear&&(autoClear=!0),void 0===autoResize&&(autoResize=!1),this.renderer=renderer,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=scale,this.minFilter=minFilter,this.autoClear=autoClear,this.autoResize=!1,this.resize(width,height),autoResize&&this.setAutoResize(!0)},setAutoResize:function(autoResize){return autoResize&&!this.autoResize?(this.renderer.on(Events$E.RESIZE,this.resize,this),this.autoResize=!0):!autoResize&&this.autoResize&&(this.renderer.off(Events$E.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(width,height){var scaledWidth=width*this.scale,scaledHeight=height*this.scale;if(scaledWidth!==this.width||scaledHeight!==this.height){var renderer=this.renderer;renderer.deleteFramebuffer(this.framebuffer),renderer.deleteTexture(this.texture),width*=this.scale,height*=this.scale,(width=Math.round(width))<=0&&(width=1),(height=Math.round(height))<=0&&(height=1),this.texture=renderer.createTextureFromSource(null,width,height,this.minFilter),this.framebuffer=renderer.createFramebuffer(width,height,this.texture,!1),this.width=width,this.height=height}return this},bind:function(adjustViewport,width,height){if(void 0===adjustViewport&&(adjustViewport=!1),adjustViewport&&this.renderer.flush(),width&&height&&this.resize(width,height),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),adjustViewport&&this.adjustViewport(),this.autoClear){var gl=this.renderer.gl;gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT)}},adjustViewport:function(){var gl=this.renderer.gl;gl.viewport(0,0,this.width,this.height),gl.disable(gl.SCISSOR_TEST)},clear:function(){var renderer=this.renderer,gl=renderer.gl;renderer.pushFramebuffer(this.framebuffer),gl.disable(gl.SCISSOR_TEST),gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT),renderer.popFramebuffer(),renderer.resetScissor()},unbind:function(flush){void 0===flush&&(flush=!1);var renderer=this.renderer;return flush&&renderer.flush(),renderer.popFramebuffer()},destroy:function(){var renderer=this.renderer;renderer.deleteFramebuffer(this.framebuffer),renderer.deleteTexture(this.texture),renderer.off(Events$E.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}}),RenderTarget_1=RenderTarget$3;
111/**
112	 * @author       Richard Davey <[email protected]>
113	 * @copyright    2020 Photon Storm Ltd.
114	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
115	 */
116/**
117	 * @author       Richard Davey <[email protected]>
118	 * @author       Felipe Alfonso <@bitnenfer>
119	 * @author       Matthew Groves <@doormat>
120	 * @copyright    2020 Photon Storm Ltd.
121	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
122	 */
123function GenerateSrc(maxIfs){for(var src="",i=0;i<maxIfs;++i)i>0&&(src+="\nelse "),i<maxIfs-1&&(src+="if(test == "+i+".0){}");return src}var Utils$p={getTintFromFloats:function(r,g,b,a){return((255&(255*a|0))<<24|(255&(255*r|0))<<16|(255&(255*g|0))<<8|255&(255*b|0))>>>0},getTintAppendFloatAlpha:function(rgb,a){return((255&(255*a|0))<<24|rgb)>>>0},getTintAppendFloatAlphaAndSwap:function(rgb,a){return((255&(255*a|0))<<24|(255&(0|rgb))<<16|(255&(rgb>>8|0))<<8|255&(rgb>>16|0))>>>0},getFloatsFromUintRGB:function(rgb){return[(255&(rgb>>16|0))/255,(255&(rgb>>8|0))/255,(255&(0|rgb))/255]}
123,checkShaderMax:function(gl,maxTextures){maxTextures&&-1!==maxTextures||(maxTextures=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));for(var shader=gl.createShader(gl.FRAGMENT_SHADER),fragTemplate=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");;){var fragmentSrc=fragTemplate.replace(/%forloop%/gi,GenerateSrc(maxTextures));if(gl.shaderSource(shader,fragmentSrc),gl.compileShader(shader),gl.getShaderParameter(shader,gl.COMPILE_STATUS))break;maxTextures=maxTextures/2|0}return maxTextures},parseFragmentShaderMaxTextures:function(fragmentShaderSource,maxTextures){if(!fragmentShaderSource)return"";for(var src="",i=0;i<maxTextures;i++)i>0&&(src+="\n\telse "),i<maxTextures-1&&(src+="if (outTexId < "+i+".5)"),src+="\n\t{",src+="\n\t\ttexture = texture2D(uMainSampler["+i+"], outTexCoord);",src+="\n\t}";return(fragmentShaderSource=fragmentShaderSource.replace(/%count%/gi,maxTextures.toString())).replace(/%forloop%/gi,src)}},GetFastValue$1d=GetFastValue_1,WEBGL_CONST$4=_const$8,WebGLShader$1=new Class_1({initialize:function(pipeline,name,vertexShader,fragmentShader,attributes){this.pipeline=pipeline,this.name=name,this.renderer=pipeline.renderer,this.gl=this.renderer.gl,this.program=this.renderer.createProgram(vertexShader,fragmentShader),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(attributes),this.createUniforms()},createAttributes:function(attributes){var count=0,offset=0,result=[];this.vertexComponentCount=0;for(var i=0;i<attributes.length;i++){var element=attributes[i],name=element.name,size=GetFastValue$1d(element,"size",1),glType=GetFastValue$1d(element,"type",WEBGL_CONST$4.FLOAT),type=glType.enum,typeSize=glType.size,normalized=!!element.normalized;result.push({name:name,size:size,type:type,normalized:normalized,offset:offset,enabled:!1,location:-1}),4===typeSize?count+=size:count++,offset+=size*typeSize}this.vertexSize=offset,this.vertexComponentCount=count,this.attributes=result},bind:function(setAttributes,flush){return void 0===setAttributes&&(setAttributes=!1),void 0===flush&&(flush=!1),flush&&this.pipeline.flush(),this.renderer.setProgram(this.program),setAttributes&&this.setAttribPointers(),this},rebind:function(){return this.renderer.setProgram(this.program),this.setAttribPointers(!0),this},setAttribPointers:function(reset){void 0===reset&&(reset=!1);for(var gl=this.gl,vertexSize=this.vertexSize,attributes=this.attributes,program=this.program,i=0;i<attributes.length;i++){var element=attributes[i],size=element.size,type=element.type,offset=element.offset,enabled=element.enabled,location=element.location,normalized=!!element.normalized;if(reset){var attribLocation=gl.getAttribLocation(program,element.name);attribLocation>=0?(gl.enableVertexAttribArray(attribLocation),gl.vertexAttribPointer(attribLocation,size,type,normalized,vertexSize,offset),element.enabled=!0,element.location=attribLocation):-1!==attribLocation&&gl.disableVertexAttribArray(attribLocation)}else enabled?gl.vertexAttribPointer(location,size,type,normalized,vertexSize,offset):!enabled&&location>-1&&(gl.disableVertexAttribArray(location),element.location=-1)}return this},createUniforms:function(){var i,name,location,gl=this.gl,program=this.program,uniforms=this.uniforms,totalUniforms=gl.getProgramParameter(program,gl.ACTIVE_UNIFORMS);for(i=0;i<totalUniforms;i++){var info=gl.getActiveUniform(program,i);if(info){name=info.name,null!==(location=gl.getUniformLocation(program,name))&&(uniforms[name]={name:name,location:location,value1:null,value2:null,value3:null,value4:null});var struct=name.indexOf("[");struct>0&&(name=name.substr(0,struct),uniforms.hasOwnProperty(name)||null!==(location=gl.getUniformLocation(program,name))&&(uniforms[name]={name:name,location:location,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(name){return this.uniforms.hasOwnProperty(name)},resetUniform:function(name){var uniform=this.uniforms[name];return uniform&&(uniform.value1=null,uniform.value2=null,uniform.value3=null,uniform.value4=null),this},setUniform1:function(setter,name,value1,skipCheck){var uniform=this.uniforms[name];return uniform?((skipCheck||uniform.value1!==value1)&&(uniform.value1=value1,this.renderer.setProgram(this.program),setter.call(this.gl,uniform.location,value1),this.pipeline.currentShader=this),this):this},setUniform2:function(setter,name,value1,value2,skipCheck){var uniform=this.uniforms[name];return uniform?((skipCheck||uniform.value1!==value1||uniform.value2!==value2)&&(uniform.value1=value1,uniform.value2=value2,this.renderer.setProgram(this.program),setter.call(this.gl,uniform.location,value1,value2),this.pipeline.currentShader=this),this):this},setUniform3:function(setter,name,value1,value2,value3,skipCheck){var uniform=this.uniforms[name];return uniform?((skipCheck||uniform.value1!==value1||uniform.value2!==value2||uniform.value3!==value3)&&(uniform.value1=value1,uniform.value2=value2,uniform.value3=value3,this.renderer.setProgram(this.program),setter.call(this.gl,uniform.location,value1,value2,value3),this.pipeline.currentShader=this),this):this},setUniform4:function(setter,name,value1,value2,value3,value4,skipCheck){var uniform=this.uniforms[name];return uniform?((skipCheck||uniform.value1!==value1||uniform.value2!==value2||uniform.value3!==value3||uniform.value4!==value4)&&(uniform.value1=value1,uniform.value2=value2,uniform.value3=value3,uniform.value4=value4,this.renderer.setProgram(this.program),setter.call(this.gl,uniform.location,value1,value2,value3,value4),this.pipeline.currentShader=this),this):this},set1f:function(name,x){return this.setUniform1(this.gl.uniform1f,name,x)},set2f:function(name,x,y){return this.setUniform2(this.gl.uniform2f,name,x,y)},set3f:function(name,x,y,z){return this.setUniform3(this.gl.uniform3f,name,x,y,z)},set4f:function(name,x,y,z,w){return this.setUniform4(this.gl.uniform4f,name,x,y,z,w)},set1fv:function(name,arr){return this.setUniform1(this.gl.uniform1fv,name,arr,!0)},set2fv:function(name,arr){return this.setUniform1(this.gl.uniform2fv,name,arr,!0)},set3fv:function(name,arr){return this.setUniform1(this.gl.uniform3fv,name,arr,!0)},set4fv:function(name,arr){return this.setUniform1(this.gl.uniform4fv,name,arr,!0)},set1iv:function(name,arr){return this.setUniform1(this.gl.uniform1iv,name,arr,!0)},set2iv:function(name,arr){return this.setUniform1(this.gl.uniform2iv,name,arr,!0)},set3iv:function(name,arr){return this.setUniform1(this.gl.uniform3iv,name,arr,!0)},set4iv:function(name,arr){return this.setUniform1(this.gl.uniform4iv,name,arr,!0)},set1i:function(name,x){return this.setUniform1(this.gl.uniform1i,name,x)},set2i:function(name,x,y){return this.setUniform2(this.gl.uniform2i,name,x,y)},set3i:function(name,x,y,z){return this.setUniform3(this.gl.uniform3i,name,x,y,z)},set4i:function(name,x,y,z,w){return this.setUniform4(this.gl.uniform4i,name,x,y,z,w)},setMatrix2fv:function(name,transpose,matrix){return this.setUniform2(this.gl.uniformMatrix2fv,name,transpose,matrix,!0)},setMatrix3fv:function(name,transpose,matrix){return this.setUniform2(this.gl.uniformMatrix3fv,name,transpose,matrix,!0)},setMatrix4fv:function(name,transpose,matrix){return this.setUniform2(this.gl.uniformMatrix4fv,name,transpose,matrix,!0)},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}}),WebGLShader_1=WebGLShader$1,DeepCopy=DeepCopy_1,EventEmitter$p=eventemitter3.exports,Events$D=events$a,GetFastValue$1c=GetFastValue_1,Matrix4$4=Matrix4_1,RendererEvents=events$j,RenderTarget$2=RenderTarget_1,Utils$o=Utils$p,WebGLShader=WebGLShader_1,WebGLPipeline$8=new Class_1({Extends:EventEmitter$p,initialize:function(config){EventEmitter$p.call(this);var game=config.game,renderer=game.renderer,gl=renderer.gl;this.name=GetFastValue$1c(config,"name","WebGLPipeline"),this.game=game,this.renderer=renderer,this.manager,this.gl=gl,this.view=game.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=GetFastValue$1c(config,"topology",gl.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=GetFastValue$1c(config,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=config,this.glReset=!1},boot:function(){var i,gl=this.gl,config=this.config,renderer=this.renderer;this.isPostFX||(this.projectionMatrix=(new Matrix4$4).identity());var renderTargets=this.renderTargets,targets=GetFastValue$1c(config,"renderTarget",!1);"boolean"==typeof targets&&targets&&(targets=1);var width=renderer.width,height=renderer.height;if("number"==typeof targets)for(i=0;i<targets;i++)renderTargets.push(new RenderTarget$2(renderer,width,height,1,0,!0));else if(Array.isArray(targets))for(i=0;i<targets.length;i++){var scale=GetFastValue$1c(targets[i],"scale",1),minFilter=GetFastValue$1c(targets[i],"minFilter",0),autoClear=GetFastValue$1c(targets[i],"autoClear",1);renderTargets.push(new RenderTarget$2(renderer,width,height,scale,minFilter,autoClear))}renderTargets.length&&(this.currentRenderTarget=renderTargets[0]),this.setShadersFromConfig(config);var shaders=this.shaders,vertexSize=0;for(i=0;i<shaders.length;i++)shaders[i].vertexSize>vertexSize&&(vertexSize=shaders[i].vertexSize);var batchSize=GetFastValue$1c(config,"batchSize",renderer.config.batchSize);this.vertexCapacity=6*batchSize;var data=new ArrayBuffer(this.vertexCapacity*vertexSize);this.vertexData=data,this.bytes=new Uint8Array(data),this.vertexViewF32=new Float32Array(data),this.vertexViewU32=new Uint32Array(data);var configVerts=GetFastValue$1c(config,"vertices",null);for(configVerts?(this.vertexViewF32.set(configVerts),this.vertexBuffer=renderer.createVertexBuffer(data,gl.STATIC_DRAW)):this.vertexBuffer=renderer.createVertexBuffer(data.byteLength,gl.DYNAMIC_DRAW),this.setVertexBuffer(),i=shaders.length-1;i>=0;i--)shaders[i].rebind();this.hasBooted=!0,renderer.on(RendererEvents.RESIZE,this.resize,this),renderer.on(RendererEvents.PRE_RENDER,this.onPreRender,this),renderer.on(RendererEvents.RENDER,this.onRender,this),renderer.on(RendererEvents.POST_RENDER,this.onPostRender,this),this.emit
123(Events$D.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(shader,setAttributes){var renderer=this.renderer;shader===this.currentShader&&renderer.currentProgram===this.currentShader.program||(this.flush(),renderer.resetTextures(),this.setVertexBuffer()&&!setAttributes&&(setAttributes=!0),shader.bind(setAttributes,!1),this.currentShader=shader);return this},getShaderByName:function(name){for(var shaders=this.shaders,i=0;i<shaders.length;i++)if(shaders[i].name===name)return shaders[i]},setShadersFromConfig:function(config){var i,shaders=this.shaders,renderer=this.renderer;for(i=0;i<shaders.length;i++)shaders[i].destroy();var defaultVertShader=GetFastValue$1c(config,"vertShader",null),defaultFragShader=Utils$o.parseFragmentShaderMaxTextures(GetFastValue$1c(config,"fragShader",null),renderer.maxTextures),defaultAttribs=GetFastValue$1c(config,"attributes",null),configShaders=GetFastValue$1c(config,"shaders",[]),len=configShaders.length;if(0===len)defaultVertShader&&defaultFragShader&&(this.shaders=[new WebGLShader(this,"default",defaultVertShader,defaultFragShader,DeepCopy(defaultAttribs))]);else{var newShaders=[];for(i=0;i<len;i++){var shaderEntry=configShaders[i],name=GetFastValue$1c(shaderEntry,"name","default"),vertShader=GetFastValue$1c(shaderEntry,"vertShader",defaultVertShader),fragShader=Utils$o.parseFragmentShaderMaxTextures(GetFastValue$1c(shaderEntry,"fragShader",defaultFragShader),renderer.maxTextures),attributes=GetFastValue$1c(shaderEntry,"attributes",defaultAttribs);vertShader&&fragShader&&newShaders.push(new WebGLShader(this,name,vertShader,fragShader,DeepCopy(attributes)))}this.shaders=newShaders}return 0===this.shaders.length?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},setGameObject:function(gameObject,frame){return void 0===frame&&(frame=gameObject.frame),this.currentUnit=this.renderer.setTextureSource(frame.source),this.currentUnit},shouldFlush:function(amount){return void 0===amount&&(amount=0),this.vertexCount+amount>this.vertexCapacity},resize:function(width,height){width===this.width&&height===this.height||this.flush(),this.width=width,this.height=height;for(var targets=this.renderTargets,i=0;i<targets.length;i++)targets[i].resize(width,height);return this.setProjectionMatrix(width,height),this.emit(Events$D.RESIZE,width,height,this),this.onResize(width,height),this},setProjectionMatrix:function(width,height){var projectionMatrix=this.projectionMatrix;if(!projectionMatrix)return this;this.projectionWidth=width,this.projectionHeight=height,projectionMatrix.ortho(0,width,height,0,-1e3,1e3);for(var shaders=this.shaders,name="uProjectionMatrix",i=0;i<shaders.length;i++){var shader=shaders[i];shader.hasUniform(name)&&(shader.resetUniform(name),shader.setMatr
123ix4fv(name,!1,projectionMatrix.val,shader))}return this},updateProjectionMatrix:function(){if(this.projectionMatrix){var globalWidth=this.renderer.projectionWidth,globalHeight=this.renderer.projectionHeight;this.projectionWidth===globalWidth&&this.projectionHeight===globalHeight||this.setProjectionMatrix(globalWidth,globalHeight)}},bind:function(currentShader){if(void 0===currentShader&&(currentShader=this.currentShader),this.glReset)return this.rebind(currentShader);var wasBound=this.setVertexBuffer();return currentShader.bind(wasBound),this.currentShader=currentShader,this.emit(Events$D.BIND,this,currentShader),this.onActive(currentShader),this},rebind:function(currentShader){this.setVertexBuffer();for(var shaders=this.shaders,i=shaders.length-1;i>=0;i--){var shader=shaders[i].rebind();currentShader&&shader!==currentShader||(this.currentShader=shader)}return this.emit(Events$D.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(){var gl=this.gl,buffer=this.vertexBuffer;return gl.getParameter(gl.ARRAY_BUFFER_BINDING)!==buffer&&(gl.bindBuffer(gl.ARRAY_BUFFER,buffer),!0)},preBatch:function(gameObject){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(gameObject),this},postBatch:function(gameObject){return this.onDraw(this.currentRenderTarget),this.onPostBatch(gameObject),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(isPostFlush){if(void 0===isPostFlush&&(isPostFlush=!1),this.vertexCount>0){this.emit(Events$D.BEFORE_FLUSH,this,isPostFlush),this.onBeforeFlush(isPostFlush);var gl=this.gl,vertexCount=this.vertexCount,vertexSize=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),vertexCount===this.vertexCapacity?gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.DYNAMIC_DRAW):gl.bufferSubData(gl.ARRAY_BUFFER,0,this.bytes.subarray(0,vertexCount*vertexSize)),gl.drawArrays(this.topology,0,vertexCount)),this.vertexCount=0,this.emit(Events$D.AFTER_FLUSH,this,isPostFlush),this.onAfterFlush(isPostFlush)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(x,y,u,v,unit,tintEffect,tint){var vertexViewF32=this.vertexViewF32,vertexViewU32=this.vertexViewU32,vertexOffset=this.vertexCount*this.currentShader.vertexComponentCount-1;vertexViewF32[++vertexOffset]=x,vertexViewF32[++vertexOffset]=y,vertexViewF32[++vertexOffset]=u,vertexViewF32[++vertexOffset]=v,vertexViewF32[++vertexOffset]=unit,vertexViewF32[++vertexOffset]=tintEffect,vertexViewU32[++vertexOffset]=tint,this.vertexCount++},batchQuad:function(gameObject,x0,y0,x1,y1,x2,y2,x3,y3,u0,v0,u1,v1,tintTL,tintTR,tintBL,tintBR,tintEffect,texture,unit){void 0===unit&&(unit=this.currentUnit);var hasFlushed=!1;return this.shouldFlush(6)&&(this.flush(),hasFlushed=!0,unit=this.setTexture2D(texture)),this.batchVert(x0,y0,u0,v0,unit,tintEffect,tintTL),this.batchVert(x1,y1,u0,v1,unit,tintEffect,tintBL),this.batchVert(x2,y2,u1,v1,unit,tintEffect,tintBR),this.batchVert(x0,y0,u0,v0,unit,tintEffect,tintTL),this.batchVert(x2,y2,u1,v1,unit,tintEffect,tintBR),this.batchVert(x3,y3,u1,v0,unit,tintEffect,tintTR),this.onBatch(gameObject),hasFlushed},batchTri:function(gameObject,x0,y0,x1,y1,x2,y2,u0,v0,u1,v1,tintTL,tintTR,tintBL,tintEffect,texture,unit){void 0===unit&&(unit=this.currentUnit);var hasFlushed=!1;return this.shouldFlush(3)&&(this.flush(),hasFlushed=!0,unit=this.setTexture2D(texture)),this.batchVert(x0,y0,u0,v0,unit,tintEffect,tintTL),this.batchVert(x1,y1,u0,v1,unit,tintEffect,tintTR),this.batchVert(x2,y2,u1,v1,unit,tintEffect,tintBL),this.onBatch(gameObject),hasFlushed},drawFillRect:function(x,y,width,height,color,alpha,texture,flipUV){void 0===texture&&(texture=this.renderer.whiteTexture.glTexture),void 0===flipUV&&(flipUV=!0),x=Math.floor(x),y=Math.floor(y);var xw=Math.floor(x+width),yh=Math.floor(y+height),unit=this.setTexture2D(texture),tint=Utils$o.getTintAppendFloatAlphaAndSwap(color,alpha),v0=0,v1=1;flipUV&&(v0=1,v1=0),this.batchQuad(null,x,y,x,yh,xw,yh,xw,y,0,v0,1,v1,tint,tint,tint,tint,0,texture,unit)},setTexture2D:function(texture){return void 0===texture&&(texture=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(texture),this.currentUnit},bindTexture:function(texture,unit){void 0===unit&&(unit=0);var gl=this.gl;return gl.activeTexture(gl.TEXTURE0+unit),gl.bindTexture(gl.TEXTURE_2D,texture),this},bindRenderTarget:function(target,unit){return this.bindTexture(target.texture,unit)},setTime:function(uniform){return this.set1f(uniform,this.game.loop.getDuration()),this},set1f:function(name,x,shader){return void 0===shader&&(shader=this.currentShader),shader.set1f(name,x),this},set2f:function(name,x,y,shader){return void 0===shader&&(shader=this.currentShader),shader.set2f(name,x,y),this},set3f:function(name,x,y,z,shader){return void 0===shader&&(shader=this.currentShader),shader.set3f(name,x,y,z),this},set4f:function(name,x,y,z,w,shader){return void 0===shader&&(shader=this.currentShader),shader.set4f(name,x,y,z,w),this},set1fv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set1fv(name,arr),this},set2fv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set2fv
123(name,arr),this},set3fv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set3fv(name,arr),this},set4fv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set4fv(name,arr),this},set1iv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set1iv(name,arr),this},set2iv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set2iv(name,arr),this},set3iv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set3iv(name,arr),this},set4iv:function(name,arr,shader){return void 0===shader&&(shader=this.currentShader),shader.set4iv(name,arr),this},set1i:function(name,x,shader){return void 0===shader&&(shader=this.currentShader),shader.set1i(name,x),this},set2i:function(name,x,y,shader){return void 0===shader&&(shader=this.currentShader),shader.set2i(name,x,y),this},set3i:function(name,x,y,z,shader){return void 0===shader&&(shader=this.currentShader),shader.set3i(name,x,y,z),this},set4i:function(name,x,y,z,w,shader){return void 0===shader&&(shader=this.currentShader),shader.set4i(name,x,y,z,w),this},setMatrix2fv:function(name,transpose,matrix,shader){return void 0===shader&&(shader=this.currentShader),shader.setMatr
123ix2fv(name,transpose,matrix),this},setMatrix3fv:function(name,transpose,matrix,shader){return void 0===shader&&(shader=this.currentShader),shader.setMatrix3fv(name,transpose,matrix),this},setMatrix4fv:function(name,transpose,matrix,shader){return void 0===shader&&(shader=this.currentShader),shader.setMatrix4fv(name,transpose,matrix),this},destroy:function(){var i;this.emit(Events$D.DESTROY,this);var shaders=this.shaders;for(i=0;i<shaders.length;i++)shaders[i].destroy();var targets=this.renderTargets;for(i=0;i<targets.length;i++)targets[i].destroy();this.gl.deleteBuffer(this.vertexBuffer);var renderer=this.renderer;return renderer.off(RendererEvents.RESIZE,this.resize,this),renderer.off(RendererEvents.PRE_RENDER,this.onPreRender,this),renderer.off(RendererEvents.RENDER,this.onRender,this),renderer.off(RendererEvents.POST_RENDER,this.onPostRender,this),this.removeAllListeners(),this.game=null,this.renderer=null,this.manager=null,this.gl=null,this.view=null,this.shaders=null,this.renderTargets=null,this.bytes=null,this.vertexViewF32=null,this.vertexViewU32=null,this.vertexData=null,this.vertexBuffer=null,this.currentShader=null,this.currentRenderTarget=null,this}}),WebGLPipeline_1=WebGLPipeline$8,GetFastValue$1b=GetFastValue_1,ShaderSourceFS$4=BitmapMaskFrag,ShaderSourceVS$4=BitmapMaskVert,WEBGL_CONST$3=_const$8,WebGLPipeline$7=WebGLPipeline_1,BitmapMaskPipeline$1=new Class_1({Extends:WebGLPipeline$7,initialize:function(config){config.fragShader=GetFastValue$1b(config,"fragShader",ShaderSourceFS$4),config.vertShader=GetFastValue$1b(config,"vertShader",ShaderSourceVS$4),config.batchSize=GetFastValue$1b(config,"batchSize",1),config.vertices=GetFastValue$1b(config,"vertices",[-1,1,-1,-7,7,1]),config.attributes=GetFastValue$1b(config,"attributes",[{name:"inPosition",size:2,type:WEBGL_CONST$3.FLOAT}]),WebGLPipeline$7.call(this,config)},boot:function(){WebGLPipeline$7.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(width,height){WebGLPipeline$7.prototype.resize.call(this,width,height),this.set2f("uResolution",width,height)},beginMask:function(mask,maskedObject,camera){var gl=this.gl;if(mask.bitmapMask&&gl){var renderer=this.renderer;renderer.flush(),renderer.pushFramebuffer(mask.mainFramebuffer),gl.disable(gl.STENCIL_TEST),gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT),renderer.currentCameraMask.mask!==mask&&(renderer.currentMask.mask=mask,renderer.currentMask.camera=camera)}},endMask:function(mask,camera){var gl=this.gl,renderer=this.renderer,bitmapMask=mask.bitmapMask;if(bitmapMask&&gl){renderer.flush(),renderer.pushFramebuffer(mask.maskFramebuffer),gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT),renderer.setBlendMode(0,!0),bitmapMask.renderWebGL(renderer,bitmapMask,camera),renderer.flush(),renderer.popFramebuffer(),renderer.popFramebuffer();var prev=renderer.getCurrentStencilMask();prev?(gl.enable(gl.STENCIL_TEST),prev.mask.applyStencil(renderer,prev.camera,!0)):renderer.currentMask.mask=null,renderer.pipelines.set(this),gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,mask.maskTexture),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,mask.mainTexture),this.set1i("uInvertMaskAlpha",mask.invertAlpha),gl.drawArrays(this.topology,0,3),renderer.resetTextures()}}}),BitmapMaskPipeline_1=BitmapMaskPipeline$1;
124/**
125	 * @author       Richard Davey <[email protected]>
126	 * @copyright    2020 Photon Storm Ltd.
127	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
128	 */
129/**
130	 * @author       Richard Davey <[email protected]>
131	 * @copyright    2020 Photon Storm Ltd.
132	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
133	 */
134function earcut(data,holeIndices,dim){dim=dim||2;var minX,minY,maxX,maxY,x,y,invSize,hasHoles=holeIndices&&holeIndices.length,outerLen=hasHoles?holeIndices[0]*dim:data.length,outerNode=linkedList(data,0,outerLen,dim,!0),triangles=[];if(!outerNode||outerNode.next===outerNode.prev)return triangles;if(hasHoles&&(outerNode=function(data,holeIndices,outerNode,dim){var i,len,list,queue=[];for(i=0,len=holeIndices.length;i<len;i++)(list=linkedList(data,holeIndices[i]*dim,i<len-1?holeIndices[i+1]*dim:data.length,dim,!1))===list.next&&(list.steiner=!0),queue.push(getLeftmost(list));for(queue.sort(compareX),i=0;i<queue.length;i++)eliminateHole(queue[i],outerNode),outerNode=filterPoints(outerNode,outerNode.next);return outerNode}(data,holeIndices,outerNode,dim)),data.length>80*dim){minX=maxX=data[0],minY=maxY=data[1];for(var i=dim;i<outerLen;
vendor: 8,767 bytes, line 134
134i+=dim)(x=data[i])<minX&&(minX=x),(y=data[i+1])<minY&&(minY=y),x>maxX&&(maxX=x),y>maxY&&(maxY=y);invSize=0!==(invSize=Math.max(maxX-minX,maxY-minY))?1/invSize:0}return earcutLinked(outerNode,triangles,dim,minX,minY,invSize),triangles}function linkedList(data,start,end,dim,clockwise){var i,last;if(clockwise===signedArea(data,start,end,dim)>0)for(i=start;i<end;i+=dim)last=insertNode(i,data[i],data[i+1],last);else for(i=end-dim;i>=start;i-=dim)last=insertNode(i,data[i],data[i+1],last);return last&&equals(last,last.next)&&(removeNode(last),last=last.next),last}function filterPoints(start,end){if(!start)return start;end||(end=start);var again,p=start;do{if(again=!1,p.steiner||!equals(p,p.next)&&0!==area(p.prev,p,p.next))p=p.next;else{if(removeNode(p),(p=end=p.prev)===p.next)break;again=!0}}while(again||p!==end);return end}function earcutLinked(ear,triangles,dim,minX,minY,invSize,pass){if(ear){!pass&&invSize&&function(start,minX,minY,invSize){var p=start;do{null===p.z&&(p.z=zOrder(p.x,p.y,minX,minY,invSize)),p.prevZ=p.prev,p.nextZ=p.next,p=p.next}while(p!==start);p.prevZ.nextZ=null,p.prevZ=null,function(list){var i,p,q,e,tail,numMerges,pSize,qSize,inSize=1;do{for(p=list,list=null,tail=null,numMerges=0;p;){for(numMerges++,q=p,pSize=0,i=0;i<inSize&&(pSize++,q=q.nextZ);i++);for(qSize=inSize;pSize>0||qSize>0&&q;)0!==pSize&&(0===qSize||!q||p.z<=q.z)?(e=p,p=p.nextZ,pSize--):(e=q,q=q.nextZ,qSize--),tail?tail.nextZ=e:list=e,e.prevZ=tail,tail=e;p=q}tail.nextZ=null,inSize*=2}while(numMerges>1)}(p)}(ear,minX,minY,invSize);for(var prev,next,stop=ear;ear.prev!==ear.next;)if(prev=ear.prev,next=ear.next,invSize?isEarHashed(ear,minX,minY,invSize):isEar(ear))triangles.push(prev.i/dim),triangles.push(ear.i/dim),triangles.push(next.i/dim),removeNode(ear),ear=next.next,stop=next.next;else if((ear=next)===stop){pass?1===pass?earcutLinked(ear=cureLocalIntersections(filterPoints(ear),triangles,dim),triangles,dim,minX,minY,invSize,2):2===pass&&splitEarcut(ear,triangles,dim,minX,minY,invSize):earcutLinked(filterPoints(ear),triangles,dim,minX,minY,invSize,1);break}}}function isEar(ear){var a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;for(var p=ear.next.next;p!==ear.prev;){if(pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function isEarHashed(ear,minX,minY,invSize){var a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return!1;for(var minTX=a.x<b.x?a.x<c.x?a.x:c.x:b.x<c.x?b.x:c.x,minTY=a.y<b.y?a.y<c.y?a.y:c.y:b.y<c.y?b.y:c.y,maxTX=a.x>b.x?a.x>c.x?a.x:c.x:b.x>c.x?b.x:c.x,maxTY=a.y>b.y?a.y>c.y?a.y:c.y:b.y>c.y?b.y:c.y,minZ=zOrder(minTX,minTY,minX,minY,invSize),maxZ=zOrder(maxTX,maxTY,minX,minY,invSize),p=ear.prevZ,n=ear.nextZ;p&&p.z>=minZ&&n&&n.z<=maxZ;){if(p!==ear.prev&&p!==ear.next&&pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,n!==ear.prev&&n!==ear.next&&pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}for(;p&&p.z>=minZ;){if(p!==ear.prev&&p!==ear.next&&pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;n&&n.z<=maxZ;){if(n!==ear.prev&&n!==ear.next&&pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,n.x,n.y)&&area(n.prev,n,n.next)>=0)return!1;n=n.nextZ}return!0}function cureLocalIntersections(start,triangles,dim){var p=start;do{var a=p.prev,b=p.next.next;!equals(a,b)&&intersects$2(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)&&(triangles.push(a.i/dim),triangles.push(p.i/dim),triangles.push(b.i/dim),removeNode(p),removeNode(p.next),p=start=b),p=p.next}while(p!==start);return filterPoints(p)}function splitEarcut(start,triangles,dim,minX,minY,invSize){var a=start;do{for(var b=a.next.next;b!==a.prev;){if(a.i!==b.i&&isValidDiagonal(a,b)){var c=splitPolygon(a,b);return a=filterPoints(a,a.next),c=filterPoints(c,c.next),earcutLinked(a,triangles,dim,minX,minY,invSize),void earcutLinked(c,triangles,dim,minX,minY,invSize)}b=b.next}a=a.next}while(a!==start)}function compareX(a,b){return a.x-b.x}function eliminateHole(hole,outerNode){if(outerNode=function(hole,outerNode){var m,p=outerNode,hx=hole.x,hy=hole.y,qx=-1/0;do{if(hy<=p.y&&hy>=p.next.y&&p.next.y!==p.y){var x=p.x+(hy-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(x<=hx&&x>qx){if(qx=x,x===hx){if(hy===p.y)return p;if(hy===p.next.y)return p.next}m=p.x<p.next.x?p:p.next}}p=p.next}while(p!==outerNode);if(!m)return null;if(hx===qx)return m;var tan,stop=m,mx=m.x,my=m.y,tanMin=1/0;p=m;do{hx>=p.x&&p.x>=mx&&hx!==p.x&&pointInTriangle(hy<my?hx:qx,hy,mx,my,hy<my?qx:hx,hy,p.x,p.y)&&(tan=Math.abs(hy-p.y)/(hx-p.x),locallyInside(p,hole)&&(tan<tanMin||tan===tanMin&&(p.x>m.x||p.x===m.x&&sectorContainsSector(m,p)))&&(m=p,tanMin=tan)),p=p.next}while(p!==stop);return m}(hole,outerNode),outerNode){var b=splitPolygon(outerNode,hole);filterPoints(outerNode,outerNode.next),filterPoints(b,b.next)}}function sectorContainsSector(m,p){return area(m.prev,m,p.prev)<0&&area(p.next,m,m.next)<0}function zOrder(x,y,minX,minY,invSize){return(x=1431655765&((x=858993459&((x=252645135&((x=16711935&((x=32767*(x-minX)*invSize)|x<<8))|x<<4))|x<<2))|x<<1))|(y=1431655765&((y=858993459&((y=252645135&((y=16711935&((y=32767*(y-minY)*invSize)|y<<8))|y<<4))|y<<2))|y<<1))<<1}function getLeftmost(start){var p=start,leftmost=start;do{(p.x<leftmost.x||p.x===leftmost.x&&p.y<leftmost.y)&&(leftmost=p),p=p.next}while(p!==start);return leftmost}function pointInTriangle(ax,ay,bx,by,cx,cy,px,py){return(cx-px)*(ay-py)-(ax-px)*(cy-py)>=0&&(ax-px)*(by-py)-(bx-px)*(ay-py)>=0&&(bx-px)*(cy-py)-(cx-px)*(by-py)>=0}function isValidDiagonal(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function(a,b){var p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects$2(p,p.next,a,b))return!0;p=p.next}while(p!==a);return!1}(a,b)&&(locallyInside(a,b)&&locallyInside(b,a)&&function(a,b){var p=a,inside=!1,px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{p.y>py!=p.next.y>py&&p.next.y!==p.y&&px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x&&(inside=!inside),p=p.next}while(p!==a);return inside}(a,b)&&(area(a.prev,a,b.prev)||area(a,b.prev,b))||equals(a,b)&&area(a.prev,a,a.next)>0&&area(b.prev,b,b.next)>0)}function area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y)}function equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y}function intersects$2(p1,q1,p2,q2){var o1=sign(area(p1,q1,p2)),o2=sign(area(p1,q1,q2)),o3=sign(area(p2,q2,p1)),o4=sign(area(p2,q2,q1));return o1!==o2&&o3!==o4||(!(0!==o1||!onSegment(p1,p2,q1))||(!(0!==o2||!onSegment(p1,q2,q1))||(!(0!==o3||!onSegment(p2,p1,q2))||!(0!==o4||!onSegment(p2,q1,q2)))))}function onSegment(p,q,r){return q.x<=Math.max(p.x,r.x)&&q.x>=Math.min(p.x,r.x)&&q.y<=Math.max(p.y,r.y)&&q.y>=Math.min(p.y,r.y)}function sign(num){return num>0?1:num<0?-1:0}function locallyInside(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0}function splitPolygon(a,b){var a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;return a.next=b,b.prev=a,a2.next=an,an.prev=a2,b2.next=a2,a2.prev=b2,bp.next=b2,b2.prev=bp,b2}function insertNode(i,x,y,last){var p=new Node(i,x,y);return last?(p.next=last.next,p.prev=last,last.next.prev=p,last.next=p):(p.prev=p,p.next=p),p}function removeNode(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function Node(i,x,y){this.i=i,this.x=x,this.y=y,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(data,start,end,dim){for(var sum=0,i=start,j=end-dim;i<end;i+=dim)sum+=(data[j]-data[i])*(data[i+1]+data[j+1]),j=i;return sum}earcut.deviation=function(data,holeIndices,dim,triangles){var hasHoles=holeIndices&&holeIndices.length,outerLen=hasHoles?holeIndices[0]*dim:data.length,polygonArea=Math.abs(signedArea(data,0,outerLen,dim));if(hasHoles)for(var i=0,len=holeIndices.length;i<len;i++){var start=holeIndices[i]*dim,end=i<len-1?holeIndices[i+1]*dim:data.length;polygonArea-=Math.abs(signedArea(data,start,end,dim))}var trianglesArea=0;for(i=0;i<triangles.length;i+=3){var a=triangles[i]*dim,b=triangles[i+1]*dim,c=triangles[i+2]*dim;trianglesArea+=Math.abs((data[a]-data[c])*(data[b+1]-data[a+1])-(data[a]-data[b])*(data[c+1]-data[a+1]))}return 0===polygonArea&&0===trianglesArea?0:Math.abs((trianglesArea-polygonArea)/polygonArea)},earcut.flatten=function(data){for(var dim=data[0][0].length,result={vertices:[],holes:[],dimensions:dim},holeIndex=0,i=0;i<data.length;i++){for(var j=0;j<data[i].length;j++)for(var d=0;d<dim;d++)result.vertices.push(data[i][j][d]);i>0&&(holeIndex+=data[i-1].length,result.holes.push(holeIndex))}return result};var Earcut$7=earcut,GraphicsFrag=["#define SHADER_NAME PHASER_GRAPHICS_FS","","precision mediump float;","","varying vec4 outColor;
134","","void main ()","{","    gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);","}",""].join("\n"),GraphicsVert=["#define SHADER_NAME PHASER_GRAPHICS_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec4 inColor;","","varying vec4 outColor;","","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","","    outColor = inColor;","}",""].join("\n"),Earcut$6=Earcut$7,GetFastValue$1a=GetFastValue_1,ShaderSourceFS$3=GraphicsFrag,ShaderSourceVS$3=GraphicsVert,TransformMatrix$c=TransformMatrix_1,WEBGL_CONST$2=_const$8,WebGLPipeline$6=WebGLPipeline_1,GraphicsPipeline$1=new Class_1({Extends:WebGLPipeline$6,initialize:function(config){config.fragShader=GetFastValue$1a(config,"fragShader",ShaderSourceFS$3),config.vertShader=GetFastValue$1a(config,"vertShader",ShaderSourceVS$3),config.attributes=GetFastValue$1a(config,"attributes",[{name:"inPosition",size:2},{name:"inColor",size:4,type:WEBGL_CONST$2.UNSIGNED_BYTE,normalized:!0}]),WebGLPipeline$6.call(this,config),this.calcMatrix=new TransformMatrix$c,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},batchFillRect:function(x,y,width,height,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);var xw=x+width,yh=y+height,x0=calcMatrix.getX(x,y),y0=calcMatrix.getY(x,y),x1=calcMatrix.getX(x,yh),y1=calcMatrix.getY(x,yh),x2=calcMatrix.getX(xw,yh),y2=calcMatrix.getY(xw,yh),x3=calcMatrix.getX(xw,y),y3=calcMatrix.getY(xw,y),tint=this.fillTint;this.batchQuad(x0,y0,x1,y1,x2,y2,x3,y3,tint.TL,tint.TR,tint.BL,tint.BR)},batchFillTriangle:function(x0,y0,x1,y1,x2,y2,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);var tx0=calcMatrix.getX(x0,y0),ty0=calcMatrix.getY(x0,y0),tx1=calcMatrix.getX(x1,y1),ty1=calcMatrix.getY(x1,y1),tx2=calcMatrix.getX(x2,y2),ty2=calcMatrix.getY(x2,y2),tint=this.fillTint;this.batchTri(tx0,ty0,tx1,ty1,tx2,ty2,tint.TL,tint.TR,tint.BL)},batchStrokeTriangle:function(x0,y0,x1,y1,x2,y2,lineWidth,currentMatrix,parentMatrix){var tempTriangle=this.tempTriangle;tempTriangle[0].x=x0,tempTriangle[0].y=y0,tempTriangle[0].width=lineWidth,tempTriangle[1].x=x1,tempTriangle[1].y=y1,tempTriangle[1].width=lineWidth,tempTriangle[2].x=x2,tempTriangle[2].y=y2,tempTriangle[2].width=lineWidth,tempTriangle[3].x=x0,tempTriangle[3].y=y0,tempTriangle[3].width=lineWidth,this.batchStrokePath(tempTriangle,lineWidth,!1,currentMatrix,parentMatrix)},batchFillPath:function(path,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);for(var polygonIndexArray,point,length=path.length,polygonCache=this.polygonCache,tintTL=this.fillTint.TL,tintTR=this.fillTint.TR,tintBL=this.fillTint.BL,pathIndex=0;pathIndex<length;++pathIndex)point=path[pathIndex],polygonCache.push(point.x,point.y);length=(polygonIndexArray=Earcut$6(polygonCache)).length;for(var index=0;index<length;index+=3){var p0=2*polygonIndexArray[index+0],p1=2*polygonIndexArray[index+1],p2=2*polygonIndexArray[index+2],x0=polygonCache[p0+0],y0=polygonCache[p0+1],x1=polygonCache[p1+0],y1=polygonCache[p1+1],x2=polygonCache[p2+0],y2=polygonCache[p2+1],tx0=calcMatrix.getX(x0,y0),ty0=calcMatrix.getY(x0,y0),tx1=calcMatrix.getX(x1,y1),ty1=calcMatrix.getY(x1,y1),tx2=calcMatrix.getX(x2,y2),ty2=calcMatrix.getY(x2,y2);this.batchTri(tx0,ty0,tx1,ty1,tx2,ty2,tintTL,tintTR,tintBL)}polygonCache.length=0},batchStrokePath:function(path,lineWidth,pathOpen,currentMatrix,parentMatrix){this.renderer.pipelines.set(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var pathLength=path.length-1,pathIndex=0;pathIndex<pathLength;pathIndex++){var point0=path[pathIndex],point1=path[pathIndex+1];this.batchLine(point0.x,point0.y,point1.x,point1.y,point0.width/2,point1.width/2,lineWidth,pathIndex,!pathOpen&&pathIndex===pathLength-1,currentMatrix,parentMatrix)}},batchLine:function(ax,ay,bx,by,aLineWidth,bLineWidth,lineWidth,index,closePath,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);var dx=bx-ax,dy=by-ay,len=Math.sqrt(dx*dx+dy*dy),al0=aLineWidth*(by-ay)/len,al1=aLineWidth*(ax-bx)/len,bl
1340=bLineWidth*(by-ay)/len,bl1=bLineWidth*(ax-bx)/len,lx0=bx-bl0,ly0=by-bl1,lx1=ax-al0,ly1=ay-al1,lx2=bx+bl0,ly2=by+bl1,lx3=ax+al0,ly3=ay+al1,brX=calcMatrix.getX(lx0,ly0),brY=calcMatrix.getY(lx0,ly0),blX=calcMatrix.getX(lx1,ly1),blY=calcMatrix.getY(lx1,ly1),trX=calcMatrix.getX(lx2,ly2),trY=calcMatrix.getY(lx2,ly2),tlX=calcMatrix.getX(lx3,ly3),tlY=calcMatrix.getY(lx3,ly3),tint=this.strokeTint,tintTL=tint.TL,tintTR=tint.TR,tintBL=tint.BL,tintBR=tint.BR;if(this.batchQuad(tlX,tlY,blX,blY,brX,brY,trX,trY,tintTL,tintTR,tintBL,tintBR),!(lineWidth<=2)){var prev=this.prevQuad,first=this.firstQuad;index>0&&prev[4]?this.batchQuad(tlX,tlY,blX,blY,prev[0],prev[1],prev[2],prev[3],tintTL,tintTR,tintBL,tintBR):(first[0]=tlX,first[1]=tlY,first[2]=blX,first[3]=blY,first[4]=1),closePath&&first[4]?this.batchQuad(brX,brY,trX,trY,first[0],first[1],first[2],first[3],tintTL,tintTR,tintBL,tintBR):(prev[0]=brX,prev[1]=brY,prev[2]=trX,prev[3]=trY,prev[4]=1)}},batchVert:function(x,y,tint){var vertexViewF32=this.vertexViewF32,vertexViewU32=this.vertexViewU32,vertexOffset=this.vertexCount*this.currentShader.vertexComponentCount-1;vertexViewF32[++vertexOffset]=x,vertexViewF32[++vertexOffset]=y,vertexViewU32[++vertexOffset]=tint,this.vertexCount++},batchQuad:function(x0,y0,x1,y1,x2,y2,x3,y3,tintTL,tintTR,tintBL,tintBR){var hasFlushed=!1;return this.shouldFlush(6)&&(this.flush(),hasFlushed=!0),this.batchVert(x0,y0,tintTL),this.batchVert(x1,y1,tintBL),this.batchVert(x2,y2,tintBR),this.batchVert(x0,y0,tintTL),this.batchVert(x2,y2,tintBR),this.batchVert(x3,y3,tintTR),hasFlushed},batchTri:function(x0,y0,x1,y1,x2,y2,tintTL,tintTR,tintBL){var hasFlushed=!1;return this.shouldFlush(3)&&(this.flush(),hasFlushed=!0),this.batchVert(x0,y0,tintTL),this.batchVert(x1,y1,tintTR),this.batchVert(x2,y2,tintBL),hasFlushed},destroy:function(){return WebGLPipeline$6.prototype.destroy.call(this),this.polygonCache=null,this}}),GraphicsPipeline_1=GraphicsPipeline$1,LightFrag=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{","    vec2 position;","    vec3 color;","    float intensity;","    float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{","    vec3 finalColor = vec3(0.0, 0.0, 0.0);","    vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);","    vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;","    vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","    vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;","","    for (int index = 0; index < kMaxLights; ++index)","    {","        Light light = uLights[index];","        vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);","        vec3 lightNormal = normalize(lightDir);","        float distToSurf = length(lightDir) * uCamera.w;","        float diffuseFactor = max(dot(normal, lightNormal), 0.0);","        float radius = (light.radius / res.x * uCamera.w) * uCamera.w;","        float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);","        vec3 diffuse = light.color * diffuseFactor;","        finalColor += (attenuation * diffuse) * light.intensity;","    }","","    vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);","","    gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n"),MultiFrag=["#define SHADER_NAME PHASER_MULTI_FS","","precision mediump float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{","    vec4 texture;","","    %forloop%","","    vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);","","    //  Multiply texture tint","    vec4 color = texture * texel;
134","","    if (outTintEffect == 1.0)","    {","        //  Solid color + texture alpha","        color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);","    }","    else if (outTintEffect == 2.0)","    {","        //  Solid color, no texture","        color = texel;","    }","","    gl_FragColor = color;","}",""].join("\n"),MultiVert=["#define SHADER_NAME PHASER_MULTI_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","","    outTexCoord = inTexCoord;","    outTexId = inTexId;","    outTint = inTint;","    outTintEffect = inTintEffect;","}",""].join("\n"),Earcut$5=Earcut$7,GetFastValue$19=GetFastValue_1,ShaderSourceFS$2=MultiFrag,ShaderSourceVS$2=MultiVert,TransformMatrix$b=TransformMatrix_1,Utils$n=Utils$p,WEBGL_CONST$1=_const$8,WebGLPipeline$5=WebGLPipeline_1,MultiPipeline$4=new Class_1({Extends:WebGLPipeline$5,initialize:function(config){var renderer=config.game.renderer,fragmentShaderSource=GetFastValue$19(config,"fragShader",ShaderSourceFS$2);config.fragShader=Utils$n.parseFragmentShaderMaxTextures(fragmentShaderSource,renderer.maxTextures),config.vertShader=GetFastValue$19(config,"vertShader",ShaderSourceVS$2),config.attributes=GetFastValue$19(config,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:WEBGL_CONST$1.UNSIGNED_BYTE,normalized:!0}]),WebGLPipeline$5.call(this,config),this._tempMatrix1=new TransformMatrix$b,this._tempMatrix2=new TransformMatrix$b,this._tempMatrix3=new TransformMatrix$b,this.calcMatrix=new TransformMatrix$b,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){WebGLPipeline$5.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(gameObject,camera,parentTransformMatrix){this.manager.set(this,gameObject);var camMatrix=this._tempMatrix1,spriteMatrix=this._tempMatrix2,calcMatrix=this._tempMatrix3,frame=gameObject.frame,texture=frame.glTexture,u0=frame.u0,v0=frame.v0,u1=frame.u1,v1=frame.v1,frameX=frame.x,frameY=frame.y,frameWidth=frame.cutWidth,frameHeight=frame.cutHeight,customPivot=frame.customPivot,displayOriginX=gameObject.displayOriginX,displayOriginY=gameObject.displayOriginY,x=-displayOriginX+frameX,y=-displayOriginY+frameY;if(gameObject.isCropped){var crop=gameObject._crop;crop.flipX===gameObject.flipX&&crop.flipY===gameObject.flipY||frame.updateCropUVs(crop,gameObject.flipX,gameObject.flipY),u0=crop.u0,v0=crop.v0,u1=crop.u1,v1=crop.v1,frameWidth=crop.width,frameHeight=crop.height,x=-displayOriginX+(frameX=crop.x),y=-displayOriginY+(frameY=crop.y)}var flipX=1,flipY=1;gameObject.flipX&&(customPivot||(x+=-frame.realWidth+2*displayOriginX),flipX=-1),(gameObject.flipY||frame.source.isGLTexture&&!texture.flipY)&&(customPivot||(y+=-frame.realHeight+2*displayOriginY),flipY=-1),spriteMatrix.applyITRS(gameObject.x,gameObject.y,gameObject.rotation,gameObject.scaleX*flipX,gameObject.scaleY*flipY),camMatrix.copyFrom(camera.matrix),parentTransformMatrix?(camMatrix.multiplyWithOffset(parentTransformMatrix,-camera.scrollX*gameObject.scrollFactorX,-camera.scrollY*gameObject.scrollFactorY),spriteMatrix.e=gameObject.x,spriteMatrix.f=gameObject.y):(spriteMatrix.e-=camera.scrollX*gameObject.scrollFactorX,spriteMatrix.f-=camera.scrollY*gameObject.scrollFactorY),camMatrix.multiply(spriteMatrix,calcMatrix);var xw=x+frameWidth,yh=y+frameHeight,roundPixels=camera.roundPixels,tx0=calcMatrix.getXRound(x,y,roundPixels),ty0=calcMatrix.getYRound(x,y,roundPixels),tx1=calcMatrix.getXRound(x,yh,roundPixels),ty1=calcMatrix.getYRound(x,yh,roundPixels),tx2=calcMatrix.getXRound(xw,yh,roundPixels),ty2=calcMatrix.getYRound(xw,yh,roundPixels),tx3=calcMatrix.getXRound(xw,y,roundPixels),ty3=calcMatrix.getYRound(xw,y,roundPixels),getTint=Utils$n.getTintAppendFloatAlpha,cameraAlpha=camera.alpha,tintTL=getTint(gameObject.tintTopLeft,cameraAlpha*gameObject._alphaTL),tintTR=getTint(gameObject.tintTopRight,cameraAlpha*gameObject._alphaTR),tintBL=getTint(gameObject.tintBottomLeft,cameraAlpha*gameObject._alphaBL),tintBR=getTint(gameObject.tintBottomRight,cameraAlpha*gameObject._alphaBR);this.shouldFlush(6)&&this.flush();var unit=this.setGameObject(gameObject,frame);this.manager.preBatch(gameObject),this.batchQuad(gameObject,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,u0,v0,u1,v1,tintTL,tintTR,tintBL,tintBR,gameObject.tintFill,texture,unit),this.manager.postBatch(gameObject)},batchTexture:function(gameObject,texture,textureWidth,textureHeight,srcX,srcY,srcWidth,srcHeight,scaleX,scaleY,rotation,flipX,flipY,scrollFactorX,scrollFactorY,displayOriginX,displayOriginY,frameX,frameY,frameWidth,frameHeight,tintTL,tintTR,tintBL,tintBR,tintEffect,uOffset,vOffset,camera,parentTransformMatrix,skipFlip,textureUnit){this.manager.set(this,gameObject);var camMatrix=this._tempMatrix1,spriteMatrix=this._tempMatrix2,calcMatrix=this._tempMatrix3,u0=frameX/textureWidth+uOffset,v0=frameY/textureHeight+vOffset,u1=(frameX+frameWidth)/textureWidth+uOffset,v1=(frameY+frameHeight)/textureHeight+vOffset,width=srcWidth,height=srcHeight,x=-displayOriginX,y=-displayOriginY;if(gameObject.isCropped){var crop=gameObject._crop,cropWidth=crop.width,cropHeight=crop.height;width=cropWidth,height=cropHeight,srcWidth=cropWidth,srcHeight=cropHeight;var ox=frameX=crop.x,oy=frameY=crop.y;flipX&&(ox=frameWidth-crop.x-cropWidth),flipY&&(oy=frameHeight-crop.y-cropHeight),u0=ox/textureWidth+uOffset,v0=oy/textureHeight+vOffset,u1=(ox+cropWidth)/textureWidth+uOffset,v1=(oy+cropHeight)/textureHeight+vOffset,x=-displayOriginX+frameX,y=-displayOriginY+frameY}flipX&&(width*=-1,x+=srcWidth),(flipY^=!skipFlip&&texture.isRenderTexture?1:0)&&(height*=-1,y+=srcHeight);var xw=x+width,yh=y+height;spriteMatrix.applyITRS(srcX,srcY,rotation,scaleX,scaleY),camMatrix.copyFrom(camera.matrix
134),parentTransformMatrix?(camMatrix.multiplyWithOffset(parentTransformMatrix,-camera.scrollX*scrollFactorX,-camera.scrollY*scrollFactorY),spriteMatrix.e=srcX,spriteMatrix.f=srcY):(spriteMatrix.e-=camera.scrollX*scrollFactorX,spriteMatrix.f-=camera.scrollY*scrollFactorY),camMatrix.multiply(spriteMatrix,calcMatrix);var roundPixels=camera.roundPixels,tx0=calcMatrix.getXRound(x,y,roundPixels),ty0=calcMatrix.getYRound(x,y,roundPixels),tx1=calcMatrix.getXRound(x,yh,roundPixels),ty1=calcMatrix.getYRound(x,yh,roundPixels),tx2=calcMatrix.getXRound(xw,yh,roundPixels),ty2=calcMatrix.getYRound(xw,yh,roundPixels),tx3=calcMatrix.getXRound(xw,y,roundPixels),ty3=calcMatrix.getYRound(xw,y,roundPixels);void 0===textureUnit&&(textureUnit=this.renderer.setTexture2D(texture)),gameObject&&this.manager.preBatch(gameObject),this.batchQuad(gameObject,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,u0,v0,u1,v1,tintTL,tintTR,tintBL,tintBR,tintEffect,texture,textureUnit),gameObject&&this.manager.postBatch(gameObject)},batchTextureFrame:function(frame,x,y,tint,alpha,transformMatrix,parentTransformMatrix){this.manager.set(this);var spriteMatrix=this._tempMatrix1.copyFrom(transformMatrix),calcMatrix=this._tempMatrix2,xw=x+frame.width,yh=y+frame.height;parentTransformMatrix?spriteMatrix.multiply(parentTransformMatrix,calcMatrix):calcMatrix=spriteMatrix;var tx0=calcMatrix.getX(x,y),ty0=calcMatrix.getY(x,y),tx1=calcMatrix.getX(x,yh),ty1=calcMatrix.getY(x,yh),tx2=calcMatrix.getX(xw,yh),ty2=calcMatrix.getY(xw,yh),tx3=calcMatrix.getX(xw,y),ty3=calcMatrix.getY(xw,y),unit=this.renderer.setTextureSource(frame.source);tint=Utils$n.getTintAppendFloatAlpha(tint,alpha),this.batchQuad(null,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,frame.u0,frame.v0,frame.u1,frame.v1,tint,tint,tint,tint,0,frame.glTexture,unit)},batchFillRect:function(x,y,width,height,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);var xw=x+width,yh=y+height,x0=calcMatrix.getX(x,y),y0=calcMatrix.getY(x,y),x1=calcMatrix.getX(x,yh),y1=calcMatrix.getY(x,yh),x2=calcMatrix.getX(xw,yh),y2=calcMatrix.getY(xw,yh),x3=calcMatrix.getX(xw,y),y3=calcMatrix.getY(xw,y),tint=this.fillTint;this.batchQuad(null,x0,y0,x1,y1,x2,y2,x3,y3,0,0,1,1,tint.TL,tint.TR,tint.BL,tint.BR,2)},batchFillTriangle:function(x0,y0,x1,y1,x2,y2,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);var tx0=calcMatrix.getX(x0,y0),ty0=calcMatrix.getY(x0,y0),tx1=calcMatrix.getX(x1,y1),ty1=calcMatrix.getY(x1,y1),tx2=calcMatrix.getX(x2,y2),ty2=calcMatrix.getY(x2,y2),tint=this.fillTint;this.batchTri(null,tx0,ty0,tx1,ty1,tx2,ty2,0,0,1,1,tint.TL,tint.TR,tint.BL,2)},batchStrokeTriangle:function(x0,y0,x1,y1,x2,y2,lineWidth,currentMatrix,parentMatrix){var tempTriangle=this.tempTriangle;tempTriangle[0].x=x0,tempTriangle[0].y=y0,tempTriangle[0].width=lineWidth,tempTriangle[1].x=x1,tempTriangle[1].y=y1,tempTriangle[1].width=lineWidth,tempTriangle[2].x=x2,tempTriangle[2].y=y2,tempTriangle[2].width=lineWidth,tempTriangle[3].x=x0,tempTriangle[3].y=y0,tempTriangle[3].width=lineWidth,this.batchStrokePath(tempTriangle,lineWidth,!1,currentMatrix,parentMatrix)},batchFillPath:function(path,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);for(var polygonIndexArray,point,length=path.length,polygonCache=this.polygonCache,tintTL=this.fillTint.TL,tintTR=this.fillTint.TR,tintBL=this.fillTint.BL,pathIndex=0;pathIndex<length;++pathIndex)point=path[pathIndex],polygonCache.push(point.x,point.y);length=(polygonIndexArray=Earcut$5(polygonCache)).length;for(var index=0;index<length;index+=3){var p0=2*polygonIndexArray[index+0],p1=2*polygonIndexArray[index+1],p2=2*polygonIndexArray[index+2],x0=polygonCache[p0+0],y0=polygonCache[p0+1],x1=polygonCache[p1+0],y1=polygonCache[p1+1],x2=polygonCache[p2+0],y2=polygonCache[p2+1],tx0=calcMatrix.getX(x0,y0),ty0=calcMatrix.getY(x0,y0),tx1=calcMatrix.getX(x1,y1),ty1=calcMatrix.getY(x1,y1),tx2=calcMatrix.getX(x2,y2),ty2=calcMatrix.getY(x2,y2);this.batchTri(null,tx0,ty0,tx1,ty1,tx2,ty2,0,0,1,1,tintTL,tintTR,tintBL,2)}polygonCache.length=0},batchStrokePath:function(path,lineWidth,pathOpen,currentMatrix,parentMatrix){this.renderer.pipelines.set(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var pathLength=path.length-1,pathIndex=0;pathIndex<pathLength;pathIndex++){var point0=path[pathIndex],point1=path[pathIndex+1];this.batchLine(point0.x,point0.y,point1.x,point1.y,point0.width/2,point1.width/2,lineWidth,pathIndex,!pathOpen&&pathIndex===pathLength-1,currentMatrix,parentMatrix)}},batchLine:function(ax,ay,bx,by,aLineWidth,bLineWidth,lineWidth,index,closePath,currentMatrix,parentMatrix){this.renderer.pipelines.set(this);var calcMatrix=this.calcMatrix;parentMatrix&&parentMatrix.multiply(currentMatrix,calcMatrix);var dx=bx-ax,dy=by-ay,len=Math.sqrt(dx*dx+dy*dy),al0=aLineWidth*(by-ay)/len,al1=aLineWidth*(ax-bx)/len,bl
1340=bLineWidth*(by-ay)/len,bl1=bLineWidth*(ax-bx)/len,lx0=bx-bl0,ly0=by-bl1,lx1=ax-al0,ly1=ay-al1,lx2=bx+bl0,ly2=by+bl1,lx3=ax+al0,ly3=ay+al1,brX=calcMatrix.getX(lx0,ly0),brY=calcMatrix.getY(lx0,ly0),blX=calcMatrix.getX(lx1,ly1),blY=calcMatrix.getY(lx1,ly1),trX=calcMatrix.getX(lx2,ly2),trY=calcMatrix.getY(lx2,ly2),tlX=calcMatrix.getX(lx3,ly3),tlY=calcMatrix.getY(lx3,ly3),tint=this.strokeTint,tintTL=tint.TL,tintTR=tint.TR,tintBL=tint.BL,tintBR=tint.BR;if(this.batchQuad(null,tlX,tlY,blX,blY,brX,brY,trX,trY,0,0,1,1,tintTL,tintTR,tintBL,tintBR,2),!(lineWidth<=2)){var prev=this.prevQuad,first=this.firstQuad;index>0&&prev[4]?this.batchQuad(null,tlX,tlY,blX,blY,prev[0],prev[1],prev[2],prev[3],0,0,1,1,tintTL,tintTR,tintBL,tintBR,2):(first[0]=tlX,first[1]=tlY,first[2]=blX,first[3]=blY,first[4]=1),closePath&&first[4]?this.batchQuad(null,brX,brY,trX,trY,first[0],first[1],first[2],first[3],0,0,1,1,tintTL,tintTR,tintBL,tintBR,2):(prev[0]=brX,prev[1]=brY,prev[2]=trX,prev[3]=trY,prev[4]=1)}}}),MultiPipeline_1=MultiPipeline$4,Class$2R=Class_1,GetFastValue$18=GetFastValue_1,LightShaderSourceFS=LightFrag,MultiPipeline$3=MultiPipeline_1,WebGLPipeline$4=WebGLPipeline_1,LIGHT_COUNT=10,tempVec2=new Vector2_1,LightPipeline$1=new Class$2R({Extends:MultiPipeline$3,initialize:function(config){LIGHT_COUNT=config.game.renderer.config.maxLights;for(var fragShader=GetFastValue$18(config,"fragShader",LightShaderSourceFS),shaders=[],i=1;i<=LIGHT_COUNT;i++)shaders.push({name:"lights"+i,fragShader:fragShader.replace("%LIGHT_COUNT%",i.toString())});config.shaders=shaders,MultiPipeline$3.call(this,config),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.lightsActive=!0},boot:function(){WebGLPipeline$4.prototype.boot.call(this);var gl=this.gl,tempTexture=gl.createTexture();gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,tempTexture),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,1,1,0,gl.RGBA,gl.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:tempTexture};for(var i=0;i<this.shaders.length;i++)this["lightShader"+(i+1)]=this.shaders[i]},onRender:function(scene,camera){var lightManager=scene.sys.lights;if(this.lightsActive=!1,lightManager&&lightManager.active){var lights=lightManager.getLights(camera),lightsCount=lights.length;if(0!==lightsCount){var i;this.lightsActive=!0,this.setShader(this["lightShader"+lightsCount],!0);var height=this.renderer.height,cameraMatrix=camera.matrix;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",camera.x,camera.y,camera.rotation,camera.zoom),this.set3f("uAmbientLightColor",lightManager.ambientColor.r,lightManager.ambientColor.g,lightManager.ambientColor.b),i=0;i<lightsCount;i++){var light=lights[i].light,color=light.color,lightName="uLights["+i+"].";cameraMatrix.transformPoint(light.x,light.y,tempVec2),this.set2f(lightName+"position",tempVec2.x-camera.scrollX*light.scrollFactorX*camera.zoom,height-(tempVec2.y-camera.scrollY*light.scrollFactorY*camera.zoom)),this.set3f(lightName+"color",color.r,color.g,color.b),this.set1f(lightName+"intensity",light.intensity),this.set1f(lightName+"radius",light.radius)}this.currentNormalMapRotation=null}}},setNormalMapRotation:function(rotation){if(rotation!==this.currentNormalMapRotation||0===this.vertexCount){this.vertexCount>0&&this.flush();var inverseRotationMatrix=this.inverseRotationMatrix;if(rotation){var rot=-rotation,c=Math.cos(rot),s=Math.sin(rot);inverseRotationMatrix[1]=s,inverseRotationMatrix[3]=-s,inverseRotationMatrix[0]=inverseRotationMatrix[4]=c}else inverseRotationMatrix[0]=inverseRotationMatrix[4]=1,inverseRotationMatrix[1]=inverseRotationMatrix[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,inverseRotationMatrix),this.currentNormalMapRotation=rotation}},setTexture2D:function(texture,gameObject){var renderer=this.renderer;void 0===texture&&(texture=renderer.tempTextures[0]);var normalTexture=this.getNormalMap(gameObject);renderer.isNewNormalMap(texture,normalTexture)&&(this.flush(),renderer.setTextureZero(texture),renderer.setNormalMap(normalTexture));var rotation=gameObject?gameObject.rotation:0;return this.setNormalMapRotation(rotation),this.currentUnit=0,0},setGameObject:function(gameObject,frame){void 0===frame&&(frame=gameObject.frame);var renderer=this.renderer,texture=frame.glTexture,normalTexture=this.getNormalMap(gameObject);return renderer.isNewNormalMap()&&(this.flush(),renderer.setTextureZero(texture),renderer.setNormalMap(normalTexture)),this.setNormalMapRotation(gameObject.rotation),this.currentUnit=0,0},getNormalMap:function(gameObject){var normalTexture;return gameObject?gameObject.displayTexture?normalTexture=gameObject.displayTexture.dataSource[gameObject.displayFrame.sourceIndex]:gameObject.texture?normalTexture=gameObject.texture.dataSource[gameObject.frame.sourceIndex]:gameObject.tileset&&(normalTexture=Array.isArray(gameObject.tileset)?gameObject.tileset[0].image.dataSource[0]:gameObject.tileset.image.dataSource[0]):normalTexture=this.defaultNormalMap,normalTexture||(normalTexture=this.defaultNormalMap),normalTexture.glTexture},batchSprite:function(gameObject,camera,parentTransformMatrix){this.lightsActive&&MultiPipeline$3.prototype.batchSprite.call(this,gameObject,camera,parentTransformMatrix)},batchTexture:function(gameObject,texture,textureWidth,textureHeight,srcX,srcY,srcWidth,srcHeight,scaleX,scaleY,rotation,flipX,flipY,scrollFactorX,scrollFactorY,displayOriginX,displayOriginY,frameX,frameY,frameWidth,frameHeight,tintTL,tintTR,tintBL,tintBR,tintEffect,uOffset,vOffset,camera,parentTransformMatrix,skipFlip,textureUnit){this.lightsActive&&MultiPipeline$3.prototype.batchTexture.call(this,gameObject,texture,textureWidth,textureHeight,srcX,srcY,srcWidth,srcHeight,scaleX,scaleY,rotation,flipX,flipY,scrollFactorX,scrollFactorY,displayOriginX,displayOriginY,frameX,frameY,frameWidth,frameHeight,tintTL,tintTR,tintBL,tintBR,tintEffect,uOffset,vOffset,camera,parentTransformMatrix,skipFlip,textureUnit)},batchTextureFrame:function(frame,x,y,tint,alpha,transformMatrix,parentTransformMatrix){this.lightsActive&&MultiPipeline$3.prototype.batchTextureFrame.call(this,frame,x,y,tint,alpha,transformMatrix,parentTransformMatrix)}});LightPipeline$1.LIGHT_COUNT=LIGHT_COUNT;var LightPipeline_1=LightPipeline$1,PointLightFrag=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{","    vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);","","    float distToSurf = length(center - gl_FragCoord.xy);","","    float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);","","    float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);","","    vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;
134","","    gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n"),PointLightVert=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{","    lightColor = inLightColor;","    lightRadius = inLightRadius;","    lightAttenuation = inLightAttenuation;","    lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);","","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n"),GetFastValue$17=GetFastValue_1,PointLightShaderSourceFS=PointLightFrag,PointLightShaderSourceVS=PointLightVert,WebGLPipeline$3=WebGLPipeline_1,PointLightPipeline$1=new Class_1({Extends:WebGLPipeline$3,initialize:function(config){config.vertShader=GetFastValue$17(config,"vertShader",PointLightShaderSourceVS),config.fragShader=GetFastValue$17(config,"fragShader",PointLightShaderSourceFS),config.attributes=GetFastValue$17(config,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),WebGLPipeline$3.call(this,config)},onRender:function(scene,camera){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",camera.zoom)},batchPointLight:function(light,camera,x0,y0,x1,y1,x2,y2,x3,y3,lightX,lightY){var color=light.color,intensity=light.intensity,radius=light.radius,attenuation=light.attenuation,r=color.r*intensity,g=color.g*intensity,b=color.b*intensity,a=camera.alpha*light.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(x0,y0,lightX,lightY,radius,attenuation,r,g,b,a),this.batchLightVert(x1,y1,lightX,lightY,radius,attenuation,r,g,b,a),this.batchLightVert(x2,y2,lightX,lightY,radius,attenuation,r,g,b,a),this.batchLightVert(x0,y0,lightX,lightY,radius,attenuation,r,g,b,a),this.batchLightVert(x2,y2,lightX,lightY,radius,attenuation,r,g,b,a),this.batchLightVert(x3,y3,lightX,lightY,radius,attenuation,r,g,b,a)},batchLightVert:function(x,y,lightX,lightY,radius,attenuation,r,g,b,a){var vertexViewF32=this.vertexViewF32,vertexOffset=this.vertexCount*this.currentShader.vertexComponentCount-1;vertexViewF32[++vertexOffset]=x,vertexViewF32[++vertexOffset]=y,vertexViewF32[++vertexOffset]=lightX,vertexViewF32[++vertexOffset]=lightY,vertexViewF32[++vertexOffset]=radius,vertexViewF32[++vertexOffset]=attenuation,vertexViewF32[++vertexOffset]=r,vertexViewF32[++vertexOffset]=g,vertexViewF32[++vertexOffset]=b,vertexViewF32[++vertexOffset]=a,this.vertexCount++}}),PointLightPipeline_1=PointLightPipeline$1,GetFastValue$16=GetFastValue_1,MultiPipeline$2=MultiPipeline_1,RopePipeline_1=new Class_1({Extends:MultiPipeline$2,initialize:function(config){config.topology=5,config.batchSize=GetFastValue$16(config,"batchSize",256),MultiPipeline$2.call(this,config)}}),SingleFrag=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{","    vec4 texture = texture2D(uMainSampler, outTexCoord);","    vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);","","    //  Multiply texture tint","    vec4 color = texture * texel;","","    if (outTintEffect == 1.0)","    {","        //  Solid color + texture alpha","        color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);","    }","    else if (outTintEffect == 2.0)","    {","        //  Solid color, no texture","        color = texel;","    }","","    gl_FragColor = color;","}",""].join("\n"),SingleVert=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;
134","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{","    gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","","    outTexCoord = inTexCoord;","    outTint = inTint;","    outTintEffect = inTintEffect;","}",""].join("\n"),GetFastValue$15=GetFastValue_1,MultiPipeline$1=MultiPipeline_1,ShaderSourceFS$1=SingleFrag,ShaderSourceVS$1=SingleVert,WebGLPipeline$2=WebGLPipeline_1,SinglePipeline_1=new Class_1({Extends:MultiPipeline$1,initialize:function(config){config.fragShader=GetFastValue$15(config,"fragShader",ShaderSourceFS$1),config.vertShader=GetFastValue$15(config,"vertShader",ShaderSourceVS$1),config.forceZero=!0,MultiPipeline$1.call(this,config)},boot:function(){WebGLPipeline$2.prototype.boot.call(this),this.set1i("uMainSampler",0)}}),AddBlendFrag=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{","    vec4 frame1 = texture2D(uMainSampler1, outTexCoord);","    vec4 frame2 = texture2D(uMainSampler2, outTexCoord);","","    gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n"),ColorMatrix$2=new Class_1({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(value){return this._matrix=value,this._dirty=!0,this},reset:function(){var m=this._matrix;return m[0]=1,m[1]=0,m[2]=0,m[3]=0,m[4]=0,m[5]=0,m[6]=1,m[7]=0,m[8]=0,m[9]=0,m[10]=0,m[11]=0,m[12]=1,m[13]=0,m[14]=0,m[15]=0,m[16]=0,m[17]=0,m[18]=1,m[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var f32=new Float32Array(this._matrix);f32[4]/=255,f32[9]/=255,f32[14]/=255,f32[19]/=255,this._data=f32,this._dirty=!1}return this._data},brightness:function(value,multiply){void 0===value&&(value=0),void 0===multiply&&(multiply=!1);var b=value;return this.multiply([b,0,0,0,0,0,b,0,0,0,0,0,b,0,0,0,0,0,1,0],multiply)},saturate:function(value,multiply){void 0===value&&(value=0),void 0===multiply&&(multiply=!1);var x=2*value/3+1,y=-.5*(x-1);return this.multiply([x,y,y,0,0,y,x,y,0,0,y,y,x,0,0,0,0,0,1,0],multiply)},desaturate:function(multiply){return void 0===multiply&&(multiply=!1),this.saturate(-1,multiply)},hue:function(rotation,multiply){void 0===rotation&&(rotation=0),void 0===multiply&&(multiply=!1),rotation=rotation/180*Math.PI;var cos=Math.cos(rotation),sin=Math.sin(rotation);return this.multiply([.213+.787*cos+-.213*sin,.715+-.715*cos+-.715*sin,.072+-.072*cos+.928*sin,0,0,.213+-.213*cos+.143*sin,.715+cos*(1-.715)+.14*sin,.072+-.072*cos+-.283*sin,0,0,.213+-.213*cos+-.787*sin,.715+-.715*cos+.715*sin,.072+.928*cos+.072*sin,0,0,0,0,0,1,0],multiply)},grayscale:function(value,multiply){return void 0===value&&(value=1),void 0===multiply&&(multiply=!1),this.saturate(-value,multiply)},blackWhite:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],multiply)},contrast:function(value,multiply){void 0===value&&(value=0),void 0===multiply&&(multiply=!1);var v=value+1,o=-.5*(v-1);return this.multiply([v,0,0,0,o,0,v,0,0,o,0,0,v,0,o,0,0,0,1,0],multiply)},negative:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],multiply)},desaturateLuminance:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],multiply)},sepia:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],multiply)},night:function(intensity,multiply){return void 0===intensity&&(intensity=.1),void 0===multiply&&(multiply=!1),this.multiply([-2*intensity,-intensity,0,0,0,-intensity,0,intensity,0,0,0,intensity,2*intensity,0,0,0,0,0,1,0],multiply)},lsd:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],multiply)},brown:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538
134042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],multiply)},vintagePinhole:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],multiply)},kodachrome:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],multiply)},technicolor:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],multiply)},polaroid:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],multiply)},shiftToBGR:function(multiply){return void 0===multiply&&(multiply=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],multiply)},multiply:function(a,multiply){multiply||this.reset();for(var m=this._matrix,c=[],i=0;i<20;i++)c[i]=m[i];return m[0]=c[0]*a[0]+c[1]*a[5]+c[2]*a[10]+c[3]*a[15],m[1]=c[0]*a[1]+c[1]*a[6]+c[2]*a[11]+c[3]*a[16],m[2]=c[0]*a[2]+c[1]*a[7]+c[2]*a[12]+c[3]*a[17],m[3]=c[0]*a[3]+c[1]*a[8]+c[2]*a[13]+c[3]*a[18],m[4]=c[0]*a[4]+c[1]*a[9]+c[2]*a[14]+c[3]*a[19]+c[4],m[5]=c[5]*a[0]+c[6]*a[5]+c[7]*a[10]+c[8]*a[15],m[6]=c[5]*a[1]+c[6]*a[6]+c[7]*a[11]+c[8]*a[16],m[7]=c[5]*a[2]+c[6]*a[7]+c[7]*a[12]+c[8]*a[17],m[8]=c[5]*a[3]+c[6]*a[8]+c[7]*a[13]+c[8]*a[18],m[9]=c[5]*a[4]+c[6]*a[9]+c[7]*a[14]+c[8]*a[19]+c[9],m[10]=c[10]*a[0]+c[11]*a[5]+c[12]*a[10]+c[13]*a[15],m[11]=c[10]*a[1]+c[11]*a[6]+c[12]*a[11]+c[13]*a[16],m[12]=c[10]*a[2]+c[11]*a[7]+c[12]*a[12]+c[13]*a[17],m[13]=c[10]*a[3]+c[11]*a[8]+c[12]*a[13]+c[13]*a[18],m[14]=c[10]*a[4]+c[11]*a[9]+c[12]*a[14]+c[13]*a[19]+c[14],m[15]=c[15]*a[0]+c[16]*a[5]+c[17]*a[10]+c[18]*a[15],m[16]=c[15]*a[1]+c[16]*a[6]+c[17]*a[11]+c[18]*a[16],m[17]=c[15]*a[2]+c[16]*a[7]+c[17]*a[12]+c[18]*a[17],m[18]=c[15]*a[3]+c[16]*a[8]+c[17]*a[13]+c[18]*a[18],m[19]=c[15]*a[4]+c[16]*a[9]+c[17]*a[14]+c[18]*a[19]+c[19],this._dirty=!0,this}}),ColorMatrix_1=ColorMatrix$2,ColorMatrixFrag=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{","    vec4 c = texture2D(uMainSampler, outTexCoord);","","    if (uAlpha == 0.0)","    {","        gl_FragColor = c;","","        return;","    }","","    if (c.a > 0.0)","    {","        c.rgb /= c.a;","    }","","    vec4 result;","","    result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];","    result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];","    result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];","    result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];","","    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);","","    rgb *= result.a;","","    gl_FragColor = vec4(rgb, result.a);","}",""].join("\n"),CopyFrag=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{","    gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n"),LinearBlendFrag=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{","    vec4 frame1 = texture2D(uMainSampler1, outTexCoord);","    vec4 frame2 = texture2D(uMainSampler2, outTexCoord);","","    gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n"),QuadVert=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{","    outFragCoord = inPosition.xy * 0.5 + 0.5;","    outTexCoord = inTexCoord;","","    gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n"),AddBlendFS=AddBlendFrag,BlendModes$5=BlendModes$8,ColorMatrix$1=ColorMatrix_1,ColorMatrixFS=ColorMatrixFrag,CopyFS=CopyFrag,GetFastValue$14=GetFastValue_1,LinearBlendFS=LinearBlendFrag,QuadVS=QuadVert,WebGLPipeline$1=WebGLPipeline_1,UtilityPipeline_1=new Class_1({Extends:WebGLPipeline$1,initialize:function(config){config.renderTarget=GetFastValue$14(config,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),config.vertShader=GetFastValue$14(config,"vertShader",QuadVS),config.shaders=GetFastValue$14(config,"shaders",[{name:"Copy",fragShader:CopyFS},{name:"AddBlend",fragShader:AddBlendFS},{name:"LinearBlend",fragShader:LinearBlendFS},{name:"ColorMatrix",fragShader:ColorMatrixFS}]),config.attributes=GetFastValue$14(config,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),config.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],config.batchSize=1,WebGLPipeline$1.call(this,config),this.colorMatrix=new ColorMatrix$1,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){WebGLPipeline$1.prototype.boot.call(this);var shaders=this.shaders,targets=this.renderTargets;
134this.copyShader=shaders[0],this.addShader=shaders[1],this.linearShader=shaders[2],this.colorMatrixShader=shaders[3],this.fullFrame1=targets[0],this.fullFrame2=targets[1],this.halfFrame1=targets[2],this.halfFrame2=targets[3]},copyFrame:function(source,target,brightness,clear,clearAlpha){void 0===brightness&&(brightness=1),void 0===clear&&(clear=!0),void 0===clearAlpha&&(clearAlpha=!0);var gl=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",brightness),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,source.texture),target?(gl.viewport(0,0,target.width,target.height),gl.bindFramebuffer(gl.FRAMEBUFFER,target.framebuffer),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,target.texture,0)):gl.viewport(0,0,source.width,source.height),clear&&(clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT)),gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.STATIC_DRAW),gl.drawArrays(gl.TRIANGLES,0,6),gl.bindFramebuffer(gl.FRAMEBUFFER,null),gl.bindTexture(gl.TEXTURE_2D,null)},blitFrame:function(source,target,brightness,clear,clearAlpha,eraseMode){void 0===brightness&&(brightness=1),void 0===clear&&(clear=!0),void 0===clearAlpha&&(clearAlpha=!0),void 0===eraseMode&&(eraseMode=!1);var gl=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",brightness),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,source.texture),source.height>target.height)gl.viewport(0,0,source.width,source.height),this.setTargetUVs(source,target);else{var diff=target.height-source.height;gl.viewport(0,diff,source.width,source.height)}if(gl.bindFramebuffer(gl.FRAMEBUFFER,target.framebuffer),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,target.texture,0),clear&&(clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT)),eraseMode){var blendMode=this.renderer.currentBlendMode;this.renderer.setBlendMode(BlendModes$5.ERASE)}gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.STATIC_DRAW),gl.drawArrays(gl.TRIANGLES,0,6),eraseMode&&this.renderer.setBlendMode(blendMode),gl.bindFramebuffer(gl.FRAMEBUFFER,null),gl.bindTexture(gl.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(source,target,x,y,width,height,clear,clearAlpha){void 0===clear&&(clear=!0),void 0===clearAlpha&&(clearAlpha=!0);var gl=this.gl;gl.bindFramebuffer(gl.FRAMEBUFFER,source.framebuffer),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,source.texture,0),clear&&(clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT)),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,target.texture),gl.copyTexSubImage2D(gl.TEXTURE_2D,0,0,0,x,y,width,height),gl.bindFramebuffer(gl.FRAMEBUFFER,null),gl.bindTexture(gl.TEXTURE_2D,null)},copyToGame:function(source){var gl=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,source.texture),gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.STATIC_DRAW),gl.drawArrays(gl.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(source,target,clearAlpha,colorMatrix){void 0===clearAlpha&&(clearAlpha=!0),void 0===colorMatrix&&(colorMatrix=this.colorMatrix);var gl=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",colorMatrix.getData()),this.set1f("uAlpha",colorMatrix.alpha),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,source.texture),target?(gl.viewport(0,0,target.width,target.height),gl.bindFramebuffer(gl.FRAMEBUFFER,target.framebuffer),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,target.texture,0)):gl.viewport(0,0,source.width,source.height),clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT),gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.STATIC_DRAW),gl.drawArrays(gl.TRIANGLES,0,6),gl.bindFramebuffer(gl.FRAMEBUFFER,null),gl.bindTexture(gl.TEXTURE_2D,null)},blendFrames:function(source1,source2,target,strength,clearAlpha,blendShader){void 0===strength&&(strength=1),void 0===clearAlpha&&
134(clearAlpha=!0),void 0===blendShader&&(blendShader=this.linearShader);var gl=this.gl;this.setShader(blendShader),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",strength),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,source1.texture),gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,source2.texture),target?(gl.bindFramebuffer(gl.FRAMEBUFFER,target.framebuffer),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,target.texture,0),gl.viewport(0,0,target.width,target.height)):gl.viewport(0,0,source1.width,source1.height),clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT),gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.STATIC_DRAW),gl.drawArrays(gl.TRIANGLES,0,6),gl.bindFramebuffer(gl.FRAMEBUFFER,null),gl.bindTexture(gl.TEXTURE_2D,null)},blendFramesAdditive:function(source1,source2,target,strength,clearAlpha){this.blendFrames(source1,source2,target,strength,clearAlpha,this.addShader)},clearFrame:function(target,clearAlpha){void 0===clearAlpha&&(clearAlpha=!0);var gl=this.gl;gl.viewport(0,0,target.width,target.height),gl.bindFramebuffer(gl.FRAMEBUFFER,target.framebuffer),clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT);var fbo=this.renderer.currentFramebuffer;gl.bindFramebuffer(gl.FRAMEBUFFER,fbo)},setUVs:function(uA,vA,uB,vB,uC,vC,uD,vD){var vertexViewF32=this.vertexViewF32;vertexViewF32[2]=uA,vertexViewF32[3]=vA,vertexViewF32[6]=uB,vertexViewF32[7]=vB,vertexViewF32[10]=uC,vertexViewF32[11]=vC,vertexViewF32[14]=uA,vertexViewF32[15]=vA,vertexViewF32[18]=uC,vertexViewF32[19]=vC,vertexViewF32[22]=uD,vertexViewF32[23]=vD},setTargetUVs:function(source,target){var diff=target.height/source.height;diff=diff>.5?.5-(diff-.5):.5-diff+.5,this.setUVs(0,diff,0,1+diff,1,1+diff,1,diff)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}}),CONST$17=_const$9,CustomMap=_Map,BitmapMaskPipeline=BitmapMaskPipeline_1,GraphicsPipeline=GraphicsPipeline_1,LightPipeline=LightPipeline_1,MultiPipeline=MultiPipeline_1,PointLightPipeline=PointLightPipeline_1,RopePipeline=RopePipeline_1,SinglePipeline=SinglePipeline_1,UtilityPipeline=UtilityPipeline_1,PipelineManager$1=new Class_1({initialize:function(renderer){this.game=renderer.game,this.renderer=renderer,this.classes=new CustomMap([[CONST$17.UTILITY_PIPELINE,UtilityPipeline],[CONST$17.MULTI_PIPELINE,MultiPipeline],[CONST$17.BITMAPMASK_PIPELINE,BitmapMaskPipeline],[CONST$17.SINGLE_PIPELINE,SinglePipeline],[CONST$17.ROPE_PIPELINE,RopePipeline],[CONST$17.LIGHT_PIPELINE,LightPipeline],[CONST$17.POINTLIGHT_PIPELINE,PointLightPipeline],[CONST$17.GRAPHICS_PIPELINE,GraphicsPipeline]]),this.postPipelineClasses=new CustomMap,this.pipelines=new CustomMap,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(pipelineConfig){var instance,pipelineName,_this=this,game=this.game;if(this.classes.each((function(pipelineName,pipeline){instance=_this.add(pipelineName,new pipeline({game:game})),pipelineName===CONST$17.UTILITY_PIPELINE&&(_this.UTILITY_PIPELINE=instance,_this.fullFrame1=instance.fullFrame1,_this.fullFrame2=instance.fullFrame2,_this.halfFrame1=instance.halfFrame1,_this.halfFrame2=instance.halfFrame2)})),this.MULTI_PIPELINE=this.get(CONST$17.MULTI_PIPELINE),this.BITMAPMASK_PIPELINE=this.get(CONST$17.BITMAPMASK_PIPELINE),pipelineConfig)for(pipelineName in pipelineConfig){var pipelineClass=pipelineConfig[pipelineName];(instance=new pipelineClass(game)).isPostFX?this.postPipelineClasses.set(pipelineName,pipelineClass):this.has(pipelineName)||(this.classes.set(pipelineName,pipelineClass),this.add(pipelineName,instance))}},add:function(name,pipeline){if(!pipeline.isPostFX){var pipelines=this.pipelines,renderer=this.renderer;return pipelines.has(name)?console.warn("Pipeline exists: "+name):(pipeline.name=name,pipeline.manager=this,pipelines.set(name,pipeline)),pipeline.hasBooted||pipeline.boot(),0!==renderer.width&&0!==renderer.height&&pipeline.resize(renderer.width,renderer.height),pipeline}console.warn(name+" is a Post Pipeline. Use `addPostPipeline` instead")},addPostPipeline:function(name,pipeline){this.postPipelineClasses.has(name)||this.postPipelineClasses.set(name,pipeline)},flush:function(){this.current&&this.current.flush()},has:function(pipeline){var pipelines=this.pipelines;return"string"==typeof pipeline?pipelines.has(pipeline):!!pipelines.contains(pipeline)},get:function(pipeline){var pipelines=this.pipelines;return"string"==typeof pipeline?pipelines.get(pipeline):pipelines.contains(pipeline)?pipeline:void 0},getPostPipeline:function(pipeline,gameObject){var instance,pipelineClasses=this.postPipelineClasses;if("string"==typeof pipeline?instance=pipelineClasses.get(pipeline):"function"==typeof pipeline?pipelineClasses.contains(pipeline)&&(instance=pipeline):"object"==typeof pipeline&&(instance=pipelineClasses.get(pipeline.name)),instance){var newPipeline=new instance(this.game);return gameObject&&(newPipeline.gameObject=gameObject),newPipeline}},remove:function(name,removeClass,removePostPipelineClass){void 0===removeClass&&(removeClass=!0),void 0===removePostPipelineClass&&(removePostPipelineClass=!0),this.pipelines.delete(name),removeClass&&this.classes.delete(name),removePostPipelineClass&&this.postPipelineClasses.delete(name)},set:function(pipeline,gameObject,currentShader){if(!pipeline.isPostFX)return this.isCurrent(pipeline,currentShader)||(this.flush(),this.current&&this.current.unbind(),this.current=pipeline,pipeline.b
134ind(currentShader)),pipeline.updateProjectionMatrix(),pipeline.onBind(gameObject),pipeline},preBatch:function(gameObject){if(gameObject.hasPostPipeline){this.flush();for(var pipelines=gameObject.postPipelines,i=pipelines.length-1;i>=0;i--){var pipeline=pipelines[i];pipeline.active&&pipeline.preBatch(gameObject)}}},postBatch:function(gameObject){if(gameObject.hasPostPipeline){this.flush();for(var pipelines=gameObject.postPipelines,i=0;i<pipelines.length;i++){var pipeline=pipelines[i];pipeline.active&&pipeline.postBatch(gameObject)}}},preBatchCamera:function(camera){if(camera.hasPostPipeline){this.flush();for(var pipelines=camera.postPipelines,i=pipelines.length-1;i>=0;i--){var pipeline=pipelines[i];pipeline.active&&pipeline.preBatch(camera)}}},postBatchCamera:function(camera){if(camera.hasPostPipeline){this.flush();for(var pipelines=camera.postPipelines,i=0;i<pipelines.length;i++){var pipeline=pipelines[i];pipeline.active&&pipeline.postBatch(camera)}}},isCurrent:function(pipeline,currentShader){var renderer=this.renderer,current=this.current;return current&&!currentShader&&(currentShader=current.currentShader),!(current!==pipeline||currentShader.program!==renderer.currentProgram)},copyFrame:function(source,target,brightness,clear,clearAlpha){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyFrame(source,target,brightness,clear,clearAlpha),this},copyToGame:function(source){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyToGame(source),this},drawFrame:function(source,target,clearAlpha,colorMatrix){return this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader).drawFrame(source,target,clearAlpha,colorMatrix),this},blendFrames:function(source1,source2,target,strength,clearAlpha){return this.setUtility(this.UTILITY_PIPELINE.linearShader).blendFrames(source1,source2,target,strength,clearAlpha),this},blendFramesAdditive:function(source1,source2,target,strength,clearAlpha){return this.setUtility(this.UTILITY_PIPELINE.addShader).blendFramesAdditive(source1,source2,target,strength,clearAlpha),this},clearFrame:function(target,clearAlpha){return this.UTILITY_PIPELINE.clearFrame(target,clearAlpha),this},blitFrame:function(source,target,brightness,clear,clearAlpha,eraseMode){return this.setUtility(this.UTILITY_PIPELINE.copyShader).blitFrame(source,target,brightness,clear,clearAlpha,eraseMode),this},copyFrameRect:function(source,target,x,y,width,height,clear,clearAlpha){return this.UTILITY_PIPELINE.copyFrameRect(source,target,x,y,width,height,clear,clearAlpha),this},forceZero:function(){return this.current&&this.current.forceZero},setMulti:function(){return this.set(this.MULTI_PIPELINE)},setUtility:function(currentShader){return this.UTILITY_PIPELINE.bind(currentShader)},rebind:function(pipeline){void 0===pipeline&&this.previous&&(pipeline=this.previous);var renderer=this.renderer,gl=renderer.gl;gl.disable(gl.DEPTH_TEST),gl.disable(gl.CULL_FACE),renderer.hasActiveStencilMask()?gl.clear(gl.DEPTH_BUFFER_BIT):(gl.disable(gl.STENCIL_TEST),gl.clear(gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT)),gl.viewport(0,0,renderer.width,renderer.height),renderer.currentProgram=null,renderer.setBlendMode(0,!0);var entries=this.pipelines.entries;for(var key in entries)entries[key].glReset=!0;pipeline&&(this.current=pipeline,pipeline.rebind()),renderer.resetTextures()},clear:function(){var renderer=this.renderer;this.flush(),this.current?(this.current.unbind(),this.previous=this.current,this.current=null):this.previous=null,renderer.currentProgram=null,renderer.setBlendMode(0,!0)},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}}),PipelineManager_1=PipelineManager$1,CanvasPool$9=CanvasPool_1,Color$6=Color_1,GetFastValue$13=GetFastValue_1,WebGLSnapshot_1=function(sourceCanvas,config){var gl=sourceCanvas.getContext("experimental-webgl"),callback=GetFastValue$13(config,"callback"),type=GetFastValue$13(config,"type","image/png"),encoderOptions=GetFastValue$13(config,"encoder",.92),x=GetFastValue$13(config,"x",0),y=GetFastValue$13(config,"y",0),getPixel=GetFastValue$13(config,"getPixel",!1),isFramebuffer=GetFastValue$13(config,"isFramebuffer",!1),bufferWidth=isFramebuffer?GetFastValue$13(config,"bufferWidth",1):gl.drawingBufferWidth,bufferHeight=isFramebuffer?GetFastValue$13(config,"bufferHeight",1):gl.drawingBufferHeight;if(getPixel){var pixel=new Uint8Array(4),destY=isFramebuffer?y:bufferHeight-y;gl.readPixels(x,destY,1,1,gl.RGBA,gl.UNSIGNED_BYTE,pixel),callback.call(null,new Color$6(pixel[0],pixel[1],pixel[2],pixel[3]/255
134))}else{var width=GetFastValue$13(config,"width",bufferWidth),height=GetFastValue$13(config,"height",bufferHeight),pixels=new Uint8Array(width*height*4);gl.readPixels(x,bufferHeight-y-height,width,height,gl.RGBA,gl.UNSIGNED_BYTE,pixels);for(var canvas=CanvasPool$9.createWebGL(this,width,height),ctx=canvas.getContext("2d"),imageData=ctx.getImageData(0,0,width,height),data=imageData.data,py=0;py<height;py++)for(var px=0;px<width;px++){var sourceIndex=4*((height-py-1)*width+px),destIndex=4*(py*width+px);data[destIndex+0]=pixels[sourceIndex+0],data[destIndex+1]=pixels[sourceIndex+1],data[destIndex+2]=pixels[sourceIndex+2],data[destIndex+3]=pixels[sourceIndex+3]}ctx.putImageData(imageData,0,0);var image=new Image;image.onerror=function(){callback.call(null),CanvasPool$9.remove(canvas)},image.onload=function(){callback.call(null,image),CanvasPool$9.remove(canvas)},image.src=canvas.toDataURL(type,encoderOptions)}},ArrayRemove$2=Remove_1,CameraEvents=events$d,CONST$16=_const$e,EventEmitter$o=eventemitter3.exports,Events$C=events$j,GameEvents$c=events$k,IsSizePowerOfTwo$2=IsSizePowerOfTwo_1,Matrix4$3=Matrix4_1,NOOP$m=NOOP_1,PipelineManager=PipelineManager_1,RenderTarget$1=RenderTarget_1,ScaleEvents=events$c,TextureEvents$1=events$b,Utils$m=Utils$p,WebGLSnapshot=WebGLSnapshot_1,WebGLRenderer=new Class_1({Extends:EventEmitter$o,initialize:function(game){EventEmitter$o.call(this);var gameConfig=game.config,contextCreationConfig={alpha:gameConfig.transparent,desynchronized:gameConfig.desynchronized,depth:!1,antialias:gameConfig.antialiasGL,premultipliedAlpha:gameConfig.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:gameConfig.failIfMajorPerformanceCaveat,powerPreference:gameConfig.powerPreference,preserveDrawingBuffer:gameConfig.preserveDrawingBuffer};this.config={clearBeforeRender:gameConfig.clearBeforeRender,antialias:gameConfig.antialias,backgroundColor:gameConfig.backgroundColor,contextCreation:contextCreationConfig,roundPixels:gameConfig.roundPixels,maxTextures:gameConfig.maxTextures,maxTextureSize:gameConfig.maxTextureSize,batchSize:gameConfig.batchSize,maxLights:gameConfig.maxLights,mipmapFilter:gameConfig.mipmapFilter},this.game=game,this.type=CONST$16.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=game.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=NOOP$m,this.contextRestoredHandler=NOOP$m,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(config){var gl,game=this.game,canvas=this.canvas,clearColor=config.backgroundColor;if(!(gl=game.config.context?game.config.context:canvas.getContext("webgl",config.contextCreation)||canvas.getContext("experimental-webgl",config.contextCreation))||gl.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=gl;var _this=this;this.contextLostHandler=function(event){_this.contextLost=!0,_this.game.events.emit(GameEvents$c.CONTEXT_LOST,_this),event.preventDefault()},this.contextRestoredHandler=function(){_this.contextLost=!1,_this.init(_this.config),_this.game.events.emit(GameEvents$c.CONTEXT_RESTORED,_this)},canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),game.context=gl;for(var i=0;i<=27;i++)this.blendModes.push({func:[gl.ONE,gl.ONE_MINUS_SRC_ALPHA],equation:gl.FUNC_ADD});this.blendModes[1].func=[gl.ONE,gl.DST_ALPHA],this.blendModes[2].func=[gl.DST_COLOR,gl.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[gl.ONE,gl.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[gl.ZERO,gl.ONE_MINUS_SRC_ALPHA],equation:gl.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=gl.BYTE,this.glFormats[1]=gl.SHORT,this.glFormats[2]=gl.UNSIGNED_BYTE,this.glFormats[3]=gl.UNSIGNED_SHORT,this.glFormats[4]=gl.FLOAT,this.glFuncMap={mat2:{func:gl.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:gl.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:gl.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:gl.uniform1f,length:1},"1fv":{func:gl.uniform1fv,length:1},"1i":{func:gl.uniform1i,length:1},"1iv":{func:gl.uniform1iv,length:1},"2f":{func:gl.uniform2f,length:2},"2fv":{func:gl.uniform2fv,length:1},"2i":{func:gl.uniform2i,length:2},"2iv":{func:gl.uniform2iv,length:1},"3f":{func:gl.uniform3f,length:3},"3fv":{func:gl.uniform3fv,length:1},"3i":{func:gl.uniform3i,length:3},"3iv":{func:gl.uniform3iv,length:1},"4f":{func:gl.uniform4f,length:4},"4fv":{func:gl.uniform4fv,length:1},"4i":{func:gl.uniform4i,length:4},"4iv":{func:gl.uniform4iv,length:1}};
134var exts=gl.getSupportedExtensions();config.maxTextures&&-1!==config.maxTextures||(config.maxTextures=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)),config.maxTextureSize||(config.maxTextureSize=gl.getParameter(gl.MAX_TEXTURE_SIZE));var extString="WEBGL_compressed_texture_",wkExtString="WEBKIT_"+extString;this.compression.ETC1=gl.getExtension(extString+"etc1")||gl.getExtension(wkExtString+"etc1"),this.compression.PVRTC=gl.getExtension(extString+"pvrtc")||gl.getExtension(wkExtString+"pvrtc"),this.compression.S3TC=gl.getExtension(extString+"s3tc")||gl.getExtension(wkExtString+"s3tc"),this.supportedExtensions=exts;this.instancedArraysExtension=exts.indexOf("ANGLE_instanced_arrays")>-1?gl.getExtension("ANGLE_instanced_arrays"):null;this.vaoExtension=exts.indexOf("OES_vertex_array_object")>-1?gl.getExtension("OES_vertex_array_object"):null,gl.disable(gl.DEPTH_TEST),gl.disable(gl.CULL_FACE),gl.enable(gl.BLEND),gl.clearColor(clearColor.redGL,clearColor.greenGL,clearColor.blueGL,clearColor.alphaGL),this.mipmapFilter=gl[config.mipmapFilter],this.maxTextures=Utils$m.checkShaderMax(gl,config.maxTextures),this.textureIndexes=[];var tempTextures=this.tempTextures;if(Array.isArray(tempTextures))for(var t=0;i<this.maxTextures;t++)gl.deleteTexture(tempTextures[t]);else tempTextures=new Array(this.maxTextures);for(var index=0;index<this.maxTextures;index++){var tempTexture=gl.createTexture();gl.activeTexture(gl.TEXTURE0+index),gl.bindTexture(gl.TEXTURE_2D,tempTexture),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,1,1,0,gl.RGBA,gl.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),tempTextures[index]=tempTexture,this.textureIndexes.push(index)}return this.tempTextures=tempTextures,this.currentActiveTexture=1,this.startActiveTexture++,gl.activeTexture(gl.TEXTURE1),this.pipelines=new PipelineManager(this),this.setBlendMode(CONST$16.BlendModes.NORMAL),this.projectionMatrix=(new Matrix4$3).identity(),game.textures.once(TextureEvents$1.READY,this.boot,this),this},boot:function(){var game=this.game,pipelineManager=this.pipelines,baseSize=game.scale.baseSize;this.width=baseSize.width,this.height=baseSize.height,this.isBooted=!0,this.renderTarget=new RenderTarget$1(this,this.width,this.height,1,0,!0,!0),pipelineManager.boot(game.config.pipeline),this.blankTexture=game.textures.getFrame("__DEFAULT"),this.whiteTexture=game.textures.getFrame("__WHITE");var gl=this.gl;gl.bindFramebuffer(gl.FRAMEBUFFER,null),gl.enable(gl.SCISSOR_TEST),game.scale.on(ScaleEvents.RESIZE,this.onResize,this),this.resize(baseSize.width,baseSize.height)},onResize:function(gameSize,baseSize){baseSize.width===this.width&&baseSize.height===this.height||this.resize(baseSize.width,baseSize.height)},beginCapture:function(width,height){void 0===width&&(width=this.width),void 0===height&&(height=this.height),this.renderTarget.bind(!0,width,height),this.setProjectionMatrix(width,height),this.resetTextures()},endCapture:function(){return this.renderTarget.unbind(!0),this.resetProjectionMatrix(),this.renderTarget},resize:function(width,height){var gl=this.gl;return this.width=width,this.height=height,this.setProjectionMatrix(width,height),gl.viewport(0,0,width,height),this.drawingBufferHeight=gl.drawingBufferHeight,gl.scissor(0,gl.drawingBufferHeight-height,width,height),this.defaultScissor[2]=width,this.defaultScissor[3]=height,this.emit(Events$C.RESIZE,width,height),this},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(width,height){return width===this.projectionWidth&&height===this.projectionHeight||(this.projectionWidth=width,this.projectionHeight=height,this.projectionMatrix.ortho(0,width,height,0,-1e3,1e3)),this},resetProjectionMatrix:function(){this.projectionWidth=this.width,this.projectionHeight=this.height,this.projectionMatrix.ortho(0,this.width,this.height,0,-1e3,1e3)},hasExtension:function(extensionName){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(extensionName)},getExtension:function(extensionName){return this.hasExtension(extensionName)?(extensionName in this.extensions||(this.extensions[extensionName]=this.gl.getExtension(extensionName)),this.extensions[extensionName]):null},flush:function(){this.pipelines.flush()},pushScissor:function(x,y,width,height,drawingBufferHeight){void 0===drawingBufferHeight&&(drawingBufferHeight=this.drawingBufferHeight);var scissor=[x,y,width,height];return this.scissorStack.push(scissor),this.setScissor(x,y,width,height,drawingBufferHeight),this.currentScissor=scissor,scissor},setScissor:function(x,y,width,height,drawingBufferHeight){void 0===drawingBufferHeight&&(drawingBufferHeight=this.drawingBufferHeight);var gl=this.gl,current=this.currentScissor,setScissor=width>0&&height>0;if(current&&setScissor){var cx=current[0],cy=current[1],cw=current[2],ch=current[3];setScissor=cx!==x||cy!==y||cw!==width||ch!==height}setScissor&&(this.flush(),gl.scissor(x,drawingBufferHeight-y-height,width,height))},resetScissor:function(){var gl=this.gl;gl.enable(gl.SCISSOR_TEST);var current=this.currentScissor;if(current){var x=current[0],y=current[1],width=current[2],height=current[3];width>0&&height>0&&gl.scissor(x,this.drawingBufferHeight-y-height,width,height)}},popScissor:function(){var scissorStack=this.scissorStack;scissorStack.pop();var scissor=scissorStack[scissorStack.length-1];scissor&&this.setScissor(scissor[0],scissor[1],scissor[2],scissor[3]),this.currentScissor=scissor},hasActiveStencilMask:function(){var mask=this.currentMask.mask,camMask=this.currentCameraMask.mask;return mask&&mask.isStencil||camMask&&camMask.isStencil},resetViewport:function(){var gl=this.gl;gl.viewport(0,0,this.width,this.height),this.drawingBufferHeight=gl.drawingBufferHeight},setBlendMode:function(blendModeId,force){void 0===force&&(force=!1);var gl=this.gl,blendMode=this.blendModes[blendModeId];return!!(force||blendModeId!==CONST$16.BlendModes.SKIP_CHECK&&this.currentBlendMode!==blendModeId)&&(this.flush(),gl.enable(gl.BLEND),gl.blendEquation(blendMode.equation),blendMode.func.length>2?gl.blendFuncSeparate(blendMode.func[0],blendMode.func[1],blendMode.func[2],blendMode.func[3]):gl.blendFunc(blendMode.func[0],blendMode.func[1]),this.currentBlendMode=blendModeId,!0)},addBlendMode:function(func,equation){return this.blendModes.push({func:func,equation:equation})-1},updateBlendMode:function(index,func,equation){return this.blendModes[index]&&(this.blendModes[index].func=func,equation&&(this.blendModes[index].equation=equation)),this},removeBlendMode:function(index){return index>17&&this.blendModes[index]&&this.blendModes.splice(index,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(textureSource){if(this.pipelines.forceZero())return this.setTextureZero(textureSource.glTexture,!0),0;var gl=this.gl,currentActiveTexture=this.currentActiveTexture;return textureSource.glIndexCounter<this.startActiveTexture&&(textureSource.glIndexCounter=this.startActiveTexture,currentActiveTexture<this.maxTextures?(textureSource.glIndex=currentActiveTexture,gl.activeTexture(gl.TEXTURE0+currentActiveTexture),gl.bindTexture(gl.TEXTURE_2D,textureSource.glTexture),this.currentActiveTexture++):(this.flush(),this.startActiveTexture++,this.textureFlush++,textureSource.glIndexCounter=this.startActiveTexture,textureSource.glIndex=1,gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,textureSource.glTexture),this.currentActiveTexture=2)),this.isTextureClean=!1,textureSource.glIndex},isNewNormalMap:function(texture,normalMap){return this.textureZero!==texture||this.normalTexture!==normalMap},setTextureZero:function(texture,flush){if(this.textureZero!==texture){flush&&this.flush();var gl=this.gl;gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,texture),this.textureZero=texture}},clearTextureZero:function(){this.textureZero=null},setNormalMap:function(texture){if(this.normalTexture!==texture){var gl=this.gl;gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,texture),this.normalTexture=texture,1===this.currentActiveTexture&&(this.currentActiveTexture=2)}},clearNormalMap:function(){this.normalTexture=null,this.startActiveTexture++,this.currentActiveTexture=1,this.textureFlush++},unbindTextures:function(){for(var gl=this.gl,temp=this.tempTextures,i=0;i<temp.length;i++)gl.activeTexture(gl.TEXTURE0+i),gl.bindTexture(gl.TEXTURE_2D,null);this.normalTexture=null,this.textureZero=null,this.currentActiveTexture=1,this.startActiveTexture++,this.textureFlush++},resetTextures:function(all){if(void 0===all&&(all=!1),!this.isTextureClean){this.flush();var gl=this.gl,temp=this.tempTextures;if(all){for(var i=0;i<temp.length;i++)gl.activeTexture(gl.TEXTURE0+i),gl.bindTexture(gl.TEXTURE_2D,temp[i]);gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,temp[1]),this.isTextureClean=!0}else gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,temp[0]),gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,temp[1]);this.normalTexture=null,this.textureZero=null,this.currentActiveTexture=1,this.startActiveTexture++,this.textureFlush++}},setTexture2D:function(texture){if(this.pipelines.forceZero())return this.setTextureZero(texture,!0),0;var gl=this.gl,currentActiveTexture=this.currentActiveTexture;return texture.glIndexCounter<this.startActiveTexture&&(texture.glIndexCounter=this.startActiveTexture,currentActiveTexture<this.maxTextures?(texture.glIndex=currentActiveTexture,gl.activeTexture(gl.TEXTURE0+currentActiveTexture),gl.bindTexture(gl.TEXTURE_2D,texture),this.currentActiveTexture++):(this.flush(),this.startActiveTexture++,this.textureFlush++,texture.glIndexCounter=this.startActiveTexture,texture.glIndex=1,gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,texture),this.currentActiveTexture=2)),this.isTextureClean=!1,texture.glIndex},pushFramebuffer:function(framebuffer,updateScissor,resetTextures,setVie
134wport){return framebuffer===this.currentFramebuffer?this:(this.fboStack.push(framebuffer),this.setFramebuffer(framebuffer,updateScissor,resetTextures,setViewport))},setFramebuffer:function(framebuffer,updateScissor,resetTextures,setViewport){if(void 0===updateScissor&&(updateScissor=!1),void 0===resetTextures&&(resetTextures=!1),void 0===setViewport&&(setViewport=!0),framebuffer===this.currentFramebuffer)return this;var gl=this.gl,width=this.width,height=this.height;return framebuffer&&framebuffer.renderTexture&&setViewport?(width=framebuffer.renderTexture.width,height=framebuffer.renderTexture.height):this.flush(),gl.bindFramebuffer(gl.FRAMEBUFFER,framebuffer),setViewport&&gl.viewport(0,0,width,height),updateScissor&&(framebuffer?(this.drawingBufferHeight=height,this.pushScissor(0,0,width,height)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=framebuffer,resetTextures&&this.resetTextures(),this},popFramebuffer:function(updateScissor,resetTextures,setViewport){void 0===updateScissor&&(updateScissor=!1),void 0===resetTextures&&(resetTextures=!1),void 0===setViewport&&(setViewport=!0);var fboStack=this.fboStack;fboStack.pop();var framebuffer=fboStack[fboStack.length-1];return framebuffer||(framebuffer=null),this.setFramebuffer(framebuffer,updateScissor,resetTextures,setViewport),framebuffer},setProgram:function(program){return program!==this.currentProgram&&(this.flush(),this.gl.useProgram(program),this.currentProgram=program,!0)},resetProgram:function(){return this.gl.useProgram(this.currentProgram),this},createTextureFromSource:function(source,width,height,scaleMode){var gl=this.gl,minFilter=gl.NEAREST,magFilter=gl.NEAREST,wrap=gl.CLAMP_TO_EDGE;width=source?source.width:width,height=source?source.height:height;var pow=IsSizePowerOfTwo$2(width,height);return pow&&(wrap=gl.REPEAT),scaleMode===CONST$16.ScaleModes.LINEAR&&this.config.antialias&&(minFilter=pow?this.mipmapFilter:gl.LINEAR,magFilter=gl.LINEAR),source||"number"!=typeof width||"number"!=typeof height?this.createTexture2D(0,minFilter,magFilter,wrap,wrap,gl.RGBA,source):this.createTexture2D(0,minFilter,magFilter,wrap,wrap,gl.RGBA,null,width,height)},createTexture2D:function(mipLevel,minFilter,magFilter,wrapT,wrapS,format,pixels,width,height,pma,forceSize,flipY){pma=null==pma||pma,void 0===forceSize&&(forceSize=!1),void 0===flipY&&(flipY=!1);var gl=this.gl,texture=gl.createTexture();gl.activeTexture(gl.TEXTURE0);var currentTexture=gl.getParameter(gl.TEXTURE_BINDING_2D);return gl.bindTexture(gl.TEXTURE_2D,texture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,minFilter),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,magFilter),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,wrapS),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,wrapT),gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pma),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,flipY),null==pixels?gl.texImage2D(gl.TEXTURE_2D,mipLevel,format,width,height,0,format,gl.UNSIGNED_BYTE,null):(forceSize||(width=pixels.width,height=pixels.height),gl.texImage2D(gl.TEXTURE_2D,mipLevel,format,format,gl.UNSIGNED_BYTE,pixels)),IsSizePowerOfTwo$2(width,height)&&gl.generateMipmap(gl.TEXTURE_2D),currentTexture&&gl.bindTexture(gl.TEXTURE_2D,currentTexture),texture.isAlphaPremultiplied=pma,texture.isRenderTexture=!1,texture.width=width,texture.height=height,texture.glIndex=0,texture.glIndexCounter=-1,texture},createFramebuffer:function(width,height,renderTexture,addDepthStencilBuffer){var complete,gl=this.gl,framebuffer=gl.createFramebuffer();if(this.setFramebuffer(framebuffer),addDepthStencilBuffer){var depthStencilBuffer=gl.createRenderbuffer();gl.bindRenderbuffer(gl.RENDERBUFFER,depthStencilBuffer),gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_STENCIL,width,height),gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_STENCIL_ATTACHMENT,gl.RENDERBUFFER,depthStencilBuffer)}if(renderTexture.isRenderTexture=!0,renderTexture.isAlphaPremultiplied=!1,gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,renderTexture,0),(complete=gl.checkFramebufferStatus(gl.FRAMEBUFFER))!==gl.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer status: "+{3
1346054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[complete])}return framebuffer.renderTexture=renderTexture,this.setFramebuffer(null),this.resetTextures(),framebuffer},createProgram:function(vertexShader,fragmentShader){var gl=this.gl,program=gl.createProgram(),vs=gl.createShader(gl.VERTEX_SHADER),fs=gl.createShader(gl.FRAGMENT_SHADER);if(gl.shaderSource(vs,vertexShader),gl.shaderSource(fs,fragmentShader),gl.compileShader(vs),gl.compileShader(fs),!gl.getShaderParameter(vs,gl.COMPILE_STATUS))throw new Error("Vertex Shader failed:\n"+gl.getShaderInfoLog(vs));if(!gl.getShaderParameter(fs,gl.COMPILE_STATUS))throw new Error("Fragment Shader failed:\n"+gl.getShaderInfoLog(fs));if(gl.attachShader(program,vs),gl.attachShader(program,fs),gl.linkProgram(program),!gl.getProgramParameter(program,gl.LINK_STATUS))throw new Error("Link Program failed:\n"+gl.getProgramInfoLog(program));return gl.useProgram(program),program},createVertexBuffer:function(initialDataOrSize,bufferUsage){var gl=this.gl,vertexBuffer=gl.createBuffer();return gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer),gl.bufferData(gl.ARRAY_BUFFER,initialDataOrSize,bufferUsage),gl.bindBuffer(gl.ARRAY_BUFFER,null),vertexBuffer},createIndexBuffer:function(initialDataOrSize,bufferUsage){var gl=this.gl,indexBuffer=gl.createBuffer();return gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indexBuffer),gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,initialDataOrSize,bufferUsage),gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,null),indexBuffer},deleteTexture:function(texture,reset){return reset&&this.resetTextures(!0),texture&&this.gl.deleteTexture(texture),this},deleteFramebuffer:function(framebuffer){return framebuffer&&(this.gl.deleteFramebuffer(framebuffer),ArrayRemove$2(this.fboStack,framebuffer),this.currentFramebuffer===framebuffer&&(this.currentFramebuffer=null)),this},deleteProgram:function(program){return program&&this.gl.deleteProgram(program),this},deleteBuffer:function(buffer){return this.gl.deleteBuffer(buffer),this},preRenderCamera:function(camera){var cx=camera.x,cy=camera.y,cw=camera.width,ch=camera.height,color=camera.backgroundColor;(camera.emit(CameraEvents.PRE_RENDER,camera),this.pipelines.preBatchCamera(camera),this.pushScissor(cx,cy,cw,ch),camera.mask&&(this.currentCameraMask.mask=camera.mask,this.currentCameraMask.camera=camera._maskCamera,camera.mask.preRenderWebGL(this,camera,camera._maskCamera)),color.alphaGL>0)&&this.pipelines.setMulti().drawFillRect(cx,cy,cw,ch,Utils$m.getTintFromFloats(color.blueGL,color.greenGL,color.redGL,1),color.alphaGL)},getCurrentStencilMask:function(){var prev=null,stack=this.maskStack,cameraMask=this.currentCameraMask;return stack.length>0?prev=stack[stack.length-1]:cameraMask.mask&&cameraMask.mask.isStencil&&(prev=cameraMask),prev},postRenderCamera:function(camera){var flashEffect=camera.flashEffect,fadeEffect=camera.fadeEffect;if(flashEffect.isRunning||fadeEffect.isRunning||fadeEffect.isComplete){var pipeline=this.pipelines.setMulti();flashEffect.postRenderWebGL(pipeline,Utils$m.getTintFromFloats),fadeEffect.postRenderWebGL(pipeline,Utils$m.getTintFromFloats)}camera.dirty=!1,this.popScissor(),camera.mask&&(this.currentCameraMask.mask=null,camera.mask.postRenderWebGL(this,camera._maskCamera)),this.pipelines.postBatchCamera(camera),camera.emit
134(CameraEvents.POST_RENDER,camera)},preRender:function(){if(!this.contextLost){var gl=this.gl;if(gl.bindFramebuffer(gl.FRAMEBUFFER,null),this.config.clearBeforeRender){var clearColor=this.config.backgroundColor;gl.clearColor(clearColor.redGL,clearColor.greenGL,clearColor.blueGL,clearColor.alphaGL),gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT)}gl.enable(gl.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&gl.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(Events$C.PRE_RENDER)}},render:function(scene,children,camera){if(!this.contextLost){var childCount=children.length;if(this.emit(Events$C.RENDER,scene,camera),this.preRenderCamera(camera),0===childCount)return this.setBlendMode(CONST$16.BlendModes.NORMAL),void this.postRenderCamera(camera);this.currentType="";for(var current=this.currentMask,i=0;i<childCount;i++){this.finalType=i===childCount-1;var child=children[i],mask=child.mask;(current=this.currentMask).mask&&current.mask!==mask&&current.mask.postRenderWebGL(this,current.camera),mask&&current.mask!==mask&&mask.preRenderWebGL(this,child,camera),child.blendMode!==this.currentBlendMode&&this.setBlendMode(child.blendMode);
134var type=child.type;type!==this.currentType&&(this.newType=!0,this.currentType=type),this.finalType?this.nextTypeMatch=!1:this.nextTypeMatch=children[i+1].type===this.currentType,child.renderWebGL(this,child,camera),this.newType=!1}(current=this.currentMask).mask&&current.mask.postRenderWebGL(this,current.camera),this.setBlendMode(CONST$16.BlendModes.NORMAL),this.postRenderCamera(camera)}},postRender:function(){if(!this.contextLost){this.flush(),this.emit(Events$C.POST_RENDER);var state=this.snapshotState;state.callback&&(WebGLSnapshot(this.canvas,state),state.callback=null),this.textureFlush>0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(callback,type,encoderOptions){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,callback,type,encoderOptions)},snapshotArea:function(x,y,width,height,callback,type,encoderOptions){var state=this.snapshotState;return state.callback=callback,state.type=type,state.encoder=encoderOptions,state.getPixel=!1,state.x=x,state.y=y,state.width=Math.min(width,this.gl.drawingBufferWidth),state.height=Math.min(height,this.gl.drawingBufferHeight),this},snapshotPixel:function(x,y,callback){return this.snapshotArea(x,y,1,1,callback),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(framebuffer,bufferWidth,bufferHeight,callback,getPixel,x,y,width,height,type,encoderOptions){void 0===getPixel&&(getPixel=!1),void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=bufferWidth),void 0===height&&(height=bufferHeight);var currentFramebuffer=this.currentFramebuffer;this.snapshotArea(x,y,width,height,callback,type,encoderOptions);var state=this.snapshotState;return state.getPixel=getPixel,state.isFramebuffer=!0,state.bufferWidth=bufferWidth,state.bufferHeight=bufferHeight,this.setFramebuffer(framebuffer),WebGLSnapshot(this.canvas,state),this.setFramebuffer(currentFramebuffer),state.callback=null,state.isFramebuffer=!1,this},canvasToTexture:function(srcCanvas,dstTexture,noRepeat,flipY){return void 0===noRepeat&&(noRepeat=!1),void 0===flipY&&(flipY=!1),dstTexture?this.updateCanvasTexture(srcCanvas,dstTexture,flipY):this.createCanvasTexture(srcCanvas,noRepeat,flipY)},createCanvasTexture:function(srcCanvas,noRepeat,flipY){void 0===noRepeat&&(noRepeat=!1),void 0===flipY&&(flipY=!1);var gl=this.gl,minFilter=gl.NEAREST,magFilter=gl.NEAREST,width=srcCanvas.width,height=srcCanvas.height,wrapping=gl.CLAMP_TO_EDGE,pow=IsSizePowerOfTwo$2(width,height);return!noRepeat&&pow&&(wrapping=gl.REPEAT),this.config.antialias&&(minFilter=pow?this.mipmapFilter:gl.LINEAR,magFilter=gl.LINEAR),this.createTexture2D(0,minFilter,magFilter,wrapping,wrapping,gl.RGBA,srcCanvas,width,height,!0,!1,flipY)},updateCanvasTexture:function(srcCanvas,dstTexture,flipY){void 0===flipY&&(flipY=!1);var gl=this.gl,width=srcCanvas.width,height=srcCanvas.height;if(width>0&&height>0){gl.activeTexture(gl.TEXTURE0);var currentTexture=gl.getParameter(gl.TEXTURE_BINDING_2D);gl.bindTexture(gl.TEXTURE_2D,dstTexture),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,flipY),gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,srcCanvas),dstTexture.width=width,dstTexture.height=height,currentTexture&&gl.bindTexture(gl.TEXTURE_2D,currentTexture)}return dstTexture},createVideoTexture:function(srcVideo,noRepeat,flipY){void 0===noRepeat&&(noRepeat=!1),void 0===flipY&&(flipY=!1);var gl=this.gl,minFilter=gl.NEAREST,magFilter=gl.NEAREST,width=srcVideo.videoWidth,height=srcVideo.videoHeight,wrapping=gl.CLAMP_TO_EDGE,pow=IsSizePowerOfTwo$2(width,height);return!noRepeat&&pow&&(wrapping=gl.REPEAT),this.config.antialias&&(minFilter=pow?this.mipmapFilter:gl.LINEAR,magFilter=gl.LINEAR),this.createTexture2D(0,minFilter,magFilter,wrapping,wrapping,gl.RGBA,srcVideo,width,height,!0,!0,flipY)},updateVideoTexture:function(srcVideo,dstTexture,flipY){void 0===flipY&&(flipY=!1);var gl=this.gl,width=srcVideo.videoWidth,height=srcVideo.videoHeight;if(width>0&&height>0){gl.activeTexture(gl.TEXTURE0);var currentTexture=gl.getParameter(gl.TEXTURE_BINDING_2D);gl.bindTexture(gl.TEXTURE_2D,dstTexture),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,flipY),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,srcVideo),dstTexture.width=width,dstTexture.height=height,currentTexture&&gl.bindTexture(gl.TEXTURE_2D,currentTexture)}return dstTexture},setTextureFilter:function(texture,filter){var gl=this.gl,glFilter=[gl.LINEAR,gl.NEAREST][filter];gl.activeTexture(gl.TEXTURE0);var currentTexture=gl.getParameter(gl.TEXTURE_BINDING_2D);return gl.bindTexture(gl.TEXTURE_2D,texture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,glFilter),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,glFilter),currentTexture&&gl.bindTexture(gl.TEXTURE_2D,currentTexture),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var gl=this.gl,temp=this.tempTextures,i=0;i<temp.length;i++)gl.deleteTexture(temp[i]);this.pipelines.destroy(),this.removeAllListeners(),this.fboStack=[],this.maskStack=[],this.extensions={},this.textureIndexes=[],this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0,this.currentMask=null,this.currentCameraMask=null}}),WebGLRenderer_1=WebGLRenderer,CanvasInterpolation=CanvasInterpolation_1,CanvasPool$8=CanvasPool_1,CONST$15=_const$e,Features$1=Features_1,CreateRenderer_1=function(game){var config=game.config;if((config.customEnvironment||config.canvas)&&config.renderType===CONST$15.AUTO)throw new Error("Mu
134st set explicit renderType in custom environment");if(!config.customEnvironment&&!config.canvas&&config.renderType!==CONST$15.HEADLESS)if(config.renderType===CONST$15.CANVAS||config.renderType!==CONST$15.CANVAS&&!Features$1.webGL){if(!Features$1.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");config.renderType=CONST$15.CANVAS}else config.renderType=CONST$15.WEBGL;config.antialias||CanvasPool$8.disableSmoothing();var CanvasRenderer,WebGLRenderer,baseSize=game.scale.baseSize,width=baseSize.width,height=baseSize.height;(config.canvas?(game.canvas=config.canvas,game.canvas.width=width,game.canvas.height=height):game.canvas=CanvasPool$8.create(game,width,height,config.renderType),config.canvasStyle&&(game.canvas.style=config.canvasStyle),config.antialias||CanvasInterpolation.setCrisp(game.canvas),config.renderType!==CONST$15.HEADLESS)&&(CanvasRenderer=CanvasRenderer_1,WebGLRenderer=WebGLRenderer_1,config.renderType===CONST$15.WEBGL?game.renderer=new WebGLRenderer(game):(game.renderer=new CanvasRenderer(game),game.context=game.renderer.gameContext))},CONST$14=_const$e,DebugHeader_1=function(game){var config=game.config;if(!config.hideBanner){var renderType="WebGL";config.renderType===CONST$14.CANVAS?renderType="Canvas":config.renderType===CONST$14.HEADLESS&&(renderType="Headless");var audioType,audioConfig=config.audio,deviceAudio=game.device.audio;if(audioType=deviceAudio.webAudio&&!audioConfig.disableWebAudio?"Web Audio":audioConfig.noAudio||!deviceAudio.webAudio&&!deviceAudio.audioData?"No Audio":"HTML5 Audio",game.device.browser.ie)window.console&&console.log("Phaser v"+CONST$14.VERSION+" / https://phaser.io");else{var lastColor,c="",args=[c];if(Array.isArray(config.bannerBackgroundColor))config.bannerBackgroundColor.forEach((function(color){c=c.concat("%c "),args.push("background: "+color),lastColor=color})),args[args.length-1]="color: "+config.bannerTextColor+"; background: "+lastColor;else c=c.concat("%c "),args.push("color: "+config.bannerTextColor+"; background: "+config.bannerBackgroundColor);args.push("background: transparent"),config.gameTitle&&(c=c.concat(config.gameTitle),config.gameVersion&&(c=c.concat(" v"+config.gameVersion)),config.hidePhaser||(c=c.concat(" / ")));config.hidePhaser||(c=c.concat("Phaser v"+CONST$14.VERSION+" ("+renderType+" | "+audioType+")")),c=c.concat(" %c "+config.gameURL),args[0]=c,console.log.apply(console,args)}}},NOOP$l=NOOP_1,RequestAnimationFrame_1=new Class_1({initialize:function(){this.isRunning=!1,this.callback=NOOP$l,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var _this=this;this.step=function step(){var timestamp=window.performance.now();_this.lastTime=_this.tick,_this.tick=timestamp,_this.callback(timestamp),_this.timeOutID=window.requestAnimationFrame(step)},this.stepTimeout=function stepTimeout(){var d=Date.now(),delay=Math.min(Math.max(2*_this.target+_this.tick-d,0),_this.target);_this.lastTime=_this.tick,_this.tick=d,_this.callback(d),_this.timeOutID=window.setTimeout(stepTimeout,delay)}},start:function(callback,forceSetTimeOut,targetFPS){this.isRunning||(this.callback=callback,this.isSetTimeOut=forceSetTimeOut,this.target=targetFPS,this.isRunning=!0,this.timeOutID=forceSetTimeOut?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=NOOP$l}}),GetValue$t=GetValue_1,NOOP$k=NOOP_1,RequestAnimationFrame=RequestAnimationFrame_1,TimeStep$1=new Class_1({initialize:function(game,config){this.game=game,this.raf=new RequestAnimationFrame,this.started=!1,this.running=!1,this.minFps=GetValue$t(config,"min",5),this.targetFps=GetValue$t(config,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=NOOP$k,this.forceSetTimeOut=GetValue$t(config,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=GetValue$t(config,"deltaHistory",10),this.panicMax=GetValue$t(config,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=GetValue$t(config,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var now=window.performance.now();this.time=now,this.lastTime=now,this.nextFpsUpdate=now+1e3,this.framesThisSecond=0;for(var i=0;i<this.deltaSmoothingMax;i++)this.deltaHistory[i]=Math.min(this._target,this.deltaHistory[i]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(callback){if(this.started)return this;this.started=!0,this.running=!0;for(var i=0;i<this.deltaSmoothingMax;i++)this.deltaHistory[i]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=callback,this.raf.start(this.step.bind(this),this.forceSetTimeOut,this._target)},step:function(){var time=window.performance.now();this.now=time;var before=time-this.lastTime;before<0&&(before=0),this.rawDelta=before;var idx=this.deltaIndex,history=this.deltaHistory,max=this.deltaSmoothingMax,dt=before,avg=before;if(this.smoothStep){(this._coolDown>0||!this.inFocus)&&(this._coolDown--,dt=Math.min(dt,this._target)),dt>this._min&&(dt=history[idx],dt=Math.min(dt,this._min)),history[idx]=dt,this.deltaIndex++,this.deltaIndex>max&&(this.deltaIndex=0),avg=0;for(var i=0;i<max;i++)avg+=history[i];avg/=max}this.delta=avg,this.time+=this.rawDelta,time>this.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=time+1e3,this.framesThisSecond=0),this.framesThisSecond++;var interpolation=avg/this._target;this.callback(time,avg,interpolation),this.lastTime=time,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(seamless){this.running||(seamless&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=NOOP$k,this.raf=null,this.game=null}}),TimeStep_1=TimeStep$1,Events$B=events$k,VisibilityHandler_1=function(game){var hiddenVar,eventEmitter=game.events;if(void 0!==document.hidden)hiddenVar="visibilitychange";else{["webkit","moz","ms"].forEach((function(prefix){void 0!==document[prefix+"Hidden"]&&(document.hidden=function(){return document[prefix+"Hidden"]},hiddenVar=prefix+"visibilitychange")}))}hiddenVar&&document.addEventListener(hiddenVar,(function(event){document.hidden||"pause"===event.type?eventEmitter.emit(Events$B.HIDDEN):eventEmitter.emit(Events$B.VISIBLE)}
134),!1),window.onblur=function(){eventEmitter.emit(Events$B.BLUR)},window.onfocus=function(){eventEmitter.emit(Events$B.FOCUS)},window.focus&&game.config.autoFocus&&window.focus()},core={Config:Config_1,CreateRenderer:CreateRenderer_1,DebugHeader:DebugHeader_1,Events:events$k,TimeStep:TimeStep_1,VisibilityHandler:VisibilityHandler_1},Arne16$1={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"},Arne16=Arne16$1,CanvasPool$7=CanvasPool_1,GetValue$s=GetValue_1,GenerateTexture_1=function(config){var data=GetValue$s(config,"data",[]),canvas=GetValue$s(config,"canvas",null),palette=GetValue$s(config,"palette",Arne16),pixelWidth=GetValue$s(config,"pixelWidth",1),pixelHeight=GetValue$s(config,"pixelHeight",pixelWidth),resizeCanvas=GetValue$s(config,"resizeCanvas",!0),clearCanvas=GetValue$s(config,"clearCanvas",!0),preRender=GetValue$s(config,"preRender",null),postRender=GetValue$s(config,"postRender",null),width=Math.floor(Math.abs(data[0].length*pixelWidth)),height=Math.floor(Math.abs(data.length*pixelHeight));canvas||(canvas=CanvasPool$7.create2D(this,width,height),resizeCanvas=!1,clearCanvas=!1),resizeCanvas&&(canvas.width=width,canvas.height=height);var ctx=canvas.getContext("2d");clearCanvas&&ctx.clearRect(0,0,width,height),preRender&&preRender(canvas,ctx);for(var y=0;y<data.length;y++)for(var row=data[y],x=0;x<row.length;x++){var d=row[x];"."!==d&&" "!==d&&(ctx.fillStyle=palette[d],ctx.fillRect(x*pixelWidth,y*pixelHeight,pixelWidth,pixelHeight))}return postRender&&postRender(canvas,ctx),canvas},create={GenerateTexture:GenerateTexture_1,Palettes:{ARNE16:Arne16$1,C64:{0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"},CGA:{0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"},JMP:{0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"},MSX:{0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}}},Rectangle$q=Rectangle_1$1,MATH_CONST$e=_const$b,FromPoints_1=function(points,out){if(void 0===out&&(out=new Rectangle$q),0===points.length)return out;for(var p,px,py,minX=Number.MAX_VALUE,minY=Number.MAX_VALUE,maxX=MATH_CONST$e.MIN_SAFE_INTEGER,maxY=MATH_CONST$e.MIN_SAFE_INTEGER,i=0;i<points.length;i++)p=points[i],Array.isArray(p)?(px=p[0],py=p[1]):(px=p.x,py=p.y),minX=Math.min(minX,px),minY=Math.min(minY,py),maxX=Math.max(maxX,px),maxY=Math.max(maxY,py);return out.x=minX,out.y=minY,out.width=maxX-minX,out.height=maxY-minY,out},FromPoints$1=FromPoints_1,Rectangle$p=Rectangle_1$1,Vector2$H=Vector2_1,Curve$7=new Class_1({initialize:function(type){this.type=type,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new Vector2$H,this._tmpVec2B=new Vector2$H},draw:function(graphics,pointsTotal){return void 0===pointsTotal&&(pointsTotal=32),graphics.strokePoints(this.getPoints(pointsTotal))},getBounds:function(out,accuracy){out||(out=new Rectangle$p),void 0===accuracy&&(accuracy=16);var len=this.getLength();accuracy>len&&(accuracy=len/2);var spaced=Math.max(1,Math.round(len/accuracy));return FromPoints$1(this.getSpacedPoints(spaced),out)},getDistancePoints:function(distance){var len=this.getLength(),spaced=Math.max(1,len/distance);return this.getSpacedPoints(spaced)},getEndPoint:function(out){return void 0===out&&(out=new Vector2$H),this.getPointAt(1,out)},getLength:function(){var lengths=this.getLengths();return lengths[lengths.length-1]},getLengths:function(divisions){if(void 0===divisions&&(divisions=this.arcLengthDivisions),this.cacheArcLengths.length===divisions+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var current,cache=[],last=this.getPoint(0,this._tmpVec2A),sum=0;cache.push(0);for(var p=1;p<=divisions;p++)sum+=(current=this.getPoint(p/divisions,this._tmpVec2B)).distance(last),cache.push(sum),last.copy(current);return this.cacheArcLengths=cache,cache},getPointAt:function(u,out){var t=this.getUtoTmapping(u);return this.getPoint(t,out)},getPoints:function(divisions,stepRate,out){void 0===out&&(out=[]),divisions||(divisions=stepRate?this.getLength()/stepRate:this.defaultDivisions);for(var d=0;d<=divisions;d++)out.push(this.getPoint(d/divisions));return out},getRandomPoint:function(out){return void 0===out&&(out=new Vector2$H),this.getPoint(Math.random(),out)},getSpacedPoints:function(divisions,stepRate,out){void 0===out&&(out=[]),divisions||(divisions=stepRate?this.getLength()/stepRate:this.defaultDivisions);for(var d=0;d<=divisions;d++){var t=this.getUtoTmapping(d/divisions,null,divisions);out.push(this.getPoint(t))}return out},getStartPoint:function(out){return void 0===out&&(out=new Vector2$H),this.getPointAt(0,out)},getTangent:function(t,out){void 0===out&&(out=new Vector2$H);var t1=t-1e-4,t2=t+1e-4;return t1<0&&(t1=0),t2>1&&(t2=1),this.getPoint(t1,this._tmpVec2A),this.getPoint(t2,out),out.subtract(this._tmpVec2A).normalize()},getTangentAt:function(u,out){var t=this.getUtoTmapping(u);return this.getTangent(t,out)},getTFromDistance:function(distance,divisions){return distance<=0?0:this.getUtoTmapping(0,distance,divisions)},getUtoTmapping:function(u,distance,divisions){var targetArcLength,arcLengths=this.getLengths(divisions),i=0,il=arcLengths.length;targetArcLength=distance?Math.min(distance,arcLengths[il-1]):u*arcLengths[il-1];for(var comparison,low=0,high=il-1;low<=high;)if((comparison=arcLengths[i=Math.floor(low+(high-low)/2)]-targetArcLength)<0)low=i+1;else{if(!(comparison>0)){high=i;break}high=i-1}if(arcLengths[i=high]===targetArcLength)return i/(il-1);var lengthBefore=arcLengths[i];return(i+(targetArcLength-lengthBefore)/(arcLengths[i+1]-lengthBefore))/(il-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}}),Curve_1$1=Curve$7,CubicBezier=CubicBezierInterpolation_1,Curve$6=Curve_1$1,Vector2$G=Vector2_1,CubicBezierCurve$1=new Class_1({Extends:Curve$6,initialize:function(p0,p1,p2,p3){Curve$6.call(this,"CubicBezierCurve"),Array.isArray(p0)&&(p3=new Vector2$G(p0[6],p0[7]),p2=new Vector2$G(p0[4],p0[5]),p1=new Vector2$G(p0[2],p0[3]),p0=new Vector2$G(p0[0],p0[1])),this.p0=p0,this.p1=p1,this.p2=p2,this.p3=p3},getStartPoint:function(out){return void 0===out&&(out=new Vector2$G),out.copy(this.p0)},getResolution:function(divisions){return divisions},getPoint:function(t,out){void 0===out&&(out=new Vector2$G);var p0=this.p0,p1=this.p1,p2=this.p2,p3=this.p3;return out.set(CubicBezier(t,p0.x,p1.x,p2.x,p3.x),CubicBezier(t,p0.y,p1.y,p2.y,p3.y))},draw:function(graphics,pointsTotal){void 0===pointsTotal&&(pointsTotal=32);var points=this.getPoints(pointsTotal);graphics.beginPath(),graphics.moveTo(this.p0.x,this.p0.y);for(var i=1;i<points.length;
vendor: 17,556 bytes, lines 134-164
134i++)graphics.lineTo(points[i].x,points[i].y);return graphics.strokePath(),graphics},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});CubicBezierCurve$1.fromJSON=function(data){var points=data.points,p0=new Vector2$G(points[0],points[1]),p1=new Vector2$G(points[2],points[3]),p2=new Vector2$G(points[4],points[5]),p3=new Vector2$G(points[6],points[7]);return new CubicBezierCurve$1(p0,p1,p2,p3)};var CubicBezierCurve_1=CubicBezierCurve$1,Curve$5=Curve_1$1,DegToRad$7=DegToRad_1,GetValue$r=GetValue_1,RadToDeg$1=RadToDeg_1,Vector2$F=Vector2_1,EllipseCurve$1=new Class_1({Extends:Curve$5,initialize:function(x,y,xRadius,yRadius,startAngle,endAngle,clockwise,rotation){if("object"==typeof x){var config=x;x=GetValue$r(config,"x",0),y=GetValue$r(config,"y",0),xRadius=GetValue$r(config,"xRadius",0),yRadius=GetValue$r(config,"yRadius",xRadius),startAngle=GetValue$r(config,"startAngle",0),endAngle=GetValue$r(config,"endAngle",360),clockwise=GetValue$r(config,"clockwise",!1),rotation=GetValue$r(config,"rotation",0)}else void 0===yRadius&&(yRadius=xRadius),void 0===startAngle&&(startAngle=0),void 0===endAngle&&(endAngle=360),void 0===clockwise&&(clockwise=!1),void 0===rotation&&(rotation=0);Curve$5.call(this,"EllipseCurve"),this.p0=new Vector2$F(x,y),this._xRadius=xRadius,this._yRadius=yRadius,this._startAngle=DegToRad$7(startAngle),this._endAngle=DegToRad$7(endAngle),this._clockwise=clockwise,this._rotation=DegToRad$7(rotation)},getStartPoint:function(out){return void 0===out&&(out=new Vector2$F),this.getPoint(0,out)},getResolution:function(divisions){return 2*divisions},getPoint:function(t,out){void 0===out&&(out=new Vector2$F);for(var twoPi=2*Math.PI,deltaAngle=this._endAngle-this._startAngle,samePoints=Math.abs(deltaAngle)<Number.EPSILON;deltaAngle<0;)deltaAngle+=twoPi;for(;deltaAngle>twoPi;)deltaAngle-=twoPi;deltaAngle<Number.EPSILON&&(deltaAngle=samePoints?0:twoPi),this._clockwise&&!samePoints&&(deltaAngle===twoPi?deltaAngle=-twoPi:deltaAngle-=twoPi);var angle=this._startAngle+t*deltaAngle,x=this.p0.x+this._xRadius*Math.cos(angle),y=this.p0.y+this._yRadius*Math.sin(angle);if(0!==this._rotation){var cos=Math.cos(this._rotation),sin=Math.sin(this._rotation),tx=x-this.p0.x,ty=y-this.p0.y;x=tx*cos-ty*sin+this.p0.x,y=tx*sin+ty*cos+this.p0.y}return out.set(x,y)},setXRadius:function(value){return this.xRadius=value,this},setYRadius:function(value){return this.yRadius=value,this},setWidth:function(value){return this.xRadius=value/2,this},setHeight:function(value){return this.yRadius=value/2,this},setStartAngle:function(value){return this.startAngle=value,this},setEndAngle:function(value){return this.endAngle=value,this},setClockwise:function(value){return this.clockwise=value,this},setRotation:function(value){return this.rotation=value,this},x:{get:function(){return this.p0.x},set:function(value){this.p0.x=value}},y:{get:function(){return this.p0.y},set:function(value){this.p0.y=value}},xRadius:{get:function(){return this._xRadius},set:function(value){this._xRadius=value}},yRadius:{get:function(){return this._yRadius},set:function(value){this._yRadius=value}},startAngle:{get:function(){return RadToDeg$1(this._startAngle)},set:function(value){this._startAngle=DegToRad$7(value)}},endAngle:{get:function(){return RadToDeg$1(this._endAngle)},set:function(value){this._endAngle=DegToRad$7(value)}},clockwise:{get:function(){return this._clockwise},set:function(value){this._clockwise=value}},angle:{get:function(){return RadToDeg$1(this._rotation)},set:function(value){this._rotation=DegToRad$7(value)}},rotation:{get:function(){return this._rotation},set:function(value){this._rotation=value}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:RadToDeg$1(this._startAngle),endAngle:RadToDeg$1(this._endAngle),clockwise:this._clockwise,rotation:RadToDeg$1(this._rotation)}}});
135/**
136	 * @author       Richard Davey <[email protected]>
137	 * @copyright    2020 Photon Storm Ltd.
138	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
139	 */EllipseCurve$1.fromJSON=function(data){return new EllipseCurve$1(data)};var EllipseCurve_1=EllipseCurve$1,PluginCache$f=PluginCache_1,SceneEvents$e=events$g,GameObjectFactory$B=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.events=scene.sys.events,this.displayList,this.updateList,this.events.once(SceneEvents$e.BOOT,this.boot,this),this.events.on(SceneEvents$e.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(SceneEvents$e.DESTROY,this.destroy,this)},start:function(){this.events.once(SceneEvents$e.SHUTDOWN,this.shutdown,this)},existing:function(child){return(child.renderCanvas||child.renderWebGL)&&this.displayList.add(child),child.preUpdate&&this.updateList.add(child),child},shutdown:function(){this.events.off(SceneEvents$e.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(SceneEvents$e.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});
140/**
141	 * @author       Richard Davey <[email protected]>
142	 * @copyright    2020 Photon Storm Ltd.
143	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
144	 */GameObjectFactory$B.register=function(factoryType,factoryFunction){GameObjectFactory$B.prototype.hasOwnProperty(factoryType)||(GameObjectFactory$B.prototype[factoryType]=factoryFunction)},GameObjectFactory$B.remove=function(factoryType){GameObjectFactory$B.prototype.hasOwnProperty(factoryType)&&delete GameObjectFactory$B.prototype[factoryType]},PluginCache$f.register("GameObjectFactory",GameObjectFactory$B,"add");var GameObjectFactory_1=GameObjectFactory$B,Curve$4=Curve_1$1,FromPoints=FromPoints_1,Rectangle$o=Rectangle_1$1,Vector2$E=Vector2_1,LineCurve$1=new Class_1({Extends:Curve$4,initialize:function(p0,p1){Curve$4.call(this,"LineCurve"),Array.isArray(p0)&&(p1=new Vector2$E(p0[2],p0[3]),p0=new Vector2$E(p0[0],p0[1])),this.p0=p0,this.p1=p1,this.arcLengthDivisions=1},getBounds:function(out){return void 0===out&&(out=new Rectangle$o),FromPoints([this.p0,this.p1],out)},getStartPoint:function(out){return void 0===out&&(out=new Vector2$E),out.copy(this.p0)},getResolution:function(divisions){return void 0===divisions&&(divisions=1),divisions},getPoint:function(t,out){return void 0===out&&(out=new Vector2$E),1===t?out.copy(this.p1):(out.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),out)},getPointAt:function(u,out){return this.getPoint(u,out)},getTangent:function(t,out){return void 0===out&&(out=new Vector2$E),out.copy(this.p1).subtract(this.p0).normalize(),out},getUtoTmapping:function(u,distance,divisions){var t;if(distance){var arcLengths=this.getLengths(divisions),lineLength=arcLengths[arcLengths.length-1];t=Math.min(distance,lineLength)/lineLength}else t=u;return t},draw:function(graphics){return graphics.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),graphics},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});
145/**
146	 * @author       Richard Davey <[email protected]>
147	 * @copyright    2020 Photon Storm Ltd.
148	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
149	 */LineCurve$1.fromJSON=function(data){var points=data.points,p0=new Vector2$E(points[0],points[1]),p1=new Vector2$E(points[2],points[3]);return new LineCurve$1(p0,p1)};var LineCurve_1=LineCurve$1,Vector2$D=Vector2_1,MoveTo_1$1=new Class_1({initialize:function(x,y){this.active=!1,this.p0=new Vector2$D(x,y)},getPoint:function(t,out){return void 0===out&&(out=new Vector2$D),out.copy(this.p0)},getPointAt:function(u,out){return this.getPoint(u,out)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}}),Curve$3=Curve_1$1,QuadraticBezierInterpolation=QuadraticBezierInterpolation_1,Vector2$C=Vector2_1,QuadraticBezier=new Class_1({Extends:Curve$3,initialize:function(p0,p1,p2){Curve$3.call(this,"QuadraticBezier"),Array.isArray(p0)&&(p2=new Vector2$C(p0[4],p0[5]),p1=new Vector2$C(p0[2],p0[3]),p0=new Vector2$C(p0[0],p0[1])),this.p0=p0,this.p1=p1,this.p2=p2},getStartPoint:function(out){return void 0===out&&(out=new Vector2$C),out.copy(this.p0)},getResolution:function(divisions){return divisions},getPoint:function(t,out){void 0===out&&(out=new Vector2$C);var p0=this.p0,p1=this.p1,p2=this.p2;return out.set(QuadraticBezierInterpolation(t,p0.x,p1.x,p2.x),QuadraticBezierInterpolation(t,p0.y,p1.y,p2.y))},draw:function(graphics,pointsTotal){void 0===pointsTotal&&(pointsTotal=32);var points=this.getPoints(pointsTotal);graphics.beginPath(),graphics.moveTo(this.p0.x,this.p0.y);for(var i=1;i<points.length;i++)graphics.lineTo(points[i].x,points[i].y);return graphics.strokePath(),graphics},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});
150/**
151	 * @author       Richard Davey <[email protected]>
152	 * @copyright    2020 Photon Storm Ltd.
153	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
154	 */QuadraticBezier.fromJSON=function(data){var points=data.points,p0=new Vector2$C(points[0],points[1]),p1=new Vector2$C(points[2],points[3]),p2=new Vector2$C(points[4],points[5]);return new QuadraticBezier(p0,p1,p2)};var QuadraticBezierCurve$1=QuadraticBezier,CatmullRom=CatmullRom_1,Curve$2=Curve_1$1,Vector2$B=Vector2_1,SplineCurve$1=new Class_1({Extends:Curve$2,initialize:function(points){void 0===points&&(points=[]),Curve$2.call(this,"SplineCurve"),this.points=[],this.addPoints(points)},addPoints:function(points){for(var i=0;i<points.length;i++){var p=new Vector2$B;"number"==typeof points[i]?(p.x=points[i],p.y=points[i+1],i++):Array.isArray(points[i])?(p.x=points[i][0],p.y=points[i][1]):(p.x=points[i].x,p.y=points[i].y),this.points.push(p)}return this},addPoint:function(x,y){var vec=new Vector2$B(x,y);return this.points.push(vec),vec},getStartPoint:function(out){return void 0===out&&(out=new Vector2$B),out.copy(this.points[0])},getResolution:function(divisions){return divisions*this.points.length},getPoint:function(t,out){void 0===out&&(out=new Vector2$B);var points=this.points,point=(points.length-1)*t,intPoint=Math.floor(point),weight=point-intPoint,p0=points[0===intPoint?intPoint:intPoint-1],p1=points[intPoint],p2=points[intPoint>points.length-2?points.length-1:intPoint+1],p3=points[intPoint>points.length-3?points.length-1:intPoint+2];return out.set(CatmullRom(weight,p0.x,p1.x,p2.x,p3.x),CatmullRom(weight,p0.y,p1.y,p2.y,p3.y))},toJSON:function(){for(var points=[],i=0;i<this.points.length;i++)points.push(this.points[i].x),points.push(this.points[i].y);return{type:this.type,points:points}}});
155/**
156	 * @author       Richard Davey <[email protected]>
157	 * @copyright    2020 Photon Storm Ltd.
158	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
159	 */SplineCurve$1.fromJSON=function(data){return new SplineCurve$1(data.points)};var SplineCurve_1=SplineCurve$1,CubicBezierCurve=CubicBezierCurve_1,EllipseCurve=EllipseCurve_1,GameObjectFactory$A=GameObjectFactory_1,LineCurve=LineCurve_1,MovePathTo=MoveTo_1$1,QuadraticBezierCurve=QuadraticBezierCurve$1,Rectangle$n=Rectangle_1$1,SplineCurve=SplineCurve_1,Vector2$A=Vector2_1,MATH_CONST$d=_const$b,Path$1=new Class_1({initialize:function(x,y){void 0===x&&(x=0),void 0===y&&(y=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new Vector2$A,this._tmpVec2A=new Vector2$A,this._tmpVec2B=new Vector2$A,"object"==typeof x?this.fromJSON(x):this.startPoint.set(x,y)},add:function(curve){return this.curves.push(curve),this},circleTo:function(radius,clockwise,rotation){return void 0===clockwise&&(clockwise=!1),this.ellipseTo(radius,radius,0,360,clockwise,rotation)},closePath:function(){var startPoint=this.curves[0].getPoint(0),endPoint=this.curves[this.curves.length-1].getPoint(1);return startPoint.equals(endPoint)||this.curves.push(new LineCurve(endPoint,startPoint)),this},cubicBezierTo:function(x,y,control1X,control1Y,control2X,control2Y){var p1,p2,p3,p0=this.getEndPoint();return x instanceof Vector2$A?(p1=x,p2=y,p3=control1X):(p1=new Vector2$A(control1X,control1Y),p2=new Vector2$A(control2X,control2Y),p3=new Vector2$A(x,y)),this.add(new CubicBezierCurve(p0,p1,p2,p3))},quadraticBezierTo:function(x,y,controlX,controlY){var p1,p2,p0=this.getEndPoint();return x instanceof Vector2$A?(p1=x,p2=y):(p1=new Vector2$A(controlX,controlY),p2=new Vector2$A(x,y)),this.add(new QuadraticBezierCurve(p0,p1,p2))},draw:function(graphics,pointsTotal){for(var i=0;i<this.curves.length;i++){var curve=this.curves[i];curve.active&&curve.draw(graphics,pointsTotal)}return graphics},ellipseTo:function(xRadius,yRadius,startAngle,endAngle,clockwise,rotation){var ellipse=new EllipseCurve(0,0,xRadius,yRadius,startAngle,endAngle,clockwise,rotation),end=this.getEndPoint(this._tmpVec2A),start=ellipse.getStartPoint(this._tmpVec2B);return end.subtract(start),ellipse.x=end.x,ellipse.y=end.y,this.add(ellipse)},fromJSON:function(data){this.curves=[],this.cacheLengths=[],this.startPoint.set(data.x,data.y),this.autoClose=data.autoClose;for(var i=0;i<data.curves.length;i++){var curve=data.curves[i];switch(curve.type){case"LineCurve":this.add(LineCurve.fromJSON(curve));break;case"EllipseCurve":this.add(EllipseCurve.fromJSON(curve));break;case"SplineCurve":this.add(SplineCurve.fromJSON(curve));break;case"CubicBezierCurve":this.add(CubicBezierCurve.fromJSON(curve));break;case"QuadraticBezierCurve":this.add(QuadraticBezierCurve.fromJSON(curve))}}return this},getBounds:function(out,accuracy){void 0===out&&(out=new Rectangle$n),void 0===accuracy&&(accuracy=16),out.x=Number.MAX_VALUE,out.y=Number.MAX_VALUE;for(var bounds=new Rectangle$n,maxRight=MATH_CONST$d.MIN_SAFE_INTEGER,maxBottom=MATH_CONST$d.MIN_SAFE_INTEGER,i=0;i<this.curves.length;i++){var curve=this.curves[i];curve.active&&(curve.getBounds(bounds,accuracy),out.x=Math.min(out.x,bounds.x),out.y=Math.min(out.y,bounds.y),maxRight=Math.max(maxRight,bounds.right),maxBottom=Math.max(maxBottom,bounds.bottom))}return out.right=maxRight,out.bottom=maxBottom,out},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var lengths=[],sums=0,i=0;i<this.curves.length;i++)sums+=this.curves[i].getLength(),lengths.push(sums);return this.cacheLengths=lengths,lengths},getEndPoint:function(out){return void 0===out&&(out=new Vector2$A),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,out):out.copy(this.startPoint),out},getLength:function(){var lens=this.getCurveLengths();return lens[lens.length-1]},getPoint:function(t,out){void 0===out&&(out=new Vector2$A);for(var d=t*this.getLength(),curveLengths=this.getCurveLengths(),i=0;i<curveLengths.length;){if(curveLengths[i]>=d){var diff=curveLengths[i]-d,curve=this.curves[i],segmentLength=curve.getLength(),u=0===segmentLength?0:1-diff/segmentLength;return curve.getPointAt(u,out)}i++}return null},getPoints:function(divisions){void 0===divisions&&(divisions=12);for(var last,points=[],i=0;i<this.curves.length;i++){var curve=this.curves[i];if(curve.active)for(var resolution=curve.getResolution(divisions),pts=curve.getPoints(resolution),j=0;j<pts.length;j++){var point=pts[j];last&&last.equals(point)||(points.push(point),last=point)}}return this.autoClose&&points.length>1&&!points[points.length-1].equals(points[0])&&points.push(points[0]),points},getRandomPoint:function(out){return void 0===out&&(out=new Vector2$A),this.getPoint(Math.random(),out)},getSpacedPoints:function(divisions){void 0===divisions&&(divisions=40);for(var points=[],i=0;i<=divisions;i++)points.push(this.getPoint(i/divisions));return this.autoClose&&points.push(points[0]),points},getStartPoint:function(out){return void 0===out&&(out=new Vector2$A),out.copy(this.startPoint)},getTangent:function(t,out){void 0===out&&(out=new Vector2$A);for(var d=t*this.getLength(),curveLengths=this.getCurveLengths(),i=0;i<curveLengths.length;){if(curveLengths[i]>=d){var diff=curveLengths[i]-d,curve=this.curves[i],segmentLength=curve.getLength(),u=0===segmentLength?0:1-diff/segmentLength;return curve.getTangentAt(u,out)}i++}return null},lineTo:function(x,y){x instanceof Vector2$A?this._tmpVec2B.copy(x):this._tmpVec2B.set(x,y);var end=this.getEndPoint(this._tmpVec2A);return this.add(new LineCurve([end.x,end.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(points){return points.unshift(this.getEndPoint()),this.add(new SplineCurve(points))},moveTo:function(x,y){return x instanceof Vector2$A?this.add(new MovePathTo(x.x,x.y)):this.add(new MovePathTo(x,y))},toJSON:function(){for(var out=[],i=0;i<this.curves.length;i++)out.push(this.curves[i].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:out}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});
160/**
161	 * @author       Richard Davey <[email protected]>
162	 * @copyright    2020 Photon Storm Ltd.
163	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
164	 */GameObjectFactory$A.register("path",(function(x,y){return new Path$1(x,y)}));var curves={Path:Path$1,MoveTo:MoveTo_1$1,CubicBezier:CubicBezierCurve_1,Curve:Curve_1$1,Ellipse:EllipseCurve_1,Line:LineCurve_1,QuadraticBezier:QuadraticBezierCurve$1,Spline:SplineCurve_1}
164,DataManager$2=DataManager_1,PluginCache$e=PluginCache_1,SceneEvents$d=events$g,DataManagerPlugin=new Class_1({Extends:DataManager$2,initialize:function(scene){DataManager$2.call(this,scene,scene.sys.events),this.scene=scene,this.systems=scene.sys,scene.sys.events.once(SceneEvents$d.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$d.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(SceneEvents$d.DESTROY,this.destroy,this)},start:function(){this.events.once(SceneEvents$d.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(SceneEvents$d.SHUTDOWN,this.shutdown,this)},destroy:function(){DataManager$2.prototype.destroy.call(this),this.events.off(SceneEvents$d.START,this.start,this),this.scene=null,this.systems=null}});
165/**
166	 * @author       Richard Davey <[email protected]>
167	 * @copyright    2020 Photon Storm Ltd.
168	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
169	 */PluginCache$e.register("DataManagerPlugin",DataManagerPlugin,"data");var data={DataManager:DataManager_1,DataManagerPlugin:DataManagerPlugin,Events:events$i},Align={In:{BottomCenter:BottomCenter_1,BottomLeft:BottomLeft_1,BottomRight:BottomRight_1,Center:Center_1,LeftCenter:LeftCenter_1,QuickSet:QuickSet_1,RightCenter:RightCenter_1,TopCenter:TopCenter_1,TopLeft:TopLeft_1,TopRight:TopRight_1},To:{BottomCenter:BottomCenter_1$1,BottomLeft:BottomLeft_1$1,BottomRight:BottomRight_1$1,LeftBottom:LeftBottom_1,LeftCenter:LeftCenter_1$1,LeftTop:LeftTop_1,QuickSet:QuickSet_1$1,RightBottom:RightBottom_1,RightCenter:RightCenter_1$1,RightTop:RightTop_1,TopCenter:TopCenter_1$1,TopLeft:TopLeft_1$1,TopRight:TopRight_1$1}},align=Align=Extend_1$1(!1,Align,_const$d),BaseShader=new Class_1({initialize:function(key,fragmentSrc,vertexSrc,uniforms){fragmentSrc&&""!==fragmentSrc||(fragmentSrc=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {","    vec2 uv = fragCoord / resolution.xy;","    gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),vertexSrc&&""!==vertexSrc||(vertexSrc=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {","   gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);","   fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);","   outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===uniforms&&(uniforms=null),this.key=key,this.fragmentSrc=fragmentSrc,this.vertexSrc=vertexSrc,this.uniforms=uniforms}}),BaseShader_1=BaseShader,GetBottom=GetBottom_1,GetLeft=GetLeft_1,GetRight=GetRight_1,GetTop=GetTop_1,bounds$1={CenterOn:CenterOn_1$3,GetBottom:GetBottom_1,GetBounds:function(gameObject,output){void 0===output&&(output={});var left=GetLeft(gameObject),top=GetTop(gameObject);return output.x=left,output.y=top,output.width=GetRight(gameObject)-left,output.height=GetBottom(gameObject)-top,output},GetCenterX:GetCenterX_1,GetCenterY:GetCenterY_1,GetLeft:GetLeft_1,GetOffsetX:function(gameObject){return gameObject.width*gameObject.originX},GetOffsetY:function(gameObject){return gameObject.height*gameObject.originY},GetRight:GetRight_1,GetTop:GetTop_1,SetBottom:SetBottom_1,SetCenterX:SetCenterX_1,SetCenterY:SetCenterY_1,SetLeft:SetLeft_1,SetRight:SetRight_1,SetTop:SetTop_1},TouchAction_1=function(canvas,value){return void 0===value&&(value="none"),canvas.style.msTouchAction=value,canvas.style["ms-touch-action"]=value,canvas.style["touch-action"]=value,canvas},UserSelect_1=function(canvas,value){void 0===value&&(value="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(vendor){canvas.style[vendor+"user-select"]=value})),canvas.style["-webkit-touch-callout"]=value,canvas.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",canvas},canvas$1={CanvasInterpolation:CanvasInterpolation_1,CanvasPool:CanvasPool_1,Smoothing:Smoothing_1,TouchAction:TouchAction_1,UserSelect:UserSelect_1},GetColor$1=GetColor_1,ColorSpectrum_1=function(limit){void 0===limit&&(limit=1024);var i,colors=[],r=255,g=0,b=0;for(i=0;i<=255;i++)colors.push({r:r,g:i,b:b,color:GetColor$1(r,i,b)});for(g=255,i=255;i>=0;i--)colors.push({r:i,g:g,b:b,color:GetColor$1(i,g,b)});for(r=0,i=0;i<=255;i++,g--)colors.push({r:r,g:g,b:i,color:GetColor$1(r,g,i)});for(g=0,b=255,i=0;i<=255;i++,b--,r++)colors.push({r:r,g:g,b:b,color:GetColor$1(r,g,b)});if(1024===limit)return colors;var out=[],t=0,inc=1024/limit;for(i=0;i<limit;i++)out.push(colors[Math.floor(t)]),t+=inc;return out},ColorToRGBA_1=function(color){var output={r:color>>16&255,g:color>>8&255,b:255&color,a:255};return color>16777215&&(output.a=color>>>24),output},ComponentToHex_1=function(color){var hex=color.toString(16);return 1===hex.length?"0"+hex:hex},HueToComponent_1=function(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p},Color$5=Color_1,HueToComponent=HueToComponent_1,HSLToColor_1=function(h,s,l){var r=l,g=l,b=l;if(0!==s){var q=l<.5?l*(1+s):l+s-l*s,p=2*l-q;r=HueToComponent(p,q,h+1/3),g=HueToComponent(p,q,h),b=HueToComponent(p,q,h-1/3)}return(new Color$5).setGLTo(r,g,b,1)},HSVToRGB=HSVToRGB_1,HSVColorWheel_1=function(s,v){void 0===s&&(s=1),void 0===v&&(v=1);for(var colors=[],c=0;c<=359;c++)colors.push(HSVToRGB(c/359,s,v));return colors},Linear=Linear_1,RGBWithRGB=function(r1,g1,b1,r2,g2,b2,length,index){void 0===length&&(length=100),void 0===index&&(index=0);var t=index/length;return{r:Linear(r1,r2,t),g:Linear(g1,g2,t),b:Linear(b1,b2,t)}},Interpolate$1={RGBWithRGB:RGBWithRGB,ColorWithRGB:function(color,r,g,b,length,index){return void 0===length&&(length=100),void 0===index&&(index=0),RGBWithRGB(color.r,color.g,color.b,r,g,b,length,index)},ColorWithColor:function(color1,color2,length,index){return void 0===length&&(length=100),void 0===index&&(index=0),RGBWithRGB(color1.r,color1.g,color1.b,color2.r,color2.g,color2.b,length,index)}},Between$1=Between_1,Color$4=Color_1,RandomRGB_1=function(min,max){return void 0===min&&(min=0),void 0===max&&(max=255),new Color$4(Between$1(min,max),Between$1(min,max),Between$1(min,max))},ComponentToHex=ComponentToHex_1,RGBToString_1=function(r,g,b,a,prefix){return void 0===a&&(a=255),void 0===prefix&&(prefix="#"),"#"===prefix?"#"+((1<<24)+(r<<16)+(g<<8)+b).toString(16).slice(1,7):"0x"+ComponentToHex(a)+ComponentToHex(r)+ComponentToHex(g)+ComponentToHex(b)},Color$3=Color_1;
170/**
171	 * @author       Richard Davey <[email protected]>
172	 * @copyright    2020 Photon Storm Ltd.
173	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
174	 */Color$3.ColorSpectrum=ColorSpectrum_1,Color$3.ColorToRGBA=ColorToRGBA_1,Color$3.ComponentToHex=ComponentToHex_1,Color$3.GetColor=GetColor_1,Color$3.GetColor32=GetColor32_
1741,Color$3.HexStringToColor=HexStringToColor_1,Color$3.HSLToColor=HSLToColor_1,Color$3.HSVColorWheel=HSVColorWheel_1,Color$3.HSVToRGB=HSVToRGB_1,Color$3.HueToComponent=HueToComponent_1,Color$3.IntegerToColor=IntegerToColor_1,Color$3.IntegerToRGB=IntegerToRGB_1,Color$3.Interpolate=Interpolate$1,Color$3.ObjectToColor=ObjectToColor_1,Color$3.RandomRGB=RandomRGB_1,Color$3.RGBStringToColor=RGBStringToColor_1,Color$3.RGBToHSV=RGBToHSV_1,Color$3.RGBToString=RGBToString_1,Color$3.ValueToColor=ValueToColor_1;var color=Color$3,mask={BitmapMask:BitmapMask_1,GeometryMask:GeometryMask_1},NOOP$j=NOOP_1,RGB_1=new Class_1({initialize:function(red,green,blue){this._rgb=[0,0,0],this.onChangeCallback=NOOP$j,this.dirty=!1,this.set(red,green,blue)},set:function(red,green,blue){return void 0===red&&(red=0),void 0===green&&(green=0),void 0===blue&&(blue=0),this._rgb=[red,green,blue],this.onChange(),this},equals:function(red,green,blue){var rgb=this._rgb;return rgb.r===red&&rgb.g===green&&rgb.b===blue},onChange:function(){this.dirty=!0;var rgb=this._rgb;this.onChangeCallback.call(this,rgb[0],rgb[1],rgb[2])},r:{get:function(){return this._rgb[0]},set:function(value){this._rgb[0]=value,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(value){this._rgb[1]=value,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(value){this._rgb[2]=value,this.onChange()}},destroy:function(){this.onChangeCallback=null}}),display={Align:align,BaseShader:BaseShader_1,Bounds:bounds$1,Canvas:canvas$1,Color:color,ColorMatrix:ColorMatrix_1,Masks:mask,RGB:RGB_1},AddToDOM_1=function(element,parent){var target;if(parent)"string"==typeof parent?target=document.getElementById(parent):"object"==typeof parent&&1===parent.nodeType&&(target=parent);else if(element.parentElement||null===parent)return element;return target||(target=document.body),target.appendChild(element),element},OS$1=OS_1,DOMContentLoaded_1=function(callback){if("complete"!==document.readyState&&"interactive"!==document.readyState){var check=function(){document.removeEventListener("deviceready",check,!0),document.removeEventListener("DOMContentLoaded",check,!0),window.removeEventListener("load",check,!0),callback()};document.body?OS$1.cordova?document.addEventListener("deviceready",check,!1):(document.addEventListener("DOMContentLoaded",check,!0),window.addEventListener("load",check,!0)):window.setTimeout(check,20)}else callback()},GetInnerHeight_1=function(iOS){if(!iOS)return window.innerHeight;var axis=Math.abs(window.orientation),size={w:0,h:0},ruler=document.createElement("div");return ruler.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(ruler),size.w=90===axis?ruler.offsetHeight:window.innerWidth,size.h=90===axis?window.innerWidth:ruler.offsetHeight,document.documentElement.removeChild(ruler),ruler=null,90!==Math.abs(window.orientation)?size.h:size.w},CENTER_CONST={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3},ORIENTATION_CONST$1={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"},SCALE_MODE_CONST={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5},ZOOM_CONST={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1},_const$7={CENTER:CENTER_CONST,ORIENTATION:ORIENTATION_CONST$1,SCALE_MODE:SCALE_MODE_CONST,ZOOM:ZOOM_CONST},CONST$11=_const$7,GetScreenOrientation_1=function(width,height){var screen=window.screen,orientation=!!screen&&(screen.orientation||screen.mozOrientation||screen.msOrientation);return orientation&&"string"==typeof orientation.type?orientation.type:"string"==typeof orientation?orientation:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?CONST$11.ORIENTATION.PORTRAIT:CONST$11.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?CONST$11.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?CONST$11.ORIENTATION.LANDSCAPE:void 0:height>width?CONST$11.ORIENTATION.PORTRAIT:CONST$11.ORIENTATION.LANDSCAPE},GetTarget_1=function(element){var target;return""!==element&&("string"==typeof element?target=document.getElementById(element):element&&1===element.nodeType&&(target=element)),target||(target=document.body),target},ParseXML_1=function(data){var xml="";try{if(window.DOMParser)xml=(new DOMParser).parseFromString(data,"text/xml");else(xml=new ActiveXObject("Microsoft.XMLDOM")).loadXML(data)}catch(e){xml=null}return xml&&xml.documentElement&&!xml.getElementsByTagName("parsererror").length?xml:null},RemoveFromDOM_1=function(element){element.parentNode&&element.parentNode.removeChild(element)},dom={AddToDOM:AddToDOM_1,DOMContentLoaded:DOMContentLoaded_1,GetInnerHeight:GetInnerHeight_1,GetScreenOrientation:GetScreenOrientation_1,GetTarget:GetTarget_1,ParseXML:ParseXML_1,RemoveFromDOM:RemoveFromDOM_1,RequestAnimationFrame:RequestAnimationFrame_1}
vendor: 16,384 bytes, lines 174-179
174,EE=eventemitter3.exports,PluginCache$d=PluginCache_1,EventEmitter$n=new Class_1({Extends:EE,initialize:function(){EE.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});
175/**
176	 * @author       Richard Davey <[email protected]>
177	 * @copyright    2020 Photon Storm Ltd.
178	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
179	 */PluginCache$d.register("EventEmitter",EventEmitter$n,"events");var events$9={EventEmitter:EventEmitter$n},AddToDOM$2=AddToDOM_1,CreateDOMContainer_1=function(game){var config=game.config;if(config.parent&&config.domCreateContainer){var div=document.createElement("div");div.style.cssText=["display: block;","width: "+game.scale.width+"px;","height: "+game.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+config.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),game.domContainer=div,AddToDOM$2(div,config.parent)}},_const$6={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8},events$8={BOOT:"boot",DESTROY:"destroy",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG:"drag",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DRAG_START:"dragstart",DROP:"drop",GAME_OUT:"gameout",GAME_OVER:"gameover",GAMEOBJECT_DOWN:"gameobjectdown",GAMEOBJECT_DRAG_END:"dragend",GAMEOBJECT_DRAG_ENTER:"dragenter",GAMEOBJECT_DRAG:"drag",GAMEOBJECT_DRAG_LEAVE:"dragleave",GAMEOBJECT_DRAG_OVER:"dragover",GAMEOBJECT_DRAG_START:"dragstart",GAMEOBJECT_DROP:"drop",GAMEOBJECT_MOVE:"gameobjectmove",GAMEOBJECT_OUT:"gameobjectout",GAMEOBJECT_OVER:"gameobjectover",GAMEOBJECT_POINTER_DOWN:"pointerdown",GAMEOBJECT_POINTER_MOVE:"pointermove",GAMEOBJECT_POINTER_OUT:"pointerout",GAMEOBJECT_POINTER_OVER:"pointerover",GAMEOBJECT_POINTER_UP:"pointerup",GAMEOBJECT_POINTER_WHEEL:"wheel",GAMEOBJECT_UP:"gameobjectup",GAMEOBJECT_WHEEL:"gameobjectwheel",MANAGER_BOOT:"boot",MANAGER_PROCESS:"process",MANAGER_UPDATE:"update",POINTER_DOWN:"pointerdown",POINTER_DOWN_OUTSIDE:"pointerdownoutside",POINTER_MOVE:"pointermove",POINTER_OUT:"pointerout",POINTER_OVER:"pointerover",POINTER_UP:"pointerup",POINTER_UP_OUTSIDE:"pointerupoutside",POINTER_WHEEL:"wheel",POINTERLOCK_CHANGE:"pointerlockchange",PRE_UPDATE:"preupdate",SHUTDOWN:"shutdown",START:"start",UPDATE:"update"},KeyCodes_1={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175},ArrayRemove$1=Remove_1,GameEvents$b=events$k,InputEvents$6=events$8,KeyCodes$2=KeyCodes_1,NOOP$i=NOOP_1,KeyboardManager=new Class_1({initialize:function(inputManager){this.manager=inputManager,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=NOOP$i,this.onKeyUp=NOOP$i,inputManager.events.once(InputEvents$6.MANAGER_BOOT,this.boot,this)},boot:function(){var config=this.manager.config;this.enabled=config.inputKeyboard,this.target=config.inputKeyboardEventTarget,this.addCapture(config.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(GameEvents$b.POST_STEP,this.postUpdate,this)},startListeners:function(){var _this=this;this.onKeyDown=function(event){if(!event.defaultPrevented&&_this.enabled&&_this.manager){_this.queue.push(event),_this.manager.events.emit(InputEvents$6.MANAGER_PROCESS);var modified=event.altKey||event.ctrlKey||event.shiftKey||event.metaKey;_this.preventDefault&&!modified&&_this.captures.indexOf(event.keyCode)>-1&&event.preventDefault()}},this.onKeyUp=function(event){if(!event.defaultPrevented&&_this.enabled&&_this.manager){_this.queue.push(event),_this.manager.events.emit(InputEvents$6.MANAGER_PROCESS);var modified=event.altKey||event.ctrlKey||event.shiftKey||event.metaKey;_this.preventDefault&&!modified&&_this.captures.indexOf(event.keyCode)>-1&&event.preventDefault()}};var target=this.target;target&&(target.addEventListener("keydown",this.onKeyDown,!1),target.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var target=this.target;target.removeEventListener("keydown",this.onKeyDown,!1),target.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(keycode){"string"==typeof keycode&&(keycode=keycode.split(",")),Array.isArray(keycode)||(keycode=[keycode]);for(var captures=this.captures,i=0;i<keycode.length;i++){var code=keycode[i];"string"==typeof code&&(code=KeyCodes$2[code.trim().toUpperCase()]),-1===captures.indexOf(code)&&captures.push(code)}this.preventDefault=captures.length>0},removeCapture:function(keycode){"string"==typeof keycode&&(keycode=keycode.split(",")),Array.isArray(keycode)||(keycode=[keycode]);for(var captures=this.captures,i=0;i<keycode.length;i++){var code=keycode[i];"string"==typeof code&&(code=KeyCodes$2[code.toUpperCase()]),ArrayRemove$1(captures,code)}this.preventDefault=captures.length>0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(GameEvents$b.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}}),KeyboardManager_1=KeyboardManager,Features=Features_1,InputEvents$5=events$8,NOOP$h=NOOP_1,MouseManager=new Class_1({initialize:function(inputManager){this.manager=inputManager,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=NOOP$h,this.onMouseDown=NOOP$h,this.onMouseUp=NOOP$h,this.onMouseDownWindow=NOOP$h,this.onMouseUpWindow=NOOP$h,this.onMouseOver=NOOP$h,this.onMouseOut=NOOP$h,this.onMouseWheel=NOOP$h,this.pointerLockChange=NOOP$h,this.isTop=!0,inputManager.events.once(InputEvents$5.MANAGER_BOOT,this.boot,this)},boot:function(){var config=this.manager.config;this.enabled=config.inputMouse,this.target=config.inputMouseEventTarget,this.passive=config.inputMousePassive,this.preventDefaultDown=config.inputMousePreventDefaultDown,this.preventDefaultUp=config.inputMousePreventDefaultUp,this.preventDefaultMove=config.inputMousePreventDefaultMove,this.preventDefaultWheel=config.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,config.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(event){return event.preventDefault(),!1})),this},requestPointerLock:function(){if(Features.pointerLock){var element=this.target;element.requestPointerLock=element.requestPointerLock||element.mozRequestPointerLock||element.webkitRequestPointerLock,element.requestPointerLock()}},releasePointerLock:function(){Features.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var target=this.target;if(target){var _this=this,manager=this.manager,canvas=manager.canvas,autoFocus=window&&window.focus&&manager.game.config.autoFocus;this.onMouseMove=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&(manager.onMouseMove(event),_this.preventDefaultMove&&event.preventDefault())},this.onMouseDown=function(event){autoFocus&&window.focus(),!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&(manager.onMouseDown(event),_this.preventDefaultDown&&event.target===canvas&&event.preventDefault())},this.onMouseDownWindow=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&event.target!==canvas&&manager.onMouseDown(event)},this.onMouseUp=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&(manager.onMouseUp(event),_this.preventDefaultUp&&event.target===canvas&&event.preventDefault())},this.onMouseUpWindow=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&event.target!==canvas&&manager.onMouseUp(event)},this.onMouseOver=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&manager.setCanvasOver(event)},this.onMouseOut=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&manager.setCanvasOut(event)},this.onMouseWheel=function(event){!event.defaultPrevented&&_this.enabled&&manager&&manager.enabled&&manager.onMouseWheel(event),_this.preventDefaultWheel&&event.target===canvas&&event.preventDefault()};var passive={passive:!0};if(target.addEventListener("mousemove",this.onMouseMove),target.addEventListener("mousedown",this.onMouseDown),target.addEventListener("mouseup",this.onMouseUp),target.addEventListener("mouseover",this.onMouseOver,passive),target.addEventListener("mouseout",this.onMouseOut,passive),this.preventDefaultWheel?target.addEventListener("wheel",this.onMouseWheel,{passive:!1}):target.addEventListener("wheel",this.onMouseWheel,passive),window&&manager.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,passive),window.top.addEventListener("mouseup",this.onMouseUpWindow,passive)}catch(exception){window.addEventListener("mousedown",this.onMouseDownWindow,passive),window.addEventListener("mouseup",this.onMouseUpWindow,passive),this.isTop=!1}Features.pointerLock&&(this.pointerLockChange=function(event){var element=_this.target;_this.locked=document.pointerLockElement===element||document.mozPointerLockElement===element||document.webkitPointerLockElement===element,manager.onPointerLockChange(event)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var target=this.target;target.removeEventListener("mousemove",this.onMouseMove),target.removeEventListener("mousedown",this.onMouseDown),target.removeEventListener("mouseup",this.onMouseUp),target.removeEventListener("mouseover",this.onMouseOver),target.removeEventListener("mouseout",this.onMouseOut),window&&((target=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),target.removeEventListener("mouseup",this.onMouseUpWindow)),Features.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}}),MouseManager_1=MouseManager,Angle$6=Between_1$1,Distance=DistanceBetween_1,FuzzyEqual$1=Equal_1,SmoothStepInterpolation=SmoothStepInterpolation_1,Vector2$z=Vector2_1,OS=OS_1,Pointer$1=new Class_1({initialize:function(manager,id){this.manager=manager,this.id=id,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new Vector2$z,this.prevPosition=new Vector2$z,this.midPoint=new Vector2$z(-1,-1),this.velocity=new Vector2$z,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===id,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(camera){var temp=camera.getWorldPoint(this.x,this.y);return this.worldX=temp.x,this.worldY=temp.y,this},positionToCamera:function(camera,output){return camera.getWorldPoint(this.x,this.y,output)},updateMotion:function(){var cx=this.position.x,cy=this.position.y,mx=this.midPoint.x,my=this.midPoint.y;if(cx!==mx||cy!==my){var vx=SmoothStepInterpolation(this.motionFactor,mx,cx),vy=SmoothStepInterpolation(this.motionFactor,my,cy);FuzzyEqual$1(vx,cx,.1)&&(vx=cx),FuzzyEqual$1(vy,cy,.1)&&(vy=cy),this.midPoint.set(vx,vy);var dx=cx-vx,dy=cy-vy;this.velocity.set(dx,dy),this.angle=Angle$6(vx,vy,cx,cy),this.distance=Math.sqrt(dx*dx+dy*dy)}},up:function(event){"buttons"in event&&(this.buttons=event.buttons),this.event=event,this.button=event.button,this.upElement=event.target,this.manager.transformPointer(this,event.pageX,event.pageY,!1),0===event.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=event.timeStamp,this.wasTouch=!1)},down:function(event){"buttons"in event&&(this.buttons=event.buttons),this.event=event,this.button=event.button,this.downElement=event.target,this.manager.transformPointer(this,event.pageX,event.pageY,!1),0===event.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),OS.macOS&&event.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=event.timeStamp),this.wasTouch=!1},move:function(event){"buttons"in event&&(this.buttons=event.buttons),this.event=event,this.manager.transformPointer(this,event.pageX,event.pageY,!0),this.locked&&(this.movementX=event.movementX||event.mozMovementX||event.webkitMovementX||0,this.movementY=event.movementY||event.mozMovementY||event.webkitMovementY||0),this.moveTime=event.timeStamp,this.wasTouch=!1},wheel:function(event){"buttons"in event&&(this.buttons=event.buttons),this.event=event,this.manager.transformPointer(this,event.pageX,event.pageY,!1),this.deltaX=event.deltaX,this.deltaY=event.deltaY,this.deltaZ=event.deltaZ,this.wasTouch=!1},touchstart:function(touch,event){touch.pointerId&&(this.pointerId=touch.pointerId),this.identifier=touch.identifier,this.target=touch.target,this.active=!0,this.buttons=1,this.event=event,this.downElement=touch.target,this.manager.transformPointer(this,touch.pageX,touch.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=event.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(touch,event){this.event=event,this.manager.transformPointer(this,touch.pageX,touch.pageY,!0),this.moveTime=event.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(touch,event){this.buttons=0,this.event=event,this.upElement=touch.target,this.manager.transformPointer(this,touch.pageX,touch.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=event.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(touch,event){this.buttons=0,this.event=event,this.upElement=touch.target,this.manager.transformPointer(this,touch.pageX,touch.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=event.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backB
179uttonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?Distance(this.downX,this.downY,this.x,this.y):Distance(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?Angle$6(this.downX,this.downY,this.x,this.y):Angle$6(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(steps,out){void 0===steps&&(steps=10),void 0===out&&(out=[]);for(var prevX=this.prevPosition.x,prevY=this.prevPosition.y,curX=this.position.x,curY=this.position.y,i=0;i<steps;i++){var t=1/steps*i;out[i]={x:SmoothStepInterpolation(t,prevX,curX),y:SmoothStepInterpolation(t,prevY,curY)}}return out},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(value){this.position.x=value}},y:{get:function(){return this.position.y},set:function(value){this.position.y=value}},time:{get:function(){return this.event?this.event.timeStamp:0}}}),Pointer_1=Pointer$1,InputEvents$4=events$8,NOOP$g=NOOP_1,TouchManager=new Class_1({initialize:function(inputManager){this.manager=inputManager,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=NOOP$g,this.onTouchStartWindow=NOOP$g,this.onTouchMove=NOOP$g,this.onTouchEnd=NOOP$g,this.onTouchEndWindow=NOOP$g,this.onTouchCancel=NOOP$g,this.onTouchCancelWindow=NOOP$g,this.onTouchOver=NOOP$g,this.onTouchOut=NOOP$g,inputManager.events.once(InputEvents$4.MANAGER_BOOT,this.boot,this)},boot:function(){var config=this.manager.config;this.enabled=config.inputTouch,this.target=config.inputTouchEventTarget,this.capture=config.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),config.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(event){return event.preventDefault(),!1})),this},startListeners:function(){var _this=this,canvas=this.manager.canvas,autoFocus=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(event){autoFocus&&window.focus(),!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&(_this.manager.onTouchStart(event),_this.capture&&event.cancelable&&event.target===canvas&&event.preventDefault())},this.onTouchStartWindow=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&event.target!==canvas&&_this.manager.onTouchStart(event)},this.onTouchMove=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&(_this.manager.onTouchMove(event),_this.capture&&event.cancelable&&event.preventDefault())},this.onTouchEnd=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&(_this.manager.onTouchEnd(event),_this.capture&&event.cancelable&&event.target===canvas&&event.preventDefault())},this.onTouchEndWindow=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&event.target!==canvas&&_this.manager.onTouchEnd(event)},this.onTouchCancel=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&(_this.manager.onTouchCancel(event),_this.capture&&event.preventDefault())},this.onTouchCancelWindow=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&_this.manager.onTouchCancel(event)},this.onTouchOver=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&_this.manager.setCanvasOver(event)},this.onTouchOut=function(event){!event.defaultPrevented&&_this.enabled&&_this.manager&&_this.manager.enabled&&_this.manager.setCanvasOut(event)};var target=this.target;if(target){var passive={passive:!0},nonPassive={passive:!1};target.addEventListener("touchstart",this.onTouchStart,this.capture?nonPassive:passive),target.addEventListener("touchmove",this.onTouchMove,this.capture?nonPassive:passive),target.addEventListener("touchend",this.onTouchEnd,this.capture?nonPassive:passive),target.addEventListener("touchcancel",this.onTouchCancel,this.capture?nonPassive:passive),target.addEventListener("touchover",this.onTouchOver,this.capture?nonPassive:passive),target.addEventListener("touchout",this.onTouchOut,this.capture?nonPassive:passive),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,nonPassive),window.addEventListener("touchend",this.onTouchEndWindow,nonPassive),window.addEventListener("touchcancel",this.onTouchCancelWindow,nonPassive)),this.enabled=!0}},stopListeners:function(){var target=this.target;target.removeEventListener("touchstart",this.onTouchStart),target.removeEventListener("touchmove",this.onTouchMove),target.removeEventListener("touchend",this.onTouchEnd),target.removeEventListener("touchcancel",this.onTouchCancel),target.removeEventListener("touchover",this.onTouchOver),target.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}}),TouchManager_1=TouchManager,CONST$10=_const$6,EventEmitter$m=eventemitter3.exports,Events$A=events$8,GameEvents$a=events$k,Keyboard=KeyboardManager_1,Mouse=MouseManager_1,Pointer=Pointer_1,Touch=TouchManager_1,TransformMatrix$a=TransformMatrix_1,TransformXY=TransformXY_1,InputManager$1=new Class_1({initialize:function(game,config){this.game=game,this.scaleManager,this.canvas,this.config=config,this.enabled=!0,this.events=new EventEmitter$m,this.isOver=!0,this.defaultCursor="",this.keyboard=config.inputKeyboard?new Keyboard(this):null,this.mouse=config.inputMouse?new Mouse(this):null,this.touch=config.inputTouch?new Touch(this):null,this.pointers=[],this.pointersTotal=config.inputActivePointers,config.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var pointer=new Pointer(this,i);pointer.smoothFactor=config.inputSmoothFactor,this.pointers.push(pointer)}this.mousePointer=config.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new TransformMatrix$a,this._tempMatrix2=new TransformMatrix$a,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],game.events.once(GameEvents$a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(Events$A.MANAGER_BOOT),this.game.events.on(GameEvents$a.PRE_RENDER,this.preRender,this),this.game.events.once(GameEvents$a.DESTROY,this.destroy,this)},setCanvasOver:function(event){this.isOver=!0,this.events.emit(Events$A.GAME_OVER,event)},setCanvasOut:function(event){this.isOver=!1,this.events.emit(Events$A.GAME_OUT,event)},preRender:function(){var time=this.game.loop.now,delta=this.game.loop.delta,scenes=this.game.scene.getScenes(!0,!0);this.time=time,this.events.emit(Events$A.MANAGER_UPDATE);for(var i=0;i<scenes.length;i++){var scene=scenes[i];if(scene.sys.input&&scene.sys.input.updatePoll(time,delta)&&this.globalTopOnly)return}},setDefaultCursor:function(cursor){this.defaultCursor=cursor,this.canvas.style.cursor!==cursor&&(this.canvas.style.cursor=cursor)},setCursor:function(interactiveObject){interactiveObject.cursor&&(this.canvas.style.cursor=interactiveObject.cursor)},resetCursor:function(interactiveObject){interactiveObject.cursor&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(quantity){void 0===quantity&&(quantity=1);var output=[];this.pointersTotal+quantity>10&&(quantity=10-this.pointersTotal);for(var i=0;i<quantity;i++){var id=this.pointers.length,pointer=new Pointer(this,id);pointer.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(pointer),this.pointersTotal++,output.push(pointer)}return output},updateInputPlugins:function(type,pointers){var scenes=this.game.scene.getScenes(!0,!0);this._tempSkip=!1;for(var i=0;i<scenes.length;i++){var scene=scenes[i];if(scene.sys.input)if(scene.sys.input.update(type,pointers)&&this.globalTopOnly||this._tempSkip)return}},onTouchStart:function(event){for(var pointers=this.pointers,changed=[],c=0;c<event.changedTouches.length;c++)for(var changedTouch=event.changedTouches[c],i=1;i<this.pointersTotal;i++){var pointer=pointers[i];if(!pointer.active){pointer.touchstart(changedTouch,event),this.activePointer=pointer,changed.push(pointer);break}}this.updateInputPlugins(CONST$10.TOUCH_START,changed)},onTouchMove:function(event){for(var pointers=this.pointers,changed=[],c=0;c<event.changedTouches.length;c++)for(var changedTouch=event.changedTouches[c],i=1;i<this.pointersTotal;i++){var pointer=pointers[i];if(pointer.active&&pointer.identifier===changedTouch.identifier){pointer.touchmove(changedTouch,event),this.activePointer=pointer,changed.push(pointer);break}}this.updateInputPlugins(CONST$10.TOUCH_MOVE,changed)},onTouchEnd:function(event){for(var pointers=this.pointers,changed=[],c=0;c<event.changedTouches.length;c++)for(var changedTouch=event.changedTouches[c],i=1;i<this.pointersTotal;i++){var pointer=pointers[i];if(pointer.active&&pointer.identifier===changedTouch.identifier){pointer.touchend(changedTouch,event),changed.push(pointer);break}}this.updateInputPlugins(CONST$10.TOUCH_END,changed)},onTouchCancel:function(event){for(var pointers=this.pointers,changed=[],c=0;c<event.changedTouches.length;c++)for(var changedTouch=event.changedTouches[c],i=1;i<this.pointersTotal;i++){var pointer=pointers[i];if(pointer.active&&pointer.identifier===changedTouch.identifier){pointer.touchcancel(changedTouch,event),changed.push(pointer);break}}this.updateInputPlugins(CONST$10.TOUCH_CANCEL,changed)},onMouseDown:function(event){var mousePointer=this.mousePointer;mousePointer.down(event),mousePointer.updateMotion(),this.activePointer=mousePointer,this.updateInputPlugins(CONST$10.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(event){var mousePointer=this.mousePointer;mousePointer.move(event),mousePointer.updateMotion(),this.activePointer=mousePointer,this.updateInputPlugins(CONST$10.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(event){var mousePointer=this.mousePointer;mousePointer.up(event),mousePointer.updateMotion(),this.activePointer=mousePointer,this.updateInputPlugins(CONST$10.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(event){var mousePointer=this.mousePointer;mousePointer.wheel(event),this.activePointer=mousePointer,this.updateInputPlugins(CONST$10.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(event){var isLocked=this.mouse.locked;this.mousePointer.locked=isLocked,this.events.emit(Events$A.POINTERLOCK_CHANGE,event,isLocked)},inputCandidate:function(gameObject,camera){var input=gameObject.input;if(!input||!input.enabled||!input.alwaysEnabled&&!gameObject.willRender(camera))return!1;var visible=!0,parent=gameObject.parentContainer;
vendor: 24,986 bytes, lines 179-189
179if(parent)do{if(!parent.willRender(camera)){visible=!1;break}parent=parent.parentContainer}while(parent);return visible},hitTest:function(pointer,gameObjects,camera,output){void 0===output&&(output=this._tempHitTest);var tempPoint=this._tempPoint,csx=camera.scrollX,csy=camera.scrollY;output.length=0;var x=pointer.x,y=pointer.y;camera.getWorldPoint(x,y,tempPoint),pointer.worldX=tempPoint.x,pointer.worldY=tempPoint.y;for(var point={x:0,y:0},matrix=this._tempMatrix,parentMatrix=this._tempMatrix2,i=0;i<gameObjects.length;i++){var gameObject=gameObjects[i];if(this.inputCandidate(gameObject,camera)){var px=tempPoint.x+csx*gameObject.scrollFactorX-csx,py=tempPoint.y+csy*gameObject.scrollFactorY-csy;gameObject.parentContainer?(gameObject.getWorldTransformMatrix(matrix,parentMatrix),matrix.applyInverse(px,py,point)):TransformXY(px,py,gameObject.x,gameObject.y,gameObject.rotation,gameObject.scaleX,gameObject.scaleY,point),this.pointWithinHitArea(gameObject,point.x,point.y)&&output.push(gameObject)}}return output},pointWithinHitArea:function(gameObject,x,y){x+=gameObject.displayOriginX,y+=gameObject.displayOriginY;var input=gameObject.input;return!(!input||!input.hitAreaCallback(input.hitArea,x,y,gameObject))&&(input.localX=x,input.localY=y,!0)},pointWithinInteractiveObject:function(object,x,y){return!!object.hitArea&&(x+=object.gameObject.displayOriginX,y+=object.gameObject.displayOriginY,object.localX=x,object.localY=y,object.hitAreaCallback(object.hitArea,x,y,object))},transformPointer:function(pointer,pageX,pageY,wasMove){var p0=pointer.position,p1=pointer.prevPosition;p1.x=p0.x,p1.y=p0.y;var x=this.scaleManager.transformX(pageX),y=this.scaleManager.transformY(pageY),a=pointer.smoothFactor;wasMove&&0!==a?(p0.x=x*a+p1.x*(1-a),p0.y=y*a+p1.y*(1-a)):(p0.x=x,p0.y=y)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(GameEvents$a.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var i=0;i<this.pointers.length;i++)this.pointers[i].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}}),InputManager_1=InputManager$1,types={},FileTypesManager$x={install:function(loader){for(var key in types)loader[key]=types[key]},register:function(key,factoryFunction){types[key]=factoryFunction},destroy:function(){types={}}},FileTypesManager_1=FileTypesManager$x,PluginCache$c=PluginCache_1,SceneEvents$c=events$g,GameObjectCreator$m=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.events=scene.sys.events,this.displayList,this.updateList,this.events.once(SceneEvents$c.BOOT,this.boot,this),this.events.on(SceneEvents$c.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(SceneEvents$c.DESTROY,this.destroy,this)},start:function(){this.events.once(SceneEvents$c.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(SceneEvents$c.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(SceneEvents$c.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});
180/**
181	 * @author       Richard Davey <[email protected]>
182	 * @copyright    2020 Photon Storm Ltd.
183	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
184	 */GameObjectCreator$m.register=function(factoryType,factoryFunction){GameObjectCreator$m.prototype.hasOwnProperty(factoryType)||(GameObjectCreator$m.prototype[factoryType]=factoryFunction)},GameObjectCreator$m.remove=function(factoryType){GameObjectCreator$m.prototype.hasOwnProperty(factoryType)&&delete GameObjectCreator$m.prototype[factoryType]},PluginCache$c.register("GameObjectCreator",GameObjectCreator$m,"make");var GameObjectCreator_1=GameObjectCreator$m,GameEvents$9=events$k,EventEmitter$l=eventemitter3.exports,FileTypesManager$w=FileTypesManager_1,GameObjectCreator$l=GameObjectCreator_1,GameObjectFactory$z=GameObjectFactory_1,GetFastValue$12=GetFastValue_1,PluginCache$b=PluginCache_1,Remove$1=Remove_1,PluginManager$1=new Class_1({Extends:EventEmitter$l,initialize:function(game){EventEmitter$l.call(this),this.game=game,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],game.isBooted?this.boot():game.events.once(GameEvents$9.BOOT,this.boot,this)},boot:function(){var i,entry,key,plugin,start,mapping,data,config=this.game.config,list=config.installGlobalPlugins;for(list=list.concat(this._pendingGlobal),i=0;i<list.length;i++)entry=list[i],key=GetFastValue$12(entry,"key",null),plugin=GetFastValue$12(entry,"plugin",null),start=GetFastValue$12(entry,"start",!1),mapping=GetFastValue$12(entry,"mapping",null),data=GetFastValue$12(entry,"data",null),key&&(plugin?this.install(key,plugin,start,mapping,data):console.warn("Missing `plugin` for key: "+key));for(list=(list=config.installScenePlugins).concat(this._pendingScene),i=0;i<list.length;i++)entry=list[i],key=GetFastValue$12(entry,"key",null),plugin=GetFastValue$12(entry,"plugin",null),mapping=GetFastValue$12(entry,"mapping",null),key&&(plugin?this.installScenePlugin(key,plugin,mapping):console.warn("Missing `plugin` for key: "+key));this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(GameEvents$9.DESTROY,this.destroy,this)},addToScene:function(sys,globalPlugins,scenePlugins){var i,pluginKey,pluginList,game=this.game,scene=sys.scene,map=sys.settings.map,isBooted=sys.settings.isBooted;for(i=0;i<globalPlugins.length;i++)game[pluginKey=globalPlugins[i]]?(sys[pluginKey]=game[pluginKey],map.hasOwnProperty(pluginKey)&&(scene[map[pluginKey]]=sys[pluginKey])):"game"===pluginKey&&map.hasOwnProperty(pluginKey)&&(scene[map[pluginKey]]=game);for(var s=0;s<scenePlugins.length;s++)for(pluginList=scenePlugins[s],i=0;i<pluginList.length;i++)if(pluginKey=pluginList[i],PluginCache$b.hasCore(pluginKey)){var source=PluginCache$b.getCore(pluginKey),mapKey=source.mapping,plugin=new source.plugin(scene,this,mapKey);sys[mapKey]=plugin,source.custom?scene[mapKey]=plugin:map.hasOwnProperty(mapKey)&&(scene[map[mapKey]]=plugin),isBooted&&plugin.boot()}for(pluginList=this.plugins,i=0;i<pluginList.length;i++){var entry=pluginList[i];entry.mapping&&(scene[entry.mapping]=entry.plugin)}},getDefaultScenePlugins:function(){var list=this.game.config.defaultPlugins;return list=list.concat(this.scenePlugins)},installScenePlugin:function(key,plugin,mapping,addToScene,fromLoader){if(void 0===fromLoader&&(fromLoader=!1),"function"==typeof plugin){if(PluginCache$b.hasCore(key)){if(!fromLoader&&PluginCache$b.hasCore(key))return void console.warn("Scene Plugin key in use: "+key)}else PluginCache$b.register(key,plugin,mapping,!0),this.scenePlugins.push(key);if(addToScene){var instance=new plugin(addToScene,this,key);addToScene.sys[key]=instance,mapping&&""!==mapping&&(addToScene[mapping]=instance),instance.boot()}}else console.warn("Invalid Scene Plugin: "+key)},install:function(key,plugin,start,mapping,data){if(void 0===start&&(start=!1),void 0===mapping&&(mapping=null),void 0===data&&(data=null),"function"!=typeof plugin)return console.warn("Invalid Plugin: "+key),null;if(PluginCache$b.hasCustom(key))return console.warn("Plugin key in use: "+key),null;if(null!==mapping&&(start=!0),this.game.isBooted){if(PluginCache$b.registerCustom(key,plugin,mapping,data),start)return this.start(key)}else this._pendingGlobal.push({key:key,plugin:plugin,start:start,mapping:mapping,data:data});return null},getIndex:function(key){for(var list=this.plugins,i=0;i<list.length;i++){if(list[i].key===key)return i}return-1},getEntry:function(key){var idx=this.getIndex(key);if(-1!==idx)return this.plugins[idx]},isActive:function(key){var entry=this.getEntry(key);return entry&&entry.active},start:function(key,runAs){void 0===runAs&&(runAs=key);var entry=this.getEntry(runAs);return entry&&!entry.active?(entry.active=!0,entry.plugin.start()):entry||(entry=this.createEntry(key,runAs)),entry?entry.plugin:null},createEntry:function(key,runAs){var entry=PluginCache$b.getCustom(key);if(entry){var instance=new entry.plugin(this);entry={key:runAs,plugin:instance,active:!0,mapping:entry.mapping,data:entry.data},this.plugins.push(entry),instance.init(entry.data),instance.start()}return entry},stop:function(key){var entry=this.getEntry(key);return entry&&entry.active&&(entry.active=!1,entry.plugin.stop()),this},get:function(key,autoStart){void 0===autoStart&&(autoStart=!0);var entry=this.getEntry(key);if(entry)return entry.plugin;var plugin=this.getClass(key);return plugin&&autoStart?(entry=this.createEntry(key,key))?entry.plugin:null:plugin||null},getClass:function(key){return PluginCache$b.getCustomClass(key)},removeGlobalPlugin:function(key){var entry=this.getEntry(key);entry&&Remove$1(this.plugins,entry),PluginCache$b.removeCustom(key)},removeScenePlugin:function(key){Remove$1(this.scenePlugins,key),PluginCache$b.remove(key)},registerGameObject:function(key,factoryCallback,creatorCallback){return factoryCallback&&GameObjectFactory$z.register(key,factoryCallback),creatorCallback&&GameObjectCreator$l.register(key,creatorCallback),this},removeGameObject:function(key,removeFromFactory,removeFromCreator){return void 0===removeFromFactory&&(removeFromFactory=!0),void 0===removeFromCreator&&(removeFromCreator=!0),removeFromFactory&&GameObjectFactory$z.remove(key),removeFromCreator&&GameObjectCreator$l.remove(key),this},registerFileType:function(key,callback,addToScene){FileTypesManager$w.register(key,callback),addToScene&&addToScene.sys.load&&(addToScene.sys.load[key]=callback)},destroy:function(){for(var i=0;i<this.plugins.length;i++)this.plugins[i].plugin.destroy();PluginCache$b.destroyCustomPlugins(),this.game.noReturn&&PluginCache$b.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}}),PluginManager_1=PluginManager$1,Clamp$8=Clamp_1,SnapFloor$5=SnapFloor_1,Vector2$y=Vector2_1,Size$2=new Class_1({initialize:function(width,height,aspectMode,parent){void 0===width&&(width=0),void 0===height&&(height=width),void 0===aspectMode&&(aspectMode=0),void 0===parent&&(parent=null),this._width=width,this._height=height,this._parent=parent,this.aspectMode=aspectMode,this.aspectRatio=0===height?1:width/height,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new Vector2$y},setAspectMode:function(value){return void 0===value&&(value=0),this.aspectMode=value,this.setSize(this._width,this._height)},setSnap:function(snapWidth,snapHeight){return void 0===snapWidth&&(snapWidth=0),void 0===snapHeight&&(snapHeight=snapWidth),this.snapTo.set(snapWidth,snapHeight),this.setSize(this._width,this._height)},setParent:function(parent){return this._parent=parent,this.setSize(this._width,this._height)},setMin:function(width,height){return void 0===width&&(width=0),void 0===height&&(height=width),this.minWidth=Clamp$8(width,0,this.maxWidth),this.minHeight=Clamp$8(height,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(width,height){return void 0===width&&(width=Number.MAX_VALUE),void 0===height&&(height=width),this.maxWidth=Clamp$8(width,this.minWidth,Number.MAX_VALUE),this.maxHeight=Clamp$8(height,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(width,height){switch(void 0===width&&(width=0),void 0===height&&(height=width),this.aspectMode){case Size$2.NONE:this._width=this.getNewWidth(SnapFloor$5(width,this.snapTo.x)),this._height=this.getNewHeight(SnapFloor$5(height,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case Size$2.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(SnapFloor$5(width,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case Size$2.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(SnapFloor$5(height,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case Size$2.FIT:this.constrain(width,height,!0);break;case Size$2.ENVELOP:this.constrain(width,height,!1)}return this},setAspectRatio:function(ratio){return this.aspectRatio=ratio,this.setSize(this._width,this._height)},resize:function(width,height){return this._width=this.getNewWidth(SnapFloor$5(width,this.snapTo.x)),this._height=this.getNewHeight(SnapFloor$5(height,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(value,checkParent){return void 0===checkParent&&(checkParent=!0),value=Clamp$8(value,this.minWidth,this.maxWidth),checkParent&&this._parent&&value>this._parent.width&&(value=Math.max(this.minWidth,this._parent.width)),value},getNewHeight:function(value,checkParent){return void 0===checkParent&&(checkParent=!0),value=Clamp$8(value,this.minHeight,this.maxHeight),checkParent&&this._parent&&value>this._parent.height&&(value=Math.max(this.minHeight,this._parent.height)),value},constrain:function(width,height,fit){void 0===width&&(width=0),void 0===height&&(height=width),void 0===fit&&(fit=!0),width=this.getNewWidth(width),height=this.getNewHeight(height);var snap=this.snapTo,newRatio=0===height?1:width/height;return fit&&this.aspectRatio>newRatio||!fit&&this.aspectRatio<newRatio?(height=(width=SnapFloor$5(width,snap.x))/this.aspectRatio,snap.y>0&&(width=(height=SnapFloor$5(height,snap.y))*this.aspectRatio)):(fit&&this.aspectRatio<newRatio||!fit&&this.aspectRatio>newRatio)&&(width=(height=SnapFloor$5(height,snap.y))*this.aspectRatio,snap.x>0&&(height=(width=SnapFloor$5(width,snap.x))*(1/this.aspectRatio))),this._width=width,this._height=height,this},fitTo:function(width,height){return this.constrain(width,height,!0)},envelop:function(width,height){return this.constrain(width,height,!1)},setWidth:function(value){return this.setSize(value,this._height)},setHeight:function(value){return this.setSize(this._width,value)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(element){element&&element.style&&(element.style.width=this._width+"px",element.style.height=this._height+"px")},copy:function(destination){return destination.setAspectMode(this.aspectMode),destination.aspectRatio=this.aspectRatio,destination.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(value){this.setSize(value,this._height)}},height:{get:function(){return this._height},set:function(value){this.setSize(this._width,value)}}});
185/**
186	 * @author       Richard Davey <[email protected]>
187	 * @copyright    2020 Photon Storm Ltd.
188	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
189	 */Size$2.NONE=0,Size$2.WIDTH_CONTROLS_HEIGHT=1,Size$2.HEIGHT_CONTROLS_WIDTH=2,Size$2.FIT=3,Size$2.ENVELOP=4;for(var Size_1$1=Size$2,CONST$$=_const$7,Class$2m=Class_1,EventEmitter$k=eventemitter3.exports,Events$z=events$c,GameEvents$8=events$k,GetInnerHeight=GetInnerHeight_1,GetTarget=GetTarget_1,GetScreenOrientation=GetScreenOrientation_1,NOOP$f=NOOP_1,Rectangle$m=Rectangle_1$1,Size$1=Size_1$1,SnapFloor$4=SnapFloor_1,Vector2$x=Vector2_1,ScaleManager$1=new Class$2m({Extends:EventEmitter$k,initialize:function(game){EventEmitter$k.call(this),this.game=game,this.canvas,this.canvasBounds=new Rectangle$m,this.parent=null,this.parentIsWindow=!1,this.parentSize=new Size$1,this.gameSize=new Size$1,this.baseSize=new Size$1,this.displaySize=new Size$1,this.scaleMode=CONST$$.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new Vector2$x(1,1),this.autoRound=!1,this.autoCenter=CONST$$.CENTER.NO_CENTER,this.orientation=CONST$$.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:NOOP$f,windowResize:NOOP$f,fullScreenChange:NOOP$f,fullScreenError:NOOP$f}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(GameEvents$8.BOOT,this.boot,this)},boot:function(){var game=this.game;this.canvas=game.canvas,this.fullscreen=game.device.fullscreen,this.scaleMode!==CONST$$.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===CONST$$.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),game.events.on(GameEvents$8.PRE_STEP,this.step,this),game.events.once(GameEvents$8.READY,this.refresh,this),game.events.once(GameEvents$8.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(config){this.getParent(config),this.getParentBounds();var width=config.width,height=config.height,scaleMode=config.scaleMode,zoom=config.zoom,autoRound=config.autoRound;if("string"==typeof width){var parentWidth=this.parentSize.width;0===parentWidth&&(parentWidth=window.innerWidth);var parentScaleX=parseInt(width,10)/100;width=Math.floor(parentWidth*parentScaleX)}if("string"==typeof height){var parentHeight=this.parentSize.height;0===parentHeight&&(parentHeight=window.innerHeight);var parentScaleY=parseInt(height,10)/100;height=Math.floor(parentHeight*parentScaleY)}this.scaleMode=scaleMode,this.autoRound=autoRound,this.autoCenter=config.autoCenter,this.resizeInterval=config.resizeInterval,autoRound&&(width=Math.floor(width),height=Math.floor(height)),this.gameSize.setSize(width,height),zoom===CONST$$.ZOOM.MAX_ZOOM&&(zoom=this.getMaxZoom()),this.zoom=zoom,1!==zoom&&(this._resetZoom=!0),this.baseSize.setSize(width,height),autoRound&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),config.minWidth>0&&this.displaySize.setMin(config.minWidth*zoom,config.minHeight*zoom),config.maxWidth>0&&this.displaySize.setMax(config.maxWidth*zoom,config.maxHeight*zoom),this.displaySize.setSize(width,height),this.orientation=GetScreenOrientation(width,height)},getParent:function(config){var parent=config.parent;if(null!==parent){if(this.parent=GetTarget(parent),this.parentIsWindow=this.parent===document.body,config.expandParent&&config.scaleMode!==CONST$$.SCALE_MODE.NONE){var DOMRect=this.parent.getBoundingClientRect();(this.parentIsWindow||0===DOMRect.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",DOMRect=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==DOMRect.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}config.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=GetTarget(config.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var parentSize=this.parentSize,DOMRect=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(DOMRect.height=GetInnerHeight(!0));var newWidth=DOMRect.width,newHeight=DOMRect.height;return(parentSize.width!==newWidth||parentSize.height!==newHeight)&&(parentSize.setSize(newWidth,newHeight),!0)},lockOrientation:function(orientation){var lock=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!lock&&lock.call(screen,orientation)},setParentSize:function(width,height){return this.parentSize.setSize(width,height),this.refresh()},setGameSize:function(width,height){var autoRound=this.autoRound;autoRound&&(width=Math.floor(width),height=Math.floor(height));var previousWidth=this.width,previousHeight=this.height;return this.gameSize.resize(width,height),this.baseSize.resize(width,height),autoRound&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(width/height),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(previousWidth,previousHeight)},resize:function(width,height){var zoom=this.zoom,autoRound=this.autoRound;autoRound&&(width=Math.floor(width),height=Math.floor(height));var previousWidth=this.width,previousHeight=this.height;this.gameSize.resize(width,height),this.baseSize.resize(width,height),autoRound&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(width*zoom,height*zoom),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var style=this.canvas.style,styleWidth=width*zoom,styleHeight=height*zoom;return autoRound&&(styleWidth=Math.floor(styleWidth),styleHeight=Math.floor(styleHeight)),styleWidth===width&&styleHeight===height||(style.width=styleWidth+"px",style.height=styleHeight+"px"),this.refresh(previousWidth,previousHeight)},setZoom:function(value){return this.zoom=value,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(previousWidth,previousHeight){void 0===previousWidth&&(previousWidth=this.width),void 0===previousHeight&&(previousHeight=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var domContainer=this.game.domContainer;if(domContainer){this.baseSize.setCSS(domContainer);var canvasStyle=this.canvas.style,domStyle=domContainer.style;domStyle.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",domStyle.marginLeft=canvasStyle.marginLeft,domStyle.marginTop=canvasStyle.marginTop}return this.emit(Events$z.RESIZE,this.gameSize,this.baseSize,this.displaySize,previousWidth,previousHeight),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var newOrientation=GetScreenOrientation(this.width,this.height);newOrientation!==this.orientation&&(this.orientation=newOrientation,this.emit(Events$z.ORIENTATION_CHANGE,newOrientation))}},updateScale:function(){var styleWidth,styleHeight,style=this.canvas.style,width=this.gameSize.width,height=this.gameSize.height,zoom=this.zoom,autoRound=this.autoRound;this.scaleMode===CONST$$.SCALE_MODE.NONE?(this.displaySize.setSize(width*zoom,height*zoom),styleWidth=this.displaySize.width,styleHeight=this.displaySize.height,autoRound&&(styleWidth=Math.floor(styleWidth),styleHeight=Math.floor(styleHeight)),this._resetZoom&&(style.width=styleWidth+"px",style.height=styleHeight+"px",this._resetZoom=!1)):this.scaleMode===CONST$$.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),styleWidth=this.displaySize.width,styleHeight=this.displaySize.height,autoRound&&(styleWidth=Math.floor(styleWidth),styleHeight=Math.floor(styleHeight)),this.canvas.width=styleWidth,this.canvas.height=styleHeight):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),styleWidth=this.displaySize.width,styleHeight=this.displaySize.height,autoRound&&(styleWidth=Math.floor(styleWidth),styleHeight=Math.floor(styleHeight)),style.width=styleWidth+"px",style.height=styleHeight+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var zoomH=SnapFloor$4(this.parentSize.width,this.gameSize.width,0,!0),zoomV=SnapFloor$4(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(zoomH,zoomV),1)},updateCenter:function(){var autoCenter=this.autoCenter;if(autoCenter!==CONST$$.CENTER.NO_CENTER){var canvas=this.canvas,style=canvas.style,bounds=canvas.getBoundingClientRect(),width=bounds.width,height=bounds.height,offsetX=Math.floor((this.parentSize.width-width)/2),offsetY=Math.floor((this.parentSize.height-height)/2);autoCenter===CONST$$.CENTER.CENTER_HORIZONTALLY?offsetY=0:autoCenter===CONST$$.CENTER.CENTER_VERTICALLY&&(offsetX=0),style.marginLeft=offsetX+"px",style.marginTop=offsetY+"px"}},updateBounds:function(){var bounds=this.canvasBounds,clientRect=this.canvas.getBoundingClientRect();bounds.x=clientRect.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),bounds.y=clientRect.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),bounds.width=clientRect.width,bounds.height=clientRect.height},transformX:function(pageX){return(pageX-this.canvasBounds.left)*this.displayScale.x},transformY:function(pageY){return(pageY-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(fullscreenOptions){void 0===fullscreenOptions&&(fullscreenOptions={navigationUI:"hide"});var fullscreen=this.fullscreen;if(fullscreen.available){if(!fullscreen.active){var fsTarget=this.getFullscreenTarget();fullscreen.keyboard?fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT):fsTarget[fullscreen.request](fullscreenOptions)}}else this.emit(Events$z.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit
189(Events$z.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(error){this.removeFullscreenTarget(),this.emit(Events$z.FULLSCREEN_FAILED,error)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var fsTarget=document.createElement("div");fsTarget.style.margin="0",fsTarget.style.padding="0",fsTarget.style.width="100%",fsTarget.style.height="100%",this.fullscreenTarget=fsTarget,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var fsTarget=this.fullscreenTarget;if(fsTarget&&fsTarget.parentNode){var parent=fsTarget.parentNode;parent.insertBefore(this.canvas,fsTarget),parent.removeChild(fsTarget)}}},stopFullscreen:function(){var fullscreen=this.fullscreen;if(!fullscreen.available)return this.emit(Events$z.FULLSCREEN_UNSUPPORTED),!1;fullscreen.active&&document[fullscreen.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(Events$z.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(fullscreenOptions){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(fullscreenOptions)},startListeners:function(){var _this=this,listeners=this.listeners;if(listeners.orientationChange=function(){_this.updateBounds(),_this._checkOrientation=!0,_this.dirty=!0},listeners.windowResize=function(){_this.updateBounds(),_this.dirty=!0},window.addEventListener("orientationchange",listeners.orientationChange,!1),window.addEventListener("resize",listeners.windowResize,!1),this.fullscreen.available){listeners.fullScreenChange=function(event){return _this.onFullScreenChange(event)},listeners.fullScreenError=function(event){return _this.onFullScreenError(event)};["webkit","moz",""].forEach((function(prefix){document.addEventListener(prefix+"fullscreenchange",listeners.fullScreenChange,!1),document.addEventListener(prefix+"fullscreenerror",listeners.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",listeners.fullScreenChange,!1),document.addEventListener("MSFullscreenError",listeners.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(time,delta){this.parent&&(this._lastCheck+=delta,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var listeners=this.listeners;window.removeEventListener("orientationchange",listeners.orientationChange,!1),window.removeEventListener("resize",listeners.windowResize,!1);["webkit","moz",""].forEach((function(prefix){document.removeEventListener(prefix+"fullscreenchange",listeners.fullScreenChange,!1),document.removeEventListener(prefix+"fullscreenerror",listeners.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",listeners.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",listeners.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===CONST$$.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===CONST$$.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}}),ScaleManager_1=ScaleManager$1,_const$5={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9},events$7={ADD:"addfile",COMPLETE:"complete",FILE_COMPLETE:"filecomplete",FILE_KEY_COMPLETE:"filecomplete-",FILE_LOAD_ERROR:"loaderror",FILE_LOAD:"load",FILE_PROGRESS:"fileprogress",POST_PROCESS:"postprocess",PROGRESS:"progress",START:"start"},UppercaseFirst_1=function(str){return str&&str[0].toUpperCase()+str.slice(1)},GetFastValue$11=GetFastValue_1,UppercaseFirst$1=UppercaseFirst_1,GetPhysicsPlugins_1=function(sys){var defaultSystem=sys.game.config.defaultPhysicsSystem,sceneSystems=GetFastValue$11(sys.settings,"physics",!1);if(defaultSystem||sceneSystems){var output=[];if(defaultSystem&&output.push(UppercaseFirst$1(defaultSystem+"Physics")),sceneSystems)for(var key in sceneSystems)key=UppercaseFirst$1(key.concat("Physics")),-1===output.indexOf(key)&&output.push(key);return output}},GetFastValue$10=GetFastValue_1,GetScenePlugins_1=function(sys){var defaultPlugins=sys.plugins.getDefaultScenePlugins(),scenePlugins=GetFastValue$10(sys.settings,"plugins",!1);return Array.isArray(scenePlugins)?scenePlugins:defaultPlugins||[]},Clone_1$7=function(obj){var clone={};for(var key in obj)Array.isArray(obj[key])?clone[key]=obj[key].slice(0):clone[key]=obj[key];return clone},Clone$c=Clone_1$7,Merge_1=function(obj1,obj2){var clone=Clone$c(obj1);for(var key in obj2)clone.hasOwnProperty(key)||(clone[key]=obj2[key]);return clone},CONST$Z=_const$5,GetValue$q=GetValue_1,Merge$3=Merge_1,InjectionMap={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",dis
vendor: 13,322 bytes, line 189
189playList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"},Settings_1={create:function(config){return"string"==typeof config?config={key:config}:void 0===config&&(config={}),{status:CONST$Z.PENDING,key:GetValue$q(config,"key",""),active:GetValue$q(config,"active",!1),visible:GetValue$q(config,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:GetValue$q(config,"pack",!1),cameras:GetValue$q(config,"cameras",null),map:GetValue$q(config,"map",Merge$3(InjectionMap,GetValue$q(config,"mapAdd",{}))),physics:GetValue$q(config,"physics",{}),loader:GetValue$q(config,"loader",{}),plugins:GetValue$q(config,"plugins",!1),input:GetValue$q(config,"input",{})}}},CONST$Y=_const$5,DefaultPlugins=DefaultPlugins_1,Events$y=events$g,GetPhysicsPlugins=GetPhysicsPlugins_1,GetScenePlugins=GetScenePlugins_1,GLOBAL_CONST=_const$e,NOOP$e=NOOP_1,Settings=Settings_1,Systems$2=new Class_1({initialize:function(scene,config){this.scene=scene,this.game,this.renderer,this.config=config,this.settings=Settings.create(config),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=NOOP$e},init:function(game){this.settings.status=CONST$Y.INIT,this.sceneUpdate=NOOP$e,this.game=game,this.renderer=game.renderer,this.canvas=game.canvas,this.context=game.context;var pluginManager=game.plugins;this.plugins=pluginManager,pluginManager.addToScene(this,DefaultPlugins.Global,[DefaultPlugins.CoreScene,GetScenePlugins(this),GetPhysicsPlugins(this)]),this.events.emit(Events$y.BOOT,this),this.settings.isBooted=!0},step:function(time,delta){var events=this.events;events.emit(Events$y.PRE_UPDATE,time,delta),events.emit(Events$y.UPDATE,time,delta),this.sceneUpdate.call(this.scene,time,delta),events.emit(Events$y.POST_UPDATE,time,delta)},render:function(renderer){var displayList=this.displayList;displayList.depthSort(),this.events.emit(Events$y.PRE_RENDER,renderer),this.cameras.render(renderer,displayList),this.events.emit(Events$y.RENDER,renderer)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(data){var events=this.events,settings=this.settings;return this.settings.active&&(settings.status=CONST$Y.PAUSED,settings.active=!1,events.emit(Events$y.PAUSE,this,data)),this},resume:function(data){var events=this.events,settings=this.settings;return this.settings.active||(settings.status=CONST$Y.RUNNING,settings.active=!0,events.emit(Events$y.RESUME,this,data)),this},sleep:function(data){var events=this.events,settings=this.settings;return settings.status=CONST$Y.SLEEPING,settings.active=!1,settings.visible=!1,events.emit(Events$y.SLEEP,this,data),this},wake:function(data){var events=this.events,settings=this.settings;return settings.status=CONST$Y.RUNNING,settings.active=!0,settings.visible=!0,events.emit(Events$y.WAKE,this,data),settings.isTransition&&events.emit(Events$y.TRANSITION_WAKE,settings.transitionFrom,settings.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===CONST$Y.SLEEPING},isActive:function(){return this.settings.status===CONST$Y.RUNNING},isPaused:function(){return this.settings.status===CONST$Y.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(value){return this.settings.visible=value,this},setActive:function(value,data){return value?this.resume(data):this.pause(data)},start:function(data){var events=this.events,settings=this.settings;data&&(settings.data=data),settings.status=CONST$Y.START,settings.active=!0,settings.visible=!0,events.emit(Events$y.START,this),events.emit(Events$y.READY,this,data)},shutdown:function(data){var events=this.events,settings=this.settings;events.off(Events$y.TRANSITION_INIT),events.off(Events$y.TRANSITION_START),events.off(Events$y.TRANSITION_COMPLETE),events.off(Events$y.TRANSITION_OUT),settings.status=CONST$Y.SHUTDOWN,settings.active=!1,settings.visible=!1,this.renderer===GLOBAL_CONST.WEBGL&&this.renderer.resetTextures(!0),events.emit(Events$y.SHUTDOWN,this,data)},destroy:function(){var events=this.events,settings=this.settings;settings.status=CONST$Y.DESTROYED,settings.active=!1,settings.visible=!1,events.emit(Events$y.DESTROY,this),events.removeAllListeners();for(var props=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],i=0;i<props.length;i++)this[props[i]]=null}}),Systems_1=Systems$2,Systems$1=Systems_1,Scene_1=new Class_1({initialize:function(config){this.sys=new Systems$1(this,config),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}}),CONST$X=_const$5,Events$x=events$g,GameEvents$7=events$k,GetValue$p=GetValue_1,LoaderEvents$1=events$7,NOOP$d=NOOP_1,Scene$1=Scene_1,Systems=Systems_1,SceneManager$1=new Class_1({initialize:function(game,sceneConfig){if(this.game=game,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,sceneConfig){Array.isArray(sceneConfig)||(sceneConfig=[sceneConfig]);for(var i=0;i<sceneConfig.length;i++)this._pending.push({key:"default",scene:sceneConfig[i],autoStart:0===i,data:{}})}game.events.once(GameEvents$7.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var i,entry,key,sceneConfig;for(i=0;i<this._pending.length;i++){var newScene;key=(entry=this._pending[i]).key,(sceneConfig=entry.scene)instanceof Scene$1?newScene=this.createSceneFromInstance(key,sceneConfig):"object"==typeof sceneConfig?newScene=this.createSceneFromObject(key,sceneConfig):"function"==typeof sceneConfig&&(newScene=this.createSceneFromFunction(key,sceneConfig)),key=newScene.sys.settings.key,this.keys[key]=newScene,this.scenes.push(newScene),this._data[key]&&(newScene.sys.settings.data=this._data[key].data,this._data[key].autoStart&&(entry.autoStart=!0)),(entry.autoStart||newScene.sys.settings.active)&&this._start.push(key)}for(this._pending.length=0,this._data={},this.isBooted=!0,i=0;i<this._start.length;i++)entry=this._start[i],this.start(entry);this._start.length=0}},processQueue:function(){var pendingLength=this._pending.length,queueLength=this._queue.length;if(0!==pendingLength||0!==queueLength){var i,entry;if(pendingLength){for(i=0;i<pendingLength;i++)entry=this._pending[i],this.add(entry.key,entry.scene,entry.autoStart,entry.data);for(i=0;i<this._start.length;i++)entry=this._start[i],this.start(entry);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(entry=this._queue[i]).op](entry.keyA,entry.keyB);this._queue.length=0}},add:function(key,sceneConfig,autoStart,data){return void 0===autoStart&&(autoStart=!1),void 0===data&&(data={}),this.isProcessing||!this.isBooted?(this._pending.push({key:key,scene:sceneConfig,autoStart:autoStart,data:data}),this.isBooted||(this._data[key]={data:data}),null):(key=this.getKey(key,sceneConfig),sceneConfig instanceof Scene$1?newScene=this.createSceneFromInstance(key,sceneConfig):"object"==typeof sceneConfig?(sceneConfig.key=key,newScene=this.createSceneFromObject(key,sceneConfig)):"function"==typeof sceneConfig&&(newScene=this.createSceneFromFunction(key,sceneConfig)),newScene.sys.settings.data=data,key=newScene.sys.settings.key,this.keys[key]=newScene,this.scenes.push(newScene),(autoStart||newScene.sys.settings.active)&&(this._pending.length?this._start.push(key):this.start(key)),newScene);var newScene},remove:function(key){if(this.isProcessing)this._queue.push({op:"remove",keyA:key,keyB:null});else{var sceneToRemove=this.getScene(key);if(!sceneToRemove||sceneToRemove.sys.isTransitioning())return this;var index=this.scenes.indexOf(sceneToRemove),sceneKey=sceneToRemove.sys.settings.key;index>-1&&(delete this.keys[sceneKey],this.scenes.splice(index,1),this._start.indexOf(sceneKey)>-1&&(index=this._start.indexOf(sceneKey),this._start.splice(index,1)),sceneToRemove.sys.destroy())}return this},bootScene:function(scene){var loader,sys=scene.sys,settings=sys.settings;sys.sceneUpdate=NOOP$d,scene.init&&(scene.init.call(scene,settings.data),settings.status=CONST$X.INIT,settings.isTransition&&sys.events.emit(Events$x.TRANSITION_INIT,settings.transitionFrom,settings.transitionDuration)),sys.load&&(loader=sys.load).reset(),loader&&scene.preload?(scene.preload.call(scene),0===loader.list.size?this.create(scene):(settings.status=CONST$X.LOADING,loader.once(LoaderEvents$1.COMPLETE,this.loadComplete,this),loader.start())):this.create(scene)},loadComplete:function(loader){this.create(loader.scene)},payloadComplete:function(loader){this.bootScene(loader.scene)},update:function(time,delta){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var sys=this.scenes[i].sys;sys.settings.status>CONST$X.START&&sys.settings.status<=CONST$X.RUNNING&&sys.step(time,delta)}},render:function(renderer){for(var i=0;i<this.scenes.length;i++){var sys=this.scenes[i].sys;sys.settings.visible&&sys.settings.status>=CONST$X.LOADING&&sys.settings.status<CONST$X.SLEEPING&&sys.render(renderer)}this.isProcessing=!1},create:function(scene){var sys=scene.sys,settings=sys.settings;scene.create&&(settings.status=CONST$X.CREATING,scene.create.call(scene,settings.data),settings.status===CONST$X.DESTROYED)||(settings.isTransition&&sys.events.emit(Events$x.TRANSITION_START,settings.transitionFrom,settings.transitionDuration),scene.update&&(sys.sceneUpdate=scene.update),settings.status=CONST$X.RUNNING,sys.events.emit(Events$x.CREATE,scene))},createSceneFromFunction:function(key,scene){var newScene=new scene;if(newScene instanceof Scene$1){var configKey=newScene.sys.settings.key;if(""!==configKey&&(key=configKey),this.keys.hasOwnProperty(key))throw new Error("Cannot add a Scene with duplicate key: "+key);return this.createSceneFromInstance(key,newScene)}return newScene.sys=new Systems(newScene),newScene.sys.settings.key=key,newScene.sys.init(this.game),newScene},createSceneFromInstance:function(key,newScene){return""===newScene.sys.settings.key&&(newScene.sys.settings.key=key),newScene.sys.init(this.game),newScene},createSceneFromObject:function(key,sceneConfig){var newScene=new Scene$1(sceneConfig),configKey=newScene.sys.settings.key;""!==configKey?key=configKey:newScene.sys.settings.key=key,newScene.sys.init(this.game);for(var defaults=["init","preload","create","update","render"],i=0;i<defaults.length;i++){var sceneCallback=GetValue$p(sceneConfig,defaults[i],null);sceneCallback&&(newScene[defaults[i]]=sceneCallback)}if(sceneConfig.hasOwnProperty("extend"))for(var propertyKey in sceneConfig.extend)if(sceneConfig.extend.hasOwnProperty(propertyKey)){var value=sceneConfig.extend[propertyKey];"data"===propertyKey&&newScene.hasOwnProperty("data")&&"object"==typeof value?newScene.data.merge(value):"sys"!==propertyKey&&(newScene[propertyKey]=value)}return newScene},getKey:function(key,sceneConfig){if(key||(key="default"),"function"==typeof sceneConfig)return key;if(sceneConfig instanceof Scene$1?key=sceneConfig.sys.settings.key:"object"==typeof sceneConfig&&sceneConfig.hasOwnProperty("key")&&(key=sceneConfig.key),this.keys.hasOwnProperty(key))throw new Error("Cannot add a Scene with duplicate key: "+key);return key},getScenes:function(isActive,inReverse){void 0===isActive&&(isActive=!0),void 0===inReverse&&(inReverse=!1);for(var out=[],scenes=this.scenes,i=0;i<scenes.length;i++){var scene=scenes[i];scene&&(!isActive||isActive&&scene.sys.isActive())&&out.push(scene)}return inReverse?out.reverse():out},getScene:function(key){if("string"==typeof key){if(this.keys[key])return this.keys[key]}else for(var i=0;i<this.scenes.length;i++)if(key===this.scenes[i])return key;return null},isActive:function(key){var scene=this.getScene(key);return scene?scene.sys.isActive():null},isPaused:function(key){var scene=this.getScene(key);return scene?scene.sys.isPaused():null},isVisible:function(key){var scene=this.getScene(key);return scene?scene.sys.isVisible():null},isSleeping:function(key){var scene=this.getScene(key);return scene?scene.sys.isSleeping():null},pause:function(key,data){var scene=this.getScene(key);return scene&&scene.sys.pause(data),this},resume:function(key,data){var scene=this.getScene(key);return scene&&scene.sys.resume(data),this},sleep:function(key,data){var scene=this.getScene(key);return scene&&!scene.sys.isTransitioning()&&scene.sys.sleep(data),this},wake:function(key,data){var scene=this.getScene(key);return scene&&scene.sys.wake(data),this},run:function(key,data){var scene=this.getScene(key);if(!scene){for(var i=0;
189i<this._pending.length;i++)if(this._pending[i].key===key){this.queueOp("start",key,data);break}return this}scene.sys.isSleeping()?scene.sys.wake(data):scene.sys.isPaused()?scene.sys.resume(data):this.start(key,data)},start:function(key,data){if(!this.isBooted)return this._data[key]={autoStart:!0,data:data},this;var scene=this.getScene(key);if(scene){var loader,sys=scene.sys;if(sys.isActive()||sys.isPaused())sys.shutdown(),sys.sceneUpdate=NOOP$d,sys.start(data);else if(sys.sceneUpdate=NOOP$d,sys.start(data),sys.load&&(loader=sys.load),loader&&sys.settings.hasOwnProperty("pack")&&(loader.reset(),loader.addPack({payload:sys.settings.pack})))return sys.settings.status=CONST$X.LOADING,loader.once(LoaderEvents$1.COMPLETE,this.payloadComplete,this),loader.start(),this;this.bootScene(scene)}return this},stop:function(key,data){var scene=this.getScene(key);return scene&&!scene.sys.isTransitioning()&&scene.sys.shutdown(data),this},switch:function(from,to){var sceneA=this.getScene(from),sceneB=this.getScene(to);return sceneA&&sceneB&&sceneA!==sceneB&&(this.sleep(from),this.isSleeping(to)?this.wake(to):this.start(to)),this},getAt:function(index){return this.scenes[index]},getIndex:function(key){var scene=this.getScene(key);return this.scenes.indexOf(scene)},bringToTop:function(key){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:key,keyB:null});else{var index=this.getIndex(key);if(-1!==index&&index<this.scenes.length){var scene=this.getScene(key);this.scenes.splice(index,1),this.scenes.push(scene)}}return this},sendToBack:function(key){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:key,keyB:null});else{var index=this.getIndex(key);if(-1!==index&&index>0){var scene=this.getScene(key);this.scenes.splice(index,1),this.scenes.unshift(scene)}}return this},moveDown:function(key){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:key,keyB:null});else{var indexA=this.getIndex(key);if(indexA>0){var indexB=indexA-1,sceneA=this.getScene(key),sceneB=this.getAt(indexB);this.scenes[indexA]=sceneB,this.scenes[indexB]=sceneA}}return this},moveUp:function(key){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:key,keyB:null});else{var indexA=this.getIndex(key);if(indexA<this.scenes.length-1){var indexB=indexA+1,sceneA=this.getScene(key),sceneB=this.getAt(indexB);this.scenes[indexA]=sceneB,this.scenes[indexB]=sceneA}}return this},moveAbove:function(keyA,keyB){if(keyA===keyB)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:keyA,keyB:keyB});else{var indexA=this.getIndex(keyA),indexB=this.getIndex(keyB);if(-1!==indexA&&-1!==indexB){var tempScene=this.getAt(indexB);this.scenes.splice(indexB,1),this.scenes.splice(indexA+1,0,tempScene)}}return this},moveBelow:function(keyA,keyB){if(keyA===keyB)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:keyA,keyB:keyB});else{var indexA=this.getIndex(keyA),indexB=this.getIndex(keyB);if(-1!==indexA&&-1!==indexB){var tempScene=this.getAt(indexB);this.scenes.splice(indexB,1),0===indexA?this.scenes.unshift(tempScene):this.scenes.splice(indexA,0,tempScene)}}return this},queueOp:function(op,keyA,keyB){return this._queue.push({op:op,keyA:keyA,keyB:keyB}),this},swapPosition:function(keyA,keyB){if(keyA===keyB)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:keyA,keyB:keyB});else{var indexA=this.getIndex(keyA),indexB=this.getIndex(keyB);if(indexA!==indexB&&-1!==indexA&&-1!==indexB){var tempScene=this.getAt(indexA);this.scenes[indexA]=this.scenes[indexB],this.scenes[indexB]=tempScene}}return this},dump:function(){for(var out=[],map=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var sys=this.scenes[i].sys,key=!sys.settings.visible||sys.settings.status!==CONST$X.RUNNING&&sys.settings.status!==CONST$X.PAUSED?"[-] ":"[*] ";key+=sys.settings.key+" ("+map[sys.settings.status]+")",out.push(key)}console.log(out.join("\n"))},destroy:function(){for(var i=0;i<this.scenes.length;i++){this.scenes[i].sys.destroy()}this.update=NOOP$d,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}}),SceneManager_1=SceneManager$1,Clamp$7=Clamp_1,Extend$j=Extend_1$1,Frame$4=new Class_1({initialize:function(texture,name,sourceIndex,x,y,width,height){this.texture=texture,this.name=name,this.source=texture.source[sourceIndex],this.sourceIndex=sourceIndex,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(width,height,x,y)},setSize:function(width,height,x,y){void 0===x&&(x=0),void 0===y&&(y=0),this.cutX=x,this.cutY=y,this.cutWidth=width,this.cutHeight=height,this.width=width,this.height=height,this.halfWidth=Math.floor(.5*width),this.halfHeight=Math.floor(.5*height),this.centerX=Math.floor(width/2),this.centerY=Math.floor(height/2);var data=this.data,cut=data.cut;cut.x=x,cut.y=y,cut.w=width,cut.h=height,cut.r=x+width,cut.b=y+height,data.sourceSize.w=width,data.sourceSize.h=height,data.spriteSourceSize.w=width,data.spriteSourceSize.h=height,data.radius=.5*Math.sqrt(width*width+height*height);var drawImage=data.drawImage;return drawImage.x=x,drawImage.y=y,drawImage.width=width,drawImage.height=height,this.updateUVs()},setTrim:function(actualWidth,actualHeight,destX,destY,destWidth,destHeight){var data=this.data,ss=data.spriteSourceSize;return data.trim=!0,data.sourceSize.w=actualWidth,data.sourceSize.h=actualHeight,ss.x=destX,ss.y=destY,ss.w=destWidth,ss.h=destHeight,ss.r=dest
189X+destWidth,ss.b=destY+destHeight,this.x=destX,this.y=destY,this.width=destWidth,this.height=destHeight,this.halfWidth=.5*destWidth,this.halfHeight=.5*destHeight,this.centerX=Math.floor(destWidth/2),this.centerY=Math.floor(destHeight/2),this.updateUVs()},setCropUVs:function(crop,x,y,width,height,flipX,flipY){var cx=this.cutX,cy=this.cutY,cw=this.cutWidth,ch=this.cutHeight,rw=this.realWidth,rh=this.realHeight,ox=cx+(x=Clamp$7(x,0,rw)),oy=cy+(y=Clamp$7(y,0,rh)),ow=width=Clamp$7(width,0,rw-x),oh=height=Clamp$7(height,0,rh-y),data=this.data;if(data.trim){var ss=data.spriteSourceSize,cropRight=x+(width=Clamp$7(width,0,cw-x)),cropBottom=y+(height=Clamp$7(height,0,ch-y));if(!(ss.r<x||ss.b<y||ss.x>cropRight||ss.y>cropBottom)){var ix=Math.max(ss.x,x),iy=Math.max(ss.y,y),iw=Math.min(ss.r,cropRight)-ix,ih=Math.min(ss.b,cropBottom)-iy;ow=iw,oh=ih,ox=flipX?cx+(cw-(ix-ss.x)-iw):cx+(ix-ss.x),oy=flipY?cy+(ch-(iy-ss.y)-ih):cy+(iy-ss.y),x=ix,y=iy,width=iw,height=ih}else ox=0,oy=0,ow=0,oh=0}else flipX&&(ox=cx+(cw-x-width)),flipY&&(oy=cy+(ch-y-height));var tw=this.source.width,th=this.source.height;return crop.u0=Math.max(0,ox/tw),crop.v0=Math.max(0,oy/th),crop.u1=Math.min(1,(ox+ow)/tw),crop.v1=Math.min(1,(oy+oh)/th),crop.x=x,crop.y=y,crop.cx=ox,crop.cy=oy,crop.cw=ow,crop.ch=oh,crop.width=width,crop.height=height,crop.flipX=flipX,crop.flipY=flipY,crop},updateCropUVs:function(crop,flipX,flipY){return this.setCropUVs(crop,crop.x,crop.y,crop.width,crop.height,flipX,flipY)},setUVs:function(width,height,u0,v0,u1,v1){var cd=this.data.drawImage;return cd.width=width,cd.height=height,this.u0=u0,this.v0=v0,this.u1=u1,this.v1=v1,this},updateUVs:function(){var cx=this.cutX,cy=this.cutY,cw=this.cutWidth,ch=this.cutHeight,cd=this.data.drawImage;cd.width=cw,cd.height=ch;var tw=this.source.width,th=this.source.height;return this.u0=cx/tw,this.v0=cy/th,this.u1=(cx+cw)/tw,this.v1=(cy+ch)/th,this},updateUVsInverted:function(){var tw=this.source.width,th=this.source.height;return this.u0=(this.cutX+this.cutHeight)/tw,this.v0=this.cutY/th,this.u1=this.cutX/tw,this.v1=(this.cutY+this.cutWidth)/th,this},clone:function(){var clone=new Frame$4(this.texture,this.name,this.sourceIndex);return clone.cutX=this.cutX,clone.cutY=this.cutY,clone.cutWidth=this.cutWidth,clone.cutHeight=this.cutHeight,clone.x=this.x,clone.y=this.y,clone.width=this.width,clone.height=this.height,clone.halfWidth=this.halfWidth,clone.halfHeight=this.halfHeight,clone.centerX=this.centerX,clone.centerY=this.centerY,clone.rotated=this.rotated,clone.data=Extend$j(!0,clone.data,this.data),clone.updateUVs(),clone},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}}),Frame_1=Frame$4,CanvasPool$6=CanvasPool_1,IsSizePowerOfTwo$1=IsSizePowerOfTwo_1,ScaleModes=ScaleModes_1,TextureSource$1=new Class_1({initialize:function(texture,source,width,height,flipY){void 0===flipY&&(flipY=!1);var game=texture.manager.game;this.renderer=game.renderer,this.texture=texture,this.source=source,this.image=source,this.compressionAlgorithm=null,this.resolution=1,this.width=width||source.naturalWidth||source.videoWidth||source.width||0,this.height=height||source.naturalHeight||source.videoHeight||source.height||0,this.scaleMode=ScaleModes.DEFAULT,this.isCanvas=source instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&source instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===source.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&source instanceof WebGLTexture,this.isPowerOf2=IsSizePowerOfTwo$1(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=flipY,this.init(game)},init:function(game){var renderer=this.renderer;renderer&&(renderer.gl?this.isCanvas?this.glTexture=renderer.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=renderer.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.glTexture=renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),game.config.antialias||this.setFilter(1)},setFilter:function(filterMode){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,filterMode),this.scaleMode=filterMode},setFlipY:function(value){return void 0===value&&(value=!0),this.flipY=value,this},update:function(){var gl=this.renderer.gl;gl&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):gl&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!0),this.isCanvas&&CanvasPool$6.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}}),TextureSource_1=TextureSource$1,CONST$W=_const$e,Frame$3=Frame_1,TextureSource=TextureSource_1,Texture$2=new Class_1({initialize:function(manager,key,source,width,height){Array.isArray(source)||(source=[source]),this.manager=manager,this.key=key,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var i=0;i<source.length;
189i++)this.source.push(new TextureSource(this,source[i],width,height))},add:function(name,sourceIndex,x,y,width,height){if(this.has(name))return null;var frame=new Frame$3(this,name,sourceIndex,x,y,width,height);return this.frames[name]=frame,"__BASE"===this.firstFrame&&(this.firstFrame=name),this.frameTotal++,frame},remove:function(name){return!!this.has(name)&&(this.get(name).destroy(),delete this.frames[name],!0)},has:function(name){return this.frames[name]},get:function(name){name||(name=this.firstFrame);var frame=this.frames[name];return frame||(console.warn("Texture.frame missing: "+name),frame=this.frames[this.firstFrame]),frame},getTextureSourceIndex:function(source){for(var i=0;i<this.source.length;i++)if(this.source[i]===source)return i;return-1},getFramesFromTextureSource:function(sourceIndex,includeBase){void 0===includeBase&&(includeBase=!1);var out=[];for(var frameName in this.frames)if("__BASE"!==frameName||includeBase){var frame=this.frames[frameName];frame.sourceIndex===sourceIndex&&out.push(frame)}return out},getFrameNames:function(includeBase){void 0===includeBase&&(includeBase=!1);var out=Object.keys(this.frames);if(!includeBase){var idx=out.indexOf("__BASE");-1!==idx&&out.splice(idx,1)}return out},getSourceImage:function(name){null!=name&&1!==this.frameTotal||(name="__BASE");var frame=this.frames[name];return frame?frame.source.image:(console.warn("Texture.frame missing: "+name),this.frames.__BASE.source.image)},getDataSourceImage:function(name){null!=name&&1!==this.frameTotal||(name="__BASE");var idx,frame=this.frames[name];return frame?idx=frame.sourceIndex:(console.warn("Texture.frame missing: "+name),idx=this.frames.__BASE.sourceIndex),this.dataSource[idx].image},setDataSource:function(data){Array.isArray(data)||(data=[data]);for(var i=0;i<data.length;i++){var source=this.source[i];this.dataSource.push(new TextureSource(this,data[i],source.width,source.height))}},setFilter:function(filterMode){var i;for(i=0;i<this.source.length;i++)this.source[i].setFilter(filterMode);for(i=0;i<this.dataSource.length;i++)this.dataSource[i].setFilter(filterMode)},destroy:function(){var i;for(i=0;i<this.source.length;i++)this.source[i].destroy();for(i=0;i<this.dataSource.length;i++)this.dataSource[i].destroy();for(var frameName in this.frames){this.frames[frameName].destroy()}this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key);var renderer=this.manager.game.renderer;renderer&&renderer.type===CONST$W.WEBGL&&renderer.resetTextures(!0),this.manager=null}}),Texture_1=Texture$2,Clamp$6=Clamp_1,Color$2=Color_1,CONST$V=_const$e,IsSizePowerOfTwo=IsSizePowerOfTwo_1,Texture$1=Texture_1,CanvasTexture$1=new Class_1({Extends:Texture$1,initialize:function(manager,key,source,width,height){Texture$1.call(this,manager,key,source,width,height),this.add("__BASE",0,0,0,width,height),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=width,this.height=height,this.imageData=this.context.getImageData(0,0,width,height),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===CONST$V.WEBGL&&this.refresh(),this},draw:function(x,y,source){return this.context.drawImage(source,x,y),this.update()},drawFrame:function(key,frame,x,y){void 0===x&&(x=0),void 0===y&&(y=0);var textureFrame=this.manager.getFrame(key,frame);if(textureFrame){var cd=textureFrame.canvasData,width=textureFrame.cutWidth,height=textureFrame.cutHeight,res=textureFrame.source.resolution;return this.context.drawImage(textureFrame.source.image,cd.x,cd.y,width,height,x,y,width/res,height/res),this.update()}return this},setPixel:function(x,y,red,green,blue,alpha){if(void 0===alpha&&(alpha=255),x=Math.abs(Math.floor(x)),y=Math.abs(Math.floor(y)),this.getIndex(x,y)>-1){var imageData=this.context.getImageData(x,y,1,1);imageData.data[0]=red,imageData.data[1]=green,imageData.data[2]=blue,imageData.data[3]=alpha,this.context.putImageData(imageData,x,y)}return this},putData:function(imageData,x,y,dirtyX,dirtyY,dirtyWidth,dirtyHeight){return void 0===dirtyX&&(dirtyX=0),void 0===dirtyY&&(dirtyY=0),void 0===dirtyWidth&&(dirtyWidth=imageData.width),void 0===dirtyHeight&&(dirt
vendor: 8,445 bytes, line 189
189yHeight=imageData.height),this.context.putImageData(imageData,x,y,dirtyX,dirtyY,dirtyWidth,dirtyHeight),this},getData:function(x,y,width,height){return x=Clamp$6(Math.floor(x),0,this.width-1),y=Clamp$6(Math.floor(y),0,this.height-1),width=Clamp$6(width,1,this.width-x),height=Clamp$6(height,1,this.height-y),this.context.getImageData(x,y,width,height)},getPixel:function(x,y,out){out||(out=new Color$2);var index=this.getIndex(x,y);if(index>-1){var data=this.data,r=data[index+0],g=data[index+1],b=data[index+2],a=data[index+3];out.setTo(r,g,b,a)}return out},getPixels:function(x,y,width,height){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=this.width),void 0===height&&(height=width),x=Math.abs(Math.round(x)),y=Math.abs(Math.round(y));for(var left=Clamp$6(x,0,this.width),right=Clamp$6(x+width,0,this.width),top=Clamp$6(y,0,this.height),bottom=Clamp$6(y+height,0,this.height),pixel=new Color$2,out=[],py=top;py<bottom;py++){for(var row=[],px=left;px<right;px++)pixel=this.getPixel(px,py,pixel),row.push({x:px,y:py,color:pixel.color,alpha:pixel.alphaGL});out.push(row)}return out},getIndex:function(x,y){return x=Math.abs(Math.round(x)),y=Math.abs(Math.round(y)),x<this.width&&y<this.height?4*(x+y*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(x,y,width,height){return void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=this.width),void 0===height&&(height=this.height),this.context.clearRect(x,y,width,height),this.update()},setSize:function(width,height){return void 0===height&&(height=width),width===this.width&&height===this.height||(this.canvas.width=width,this.canvas.height=height,this._source.width=width,this._source.height=height,this._source.isPowerOf2=IsSizePowerOfTwo(width,height),this.frames.__BASE.setSize(width,height,0,0),this.width=width,this.height=height,this.refresh()),this},destroy:function(){Texture$1.prototype.destroy.call(this),this._source=null,this.canvas=null,this.context=null,this.imageData=null,this.data=null,this.pixels=null,this.buffer=null}}),CanvasTexture_1=CanvasTexture$1,AtlasXML_1=function(texture,sourceIndex,xml){if(xml.getElementsByTagName("TextureAtlas")){var source=texture.source[sourceIndex];texture.add("__BASE",sourceIndex,0,0,source.width,source.height);for(var newFrame,frames=xml.getElementsByTagName("SubTexture"),i=0;i<frames.length;i++){var frame=frames[i].attributes,name=frame.name.value,x=parseInt(frame.x.value,10),y=parseInt(frame.y.value,10),width=parseInt(frame.width.value,10),height=parseInt(frame.height.value,10);if(newFrame=texture.add(name,sourceIndex,x,y,width,height),frame.frameX){var frameX=Math.abs(parseInt(frame.frameX.value,10)),frameY=Math.abs(parseInt(frame.frameY.value,10)),frameWidth=parseInt(frame.frameWidth.value,10),frameHeight=parseInt(frame.frameHeight.value,10);newFrame.setTrim(width,height,frameX,frameY,frameWidth,frameHeight)}}return texture}console.warn("Invalid Texture Atlas XML given")},Clone$b=Clone_1$7,JSONArray_1=function(texture,sourceIndex,json){if(json.frames||json.textures){var source=texture.source[sourceIndex];texture.add("__BASE",sourceIndex,0,0,source.width,source.height);for(var newFrame,frames=Array.isArray(json.textures)?json.textures[sourceIndex].frames:json.frames,i=0;i<frames.length;i++){var src=frames[i];newFrame=texture.add(src.filename,sourceIndex,src.frame.x,src.frame.y,src.frame.w,src.frame.h),src.trimmed&&newFrame.setTrim(src.sourceSize.w,src.sourceSize.h,src.spriteSourceSize.x,src.spriteSourceSize.y,src.spriteSourceSize.w,src.spriteSourceSize.h),src.rotated&&(newFrame.rotated=!0,newFrame.updateUVsInverted());var pivot=src.anchor||src.pivot;pivot&&(newFrame.customPivot=!0,newFrame.pivotX=pivot.x,newFrame.pivotY=pivot.y),newFrame.customData=Clone$b(src)}for(var dataKey in json)"frames"!==dataKey&&(Array.isArray(json[dataKey])?texture.customData[dataKey]=json[dataKey].slice(0):texture.customData[dataKey]=json[dataKey]);return texture}console.warn("Invalid Texture Atlas JSON Array")},Clone$a=Clone_1$7,JSONHash_1=function(texture,sourceIndex,json){if(json.frames){var source=texture.source[sourceIndex];texture.add("__BASE",sourceIndex,0,0,source.width,source.height);var newFrame,frames=json.frames;for(var key in frames)if(frames.hasOwnProperty(key)){var src=frames[key];newFrame=texture.add(key,sourceIndex,src.frame.x,src.frame.y,src.frame.w,src.frame.h),src.trimmed&&newFrame.setTrim(src.sourceSize.w,src.sourceSize.h,src.spriteSourceSize.x,src.spriteSourceSize.y,src.spriteSourceSize.w,src.spriteSourceSize.h),src.rotated&&(newFrame.rotated=!0,newFrame.updateUVsInverted());var pivot=src.anchor||src.pivot;pivot&&(newFrame.customPivot=!0,newFrame.pivotX=pivot.x,newFrame.pivotY=pivot.y),newFrame.customData=Clone$a(src)}for(var dataKey in json)"frames"!==dataKey&&(Array.isArray(json[dataKey])?texture.customData[dataKey]=json[dataKey].slice(0):texture.customData[dataKey]=json[dataKey]);return texture}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")},GetFastValue$$=GetFastValue_1,SpriteSheet_1=function(texture,sourceIndex,x,y,width,height,config){var frameWidth=GetFastValue$$(config,"frameWidth",null),frameHeight=GetFastValue$$(config,"frameHeight",frameWidth);if(null===frameWidth)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var source=texture.source[sourceIndex];texture.add("__BASE",sourceIndex,0,0,source.width,source.height);var startFrame=GetFastValue$$(config,"startFrame",0),endFrame=GetFastValue$$(config,"endFrame",-1),margin=GetFastValue$$(config,"margin",0),spacing=GetFastValue$$(config,"spacing",0),total=Math.floor((width-margin+spacing)/(frameWidth+spacing))*Math.floor((height-margin+spacing)/(frameHeight+spacing));0===total&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",texture.key),(startFrame>total||startFrame<-total)&&(startFrame=0),startFrame<0&&(startFrame=total+startFrame),-1!==endFrame&&(total=startFrame+(endFrame+1));for(var fx=margin,fy=margin,ax=0,ay=0,i=0;i<total;i++){ax=0,ay=0;var w=fx+frameWidth,h=fy+frameHeight;w>width&&(ax=w-width),h>height&&(ay=h-height),texture.add(i,sourceIndex,x+fx,y+fy,frameWidth-ax,frameHeight-ay),(fx+=frameWidth+spacing)+frameWidth>width&&(fx=margin,fy+=frameHeight+spacing)}return texture},GetFastValue$_=GetFastValue_1,imageHeight=0,addFrame=function(texture,sourceIndex,name,frame){var y=imageHeight-frame.y-frame.height;texture.add(name,sourceIndex,frame.x,y,frame.width,frame.height)},UnityYAML_1=function(texture,sourceIndex,yaml){var source=texture.source[sourceIndex];texture.add("__BASE",sourceIndex,0,0,source.width,source.height),imageHeight=source.height;for(var data=yaml.split("\n"),lineRegExp=/^[ ]*(- )*(\w+)+[: ]+(.*)/,prevSprite="",currentSprite="",rect={x:0,y:0,width:0,height:0},i=0;i<data.length;i++){var results=data[i].match(lineRegExp);if(results){var isList="- "===results[1],key=results[2],value=results[3];if(isList&&(currentSprite!==prevSprite&&(addFrame(texture,sourceIndex,currentSprite,rect),prevSprite=currentSprite),rect={x:0,y:0,width:0,height:0}),"name"!==key)switch(key){case"x":case"y":case"width":case"height":rect[key]=parseInt(value,10)}else currentSprite=value}}return currentSprite!==prevSprite&&addFrame(texture,sourceIndex,currentSprite,rect),texture},parsers$1={AtlasXML:AtlasXML_1,Canvas:function(texture,sourceIndex){var source=texture.source[sourceIndex];return texture.add("__BASE",sourceIndex,0,0,source.width,source.height),texture},Image:function(texture,sourceIndex){var source=texture.source[sourceIndex];return texture.add("__BASE",sourceIndex,0,0,source.width,source.height),texture},JSONArray:JSONArray_1,JSONHash:JSONHash_1,SpriteSheet:SpriteSheet_1,SpriteSheetFromAtlas:function(texture,frame,config){var frameWidth=GetFastValue$_(config,"frameWidth",null),frameHeight=GetFastValue$_(config,"frameHeight",frameWidth);if(!frameWidth)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var source=texture.source[0];texture.add("__BASE",0,0,0,source.width,source.height),GetFastValue$_(config,"startFrame",0),GetFastValue$_(config,"endFrame",-1);for(var sheetFrame,margin=GetFastValue$_(config,"margin",0),spacing=GetFastValue$_(config,"spacing",0),x=frame.cutX,y=frame.cutY,cutWidth=frame.cutWidth,cutHeight=frame.cutHeight,sheetWidth=frame.realWidth,sheetHeight=frame.realHeight,row=Math.floor((s
189heetWidth-margin+spacing)/(frameWidth+spacing)),column=Math.floor((sheetHeight-margin+spacing)/(frameHeight+spacing)),leftPad=frame.x,leftWidth=frameWidth-leftPad,rightWidth=frameWidth-(sheetWidth-cutWidth-leftPad),topPad=frame.y,topHeight=frameHeight-topPad,bottomHeight=frameHeight-(sheetHeight-cutHeight-topPad),frameX=margin,frameY=margin,frameIndex=0,sourceIndex=frame.sourceIndex,sheetY=0;sheetY<column;sheetY++){for(var topRow=0===sheetY,bottomRow=sheetY===column-1,sheetX=0;sheetX<row;sheetX++){var leftRow=0===sheetX,rightRow=sheetX===row-1;if(sheetFrame=texture.add(frameIndex,sourceIndex,x+frameX,y+frameY,frameWidth,frameHeight),leftRow||topRow||rightRow||bottomRow){var destX=leftRow?leftPad:0,destY=topRow?topPad:0,trimWidth=0,trimHeight=0;leftRow&&(trimWidth+=frameWidth-leftWidth),rightRow&&(trimWidth+=frameWidth-rightWidth),topRow&&(trimHeight+=frameHeight-topHeight),bottomRow&&(trimHeight+=frameHeight-bottomHeight);var destWidth=frameWidth-trimWidth,destHeight=frameHeight-trimHeight;sheetFrame.cutWidth=destWidth,sheetFrame.cutHeight=destHeight,sheetFrame.setTrim(frameWidth,frameHeight,destX,destY,destWidth,destHeight)}frameX+=spacing,frameX+=leftRow?leftWidth:rightRow?rightWidth:frameWidth,frameIndex++}frameX=margin,frameY+=spacing,frameY+=topRow?topHeight:bottomRow?bottomHeight:frameHeight}return texture},UnityYAML:UnityYAML_1},CanvasPool$5=CanvasPool_1,CanvasTexture=CanvasTexture_1,Color$1=Color_1,CONST$U=_const$e,EventEmitter$j=eventemitter3.exports,Events$w=events$b,GameEvents$6=events$k,GenerateTexture=GenerateTexture_1,GetValue$o=GetValue_1,Parser=parsers$1,Texture=Texture_1,TextureManager$1=new Class_1({Extends:EventEmitter$j,initialize:function(game){EventEmitter$j.call(this),this.game=game,this.name="TextureManager",this.list={},this._tempCanvas=CanvasPool$5.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,game.events.once(GameEvents$6.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(Events$w.LOAD,this.updatePending,this),this.on(Events$w.ERROR,this.updatePending,this);var config=this.game.config;this.addBase64("__DEFAULT",config.defaultImage),this.addBase64("__MISSING",config.missingImage),this.addBase64("__WHITE",config.whiteImage),this.game.events.once(GameEvents$6.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(Events$w.LOAD),this.off(Events$w.ERROR),this.emit(Events$w.READY))},checkKey:function(key){return!this.exists(key)||(console.error("Texture key already in use: "+key),!1)},remove:function(key){if("string"==typeof key){if(!this.exists(key))return console.warn("No texture found matching key: "+key),this;key=this.get(key)}return this.list.hasOwnProperty(key.key)&&(key.destroy(),this.emit(Events$w.REMOVE,key.key)),this},removeKey:function(key){return this.list.hasOwnProperty(key)&&delete this.list[key],this},addBase64:function(key,data){if(this.checkKey(key)){var _this=this,image=new Image;image.onerror=function(){_this.emit(Events$w.ERROR,key)},image.onload=function(){var texture=_this.create(key,image);Parser.Image(texture,0),_this.emit(Events$w.ADD,key,texture),_this.emit(Events$w.LOAD,key,texture)},image.src=data}return this},getBase64:function(key,frame,type,encoderOptions){void 0===type&&(type="image/png"),void 0===encoderOptions&&(encoderOptions=.92);var data="",textureFrame=this.getFrame(key,frame);if(textureFrame&&(textureFrame.source.isRenderTexture||textureFrame.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(textureFrame){var cd=textureFrame.canvasData,canvas=CanvasPool$5.create2D(this,cd.width,cd.height);canvas.getContext("2d").drawImage(textureFrame.source.image,cd.x,cd.y,cd.width,cd.height,0,0,cd.width,cd.height),data=canvas.toDataURL(type,encoderOptions),CanvasPool$5.remove(canvas)}return data},addImage:function(key,source,dataSource){var texture=null;return this.checkKey(key)&&(texture=this.create(key,source),Parser.Image(texture,0),dataSource&&texture.setDataSource(dataSource),this.emit(Events$w.ADD,key,texture)),texture},addGLTexture:function(key,glTexture,width,height){var texture=null;return this.checkKey(key)&&(void 0===width&&(width=glTexture.width),void 0===height&&(height=glTexture.height),(texture=this.create(key,glTexture,width,height)).add("__BASE",0,0,0,width,height),this.emit
189(Events$w.ADD,key,texture)),texture},addRenderTexture:function(key,renderTexture){var texture=null;return this.checkKey(key)&&((texture=this.create(key,renderTexture)).add("__BASE",0,0,0,renderTexture.width,renderTexture.height),this.emit(Events$w.ADD,key,texture)),texture},generate:function(key,config){if(this.checkKey(key)){var canvas=CanvasPool$5.create(this,1,1);return config.canvas=canvas,GenerateTexture(config),this.addCanvas(key,canvas)}return null},createCanvas:function(key,width,height){if(void 0===width&&(width=256),void 0===height&&(height=256),this.checkKey(key)){var canvas=CanvasPool$5.create(this,width,height,CONST$U.CANVAS,!0);return this.addCanvas(key,canvas)}return null},addCanvas:function(key,source,skipCache){void 0===skipCache&&(skipCache=!1);var texture=null;return skipCache?texture=new CanvasTexture(this,key,source,source.width,source.height):this.checkKey(key)&&(texture=new CanvasTexture(this,key,source,source.width,source.height),this.list[key]=texture,this.emit(Events$w.ADD,key,texture)),texture},addAtlas:function(key,source,data,dataSource){return Array.isArray(data.textures)||Array.isArray(data.frames)?this.addAtlasJSONArray(key,source,data,dataSource):this.addAtlasJSONHash(key,source,data,dataSource)},addAtlasJSONArray:function(key,source,data,dataSource){var texture=null;if(this.checkKey(key)){if(texture=this.create(key,source),Array.isArray(data))for(var singleAtlasFile=1===data.length,i=0;i<texture.source.length;i++){var atlasData=singleAtlasFile?data[0]:data[i];Parser.JSONArray(texture,i,atlasData)}else Parser.JSONArray(texture,0,data);dataSource&&texture.setDataSource(dataSource),this.emit(Events$w.ADD,key,texture)}return texture},addAtlasJSONHash:function(key,source,data,dataSource){var texture=null;if(this.checkKey(key)){if(texture=this.create(key,source),Array.isArray(data))for(var i=0;i<data.length;i++)Parser.JSONHash(texture,i,data[i]);else Parser.JSONHash(texture,0,data);dataSource&&texture.setDataSource(dataSource),this.emit(Events$w.ADD,key,texture)}return texture},addAtlasXML:function(key,source,data,dataSource){var texture=null;return this.checkKey(key)&&(texture=this.create(key,source),Parser.AtlasXML(texture,0,data),dataSource&&texture.setDataSource(dataSource),this.emit(Events$w.ADD,key,texture)),texture},addUnityAtlas:function(key,source,data,dataSource){var texture=null;return this.checkKey(key)&&(texture=this.create(key,source),Parser.UnityYAML(texture,0,data),dataSource&&texture.setDataSource(dataSource),this.emit(Events$w.ADD,key,texture)),texture},addSpriteSheet:function(key,source,config){var texture=null;if(this.checkKey(key)){var width=(texture=this.create(key,source)).source[0].width,height=texture.source[0].height;Parser.SpriteSheet(texture,0,0,0,width,height,config),this.emit(Events$w.ADD,key,texture)}return texture},addSpriteSheetFromAtlas:function(key,config){if(!this.checkKey(key))return null;var atlasKey=GetValue$o(config,"atlas",null),atlasFrame=GetValue$o(config,"frame",null);if(atlasKey&&atlasFrame){var sheet=this.get(atlasKey).get(atlasFrame);if(sheet){var texture=this.create(key,sheet.source.image);return sheet.trimmed?Parser.SpriteSheetFromAtlas(texture,sheet,config):Parser.SpriteSheet(texture,0,sheet.cutX,sheet.cutY,sheet.cutWidth,sheet.cutHeight,config),this.emit(Events$w.ADD,key,texture),texture}}},create:function(key,source,width,height){var texture=null;return this.checkKey(key)&&(texture=new Texture(this,key,source,width,height),this.list[key]=texture),texture},exists:function(key){return this.list.hasOwnProperty(key)},get:function(key){return void 0===key&&(key="__DEFAULT"),this.list[key]?this.list[key]:key instanceof Texture?key:this.list.__MISSING},cloneFrame:function(key,frame){if(this.list[key])return this.list[key].get(frame).clone()},getFrame:function(key,frame){if(this.list[key])return this.list[key].get(frame)},getTextureKeys:function(){var output=[];for(var key in this.list)"__DEFAULT"!==key&&"__MISSING"!==key&&output.push(key);return output},getPixel:function(x,y,key,frame){var textureFrame=this.getFrame(key,frame);if(textureFrame){x-=textureFrame.x,y-=textureFrame.y;var data=textureFrame.data.cut;if(x+=data.x,y+=data.y,x>=data.x&&x<data.r&&y>=data.y&&y<data.b){var ctx=this._tempContext;ctx.clearRect(0,0,1,1),ctx.drawImage(textureFrame.source.image,x,y,1,1,0,0,1,1);var rgb=ctx.getImageData(0,0,1,1);return new Color$1(rgb.data[0],rgb.data[1],rgb.data[2],rgb.data[3])}}return null},getPixelAlpha:function(x,y,key,frame){var textureFrame=this.getFrame(key,frame);if(textureFrame){x-=textureFrame.x,y-=textureFrame.y;var data=textureFrame.data.cut;if(x+=data.x,y+=data.y,x>=data.x&&x<data.r&&y>=data.y&&y<data.b){var ctx=this._tempContext;return ctx.clearRect(0,0,1,1),ctx.drawImage(textureFrame.source.image,x,y,1,1,0,0,1,1),ctx.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(gameObject,key,frame){return this.list[key]&&(gameObject.texture=this.list[key],gameObject.frame=gameObject.texture.get(frame)),gameObject},renameTexture:function(currentKey,newKey){var texture=this.get(currentKey);return!(!texture||currentKey===newKey)&&(texture.key=newKey,this.list[newKey]=texture,delete this.list[currentKey],!0)},each:function(callback,scope){for(var args=[null],i=1;i<arguments.length;i++)args.push(arguments[i]);for(var texture in this.list)args[0]=this.list[texture],callback.apply(scope,args)},destroy:function(){for(var texture in this.list)this.list[texture].destroy();this.list={},this.game=null,CanvasPool$5.remove(this._tempCanvas)}}),TextureManager_1=TextureManager$1,events$6={COMPLETE:"complete",DECODED:"decoded",DECODED_ALL:"decodedall",DESTROY:"destroy",DETUNE:"detune",GLOBAL_DETUNE:"detune",GLOBAL_MUTE:"mute",GLOBAL_RATE:"rate",GLOBAL_VOLUME:"volume",LOOP:"loop",LOOPED:"looped",MUTE:"mute",PAN:"pan",PAUSE_ALL:"pauseall",PAUSE:"pause",PLAY:"play",RATE:"rate",RESUME_ALL:"resumeall",RESUME:"resume",SEEK:"seek",STOP_ALL:"stopall",STOP:"stop",UNLOCKED:"unlocked",VOLUME:"volume"},SafeRange_1=function(array,startIndex,endIndex,throwError){var len=array.length;if(startIndex<0||startIndex>len||startIndex>=endIndex||endIndex>len||startIndex+endIndex>
189len){if(throwError)throw new Error("Range Error: Values outside acceptable range");return!1}return!0},SafeRange$5=SafeRange_1,GetAll_1=function(array,property,value,startIndex,endIndex){void 0===startIndex&&(startIndex=0),void 0===endIndex&&(endIndex=array.length);var output=[];if(SafeRange$5(array,startIndex,endIndex))for(var i=startIndex;i<endIndex;i++){var child=array[i];(!property||property&&void 0===value&&child.hasOwnProperty(property)||property&&void 0!==value&&child[property]===value)&&output.push(child)}return output},SafeRange$4=SafeRange_1,GetFirst_1=function(array,property,value,startIndex,endIndex){if(void 0===startIndex&&(startIndex=0),void 0===endIndex&&(endIndex=array.length),SafeRange$4(array,startIndex,endIndex))for(var i=startIndex;i<endIndex;i++){var child=array[i];if(!property||property&&void 0===value&&child.hasOwnProperty(property)||property&&void 0!==value&&child[property]===value)return child}return null},Clone$9=Clone_1$7,EventEmitter$i=eventemitter3.exports,Events$v=events$6,GameEvents$5=events$k,GetAll$1=GetAll_1,GetFirst=GetFirst_1,BaseSoundManager$3=new Class_1({Extends:EventEmitter$i,initialize:function(game){EventEmitter$i.call(this),this.game=game,this.jsonCache=game.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,game.events.on(GameEvents$5.BLUR,this.onGameBlur,this),game.events.on(GameEvents$5.FOCUS,this.onGameFocus,this),game.events.on(GameEvents$5.PRE_STEP,this.update,this),game.events.once(GameEvents$5.DESTROY,this.destroy,this)},add:NOOP_1,addAudioSprite:function(key,config){void 0===config&&(config={});var sound=this.add(key,config);for(var markerName in sound.spritemap=this.jsonCache.get(key).spritemap,sound.spritemap)if(sound.spritemap.hasOwnProperty(markerName)){var markerConfig=Clone$9(config),marker=sound.spritemap[markerName];markerConfig.loop=!!marker.hasOwnProperty("loop")&&marker.loop,sound.addMarker({name:markerName,start:marker.start,duration:marker.end-marker.start,config:markerConfig})}return sound},get:function(key){return GetFirst(this.sounds,"key",key)},getAll:function(key){return GetAll$1(this.sounds,"key",key)},play:function(key,extra){var sound=this.add(key);return sound.once(Events$v.COMPLETE,sound.destroy,sound),extra?extra.name?(sound.addMarker(extra),sound.play(extra.name)):sound.play(extra):sound.play()},playAudioSprite:function(key,spriteName,config){var sound=this.addAudioSprite(key);return sound.once(Events$v.COMPLETE,sound.destroy,sound),sound.play(spriteName,config)},remove:function(sound){var index=this.sounds.indexOf(sound);return-1!==index&&(sound.destroy(),this.sounds.splice(index,1),!0)},removeAll:function(){this.sounds.forEach((function(sound){sound.destroy()})),this.sounds.length=0},removeByKey:function(key){for(var removed=0,i=this.sounds.length-1;i>=0;i--){var sound=this.sounds[i];sound.key===key&&(sound.destroy(),this.sounds.splice(i,1),removed++)}return removed},pauseAll:function(){this.forEachActiveSound((function(sound){sound.pause()})),this.emit(Events$v.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(sound){sound.resume()})),this.emit(Events$v.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(sound){sound.stop()})),this.emit(Events$v.STOP_ALL,this)},stopByKey:function(key){var stopped=0;
189return this.getAll(key).forEach((function(sound){sound.stop()&&stopped++})),stopped},unlock:NOOP_1,onBlur:NOOP_1,onFocus:NOOP_1,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(time,delta){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(Events$v.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(sound){sound.update(time,delta)}))},destroy:function(){this.game.events.off(GameEvents$5.BLUR,this.onGameBlur,this),this.game.events.off(GameEvents$5.FOCUS,this.onGameFocus,this),this.game.events.off(GameEvents$5.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(callback,scope){var _this=this;this.sounds.forEach((function(sound,index){sound&&!sound.pendingRemove&&callback.call(scope||_this,sound,index,_this.sounds)}))},setRate:function(value){return this.rate=value,this},rate:{get:function(){return this._rate},set:function(value){this._rate=value,this.forEachActiveSound((function(sound){sound.calculateRate()})),this.emit(Events$v.GLOBAL_RATE,this,value)}},setDetune:function(value){return this.detune=value,this},detune:{get:function(){return this._detune},set:function(value){this._detune=value,this.forEachActiveSound((function(sound){sound.calculateRate()})),this.emit(Events$v.GLOBAL_DETUNE,this,value)}}}),BaseSoundManager_1=BaseSoundManager$3,EventEmitter$h=eventemitter3.exports,Events$u=events$6,Extend$i=Extend_1$1,BaseSound$3=new Class_1({Extends:EventEmitter$h,initialize:function(manager,key,config){EventEmitter$h.call(this),this.manager=manager,this.key=key,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=Extend$i(this.config,config),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(marker){return!(!marker||!marker.name||"string"!=typeof marker.name)&&(this.markers[marker.name]?(console.error("addMarker "+marker.name+" already exists in Sound"),!1):(marker=Extend$i(!0,{name:"",start:0,duration:this.totalDuration-(marker.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},marker),this.markers[marker.name]=marker,!0))},updateMarker:function(marker){return!(!marker||!marker.name||"string"!=typeof marker.name)&&(this.markers[marker.name]?(this.markers[marker.name]=Extend$i(!0,this.markers[marker.name],marker),!0):(console.warn("Audio Marker: "+marker.name+" missing in Sound: "+this.key),!1))},removeMarker:function(markerName){var marker=this.markers[markerName];return marker?(this.markers[markerName]=null,marker):null},play:function(markerName,config){if(void 0===markerName&&(markerName=""),"object"==typeof markerName&&(config=markerName,markerName=""),"string"!=typeof markerName)return!1;if(markerName){if(!this.markers[markerName])return console.warn("Marker: "+markerName+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[markerName],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=Extend$i(this.currentConfig,config),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:NOOP_1,calculateRate:function(){var totalDetune=this.currentConfig.detune+this.manager.detune,detuneRate=Math.pow(1.0005777895065548,totalDetune);this.totalRate=this.currentConfig.rate*this.manager.rate*detuneRate}
189,destroy:function(){this.pendingRemove||(this.emit(Events$u.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}}),BaseSound_1=BaseSound$3,BaseSound$2=BaseSound_1,Events$t=events$6,Clamp$5=Clamp_1,HTML5AudioSound$1=new Class_1({Extends:BaseSound$2,initialize:function(manager,key,config){if(void 0===config&&(config={}),this.tags=manager.game.cache.audio.get(key),!this.tags)throw new Error('There is no audio asset with key "'+key+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,BaseSound$2.call(this,manager,key,config)},play:function(markerName,config){return!this.manager.isLocked(this,"play",[markerName,config])&&(!!BaseSound$2.prototype.play.call(this,markerName,config)&&(!!this.pickAndPlayAudioTag()&&(this.emit(Events$t.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!BaseSound$2.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(Events$t.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!BaseSound$2.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(Events$t.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!BaseSound$2.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(Events$t.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var seek=this.currentConfig.seek,delay=this.currentConfig.delay,offset=(this.currentMarker?this.currentMarker.start:0)+seek;return this.previousTime=offset,this.audio.currentTime=offset,this.applyConfig(),0===delay?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*delay,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var i=0;i<this.tags.length;i++){var audio=this.tags[i];if("false"===audio.dataset.used)return audio.dataset.used="true",this.audio=audio,!0}if(!this.manager.override)return!1;var otherSounds=[];this.manager.forEachActiveSound((function(sound){sound.key===this.key&&sound.audio&&otherSounds.push(sound)}),this),otherSounds.sort((function(a1,a2){return a1.loop===a2.loop?a2.seek/a2.duration-a1.seek/a1.duration:a1.loop?1:-1}));var selectedSound=otherSounds[0];return this.audio=selectedSound.audio,selectedSound.reset(),selectedSound.audio=null,selectedSound.startTime=0,selectedSound.previousTime=0,!0},playCatchPromise:function(){var playPromise=this.audio.play();playPromise&&playPromise.catch((function(reason){console.warn(reason)}))},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){BaseSound$2.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(time){if(this.isPlaying)if(this.startTime>0)this.startTime<time-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,time-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var startTime=this.currentMarker?this.currentMarker.start:0,endTime=startTime+this.duration,currentTime=this.audio.currentTime;if(this.currentConfig.loop)currentTime>=endTime-this.manager.loopEndOffset?(this.audio.currentTime=startTime+Math.max(0,currentTime-endTime),currentTime=this.audio.currentTime):currentTime<startTime&&(this.audio.currentTime+=startTime,currentTime=this.audio.currentTime),currentTime<this.previousTime&&this.emit
189(Events$t.LOOPED,this);else if(currentTime>=endTime)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(Events$t.COMPLETE,this);this.previousTime=currentTime}},destroy:function(){BaseSound$2.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=Clamp$5(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){BaseSound$2.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(value){this.currentConfig.mute=value,this.manager.isLocked(this,"mute",value)||(this.updateMute(),this.emit(Events$t.MUTE,this,value))}},setMute:function(value){return this.mute=value,this},volume:{get:function(){return this.currentConfig.volume},set:function(value){this.currentConfig.volume=value,this.manager.isLocked(this,"volume",value)||(this.updateVolume(),this.emit(Events$t.VOLUME,this,value))}},setVolume:function(value){return this.volume=value,this},rate:{get:function(){return this.currentConfig.rate},set:function(value){this.currentConfig.rate=value,this.manager.isLocked(this,Events$t.RATE,value)||(this.calculateRate(),this.emit(Events$t.RATE,this,value))}},setRate:function(value){return this.rate=value,this},detune:{get:function(){return this.currentConfig.detune},set:function(value){this.currentConfig.detune=value,this.manager.isLocked(this,Events$t.DETUNE,value)||(this.calculateRate(),this.emit(Events$t.DETUNE,this,value))}},setDetune:function(value){return this.detune=value,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(value){this.manager.isLocked(this,"seek",value)||this.startTime>0||(this.isPlaying||this.isPaused)&&(value=Math.min(Math.max(0,value),this.duration),this.isPlaying?(this.previousTime=value,this.audio.currentTime=value):this.isPaused&&(this.currentConfig.seek=value),this.emit(Events$t.SEEK,this,value))}},setSeek:function(value){return this.seek=value,this},loop:{get:function(){return this.currentConfig.loop},set:function(value){this.currentConfig.loop=value,this.manager.isLocked(this,"loop",value)||(this.audio&&(this.audio.loop=value),this.emit(Events$t.LOOP,this,value))}},setLoop:function(value){return this.loop=value,this},pan:{get:function(){return this.currentConfig.pan},set:function(value){this.currentConfig.pan=value,this.emit(Events$t.PAN,this,value)}},setPan:function(value){return this.pan=value,this}}),HTML5AudioSound_1=HTML5AudioSound$1,BaseSoundManager$2=BaseSoundManager_1,Events$s=events$6,HTML5AudioSound=HTML5AudioSound_1,HTML5AudioSoundManager$1=new Class_1({Extends:BaseSoundManager$2,initialize:function(game){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,BaseSoundManager$2.call(this,game)},add:function(key,config){var sound=new HTML5AudioSound(this,key,config);return this.sounds.push(sound),sound},unlock:function(){this.locked=!1;var _this=this;if(this.game.cache.audio.entries.each((function(key,tags){for(var i=0;i<tags.length;i++)if("true"===tags[i].dataset.locked)return _this.locked=!0,!1;return!0})),this.locked){var moved=!1,detectMove=function(){moved=!0},unlock=function(){if(moved)moved=!1;else{document.body.removeEventListener("touchmove",detectMove),document.body.removeEventListener("touchend",unlock);var lockedTags=[];if(_this.game.cache.audio.entries.each((function(key,tags){for(var i=0;i<tags.length;i++){var tag=tags[i];"true"===tag.dataset.locked&&lockedTags.push(tag)}return!0})),0!==lockedTags.length){var lastTag=lockedTags[lockedTags.length-1];lastTag.oncanplaythrough=function(){lastTag.oncanplaythrough=null,lockedTags.forEach((function(tag){tag.dataset.locked="false"})),_this.unlocked=!0},lockedTags.forEach((function(tag){tag.load()}))}}};this.once(Events$s.UNLOCKED,(function(){for(this.forEachActiveSound((function(sound){null===sound.currentMarker&&0===sound.duration&&(sound.duration=sound.tags[0].duration),sound.totalDuration=sound.tags[0].duration}));this.lockedActionsQueue.length;){var lockedAction=this.lockedActionsQueue.shift();lockedAction.sound[lockedAction.prop].apply?lockedAction.sound[lockedAction.prop].apply(lockedAction.sound,lockedAction.value||[]):lockedAction.sound[lockedAction.prop]=lockedAction.value}}),this),document.body.addEventListener("touchmove",detectMove,!1),document.body.addEventListener("touchend",unlock,!1)}},onBlur:function(){this.forEachActiveSound((function(sound){sound.isPlaying&&(this.onBlurPausedSounds.push(sound),sound.onBlur())}))},onFocus:function(){this.onBlurPausedSounds.forEach((function(sound){sound.onFocus()})),this.onBlurPausedSounds.length=0}
189,destroy:function(){BaseSoundManager$2.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(sound,prop,value){return"true"===sound.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:sound,prop:prop,value:value}),!0)},setMute:function(value){return this.mute=value,this},mute:{get:function(){return this._mute},set:function(value){this._mute=value,this.forEachActiveSound((function(sound){sound.updateMute()})),this.emit(Events$s.GLOBAL_MUTE,this,value)}},setVolume:function(value){return this.volume=value,this},volume:{get:function(){return this._volume},set:function(value){this._volume=value,this.forEachActiveSound((function(sound){sound.updateVolume()})),this.emit(Events$s.GLOBAL_VOLUME,this,value)}}}),HTML5AudioSoundManager_1=HTML5AudioSoundManager$1,BaseSound$1=BaseSound_1,EventEmitter$g=eventemitter3.exports,Extend$h=Extend_1$1,returnFalse=function(){return!1},returnThis=function(){return this},NoAudioSound$1=new Class_1({Extends:EventEmitter$g,initialize:function(manager,key,config){void 0===config&&(config={}),EventEmitter$g.call(this),this.manager=manager,this.key=key,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=Extend$h({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},config),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:returnFalse,updateMarker:returnFalse,removeMarker:function(){return null},play:returnFalse,pause:returnFalse,resume:returnFalse,stop:returnFalse,destroy:function(){BaseSound$1.prototype.destroy.call(this)},setMute:returnThis,setVolume:returnThis,setRate:returnThis,setDetune:returnThis,setSeek:returnThis,setLoop:returnThis,setPan:returnThis}),NoAudioSound_1=NoAudioSound$1,BaseSoundManager$1=BaseSoundManager_1,EventEmitter$f=eventemitter3.exports,NoAudioSound=NoAudioSound_1,NoAudioSoundManager$1=new Class_1({Extends:EventEmitter$f,initialize:function(game){EventEmitter$f.call(this),this.game=game,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(key,config){var sound=new NoAudioSound(this,key,config);return this.sounds.push(sound),sound},addAudioSprite:function(key,config){var sound=this.add(key,config);return sound.spritemap={},sound},play:function(key,extra){return!1},playAudioSprite:function(key,spriteName,config){return!1},remove:function(sound){return BaseSoundManager$1.prototype.remove.call(this,sound)},removeByKey:function(key){return BaseSoundManager$1.prototype.removeByKey.call(this,key)},pauseAll:NOOP_1,resumeAll:NOOP_1,stopAll:NOOP_1,update:NOOP_1,setRate:NOOP_1,setDetune:NOOP_1,setMute:NOOP_1,setVolume:NOOP_1,forEachActiveSound:function(callbackfn,scope){BaseSoundManager$1.prototype.forEachActiveSound.call(this,callbackfn,scope)},destroy:function(){BaseSoundManager$1.prototype.destroy.call(this)}}),NoAudioSoundManager_1=NoAudioSoundManager$1,chars$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup=new Uint8Array(256),i=0
190/**
191	 * @author       Richard Davey <[email protected]>
192	 * @copyright    2020 Photon Storm Ltd.
193	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
194	 */;i<chars$1.length;i++)lookup[chars$1.charCodeAt(i)]=i;var Base64ToArrayBuffer_1=function(base64){var encoded1,encoded2,encoded3,encoded4,len=(base64=base64.substr(base64.indexOf(",")+1)).length,bufferLength=.75*len,p=0;"="===base64[len-1]&&(bufferLength--,"="===base64[len-2]&&bufferLength--);for(var arrayBuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arrayBuffer),i=0;i<len;i+=4)encoded1=lookup[base64.charCodeAt(i)],encoded2=lookup[base64.charCodeAt(i+1)],encoded3=lookup[base64.charCodeAt(i+2)],encoded4=lookup[base64.charCodeAt(i+3)],bytes[p++]=encoded1<<2|encoded2>>4,bytes[p++]=(15&encoded2)<<4|encoded3>>2,bytes[p++]=(3&encoded3)<<6|63&encoded4;return arrayBuffer},BaseSound=BaseSound_1,Events$r=events$6,WebAudioSound$1=new Class_1({Extends:BaseSound,initialize:function(manager,key,config){if(void 0===config&&(config={}),this.audioBuffer=manager.game.cache.audio.get(key),!this.audioBuffer)throw new Error('Audio key "'+key+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=manager.context.createGain(),this.volumeNode=manager.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),manager.context.createStereoPanner?(this.pannerNode=manager.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(manager.destination)):this.volumeNode.connect(manager.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,BaseSound.c
vendor: 4,273 bytes, line 194
194all(this,manager,key,config)},play:function(markerName,config){return!!BaseSound.prototype.play.call(this,markerName,config)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(Events$r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!BaseSound.prototype.pause.call(this)&&(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(Events$r.PAUSE,this),!0))},resume:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!BaseSound.prototype.resume.call(this)&&(this.createAndStartBufferSource(),this.emit(Events$r.RESUME,this),!0))},stop:function(){return!!BaseSound.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(Events$r.STOP,this),!0)},createAndStartBufferSource:function(){var seek=this.currentConfig.seek,delay=this.currentConfig.delay,when=this.manager.context.currentTime+delay,offset=(this.currentMarker?this.currentMarker.start:0)+seek,duration=this.duration-seek;this.playTime=when-seek,this.startTime=when,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,when),Math.max(0,offset),Math.max(0,duration)),this.resetConfig()},createAndStartLoopBufferSource:function(){var when=this.getLoopTime(),offset=this.currentMarker?this.currentMarker.start:0,duration=this.duration;this.loopTime=when,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,when),Math.max(0,offset),Math.max(0,duration))},createBufferSource:function(){var _this=this,source=this.manager.context.createBufferSource();return source.buffer=this.audioBuffer,source.connect(this.muteNode),source.onended=function(ev){ev.target===_this.source&&(_this.currentConfig.loop?_this.hasLooped=!0:_this.hasEnded=!0)},source},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),BaseSound.prototype.applyConfig.call(this)},update:function(){this.hasEnded?(this.hasEnded=!1,BaseSound.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(Events$r.COMPLETE,this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit(Events$r.LOOPED,this))},destroy:function(){BaseSound.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.pannerNode&&(this.pannerNode.disconnect(),this.pannerNode=null),this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){BaseSound.prototype.calculateRate.call(this);var now=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,now),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,now)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var currentTime=0,i=0;i<this.rateUpdates.length;i++){currentTime+=((i<this.rateUpdates.length-1?this.rateUpdates[i+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[i].time)*this.rateUpdates[i].rate}return currentTime},getLoopTime:function(){for(var lastRateUpdateCurrentTime=0,i=0;i<this.rateUpdates.length-1;i++)lastRateUpdateCurrentTime+=(this.rateUpdates[i+1].time-this.rateUpdates[i].time)*this.rateUpdates[i].rate;var lastRateUpdate=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+lastRateUpdate.time+(this.duration-lastRateUpdateCurrentTime)/lastRateUpdate.rate},rate:{get:function(){return this.currentConfig.rate},set:function(value){this.currentConfig.rate=value,this.calculateRate(),this.emit
194(Events$r.RATE,this,value)}},setRate:function(value){return this.rate=value,this},detune:{get:function(){return this.currentConfig.detune},set:function(value){this.currentConfig.detune=value,this.calculateRate(),this.emit(Events$r.DETUNE,this,value)}},setDetune:function(value){return this.detune=value,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(value){this.currentConfig.mute=value,this.muteNode.gain.setValueAtTime(value?0:1,0),this.emit(Events$r.MUTE,this,value)}},setMute:function(value){return this.mute=value,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(value){this.currentConfig.volume=value,this.volumeNode.gain.setValueAtTime(value,0),this.emit(Events$r.VOLUME,this,value)}},setVolume:function(value){return this.volume=value,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(value){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(value=Math.min(Math.max(0,value),this.duration),this.currentConfig.seek=value,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit(Events$r.SEEK,this,value))}},setSeek:function(value){return this.seek=value,this},loop:{get:function(){return this.currentConfig.loop},set:function(value){this.currentConfig.loop=value,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),value&&this.createAndStartLoopBufferSource()),this.emit(Events$r.LOOP,this,value)}},setLoop:function(value){return this.loop=value,this},pan:{get:function(){return this.pannerNode?this.pannerNode.pan.value:0},set:function(value){this.currentConfig.pan=value,this.pannerNode&&this.pannerNode.pan.setValueAtTime(value,this.manager.context.currentTime),this.emit(Events$r.PAN,this,value)}},setPan:function(value){return this.pan=value,this}}),WebAudioSound_1=WebAudioSound$1,Base64ToArrayBuffer=Base64ToArrayBuffer_1,BaseSoundManager=BaseSoundManager_1,Events$q=events$6,GameEvents$4=events$k,WebAudioSound=WebAudioSound_1,WebAudioSoundManager$1=new Class_1({Extends:BaseSoundManager,initialize:function(game){this.context=this.createAudioContext(game),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),BaseSoundManager.call(this,game),this.locked&&game.isBooted?this.unlock():game.events.once(GameEvents$4.BOOT,this.unlock,this)},createAudioContext:function(game){var audioConfig=game.config.audio;return audioConfig.context?(audioConfig.context.resume(),audioConfig.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(context){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=context,this.masterMuteNode=context.createGain(),this.masterVolumeNode=context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(context.destination),this.destination=this.masterMuteNode,this},add:function(key,config){var sound=new WebAudioSound(this,key,config);return this.sounds.push(sound),sound},decodeAudio:function(audioKey,audioData){var audioFiles;audioFiles=Array.isArray(audioKey)?audioKey:[{key:audioKey,data:audioData}];for(var cache=this.game.cache.audio,remaining=audioFiles.length,i=0;i<audioFiles.length;i++){var entry=audioFiles[i],key=entry.key,data=entry.data;"string"==typeof data&&(data=Base64ToArrayBuffer(data));var success=function(key,audioBuffer){cache.add(key,audioBuffer),this.emit(Events$q.DECODED,key),0===--remaining&&this.emit(Events$q.DECODED_ALL)}.bind(this,key),failure=function(key,error){console.error("Error decoding audio: "+key+" - ",error?error.message:""),0===--remaining&&this.emit
194(Events$q.DECODED_ALL)}.bind(this,key);this.context.decodeAudioData(data,success,failure)}},unlock:function(){var _this=this,body=document.body,unlockHandler=function unlockHandler(){if(_this.context&&body){var bodyRemove=body.removeEventListener;_this.context.resume().then((function(){bodyRemove("touchstart",unlockHandler),bodyRemove("touchend",unlockHandler),bodyRemove("click",unlockHandler),bodyRemove("keydown",unlockHandler),_this.unlocked=!0}),(function(){bodyRemove("touchstart",unlockHandler),bodyRemove("touchend",unlockHandler),bodyRemove("click",unlockHandler),bodyRemove("keydown",unlockHandler)}))}};body&&(body.addEventListener("touchstart",unlockHandler,!1),body.addEventListener("touchend",unlockHandler,!1),body.addEventListener("click",unlockHandler,!1),body.addEventListener("keydown",unlockHandler,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){var context=this.context;"suspended"!==context.state&&"interrupted"!==context.state||this.locked||context.resume()},update:function(time,delta){BaseSoundManager.prototype.update.call(this,time,delta);var context=this.context;context&&"interrupted"===context.state&&context.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio.context)this.context.suspend();else{var _this=this;this.context.close().then((function(){_this.context=null}))}BaseSoundManager.prototype.destroy.call(this)},setMute:function(value){return this.mute=value,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(value){this.masterMuteNode.gain.setValueAtTime(value?0:1,0),this.emit(Events$q.GLOBAL_MUTE,this,value)}},setVolume:function(value){return this.volume=value,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(value){this.masterVolumeNode.gain.setValueAtTime(value,0),this.emit(Events$q.GLOBAL_VOLUME,this,value)}}}),WebAudioSoundManager_1=WebAudioSoundManager$1,HTML5AudioSoundManager=HTML5AudioSoundManager_1,NoAudioSoundManager=NoAudioSoundManager_1,WebAudioSoundManager=WebAudioSoundManager_1,SoundManagerCreator_1={create:function(game){var audioConfig=game.config.audio,deviceAudio=game.device.audio;return audioConfig.noAudio||!deviceAudio.webAudio&&!deviceAudio.audioData?new NoAudioSoundManager(game):deviceAudio.webAudio&&!audioConfig.disableWebAudio?new WebAudioSoundManager(game):new HTML5AudioSoundManager(game)}},AddToDOM$1=AddToDOM_1,AnimationManager=AnimationManager_1,CacheManager=CacheManager_1,CanvasPool$4=CanvasPool_1,Config=Config_1,CreateDOMContainer=CreateDOMContainer_1,CreateRenderer=CreateRenderer_1,DataManager$1=DataManager_1,DebugHeader=DebugHeader_1,Device=device,DOMContentLoaded=DOMContentLoaded_1,EventEmitter$e=eventemitter3.exports,Events$p=events$k,InputManager=InputManager_1,PluginCache$a=PluginCache_
vendor: 12,021 bytes, lines 194-200
1941,PluginManager=PluginManager_1,ScaleManager=ScaleManager_1,SceneManager=SceneManager_1,TextureEvents=events$b,TextureManager=TextureManager_1,TimeStep=TimeStep_1,VisibilityHandler=VisibilityHandler_1,SoundManagerCreator=SoundManagerCreator_1,Game=new Class_1({initialize:function(config){this.config=new Config(config),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new EventEmitter$e,this.anims=new AnimationManager(this),this.textures=new TextureManager(this),this.cache=new CacheManager(this),this.registry=new DataManager$1(this),this.input=new InputManager(this,this.config),this.scene=new SceneManager(this,this.config.sceneConfig),this.device=Device,this.scale=new ScaleManager(this,this.config),this.sound=null,this.sound=SoundManagerCreator.create(this),this.loop=new TimeStep(this,this.config.fps),this.plugins=new PluginManager(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,DOMContentLoaded(this.boot.bind(this))},boot:function(){PluginCache$a.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),CreateRenderer(this),CreateDOMContainer(this),DebugHeader(this),AddToDOM$1(this.canvas,this.config.parent),this.textures.once(TextureEvents.READY,this.texturesReady,this),this.events.emit(Events$p.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(Events$p.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),VisibilityHandler(this);var eventEmitter=this.events;eventEmitter.on(Events$p.HIDDEN,this.onHidden,this),eventEmitter.on(Events$p.VISIBLE,this.onVisible,this),eventEmitter.on(Events$p.BLUR,this.onBlur,this),eventEmitter.on(Events$p.FOCUS,this.onFocus,this)},step:function(time,delta){if(this.pendingDestroy)return this.runDestroy();var eventEmitter=this.events;eventEmitter.emit(Events$p.PRE_STEP,time,delta),eventEmitter.emit(Events$p.STEP,time,delta),this.scene.update(time,delta),eventEmitter.emit(Events$p.POST_STEP,time,delta);var renderer=this.renderer;renderer.preRender(),eventEmitter.emit(Events$p.PRE_RENDER,renderer,time,delta),this.scene.render(renderer),renderer.postRender(),eventEmitter.emit(Events$p.POST_RENDER,renderer,time,delta)},headlessStep:function(time,delta){if(this.pendingDestroy)return this.runDestroy();var eventEmitter=this.events;eventEmitter.emit(Events$p.PRE_STEP,time,delta),eventEmitter.emit(Events$p.STEP,time,delta),this.scene.update(time,delta),eventEmitter.emit(Events$p.POST_STEP,time,delta),eventEmitter.emit(Events$p.PRE_RENDER),eventEmitter.emit(Events$p.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(Events$p.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(Events$p.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(removeCanvas,noReturn){void 0===noReturn&&(noReturn=!1),this.pendingDestroy=!0,this.removeCanvas=removeCanvas,this.noReturn=noReturn},runDestroy:function(){this.scene.destroy(),this.events.emit(Events$p.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(CanvasPool$4.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}}),Game_1=Game,CheckMatrix_1=function(matrix){if(!Array.isArray(matrix)||matrix.length<2||!Array.isArray(matrix[0]))return!1;for(var size=matrix[0].length,i=1;i<matrix.length;i++)if(matrix[i].length!==size)return!1;return!0},Pad=Pad_1,CheckMatrix$1=CheckMatrix_1,MatrixToString_1=function(matrix){var str="";if(!CheckMatrix$1(matrix))return str;for(var r=0;r<matrix.length;r++){for(var c=0;c<matrix[r].length;c++){var cell=matrix[r][c].toString();str+="undefined"!==cell?Pad(cell,2):"?",c<matrix[r].length-1&&(str+=" |")}if(r<matrix.length-1){str+="\n";for(var i=0;i<matrix[r].length;i++)str+="---",i<matrix[r].length-1&&(str+="+");str+="\n"}}return str},ReverseColumns_1=function(matrix){return matrix.reverse()},ReverseRows_1=function(matrix){for(var i=0;i<matrix.length;i++)matrix[i].reverse();return matrix},TransposeMatrix_1=function(array){for(var sourceRowCount=array.length,sourceColCount=array[0].length,result=new Array(sourceColCount),i=0;i<sourceColCount;i++){result[i]=new Array(sourceRowCount);for(var j=sourceRowCount-1;j>-1;j--)result[i][j]=array[j][i]}return result},CheckMatrix=CheckMatrix_1,TransposeMatrix=TransposeMatrix_1,RotateMatrix_1=function(matrix,direction){if(void 0===direction&&(direction=90),!CheckMatrix(matrix))return null;if("string"!=typeof direction&&(direction=(direction%360+360)%360),90===direction||-270===direction||"rotateLeft"===direction)(matrix=TransposeMatrix(matrix)).reverse();else if(-90===direction||270===direction||"rotateRight"===direction)matrix.reverse(),matrix=TransposeMatrix(matrix);else if(180===Math.abs(direction)||"rotate180"===direction){for(var i=0;i<matrix.length;i++)matrix[i].reverse();matrix.reverse()}return matrix},RotateMatrix$2=RotateMatrix_1,Rotate180_1=function(matrix){return RotateMatrix$2(matrix,180)},RotateMatrix$1=RotateMatrix_1,RotateLeft_1=function(matrix){return RotateMatrix$1(matrix,90)},RotateMatrix=RotateMatrix_1,RotateRight_1=function(matrix){return RotateMatrix(matrix,-90)},RotateLeft=RotateLeft_1$1,RotateRight=RotateRight_1$1,TranslateMatrix_1=function(matrix,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),0!==y&&(y<0?RotateLeft(matrix,Math.abs(y)):RotateRight(matrix,y)),0!==x)for(var i=0;i<matrix.length;i++){var row=matrix[i];x<0?RotateLeft(row,Math.abs(x)):RotateRight(row,x)}return matrix},Add_1=function(array,item,limit,callback,context){if(void 0===context&&(context=array),limit>0){var remaining=limit-array.length;if(remaining<=0)return null}if(!Array.isArray(item))return-1===array.indexOf(item)?(array.push(item),callback&&callback.call(context,item),item):null;for(var itemLength=item.length-1;itemLength>=0;)-1!==array.indexOf(item[itemLength])&&item.splice(itemLength,1),itemLength--;if(0===(itemLength=item.length))return null;limit>0&&itemLength>remaining&&(item.splice(remaining),itemLength=remaining);for(var i=0;i<itemLength;i++){var entry=item[i];array.push(entry),callback&&callback.call(context,entry)}return item},AddAt_1=function(array,item,index,limit,callback,context){if(void 0===index&&(index=0),void 0===context&&(context=array),limit>0){var remaining=limit-array.length;if(remaining<=0)return null}if(!Array.isArray(item))return-1===array.indexOf(item)?(array.splice(index,0,item),callback&&callback.call(context,item),item):null;for(var itemLength=item.length-1;itemLength>=0;)-1!==array.indexOf(item[itemLength])&&item.pop(),itemLength--;if(0===(itemLength=item.length))return null;limit>0&&itemLength>remaining&&(item.splice(remaining),itemLength=remaining);for(var i=itemLength-1;i>=0;i--){var entry=item[i];array.splice(index,0,entry),callback&&callback.call(context,entry)}return item},BringToTop_1=function(array,item){var currentIndex=array.indexOf(item);return-1!==currentIndex&&currentIndex<array.length&&(array.splice(currentIndex,1),array.push(item)),item},SafeRange$3=SafeRange_1,CountAllMatching_1=function(array,property,value,startIndex,endIndex){void 0===startIndex&&(startIndex=0),void 0===endIndex&&(endIndex=array.length);var total=0;if(SafeRange$3(array,startIndex,endIndex))for(var i=startIndex;i<endIndex;i++){array[i][property]===value&&total++}return total},Each_1=function(array,callback,context){var i,args=[null];for(i=3;i<arguments.length;i++)args.push(arguments[i]);for(i=0;i<array.length;i++)args[0]=array[i],callback.apply(context,args);return array},SafeRange$2=SafeRange_1,EachInRange_1=function(array,callback,context,startIndex,endIndex){if(void 0===startIndex&&(startIndex=0),void 0===endIndex&&(endIndex=array.length),SafeRange$2(array,startIndex,endIndex)){var i,args=[null];for(i=5;i<arguments.length;i++)args.push(arguments[i]);for(i=startIndex;i<endIndex;i++)args[0]=array[i],callback.apply(context,args)}return array},GetRandom_1=function(array,startIndex,length){void 0===startIndex&&(startIndex=0),void 0===length&&(length=array.length);var randomIndex=startIndex+Math.floor(Math.random()*length);return void 0===array[randomIndex]?null:array[randomIndex]},MoveDown_1=function(array,item){var currentIndex=array.indexOf(item);if(currentIndex>0){var item2=array[currentIndex-1],index2=array.indexOf(item2);array[currentIndex]=item2,array[index2]=item}return array},MoveTo_1=function(array,item,index){var currentIndex=array.indexOf(item);if(-1===currentIndex||index<0||index>=array.length)throw new Error("Supplied index out of bounds");return currentIndex!==index&&(array.splice(currentIndex,1),array.splice(index,0,item)),item},MoveUp_1=function(array,item){var currentIndex=array.indexOf(item);if(-1!==currentIndex&&currentIndex<array.length-1){var item2=array[currentIndex+1],index2=array.indexOf(item2);array[currentIndex]=item2,array[index2]=item}return array},MoveAbove_1=function(array,item1,item2){if(item1===item2)return array;var currentIndex=array.indexOf(item1),baseIndex=array.indexOf(item2);if(currentIndex<0||baseIndex<0)throw new Error("Supplied items must be elements of the same array");return currentIndex>baseIndex||(array.splice(currentIndex,1),baseIndex===array.length-1?array.push(item1):array.splice(baseIndex,0,item1)),array},MoveBelow_1=function(array,item1,item2){if(item1===item2)return array;var currentIndex=array.indexOf(item1),baseIndex=array.indexOf(item2);if(currentIndex<0||baseIndex<0)throw new Error("Supplied items must be elements of the same array");return currentIndex<baseIndex||(array.splice(currentIndex,1),0===baseIndex?array.unshift(item1):array.splice(baseIndex,0,item1)),array},RoundAwayFromZero=RoundAwayFromZero_1,NumberArrayStep_1=function(start,end,step){void 0===start&&(start=0),void 0===end&&(end=null),void 0===step&&(step=1),null===end&&(end=start,start=0);for(var result=[],total=Math.max(RoundAwayFromZero((end-start)/(step||1)),0),i=0;i<total;i++)result.push(start),start+=step;return result};
195/**
196	 * @author       Richard Davey <[email protected]>
197	 * @copyright    2020 Photon Storm Ltd.
198	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
199	 */
200function swap(arr,i,j){var tmp=arr[i];arr[i]=arr[j],arr[j]=tmp}function defaultCompare(a,b){return a<b?-1:a>b?1:0}var QuickSelect=function(arr,k,left,right,compare){for(void 0===left&&(left=0),void 0===right&&(right=arr.length-1),void 0===compare&&(compare=defaultCompare);right>left;){if(right-left>600){var n=right-left+1,m=k-left+1,z=Math.log(n),s=.5*Math.exp(2*z/3),sd=.5*Math.sqrt(z*s*(n-s)/n)*(m-n/2<0?-1:1),newLeft=Math.max(left,Math.floor(k-m*s/n+sd)),newRight=Math.min(right,Math.floor(k+(n-m)*s/n+sd));QuickSelect(arr,k,newLeft,newRight,compare)}var t=arr[k],i=left,j=right;for(swap(arr,left,k),compare(arr[right],t)>0&&swap(arr,left,right);i<j;){for(swap(arr,i,j),i++,j--;compare(arr[i],t)<0;)i++;for(;compare(arr[j],t)>0;)j--}0===compare(arr[left],t)?swap(arr,left,j):swap(arr,++j,right),j<=k&&(left=j+1),k<=j&&(right=j-1)}},QuickSelect_1=QuickSelect,GetValue$n=GetValue_1,Shuffle$1=Shuffle_1$2,BuildChunk=function(a,b,qty){for(var out=[],aIndex=0;aIndex<a.length;aIndex++)for(var bIndex=0;bIndex<b.length;bIndex++)for(var i=0;i<qty;i++)out.push({a:a[aIndex],b:b[bIndex]});return out},Range_1=function(a,b,options){var max=GetValue$n(options,"max",0),qty=GetValue$n(options,"qty",1),random=GetValue$n(options,"random",!1),randomB=GetValue$n(options,"randomB",!1),repeat=GetValue$n(options,"repeat",0),yoyo=GetValue$n(options,"yoyo",!1),out=[];if(randomB&&Shuffle$1(b),-1===repeat)if(0===max)repeat=0;else{var total=a.length*b.length*qty;
200yoyo&&(total*=2),repeat=Math.ceil(max/total)}for(var i=0;i<=repeat;i++){var chunk=BuildChunk(a,b,qty);random&&Shuffle$1(chunk),out=out.concat(chunk),yoyo&&(chunk.reverse(),out=out.concat(chunk))}return max&&out.splice(max),out},SpliceOne$3=SpliceOne_1,RemoveAt_1$1=function(array,index,callback,context){if(void 0===context&&(context=array),index<0||index>array.length-1)throw new Error("Index out of bounds");var item=SpliceOne$3(array,index);return callback&&callback.call(context,item),item},SafeRange$1=SafeRange_1,RemoveBetween_1=function(array,startIndex,endIndex,callback,context){if(void 0===startIndex&&(startIndex=0),void 0===endIndex&&(endIndex=array.length),void 0===context&&(context=array),SafeRange$1(array,startIndex,endIndex)){var size=endIndex-startIndex,removed=array.splice(startIndex,size);if(callback)for(var i=0;i<removed.length;i++){var entry=removed[i];callback.call(context,entry)}return removed}return[]},SpliceOne$2=SpliceOne_1,RemoveRandomElement_1=function(array,start,length){void 0===start&&(start=0),void 0===length&&(length=array.length);var randomIndex=start+Math.floor(Math.random()*length);return SpliceOne$2(array,randomIndex)},Replace_1=function(array,oldChild,newChild){var index1=array.indexOf(oldChild),index2=array.indexOf(newChild);return-1!==index1&&-1===index2&&(array[index1]=newChild,!0)},SendToBack_1=function(array,item){var currentIndex=array.indexOf(item);return-1!==currentIndex&&currentIndex>0&&(array.splice(currentIndex,1),array.unshift(item)),item},SafeRange=SafeRange_1,SetAll_1=function(array,property,value,startIndex,endIndex){if(void 0===startIndex&&(startIndex=0),void 0===endIndex&&(endIndex=array.length),SafeRange(array,startIndex,endIndex))for(var i=startIndex;i<endIndex;i++){var entry=array[i];entry.hasOwnProperty(property)&&(entry[property]=value)}return array};
201/**
202	 * @author       Richard Davey <[email protected]>
203	 * @author       Angry Bytes (and contributors)
204	 * @copyright    2020 Photon Storm Ltd.
205	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
206	 */
207function Compare(a,b){return String(a).localeCompare(b)}function RunPass(arr,comp,chk,result){var l,r,e,li,ri,len=arr.length,i=0,dbl=2*chk;for(l=0;l<len;l+=dbl)for(e=(r=l+chk)+chk,r>len&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(li<r&&ri<e)comp(arr[li],arr[ri])<=0?result[i++]=arr[li++]:result[i++]=arr[ri++];else if(li<r)result[i++]=arr[li++];else{if(!(ri<e))break;result[i++]=arr[ri++]}}var StableSort_1=function(array,compare){void 0===compare&&(compare=Compare);var result=function(array,compare){var len=array.length;if(len<=1)return array;for(var buffer=new Array(len),chk=1;chk<len;chk*=2){RunPass(array,compare,chk,buffer);var tmp=array;array=buffer,buffer=tmp}return array}(array,compare);return result!==array&&RunPass(result,null,array.length,array),array},Swap_1=function(array,item1,item2){if(item1===item2)return array;var index1=array.indexOf(item1),index2=array.indexOf(item2);if(index1<0||index2<0)throw new Error("Supplied items must be elements of the same array");return array[index1]=item2,array[index2]=item1,array},array={Matrix:{CheckMatrix:CheckMatrix_1,MatrixToString:MatrixToString_1,ReverseColumns:ReverseColumns_1,ReverseRows:ReverseRows_1,Rotate180:Rotate180_1,RotateLeft:RotateLeft_1,RotateMatrix:RotateMatrix_1,RotateRight:RotateRight_1,Translate:TranslateMatrix_1,TransposeMatrix:TransposeMatrix_1},Add:Add_1,AddAt:AddAt_1,BringToTop:BringToTop_1,CountAllMatching:CountAllMatching_1,Each:Each_1,EachInRange:EachInRange_1,FindClosestInSorted:FindClosestInSorted_1,GetAll:GetAll_1,GetFirst:GetFirst_1,GetRandom:GetRandom_1,MoveDown:MoveDown_1,MoveTo:MoveTo_1,MoveUp:MoveUp_1,MoveAbove:MoveAbove_1,MoveBelow:MoveBelow_1,NumberArray:NumberArray_1,NumberArrayStep:NumberArrayStep_1,QuickSelect:QuickSelect_1,Range:Range_1,Remove:Remove_1,RemoveAt:RemoveAt_1$1,RemoveBetween:RemoveBetween_1,RemoveRandomElement:RemoveRandomElement_1,Replace:Replace_1,RotateLeft:RotateLeft_1$1,RotateRight:RotateRight_1$1,SafeRange:SafeRange_1,SendToBack:SendToBack_1,SetAll:SetAll_1,Shuffle:Shuffle_1$2,SortByDigits:SortByDigits_1,SpliceOne:SpliceOne_1,StableSort:StableSort_1,Swap:Swap_1},ArrayUtils$1=array,NOOP$9=NOOP_1,StableSort$5=StableSort_1,List$4=new Class_1({initialize:function(parent){this.parent=parent,this.list=[],this.position=0,this.addCallback=NOOP$9,this.removeCallback=NOOP$9,this._sortKey=""},add:function(child,skipCallback){return skipCallback?ArrayUtils$1.Add(this.list,child):ArrayUtils$1.Add(this.list,child,0,this.addCallback,this)},addAt:function(child,index,skipCallback){return skipCallback?ArrayUtils$1.AddAt(this.list,child,index):ArrayUtils$1.AddAt(this.list,child,index,0,this.addCallback,this)},getAt:function(index){return this.list[index]},getIndex:function(child){return this.list.indexOf(child)},sort:function(property,handler){return property?(void 0===handler&&(handler=function(childA,childB){return childA[property]-childB[property]}),StableSort$5(this.list,handler),this):this},getByName:function(name){return ArrayUtils$1.GetFirst(this.list,"
207name",name)},getRandom:function(startIndex,length){return ArrayUtils$1.GetRandom(this.list,startIndex,length)},getFirst:function(property,value,startIndex,endIndex){return ArrayUtils$1.GetFirst(this.list,property,value,startIndex,endIndex)},getAll:function(property,value,startIndex,endIndex){return ArrayUtils$1.GetAll(this.list,property,value,startIndex,endIndex)},count:function(property,value){return ArrayUtils$1.CountAllMatching(this.list,property,value)},swap:function(child1,child2){ArrayUtils$1.Swap(this.list,child1,child2)},moveTo:function(child,index){return ArrayUtils$1.MoveTo(this.list,child,index)},moveAbove:function(child1,child2){return ArrayUtils$1.MoveAbove(this.list,child1,child2)},moveBelow:function(child1,child2){return ArrayUtils$1.MoveBelow(this.list,child1,child2)},remove:function(child,skipCallback){return skipCallback?ArrayUtils$1.Remove(this.list,child):ArrayUtils$1.Remove(this.list,child,this.removeCallback,this)},removeAt:function(index,skipCallback){return skipCallback?ArrayUtils$1.RemoveAt(this.list,index):ArrayUtils$1.RemoveAt(this.list,index,this.removeCallback,this)},removeBetween:function(startIndex,endIndex,skipCallback){return skipCallback?ArrayUtils$1.RemoveBetween(this.list,startIndex,endIndex):ArrayUtils$1.RemoveBetween(this.list,startIndex,endIndex,this.removeCallback,this)},removeAll:function(skipCallback){for(var i=this.list.length;i--;)this.remove(this.list[i],skipCallback);return this},bringToTop:function(child){return ArrayUtils$1.BringToTop(this.list,child)},sendToBack:function(child){return ArrayUtils$1.SendToBack(this.list,child)},moveUp:function(child){return ArrayUtils$1.MoveUp(this.list,child),child},moveDown:function(child){return ArrayUtils$1.MoveDown(this.list,child),child},reverse:function(){return this.list.reverse(),this},shuffle:function(){return ArrayUtils$1.Shuffle(this.list),this},replace:function(oldChild,newChild){return ArrayUtils$1.Replace(this.list,oldChild,newChild)},exists:function(child){return this.list.indexOf(child)>-1},setAll:function(property,value,startIndex,endIndex){return ArrayUtils$1.SetAll(this.list,property,value,startIndex,endIndex),this},each:function(callback,context){for(var args=[null],i=2;i<arguments.length;i++)args.push(arguments[i]);for(i=0;i<this.list.length;i++)args[0]=this.list[i],callback.apply(context,args)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}}}
207),List_1=List$4,List$3=List_1,PluginCache$9=PluginCache_1,GameObjectEvents$1=events$h,SceneEvents$b=events$g,StableSort$4=StableSort_1,DisplayList=new Class_1({Extends:List$3,initialize:function(scene){List$3.call(this,scene),this.sortChildrenFlag=!1,this.scene=scene,this.systems=scene.sys,this.events=scene.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(SceneEvents$b.BOOT,this.boot,this),this.events.on(SceneEvents$b.START,this.start,this)},boot:function(){this.events.once(SceneEvents$b.DESTROY,this.destroy,this)},addChildCallback:function(gameObject){gameObject.displayList&&gameObject.displayList!==this&&gameObject.removeFromDisplayList(),gameObject.displayList||(this.queueDepthSort(),gameObject.displayList=this,gameObject.emit(GameObjectEvents$1.ADDED_TO_SCENE,gameObject,this.scene),this.events.emit(SceneEvents$b.ADDED_TO_SCENE,gameObject,this.scene))},removeChildCallback:function(gameObject){this.queueDepthSort(),gameObject.displayList=null,gameObject.emit(GameObjectEvents$1.REMOVED_FROM_SCENE,gameObject,this.scene),this.events.emit(SceneEvents$b.REMOVED_FROM_SCENE,gameObject,this.scene)},start:function(){this.events.once(SceneEvents$b.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(StableSort$4(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(childA,childB){return childA._depth-childB._depth},getChildren:function(){return this.list},shutdown:function(){for(var list=this.list,i=list.length;i--;)list[i].destroy(!0);list.length=0,this.events.off(SceneEvents$b.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(SceneEvents$b.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});PluginCache$9.register("DisplayList",DisplayList,"displayList");var DisplayList_1=DisplayList,events$5={PROCESS_QUEUE_ADD:"add",PROCESS_QUEUE_REMOVE:"remove"},EventEmitter$d=eventemitter3.exports,Events$o=events$5,ProcessQueue$2=new Class_1({Extends:EventEmitter$d,initialize:function(){EventEmitter$d.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},add:function(item){return this._pending.push(item),this._toProcess++,item},remove:function(item){return this._destroy.push(item),this._toProcess++,item},removeAll:function(){for(var list=this._active,destroy=this._destroy,i=list.length;i--;)destroy.push(list[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var i,item,list=this._destroy,active=this._active;for(i=0;i<list.length;i++){item=list[i];var idx=active.indexOf(item);-1!==idx&&(active.splice(idx,1),this.emit(Events$o.PROCESS_QUEUE_REMOVE,item))}
207for(list.length=0,list=this._pending,i=0;i<list.length;i++)item=list[i],(!this.checkQueue||this.checkQueue&&-1===active.indexOf(item))&&(active.push(item),this.emit(Events$o.PROCESS_QUEUE_ADD,item));return list.length=0,this._toProcess=0,active},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}}),ProcessQueue_1=ProcessQueue$2,ProcessQueue$1=ProcessQueue_1,PluginCache$8=PluginCache_1,SceneEvents$a=events$g,UpdateList=new Class_1({Extends:ProcessQueue$1,initialize:function(scene){ProcessQueue$1.call(this),this.checkQueue=!0,this.scene=scene,this.systems=scene.sys,scene.sys.events.once(SceneEvents$a.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$a.START,this.start,this)},boot:function(){this.systems.events.once(SceneEvents$a.DESTROY,this.destroy,this)},start:function(){var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents$a.PRE_UPDATE,this.update,this),eventEmitter.on(SceneEvents$a.UPDATE,this.sceneUpdate,this),eventEmitter.once(SceneEvents$a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(time,delta){for(var list=this._active,length=list.length,i=0;i<length;i++){var gameObject=list[i];gameObject.active&&gameObject.preUpdate.call(gameObject,time,delta)}},shutdown:function(){for(var i=this._active.length;i--;)this._active[i].destroy(!0);for(i=this._pending.length;i--;)this._pending[i].destroy(!0);for(i=this._destroy.length;i--;)this._destroy[i].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var eventEmitter=this.systems.events;eventEmitter.off(SceneEvents$a.PRE_UPDATE,this.update,this),eventEmitter.off(SceneEvents$a.UPDATE,this.sceneUpdate,this),eventEmitter.off(SceneEvents$a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(SceneEvents$a.START,this.start,this),this.scene=null,this.systems=null}});
208/**
209	 * @author       Richard Davey <[email protected]>
210	 * @copyright    2020 Photon Storm Ltd.
211	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
212	 */PluginCache$8.register("UpdateList",UpdateList,"updateList");var UpdateList_1=UpdateList,TransformMatrix$9=TransformMatrix_1,tempMatrix1$4=new TransformMatrix$9,tempMatrix2$4=new TransformMatrix$9,tempMatrix3$4=new TransformMatrix$9,result={camera:tempMatrix1$4,sprite:tempMatrix2$4,calc:tempMatrix3$4},GetCalcMatrix_1=function(src,camera,parentMatrix){var camMatrix=tempMatrix1$4,spriteMatrix=tempMatrix2$4,calcMatrix=tempMatrix3$4;return spriteMatrix.applyITRS(src.x,src.y,src.rotation,src.scaleX,src.scaleY),camMatrix.copyFrom(camera.matrix),parentMatrix?(camMatrix.multiplyWithOffset(parentMatrix,-camera.scrollX*src.scrollFactorX,-camera.scrollY*src.scrollFactorY),spriteMatrix.e=src.x,spriteMatrix.f=src.y):(spriteMatrix.e-=camera.scrollX*src.scrollFactorX,spriteMatrix.f-=camera.scrollY*src.scrollFactorY),camMatrix.multiply(spriteMatrix,calcMatrix),result},MATH=math,GetValue$m=GetValue_1,GetAdvancedValue_1=function(source,key,defaultValue){var value=GetValue$m(source,key,null);if(null===value)return defaultValue;if(Array.isArray(value))return MATH.RND.pick(value);if("object"==typeof value){if(value.hasOwnProperty("randInt"))return MATH.RND.integerInRange(value.randInt[0],value.randInt[1]);if(value.hasOwnProperty("randFloat"))return MATH.RND.realInRange(value.randFloat[0],value.randFloat[1])}else if("function"==typeof value)return value(key);return value},BlendModes$4=BlendModes$8,GetAdvancedValue$m=GetAdvancedValue_1,BuildGameObject_1=function(scene,gameObject,config){gameObject.x=GetAdvancedValue$m(config,"x",0),gameObject.y=GetAdvancedValue$m(config,"y",0),gameObject.depth=GetAdvancedValue$m(config,"depth",0),gameObject.flipX=GetAdvancedValue$m(config,"flipX",!1),gameObject.flipY=GetAdvancedValue$m(config,"flipY",!1);var scale=GetAdvancedValue$m(config,"scale",null);"number"==typeof scale?gameObject.setScale(scale):null!==scale&&(gameObject.scaleX=GetAdvancedValue$m(scale,"x",1),gameObject.scaleY=GetAdvancedValue$m(scale,"y",1));var scrollFactor=GetAdvancedValue$m(config,"scrollFactor",null);"number"==typeof scrollFactor?gameObject.setScrollFactor(scrollFactor):null!==scrollFactor&&(gameObject.scrollFactorX=GetAdvancedValue$m(scrollFactor,"x",1),gameObject.scrollFactorY=GetAdvancedValue$m(scrollFactor,"y",1)),gameObject.rotation=GetAdvancedValue$m(config,"rotation",0);var angle=GetAdvancedValue$m(config,"angle",null);null!==angle&&(gameObject.angle=angle),gameObject.alpha=GetAdvancedValue$m(config,"alpha",1);var origin=GetAdvancedValue$m(config,"origin",null);if("number"==typeof origin)gameObject.setOrigin(origin);else if(null!==origin){var ox=GetAdvancedValue$m(origin,"x",.5),oy=GetAdvancedValue$m(origin,"y",.5);gameObject.setOrigin(ox,oy)}return gameObject.blendMode=GetAdvancedValue$m(config,"blendMode",BlendM
212odes$4.NORMAL),gameObject.visible=GetAdvancedValue$m(config,"visible",!0),GetAdvancedValue$m(config,"add",!0)&&scene.sys.displayList.add(gameObject),gameObject.preUpdate&&scene.sys.updateList.add(gameObject),gameObject},GetAdvancedValue$l=GetAdvancedValue_1,BuildGameObjectAnimation_1=function(sprite,config){var animConfig=GetAdvancedValue$l(config,"anims",null);if(null===animConfig)return sprite;if("string"==typeof animConfig)sprite.anims.play(animConfig);else if("object"==typeof animConfig){var anims=sprite.anims,key=GetAdvancedValue$l(animConfig,"key",void 0);if(key){var startFrame=GetAdvancedValue$l(animConfig,"startFrame",void 0),delay=GetAdvancedValue$l(animConfig,"delay",0),repeat=GetAdvancedValue$l(animConfig,"repeat",0),repeatDelay=GetAdvancedValue$l(animConfig,"repeatDelay",0),yoyo=GetAdvancedValue$l(animConfig,"yoyo",!1),play=GetAdvancedValue$l(animConfig,"play",!1),delayedPlay=GetAdvancedValue$l(animConfig,"delayedPlay",0),playConfig={key:key,delay:delay,repeat:repeat,repeatDelay:repeatDelay,yoyo:yoyo,startFrame:startFrame};play?anims.play(playConfig):delayedPlay>0?anims.playAfterDelay(playConfig,delayedPlay):anims.load(playConfig)}}return sprite},GetBitmapTextSize_1=function(src,round,updateOrigin,out){if(void 0===updateOrigin&&(updateOrigin=!1),void 0===out)return out={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var i,str,index,value,text=src.text,textLength=text.length,maxWidth=src.maxWidth,wordWrapCharCode=src.wordWrapCharCode,bx=Number.MAX_VALUE,by=Number.MAX_VALUE,bw=0,bh=0,chars=src.fontData.chars,lineHeight=src.fontData.lineHeight,letterSpacing=src.letterSpacing,xAdvance=0,yAdvance=0,charCode=0,glyph=null,align=src._align,x=0,y=0,scale=src.fontSize/src.fontData.size,sx=scale*src.scaleX,sy=scale*src.scaleY,lastGlyph=null,lastCharCode=0,lineWidths=[],shortestLine=Number.MAX_VALUE,longestLine=0,currentLine=0,currentLineWidth=0,words=[],characters=[],current=null;if(maxWidth>0){for(i=0;i<textLength;i++)if(10!==(charCode=text.charCodeAt(i))){if(glyph=chars[charCode]){if(null!==lastGlyph)var glyphKerningOffset=glyph.kerning[lastCharCode];charCode===wordWrapCharCode?null!==current&&(words.push({word:current.word,i:current.i,x:current.x*sx,y:current.y*sy,w:current.w*sx,h:current.h*sy,cr:!1}),current=null):(null===current&&(current={word:"",i:i,x:xAdvance,y:yAdvance,w:0,h:lineHeight,cr:!1}),current.word=current.word.concat(text[i]),current.w+=glyph.xOffset+glyph.xAdvance+(void 0!==glyphKerningOffset?glyphKerningOffset:0)),xAdvance+=glyph.xAdvance+letterSpacing,lastGlyph=glyph,lastCharCode=charCode}}else null!==current&&(words.push({word:current.word,i:current.i,x:current.x*sx,y:current.y*sy,w:current.w*sx,h:current.h*sy,cr:!0}),current=null),xAdvance=0,yAdvance+=lineHeight,lastGlyph=null;var prev;null!==current&&words.push({word:current.word,i:current.i,x:current.x*sx,y:current.y*sy,w:current.w*sx,h:current.h*sy,cr:!1}),xAdvance=0,yAdvance=0,lastGlyph=null,lastCharCode=0;var offset=0,crs=[];for(i=0;i<words.length;i++){var entry=words[i],left=entry.x,right=entry.x+entry.w;if(prev)offset=left-(left-(prev.x+prev.w)+prev.w),prev=null;left-offset>maxWidth||right-offset>maxWidth?(crs.push(entry.i-1),entry.cr?(crs.push(entry.i+entry.word.length),offset=0,prev=null):prev=entry):entry.cr&&(crs.push(entry.i+entry.word.length),offset=0,prev=null)}for(i=crs.length-1;i>=0;i--)str=text,index=crs[i],value="\n",text=str.substr(0,index)+value+str.substr(index+1);out.wrappedText=text,textLength=text.length,words=[],current=null}var charIndex=0;for(i=0;i<textLength;i++)if(10!==(charCode=text.charCodeAt(i))){if(glyph=chars[charCode]){if(x=xAdvance,y=yAdvance,null!==lastGlyph){var kerningOffset=glyph.kerning[lastCharCode];x+=void 0!==kerningOffset?kerningOffset:0}bx>x&&(bx=x),by>y&&(by=y);var gw=x+glyph.xAdvance,gh=y+lineHeight;bw<gw&&(bw=gw),bh<gh&&(bh=gh);var charWidth=glyph.xOffset+glyph.xAdvance+(void 0!==kerningOffset?kerningOffset:0);charCode===wordWrapCharCode?null!==current&&(words.push({word:current.word,i:current.i,x:current.x*sx,y:current.y*sy,w:current.w*sx,h:current.h*sy}),current=null):(null===current&&(current={word:"",i:charIndex,x:xAdvance,y:yAdvance,w:0,h:lineHeight}),current.word=current.word.concat(text[i]),current.w+=charWidth),characters.push({i:charIndex,char:text[i],code:charCode,x:(glyph.xOffset+xAdvance)*scale,y:(glyph.yOffset+yAdvance)*scale,w:glyph.width*scale,h:glyph.height*scale,t:yAdvance*scale,r:gw*scale,b:lineHeight*scale,line:currentLine,glyph:glyph}),xAdvance+=glyph.xAdvance+letterSpacing,lastGlyph=glyph,lastCharCode=charCode,currentLineWidth=gw*scale,charIndex++}}else null!==current&&(words.push({word:current.word,i:current.i,x:current.x*sx,y:current.y*sy,w:current.w*sx,h:current.h*sy}),current=null),xAdvance=0,yAdvance+=lineHeight,lastGlyph=null,lineWidths[currentLine]=currentLineWidth,currentLineWidth>longestLine&&(longestLine=currentLineWidth),currentLineWidth<shortestLine&&(shortestLine=currentLineWidth),currentLine++,currentLineWidth=0;if(null!==current&&words.push({word:current.word,i:current.i,x:current.x*sx,y:current.y*sy,w:current.w*sx,h:current.h*sy}),lineWidths[currentLine]=currentLineWidth,currentLineWidth>longestLine&&(longestLine=currentLineWidth),currentLineWidth<shortestLine&&(shortestLine=currentLineWidth),align>0)for(var c=0;c<characters.length;c++){var currentChar=characters[c];if(1===align){var ax1=(longestLine-lineWidths[currentChar.line])/2;currentChar.x+=ax1,currentChar.r+=ax1}else if(2===align){var ax2=longestLine-lineWidths[currentChar.line];currentChar.x+=ax2,currentChar.r+=ax2}}var local=out.local,global=out.global,lines=out.lines;return local.x=bx*scale,local.y=by*scale,local.width=bw*scale,local.height=bh*scale,global.x=src.x-src._displayOriginX+bx*sx,global.y=src.y-src._displayOriginY+by*sy,global.width=bw*sx,global.he
212ight=bh*sy,lines.shortest=shortestLine,lines.longest=longestLine,lines.lengths=lineWidths,round&&(local.x=Math.ceil(local.x),local.y=Math.ceil(local.y),local.width=Math.ceil(local.width),local.height=Math.ceil(local.height),global.x=Math.ceil(global.x),global.y=Math.ceil(global.y),global.width=Math.ceil(global.width),global.height=Math.ceil(global.height),lines.shortest=Math.ceil(shortestLine),lines.longest=Math.ceil(longestLine)),updateOrigin&&(src._displayOriginX=src.originX*local.width,src._displayOriginY=src.originY*local.height,global.x=src.x-src._displayOriginX*src.scaleX,global.y=src.y-src._displayOriginY*src.scaleY,round&&(global.x=Math.ceil(global.x),global.y=Math.ceil(global.y))),out.words=words,out.characters=characters,out.lines.height=lineHeight,out.scale=scale,out.scaleX=src.scaleX,out.scaleY=src.scaleY,out};
213/**
214	 * @author       Richard Davey <[email protected]>
215	 * @copyright    2020 Photon Storm Ltd.
216	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
217	 */
218/**
219	 * @author       Richard Davey <[email protected]>
220	 * @copyright    2020 Photon Storm Ltd.
221	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
222	 */
223function getValue(node,attribute){return parseInt(node.getAttribute(attribute),10)}var ParseXMLBitmapFont_1=function(xml,frame,xSpacing,ySpacing,texture){void 0===xSpacing&&(xSpacing=0),void 0===ySpacing&&(ySpacing=0);var textureX=frame.cutX,textureY=frame.cutY,textureWidth=frame.source.width,textureHeight=frame.source.height,sourceIndex=frame.sourceIndex,data={},info=xml.getElementsByTagName("info")[0],common=xml.getElementsByTagName("common")[0];data.font=info.getAttribute("face"),data.size=getValue(info,"size"),data.lineHeight=getValue(common,"lineHeight")+ySpacing,data.chars={};var letters=xml.getElementsByTagName("char"),adjustForTrim=void 0!==frame&&frame.trimmed;if(adjustForTrim)var top=frame.height,left=frame.width;for(var i=0;i<letters.length;i++){var node=letters[i],charCode=getValue(node,"id"),letter=String.fromCharCode(charCode),gx=getValue(node,"x"),gy=getValue(node,"y"),gw=getValue(node,"width"),gh=getValue(node,"height");adjustForTrim&&(gx<left&&(left=gx),gy<top&&(top=gy)),adjustForTrim&&0!==top&&0!==left&&(gx-=frame.x,gy-=frame.y);var u0=(textureX+gx)/textureWidth,v0=(textureY+gy)/textureHeight,u1=(textureX+gx+gw)/textureWidth,v1=(textureY+gy+gh)/textureHeight;if(data.chars[charCode]={x:gx,y:gy,width:gw,height:gh,centerX:Math.floor(gw/2),centerY:Math.floor(gh/2),xOffset:getValue(node,"xoffset"),yOffset:getValue(node,"yoffset"),xAdvance:getValue(node,"xadvance")+xSpacing,data:{},kerning:{},u0:u0,v0:v0,u1:u1,v1:v1},texture&&0!==gw&&0!==gh){var charFrame=texture.add(letter,sourceIndex,gx,gy,gw,gh);charFrame&&charFrame.setUVs(gw,gh,u0,v0,u1,v1)}}var kernings=xml.getElementsByTagName("kerning");for(i=0;i<kernings.length;i++){var kern=kernings[i],first=getValue(kern,"first"),second=getValue(kern,"second"),amount=getValue(kern,"amount");data.chars[second].kerning[first]=amount}return data},ParseXMLBitmapFont$2=ParseXMLBitmapFont_1,ParseFromAtlas_1=function(scene,fontName,textureKey,frameKey,xmlKey,xSpacing,ySpacing){var texture=scene.sys.textures.get(textureKey),frame=texture.get(frameKey),xml=scene.sys.cache.xml.get(xmlKey);if(frame&&xml){var data=ParseXMLBitmapFont$2(xml,frame,xSpacing,ySpacing,texture);return scene.sys.cache.bitmapFont.add(fontName,{data:data,texture:textureKey,frame:frameKey,fromAtlas:!0}),!0}return!1},BatchChar=function(pipeline,src,char,glyph,offsetX,offsetY,calcMatrix,roundPixels,tintTL,tintTR,tintBL,tintBR,tintEffect,texture,textureUnit){var x=char.x-src.displayOriginX+offsetX,y=char.y-src.displayOriginY+offsetY,xw=x+char.w,yh=y+char.h,tx0=calcMatrix.getXRound(x,y,roundPixels),ty0=calcMatrix.getYRound(x,y,roundPixels),tx1=calcMatrix.getXRound(x,yh,roundPixels),ty1=calcMatrix.getYRound(x,yh,roundPixels),tx2=calcMatrix.getXRound(xw,yh,roundPixels),ty2=calcMatrix.getYRound(xw,yh,roundPixels),tx3=calcMatrix.getXRound(xw,y,roundPixels),ty3=calcMatrix.getYRound(xw,y,roundPixels);pipeline.batchQuad(src,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,glyph.u0,glyph.v0,glyph.u1,glyph.v1,tintTL,tintTR,tintBL,tintBR,tintEffect,texture,textureUnit)},GetCalcMatrix$k=GetCalcMatrix_1,Utils$l=Utils$p,BitmapTextWebGLRenderer_1=function(renderer,src,camera,parentMatrix){if(0!==src._text.length){camera.addToRenderList(src);
223var i,char,glyph,pipeline=renderer.pipelines.set(src.pipeline,src),calcMatrix=GetCalcMatrix$k(src,camera,parentMatrix).calc,roundPixels=camera.roundPixels,cameraAlpha=camera.alpha,charColors=src.charColors,tintEffect=src.tintFill,getTint=Utils$l.getTintAppendFloatAlpha,tintTL=getTint(src.tintTopLeft,cameraAlpha*src._alphaTL),tintTR=getTint(src.tintTopRight,cameraAlpha*src._alphaTR),tintBL=getTint(src.tintBottomLeft,cameraAlpha*src._alphaBL),tintBR=getTint(src.tintBottomRight,cameraAlpha*src._alphaBR),texture=src.frame.glTexture,textureUnit=pipeline.setGameObject(src),characters=src.getTextBounds(!1).characters,dropShadowX=src.dropShadowX,dropShadowY=src.dropShadowY,dropShadow=0!==dropShadowX||0!==dropShadowY;if(renderer.pipelines.preBatch(src),dropShadow){var srcShadowColor=src.dropShadowColor,srcShadowAlpha=src.dropShadowAlpha,shadowTL=getTint(srcShadowColor,cameraAlpha*srcShadowAlpha*src._alphaTL),shadowTR=getTint(srcShadowColor,cameraAlpha*srcShadowAlpha*src._alphaTR),shadowBL=getTint(srcShadowColor,cameraAlpha*srcShadowAlpha*src._alphaBL),shadowBR=getTint(srcShadowColor,cameraAlpha*srcShadowAlpha*src._alphaBR);for(i=0;i<characters.length;i++)glyph=(char=characters[i]).glyph,32!==char.code&&0!==glyph.width&&0!==glyph.height&&BatchChar(pipeline,src,char,glyph,dropShadowX,dropShadowY,calcMatrix,roundPixels,shadowTL,shadowTR,shadowBL,shadowBR,1,texture,textureUnit)}for(i=0;i<characters.length;i++)if(glyph=(char=characters[i]).glyph,32!==char.code&&0!==glyph.width&&0!==glyph.height)if(charColors[char.i]){var color=charColors[char.i],charTintEffect=color.tintEffect,charTintTL=getTint(color.tintTL,cameraAlpha*src._alphaTL),charTintTR=getTint(color.tintTR,cameraAlpha*src._alphaTR),charTintBL=getTint(color.tintBL,cameraAlpha*src._alphaBL),charTintBR=getTint(color.tintBR,cameraAlpha*src._alphaBR);BatchChar(pipeline,src,char,glyph,0,0,calcMatrix,roundPixels,charTintTL,charTintTR,charTintBL,charTintBR,charTintEffect,texture,textureUnit)}else BatchChar(pipeline,src,char,glyph,0,0,calcMatrix,roundPixels,tintTL,tintTR,tintBL,tintBR,tintEffect,texture,textureUnit);renderer.pipelines.postBatch(src)}},GetCalcMatrix$j=GetCalcMatrix_1,SetTransform_1=function(renderer,ctx,src,camera,parentMatrix){var alpha=camera.alpha*src.alpha;if(alpha<=0)return!1;var calcMatrix=GetCalcMatrix$j(src,camera,parentMatrix).calc;return ctx.globalCompositeOperation=renderer.blendModes[src.blendMode],ctx.globalAlpha=alpha,ctx.save(),calcMatrix.setToContext(ctx),ctx.imageSmoothingEnabled=!(!renderer.antialias||src.frame&&src.frame.source.scaleMode),!0},SetTransform$d=SetTransform_1,BitmapTextCanvasRenderer_1=function(renderer,src,camera,parentMatrix){var text=src._text,textLength=text.length,ctx=renderer.currentContext;if(0!==textLength&&SetTransform$d(renderer,ctx,src,camera,parentMatrix)){camera.addToRenderList(src);var textureFrame=src.fromAtlas?src.frame:src.texture.frames.__BASE,chars=src.fontData.chars,lineHeight=src.fontData.lineHeight,letterSpacing=src._letterSpacing,xAdvance=0,yAdvance=0,charCode=0,glyph=null,glyphX=0,glyphY=0,glyphW=0,glyphH=0,x=0,y=0,lastGlyph=null,lastCharCode=0,image=textureFrame.source.image,textureX=textureFrame.cutX,textureY=textureFrame.cutY,scale=src._fontSize/src.fontData.size,align=src._align,currentLine=0,lineOffsetX=0,bounds=src.getTextBounds(!1);src.maxWidth>0&&(textLength=(text=bounds.wrappedText).length);var lineData=src._bounds.lines;1===align?lineOffsetX=(lineData.longest-lineData.lengths[0])/2:2===align&&(lineOffsetX=lineData.longest-lineData.lengths[0]),ctx.translate(-src.displayOriginX,-src.displayOriginY);for(var roundPixels=camera.roundPixels,i=0;i<textLength;i++)if(10!==(charCode=text.charCodeAt(i))){if(glyph=chars[charCode]){if(glyphX=textureX+glyph.x,glyphY=textureY+glyph.y,glyphW=glyph.width,glyphH=glyph.height,x=glyph.xOffset+xAdvance,y=glyph.yOffset+yAdvance,null!==lastGlyph){var kerningOffset=glyph.kerning[lastCharCode];x+=void 0!==kerningOffset?kerningOffset:0}x*=scale,y*=scale,x+=lineOffsetX,xAdvance+=glyph.xAdvance+letterSpacing,lastGlyph=glyph,lastCharCode=charCode,0!==glyphW&&0!==glyphH&&32!==charCode&&(rou
vendor: 4,112 bytes, line 223
223ndPixels&&(x=Math.round(x),y=Math.round(y)),ctx.save(),ctx.translate(x,y),ctx.scale(scale,scale),ctx.drawImage(image,glyphX,glyphY,glyphW,glyphH,0,0,glyphW,glyphH),ctx.restore())}}else currentLine++,1===align?lineOffsetX=(lineData.longest-lineData.lengths[currentLine])/2:2===align&&(lineOffsetX=lineData.longest-lineData.lengths[currentLine]),xAdvance=0,yAdvance+=lineHeight,lastGlyph=null;ctx.restore()}},Clamp$4=Clamp_1,Components$s=components$3,GameObject$l=GameObject_1,GetBitmapTextSize=GetBitmapTextSize_1,ParseFromAtlas=ParseFromAtlas_1,ParseXMLBitmapFont$1=ParseXMLBitmapFont_1,Rectangle$l=Rectangle_1$1,Render$7={renderWebGL:BitmapTextWebGLRenderer_1,renderCanvas:BitmapTextCanvasRenderer_1},BitmapText$4=new Class_1({Extends:GameObject$l,Mixins:[Components$s.Alpha,Components$s.BlendMode,Components$s.Depth,Components$s.Mask,Components$s.Origin,Components$s.Pipeline,Components$s.ScrollFactor,Components$s.Texture,Components$s.Tint,Components$s.Transform,Components$s.Visible,Render$7],initialize:function(scene,x,y,font,text,size,align){void 0===text&&(text=""),void 0===align&&(align=0),GameObject$l.call(this,scene,"BitmapText"),this.font=font;var entry=this.scene.sys.cache.bitmapFont.get(font);entry||console.warn("Invalid BitmapText key: "+font),this.fontData=entry.data,this._text="",this._fontSize=size||this.fontData.size,this._letterSpacing=0,this._align=align,this._bounds=GetBitmapTextSize(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=entry.fromAtlas,this.setTexture(entry.texture,entry.frame),this.setPosition(x,y),this.setOrigin(0,0),this.initPipeline(),this.setText(text)},setLeftAlign:function(){return this._align=BitmapText$4.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=BitmapText$4.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=BitmapText$4.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(size){return this._fontSize=size,this._dirty=!0,this},setLetterSpacing:function(spacing){return void 0===spacing&&(spacing=0),this._letterSpacing=spacing,this._dirty=!0,this},setText:function(value){return value||0===value||(value=""),Array.isArray(value)&&(value=value.join("\n")),value!==this.text&&(this._text=value.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(x,y,color,alpha){return void 0===x&&(x=0),void 0===y&&(y=0),void 0===color&&(color=0),void 0===alpha&&(alpha=.5),this.dropShadowX=x,this.dropShadowY=y,this.dropShadowColor=color,this.dropShadowAlpha=alpha,this},setCharacterTint:function(start,length,tintFill,topLeft,topRight,bottomLeft,bottomRight){void 0===start&&(start=0),void 0===length&&(length=1),void 0===tintFill&&(tintFill=!1),void 0===topLeft&&(topLeft=-1),void 0===topRight&&(topRight=topLeft,bottomLeft=topLeft,bottomRight=topLeft);var len=this.text.length;-1===length&&(length=len),start<0&&(start=len+start),start=Clamp$4(start,0,len-1);for(var end=Clamp$4(start+length,start,len),charColors=this.charColors,i=start;i<end;i++){var color=charColors[i];if(-1===topLeft)charColors[i]=null;else{var tintEffect=tintFill?1:0;color?(color.tintEffect=tintEffect,color.tintTL=topLeft,color.tintTR=topRight,color.tintBL=bottomLeft,color.tintBR=bottomRight):charColors[i]={tintEffect:tintEffect,tintTL:topLeft,tintTR:topRight,tintBL:bottomLeft,tintBR:bottomRight}}}return this},setWordTint:function(word,count,tintFill,topLeft,topRight,bottomLeft,bottomRight){void 0===count&&(count=1);for(var words=this.getTextBounds().words,wordIsNumber="number"==typeof word,total=0,i=0;i<words.length;i++){var lineword=words[i];if((wordIsNumber&&i===word||!wordIsNumber&&lineword.word===word)&&(this.setCharacterTint(lineword.i,lineword.word.length,tintFill,topLeft,topRight,bottomLeft,bottomRight),++total===count))return this}return this},getTextBounds:function(round){var bounds=this._bounds;return(this._dirty||round||this.scaleX!==bounds.scaleX||this.scaleY!==bounds.scaleY)&&(GetBitmapTextSize(this,round,!0,bounds),this._dirty=!1),bounds}
223,getCharacterAt:function(x,y,camera){for(var point=this.getLocalPoint(x,y,null,camera),chars=this.getTextBounds().characters,tempRect=new Rectangle$l,i=0;i<chars.length;i++){var char=chars[i];if(tempRect.setTo(char.x,char.t,char.r-char.x,char.b),tempRect.contains(point.x,point.y))return char}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(key,size,align){if(void 0===size&&(size=this._fontSize),void 0===align&&(align=this._align),key!==this.font){var entry=this.scene.sys.cache.bitmapFont.get(key);entry&&(this.font=key,this.fontData=entry.data,this._fontSize=size,this._align=align,this.fromAtlas=!0===entry.fromAtlas,this.setTexture(entry.texture,entry.frame),GetBitmapTextSize(this,!1,!0,this._bounds))}return this},setMaxWidth:function(value,wordWrapCharCode){return this._maxWidth=value,this._dirty=!0,void 0!==wordWrapCharCode&&(this.wordWrapCharCode=wordWrapCharCode),this},align:{set:function(value){this._align=value,this._dirty=!0},get:function(){return this._align}},text:{set:function(value){this.setText(value)},get:function(){return this._text}},fontSize:{set:function(value){this._fontSize=value,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(value){this._letterSpacing=value,this._dirty=!0},get:function(){return this._letterSpacing}},maxWidth:{set:function(value){this._maxWidth=value,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var out=Components$s.ToJSON(this),data={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,align:this.align};return out.data=data,out},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});BitmapText$4.ALIGN_LEFT=0,BitmapText$4.ALIGN_CENTER=1,BitmapText$4.ALIGN_RIGHT=2,BitmapText$4.ParseFromAtlas=ParseFromAtlas,BitmapText$4.ParseXMLBitmapFont=ParseXMLBitmapFont$1;var BitmapText_1=BitmapText$4,Utils$k=Utils$p,tempMatrix$4=new TransformMatrix_1,BlitterWebGLRenderer_1=function(renderer,src,camera,parentMatrix){var list=src.getRenderList();if(0!==list.length){var alpha=camera.alpha*src.alpha;if(0!==alpha){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(this.pipeline,src),cameraScrollX=camera.scrollX*src.scrollFactorX,cameraScrollY=camera.scrollY*src.scrollFactorY,calcMatrix=tempMatrix$4.copyFrom(camera.matrix);parentMatrix&&(calcMatrix.multiplyWithOffset(parentMatrix,-cameraScrollX,-cameraScrollY),cameraScrollX=0,cameraScrollY=0);var blitterX=src.x-cameraScrollX,blitterY=src.y-cameraScrollY,prevTextureSourceIndex=-1,roundPixels=camera.roundPixels;renderer.pipelines.preBatch(src);for(var index=0;index<list.length;index++){var bob=list[index],frame=bob.frame,bobAlpha=bob.alpha*alpha;if(0!==bobAlpha){var width=frame.width,height=frame.height,x=blitterX+bob.x+frame.x,y=blitterY+bob.y+frame.y;bob.flipX&&(width*=-1,x+=frame.width),bob.flipY&&(height*=-1,y+=frame.height);var xw=x+width,yh=y+height,tx0=calcMatrix.getX(x,y),ty0=calcMatrix.getY(x,y),tx1=calcMatrix.getX(xw,yh),ty1=calcMatrix.getY(xw,yh),tint=Utils$k.getTintAppendFloatAlpha(bob.tint,bobAlpha);if(frame.sourceIndex!==prevTextureSourceIndex){var textureUnit=pipeline.setGameObject(src,frame);prevTextureSourceIndex=frame.sourceIndex}roundPixels&&(tx0=Math.round(tx0),ty0=Math.round(ty0),tx1=Math.round(tx1),ty1=Math.round(ty1)),pipeline.batchQuad(src,tx0,ty0,tx0,ty1,tx1,ty1,tx1,ty0,frame.u0,frame.v0,frame.u1,frame.v1,tint,tint,tint,tint,false,frame.glTexture,textureUnit)&&(prevTextureSourceIndex=-1)}}renderer.pipelines.postBatch(src)}}},BlitterCanvasRenderer_1=function(renderer,src,camera,parentMatrix){var list=src.getRenderList();if(0!==list.length){var ctx=renderer.currentContext,alpha=camera.alpha*src.alpha;if(0!==alpha){camera.addToRenderList(src),ctx.globalCompositeOperation=renderer.blendModes[src.blendMode],ctx.imageSmoothingEnabled=!(!renderer.antialias||src.frame.source.scaleMode);var cameraScrollX=src.x-camera.scrollX*src.scrollFactorX,cameraScrollY=src.y-camera.scrollY*src.scrollFactorY;ctx.save(),parentMatrix&&parentMatrix.copyToContext(ctx);
223for(var roundPixels=camera.roundPixels,i=0;i<list.length;i++){var bob=list[i],flip=bob.flipX||bob.flipY,frame=bob.frame,cd=frame.canvasData,dx=frame.x,dy=frame.y,fx=1,fy=1,bobAlpha=bob.alpha*alpha;0!==bobAlpha&&(ctx.globalAlpha=bobAlpha,flip?(bob.flipX&&(fx=-1,dx-=cd.width),bob.flipY&&(fy=-1,dy-=cd.height),ctx.save(),ctx.translate(bob.x+cameraScrollX,bob.y+cameraScrollY),ctx.scale(fx,fy),ctx.drawImage(frame.source.image,cd.x,cd.y,cd.width,cd.height,dx,dy,cd.width,cd.height),ctx.restore()):(roundPixels&&(dx=Math.round(dx),dy=Math.round(dy)),ctx.drawImage(frame.source.image,cd.x,cd.y,cd.width,cd.height,dx+bob.x+cameraScrollX,dy+bob.y+cameraScrollY,cd.width,cd.height)))}ctx.restore()}}},BlitterRender$1={renderWebGL:BlitterWebGLRenderer_1,renderCanvas:BlitterCanvasRenderer_1},Frame$2=Frame_1,Bob_1=new Class_1({initialize:function(blitter,x,y,frame,visible){this.parent=blitter,this.x=x,this.y=y,this.frame=frame,this.data={},this.tint=16777215,this._visible=visible,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(frame){return void 0===frame?this.frame=this.parent.frame:frame instanceof Frame$2&&frame.texture===this.parent.texture?this.frame=frame:this.frame=this.parent.texture.get(frame),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(x,y,frame){return this.x=x,this.y=y,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,frame&&this.setFrame
223(frame),this},setPosition:function(x,y){return this.x=x,this.y=y,this},setFlipX:function(value){return this.flipX=value,this},setFlipY:function(value){return this.flipY=value,this},setFlip:function(x,y){return this.flipX=x,this.flipY=y,this},setVisible:function(value){return this.visible=value,this},setAlpha:function(value){return this.alpha=value,this},setTint:function(value){return this.tint=value,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(value){this.parent.dirty|=this._visible!==value,this._visible=value}},alpha:{get:function(){return this._alpha},set:function(value){this.parent.dirty|=this._alpha>0!=value>0,this._alpha=value}}}),Bob=Bob_1,Frame$1=Frame_1,GameObject$k=GameObject_1,List$2=List_1,Blitter$2=new Class_1({Extends:GameObject$k,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.Depth,components$3.Mask,components$3.Pipeline,components$3.ScrollFactor,components$3.Size,components$3.Texture,components$3.Transform,components$3.Visible,BlitterRender$1],initialize:function(scene,x,y,texture,frame){GameObject$k.call(this,scene,"Blitter"),this.setTexture(texture,frame),this.setPosition(x,y),this.initPipeline(),this.children=new List$2,this.renderList=[],this.dirty=!1},create:function(x,y,frame,visible,index){void 0===visible&&(visible=!0),void 0===index&&(index=this.children.length),void 0===frame?frame=this.frame:frame instanceof Frame$1||(frame=this.texture.get(frame));var bob=new Bob(this,x,y,frame,visible);return this.children.addAt(bob,index,!1),this.dirty=!0,bob},createFromCallback:function(callback,quantity,frame,visible){for(var bobs=this.createMultiple(quantity,frame,visible),i=0;i<bobs.length;i++){var bob=bobs[i];callback.call(this,bob,i)}return bobs},createMultiple:function(quantity,frame,visible){void 0===frame&&(frame=this.frame.name),void 0===visible&&(visible=!0),Array.isArray(frame)||(frame=[frame]);var bobs=[],_this=this;return frame.forEach((function(singleFrame){for(var i=0;i<quantity;i++)bobs.push(_this.create(0,0,singleFrame,visible))})),bobs},childCanRender:function(child){return child.visible&&child.alpha>0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}}),Blitter_1=Blitter$2,ContainerWebGLRenderer_1=function(renderer,container,camera,parentMatrix){camera.addToRenderList(container);var children=container.list,childCount=children.length;if(0!==childCount){var transformMatrix=container.localTransform;parentMatrix?(transformMatrix.loadIdentity(),transformMatrix.multiply(parentMatrix),transformMatrix.translate(container.x,container.y),transformMatrix.rotate(container.rotation),transformMatrix.scale(container.scaleX,container.scaleY)):transformMatrix.applyITRS(container.x,container.y,container.rotation,container.scaleX,container.scaleY),renderer.pipelines.preBatch(container);var containerHasBlendMode=-1!==container.blendMode;containerHasBlendMode||renderer.setBlendMode(0);for(var alpha=container.alpha,scrollFactorX=container.scrollFactorX,scrollFactorY=container.scrollFactorY,i=0;i<childCount;i++){var child=children[i];if(child.willRender(camera)){var childAlphaTopLeft,childAlphaTopRight,childAlphaBottomLeft,childAlphaBottomRight;if(void 0!==child.alphaTopLeft)childAlphaTopLeft=child.alphaTopLeft,childAlphaTopRight=child.alphaTopRight,childAlphaBottomLeft=child.alphaBottomLeft,childAlphaBottomRight=child.alphaBottomRight;else{var childAlpha=child.alpha;childAlphaTopLeft=childAlpha,childAlphaTopRight=childAlpha,childAlphaBottomLeft=childAlpha,childAlphaBottomRight=childAlpha}var childScrollFactorX=child.scrollFactorX,childScrollFactorY=child.scrollFactorY;containerHasBlendMode||child.blendMode===renderer.currentBlendMode||renderer.setBlendMode(child.blendMode);var mask=child.mask;mask&&mask.preRenderWebGL(renderer,child,camera);
223var type=child.type;type!==renderer.currentType&&(renderer.newType=!0,renderer.currentType=type),renderer.nextTypeMatch=i<childCount-1&&children[i+1].type===renderer.currentType,child.setScrollFactor(childScrollFactorX*scrollFactorX,childScrollFactorY*scrollFactorY),child.setAlpha(childAlphaTopLeft*alpha,childAlphaTopRight*alpha,childAlphaBottomLeft*alpha,childAlphaBottomRight*alpha),child.renderWebGL(renderer,child,camera,transformMatrix),child.setAlpha(childAlphaTopLeft,childAlphaTopRight,childAlphaBottomLeft,childAlphaBottomRight),child.setScrollFactor(childScrollFactorX,childScrollFactorY),mask&&mask.postRenderWebGL(renderer,camera),renderer.newType=!1}}renderer.pipelines.postBatch(container)}},ContainerCanvasRenderer_1=function(renderer,container,camera,parentMatrix){camera.addToRenderList(container);var children=container.list;if(0!==children.length){var transformMatrix=container.localTransform;parentMatrix?(transformMatrix.loadIdentity(),transformMatrix.multiply(parentMatrix),transformMatrix.translate(container.x,container.y),transformMatrix.rotate(container.rotation),transformMatrix.scale(container.scaleX,container.scaleY)):transformMatrix.applyITRS(container.x,container.y,container.rotation,container.scaleX,container.scaleY);var containerHasBlendMode=-1!==container.blendMode;containerHasBlendMode||renderer.setBlendMode(0);var alpha=container._alpha,scrollFactorX=container.scrollFactorX,scrollFactorY=container.scrollFactorY;container.mask&&container.mask.preRenderCanvas(renderer,null,camera);for(var i=0;i<children.length;i++){var child=children[i];if(child.willRender(camera)){var childAlpha=child.alpha,childScrollFactorX=child.scrollFactorX,childScrollFactorY=child.scrollFactorY;containerHasBlendMode||child.blendMode===renderer.currentBlendMode||renderer.setBlendMode(child.blendMode),child.setScrollFactor(childScrollFactorX*scrollFactorX,childScrollFactorY*scrollFactorY),child.setAlpha(childAlpha*alpha),child.renderCanvas(renderer,child,camera,transformMatrix),child.setAlpha(childAlpha),child.setScrollFactor(childScrollFactorX,childScrollFactorY)}}container.mask&&container.mask.postRenderCanvas(renderer)}},Rectangle$k=Rectangle_1$1,Union_1=function(rectA,rectB,out){void 0===out&&(out=new Rectangle$k);var x=Math.min(rectA.x,rectB.x),y=Math.min(rectA.y,rectB.y),w=Math.max(rectA.right,rectB.right)-x,h=Math.max(rectA.bottom,rectB.bottom)-y;return out.setTo(x,y,w,h)},ArrayUtils=array,BlendModes$3=BlendModes$8,Components$q=components$3,Events$n=events$h,GameObject$j=GameObject_1,Rectangle$j=Rectangle_1$1,Render$6={renderWebGL:ContainerWebGLRenderer_1,renderCanvas:ContainerCanvasRenderer_1},Union=Union_1,Vector2$w=Vector2_1,Container$2=new Class_1({Extends:GameObject$j,Mixins:[Components$q.AlphaSingle,Components$q.BlendMode,Components$q.ComputedSize,Components$q.Depth,Components$q.Mask,Components$q.Pipeline,Components$q.Transform,Components$q.Visible,Render$6],initialize:function(scene,x,y,children){GameObject$j.call(this,scene,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new Components$q.TransformMatrix,this.tempTransformMatrix=new Components$q.TransformMatrix,this._sortKey="",this._sysEvents=scene.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(x,y),this.clearAlpha(),this.setBlendMode(BlendModes$3.SKIP_CHECK),children&&this.add(children)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(value){return void 0===value&&(value=!0),this.exclusive=value,this},getBounds:function(output){if(void 0===output&&(output=new Rectangle$j),output.setTo(this.x,this.y,0,0),this.parentContainer){var transformedPosition=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);output.setTo(transformedPosition.x,transformedPosition.y,0,0)}if(this.list.length>0){var children=this.list,tempRect=new Rectangle$j,hasSetFirst=!1;output.setEmpty();for(var i=0;i<children.length;i++){var entry=children[i];entry.getBounds&&(entry.getBounds(tempRect),hasSetFirst?Union(tempRect,output,output):(output.setTo(tempRect.x,tempRect.y,tempRect.width,tempRect.height),hasSetFirst=!0))}}return output},addHandler:function(gameObject){gameObject.once(Events$n.DESTROY,this.remove,this),this.exclusive&&(gameObject.parentContainer&&gameObject.parentContainer.remove(gameObject),gameObject.removeFromDisplayList(),gameObject.parentContainer=this)},removeHandler:function(gameObject){gameObject.off(Events$n.DESTROY,this.remove),this.exclusive&&(gameObject.parentContainer=null,gameObject.addToDisplayList())},pointToContainer:function(source,output){void 0===output&&(output=new Vector2$w),this.parentContainer?this.parentContainer.pointToContainer(source,output):output=new Vector2$w(source.x,source.y);var tempMatrix=this.tempTransformMatrix;return tempMatrix.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),tempMatrix.invert(),tempMatrix.transformPoint(source.x,source.y,output),output},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(child){return ArrayUtils.Add(this.list,child,this.maxSize,this.addHandler,this),this},addAt:function(child,index){return ArrayUtils.AddAt(this.list,child,index,this.maxSize,this.addHandler,this),this},getAt:function(index){return this.list[index]},getIndex:function(child){return this.list.indexOf(child)},sort:function(property,handler){return property?(void 0===handler&&(handler=function(childA,childB){return childA[property]-childB[property]}),ArrayUtils.StableSort(this.list,handler),this):this},getByName:function(name){return ArrayUtils.GetFirst(this.list,"
223name",name)},getRandom:function(startIndex,length){return ArrayUtils.GetRandom(this.list,startIndex,length)},getFirst:function(property,value,startIndex,endIndex){return ArrayUtils.GetFirst(this.list,property,value,startIndex,endIndex)},getAll:function(property,value,startIndex,endIndex){return ArrayUtils.GetAll(this.list,property,value,startIndex,endIndex)},count:function(property,value,startIndex,endIndex){return ArrayUtils.CountAllMatching(this.list,property,value,startIndex,endIndex)},swap:function(child1,child2){return ArrayUtils.Swap(this.list,child1,child2),this},moveTo:function(child,index){return ArrayUtils.MoveTo(this.list,child,index),this},moveAbove:function(child1,child2){return ArrayUtils.MoveAbove(this.list,child1,child2),this},moveBelow:function(child1,child2){return ArrayUtils.MoveBelow(this.list,child1,child2),this},remove:function(child,destroyChild){var removed=ArrayUtils.Remove(this.list,child,this.removeHandler,this);if(destroyChild&&removed){Array.isArray(removed)||(removed=[removed]);for(var i=0;i<removed.length;i++)removed[i].destroy()}return this},removeAt:function(index,destroyChild){var removed=ArrayUtils.RemoveAt(this.list,index,this.removeHandler,this);return destroyChild&&removed&&removed.destroy(),this},removeBetween:function(startIndex,endIndex,destroyChild){var removed=ArrayUtils.RemoveBetween(this.list,startIndex,endIndex,this.removeHandler,this);if(destroyChild)for(var i=0;i<removed.length;i++)removed[i].destroy();return this},removeAll:function(destroyChild){var removed=ArrayUtils.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(destroyChild)for(var i=0;i<removed.length;i++)removed[i].destroy();return this},bringToTop:function(child){return ArrayUtils.BringToTop(this.list,child),this},sendToBack:function(child){return ArrayUtils.SendToBack(this.list,child),this},moveUp:function(child){return ArrayUtils.MoveUp(this.list,child),this},moveDown:function(child){return ArrayUtils.MoveDown(this.list,child),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return ArrayUtils.Shuffle(this.list),this},replace:function(oldChild,newChild,destroyChild){return ArrayUtils.Replace(this.list,oldChild,newChild)&&(this.addHandler(newChild),this.removeHandler(oldChild),destroyChild&&oldChild.destroy()),this},exists:function(child){return this.list.indexOf(child)>-1},setAll:function(property,value,startIndex,endIndex){return ArrayUtils.SetAll(this.list,property,value,startIndex,endIndex),this},each:function(callback,context){var i,args=[null],temp=this.list.slice(),len=temp.length;for(i=2;i<arguments.length;i++)args.push(arguments[i]);for(i=0;i<len;i++)args[0]=temp[i],callback.apply(context,args);return this},iterate:function(callback,context){var i,args=[null];for(i=2;i<arguments.length;i++)args.push(arguments[i]);for(i=0;i<this.list.length;i++)args[0]=this.list[i],callback.apply(context,args);return this},setScrollFactor:function(x,y,updateChildren){return void 0===y&&(y=x),void 0===updateChildren&&(updateChildren=!1),this.scrollFactorX=x,this.scrollFactorY=y,updateChildren&&(ArrayUtils.SetAll(this.list,"scrollFactorX",x),ArrayUtils.SetAll(this.list,"scrollFactorY",y)),this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}}),Container_1=Container$2,CSSBlendModes=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],GameObject$i=GameObject_1,TransformMatrix$7=TransformMatrix_1,tempMatrix1$3=new TransformMatrix$7,tempMatrix2$3=new TransformMatrix$7,tempMatrix3$3=new TransformMatrix$7,DOMElementCSSRenderer_1=function(renderer,src,camera,parentMatrix){if(src.node){var style=src.node.style,settings=src.scene.sys.settings;if(!style||!settings.visible||GameObject$i.RENDER_MASK!==src.renderFlags||0!==src.c
223ameraFilter&&src.cameraFilter&camera.id||src.parentContainer&&!src.parentContainer.willRender())style.display="none";else{var parent=src.parentContainer,alpha=camera.alpha*src.alpha;parent&&(alpha*=parent.alpha);var camMatrix=tempMatrix1$3,srcMatrix=tempMatrix2$3,calcMatrix=tempMatrix3$3,dx=0,dy=0,tx="0%",ty="0%";parentMatrix?(dx=src.width*src.scaleX*src.originX,dy=src.height*src.scaleY*src.originY,srcMatrix.applyITRS(src.x-dx,src.y-dy,src.rotation,src.scaleX,src.scaleY),camMatrix.copyFrom(camera.matrix),camMatrix.multiplyWithOffset(parentMatrix,-camera.scrollX*src.scrollFactorX,-camera.scrollY*src.scrollFactorY),srcMatrix.e=src.x-dx,srcMatrix.f=src.y-dy,camMatrix.multiply(srcMatrix,calcMatrix)):(dx=src.width*src.originX,dy=src.height*src.originY,srcMatrix.applyITRS(src.x-dx,src.y-dy,src.rotation,src.scaleX,src.scaleY),camMatrix.copyFrom(camera.matrix),tx=100*src.originX+"%",ty=100*src.originY+"%",srcMatrix.e-=camera.scrollX*src.scrollFactorX,srcMatrix.f-=camera.scrollY*src.scrollFactorY,camMatrix.multiply(srcMatrix,calcMatrix)),src.transformOnly||(style.display="block",style.opacity=alpha,style.zIndex=src._depth,style.pointerEvents=src.pointerEvents,style.mixBlendMode=CSSBlendModes[src._blendMode]),style.transform=calcMatrix.getCSSMatrix()+" skew("+src.skewX+"rad, "+src.skewY+"rad) rotate3d("+src.rotate3d.x+","+src.rotate3d.y+","+src.rotate3d.z+","+src.rotate3d.w+src.rotate3dAngle+")",style.transformOrigin=tx+" "+ty}}},GameObject$h=GameObject_1,IsPlainObject$v=IsPlainObject_1,RemoveFromDOM$1=RemoveFromDOM_1,SCENE_EVENTS=events$g,Vector4$2=Vector4_1,DOMElement$1=new Class_1({Extends:GameObject$h,Mixins:[components$3.AlphaSingle,components$3.BlendMode,components$3.Depth,components$3.Origin,components$3.ScrollFactor,components$3.Transform,components$3.Visible,{renderWebGL:DOMElementCSSRenderer_1,renderCanvas:DOMElementCSSRenderer_1}],initialize:function(scene,x,y,element,style,innerText){GameObject$h.call(this,scene,"DOMElement"),this.parent=scene.sys.game.domContainer,this.cache=scene.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new Vector4$2,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(x,y),"string"==typeof element?"#"===element[0]?this.setElement(element.substr(1),style,innerText):this.createElement(element,style,innerText):element&&this.setElement(element,style,innerText),scene.sys.events.on(SCENE_EVENTS.SLEEP,this.handleSceneEvent,this),scene.sys.events.on(SCENE_EVENTS.WAKE,this.handleSceneEvent,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},handleSceneEvent:function(sys){var node=this.node,style=node.style;node&&(style.display=sys.settings.visible?"block":"none")},setSkew:function(x,y){return void 0===x&&(x=0),void 0===y&&(y=x),this.skewX=x,this.skewY=y,this},setPerspective:function(value){return this.parent.style.perspective=value+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(value){this.parent.style.perspective=value+"px"}},addListener:function(events){if(this.node){events=events.split(" ");for(var i=0;i<events.length;i++)this.node.addEventListener(events[i],this.handler,!1)}return this},removeListener:function(events){if(this.node){events=events.split(" ");for(var i=0;i<events.length;i++)this.node.removeEventListener(events[i],this.handler)}return this},dispatchNativeEvent:function(event){this.emit(event.type,event)},createElement:function(tagName,style,innerText){return this.setElement(document.createElement(tagName),style,innerText)},setElement:function(element,style,innerText){var target;if(this.removeElement(),"string"==typeof element?("#"===element[0]&&(element=element.substr(1)),target=document.getElementById(element)):"object"==typeof element&&1===element.nodeType&&(target=element),!target)return this;if(this.node=target,style&&IsPlainObject$v(style))for(var key in style)target.style[key]=style[key];else"string"==typeof style&&(target.style=style);return target.style.zIndex="0",target.style.display="inline",target.style.position="absolute",target.phaser=this,this.parent&&this.parent.appendChild(target),innerText&&(target.innerText=innerText),this.updateSize()},createFromCache:function(key,tagName){var html=this.cache.get(key);return html&&this.createFromHTML(html,tagName),this},createFromHTML:function(html,tagName){void 0===tagName&&(tagName="div"),this.removeElement();var element=document.createElement(tagName);return this.node=element,element.style.zIndex="0",element.style.display="inline",element.style.position="absolute",element.phaser=this,this.parent&&this.parent.appendChild(element),element.innerHTML=html,this.updateSize()},removeElement:function(){return this.node&&(RemoveFromDOM$1(this.node),this.node=null),this},updateSize:function(){var node=this.node,nodeBounds=node.getBoundingClientRect();return this.width=node.clientWidth,this.height=node.clientHeight,this.displayWidth=nodeBounds.width||0,this.displayHeight=nodeBounds.height||0,this},getChildByProperty:function(property,value){if(this.node)for(var children=this.node.querySelectorAll("*"),i=0;i<children.length;i++)if(children[i][property]===value)return children[i];return null},getChildByID:function(id){return this.getChildByProperty("id",id)},getChildByName:function(name){return this.getChildByProperty("name",name)},setClassName:function(className){return this.node&&(this.node.className=className,this.updateSize()),this},setText:function(text){return this.node&&(this.node.innerText=text,this.updateSize()),this},setHTML:function(html){return this.node&&(this.node.innerHTML=html,this.updateSize()),this},preUpdate:function(){var parent=this.parentContainer,node=this.node;node&&parent&&!parent.willRender()&&(node.style.display="none")},willRender:function(){return!0},preDestroy:function(){this.removeElement(),this.scene.sys.events.off(SCENE_EVENTS.SLEEP,this.handleSceneEvent,this),this.scene.sys.events.off(SCENE_EVENTS.WAKE,this.handleSceneEvent,this)}}),DOMElement_1=DOMElement$1,GetCalcMatrix$i=GetCalcMatrix_1,Utils$j=Utils$p,tempMatrix$3=new TransformMatrix_1,DynamicBitmapTextWebGLRenderer_1=function(renderer,src,camera,parentMatrix){var text=sr
223c.text,textLength=text.length;if(0!==textLength){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline,src),result=GetCalcMatrix$i(src,camera,parentMatrix),spriteMatrix=result.sprite,calcMatrix=result.calc,fontMatrix=tempMatrix$3,crop=src.cropWidth>0||src.cropHeight>0;crop&&(pipeline.flush(),renderer.pushScissor(calcMatrix.tx,calcMatrix.ty,src.cropWidth*calcMatrix.scaleX,src.cropHeight*calcMatrix.scaleY));var glyph,lastGlyph,texture=src.frame.glTexture,tintEffect=src.tintFill,tintTL=Utils$j.getTintAppendFloatAlpha(src.tintTopLeft,camera.alpha*src._alphaTL),tintTR=Utils$j.getTintAppendFloatAlpha(src.tintTopRight,camera.alpha*src._alphaTR),tintBL=Utils$j.getTintAppendFloatAlpha(src.tintBottomLeft,camera.alpha*src._alphaBL),tintBR=Utils$j.getTintAppendFloatAlpha(src.tintBottomRight,camera.alpha*src._alphaBR),textureUnit=pipeline.setGameObject(src),xAdvance=0,yAdvance=0,charCode=0,lastCharCode=0,letterSpacing=src.letterSpacing,glyphW=0,glyphH=0,scrollX=src.scrollX,scrollY=src.scrollY,fontData=src.fontData,chars=fontData.chars,lineHeight=fontData.lineHeight,scale=src.fontSize/fontData.size,rotation=0,align=src._align,currentLine=0,lineOffsetX=0,bounds=src.getTextBounds(!1);src.maxWidth>0&&(textLength=(text=bounds.wrappedText).length);var lineData=src._bounds.lines;1===align?lineOffsetX=(lineData.longest-lineData.lengths[0])/2:2===align&&(lineOffsetX=lineData.longest-lineData.lengths[0]);var roundPixels=camera.roundPixels,displayCallback=src.displayCallback,callbackData=src.callbackData;renderer.pipelines.preBatch(src);for(var i=0;i<textLength;i++)if(10!==(charCode=text.charCodeAt(i))){if(glyph=chars[charCode]){glyphW=glyph.width,glyphH=glyph.height;var x=glyph.xOffset+xAdvance-scrollX,y=glyph.yOffset+yAdvance-scrollY;if(null!==lastGlyph){var kerningOffset=glyph.kerning[lastCharCode];x+=void 0!==kerningOffset?kerningOffset:0}if(xAdvance+=glyph.xAdvance+letterSpacing,lastGlyph=glyph,lastCharCode=charCode,0!==glyphW&&0!==glyphH&&32!==charCode){if(scale=src.fontSize/src.fontData.size,rotation=0,displayCallback){callbackData.color=0,callbackData.tint.topLeft=tintTL,callbackData.tint.topRight=tintTR,callbackData.tint.bottomLeft=tintBL,callbackData.tint.bottomRight=tintBR,callbackData.index=i,callbackData.charCode=charCode,callbackData.x=x,callbackData.y=y,callbackData.scale=scale,callbackData.rotation=rotation,callbackData.data=glyph.data;var output=displayCallback(callbackData);x=output.x,y=output.y,scale=output.scale,rotation=output.rotation,output.color?(tintTL=output.color,tintTR=output.color,tintBL=output.color,tintBR=output.color):(tintTL=output.tint.topLeft,tintTR=output.tint.topRight,tintBL=output.tint.bottomLeft,tintBR=output.tint.bottomRight),tintTL=Utils$j.getTintAppendFloatAlpha(tintTL,camera.alpha*src._alphaTL),tintTR=Utils$j.getTintAppendFloatAlpha(tintTR,camera.alpha*src._alphaTR),tintBL=Utils$j.getTintAppendFloatAlpha(tintBL,camera.alpha*src._alphaBL),tintBR=Utils$j.getTintAppendFloatAlpha(tintBR,camera.alpha*src._alphaBR)}x*=scale,y*=scale,x-=src.displayOriginX,y-=src.displayOriginY,x+=lineOffsetX,fontMatrix.applyITRS(x,y,rotation,scale,scale),calcMatrix.multiply(fontMatrix,spriteMatrix);var u0=glyph.u0,v0=glyph.v0,u1=glyph.u1,v1=glyph.v1,xw=glyphW,yh=glyphH,tx0=spriteMatrix.e,ty0=spriteMatrix.f,tx1=yh*spriteMatrix.c+spriteMatrix.e,ty1=yh*spriteMatrix.d+spriteMatrix.f,tx2=xw*spriteMatrix.a+yh*spriteMatrix.c+spriteMatrix.e,ty2=xw*spriteMatrix.b+yh*spriteMatrix.d+spriteMatrix.f,tx3=xw*spriteMatrix.a+spriteMatrix.e,ty3=xw*spriteMatrix.b+spriteMatrix.f;roundPixels&&(tx0=Math.round(tx0),ty0=Math.round(ty0),tx1=Math.round(tx1),ty1=Math.round(ty1),tx2=Math.round(tx2),ty2=Math.round(ty2),tx3=Math.round(tx3),ty3=Math.round(ty3)),pipeline.batchQuad(src,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,u0,v0,u1,v1,tintTL,tintTR,tintBL,tintBR,tintEffect,texture,textureUnit)}}}else currentLine++,1===align?lineOffsetX=(lineData.longest-lineData.lengths[currentLine])/2:2===align&&(lineOffsetX=lineData.longest-lineData.lengths[currentLine]),xAdvance=0,yAdvance+=lineHeight,lastGlyph=null;crop&&(pipeline.flush(),renderer.popScissor()),renderer.pipelines.postBatch(src)}},SetTransform$c=SetTransform_1,DynamicBitmapTextCanvasRenderer_1=function(renderer,src,camera,parentMatrix){var text=sr
223c._text,textLength=text.length,ctx=renderer.currentContext;if(0!==textLength&&SetTransform$c(renderer,ctx,src,camera,parentMatrix)){camera.addToRenderList(src);var textureFrame=src.fromAtlas?src.frame:src.texture.frames.__BASE,displayCallback=src.displayCallback,callbackData=src.callbackData,chars=src.fontData.chars,lineHeight=src.fontData.lineHeight,letterSpacing=src._letterSpacing,xAdvance=0,yAdvance=0,charCode=0,glyph=null,glyphX=0,glyphY=0,glyphW=0,glyphH=0,x=0,y=0,lastGlyph=null,lastCharCode=0,image=src.frame.source.image,textureX=textureFrame.cutX,textureY=textureFrame.cutY,rotation=0,scale=0,baseScale=src._fontSize/src.fontData.size,align=src._align,currentLine=0,lineOffsetX=0;src.getTextBounds(!1);var lineData=src._bounds.lines;1===align?lineOffsetX=(lineData.longest-lineData.lengths[0])/2:2===align&&(lineOffsetX=lineData.longest-lineData.lengths[0]),ctx.translate(-src.displayOriginX,-src.displayOriginY);var roundPixels=camera.roundPixels;src.cropWidth>0&&src.cropHeight>0&&(ctx.beginPath(),ctx.rect(0,0,src.cropWidth,src.cropHeight),ctx.clip());for(var i=0;i<textLength;i++)if(scale=baseScale,rotation=0,10!==(charCode=text.charCodeAt(i))){if(glyph=chars[charCode]){if(glyphX=textureX+glyph.x,glyphY=textureY+glyph.y,glyphW=glyph.width,glyphH=glyph.height,x=glyph.xOffset+xAdvance-src.scrollX,y=glyph.yOffset+yAdvance-src.scrollY,null!==lastGlyph){var kerningOffset=glyph.kerning[lastCharCode];x+=void 0!==kerningOffset?kerningOffset:0}if(displayCallback){callbackData.index=i,callbackData.charCode=charCode,callbackData.x=x,callbackData.y=y,callbackData.scale=scale,callbackData.rotation=rotation,callbackData.data=glyph.data;var output=displayCallback(callbackData);x=output.x,y=output.y,scale=output.scale,rotation=output.rotation}x*=scale,y*=scale,x+=lineOffsetX,xAdvance+=glyph.xAdvance+letterSpacing,lastGlyph=glyph,lastCharCode=charCode,0!==glyphW&&0!==glyphH&&32!==charCode&&(roundPixels&&(x=Math.round(x),y=Math.round(y)),ctx.save(),ctx.translate(x,y),ctx.rotate(rotation),ctx.scale(scale,scale),ctx.drawImage(image,glyphX,glyphY,glyphW,glyphH,0,0,glyphW,glyphH),ctx.restore())}}else currentLine++,1===align?lineOffsetX=(lineData.longest-lineData.lengths[currentLine])/2:2===align&&(lineOffsetX=lineData.longest-lineData.lengths[currentLine]),xAdvance=0,yAdvance+=lineHeight,lastGlyph=null;ctx.restore()}},BitmapText$3=BitmapText_1,DynamicBitmapText$1=new Class_1({Extends:BitmapText$3,Mixins:[{renderWebGL:DynamicBitmapTextWebGLRenderer_1,renderCanvas:DynamicBitmapTextCanvasRenderer_1}],initialize:function(scene,x,y,font,text,size,align){BitmapText$3.call(this,scene,x,y,font,text,size,align),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(width,height){return this.cropWidth=width,this.cropHeight=height,this},setDisplayCallback:function(callback){return this.displayCallback=callback,this},setScrollX:function(value){return this.scrollX=value,this},setScrollY:function(value){return this.scrollY=value,this}}),DynamicBitmapText_1=DynamicBitmapText$1,GetCalcMatrix$h=GetCalcMatrix_1,ExternWebGLRenderer_1=function(renderer,src,camera,parentMatrix){renderer.pipelines.clear();var calcMatrix=GetCalcMatrix$h(src,camera,parentMatrix).calc;src.render.call(src,renderer,camera,calcMatrix),renderer.pipelines.rebind()}
223,GameObject$g=GameObject_1,Extern$1=new Class_1({Extends:GameObject$g,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.Depth,components$3.Flip,components$3.Origin,components$3.ScrollFactor,components$3.Size,components$3.Texture,components$3.Tint,components$3.Transform,components$3.Visible,{renderWebGL:ExternWebGLRenderer_1,renderCanvas:getAugmentedNamespace(Object.freeze({__proto__:null}))}],initialize:function(scene){GameObject$g.call(this,scene,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}}),Extern_1=Extern$1,Commands$3={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22},Contains_1$2=function(ellipse,x,y){if(ellipse.width<=0||ellipse.height<=0)return!1;var normx=(x-ellipse.x)/ellipse.width,normy=(y-ellipse.y)/ellipse.height;return(normx*=normx)+(normy*=normy)<.25},Point$r=Point_1,CircumferencePoint_1=function(ellipse,angle,out){void 0===out&&(out=new Point$r);var halfWidth=ellipse.width/2,halfHeight=ellipse.height/2;return out.x=ellipse.x+halfWidth*Math.cos(angle),out.y=ellipse.y+halfHeight*Math.sin(angle),out},CircumferencePoint$1=CircumferencePoint_1,FromPercent$1=FromPercent_1,MATH_CONST$c=_const$b,Point$q=Point_1,GetPoint_1$1=function(ellipse,position,out){void 0===out&&(out=new Point$q);var angle=FromPercent$1(position,0,MATH_CONST$c.PI2);return CircumferencePoint$1(ellipse,angle,out)},Circumference_1=function(ellipse){var rx=ellipse.width/2,ry=ellipse.height/2,h=Math.pow(rx-ry,2)/Math.pow(rx+ry,2);return Math.PI*(rx+ry)*(1+3*h/(10+Math.sqrt(4-3*h)))},Circumference=Circumference_1,CircumferencePoint=CircumferencePoint_1,FromPercent=FromPercent_1,MATH_CONST$b=_const$b,GetPoints_1$2=function(ellipse,quantity,stepRate,out){void 0===out&&(out=[]),!quantity&&stepRate>0&&(quantity=Circumference(ellipse)/stepRate);for(var i=0;i<quantity;i++){var angle=FromPercent(i/quantity,0,MATH_CONST$b.PI2);out.push(CircumferencePoint(ellipse,angle))}return out},Contains$e=Contains_1$2,GetPoint$2=GetPoint_1$1,GetPoints$4=GetPoints_1$2,GEOM_CONST$3=_const$c,Random$1=Random_1$2,Ellipse$6=new Class_1({initialize:function(x,y,width,height){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=0),void 0===height&&(height=0),this.type=GEOM_CONST$3.ELLIPSE,this.x=x,this.y=y,this.width=width,this.height=height},contains:function(x,y){return Contains$e(this,x,y)},getPoint:function(position,point){return GetPoint$2(this,position,point)},getPoints:function(quantity,stepRate,output){return GetPoints$4(this,quantity,stepRate,output)},getRandomPoint:function(point){return Random$1(this,point)},setTo:function(x,y,width,height){return this.x=x,this.y=y,this.width=width,this.height=height,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(x,y){return void 0===y&&(y=x),this.x=x,this.y=y,this},setSize:function(width,height){return void 0===height&&(height=width),this.width=width,this.height=height,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(value){this.x=value+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(value){this.x=value-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(value){this.y=value+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(value){this.y=value-this.height/2}}}),Ellipse_1$1=Ellipse$6,Commands$2=Commands$3,GetCalcMatrix$g=GetCalcMatrix_1,Utils$i=Utils$p,Point$p=function(x,y,width){this.x=x,this.y=y,this.width=width},Path=function(x,y,width){this.points=[],this.pointsLength=1,this.points[0]=new Point$p(x,y,width)},matrixStack=[],tempMatrix$2=new TransformMatrix_1,GraphicsWebGLRenderer_1=function(renderer,src,camera,parentMatrix){if(0!==src.commandBuffer.length){camera.addToRenderList(src);
223var pipeline=renderer.pipelines.set(src.pipeline,src);renderer.pipelines.preBatch(src);for(var calcMatrix=GetCalcMatrix$g(src,camera,parentMatrix).calc,currentMatrix=tempMatrix$2.loadIdentity(),commands=src.commandBuffer,alpha=camera.alpha*src.alpha,lineWidth=1,fillTint=pipeline.fillTint,strokeTint=pipeline.strokeTint,tx=0,ty=0,ta=0,PI2=2*Math.PI,path=[],pathIndex=0,pathOpen=!0,lastPath=null,getTint=Utils$i.getTintAppendFloatAlpha,cmdIndex=0;cmdIndex<commands.length;cmdIndex++)switch(commands[cmdIndex]){case Commands$2.BEGIN_PATH:path.length=0,lastPath=null,pathOpen=!0;break;case Commands$2.CLOSE_PATH:pathOpen=!1,lastPath&&lastPath.points.length&&lastPath.points.push(lastPath.points[0]);break;case Commands$2.FILL_PATH:for(pathIndex=0;pathIndex<path.length;pathIndex++)pipeline.batchFillPath(path[pathIndex].points,currentMatrix,calcMatrix);break;case Commands$2.STROKE_PATH:for(pathIndex=0;pathIndex<path.length;pathIndex++)pipeline.batchStrokePath(path[pathIndex].points,lineWidth,pathOpen,currentMatrix,calcMatrix);break;case Commands$2.LINE_STYLE:lineWidth=commands[++cmdIndex];var strokeTintColor=getTint(commands[++cmdIndex],commands[++cmdIndex]*alpha);strokeTint.TL=strokeTintColor,strokeTint.TR=strokeTintColor,strokeTint.BL=strokeTintColor,strokeTint.BR=strokeTintColor;break;case Commands$2.FILL_STYLE:var fillTintColor=getTint(commands[++cmdIndex],commands[++cmdIndex]*alpha);fillTint.TL=fillTintColor,fillTint.TR=fillTintColor,fillTint.BL=fillTintColor,fillTint.BR=fillTintColor;break;case Commands$2.GRADIENT_FILL_STYLE:var alphaTL=commands[++cmdIndex]*alpha,alphaTR=commands[++cmdIndex]*alpha,alphaBL=commands[++cmdIndex]*alpha,alphaBR=commands[++cmdIndex]*alpha;fillTint.TL=getTint(commands[++cmdIndex],alphaTL),fillTint.TR=getTint(commands[++cmdIndex],alphaTR),fillTint.BL=getTint(commands[++cmdIndex],alphaBL),fillTint.BR=getTint(commands[++cmdIndex],alphaBR);break;case Commands$2.GRADIENT_LINE_STYLE:lineWidth=commands[++cmdIndex];var gradientLineAlpha=commands[++cmdIndex]*alpha;strokeTint.TL=getTint(commands[++cmdIndex],gradientLineAlpha),strokeTint.TR=getTint(commands[++cmdIndex],gradientLineAlpha),strokeTint.BL=getTint(commands[++cmdIndex],gradientLineAlpha),strokeTint.BR=getTint(commands[++cmdIndex],gradientLineAlpha);break;case Commands$2.ARC:var iteration=0,x=commands[++cmdIndex],y=commands[++cmdIndex],radius=commands[++cmdIndex],startAngle=commands[++cmdIndex],endAngle=commands[++cmdIndex],anticlockwise=commands[++cmdIndex],overshoot=commands[++cmdIndex];for(endAngle-=startAngle,anticlockwise?endAngle<-PI2?endAngle=-PI2:endAngle>0&&(endAngle=endAngle%PI2-PI2):endAngle>PI2?endAngle=PI2:endAngle<0&&(endAngle=PI2+endAngle%PI2),null===lastPath&&(lastPath=new Path(x+Math.cos(startAngle)*radius,y+Math.sin(startAngle)*radius,lineWidth),path.push(lastPath),iteration+=.01);iteration<1+overshoot;)ta=endAngle*iteration+startAngle,tx=x+Math.cos(ta)*radius,ty=y+Math.sin(ta)*radius,lastPath.points.push(new Point$p(tx,ty,lineWidth)),iteration+=.01;ta=endAngle+startAngle,tx=x+Math.cos(ta)*radius,ty=y+Math.sin(ta)*radius,lastPath.points.push(new Point$p(tx,ty,lineWidth));break;case Commands$2.FILL_RECT:pipeline.batchFillRect(commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],currentMatrix,calcMatrix);break;case Commands$2.FILL_TRIANGLE:pipeline.batchFillTriangle(commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],currentMatrix,calcMatrix);break;case Commands$2.STROKE_TRIANGLE:pipeline.batchStrokeTriangle(commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],commands[++cmdIndex],lineWidth,currentMatrix,calcMatrix);break;case Commands$2.LINE_TO:null!==lastPath?lastPath.points.push(new Point$p(commands[++cmdIndex],commands[++cmdIndex],lineWidth)):(lastPath=new Path(commands[++cmdIndex],commands[++cmdIndex],lineWidth),path.push(lastPath));break;case Commands$2.MOVE_TO:lastPath=new Path(commands[++cmdIndex],commands[++cmdIndex],lineWidth),path.push(lastPath);break;case Commands$2.SAVE:matrixStack.push(currentMatrix.copyToArray());break;case Commands$2.RESTORE:currentMatrix.copyFromArray(matrixStack.pop());break;case Commands$2.TRANSLATE:x=commands[++cmdIndex],y=commands[++cmdIndex],currentMatrix.translate(x,y);break;case Commands$2.SCALE:x=commands[++cmdIndex],y=commands[++cmdIndex],currentMatrix.scale(x,y);break;case Commands$2.ROTATE:currentMatrix.rotate(commands[++cmdIndex])}renderer.pipelines.postBatch(src)}},Commands$1=Commands$3,SetTransform$b=SetTransform_1,GraphicsCanvasRenderer_1=function(renderer,src,camera,parentMatrix,renderTargetCtx,allowClip){var commandBuffer=src.commandBuffer,commandBufferLength=commandBuffer.length,ctx=renderTargetCtx||renderer.currentContext;if(0!==commandBufferLength&&SetTransform$b(renderer,ctx,src,camera,parentMatrix)){camera.addToRenderList(src);var lineAlpha=1,fillAlpha=1,lineColor=0,fillColor=0,lineWidth=1,red=0,green=0,blue=0;ctx.beginPath();for(var index=0;
223index<commandBufferLength;++index){switch(commandBuffer[index]){case Commands$1.ARC:ctx.arc(commandBuffer[index+1],commandBuffer[index+2],commandBuffer[index+3],commandBuffer[index+4],commandBuffer[index+5],commandBuffer[index+6]),index+=7;break;case Commands$1.LINE_STYLE:lineWidth=commandBuffer[index+1],lineColor=commandBuffer[index+2],lineAlpha=commandBuffer[index+3],red=(16711680&lineColor)>>>16,green=(65280&lineColor)>>>8,blue=255&lineColor,ctx.strokeStyle="rgba("+red+","+green+","+blue+","+lineAlpha+")",ctx.lineWidth=lineWidth,index+=3;break;case Commands$1.FILL_STYLE:fillColor=commandBuffer[index+1],fillAlpha=commandBuffer[index+2],red=(16711680&fillColor)>>>16,green=(65280&fillColor)>>>8,blue=255&fillColor,ctx.fillStyle="rgba("+red+","+green+","+blue+","+fillAlpha+")",index+=2;break;case Commands$1.BEGIN_PATH:ctx.beginPath();break;case Commands$1.CLOSE_PATH:ctx.closePath();break;case Commands$1.FILL_PATH:allowClip||ctx.fill();break;case Commands$1.STROKE_PATH:allowClip||ctx.stroke();break;case Commands$1.FILL_RECT:allowClip?ctx.rect(commandBuffer[index+1],commandBuffer[index+2],commandBuffer[index+3],commandBuffer[index+4]):ctx.fillRect(commandBuffer[index+1],commandBuffer[index+2],commandBuffer[index+3],commandBuffer[index+4]),index+=4;break;case Commands$1.FILL_TRIANGLE:ctx.beginPath(),ctx.moveTo(commandBuffer[index+1],commandBuffer[index+2]),ctx.lineTo(commandBuffer[index+3],commandBuffer[index+4]),ctx.lineTo(commandBuffer[index+5],commandBuffer[index+6]),ctx.closePath(),allowClip||ctx.fill(),index+=6;break;case Commands$1.STROKE_TRIANGLE:ctx.beginPath(),ctx.moveTo(commandBuffer[index+1],commandBuffer[index+2]),ctx.lineTo(commandBuffer[index+3],commandBuffer[index+4]),ctx.lineTo(commandBuffer[index+5],commandBuffer[index+6]),ctx.closePath(),allowClip||ctx.stroke(),index+=6;break;case Commands$1.LINE_TO:ctx.lineTo(commandBuffer[index+1],commandBuffer[index+2]),index+=2;break;case Commands$1.MOVE_TO:ctx.moveTo(commandBuffer[index+1],commandBuffer[index+2]),index+=2;break;case Commands$1.LINE_FX_TO:ctx.lineTo(commandBuffer[index+1],commandBuffer[index+2]),index+=5;break;case Commands$1.MOVE_FX_TO:ctx.moveTo(commandBuffer[index+1],commandBuffer[index+2]),index+=5;break;case Commands$1.SAVE:ctx.save();break;case Commands$1.RESTORE:ctx.restore();break;case Commands$1.TRANSLATE:ctx.translate(commandBuffer[index+1],commandBuffer[index+2]),index+=2;break;case Commands$1.SCALE:ctx.scale(commandBuffer[index+1],commandBuffer[index+2]),index+=2;break;case Commands$1.ROTATE:ctx.rotate(commandBuffer[index+1]),index+=1;break;case Commands$1.GRADIENT_FILL_STYLE:index+=5;break;case Commands$1.GRADIENT_LINE_STYLE:index+=6}}ctx.restore()}};
224/**
225	 * @author       Richard Davey <[email protected]>
226	 * @copyright    2020 Photon Storm Ltd.
227	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
228	 */var BaseCamera=BaseCamera_1,Commands=Commands$3,Ellipse$5=Ellipse_1$1,GameObject$f=GameObject_1,GetFastValue$Z=GetFastValue_1,GetValue$l=GetValue_1,MATH_CONST$a=_const$b,Graphics$2=new Class_1({Extends:GameObject$f,Mixins:[AlphaSingle_1,BlendMode_1,Depth_1,Mask_1,Pipeline_1,Transform_1$1,Visible_1,ScrollFactor_1,{renderWebGL:GraphicsWebGLRenderer_1,renderCanvas:GraphicsCanvasRenderer_1}],initialize:function(scene,options){var x=GetValue$l(options,"x",0),y=GetValue$l(options,"y",0);GameObject$f.call(this,scene,"Graphics"),this.setPosition(x,y),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(options)},setDefaultStyles:function(options){return GetValue$l(options,"lineStyle",null)&&(this.defaultStrokeWidth=GetValue$l(options,"lineStyle.width",1),this.defaultStrokeColor=GetValue$l(options,"lineStyle.color",16777215),this.defaultStrokeAlpha=GetValue$l(options,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),GetValue$l(options,"fillStyle",null)&&(this.defaultFillColor=GetValue$l(options,"fillStyle.color",16777215),this.defaultFillAlpha=GetValue$l(options,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(lineWidth,color,alpha){return void 0===alpha&&(alpha=1),this.commandBuffer.push(Commands.LINE_STYLE,lineWidth,color,alpha),this._lineWidth=lineWidth,this},fillStyle:function(color,alpha){return void 0===alpha&&(alpha=1),this.commandBuffer.push(Commands.FILL_STYLE,color,alpha),this},fillGradientStyle:function(topLeft,topRight,bottomLeft,bottomRight,alphaTopLeft,alphaTopRight,alphaBottomLeft,alphaBottomRight){return void 0===alphaTopLeft&&(alphaTopLeft=1),void 0===alphaTopRight&&(alphaTopRight=alphaTopLeft),void 0===alphaBottomLeft&&(alphaBottomLeft=alphaTopLeft),void 0===alphaBottomRight&&(alphaBottomRight=alphaTopLeft),this.commandBuffer.push(Commands.GRADIENT_FILL_STYLE,alphaTopLeft,alphaTopRight,alphaBottomLeft,alphaBottomRight,topLeft,topRight,bottomLeft,bottomRight),this},lineGradientStyle:function(lineWidth,topLeft,topRight,bottomLeft,bottomRight,alpha){return void 0===alpha&&(alpha=1),this.commandBuffer.push(Commands.GRADIENT_LINE_STYLE,lineWidth,alpha,topLeft,topRight,bottomLeft,bottomRight),this},beginPath:function(){return this.commandBuffer.push(Commands.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(Commands.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(Commands.FILL_PATH),this},fill:function(){return this.commandBuffer.push(Commands.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(Commands.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(Commands.STROKE_PATH),this},fillCircleShape:function(circle){return this.fillCircle(circle.x,circle.y,circle.radius)},strokeCircleShape:function(circle){return this.strokeCircle(circle.x,circle.y,circle.radius)},fillCircle:function(x,y,radius){return this.beginPath(),this.arc(x,y,radius,0,MATH_CONST$a.PI2),this.fillPath(),this},strokeCircle:function(x,y,radius){return this.beginPath(),this.arc(x,y,radius,0,MATH_CONST$a.PI2),this.strokePath(),this},fillRectShape:function(rect){return this.fillRect(rect.x,rect.y,rect.width,rect.height)},strokeRectShape:function(rect){return this.strokeRect(rect.x,rect.y,rect.width,rect.height)},fillRect:function(x,y,width,height){return this.commandBuffer.push(Commands.FILL_RECT,x,y,width,height),this},strokeRect:function(x,y,width,height){var lineWidthHalf=this._lineWidth/2,minx=x-lineWidthHalf,maxx=x+lineWidthHalf;return this.beginPath(),this.moveTo(x,y),this.lineTo(x,y+height),this.strokePath(),this.beginPath(),this.moveTo(x+width,y),this.lineTo(x+width,y+height),this.strokePath(),this.beginPath(),this.moveTo(minx,y),this.lineTo(maxx+width,y),this.strokePath(),this.beginPath(),this.moveTo(minx,y+height),this.lineTo(maxx+width,y+height),this.strokePath(),this},fillRoundedRect:function(x,y,width,height,radius){void 0===radius&&(radius=20);var tl=radius,tr=radius,bl=radius,br=radius;return"number"!=typeof radius&&(tl=GetFastValue$Z(radius,"tl",20),tr=GetFastValue$Z(radius,"tr",20),bl=GetFastValue$Z(radius,"bl",20),br=GetFastValue$Z(radius,"br",20)),this.beginPath(),this.moveTo(x+tl,y),this.lineTo(x+width-tr,y),this.arc(x+width-tr,y+tr,tr,-MATH_CONST$a.TAU,0),this.lineTo(x+width,y+height-br),this.arc(x+width-br,y+height-br,br,0,MATH_CONST$a.TAU),this.lineTo(x+bl,y+height),this.arc(x+bl,y+height-bl,bl,MATH_CONST$a.TAU,Math.PI),this.lineTo(x,y+tl),this.arc(x+tl,y+tl,tl,-Math.PI,-MATH_CONST$a.TAU),this.fillPath(),this},strokeRoundedRect:function(x,y,width,height,radius){void 0===radius&&(radius=20);var tl=radius,tr=radius,bl=radius,br=radius;return"number"!=typeof radius&&(tl=GetFastValue$Z(radius,"tl",20),tr=GetFastValue$Z(radius,"tr",20),bl=GetFastValue$Z(radius,"bl",20),br=GetFastValue$Z(radius,"br",20)),this.beginPath(),this.moveTo(x+tl,y),this.lineTo(x+width-tr,y),this.moveTo(x+width-tr,y),this.arc(x+width-tr,y+tr,tr,-MATH_CONST$a.TAU,0),this.lineTo(x+width,y+height-br),this.moveTo(x+width,y+height-br),this.arc(x+width-br,y+height-br,br,0,MATH_CONST$a.TAU),this.lineTo(x+bl,y+height),this.moveTo(x+bl,y+height),this.arc(x+bl,y+height-bl,bl,MATH_CONST$a.TAU,Math.PI),this.lineTo(x,y+tl),this.moveTo(x,y+tl),this.arc(x+tl,y+tl,tl,-Math.PI,-MATH_CONST$a.TAU),this.strokePath(),this},fillPointShape:function(point,size){return this.fillPoint(point.x,point.y,size)},fillPoint:function(x,y,size){return!size||size<1?size=1:(x-=size/2,y-=size/2),this.commandBuffer.push(Commands.FILL_RECT,x,y,size,size),this},fillTriangleShape:function(triangle){return this.fillTriangle(triangle.x1,triangle.y1,triangle.x2,triangle.y2,triangle.x3,triangle.y3)},strokeTriangleShape:function(triangle){return this.strokeTriangle(triangle.x1,triangle.y1,triangle.x2,triangle.y2,triangle.x3,triangle.y3)},fillTriangle:function(x0,y0,x1,y1,x2,y2){return this.commandBuffer.push(Commands.FILL_TRIANGLE,x0,y0,x1,y1,x2,y2),this},strokeTriangle:function(x0,y0,x1,y1,x2,y2){return this.commandBuffer.push(Commands.STROKE_TRIANGLE,x0,y0,x1,y1,x2,y2),this},strokeLineShape:function(line){return this.lineBetween(line.x1,line.y1,line.x2,line.y2)},lineBetween:function(x1,y1,x2,y2){return this.beginPath(),this.moveTo(x1,y1),this.lineTo(x2,y2),this.strokePath(),this},lineTo:function(x,y){return this.commandBuffer.push(Commands.LINE_TO,x,y),this},moveTo:function(x,y){return this.commandBuffer.push(Commands.MOVE_TO,x,y),this},strokePoints:function(points,closeShape,closePath,endIndex){void 0===closeShape&&(closeShape=!1),void 0===closePath&&(closePath=!1),void 0===endIndex&&(endIndex=points.length),this.beginPath(),this.moveTo(points[0].x,points[0].y);for(var i=1;i<endIndex;i++)this.lineTo(points[i].x,points[i].y);return closeShape&&this.lineTo(points[0].x,points[0].y),closePath&&this.closePath(),this.strokePath(),this},fillPoints:function(points,closeShape,closePath,endIndex){void 0===closeShape&&(closeShape=!1),void 0===closePath&&(closePath=!1),void 0===endIndex&&(endIndex=points.length),this.beginPath(),this.moveTo(points[0].x,points[0].y);for(var i=1;i<endIndex;i++)this.lineTo(points[i].x,points[i].y);return closeShape&&this.lineTo(points[0].x,points[0].y),closePath&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(ellipse,smoothness){void 0===smoothness&&(smoothness=32);var points=ellipse.getPoints(smoothness);return this.strokePoints(points,!0)},strokeEllipse:function(x,y,width,height,smoothness){void 0===smoothness&&(smoothness=32);var points=new Ellipse$5(x,y,width,height).getPoints(smoothness);return this.strokePoints(points,!0)},fillEllipseShape:function(ellipse,smoothness){void 0===smoothness&&(smoothness=32);var points=ellipse.getPoints(smoothness);return this.fillPoints(points,!0)},fillEllipse:function(x,y,width,height,smoothness){void 0===smoothness&&(smoothness=32);var points=new Ellipse$5(x,y,width,height).getPoints(smoothness);return this.fillPoints(points,!0)},arc:function(x,y,radius,startAngle,endAngle,anticlockwise,overshoot){return void 0===anticlockwise&&(anticlockwise=!1),void 0===overshoot&&(overshoot=0),this.commandBuffer.push(Commands.ARC,x,y,radius,startAngle,endAngle,anticlockwise,overshoot),this},slice:function(x,y,radius,startAngle,endAngle,anticlockwise,overshoot){return void 0===anticlockwise&&(anticlockwise=!1),void 0===overshoot&&(overshoot=0),this.commandBuffer.push(Commands.BEGIN_PATH),this.commandBuffer.push(Commands.MOVE_TO,x,y),this.commandBuffer.push(Commands.ARC,x,y,radius,startAngle,endAngle,anticlockwise,overshoot),this.commandBuffer.push(Commands.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(Commands.SAVE),this},restore:function(){return this.commandBuffer.push(Commands.RESTORE),this},translateCanvas:function(x,y){return this.commandBuffer.push(Commands.TRANSLATE,x,y),this},scaleCanvas:function(x,y){return this.commandBuffer.push(Commands.SCALE,x,y),this},rotateCanvas:function(radians){return this.commandBuffer.push(Commands.ROTATE,radians),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(key,width,height){var texture,ctx,sys=this.scene.sys,renderer=sys.game.renderer;if(void 0===width&&(width=sys.scale.width),void 0===height&&(height=sys.scale.height),Graphics$2.TargetCamera.setScene(this.scene),Graphics$2.TargetCamera.setViewport(0,0,width,height),Graphics$2.TargetCamera.scrollX=this.x,Graphics$2.TargetCamera.scrollY=this.y,"string"==typeof key)if(sys.textures.exists(key)){var src=(texture=sys.textures.get(key)).getSourceImage();src instanceof HTMLCanvasElement&&(ctx=src.getContext("2d"))}else ctx=(texture=sys.textures.createCanvas(key,width,height)).getSourceImage().getContext("2d");else key instanceof HTMLCanvasElement&&(ctx=key.getContext("2d"));return ctx&&(this.renderCanvas(renderer,this,Graphics$2.TargetCamera,null,ctx,!1),texture&&texture.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});
229/**
230	 * @author       Richard Davey <[email protected]>
231	 * @copyright    2020 Photon Storm Ltd.
232	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
233	 */Graphics$2.TargetCamera=new BaseCamera;var Graphics_1=Graphics$2,Set$5=new Class_1({initialize:function(elements){if(this.entries=[],Array.isArray(elements))for(var i=0;i<elements.length;i++)this.set(elements[i])},set:function(value){return-1===this.entries.indexOf(value)&&this.entries.push(value),this},get:function(property,value){for(var i=0;i<this.entries.length;i++){var entry=this.entries[i];if(entry[property]===value)return entry}},getArray:function(){return this.entries.slice(0)},delete:function(value){var index=this.entries.indexOf(value);return index>-1&&this.entries.splice(index,1),this},dump:function(){console.group("Set");for(var i=0;i<this.entries.length;i++){var entry=this.entries[i];console.log(entry)}console.groupEnd()},each:function(callback,callbackScope){var i,temp=this.entries.slice(),len=temp.length;if(callbackScope)for(i=0;i<len&&!1!==callback.call(callbackScope,temp[i],i);i++);else for(i=0;i<len&&!1!==callback(temp[i],i);i++);return this},iterate:function(callback,callbackScope){var i,len=this.entries.length;if(callbackScope)for(i=0;i<len&&!1!==callback.call(callbackScope,this.entries[i],i);i++);else for(i=0;i<len&&!1!==callback(this.entries[i],i);i++);return this},iterateLocal:function(callbackKey){var i,args=[];for(i=1;i<arguments.length;i++)args.push(arguments[i]);var len=this.entries.length;for(i=0;i<len;i++){var entry=this.entries[i];entry[callbackKey].apply(entry,args)}return this},clear:function(){return this.entries.length=0,this},contains:function(value){return this.entries.indexOf(value)>-1},union:function(set){var newSet=new Set$5;
233return set.entries.forEach((function(value){newSet.set(value)})),this.entries.forEach((function(value){newSet.set(value)})),newSet},intersect:function(set){var newSet=new Set$5;return this.entries.forEach((function(value){set.contains(value)&&newSet.set(value)})),newSet},difference:function(set){var newSet=new Set$5;return this.entries.forEach((function(value){set.contains(value)||newSet.set(value)})),newSet},size:{get:function(){return this.entries.length},set:function(value){return value<this.entries.length?this.entries.length=value:this.entries.length}}}),_Set=Set$5,SpriteCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src),renderer.batchSprite(src,src.frame,camera,parentMatrix)},AnimationState$2=AnimationState_1,Components$n=components$3,GameObject$e=GameObject_1,SpriteRender={renderWebGL:function(renderer,src,camera,parentMatrix){camera.addToRenderList(src),src.pipeline.batchSprite(src,camera,parentMatrix)},renderCanvas:SpriteCanvasRenderer_1},Sprite$7=new Class_1({Extends:GameObject$e,Mixins:[Components$n.Alpha,Components$n.BlendMode,Components$n.Depth,Components$n.Flip,Components$n.GetBounds,Components$n.Mask,Components$n.Origin,Components$n.Pipeline,Components$n.ScrollFactor,Components$n.Size,Components$n.TextureCrop,Components$n.Tint,Components$n.Transform,Components$n.Visible,SpriteRender],initialize:function(scene,x,y,texture,frame){GameObject$e.call(this,scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new AnimationState$2(this),this.setTexture(texture,frame),this.setPosition(x,y),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(time,delta){this.anims.update(time,delta)},play:function(key,ignoreIfPlaying){return this.anims.play(key,ignoreIfPlaying)},playReverse:function(key,ignoreIfPlaying){return this.anims.playReverse(key,ignoreIfPlaying)},playAfterDelay:function(key,delay){return this.anims.playAfterDelay(key,delay)},playAfterRepeat:function(key,repeatCount){return this.anims.playAfterRepeat(key,repeatCount)},chain:function(key){return this.anims.chain(key)},stop:function(){return this.anims.stop()},stopAfterDelay:function(delay){return this.anims.stopAfterDelay(delay)},stopAfterRepeat:function(repeatCount){return this.anims.stopAfterRepeat(repeatCount)},stopOnFrame:function(frame){return this.anims.stopOnFrame(frame)},toJSON:function(){return Components$n.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}}),Sprite_1=Sprite$7,Actions=actions,Events$m=events$h,EventEmitter$c=eventemitter3.exports,GetAll=GetAll_1,GetFastValue$Y=GetFastValue_1,GetValue$k=GetValue_1,IsPlainObject$u=IsPlainObject_1,Range=Range_1,Set$4=_Set,Sprite$6=Sprite_1,Group$4=new Class_1({Extends:EventEmitter$c,initialize:function(scene,children,config){EventEmitter$c.call(this),config?children&&!Array.isArray(children)&&(children=[children]):Array.isArray(children)?IsPlainObject$u(children[0])&&(config=children,children=null):IsPlainObject$u(children)&&(config=children,children=null),this.scene=scene,this.children=new Set$4,this.isParent=!0,this.type="Group",this.classType=GetFastValue$Y(config,"classType",Sprite$6),this.name=GetFastValue$Y(config,"name",""),this.active=GetFastValue$Y(config,"active",!0),this.maxSize=GetFastValue$Y(config,"maxSize",-1),this.defaultKey=GetFastValue$Y(config,"defaultKey",null),this.defaultFrame=GetFastValue$Y(config,"defaultFrame",null),this.runChildUpdate=GetFastValue$Y(config,"runChildUpdate",!1),this.createCallback=GetFastValue$Y(config,"createCallback",null),this.removeCallback=GetFastValue$Y(config,"removeCallback",null),this.createMultipleCallback=GetFastValue$Y(config,"createMultipleCallback",null),this.internalCreateCallback=GetFastValue$Y(config,"internalCreateCallback",null),this.internalRemoveCallback=GetFastValue$Y(config,"internalRemoveCallback",null),children&&this.addMultiple(children),config&&this.createMultiple(config),this.on(Events$m.ADDED_TO_SCENE,this.addedToScene,this),this.on(Events$m.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(x,y,key,frame,visible,active){if(void 0===x&&(x=0),void 0===y&&(y=0),void 0===key&&(key=this.defaultKey),void 0===frame&&(frame=this.defaultFrame),void 0===visible&&(visible=!0),void 0===active&&(active=!0),this.isFull())return null;var child=new this.classType(this.scene,x,y,key,frame);return child.addToDisplayList(this.scene.sys.displayList),child.addToUpdateList(),child.visible=visible,child.setActive(active),this.add(child),child},createMultiple:function(config){if(this.isFull())return[];Array.isArray(config)||(config=[config]);var output=[];if(config[0].key)for(var i=0;i<config.length;i++){var entries=this.createFromConfig(config[i]);output=output.concat(entries)}return output},createFromConfig:function(options){if(this.isFull())return[];this.classType=GetFastValue$Y(options,"classType",this.classType);var key=GetFastValue$Y(options,"key",void 0),frame=GetFastValue$Y(options,"frame",null),visible=GetFastValue$Y(options,"visible",!0),active=GetFastValue$Y(options,"active",!0),entries=[];if(void 0===key)return entries;Array.isArray(key)||(key=[key]),Array.isArray(frame)||(frame=[frame]);var repeat=GetFastValue$Y(options,"repeat",0),randomKey=GetFastValue$Y(options,"randomKey",!1),randomFrame=GetFastValue$Y(options,"randomFrame",!1),yoyo=GetFastValue$Y(options,"yoyo",!1),quantity=GetFastValue$Y(options,"quantity",!1),frameQuantity=GetFastValue$Y(options,"frameQuantity",1),max=GetFastValue$Y(options,"max",0),range=Range(key,frame,{max:max,qty:quantity||frameQuantity,random:randomKey,randomB:randomFrame,repeat:repeat,yoyo:yoyo});options.createCallback&&(this.createCallback=options.createCallback),options.removeCallback&&(this.removeCallback=options.removeCallback);for(var c=0;c<range.length;c++){var created=this.create(0,0,range[c].a,range[c].b,visible,active);if(!created)break;entries.push(created)}var x=GetValue$k(options,"setXY.x",0),y=GetValue$k(options,"setXY.y",0),stepX=GetValue$k(options,"setXY.stepX",0),stepY=GetValue$k(options,"setXY.stepY",0);Actions.SetXY(entries,x,y,stepX,stepY);var rotation=GetValue$k(options,"setRotation.value",0),stepRotation=GetValue$k(options,"setRotation.step",0);Actions.SetRotation(entries,rotation,stepRotation);var scaleX=GetValue$k(options,"setScale.x",1),scaleY=GetValue$k(options,"setScale.y",scaleX),stepScaleX=GetValue$k(options,"setScale.stepX",0),stepScaleY=GetValue$k(options,"setScale.stepY",0);Actions.SetScale(entries,scaleX,scaleY,stepScaleX,stepScaleY);var originX=GetValue$k(options,"setOrigin.x",.5),originY=GetValue$k(options,"setOrigin.y",originX),stepOriginX=GetValue$k(options,"setOrigin.stepX",0),stepOriginY=GetValue$k(options,"setOrigin.stepY",0);Actions.SetOrigin(entries,originX,originY,stepOriginX,stepOriginY);var alpha=GetValue$k(options,"setAlpha.value",1),stepAlpha=GetValue$k(options,"setAlpha.step",0);Actions.SetAlpha(entries,alpha,stepAlpha);var depth=GetValue$k(options,"setDepth.value",0),stepDepth=GetValue$k(options,"setDepth.step",0);Actions.SetDepth(entries,depth,stepDepth);var scrollFactorX=GetValue$k(options,"setScrollFactor.x",1),scrollFactorY=GetValue$k(options,"setScrollFactor.y",scrollFactorX),stepScrollFactorX=GetValue$k(options,"setScrollFactor.stepX",0),stepScrollFactorY=GetValue$k(options,"setScrollFactor.stepY",0);Actions.SetScrollFactor(entries,scrollFactorX,scrollFactorY,stepScrollFactorX,stepScrollFactorY);var hitArea=GetFastValue$Y(options,"hitArea",null),hitAreaCallback=GetFastValue$Y(options,"hitAreaCallback",null);hitArea&&Actions.SetHitArea(entries,hitArea,hitAreaCallback);var grid=GetFastValue$Y(options,"gridAlign",!1);return grid&&Actions.GridAlign(entries,grid),this.createMultipleCallback&&this.createMultipleCallback.call(this,entries),entries},preUpdate:function(time,delta){if(this.runChildUpdate&&0!==this.children.size)for(var temp=this.children.entries.slice(),i=0;i<temp.length;i++){var item=temp[i];item.active&&item.update(time,delta)}},add:function(child,addToScene){return void 0===addToScene&&(addToScene=!1),this.isFull()||(this.children.set(child),this.internalCreateCallback&&this.internalCreateCallback.call(this,child),this.createCallback&&this.createCallback.call(this,child),addToScene&&(c
233hild.addToDisplayList(this.scene.sys.displayList),child.addToUpdateList()),child.on(Events$m.DESTROY,this.remove,this)),this},addMultiple:function(children,addToScene){if(void 0===addToScene&&(addToScene=!1),Array.isArray(children))for(var i=0;i<children.length;i++)this.add(children[i],addToScene);return this},remove:function(child,removeFromScene,destroyChild){return void 0===removeFromScene&&(removeFromScene=!1),void 0===destroyChild&&(destroyChild=!1),this.children.contains(child)?(this.children.delete(child),this.internalRemoveCallback&&this.internalRemoveCallback.call(this,child),this.removeCallback&&this.removeCallback.call(this,child),child.off(Events$m.DESTROY,this.remove,this),destroyChild?child.destroy():removeFromScene&&(child.removeFromDisplayList(),child.removeFromUpdateList()),this):this},clear:function(removeFromScene,destroyChild){void 0===removeFromScene&&(removeFromScene=!1),void 0===destroyChild&&(destroyChild=!1);for(var children=this.children,i=0;i<children.size;i++){var gameObject=children.entries[i];gameObject.off(Events$m.DESTROY,this.remove,this),destroyChild?gameObject.destroy():removeFromScene&&(gameObject.removeFromDisplayList(),gameObject.removeFromUpdateList())}return this.children.clear(),this},contains:function(child){return this.children.contains(child)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getMatching:function(property,value,startIndex,endIndex){return GetAll(this.children.entries,property,value,startIndex,endIndex)},getFirst:function(state,createIfNull,x,y,key,frame,visible){return this.getHandler(!0,1,state,createIfNull,x,y,key,frame,visible)},getFirstNth:function(nth,state,createIfNull,x,y,key,frame,visible){return this.getHandler(!0,nth,state,createIfNull,x,y,key,frame,visible)},getLast:function(state,createIfNull,x,y,key,frame,visible){return this.getHandler(!1,1,state,createIfNull,x,y,key,frame,visible)},getLastNth:function(nth,state,createIfNull,x,y,key,frame,visible){return this.getHandler(!1,nth,state,createIfNull,x,y,key,frame,visible)},getHandler:function(forwards,nth,state,createIfNull,x,y,key,frame,visible){var gameObject,i;void 0===state&&(state=!1),void 0===createIfNull&&(createIfNull=!1);var total=0,children=this.children.entries;if(forwards)for(i=0;i<children.length;i++)if((gameObject=children[i]).active===state){if(++total===nth)break}else gameObject=null;else for(i=children.length-1;i>=0;i--)if((gameObject=children[i]).active===state){if(++total===nth)break}else gameObject=null;return gameObject?("number"==typeof x&&(gameObject.x=x),"number"==typeof y&&(gameObject.y=y),gameObject):createIfNull?this.create(x,y,key,frame,visible):null},get:function(x,y,key,frame,visible){return this.getFirst(!1,!0,x,y,key,frame,visible)},getFirstAlive:function(createIfNull,x,y,key,frame,visible){return this.getFirst(!0,createIfNull,x,y,key,frame,visible)},getFirstDead:function(createIfNull,x,y,key,frame,visible){return this.getFirst(!1,createIfNull,x,y,key,frame,visible)},playAnimation:function(key,startFrame){return Actions.PlayAnimation(this.children.entries,key,startFrame),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(value){void 0===value&&(value=!0);for(var total=0,i=0;i<this.children.size;i++)this.children.entries[i].active===value&&total++;return total},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var used=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-used},setActive:function(value){return this.active=value,this},setName:function(value){return this.name=value,this},propertyValueSet:function(key,value,step,index,direction){return Actions.PropertyValueSet(this.children.entries,key,value,step,index,direction),this},propertyValueInc:function(key,value,step,index,direction){return Actions.PropertyValueInc(this.children.entries,key,value,step,index,direction),this},setX:function(value,step){return Actions.SetX(this.children.entries,value,step),this},setY:function(value,step){return Actions.SetY(this.children.entries,value,step),this},setXY:function(x,y,stepX,stepY){return Actions.SetXY(this.children.entries,x,y,stepX,stepY),this},incX:function(value,step){return Actions.IncX(this.children.entries,value,step),this},incY:function(value,step){return Actions.IncY(this.children.entries,value,step),this},incXY:function(x,y,stepX,stepY){return Actions.IncXY(this.children.entries,x,y,stepX,stepY),this},shiftPosition:function(x,y,direction){return Actions.ShiftPosition(this.children.entries,x,y,direction),this},angle:function(value,step){return Actions.Angle(this.children.entries,value,step),this},rotate:function(value,step){return Actions.Rotate(this.children.entries,value,step),this}
233,rotateAround:function(point,angle){return Actions.RotateAround(this.children.entries,point,angle),this},rotateAroundDistance:function(point,angle,distance){return Actions.RotateAroundDistance(this.children.entries,point,angle,distance),this},setAlpha:function(value,step){return Actions.SetAlpha(this.children.entries,value,step),this},setTint:function(topLeft,topRight,bottomLeft,bottomRight){return Actions.SetTint(this.children.entries,topLeft,topRight,bottomLeft,bottomRight),this},setOrigin:function(originX,originY,stepX,stepY){return Actions.SetOrigin(this.children.entries,originX,originY,stepX,stepY),this},scaleX:function(value,step){return Actions.ScaleX(this.children.entries,value,step),this},scaleY:function(value,step){return Actions.ScaleY(this.children.entries,value,step),this},scaleXY:function(scaleX,scaleY,stepX,stepY){return Actions.ScaleXY(this.children.entries,scaleX,scaleY,stepX,stepY),this},setDepth:function(value,step){return Actions.SetDepth(this.children.entries,value,step),this},setBlendMode:function(value){return Actions.SetBlendMode(this.children.entries,value),this},setHitArea:function(hitArea,hitAreaCallback){return Actions.SetHitArea(this.children.entries,hitArea,hitAreaCallback),this},shuffle:function(){return Actions.Shuffle(this.children.entries),this},kill:function(gameObject){this.children.contains(gameObject)&&gameObject.setActive(!1)},killAndHide:function(gameObject){this.children.contains(gameObject)&&(gameObject.setActive(!1),gameObject.setVisible(!1))},setVisible:function(value,index,direction){return Actions.SetVisible(this.children.entries,value,index,direction),this},toggleVisible:function(){return Actions.ToggleVisible(this.children.entries),this},destroy:function(destroyChildren,removeFromScene){void 0===destroyChildren&&(destroyChildren=!1),void 0===removeFromScene&&(removeFromScene=!1),this.scene&&!this.ignoreDestroy&&(this.emit(Events$m.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(removeFromScene,destroyChildren),this.scene=void 0,this.children=void 0)}}),Group_1=Group$4,ImageCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src),renderer.batchSprite(src,src.frame,camera,parentMatrix)},GameObject$d=GameObject_1,Image$5=new Class_1({Extends:GameObject$d,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.Depth,components$3.Flip,components$3.GetBounds,components$3.Mask,components$3.Origin,components$3.Pipeline,components$3.ScrollFactor,components$3.Size,components$3.TextureCrop,components$3.Tint,components$3.Transform,components$3.Visible,{renderWebGL:function(renderer,src,camera,parentMatrix){camera.addToRenderList(src),this.pipeline.batchSprite(src,camera,parentMatrix)},renderCanvas:ImageCanvasRenderer_1}],initialize:function(scene,x,y,texture,frame){GameObject$d.call(this,scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(texture,frame),this.setPosition(x,y),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}}),Image_1=Image$5,LayerWebGLRenderer_1=function(renderer,layer,camera){var children=layer.list,childCount=children.length;if(0!==childCount){layer.depthSort(),renderer.pipelines.preBatch(layer);var layerHasBlendMode=-1!==layer.blendMode;layerHasBlendMode||renderer.setBlendMode(0);for(var alpha=layer.alpha,i=0;i<childCount;i++){var child=children[i];if(child.willRender(camera)){var childAlphaTopLeft,childAlphaTopRight,childAlphaBottomLeft,childAlphaBottomRight;if(void 0!==child.alphaTopLeft)childAlphaTopLeft=child.alphaTopLeft,childAlphaTopRight=child.alphaTopRight,childAlphaBottomLeft=child.alphaBottomLeft,childAlphaBottomRight=child.alphaBottomRight;else{var childAlpha=child.alpha;childAlphaTopLeft=childAlpha,childAlphaTopRight=childAlpha,childAlphaBottomLeft=childAlpha,childAlphaBottomRight=childAlpha}layerHasBlendMode||child.blendMode===renderer.currentBlendMode||renderer.setBlendMode(child.blendMode);var mask=child.mask;mask&&mask.preRenderWebGL(renderer,child,camera);var type=child.type;type!==renderer.currentType&&(renderer.newType=!0,renderer.currentType=type),renderer.nextTypeMatch=i<childCount-1&&children[i+1].type===renderer.currentType,child.setAlpha(childAlphaTopLeft*alpha,childAlphaTopRight*alpha,childAlphaBottomLeft*alpha,childAlphaBottomRight*alpha),child.renderWebGL(renderer,child,camera),child.setAlpha(childAlphaTopLeft,childAlphaTopRight,childAlphaBottomLeft,childAlphaBottomRight),mask&&mask.postRenderWebGL(renderer,camera),renderer.newType=!1}}renderer.pipelines.postBatch(layer)}},LayerCanvasRenderer_1=function(renderer,layer,camera){var children=layer.list;if(0!==children.length){layer.depthSort();var layerHasBlendMode=-1!==layer.blendMode;layerHasBlendMode||renderer.setBlendMode(0);var alpha=layer._alpha;layer.mask&&layer.mask.preRenderCanvas(renderer,null,camera);for(var i=0;i<children.length;i++){var child=children[i];if(child.willRender(camera)){var childAlpha=child.alpha;layerHasBlendMode||child.blendMode===renderer.currentBlendMode||renderer.setBlendMode(child.blendMode),child.setAlpha(childAlpha*alpha),child.renderCanvas(renderer,child,camera),child.setAlpha(childAlpha)}}layer.mask&&layer.mask.postRenderCanvas(renderer)}},BlendModes$2=BlendModes$8,ComponentsToJSON=ToJSON_1,DataManager=DataManager_1,EventEmitter$b=eventemitter3.exports,GameObjectEvents=events$h,List$1=List_1,SceneEvents$9=events$g,StableSort$3=StableSort_1,Layer$2=new Class_1({Extends:List$1,Mixins:[components$3.AlphaSingle,components$3.BlendMode,components$3.Depth,components$3.Mask,components$3.Pipeline,components$3.Visible,EventEmitter$b,{renderWebGL:LayerWebGLRenderer_1,renderCanvas:LayerCanvasRenderer_1}],initialize:function(scene,children){List$1.call(this,scene),EventEmitter$b.call(this),this.scene=scene,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=scene.sys,this.events=scene.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(BlendModes$2.SKIP_CHECK),children&&this.add(children),scene.sys.queueDepthSort()},setActive:function(value){return this.active=value,this},setName:function(value){return this.name=value,this},setState:function(value){return this.state=value,this},setDataEnabled:function(){return this.data||(this.data=new DataManager(this)),this},setData:function(key,value){return this.data||(this.data=new DataManager(this)),this.data.set(key,value),this},incData:function(key,value){return this.data||(this.data=new DataManager(this)),this.data.inc(key,value),this},toggleData:function(key){return this.data||(this.data=new DataManager(this)),this.data.toggle(key),this},getData:function(key){return this.data||(this.data=new DataManager(this)),this.data.get(key)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return ComponentsToJSON(this)},willRender:function(camera){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&camera.id
233)},getIndexList:function(){for(var child=this,parent=this.parentContainer,indexes=[];parent&&(indexes.unshift(parent.getIndex(child)),child=parent,parent.parentContainer);)parent=parent.parentContainer;return indexes.unshift(this.displayList.getIndex(child)),indexes},addChildCallback:function(gameObject){gameObject.displayList&&gameObject.displayList!==this&&gameObject.removeFromDisplayList(),gameObject.displayList||(this.queueDepthSort(),gameObject.displayList=this,gameObject.emit(GameObjectEvents.ADDED_TO_SCENE,gameObject,this.scene),this.events.emit(SceneEvents$9.ADDED_TO_SCENE,gameObject,this.scene))},removeChildCallback:function(gameObject){this.queueDepthSort(),gameObject.displayList=null,gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE,gameObject,this.scene),this.events.emit(SceneEvents$9.REMOVED_FROM_SCENE,gameObject,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(StableSort$3(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(childA,childB){return childA._depth-childB._depth},getChildren:function(){return this.list},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.emit(GameObjectEvents.DESTROY,this);for(var i=this.list.length;i--;)this.list[i].destroy();this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}}),Layer_1=Layer$2,EaseMap=EaseMap$4,UppercaseFirst=UppercaseFirst_1,GetEaseFunction_1=function(ease,easeParams){var easeFunction=EaseMap.Power0;if("string"==typeof ease)if(EaseMap.hasOwnProperty(ease))easeFunction=EaseMap[ease];else{var direction="";ease.indexOf(".")&&("in"===(direction=ease.substr(ease.indexOf(".")+1)).toLowerCase()?direction="easeIn":"out"===direction.toLowerCase()?direction="easeOut":"inout"===direction.toLowerCase()&&(direction="easeInOut")),ease=UppercaseFirst(ease.substr(0,ease.indexOf(".")+1)+direction),EaseMap.hasOwnProperty(ease)&&(easeFunction=EaseMap[ease])}else"function"==typeof ease?easeFunction=ease:Array.isArray(ease)&&ease.length;if(!easeParams)return easeFunction;var cloneParams=easeParams.slice(0);return cloneParams.unshift(0),function(v){return cloneParams[0]=v,easeFunction.apply(this,cloneParams)}}
233,FloatBetween=FloatBetween_1,GetEaseFunction$5=GetEaseFunction_1,GetFastValue$X=GetFastValue_1,Wrap$3=Wrap_1$1,EmitterOp$1=new Class_1({initialize:function(config,key,defaultValue,emitOnly){void 0===emitOnly&&(emitOnly=!1),this.propertyKey=key,this.propertyValue=defaultValue,this.defaultValue=defaultValue,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=emitOnly,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(config)},loadConfig:function(config,newKey){void 0===config&&(config={}),newKey&&(this.propertyKey=newKey),this.propertyValue=GetFastValue$X(config,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(value){return this.propertyValue=value,this.setMethods()},setMethods:function(){var value=this.propertyValue,t=typeof value;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"===t)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(value))this.onEmit=this.randomStaticValueEmit;else if("function"===t)this.emitOnly?this.onEmit=value:this.onUpdate=value;else if("object"===t&&this.hasBoth(value,"start","end")){this.start=value.start,this.end=value.end;var isRandom=this.has(value,"random");if(isRandom&&(this.onEmit=this.randomRangedValueEmit),this.has(value,"steps"))this.steps=value.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var easeType=this.has(value,"ease")?value.ease:"Linear";this.ease=GetEaseFunction$5(easeType,value.easeParams),isRandom||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===t&&this.hasBoth(value,"min","max"))this.start=value.min,this.end=value.max,this.onEmit=this.randomRangedValueEmit;else if("object"===t&&this.has(value,"random")){var rnd=value.random;Array.isArray(rnd)&&(this.start=rnd[0],this.end=rnd[1]),this.onEmit=this.randomRangedValueEmit}else"object"===t&&this.hasEither(value,"onEmit","onUpdate")&&(this.has(value,"onEmit")&&(this.onEmit=value.onEmit),this.has(value,"onUpdate")&&(this.onUpdate=value.onUpdate));return this},has:function(object,key){return object.hasOwnProperty(key)},hasBoth:function(object,key1,key2){return object.hasOwnProperty(key1)&&object.hasOwnProperty(key2)},hasEither:function(object,key1,key2){return object.hasOwnProperty(key1)||object.hasOwnProperty(key2)},defaultEmit:function(particle,key,value){return value},defaultUpdate:function(particle,key,t,value){return value},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var randomIndex=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[randomIndex]},randomRangedValueEmit:function(particle,key){var value=FloatBetween(this.start,this.end);return particle&&particle.data[key]&&(particle.data[key].min=value),value},steppedEmit:function(){var current=this.counter,next=this.counter+(this.end-this.start)/this.steps;return this.counter=Wrap$3(next,this.start,this.end),current},easedValueEmit:function(particle,key){if(particle&&particle.data[key]){var data=particle.data[key];data.min=this.start,data.max=this.end}return this.start},easeValueUpdate:function(particle,key,t){var data=particle.data[key];return(data.max-data.min)*this.ease(t)+data.min}}),EmitterOp_1=EmitterOp$1,GetFastValue$W=GetFastValue_1,GravityWell_1=new Class_1({initialize:function(x,y,power,epsilon,gravity){if("object"==typeof x){var config=x;x=GetFastValue$W(config,"x",0),y=GetFastValue$W(config,"y",0),power=GetFastValue$W(config,"power",0),epsilon=GetFastValue$W(config,"epsilon",100),gravity=GetFastValue$W(config,"gravity",50)}else void 0===x&&(x=0),void 0===y&&(y=0),void 0===power&&(power=0),void 0===epsilon&&(epsilon=100),void 0===gravity&&(gravity=50);this.x=x,this.y=y,this.active=!0,this._gravity=gravity,this._power=0,this._epsilon=0,this.power=power,this.epsilon=epsilon},update:function(particle,delta){var x=this.x-particle.x,y=this.y-particle.y,dSq=x*x+y*y;if(0!==dSq){var d=Math.sqrt(dSq);dSq<this._epsilon&&(dSq=this._epsilon);var factor=this._power*delta/(dSq*d)*100;particle.velocityX+=x*factor,particle.velocityY+=y*factor}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(value){this._epsilon=value*value}},power:{get:function(){return this._power/this._gravity},set:function(value){this._power=value*this._gravity}},gravity:{get:function(){return this._gravity},set:function(value){var pwr=this.power;this._gravity=value,this.power=pwr}}}),DegToRad$6=DegToRad_1,DistanceBetween$6=DistanceBetween_1,Particle$1=new Class_1({initialize:function(emitter){this.emitter=emitter,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(x,y){var emitter=this.emitter;this.frame=emitter.getFrame(),emitter.emitZone&&emitter.emitZone.getPoint(this),this.x+=void 0===x?emitter.x.onEmit(this,"x"):x,this.y+=void 0===y?emitter.y.onEmit(this,"y"):y,this.life=emitter.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var sx=emitter.speedX.onEmit(this,"speedX"),sy=emitter.speedY?emitter.speedY.onEmit(this,"speedY"):sx;if(emitter.radial){var rad=DegToRad$6(emitter.angle.onEmit(this,"angle"));this.velocityX=Math.cos(rad)*Math.abs(sx),this.velocityY=Math.sin(rad)*Math.abs(sy)}else if(emitter.moveTo){var mx=emitter.moveToX.onEmit(this,"moveToX"),my=emitter.moveToY?emitter.moveToY.onEmit(this,"moveToY"):mx,angle=Math.atan2(my-this.y,mx-this.x),speed=DistanceBetween$6(this.x,this.y,mx,my)/(this.life/1e3);this.velocityX=Math.cos(angle)*speed,this.velocityY=Math.sin(angle)*speed}else this.velocityX=sx,this.velocityY=sy;emitter.acceleration&&(this.accelerationX=emitter.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=emitter.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=emitter.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=emitter.maxVelocityY.onEm
233it(this,"maxVelocityY"),this.delayCurrent=emitter.delay.onEmit(this,"delay"),this.scaleX=emitter.scaleX.onEmit(this,"scaleX"),this.scaleY=emitter.scaleY?emitter.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=emitter.rotate.onEmit(this,"rotate"),this.rotation=DegToRad$6(this.angle),this.bounce=emitter.bounce.onEmit(this,"bounce"),this.alpha=emitter.alpha.onEmit(this,"alpha"),this.tint=emitter.tint.onEmit(this,"tint")},computeVelocity:function(emitter,delta,step,processors){var vx=this.velocityX,vy=this.velocityY,ax=this.accelerationX,ay=this.accelerationY,mx=this.maxVelocityX,my=this.maxVelocityY;vx+=emitter.gravityX*step,vy+=emitter.gravityY*step,ax&&(vx+=ax*step),ay&&(vy+=ay*step),vx>mx?vx=mx:vx<-mx&&(vx=-mx),vy>my?vy=my:vy<-my&&(vy=-my),this.velocityX=vx,this.velocityY=vy;for(var i=0;i<processors.length;i++)processors[i].update(this,delta,step)},checkBounds:function(emitter){var bounds=emitter.bounds,bounce=-this.bounce;this.x<bounds.x&&emitter.collideLeft?(this.x=bounds.x,this.velocityX*=bounce):this.x>bounds.right&&emitter.collideRight&&(this.x=bounds.right,this.velocityX*=bounce),this.y<bounds.y&&emitter.collideTop?(this.y=bounds.y,this.velocityY*=bounce):this.y>bounds.bottom&&emitter.collideBottom&&(this.y=bounds.bottom,this.velocityY*=bounce)},update:function(delta,step,processors){if(this.delayCurrent>0)return this.delayCurrent-=delta,!1;var emitter=this.emitter,t=1-this.lifeCurrent/this.life;return this.lifeT=t,this.computeVelocity(emitter,delta,step,processors),this.x+=this.velocityX*step,this.y+=this.velocityY*step,emitter.bounds&&this.checkBounds(emitter),emitter.deathZone&&emitter.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=emitter.scaleX.onUpdate(this,"scaleX",t,this.scaleX),emitter.scaleY?this.scaleY=emitter.scaleY.onUpdate(this,"scaleY",t,this.scaleY):this.scaleY=this.scaleX,this.angle=emitter.rotate.onUpdate(this,"rotate",t,this.angle),this.rotation=DegToRad$6(this.angle),this.alpha=emitter.alpha.onUpdate(this,"alpha",t,this.alpha),this.tint=emitter.tint.onUpdate(this,"tint",t,this.tint),this.lifeCurrent-=delta,this.lifeCurrent<=0)}}),Particle_1=Particle$1,DeathZone_1=new Class_1({initialize:function(source,killOnEnter){this.source=source,this.killOnEnter=killOnEnter},willKill:function(particle){var withinZone=this.source.contains(particle.x,particle.y);return withinZone&&this.killOnEnter||!withinZone&&!this.killOnEnter}}),EdgeZone$1=new Class_1({initialize:function(source,quantity,stepRate,yoyo,seamless){void 0===yoyo&&(yoyo=!1),void 0===seamless&&(seamless=!0),this.source=source,this.points=[],this.quantity=quantity,this.stepRate=stepRate,this.yoyo=yoyo,this.counter=-1,this.seamless=seamless,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var a=this.points[0],b=this.points[this.points.length-1];a.x===b.x&&a.y===b.y&&this.points.pop()}var oldLength=this._length;return this._length=this.points.length,this._length<oldLength&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(source){return this.source=source,this.updateSource()},getPoint:function(particle){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var point=this.points[this.counter];point&&(particle.x=point.x,particle.y=point.y)}}),EdgeZone_1=EdgeZone$1,HasAny_1=function(source,keys){for(var i=0;i<keys.length;i++)if(source.hasOwnProperty(keys[i]))return!0;return!1},HasValue_1=function(source,key){return source.hasOwnProperty(key)},Vector2$v=Vector2_1,RandomZone_1=new Class_1({initialize:function(source){this.source=source,this._tempVec=new Vector2$v},getPoint:function(particle){var vec=this._tempVec;this.source.getRandomPoint(vec),particle.x=vec.x,particle.y=vec.y}}),BlendModes$1=BlendModes$8,DeathZone=DeathZone_1,EdgeZone=EdgeZone_1,EmitterOp=EmitterOp_1,GetFastValue$V=GetFastValue_1,GetRandom$1=GetRandom_1,HasAny=HasAny_1,HasValue$3=HasValue_1,Particle=Particle_1,RandomZone=RandomZone_1,Rectangle$i=Rectangle_1$1,StableSort$2=StableSort_1,Vector2$u=Vector2_1,Wrap$2=Wrap_1$1,ParticleEmitter$1=new Class_1({Mixins:[components$3.BlendMode,components$3.Mask,components$3.ScrollFactor,components$3.Visible],initialize:function(manager,config){this.manager=manager,this.texture=manager.texture,this.frames=[manager.defaultFrame],this.defaultFrame=manager.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=Particle,this.x=new EmitterOp(config,"x",0,!0),this.y=new EmitterOp(config,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new EmitterOp(config,"accelerationX",0,!0),this.accelerationY=new EmitterOp(config,"accelerationY",0,!0),this.maxVelocityX=new EmitterOp(config,"maxVelocityX",1e4,!0),this.maxVelocityY=new EmitterOp(config,"maxVelocityY",1e4,!0),this.speedX=new EmitterOp(config,"speedX",0,!0),this.speedY=new EmitterOp(config,"speedY",0,!0),this.moveTo=!1,this.moveToX=new EmitterOp(config,"moveToX",0,!0),this.moveToY=new EmitterOp(config,"moveToY",0,!0),this.bounce=new EmitterOp(config,"bounce",0,!0),this.scaleX=new EmitterOp(config,"scaleX",1),this.scaleY=new EmitterOp(config,"scaleY",1),this.tint=new EmitterOp(config,"tint",16777215),this.alpha=new EmitterOp(config,"alpha",1),this.lifespan=new EmitterOp(config,"lifespan",1e3,!0),this.angle=new EmitterOp(config,"angle",{min:0,max:360},!0),this.rotate=new EmitterOp(config,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new EmitterOp(config,"quantity",1,!0),this.delay=new EmitterOp(config,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=BlendModes$1.NORMAL,this.follow=null,this.followOffset=new Vector2$u,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,config&&this.fromJSON(config)},fromJSON:function(config){if(!config)return this;var i=0,key="";for(i=0;i<this.configFastMap.length;i++)key=this.configFastMap[i],HasValue$3(config,key)&&(this[key]=GetFastValue$V(config,key));for(i=0;i<this.configOpMap.length;i++)key=this.configOpMap[i],HasValue$3(config,key)&&this[key].loadConfig(config);if(this.acceleration=0!==this.accelerationX.propertyValue||0!==this.accelerationY.propertyValue,this.moveTo=0!==this.moveToX.propertyValue||0!==this.moveToY.propertyValue,HasValue$3(config,"speed")&&(this.speedX.loadConfig(config,"speed"),this.speedY=null),(HasAny(config,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),HasValue$3(config,"scale")&&(this.scaleX.loadConfig(config,"scale"),this.scaleY=null),HasValue$3(config,"callbackScope")){var callbackScope=GetFastValue$V(config,"callbackScope",null);this.emitCallbackScope=callbackScope,this.deathCallbackScope=callbackScope}return HasValue$3(config,"emitZone")&&this.setEmitZone(config.emitZone),HasValue$3(config,"deathZone")&&this.setDeathZone(config.deathZone),HasValue$3(config,"boun
233ds")&&this.setBounds(config.bounds),HasValue$3(config,"followOffset")&&this.followOffset.setFromObject(GetFastValue$V(config,"followOffset",0)),HasValue$3(config,"frame")&&this.setFrame(config.frame),HasValue$3(config,"reserve")&&this.reserve(config.reserve),this},toJSON:function(output){void 0===output&&(output={});var i=0,key="";for(i=0;i<this.configFastMap.length;i++)output[key=this.configFastMap[i]]=this[key];for(i=0;i<this.configOpMap.length;i++)this[key=this.configOpMap[i]]&&(output[key]=this[key].toJSON());return this.speedY||(delete output.speedX,output.speed=this.speedX.toJSON()),this.scaleY||(delete output.scaleX,output.scale=this.scaleX.toJSON()),output},startFollow:function(target,offsetX,offsetY,trackVisible){return void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0),void 0===trackVisible&&(trackVisible=!1),this.follow=target,this.followOffset.set(offsetX,offsetY),this.trackVisible=trackVisible,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){if(1===this.frames.length)return this.defaultFrame;if(this.randomFrame)return GetRandom$1(this.frames);var frame=this.frames[this.currentFrame];return this._frameCounter++,this._frameCounter===this.frameQuantity&&(this._frameCounter=0,this.currentFrame=Wrap$2(this.currentFrame+1,0,this._frameLength)),frame},setFrame:function(frames,pickRandom,quantity){void 0===pickRandom&&(pickRandom=!0),void 0===quantity&&(quantity=1),this.randomFrame=pickRandom,this.frameQuantity=quantity,this.currentFrame=0,this._frameCounter=0;var t=typeof frames;if(Array.isArray(frames)||"string"===t||"number"===t)this.manager.setEmitterFrames(frames,this);else if("object"===t){var frameConfig=frames;(frames=GetFastValue$V(frameConfig,"frames",null))&&this.manager.setEmitterFrames(frames,this);var isCycle=GetFastValue$V(frameConfig,"cycle",!1);this.randomFrame=!isCycle,this.frameQuantity=GetFastValue$V(frameConfig,"quantity",quantity)}return this._frameLength=this.frames.length,1===this._frameLength&&(this.frameQuantity=1,this.randomFrame=!1),this},setRadial:function(value){return void 0===value&&(value=!0),this.radial=value,this},setPosition:function(x,y){return this.x.onChange(x),this.y.onChange(y),this},setBounds:function(x,y,width,height){if("object"==typeof x){var obj=x;x=obj.x,y=obj.y,width=HasValue$3(obj,"w")?obj.w:obj.width,height=HasValue$3(obj,"h")?obj.h:obj.height}return this.bounds?this.bounds.setTo(x,y,width,height):this.bounds=new Rectangle$i(x,y,width,height),this},setSpeedX:function(value){return this.speedX.onChange(value),this.radial=!1,this},setSpeedY:function(value){return this.speedY&&(this.speedY.onChange(value),this.radial=!1),this},setSpeed:function(value){return this.speedX.onChange(value),this.speedY=null,this.radial=!0,this},setScaleX:function(value){return this.scaleX.onChange(value),this},setScaleY:function(value){return this.scaleY.onChange(value),this},setScale:function(value){return this.scaleX.onChange(value),this.scaleY=null,this},setGravityX:function(value){return this.gravityX=value,this},setGravityY:function(value){return this.gravityY=value,this},setGravity:function(x,y){return this.gravityX=x,this.gravityY=y,this},setAlpha:function(value){return this.alpha.onChange(value),this},setTint:function(value){return this.tint.onChange(value),this},setEmitterAngle:function(value){return this.angle.onChange(value),this},setAngle:function(value){return this.angle.onChange(value),this},setLifespan:function(value){return this.lifespan.onChange(value),this},setQuantity:function(quantity){return this.quantity.onChange(quantity),this},setFrequency:function(frequency,quantity){return this.frequency=frequency,this._counter=0,quantity&&this.quantity.onChange(quantity),this},setEmitZone:function(zoneConfig){if(void 0===zoneConfig)this.emitZone=null;else{var type=GetFastValue$V(zoneConfig,"type","random"),source=GetFastValue$V(zoneConfig,"source",null);switch(type){case"random":this.emitZone=new RandomZone(source);break;case"edge":var quantity=GetFastValue$V(zoneConfig,"quantity",1),stepRate=GetFastValue$V(zoneConfig,"stepRate",0),yoyo=GetFastValue$V(zoneConfig,"yoyo",!1),seamless=GetFastValue$V(zoneConfig,"seamless",!0);this.emitZone=new EdgeZone(source,quantity,stepRate,yoyo,seamless)}}return this},setDeathZone:function(zoneConfig){if(void 0===zoneConfig)this.deathZone=null;else{var type=GetFastValue$V(zoneConfig,"type","onEnter"),source=GetFastValue$V(zoneConfig,"source",null);if(source&&"function"==typeof source.contains){var killOnEnter="onEnter"===type;this.deathZone=new DeathZone(source,killOnEnter)}}return this},reserve:function(particleCount){for(var dead=this.dead,i=0;i<particleCount;i++)dead.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return this.maxParticles>0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(callback,context){return void 0===callback?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof callback&&(this.emitCallback=callback,context&&(this.emitCallbackScope=context)),this},onParticleDeath:function(callback,context){return void 0===callback?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof callback&&(this.deathCallback=callback,context&&(this.deathCallbackScope=context)),this},killAll:function(){for(var dead=this.dead,alive=this.alive;alive.length>0;)dead.push(alive.pop());return this}
233,forEachAlive:function(callback,context){for(var alive=this.alive,length=alive.length,index=0;index<length;++index)callback.call(context,alive[index],this);return this},forEachDead:function(callback,context){for(var dead=this.dead,length=dead.length,index=0;index<length;++index)callback.call(context,dead[index],this);return this},start:function(){return this.on=!0,this._counter=0,this},stop:function(){return this.on=!1,this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},remove:function(){return this.manager.removeEmitter(this),this},depthSort:function(){return StableSort$2(this.alive,this.depthSortCallback),this},flow:function(frequency,count){return void 0===count&&(count=1),this.frequency=frequency,this.quantity.onChange(count),this.start()},explode:function(count,x,y){return this.frequency=-1,this.emitParticle(count,x,y)},emitParticleAt:function(x,y,count){return this.emitParticle(count,x,y)},emitParticle:function(count,x,y){if(!this.atLimit()){void 0===count&&(count=this.quantity.onEmit());for(var dead=this.dead,followX=this.follow?this.follow.x+this.followOffset.x:x,followY=this.follow?this.follow.y+this.followOffset.y:y,i=0;i<count;i++){var particle=dead.pop();if(particle||(particle=new this.particleClass(this)),particle.fire(followX,followY),this.particleBringToTop?this.alive.push(particle):this.alive.unshift(particle),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,particle,this),this.atLimit())break}return particle}},preUpdate:function(time,delta){var step=(delta*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);var processors=this.manager.getProcessors(),particles=this.alive,dead=this.dead,i=0,rip=[],length=particles.length;for(i=0;i<length;i++){var particle=particles[i];particle.update(delta,step,processors)&&rip.push({index:i,particle:particle})}if((length=rip.length)>0){var deathCallback=this.deathCallback,deathCallbackScope=this.deathCallbackScope;for(i=length-1;i>=0;i--){var entry=rip[i];particles.splice(entry.index,1),dead.push(entry.particle),deathCallback&&deathCallback.call(deathCallbackScope,entry.particle),entry.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=delta,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(a,b){return a.y-b.y}}),ParticleEmitter_1=ParticleEmitter$1,TransformMatrix$4=TransformMatrix_1,Utils$h=Utils$p,tempMatrix1$2=new TransformMatrix$4,tempMatrix2$2=new TransformMatrix$4,tempMatrix3$2=new TransformMatrix$4,tempMatrix4$1=new TransformMatrix$4,ParticleManagerWebGLRenderer_1=function(renderer,emitterManager,camera,parentMatrix){var emitters=emitterManager.emitters.list,emittersLength=emitters.length;if(0!==emittersLength){var pipeline=renderer.pipelines.set(emitterManager.pipeline),camMatrix=tempMatrix1$2,calcMatrix=tempMatrix2$2,particleMatrix=tempMatrix3$2,managerMatrix=tempMatrix4$1;parentMatrix?(managerMatrix.loadIdentity(),managerMatrix.multiply(parentMatrix),managerMatrix.translate(emitterManager.x,emitterManager.y),managerMatrix.rotate(emitterManager.rotation),managerMatrix.scale(emitterManager.scaleX,emitterManager.scaleY)):managerMatrix.applyITRS(emitterManager.x,emitterManager.y,emitterManager.rotation,emitterManager.scaleX,emitterManager.scaleY);var roundPixels=camera.roundPixels,texture=emitterManager.defaultFrame.glTexture,getTint=Utils$h.getTintAppendFloatAlpha,textureUnit=pipeline.setGameObject(emitterManager,emitterManager.defaultFrame);renderer.pipelines.preBatch(emitterManager);for(var e=0;e<emittersLength;e++){var emitter=emitters[e],particles=emitter.alive,particleCount=particles.length;if(emitter.visible&&0!==particleCount){camera.addToRenderList(emitter);var scrollFactorX=emitter.scrollFactorX,scrollFactorY=emitter.scrollFactorY;renderer.setBlendMode(emitter.blendMode),emitter.mask&&(emitter.mask.preRenderWebGL(renderer,emitter,camera),renderer.pipelines.set(emitterManager.pipeline));for(var i=0;i<particleCount;
233i++){var particle=particles[i],alpha=particle.alpha*camera.alpha;if(!(alpha<=0)){particleMatrix.applyITRS(particle.x,particle.y,particle.rotation,particle.scaleX,particle.scaleY),camMatrix.copyFrom(camera.matrix),camMatrix.multiplyWithOffset(managerMatrix,-camera.scrollX*scrollFactorX,-camera.scrollY*scrollFactorY),particleMatrix.e=particle.x,particleMatrix.f=particle.y,camMatrix.multiply(particleMatrix,calcMatrix);var frame=particle.frame,x=-frame.halfWidth,y=-frame.halfHeight,xw=x+frame.width,yh=y+frame.height,tx0=calcMatrix.getXRound(x,y,roundPixels),ty0=calcMatrix.getYRound(x,y,roundPixels),tx1=calcMatrix.getXRound(x,yh,roundPixels),ty1=calcMatrix.getYRound(x,yh,roundPixels),tx2=calcMatrix.getXRound(xw,yh,roundPixels),ty2=calcMatrix.getYRound(xw,yh,roundPixels),tx3=calcMatrix.getXRound(xw,y,roundPixels),ty3=calcMatrix.getYRound(xw,y,roundPixels),tint=getTint(particle.tint,alpha);pipeline.batchQuad(emitter,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,frame.u0,frame.v0,frame.u1,frame.v1,tint,tint,tint,tint,0,texture,textureUnit)}}emitter.mask&&emitter.mask.postRenderWebGL(renderer,camera)}}renderer.pipelines.postBatch(emitterManager)}},TransformMatrix$3=TransformMatrix_1,tempMatrix1$1=new TransformMatrix$3,tempMatrix2$1=new TransformMatrix$3,tempMatrix3$1=new TransformMatrix$3,tempMatrix4=new TransformMatrix$3,ParticleManagerCanvasRenderer_1=function(renderer,emitterManager,camera,parentMatrix){var emitters=emitterManager.emitters.list,emittersLength=emitters.length;if(0!==emittersLength){var camMatrix=tempMatrix1$1.copyFrom(camera.matrix),calcMatrix=tempMatrix2$1,particleMatrix=tempMatrix3$1,managerMatrix=tempMatrix4;parentMatrix?(managerMatrix.loadIdentity(),managerMatrix.multiply(parentMatrix),managerMatrix.translate(emitterManager.x,emitterManager.y),managerMatrix.rotate(emitterManager.rotation),managerMatrix.scale(emitterManager.scaleX,emitterManager.scaleY)):managerMatrix.applyITRS(emitterManager.x,emitterManager.y,emitterManager.rotation,emitterManager.scaleX,emitterManager.scaleY);for(var ctx=renderer.currentContext,roundPixels=camera.roundPixels,e=0;e<emittersLength;e++){var emitter=emitters[e],particles=emitter.alive,particleCount=particles.length;if(emitter.visible&&0!==particleCount){camera.addToRenderList(emitter);var scrollFactorX=emitter.scrollFactorX,scrollFactorY=emitter.scrollFactorY;ctx.save(),ctx.globalCompositeOperation=renderer.blendModes[emitter.blendMode];for(var i=0;i<particleCount;i++){var particle=particles[i],alpha=particle.alpha*camera.alpha;if(!(alpha<=0)){particleMatrix.applyITRS(particle.x,particle.y,particle.rotation,particle.scaleX,particle.scaleY),camMatrix.copyFrom(camera.matrix),camMatrix.multiplyWithOffset(managerMatrix,-camera.scrollX*scrollFactorX,-camera.scrollY*scrollFactorY),particleMatrix.e=particle.x,particleMatrix.f=particle.y,camMatrix.multiply(particleMatrix,calcMatrix);var frame=particle.frame,cd=frame.canvasData,x=-frame.halfWidth,y=-frame.halfHeight;ctx.globalAlpha=alpha,ctx.save(),calcMatrix.setToContext(ctx),roundPixels&&(x=Math.round(x),y=Math.round(y)),ctx.imageSmoothingEnabled=!(!renderer.antialias||frame.source.scaleMode),ctx.drawImage(frame.source.image,cd.x,cd.y,cd.width,cd.height,x,y,cd.width,cd.height),ctx.restore()}}ctx.restore()}}}},GameObject$c=GameObject_1,GravityWell=GravityWell_1,List=List_1,ParticleEmitter=ParticleEmitter_1,ParticleEmitterManager$2=new Class_1({Extends:GameObject$c,Mixins:[components$3.Depth,components$3.Mask,components$3.Pipeline,components$3.Transform,components$3.Visible,{renderWebGL:ParticleManagerWebGLRenderer_1,renderCanvas:ParticleManagerCanvasRenderer_1}],initialize:function(scene,texture,frame,emitters){if(GameObject$c.call(this,scene,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===frame||"object"!=typeof frame&&!Array.isArray(frame)||(emitters=frame,frame=null),this.setTexture(texture,frame),this.initPipeline(),this.emitters=new List(this),this.wells=new List(this),emitters){Array.isArray(emitters)||(emitters=[emitters]);for(var i=0;i<emitters.length;i++)this.createEmitter(emitters[i])}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setTexture:function(key,frame){return this.texture=this.scene.sys.textures.get(key),this.setFrame
233(frame)},setFrame:function(frame){this.frame=this.texture.get(frame);var frames=this.texture.getFramesFromTextureSource(this.frame.sourceIndex),names=[];return frames.forEach((function(sourceFrame){names.push(sourceFrame.name)})),this.frameNames=names,this.defaultFrame=this.frame,this},setEmitterFrames:function(frames,emitter){Array.isArray(frames)||(frames=[frames]);var out=emitter.frames;out.length=0;for(var i=0;i<frames.length;i++){var frame=frames[i];-1!==this.frameNames.indexOf(frame)&&out.push(this.texture.get(frame))}return out.length>0?emitter.defaultFrame=out[0]:emitter.defaultFrame=this.defaultFrame,this},addEmitter:function(emitter){return this.emitters.add(emitter)},createEmitter:function(config){return this.addEmitter(new ParticleEmitter(this,config))},removeEmitter:function(emitter){return this.emitters.remove(emitter,!0)},addGravityWell:function(well){return this.wells.add(well)},createGravityWell:function(config){return this.addGravityWell(new GravityWell(config))},emitParticle:function(count,x,y){for(var emitters=this.emitters.list,i=0;i<emitters.length;i++){var emitter=emitters[i];emitter.active&&emitter.emitParticle(count,x,y)}return this},emitParticleAt:function(x,y,count){return this.emitParticle(count,x,y)},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},getProcessors:function(){return this.wells.getAll("active",!0)},preUpdate:function(time,delta){delta*=this.timeScale;for(var emitters=this.emitters.list,i=0;i<emitters.length;i++){var emitter=emitters[i];emitter.active&&emitter.preUpdate(time,delta)}},setAlpha:function(){},setScrollFactor:function(){},setBlendMode:function(){}}),ParticleEmitterManager_1=ParticleEmitterManager$2,particles={EmitterOp:EmitterOp_1,GravityWell:GravityWell_1,Particle:Particle_1,ParticleEmitter:ParticleEmitter_1,ParticleEmitterManager:ParticleEmitterManager_1,Zones:{DeathZone:DeathZone_1,EdgeZone:EdgeZone_1,RandomZone:RandomZone_1}},Sprite$5=Sprite_1,PathFollower$1=new Class_1({Extends:Sprite$5,Mixins:[components$3.PathFollower],initialize:function(scene,path,x,y,texture,frame){Sprite$5.call(this,scene,x,y,texture,frame),this.path=path},preUpdate:function(time,delta){this.anims.update(time,delta),this.pathUpdate(time)}}),PathFollower_1=PathFollower$1,Utils$g=Utils$p,RenderTextureWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var cameraAlpha=camera.alpha,renderTarget=src.renderTarget,width=renderTarget.width,height=renderTarget.height,getTint=Utils$g.getTintAppendFloatAlpha,pipeline=renderer.pipelines.set(src.pipeline),textureUnit=pipeline.setTexture2D(renderTarget.texture);renderer.pipelines.preBatch(src),pipeline.batchTexture(src,renderTarget.texture,width,height,src.x,src.y,width,height,src.scaleX,src.scaleY,src.rotation,src.flipX,!src.flipY,src.scrollFactorX,src.scrollFactorY,src.displayOriginX,src.displayOriginY,0,0,width,height,getTint(src.tintTopLeft,cameraAlpha*src._alphaTL),getTint(src.tintTopRight,cameraAlpha*src._alphaTR),getTint(src.tintBottomLeft,cameraAlpha*src._alphaBL),getTint(src.tintBottomRight,cameraAlpha*src._alphaBR),src.tintFill,0,0,camera,parentMatrix,!0,textureUnit),renderer.resetTextures(),renderer.pipelines.postBatch(src)},RenderTextureCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src),renderer.batchSprite(src,src.frame,camera,parentMatrix)},UUID_1=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=16*Math.random()|0;return("x"===c?r:3&r|8).toString(16)}))},BlendModes=BlendModes$8,Camera=BaseCamera_1,CanvasPool$3=CanvasPool_1,CONST$T=_const$e,Frame=Frame_1,GameObject$b=GameObject_1,NOOP$8=NOOP_1,PIPELINE_CONST$1=_const$9,RenderTarget=RenderTarget_1,Utils$f=Utils$p,UUID$1=UUID_1,RenderTexture$2=new Class_1({Extends:GameObject$b,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.ComputedSize,components$3.Crop,components$3.Depth,components$3.Flip,components$3.GetBounds,components$3.Mask,components$3.Origin,components$3.Pipeline,components$3.ScrollFactor,components$3.Tint,components$3.Transform,components$3.Visible,{renderWebGL:RenderTextureWebGLRenderer_1,renderCanvas:RenderTextureCanvasRenderer_1}],initialize:function(scene,x,y,width,height,key,frame){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=32),void 0===height&&(height=32),GameObject$b.call(this,scene,"RenderTexture"),this.renderer=scene.sys.renderer,this.textureManager=scene.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===key?(this.canvas=CanvasPool$3.create2D(this,width,height),this.texture=scene.sys.textures.addCanvas(UUID$1(),this.canvas),this.frame=this.texture.get()):(this.texture=scene.sys.textures.get(key),this.frame=this.texture.get(frame),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new Camera(0,0,width,height),this.renderTarget=null;var renderer=this.renderer;renderer?renderer.type===CONST$T.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new RenderTarget(renderer,width,height,1,0,!1)):renderer.type===CONST$T.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=NOOP$8,this.camera.setScene(scene),this.setPosition(x,y),void 0===key&&this.setSize(width,height),this.setOrigin(0,0),this.initPipeline(PIPELINE_CONST$1.SINGLE_PIPELINE)},setSize:function(width,height){return this.resize(width,height)},resize:function(width,height){void 0===height&&(height=width);var frame=this.frame;if(width!==this.width||height!==this.height){if("__BASE"===frame.name){this.canvas.width=width,this.canvas.height=height,this.texture.width=width,this.texture.height=height;var renderTarget=this.renderTarget;renderTarget&&(renderTarget.resize(width,height),frame.glTexture=renderTarget.texture,frame.source.isRenderTexture=!0,frame.source.isGLTexture=!0,frame.source.glTexture=renderTarget.texture),this.camera.setSize(width,height),frame.source.width=width,frame.source.height=height,frame.setSize(width,height),this.width=width,this.height=height}}else{var baseFrame=this.texture.getSourceImage();frame.cutX+width>baseFrame.width&&(width=baseFrame.width-frame.cutX),frame.cutY+height>baseFrame.height&&(height=baseFrame.height-frame.cutY),frame.setSize(width,height,frame.cutX,frame.cutY)}this.updateDisplayOrigin();var input=this.input;return input&&!input.customHitArea&&(input.hitArea.width=width,input.hitArea.height=height),this},setGlobalTint:function(tint){return this.globalTint=tint,this},setGlobalAlpha:function(alpha){return this.globalAlpha=alpha,this},saveTexture:function(key){return this.textureManager.renameTexture(this.texture.key,key),this._saved=!0,this.texture},fill:function(rgb,alpha,x,y,width,height){var frame=this.frame,camera=this.camera,renderer=this.renderer;void 0===alpha&&(alpha=1),void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=frame.cutWidth),void 0===height&&(height=frame.cutHeight);var r=(rgb>>16&255)/255,g=(rgb>>8&255)/255,b=(255&rgb)/255,renderTarget=this.renderTarget;if(camera.preRender(),renderTarget){renderTarget.bind(!0);var pipeline=this.pipeline;pipeline.manager.set(pipeline);var tw=renderTarget.width,th=renderTarget.height,sx=renderer.width/tw,sy=renderer.height/th;pipeline.drawFillRect(x*sx,y*sy,width*sx,height*sy,Utils$f.getTintFromFloats(b,g,r,1),alpha),renderTarget.unbind(!0)}else{var ctx=this.context;renderer.setContext(ctx),ctx.fillStyle="rgba("+r+","+g+","+b+","+alpha+")",ctx.fillRect(x+frame.cutX,y+frame.cutY,width,height),renderer.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var renderTarget=this.renderTarget;if(renderTarget)renderTarget.clear();else{var ctx=this.context;ctx.save(),ctx.setTransform(1,0,0,1,0,0),ctx.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),ctx.restore(
233)}this.dirty=!1}return this},erase:function(entries,x,y){return this._eraseMode=!0,this.draw(entries,x,y,1,16777215),this._eraseMode=!1,this},draw:function(entries,x,y,alpha,tint){return this.beginDraw(),this.batchDraw(entries,x,y,alpha,tint),this.endDraw(),this},drawFrame:function(key,frame,x,y,alpha,tint){return this.beginDraw(),this.batchDrawFrame(key,frame,x,y,alpha,tint),this.endDraw(),this},beginDraw:function(){var camera=this.camera,renderer=this.renderer,renderTarget=this.renderTarget;return camera.preRender(),renderTarget?renderer.beginCapture(renderTarget.width,renderTarget.height):renderer.setContext(this.context),this},batchDraw:function(entries,x,y,alpha,tint){return void 0===alpha&&(alpha=this.globalAlpha),tint=void 0===tint?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(tint>>16)+(65280&tint)+((255&tint)<<16),Array.isArray(entries)||(entries=[entries]),this.batchList(entries,x,y,alpha,tint),this},batchDrawFrame:function(key,frame,x,y,alpha,tint){void 0===x&&(x=0),void 0===y&&(y=0),void 0===alpha&&(alpha=this.globalAlpha),tint=void 0===tint?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(tint>>16)+(65280&tint)+((255&tint)<<16);var textureFrame=this.textureManager.getFrame(key,frame);return textureFrame&&(this.renderTarget?this.pipeline.batchTextureFrame(textureFrame,x,y,tint,alpha,this.camera.matrix,null):this.batchTextureFrame(textureFrame,x+this.frame.cutX,y+this.frame.cutY,alpha,tint)),this},endDraw:function(erase){void 0===erase&&(erase=this._eraseMode);var renderer=this.renderer,renderTarget=this.renderTarget;if(renderTarget){var canvasTarget=renderer.endCapture();renderer.pipelines.setUtility().blitFrame(canvasTarget,renderTarget,1,!1,!1,erase),renderer.resetScissor(),renderer.resetViewport()}else renderer.setContext();return this.dirty=!0,this},batchList:function(children,x,y,alpha,tint){for(var i=0;i<children.length;i++){var entry=children[i];entry&&entry!==this&&(entry.renderWebGL||entry.renderCanvas?this.drawGameObject(entry,x,y):entry.isParent||entry.list?this.batchGroup(entry.getChildren(),x,y):"string"==typeof entry?this.batchTextureFrameKey(entry,null,x,y,alpha,tint):entry instanceof Frame?this.batchTextureFrame(entry,x,y,alpha,tint):Array.isArray(entry)&&this.batchList(entry,x,y,alpha,tint))}},batchGroup:function(children,x,y){void 0===x&&(x=0),void 0===y&&(y=0),x+=this.frame.cutX,y+=this.frame.cutY;for(var i=0;i<children.length;i++){var entry=children[i];if(entry.willRender(this.camera)){var tx=entry.x+x,ty=entry.y+y;this.drawGameObject(entry,tx,ty)}}},batchGameObjectWebGL:function(gameObject,x,y){void 0===x&&(x=gameObject.x),void 0===y&&(y=gameObject.y);var prevX=gameObject.x,prevY=gameObject.y;gameObject.setPosition(x+this.frame.cutX,y+this.frame.cutY),gameObject.renderDirect?gameObject.renderDirect(this.renderer,gameObject,this.camera):gameObject.renderWebGL(this.renderer,gameObject,this.camera),gameObject.setPosition(prevX,prevY)},batchGameObjectCanvas:function(gameObject,x,y){void 0===x&&(x=gameObject.x),void 0===y&&(y=gameObject.y);var prevX=gameObject.x,prevY=gameObject.y;if(this._eraseMode){var blendMode=gameObject.blendMode;gameObject.blendMode=BlendModes.ERASE}gameObject.setPosition(x+this.frame.cutX,y+this.frame.cutY),gameObject.renderCanvas(this.renderer,gameObject,this.camera,null),gameObject.setPosition(prevX,prevY),this._eraseMode&&(gameObject.blendMode=blendMode)},batchTextureFrameKey:function(key,frame,x,y,alpha,tint){var textureFrame=this.textureManager.getFrame(key,frame);textureFrame&&this.batchTextureFrame(textureFrame,x,y,alpha,tint)},batchTextureFrame:function(textureFrame,x,y,alpha,tint){if(void 0===x&&(x=0),void 0===y&&(y=0),x+=this.frame.cutX,y+=this.frame.cutY,this.renderTarget)this.pipeline.batchTextureFrame(textureFrame,x,y,tint,alpha,this.camera.matrix,null);else{var ctx=this.context,cd=textureFrame.canvasData,source=textureFrame.source.image,matrix=this.camera.matrix;ctx.save(),ctx.globalCompositeOperation=this._eraseMode?"destination-out":"source-over",ctx.globalAlpha=alpha,matrix.setToContext(ctx),ctx.drawImage(source,cd.x,cd.y,cd.width,cd.height,x,y,cd.width,cd.height),ctx.restore(
233)}},snapshotArea:function(x,y,width,height,callback,type,encoderOptions){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,callback,!1,x,y,width,height,type,encoderOptions):this.renderer.snapshotCanvas(this.canvas,callback,!1,x,y,width,height,type,encoderOptions),this},snapshot:function(callback,type,encoderOptions){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,callback,!1,0,0,this.width,this.height,type,encoderOptions):this.renderer.snapshotCanvas(this.canvas,callback,!1,0,0,this.width,this.height,type,encoderOptions),this},snapshotPixel:function(x,y,callback){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,callback,!0,x,y):this.renderer.snapshotCanvas(this.canvas,callback,!0,x,y),this},preDestroy:function(){this._saved||(CanvasPool$3.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.texture=null)}}),RenderTexture_1=RenderTexture$2,GetValue$j=GetValue_1,ParseRetroFont_1=function(scene,config){var w=config.width,h=config.height,cx=Math.floor(w/2),cy=Math.floor(h/2),letters=GetValue$j(config,"chars","");if(""!==letters){var key=GetValue$j(config,"image",""),frame=scene.sys.textures.getFrame(key),textureX=frame.cutX,textureY=frame.cutY,textureWidth=frame.source.width,textureHeight=frame.source.height,offsetX=GetValue$j(config,"offset.x",0),offsetY=GetValue$j(config,"offset.y",0),spacingX=GetValue$j(config,"spacing.x",0),spacingY=GetValue$j(config,"spacing.y",0),lineSpacing=GetValue$j(config,"lineSpacing",0),charsPerRow=GetValue$j(config,"charsPerRow",null);null===charsPerRow&&(charsPerRow=textureWidth/w)>letters.length&&(charsPerRow=letters.length);for(var x=offsetX,y=offsetY,data={retroFont:!0,font:key,size:w,lineHeight:h+lineSpacing,chars:{}},r=0,i=0;i<letters.length;i++){var charCode=letters.charCodeAt(i),u0=(textureX+x)/textureWidth,v0=(textureY+y)/textureHeight,u1=(textureX+x+w)/textureWidth,v1=(textureY+y+h)/textureHeight;data.chars[charCode]={x:x,y:y,width:w,height:h,centerX:cx,centerY:cy,xOffset:0,yOffset:0,xAdvance:w,data:{},kerning:{},u0:u0,v0:v0,u1:u1,v1:v1},++r===charsPerRow?(r=0,x=offsetX,y+=h+spacingY):x+=w+spacingX}return{data:data,frame:null,texture:key}}},RetroFont={Parse:ParseRetroFont_1},RetroFont_1=RetroFont=Extend_1$1(!1,RetroFont,{TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}),GetCalcMatrix$f=GetCalcMatrix_1,Utils$e=Utils$p,RopeWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline,src),calcMatrix=GetCalcMatrix$f(src,camera,parentMatrix).calc,vertices=src.vertices,uvs=src.uv,colors=src.colors,alphas=src.alphas,alpha=src.alpha,getTint=Utils$e.getTintAppendFloatAlpha,roundPixels=camera.roundPixels,meshVerticesLength=vertices.length,vertexCount=Math.floor(.5*meshVerticesLength);pipeline.flush(),renderer.pipelines.preBatch(src);var textureUnit=pipeline.setGameObject(src),vertexViewF32=pipeline.vertexViewF32,vertexViewU32=pipeline.vertexViewU32,vertexOffset=pipeline.vertexCount*pipeline.currentShader.vertexComponentCount-1,colorIndex=0,tintEffect=src.tintFill;src.dirty&&src.updateVertices();for(var debugCallback=src.debugCallback,debugVerts=[],i=0;i<meshVerticesLength;i+=2){var x=vertices[i+0],y=vertices[i+1],tx=x*calcMatrix.a+y*calcMatrix.c+calcMatrix.e,ty=x*calcMatrix.b+y*calcMatrix.d+calcMatrix.f;roundPixels&&(tx=Math.round(tx),ty=Math.round(ty)),vertexViewF32[++vertexOffset]=tx,vertexViewF32[++vertexOffset]=ty,vertexViewF32[++vertexOffset]=uvs[i+0],vertexViewF32[++vertexOffset]=uvs[i+1],vertexViewF32[++vertexOffset]=textureUnit,vertexViewF32[++vertexOffset]=tintEffe
233ct,vertexViewU32[++vertexOffset]=getTint(colors[colorIndex],camera.alpha*(alphas[colorIndex]*alpha)),colorIndex++,debugCallback&&(debugVerts[i+0]=tx,debugVerts[i+1]=ty)}debugCallback&&debugCallback.call(src,src,meshVerticesLength,debugVerts),pipeline.vertexCount+=vertexCount,renderer.pipelines.postBatch(src)},AnimationState$1=AnimationState_1,GameObject$a=GameObject_1,PIPELINE_CONST=_const$9,Vector2$t=Vector2_1,Rope$2=new Class_1({Extends:GameObject$a,Mixins:[components$3.AlphaSingle,components$3.BlendMode,components$3.Depth,components$3.Flip,components$3.Mask,components$3.Pipeline,components$3.Size,components$3.Texture,components$3.Transform,components$3.Visible,components$3.ScrollFactor,{renderWebGL:RopeWebGLRenderer_1,renderCanvas:function(){}}],initialize:function(scene,x,y,texture,frame,points,horizontal,colors,alphas){void 0===texture&&(texture="__DEFAULT"),void 0===points&&(points=2),void 0===horizontal&&(horizontal=!0),GameObject$a.call(this,scene,"Rope"),this.anims=new AnimationState$1(this),this.points=points,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===texture,this.dirty=!1,this.horizontal=horizontal,this._flipX=!1,this._flipY=!1,this._perp=new Vector2$t,this.debugCallback=null,this.debugGraphic=null,this.setTexture(texture,frame),this.setPosition(x,y),this.setSizeToFrame(),this.initPipeline(PIPELINE_CONST.ROPE_PIPELINE),Array.isArray(points)&&this.resizeArrays(points.length),this.setPoints(points,colors,alphas),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(time,delta){var prevFrame=this.anims.currentFrame;this.anims.update(time,delta),this.anims.currentFrame!==prevFrame&&(this.updateUVs(),this.updateVertices())},play:function(key,ignoreIfPlaying,startFrame){return this.anims.play(key,ignoreIfPlaying,startFrame),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(points,colors,alphas){return void 0===points&&(points=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(points,colors,alphas))},setVertical:function(points,colors,alphas){return void 0===points&&(points=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(points,colors,alphas)):this},setTintFill:function(value){return void 0===value&&(value=!1),this.tintFill=value,this},setAlphas:function(alphas,bottomAlpha){var total=this.points.length;if(total<1)return this;var i,currentAlphas=this.alphas;void 0===alphas?alphas=[1]:Array.isArray(alphas)||void 0!==bottomAlpha||(alphas=[alphas]);var index=0;if(void 0!==bottomAlpha)for(i=0;i<total;i++)currentAlphas[index=2*i]=alphas,currentAlphas[index+1]=bottomAlpha;else if(alphas.length===total)for(i=0;i<total;i++)currentAlphas[index=2*i]=alphas[i],currentAlphas[index+1]=alphas[i];else{var prevAlpha=alphas[0];for(i=0;i<total;i++)index=2*i,alphas.length>index&&(prevAlpha=alphas[index]),currentAlphas[index]=prevAlpha,alphas.length>index+1&&(prevAlpha=alphas[index+1]),currentAlphas[index+1]=prevAlpha}return this},setColors:function(colors){var total=this.points.length;if(total<1)return this;var i,currentColors=this.colors;void 0===colors?colors=[16777215]:Array.isArray(colors)||(colors=[colors]);var index=0;if(colors.length===total)for(i=0;i<total;i++)currentColors[index=2*i]=colors[i],currentColors[index+1]=colors[i];else{var prevColor=colors[0];for(i=0;i<total;i++)index=2*i,colors.length>index&&(prevColor=colors[index]),currentColors[index]=prevColor,colors.length>index+1&&(prevColor=colors[index+1]),currentColors[index+1]=prevColor}return this},setPoints:function(points,colors,alphas){if(void 0===points&&(points=2),"number"==typeof points){var s,frameSegment,offset,segments=points;if(segments<2&&(segments=2),points=[],this.horizontal)for(offset=-this.frame.halfWidth,frameSegment=this.frame.width/(segments-1),s=0;s<segments;s++)points.push({x:offset+s*frameSegment,y:0});else for(offset=-this.frame.halfHeight,frameSegment=this.frame.height/(segments-1),s=0;s<segments;s++)points.push({x:0,y:offset+s*frameSegment})}var total=points.length,currentTotal=this.points.length;
233return total<1?(console.warn("Rope: Not enough points given"),this):(1===total&&(points.unshift({x:0,y:0}),total++),currentTotal!==total&&this.resizeArrays(total),this.points=points,this.updateUVs(),null!=colors&&this.setColors(colors),null!=alphas&&this.setAlphas(alphas),this)},updateUVs:function(){for(var currentUVs=this.uv,total=this.points.length,u0=this.frame.u0,v0=this.frame.v0,u1=this.frame.u1,v1=this.frame.v1,partH=(u1-u0)/(total-1),partV=(v1-v0)/(total-1),i=0;i<total;i++){var uv0,uv1,uv2,uv3,index=4*i;this.horizontal?(this._flipX?(uv0=u1-i*partH,uv2=u1-i*partH):(uv0=u0+i*partH,uv2=u0+i*partH),this._flipY?(uv1=v1,uv3=v0):(uv1=v0,uv3=v1)):(this._flipX?(uv0=u0,uv2=u1):(uv0=u1,uv2=u0),this._flipY?(uv1=v1-i*partV,uv3=v1-i*partV):(uv1=v0+i*partV,uv3=v0+i*partV)),currentUVs[index+0]=uv0,currentUVs[index+1]=uv1,currentUVs[index+2]=uv2,currentUVs[index+3]=uv3}return this},resizeArrays:function(newSize){var colors=this.colors,alphas=this.alphas;this.vertices=new Float32Array(4*newSize),this.uv=new Float32Array(4*newSize),colors=new Uint32Array(2*newSize),alphas=new Float32Array(2*newSize);for(var i=0;i<2*newSize;i++)colors[i]=16777215,alphas[i]=1;return this.colors=colors,this.alphas=alphas,this.dirty=!0,this},updateVertices:function(){var perp=this._perp,points=this.points,vertices=this.vertices,total=points.length;if(this.dirty=!1,!(total<1)){for(var nextPoint,lastPoint=points[0],frameSize=this.horizontal?this.frame.halfHeight:this.frame.halfWidth,i=0;i<total;i++){var point=points[i],index=4*i;nextPoint=i<total-1?points[i+1]:point,perp.x=nextPoint.y-lastPoint.y,perp.y=-(nextPoint.x-lastPoint.x);var perpLength=perp.length();perp.x/=perpLength,perp.y/=perpLength,perp.x*=frameSize,perp.y*=frameSize,vertices[index]=point.x+perp.x,vertices[index+1]=point.y+perp.y,vertices[index+2]=point.x-perp.x,vertices[index+3]=point.y-perp.y,lastPoint=point}return this}},setDebug:function(graphic,callback){return this.debugGraphic=graphic,this.debugCallback=graphic||callback?callback||this.renderDebugVerts:null,this},renderDebugVerts:function(src,meshLength,verts){var graphic=src.debugGraphic,px0=verts[0],py0=verts[1],px1=verts[2],py1=verts[3];graphic.lineBetween(px0,py0,px1,py1);for(var i=4;i<meshLength;i+=4){var x0=verts[i+0],y0=verts[i+1],x1=verts[i+2],y1=verts[i+3];graphic.lineBetween(px0,py0,x0,y0),graphic.lineBetween(px1,py1,x1,y1),graphic.lineBetween(px1,py1,x0,y0),graphic.lineBetween(x0,y0,x1,y1),px0=x0,py0=y0,px1=x1,py1=y1}},preDestroy:function(){this.anims.destroy(),this.anims=void 0,this.points=null,this.vertices=null,this.uv=null,this.colors=null,this.alphas=null,this.debugCallback=null,this.debugGraphic=null},flipX:{get:function(){return this._flipX},set:function(value){return this._flipX=value,this.updateUVs()}},flipY:{get:function(){return this._flipY},set:function(value){return this._flipY=value,this.updateUVs()}}}),Rope_1=Rope$2,GetTextSize_1=function(text,size,lines){var canvas=text.canvas,context=text.context,style=text.style,lineWidths=[],maxLineWidth=0,drawnLines=lines.length;style.maxLines>0&&style.maxLines<lines.length&&(drawnLines=style.maxLines),style.syncFont(canvas,context);for(var i=0;i<drawnLines;i++){var lineWidth=style.strokeThickness;lineWidth+=context.measureText(lines[i]).width,style.wordWrap&&(lineWidth-=context.measureText(" ").width),lineWidths[i]=Math.ceil(lineWidth),maxLineWidth=Math.max(maxLineWidth,lineWidths[i])}var lineHeight=size.fontSize+style.strokeThickness,height=lineHeight*drawnLines,lineSpacing=text.lineSpacing;return drawnLines>1&&(height+=lineSpacing*(drawnLines-1)),{width:maxLineWidth,height:height,lines:drawnLines,lineWidths:lineWidths,lineSpacing:lineSpacing,lineHeight:lineHeight}},Utils$d=Utils$p,TextWebGLRenderer_1=function(renderer,src,camera,parentMatrix){if(0!==src.width&&0!==src.height){camera.addToRenderList(src);var frame=src.frame,width=frame.width,height=frame.height,getTint=Utils$d.getTintAppendFloatAlpha,pipeline=renderer.pipelines.set(src.pipeline,src),textureUnit=pipeline.setTexture2D(frame.glTexture,src);renderer.pipelines.preBatch(src),pipeline.batchTexture(src,frame.glTexture,width,height,src.x,src.y,width/src.style.resolution,height/src.style.resolution,src.scaleX,src.scaleY,src.rotation,src.flipX,src.flipY,src.scrollFactorX,src.scrollFactorY,src.displayOriginX,src.displayOriginY,0,0,width,height,getTint(src.tintTopLeft,camera.alpha*src._alphaTL),getTint(src.tintTopRight,camera.alpha*src._alphaTR),getTint(src.tintBottomLeft,camera.alpha*src._alphaBL),getTint(src.tintBottomRight,camera.alpha*src._alphaBR),src.tintFill,0,0,camera,parentMatrix,!1,textureUnit),renderer.pipelines.postBatch(src)}},TextCanvasRenderer_1=function(renderer,src,camera,parentMatrix){0!==src.width&&0!==src.height&&(camera.addToRenderList(src),renderer.batchSprite(src,src.frame,camera,parentMatrix))},TextRender$1={renderWebGL:TextWebGLRenderer_1,renderCanvas:TextCanvasRenderer_1},CanvasPool$2=CanvasPool_1,MeasureText_1=function(textStyle){var canvas=CanvasPool$2.create(this),context=canvas.getContext("2d");textStyle.syncFont(canvas,context);var metrics=context.measureText(textStyle.testString);if("actualBoundingBoxAscent"in metrics){var ascent=metrics.actualBoundingBoxAscent,descent=metrics.actualBoundingBoxDescent;return CanvasPool$2.remove(canvas),{ascent:ascent,descent:descent,fontSize:ascent+descent}}var width=Math.ceil(metrics.width*textStyle.baselineX),baseline=width,height=2*baseline;baseline=baseline*textStyle.baselineY|0,canvas.width=width,canvas.height=height,context.fillStyle="#f00",context.fillRect(0,0,width,height),context.font=textStyle._font,context.textBaseline="alphabetic",context.fillStyle="#000",context.fillText(textStyle.testString,0,baseline);var output={ascent:0,descent:0,fontSize:0},imagedata=context.getImageData(0,0,width,height);
233if(!imagedata)return output.ascent=baseline,output.descent=baseline+6,output.fontSize=output.ascent+output.descent,CanvasPool$2.remove(canvas),output;var i,j,pixels=imagedata.data,numPixels=pixels.length,line=4*width,idx=0,stop=!1;for(i=0;i<baseline;i++){for(j=0;j<line;j+=4)if(255!==pixels[idx+j]){stop=!0;break}if(stop)break;idx+=line}for(output.ascent=baseline-i,idx=numPixels-line,stop=!1,i=height;i>baseline;i--){for(j=0;j<line;j+=4)if(255!==pixels[idx+j]){stop=!0;break}if(stop)break;idx-=line}return output.descent=i-baseline,output.fontSize=output.ascent+output.descent,CanvasPool$2.remove(canvas),output},GetAdvancedValue$k=GetAdvancedValue_1,GetValue$i=GetValue_1,MeasureText=MeasureText_1,propertyMap={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},TextStyle$1=new Class_1({initialize:function(text,style){this.parent=text,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(style,!1,!0);var metrics=GetValue$i(style,"metrics",!1);this.metrics=metrics?{ascent:GetValue$i(metrics,"ascent",0),descent:GetValue$i(metrics,"descent",0),fontSize:GetValue$i(metrics,"fontSize",0)}:MeasureText(this)},setStyle:function(style,updateText,setDefaults){for(var key in void 0===updateText&&(updateText=!0),void 0===setDefaults&&(setDefaults=!1),style&&style.hasOwnProperty("fontSize")&&"number"==typeof style.fontSize&&(style.fontSize=style.fontSize.toString()+"px"),propertyMap){var value=setDefaults?propertyMap[key][1]:this[key];this[key]="wordWrapCallback"===key||"wordWrapCallbackScope"===key?GetValue$i(style,propertyMap[key][0],value):GetAdvancedValue$k(style,propertyMap[key][0],value)}var font=GetValue$i(style,"font",null);null!==font&&this.setFont(font,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var fill=GetValue$i(style,"fill",null);return null!==fill&&(this.color=fill),updateText?this.update(!0):this.parent},syncFont:function(canvas,context){context.font=this._font},syncStyle:function(canvas,context){context.textBaseline="alphabetic",context.fillStyle=this.color,context.strokeStyle=this.stroke,context.lineWidth=this.strokeThickness,context.lineCap="round",context.lineJoin="round"},syncShadow:function(context,enabled){enabled?(context.shadowOffsetX=this.shadowOffsetX,context.shadowOffsetY=this.shadowOffsetY,context.shadowColor=this.shadowColor,context.shadowBlur=this.shadowBlur):(context.shadowOffsetX=0,context.shadowOffsetY=0,context.shadowColor=0,context.shadowBlur=0)},update:function(recalculateMetrics){return recalculateMetrics&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=MeasureText(this)),this.parent.updateText()},setFont:function(font,updateText){void 0===updateText&&(updateText=!0);var fontFamily=font,fontSize="",fontStyle="";if("string"!=typeof font)fontFamily=GetValue$i(font,"fontFamily","Courier"),fontSize=GetValue$i(font,"fontSize","16px"),fontStyle=GetValue$i(font,"fontStyle","");else{var fontSplit=font.split(" "),i=0;fontStyle=fontSplit.length>2?fontSplit[i++]:"",fontSize=fontSplit[i++]||"16px",fontFamily=fontSplit[i++]||"Courier"}return fontFamily===this.fontFamily&&fontSize===this.fontSize&&fontStyle===this.fontStyle||(this.fontFamily=fontFamily,this.fontSize=fontSize,this.fontStyle=fontStyle,updateText&&this.update(!0)),this.parent},setFontFamily:function(family){return this.fontFamily!==family&&(this.fontFamily=family,this.update(!0)),this.parent},setFontStyle:function(style){return this.fontStyle!==style&&(this.fontStyle=style,this.update(!0)),this.parent},setFontSize:function(size){return"number"==typeof size&&(size=size.toString()+"px"),this.fontSize!==size&&(this.fontSize=size,this.update(!0)),this.parent},setTestString:function(string){return this.testString=string,this.update(!0)},setFixedSize:function(width,height){return this.fixedWidth=width,this.fixedHeight=height,width&&(this.parent.width=width),height&&(this.parent.height=height),this.update(!1)}
vendor: 2,770 bytes, line 233
233,setBackgroundColor:function(color){return this.backgroundColor=color,this.update(!1)},setFill:function(color){return this.color=color,this.update(!1)},setColor:function(color){return this.color=color,this.update(!1)},setResolution:function(value){return this.resolution=value,this.update(!1)},setStroke:function(color,thickness){return void 0===thickness&&(thickness=this.strokeThickness),void 0===color&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===color&&this.strokeThickness===thickness||(this.stroke=color,this.strokeThickness=thickness,this.update(!0)),this.parent},setShadow:function(x,y,color,blur,shadowStroke,shadowFill){return void 0===x&&(x=0),void 0===y&&(y=0),void 0===color&&(color="#000"),void 0===blur&&(blur=0),void 0===shadowStroke&&(shadowStroke=!1),void 0===shadowFill&&(shadowFill=!0),this.shadowOffsetX=x,this.shadowOffsetY=y,this.shadowColor=color,this.shadowBlur=blur,this.shadowStroke=shadowStroke,this.shadowFill=shadowFill,this.update(!1)},setShadowOffset:function(x,y){return void 0===x&&(x=0),void 0===y&&(y=x),this.shadowOffsetX=x,this.shadowOffsetY=y,this.update(!1)},setShadowColor:function(color){return void 0===color&&(color="#000"),this.shadowColor=color,this.update(!1)},setShadowBlur:function(blur){return void 0===blur&&(blur=0),this.shadowBlur=blur,this.update(!1)},setShadowStroke:function(enabled){return this.shadowStroke=enabled,this.update(!1)},setShadowFill:function(enabled){return this.shadowFill=enabled,this.update(!1)},setWordWrapWidth:function(width,useAdvancedWrap){return void 0===useAdvancedWrap&&(useAdvancedWrap=!1),this.wordWrapWidth=width,this.wordWrapUseAdvanced=useAdvancedWrap,this.update(!1)},setWordWrapCallback:function(callback,scope){return void 0===scope&&(scope=null),this.wordWrapCallback=callback,this.wordWrapCallbackScope=scope,this.update(!1)},setAlign:function(align){return void 0===align&&(align="left"),this.align=align,this.update(!1)},setMaxLines:function(max){return void 0===max&&(max=0),this.maxLines=max,this.update(!1)},getTextMetrics:function(){var metrics=this.metrics;return{ascent:metrics.ascent,descent:metrics.descent,fontSize:metrics.fontSize}},toJSON:function(){var output={};for(var key in propertyMap)output[key]=this[key];return output.metrics=this.getTextMetrics(),output},destroy:function(){this.parent=void 0}}),TextStyle_1=TextStyle$1,AddToDOM=AddToDOM_1,CanvasPool$1=CanvasPool_1,Components$f=components$3,GameEvents$3=events$k,GameObject$9=GameObject_1,GetTextSize=GetTextSize_1,GetValue$h=GetValue_1,RemoveFromDOM=RemoveFromDOM_1,TextRender=TextRender$1,TextStyle=TextStyle_1,Text$2=new Class_1({Extends:GameObject$9,Mixins:[Components$f.Alpha,Components$f.BlendMode,Components$f.ComputedSize,Components$f.Crop,Components$f.Depth,C
233omponents$f.Flip,Components$f.GetBounds,Components$f.Mask,Components$f.Origin,Components$f.Pipeline,Components$f.ScrollFactor,Components$f.Tint,Components$f.Transform,Components$f.Visible,TextRender],initialize:function(scene,x,y,text,style){void 0===x&&(x=0),void 0===y&&(y=0),GameObject$9.call(this,scene,"Text"),this.renderer=scene.sys.renderer,this.setPosition(x,y),this.setOrigin(0,0),this.initPipeline(),this.canvas=CanvasPool$1.create(this),this.context=this.canvas.getContext("2d"),this.style=new TextStyle(this,style),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=scene.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(text),style&&style.padding&&this.setPadding(style.padding),style&&style.lineSpacing&&this.setLineSpacing(style.lineSpacing),scene.sys.game.events.on(GameEvents$3.CONTEXT_RESTORED,(function(){this.dirty=!0}),this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",AddToDOM(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(text){var style=this.style;if(style.wordWrapCallback){var wrappedLines=style.wordWrapCallback.call(style.wordWrapCallbackScope,text,this);return Array.isArray(wrappedLines)&&(wrappedLines=wrappedLines.join("\n")),wrappedLines}return style.wordWrapWidth?style.wordWrapUseAdvanced?this.advancedWordWrap(text,this.context,this.style.wordWrapWidth):this.basicWordWrap(text,this.context,this.style.wordWrapWidth):text},advancedWordWrap:function(text,context,wordWrapWidth){for(var output="",lines=text.replace(/ +/gi," ").split(this.splitRegExp),linesCount=lines.length,i=0;i<linesCount;i++){var line=lines[i],out="";if(line=line.replace(/^ *|\s*$/gi,""),context.measureText(line).width<wordWrapWidth)output+=line+"\n";else{for(var currentLineWidth=wordWrapWidth,words=line.split(" "),j=0;j<words.length;j++){var word=words[j],wordWithSpace=word+" ",wordWidth=context.measureText(wordWithSpace).width;if(wordWidth>currentLineWidth){if(0===j){for(var newWord=wordWithSpace;newWord.length&&(newWord=newWord.slice(0,-1),!((wordWidth=context.measureText(newWord).width)<=currentLineWidth)););if(!newWord.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var secondPart=word.substr(newWord.length);words[j]=secondPart,out+=newWord}var offset=words[j].length?j:j+1,remainder=words.slice(offset).join(" ").replace(/[ \n]*$/gi,"");lines[i+1]=remainder+" "+(lines[i+1]||""),linesCount=lines.length;break}out+=wordWithSpace,currentLineWidth-=wordWidth}output+=out.replace(/[ \n]*$/gi,"")+"\n"}}return output=output.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(text,context,wordWrapWidth){for(var result="",lines=text.split(this.splitRegExp),lastLineIndex=lines.length-1,whiteSpaceWidth=context.measureText(" ").width,i=0;i<=lastLineIndex;i++){for(var spaceLeft=wordWrapWidth,words=lines[i].split(" "),lastWordIndex=words.length-1,j=0;j<=lastWordIndex;
vendor: 4,904 bytes, line 233
233j++){var word=words[j],wordWidth=context.measureText(word).width,wordWidthWithSpace=wordWidth;j<lastWordIndex&&(wordWidthWithSpace+=whiteSpaceWidth),wordWidthWithSpace>spaceLeft&&j>0&&(result+="\n",spaceLeft=wordWrapWidth),result+=word,j<lastWordIndex?(result+=" ",spaceLeft-=wordWidthWithSpace):spaceLeft-=wordWidth}i<lastLineIndex&&(result+="\n")}return result},getWrappedText:function(text){return void 0===text&&(text=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(text).split(this.splitRegExp)},setText:function(value){return value||0===value||(value=""),Array.isArray(value)&&(value=value.join("\n")),value!==this._text&&(this._text=value.toString(),this.updateText()),this},setStyle:function(style){return this.style.setStyle(style)},setFont:function(font){return this.style.setFont(font)},setFontFamily:function(family){return this.style.setFontFamily(family)},setFontSize:function(size){return this.style.setFontSize(size)},setFontStyle:function(style){return this.style.setFontStyle(style)},setFixedSize:function(width,height){return this.style.setFixedSize(width,height)},setBackgroundColor:function(color){return this.style.setBackgroundColor(color)},setFill:function(fillStyle){return this.style.setFill(fillStyle)},setColor:function(color){return this.style.setColor(color)},setStroke:function(color,thickness){return this.style.setStroke(color,thickness)},setShadow:function(x,y,color,blur,shadowStroke,shadowFill){return this.style.setShadow(x,y,color,blur,shadowStroke,shadowFill)},setShadowOffset:function(x,y){return this.style.setShadowOffset(x,y)},setShadowColor:function(color){return this.style.setShadowColor(color)},setShadowBlur:function(blur){return this.style.setShadowBlur(blur)},setShadowStroke:function(enabled){return this.style.setShadowStroke(enabled)},setShadowFill:function(enabled){return this.style.setShadowFill(enabled)},setWordWrapWidth:function(width,useAdvancedWrap){return this.style.setWordWrapWidth(width,useAdvancedWrap)},setWordWrapCallback:function(callback,scope){return this.style.setWordWrapCallback(callback,scope)},setAlign:function(align){return this.style.setAlign(align)},setResolution:function(value){return this.style.setResolution(value)},setLineSpacing:function(value){return this.lineSpacing=value,this.updateText()},setPadding:function(left,top,right,bottom){if("object"==typeof left){var config=left,x=GetValue$h(config,"x",null);null!==x?(left=x,right=x):(left=GetValue$h(config,"left",0),right=GetValue$h(config,"right",left));var y=GetValue$h(config,"y",null);null!==y?(top=y,bottom=y):(top=GetValue$h(config,"top",0),bottom=GetValue$h(config,"bottom",top))}else void 0===left&&(left=0),void 0===top&&(top=left),void 0===right&&(right=left),void 0===bottom&&(bottom=top);return this.padding.left=left,this.padding.top=top,this.padding.right=right,this.padding.bottom=bottom,this.updateText()},setMaxLines:function(max){return this.style.setMaxLines(max)},updateText:function(){var canvas=this.canvas,context=this.context,style=this.style,resolution=style.resolution,size=style.metrics;style.syncFont(canvas,context);var outputText=this._text;(style.wordWrapWidth||style.wordWrapCallback)&&(outputText=this.runWordWrap(this._text));var textWidth,lines=outputText.split(this.splitRegExp),textSize=GetTextSize(this,size,lines),padding=this.padding;0===style.fixedWidth?(this.width=textSize.width+padding.left+padding.right,textWidth=textSize.width):(this.width=style.fixedWidth,(textWidth=this.width-padding.left-padding.right)<textSize.width&&(textWidth=textSize.width)),0===style.fixedHeight?this.height=textSize.height+padding.top+padding.bottom:this.height=style.fixedHeight;var linePositionX,linePositionY,w=this.width,h=this.height;this.updateDisplayOrigin(),w*=resolution,h*=resolution,w=Math.max(w,1),h=Math.max(h,1),canvas.width!==w||canvas.height!==h?(canvas.width=w,canvas.height=h,this.frame.setSize(w,h),style.syncFont(canvas,context)):context.clearRect(0,0,w,h),context.save(),context.scale(resolution,resolution),style.backgroundColor&&(context.fillStyle=style.backgroundColor,context.fillRect(0,0,w,h)),style.syncStyle(canvas,context),context.textBaseline="alphabetic",context.translate(padding.left,padding.top);for(var i=0;i<textSize.lines;i++){if(linePositionX=style.strokeThickness/2,linePositionY=style.strokeThickness/2+i*textSize.lineHeight+size.ascent,i>0&&(linePositionY+=textSize.lineSpacing*i),style.rtl)linePositionX=w-linePositionX;else if("right"===style.align)linePositionX+=textWidth-textSize.lineWidths[i];else if("center"===style.align)linePositionX+=(textWidth-textSize.lineWidths[i])/2;else if("justify"===style.align){if(textSize.lineWidths[i]/textSize.width>=.85){var extraSpace=textSize.width-textSize.lineWidths[i],spaceSize=context.measureText(" ").width,trimmedLine=lines[i].trim(),array=trimmedLine.split(" ");extraSpace+=(lines[i].length-trimmedLine.length)*spaceSize;
233for(var extraSpaceCharacters=Math.floor(extraSpace/spaceSize),idx=0;extraSpaceCharacters>0;)array[idx]+=" ",idx=(idx+1)%(array.length-1||1),--extraSpaceCharacters;lines[i]=array.join(" ")}}this.autoRound&&(linePositionX=Math.round(linePositionX),linePositionY=Math.round(linePositionY)),style.strokeThickness&&(this.style.syncShadow(context,style.shadowStroke),context.strokeText(lines[i],linePositionX,linePositionY)),style.color&&(this.style.syncShadow(context,style.shadowFill),context.fillText(lines[i],linePositionX,linePositionY))}context.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(canvas,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var input=this.input;return input&&!input.customHitArea&&(input.hitArea.width=this.width,input.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(value){this.setText(value)}},toJSON:function(){var out=Components$f.ToJSON(this),data={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return out.data=data,out},preDestroy:function(){this.style.rtl&&RemoveFromDOM(this.canvas),CanvasPool$1.remove(this.canvas),this.texture.destroy()}}),Text_1=Text$2,Utils$c=Utils$p,TileSpriteWebGLRenderer_1=function(renderer,src,camera,parentMatrix){src.updateCanvas();var width=src.width,height=src.height;if(0!==width&&0!==height){camera.addToRenderList(src),renderer.pipelines.preBatch(src);var getTint=Utils$c.getTintAppendFloatAlpha,pipeline=renderer.pipelines.set(src.pipeline,src),textureUnit=pipeline.setTexture2D(src.fillPattern,src);pipeline.batchTexture(src,src.fillPattern,src.displayFrame.width*src.tileScaleX,src.displayFrame.height*src.tileScaleY,src.x,src.y,width,height,src.scaleX,src.scaleY,src.rotation,src.flipX,src.flipY,src.scrollFactorX,src.scrollFactorY,src.originX*width,src.originY*height,0,0,width,height,getTint(src.tintTopLeft,camera.alpha*src._alphaTL),getTint(src.tintTopRight,camera.alpha*src._alphaTR),getTint(src.tintBottomLeft,camera.alpha*src._alphaBL),getTint(src.tintBottomRight,camera.alpha*src._alphaBR),src.tintFill,src.tilePositionX%src.displayFrame.width/src.displayFrame.width,src.tilePositionY%src.displayFrame.height/src.displayFrame.height,camera,parentMatrix,!1,textureUnit),renderer.pipelines.postBatch(src)}},TileSpriteCanvasRenderer_1=function(renderer,src,camera,parentMatrix){src.updateCanvas(),camera.addToRenderList(src),renderer.batchSprite(src,src.frame,camera,parentMatrix)},CanvasPool=CanvasPool_1,GameEvents$2=events$k,GameObject$8=GameObject_1,GetPowerOfTwo=GetPowerOfTwo_1,Smoothing=Smoothing_1,Vector2$s=Vector2_1,TileSprite$2=new Class_1({Extends:GameObject$8,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.ComputedSize,components$3.Crop,components$3.Depth,components$3.Flip,components$3.GetBounds,components$3.Mask,components$3.Origin,components$3.Pipeline,components$3.ScrollFactor,components$3.Tint,components$3.Transform,components$3.Visible,{renderWebGL:TileSpriteWebGLRenderer_1,renderCanvas:TileSpriteCanvasRenderer_1}],initialize:function(scene,x,y,width,height,textureKey,frameKey){var renderer=scene.sys.renderer;GameObject$8.call(this,scene,"TileSprite");var displayTexture=scene.sys.textures.get(textureKey),displayFrame=displayTexture.get(frameKey);width&&height?(width=Math.floor(width),height=Math.floor(height)):(width=displayFrame.width,height=displayFrame.height),this._tilePosition=new Vector2$s,this._tileScale=new Vector2$s(1,1),this.dirty=!1,this.renderer=renderer,this.canvas=CanvasPool.create(this,width,height),this.context=this.canvas.getContext("2d"),this.displayTexture=displayTexture,this.displayFrame=displayFrame,this._crop=this.resetCropObject(),this.texture=scene.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=GetPowerOfTwo(displayFrame.width),this.potHeight=GetPowerOfTwo(displayFrame.height),this.fillCanvas=CanvasPool.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(x,y),this.setSize(width,height),this.setFrame
233(frameKey),this.setOriginFromFrame(),this.initPipeline(),scene.sys.game.events.on(GameEvents$2.CONTEXT_RESTORED,(function(renderer){if(renderer){var gl=renderer.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=renderer.createTexture2D(0,gl.LINEAR,gl.LINEAR,gl.REPEAT,gl.REPEAT,gl.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}}),this)},setTexture:function(key,frame){return this.displayTexture=this.scene.sys.textures.get(key),this.setFrame(frame)},setFrame:function(frame){var newFrame=this.displayTexture.get(frame);return this.potWidth=GetPowerOfTwo(newFrame.width),this.potHeight=GetPowerOfTwo(newFrame.height),this.canvas.width=0,newFrame.cutWidth&&newFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=newFrame,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(x,y){return void 0!==x&&(this.tilePositionX=x),void 0!==y&&(this.tilePositionY=y),this},setTileScale:function(x,y){return void 0===x&&(x=this.tileScaleX),void 0===y&&(y=x),this.tileScaleX=x,this.tileScaleY=y,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var frame=this.displayFrame;if(frame.source.isRenderTexture||frame.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var ctx=this.fillContext,canvas=this.fillCanvas,fw=this.potWidth,fh=this.potHeight;this.renderer&&this.renderer.gl||(fw=frame.cutWidth,fh=frame.cutHeight),ctx.clearRect(0,0,fw,fh),canvas.width=fw,canvas.height=fh,ctx.drawImage(frame.source.image,frame.cutX,frame.cutY,frame.cutWidth,frame.cutHeight,0,0,fw,fh),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(canvas,this.fillPattern):this.fillPattern=ctx.createPattern(canvas,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var canvas=this.canvas;if(canvas.width===this.width&&canvas.height===this.height||(canvas.width=this.width,canvas.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var ctx=this.context;this.scene.sys.game.config.antialias||Smoothing.disable(ctx);var scaleX=this._tileScale.x,scaleY=this._tileScale.y,positionX=this._tilePosition.x,positionY=this._tilePosition.y;ctx.clearRect(0,0,this.width,this.height),ctx.save(),ctx.scale(scaleX,scaleY),ctx.translate(-positionX,-positionY),ctx.fillStyle=this.fillPattern,ctx.fillRect(positionX,positionY,this.width/scaleX,this.height/scaleY),ctx.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),CanvasPool.remove(this.canvas),CanvasPool.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(value){this._tilePosition.x=value,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(value){this._tilePosition.y=value,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(value){this._tileScale.x=value,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(value){this._tileScale.y=value,this.dirty=!0}}}),TileSprite_1=TileSprite$2,VideoCanvasRenderer_1=function(renderer,src,camera,parentMatrix){src.videoTexture&&(camera.addToRenderList(src),renderer.batchSprite(src,src.frame,camera,parentMatrix))},Clamp$3=Clamp_1,Events$l=events$h,GameEvents$1=events$k,InputEvents$3=events$8,GameObject$7=GameObject_1,SoundEvents=events$6,UUID=UUID_1,MATH_CONST$9=_const$b,Video$2=new Class_1({Extends:GameObject$7,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.Depth,components$3.Flip,components$3.GetBounds,components$3.Mask,components$3.Origin,components$3.Pipeline,components$3.ScrollFactor,components$3.Size,components$3.TextureCrop,components$3.Tint,components$3.Transform,components$3.Visible,{renderWebGL:function(renderer,src,camera,parentMatrix){src.videoTexture&&(camera.addToRenderList(src),src.pipeline.batchSprite(src,camera,parentMatrix))},renderCanvas:VideoCanvasRenderer_1}],initialize:function(scene,x,y,key){GameObject$7.call(this,scene,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=UUID(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=MATH_CONST$9.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(x,y),this.initPipeline(),key&&this.changeSource(key,!1);var game=scene.sys.game.events;game.on(GameEvents$1.PAUSE,this.globalPause,this),game.on(GameEvents$1.RESUME,this.globalResume,this);var sound=scene.sys.sound;sound&&sound.on(SoundEvents.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(loop,markerIn,markerOut){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var video=this.video;
233if(!video)return console.warn("Video not loaded"),this;void 0===loop&&(loop=video.loop);var sound=this.scene.sys.sound;sound&&sound.mute&&this.setMute(!0),isNaN(markerIn)||(this._markerIn=markerIn),!isNaN(markerOut)&&markerOut>markerIn&&(this._markerOut=markerOut),video.loop=loop;var callbacks=this._callbacks,playPromise=video.play();return void 0!==playPromise?playPromise.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(video.addEventListener("playing",callbacks.play,!0),video.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),video.addEventListener("ended",callbacks.end,!0),video.addEventListener("timeupdate",callbacks.time,!0),video.addEventListener("seeking",callbacks.seeking,!0),video.addEventListener("seeked",callbacks.seeked,!0),this},changeSource:function(key,autoplay,loop,markerIn,markerOut){void 0===autoplay&&(autoplay=!0),this.video&&this.stop();var newVideo=this.scene.sys.cache.video.get(key);return newVideo?(this.video=newVideo,this._cacheKey=key,this._codePaused=newVideo.paused,this._codeMuted=newVideo.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,newVideo,newVideo.videoWidth,newVideo.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,newVideo.videoWidth,newVideo.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(Events$l.VIDEO_CREATED,this,newVideo.videoWidth,newVideo.videoHeight)):this.updateTexture(),newVideo.currentTime=0,this._lastUpdate=0,autoplay&&this.play(loop,markerIn,markerOut)):this.video=null,this},addMarker:function(key,markerIn,markerOut){return!isNaN(markerIn)&&markerIn>=0&&!isNaN(markerOut)&&(this.markers[key]=[markerIn,markerOut]),this},playMarker:function(key,loop){var marker=this.markers[key];return marker&&this.play(loop,marker[0],marker[1]),this},removeMarker:function(key){return delete this.markers[key],this},snapshot:function(width,height){return void 0===width&&(width=this.width),void 0===height&&(height=this.height),this.snapshotArea(0,0,this.width,this.height,width,height)},snapshotArea:function(x,y,srcWidth,srcHeight,destWidth,destHeight){void 0===x&&(x=0),void 0===y&&(y=0),void 0===srcWidth&&(srcWidth=this.width),void 0===srcHeight&&(srcHeight=this.height),void 0===destWidth&&(destWidth=srcWidth),void 0===destHeight&&(destHeight=srcHeight);var video=this.video,snap=this.snapshotTexture;return snap?(snap.setSize(destWidth,destHeight),video&&snap.context.drawImage(video,x,y,srcWidth,srcHeight,0,0,destWidth,destHeight)):(snap=this.scene.sys.textures.createCanvas(UUID(),destWidth,destHeight),this.snapshotTexture=snap,video&&snap.context.drawImage(video,x,y,srcWidth,srcHeight,0,0,destWidth,destHeight)),snap.update()},saveSnapshotTexture:function(key){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,key):this.snapshotTexture=this.scene.sys.textures.createCanvas(key,this.width,this.height),this.snapshotTexture},loadURL:function(url,loadEvent,noAudio){void 0===noAudio&&(noAudio=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var video=document.createElement("video");return video.controls=!1,noAudio&&(video.muted=!0,video.defaultMuted=!0,video.setAttribute("autoplay","autoplay")),video.setAttribute("playsinline","playsinline"),video.setAttribute("preload","auto"),video.addEventListener("error",this._callbacks.error,!0),video.src=url,video.load(),this.video=video,this},loadMediaStream:function(stream,loadEvent,noAudio){void 0===noAudio&&(noAudio=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var video=document.createElement("video");video.controls=!1,noAudio&&(video.muted=!0,video.defaultMuted=!0,video.setAttribute("autoplay","autoplay")),video.setAttribute("playsinline","playsinline"),video.setAttribute("preload","auto"),video.addEventListener("error",this._callbacks.error,!0);try{video.srcObject=stream}catch(error){video.src=window.URL.createObjectURL(stream)}return video.load(),this.video=video,this}
233,playPromiseSuccessHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(Events$l.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(error){this.scene.sys.input.once(InputEvents$3.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(Events$l.VIDEO_ERROR,this,error)},playHandler:function(){this._codePaused=!1,this.touchLocked=!1,this.emit(Events$l.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(event){this.stop(),this.emit(Events$l.VIDEO_ERROR,this,event)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(Events$l.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(Events$l.VIDEO_PLAY,this)},completeHandler:function(){this.emit(Events$l.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime<this._lastUpdate&&(this.emit(Events$l.VIDEO_LOOP,this),this._lastUpdate=0)},preUpdate:function(){var video=this.video;if(video){var currentTime=video.currentTime;currentTime!==this._lastUpdate&&(this._lastUpdate=currentTime,this.updateTexture(),currentTime>=this._markerOut&&(video.loop?(video.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=currentTime,this.emit(Events$l.VIDEO_LOOP,this)):(this.emit(Events$l.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(Events$l.VIDEO_TIMEOUT,this))},updateTexture:function(){var video=this.video,width=video.videoWidth,height=video.videoHeight;if(this.videoTexture){var textureSource=this.videoTextureSource;textureSource.source!==video&&(textureSource.source=video,textureSource.width=width,textureSource.height=height),textureSource.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,video,width,height),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,width,height),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(Events$l.VIDEO_CREATED,this,width,height)},getVideoKey:function(){return this._cacheKey},seekTo:function(value){var video=this.video;if(video){var duration=video.duration;if(duration!==1/0&&!isNaN(duration)){var seekTime=duration*value;this.setCurrentTime(seekTime)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(value){var video=this.video;if(video){if("string"==typeof value){var op=value[0],num=parseFloat(value.substr(1));"+"===op?value=video.currentTime+num:"-"===op&&(value=video.currentTime-num)}video.currentTime=value,this._lastUpdate=value}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(Events$l.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(Events$l.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var video=this.video;if(video){var now=video.currentTime,duration=video.duration;if(duration!==1/0&&!isNaN(duration))return now/duration}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(value){void 0===value&&(value=!0),this._codeMuted=value;var video=this.video;return video&&(video.muted=!!this._systemMuted||value),this},isMuted:function(){return this._codeMuted},globalMute:function(soundManager,value){this._systemMuted=value;var video=this.video;video&&(video.muted=!!this._codeMuted||value)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(value){void 0===value&&(value=!0);var video=this.video;return this._codePaused=value,video&&(value?video.paused||video.pause():value||video.paused&&!this._systemPaused&&video.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(value){return void 0===value&&(value=1),this.video&&(this.video.volume=Clamp$3(value,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(rate){return this.video&&(this.video.playbackRate=rate),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(value){return void 0===value&&(value=!0),this.video&&(this.video.loop=value),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(key,flipY){return void 0===flipY&&(flipY=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,key),this._key=key,this.flipY=flipY,this.videoTextureSource&&this.videoTextureSource.setFlipY(flipY),this.videoTexture},stop:function(){var video=this.video;
233if(video){var callbacks=this._callbacks;for(var callback in callbacks)video.removeEventListener(callback,callbacks[callback],!0);video.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(Events$l.VIDEO_STOP,this),this},removeVideoElement:function(){var video=this.video;if(video){for(video.parentNode&&video.parentNode.removeChild(video);video.hasChildNodes();)video.removeChild(video.firstChild);video.removeAttribute("autoplay"),video.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var game=this.scene.sys.game.events;game.off(GameEvents$1.PAUSE,this.globalPause,this),game.off(GameEvents$1.RESUME,this.globalResume,this);var sound=this.scene.sys.sound;sound&&sound.off(SoundEvents.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}}),Video_1=Video$2,GameObject$6=GameObject_1,Line$9=Line_1$1,Shape$b=new Class_1({Extends:GameObject$6,Mixins:[components$3.AlphaSingle,components$3.BlendMode,components$3.Depth,components$3.GetBounds,components$3.Mask,components$3.Origin,components$3.Pipeline,components$3.ScrollFactor,components$3.Transform,components$3.Visible],initialize:function(scene,type,data){void 0===type&&(type="Shape"),GameObject$6.call(this,scene,type),this.geom=data,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new Line$9,this.width=0,this.height=0,this.initPipeline()},setFillStyle:function(color,alpha){return void 0===alpha&&(alpha=1),void 0===color?this.isFilled=!1:(this.fillColor=color,this.fillAlpha=alpha,this.isFilled=!0),this},setStrokeStyle:function(lineWidth,color,alpha){return void 0===alpha&&(alpha=1),void 0===lineWidth?this.isStroked=!1:(this.lineWidth=lineWidth,this.strokeColor=color,this.strokeAlpha=alpha,this.isStroked=!0),this},setClosePath:function(value){return this.closePath=value,this},setSize:function(width,height){return this.width=width,this.height=height,this},setDisplaySize:function(width,height){return this.displayWidth=width,this.displayHeight=height,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(value){this.scaleX=value/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(value){this.scaleY=value/this.height}}}),Shape_1=Shape$b,Utils$b=Utils$p,FillPathWebGL_1=function(pipeline,calcMatrix,src,alpha,dx,dy){for(var fillTintColor=Utils$b.getTintAppendFloatAlpha(src.fillColor,src.fillAlpha*alpha),path=src.pathData,pathIndexes=src.pathIndexes,i=0;i<pathIndexes.length;i+=3){var p0=2*pathIndexes[i],p1=2*pathIndexes[i+1],p2=2*pathIndexes[i+2],x0=path[p0+0]-dx,y0=path[p0+1]-dy,x1=path[p1+0]-dx,y1=path[p1+1]-dy,x2=path[p2+0]-dx,y2=path[p2+1]-dy,tx0=calcMatrix.getX(x0,y0),ty0=calcMatrix.getY(x0,y0),tx1=calcMatrix.getX(x1,y1),ty1=calcMatrix.getY(x1,y1),tx2=calcMatrix.getX(x2,y2),ty2=calcMatrix.getY(x2,y2);pipeline.batchTri(src,tx0,ty0,tx1,ty1,tx2,ty2,0,0,1,1,fillTintColor,fillTintColor,fillTintColor,2)}},Utils$a=Utils$p,StrokePathWebGL_1=function(pipeline,src,alpha,dx,dy){var strokeTint=pipeline.strokeTint,strokeTintColor=Utils$a.getTintAppendFloatAlpha(src.strokeColor,src.strokeAlpha*alpha);strokeTint.TL=strokeTintColor,strokeTint.TR=strokeTintColor,strokeTint.BL=strokeTintColor,strokeTint.BR=strokeTintColor;var path=src.pathData,pathLength=path.length-1,lineWidth=src.lineWidth,halfLineWidth=lineWidth/2,px1=path[0]-dx,py1=path[1]-dy;src.closePath||(pathLength-=2);for(var i=2;i<pathLength;i+=2){var px2=path[i]-dx,py2=path[i+1]-dy;pipeline.batchLine(px1,py1,px2,py2,halfLineWidth,halfLineWidth,lineWidth,i-2,!!src.closePath&&i===pathLength-1),px1=px2,py1=py2}},GetCalcMatrix$e=GetCalcMatrix_1,FillPathWebGL$4=FillPathWebGL_1,StrokePathWebGL$6=StrokePathWebGL_1,ArcWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);
233var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$e(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;renderer.pipelines.preBatch(src),src.isFilled&&FillPathWebGL$4(pipeline,calcMatrix,src,alpha,dx,dy),src.isStroked&&StrokePathWebGL$6(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas_1=function(ctx,src,altColor,altAlpha){var fillColor=altColor||src.fillColor,fillAlpha=altAlpha||src.fillAlpha,red=(16711680&fillColor)>>>16,green=(65280&fillColor)>>>8,blue=255&fillColor;ctx.fillStyle="rgba("+red+","+green+","+blue+","+fillAlpha+")"},LineStyleCanvas_1=function(ctx,src,altColor,altAlpha){var strokeColor=altColor||src.strokeColor,strokeAlpha=altAlpha||src.strokeAlpha,red=(16711680&strokeColor)>>>16,green=(65280&strokeColor)>>>8,blue=255&strokeColor;ctx.strokeStyle="rgba("+red+","+green+","+blue+","+strokeAlpha+")",ctx.lineWidth=src.lineWidth},DegToRad$5=DegToRad_1,FillStyleCanvas$9=FillStyleCanvas_1,LineStyleCanvas$8=LineStyleCanvas_1,SetTransform$a=SetTransform_1,ArcCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$a(renderer,ctx,src,camera,parentMatrix)){var radius=src.radius;ctx.beginPath(),ctx.arc(radius-src.originX*(2*radius),radius-src.originY*(2*radius),radius,DegToRad$5(src._startAngle),DegToRad$5(src._endAngle),src.anticlockwise),src.closePath&&ctx.closePath(),src.isFilled&&(FillStyleCanvas$9(ctx,src),ctx.fill()),src.isStroked&&(LineStyleCanvas$8(ctx,src),ctx.stroke()),ctx.restore()}},DegToRad$4=DegToRad_1,Earcut$4=Earcut$7,GeomCircle=Circle_1,MATH_CONST$8=_const$b,Shape$a=Shape_1,Arc$1=new Class_1({Extends:Shape$a,Mixins:[{renderWebGL:ArcWebGLRenderer_1,renderCanvas:ArcCanvasRenderer_1}],initialize:function(scene,x,y,radius,startAngle,endAngle,anticlockwise,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===radius&&(radius=128),void 0===startAngle&&(startAngle=0),void 0===endAngle&&(endAngle=360),void 0===anticlockwise&&(anticlockwise=!1),Shape$a.call(this,scene,"Arc",new GeomCircle(0,0,radius)),this._startAngle=startAngle,this._endAngle=endAngle,this._anticlockwise=anticlockwise,this._iterations=.01,this.setPosition(x,y);var diameter=2*this.geom.radius;this.setSize(diameter,diameter),void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(value){this._iterations=value,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(value){this.geom.radius=value;var diameter=2*value;this.setSize(diameter,diameter),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(value){this._startAngle=value,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(value){this._endAngle=value,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(value){this._anticlockwise=value,this.updateData()}},setRadius:function(value){return this.radius=value,this},setIterations:function(value){return void 0===value&&(value=.01),this.iterations=value,this},setStartAngle:function(angle,anticlockwise){return this._startAngle=angle,void 0!==anticlockwise&&(this._anticlockwise=anticlockwise),this.updateData()},setEndAngle:function(angle,anticlockwise){return this._endAngle=angle,void 0!==anticlockwise&&(this._anticlockwise=anticlockwise),this.updateData()},updateData:function(){var step=this._iterations,iteration=step,radius=this.geom.radius,startAngle=DegToRad$4(this._startAngle),endAngle=DegToRad$4(this._endAngle),x=radius,y=radius;endAngle-=startAngle,this._anticlockwise?endAngle<-MATH_CONST$8.PI2?endAngle=-MATH_CONST$8.PI2:endAngle>0&&(endAngle=endAngle%MATH_CONST$8.PI2-MATH_CONST$8.PI2):endAngle>MATH_CONST$8.PI2?endAngle=MATH_CONST$8.PI2:endAngle<0&&(endAngle=MATH_CONST$8.PI2+endAngle%MATH_CONST$8.PI2);for(var ta,path=[x+Math.cos(startAngle)*radius,y+Math.sin(startAngle)*radius];iteration<1;)ta=endAngle*iteration+startAngle,path.push(x+Math.cos(ta)*radius,y+Math.sin(ta)*radius),iteration+=step;return ta=endAngle+startAngle,path.push(x+Math.cos(ta)*radius,y+Math.sin(ta)*radius),path.push(x+Math.cos(startAngle)*radius,y+Math.sin(startAngle)*radius),this.pathIndexes=Earcut$4(path),this.pathData=path,this}}),Arc_1=Arc$1,FillPathWebGL$3=FillPathWebGL_1,GetCalcMatrix$d=GetCalcMatrix_1,StrokePathWebGL$5=StrokePathWebGL_1,CurveWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);
233var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$d(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),dx=src._displayOriginX+src._curveBounds.x,dy=src._displayOriginY+src._curveBounds.y,alpha=camera.alpha*src.alpha;renderer.pipelines.preBatch(src),src.isFilled&&FillPathWebGL$3(pipeline,calcMatrix,src,alpha,dx,dy),src.isStroked&&StrokePathWebGL$5(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas$8=FillStyleCanvas_1,LineStyleCanvas$7=LineStyleCanvas_1,SetTransform$9=SetTransform_1,CurveCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$9(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX+src._curveBounds.x,dy=src._displayOriginY+src._curveBounds.y,path=src.pathData,pathLength=path.length-1,px1=path[0]-dx,py1=path[1]-dy;ctx.beginPath(),ctx.moveTo(px1,py1),src.closePath||(pathLength-=2);for(var i=2;i<pathLength;i+=2){var px2=path[i]-dx,py2=path[i+1]-dy;ctx.lineTo(px2,py2)}src.closePath&&ctx.closePath(),src.isFilled&&(FillStyleCanvas$8(ctx,src),ctx.fill()),src.isStroked&&(LineStyleCanvas$7(ctx,src),ctx.stroke()),ctx.restore()}},Earcut$3=Earcut$7,Rectangle$h=Rectangle_1$1,Shape$9=Shape_1,Curve$1=new Class_1({Extends:Shape$9,Mixins:[{renderWebGL:CurveWebGLRenderer_1,renderCanvas:CurveCanvasRenderer_1}],initialize:function(scene,x,y,curve,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),Shape$9.call(this,scene,"Curve",curve),this._smoothness=32,this._curveBounds=new Rectangle$h,this.closePath=!1,this.setPosition(x,y),void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(value){this._smoothness=value,this.updateData()}},setSmoothness:function(value){return this._smoothness=value,this.updateData()},updateData:function(){var bounds=this._curveBounds,smoothness=this._smoothness;this.geom.getBounds(bounds,smoothness),this.setSize(bounds.width,bounds.height),this.updateDisplayOrigin();for(var path=[],points=this.geom.getPoints(smoothness),i=0;i<points.length;i++)path.push(points[i].x,points[i].y);return path.push(points[0].x,points[0].y),this.pathIndexes=Earcut$3(path),this.pathData=path,this}}),Curve_1=Curve$1,FillPathWebGL$2=FillPathWebGL_1,GetCalcMatrix$c=GetCalcMatrix_1,StrokePathWebGL$4=StrokePathWebGL_1,EllipseWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$c(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;renderer.pipelines.preBatch(src),src.isFilled&&FillPathWebGL$2(pipeline,calcMatrix,src,alpha,dx,dy),src.isStroked&&StrokePathWebGL$4(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas$7=FillStyleCanvas_1,LineStyleCanvas$6=LineStyleCanvas_1,SetTransform$8=SetTransform_1,EllipseCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$8(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX,dy=src._displayOriginY,path=src.pathData,pathLength=path.length-1,px1=path[0]-dx,py1=path[1]-dy;ctx.beginPath(),ctx.moveTo(px1,py1),src.closePath||(pathLength-=2);for(var i=2;i<pathLength;i+=2){var px2=path[i]-dx,py2=path[i+1]-dy;ctx.lineTo(px2,py2)}ctx.closePath(),src.isFilled&&(FillStyleCanvas$7(ctx,src),ctx.fill()),src.isStroked&&(LineStyleCanvas$6(ctx,src),ctx.stroke()),ctx.restore()}},Earcut$2=Earcut$7,GeomEllipse=Ellipse_1$1,Shape$8=Shape_1,Ellipse$4=new Class_1({Extends:Shape$8,Mixins:[{renderWebGL:EllipseWebGLRenderer_1,renderCanvas:EllipseCanvasRenderer_1}],initialize:function(scene,x,y,width,height,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=128),void 0===height&&(height=128),Shape$8.call(this,scene,"Ellipse",new GeomEllipse(width/2,height/2,width,height)),this._smoothness=64,this.setPosition(x,y),this.width=width,this.height=height,void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(value){this._smoothness=value,this.updateData()}},setSize:function(width,height){return this.width=width,this.height=height,this.geom.setPosition(width/2,height/2),this.geom.setSize(width,height),this.updateData()},setSmoothness:function(value){return this._smoothness=value,this.updateData()},updateData:function(){for(var path=[],points=this.geom.getPoints(this._smoothness),i=0;i<points.length;i++)path.push(points[i].x,points[i].y);return path.push(points[0].x,points[0].y),this.pathIndexes=Earcut$2(path),this.pathData=path,this}}),Ellipse_1=Ellipse$4,GetCalcMatrix$b=GetCalcMatrix_1,Utils$9=Utils$p,GridWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);
233var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$b(src,camera,parentMatrix);pipeline.calcMatrix.copyFrom(result.calc).translate(-src._displayOriginX,-src._displayOriginY);var fillTint,fillTintColor,alpha=camera.alpha*src.alpha,width=src.width,height=src.height,cellWidth=src.cellWidth,cellHeight=src.cellHeight,gridWidth=Math.ceil(width/cellWidth),gridHeight=Math.ceil(height/cellHeight),cellWidthA=cellWidth,cellHeightA=cellHeight,cellWidthB=cellWidth-(gridWidth*cellWidth-width),cellHeightB=cellHeight-(gridHeight*cellHeight-height),showCells=src.showCells,showAltCells=src.showAltCells,showOutline=src.showOutline,x=0,y=0,r=0,cw=0,ch=0;if(showOutline&&(cellWidthA--,cellHeightA--,cellWidthB===cellWidth&&cellWidthB--,cellHeightB===cellHeight&&cellHeightB--),renderer.pipelines.preBatch(src),showCells&&src.fillAlpha>0)for(fillTint=pipeline.fillTint,fillTintColor=Utils$9.getTintAppendFloatAlpha(src.fillColor,src.fillAlpha*alpha),fillTint.TL=fillTintColor,fillTint.TR=fillTintColor,fillTint.BL=fillTintColor,fillTint.BR=fillTintColor,y=0;y<gridHeight;y++)for(showAltCells&&(r=y%2),x=0;x<gridWidth;x++)showAltCells&&r?r=0:(r++,cw=x<gridWidth-1?cellWidthA:cellWidthB,ch=y<gridHeight-1?cellHeightA:cellHeightB,pipeline.batchFillRect(x*cellWidth,y*cellHeight,cw,ch));if(showAltCells&&src.altFillAlpha>0)for(fillTint=pipeline.fillTint,fillTintColor=Utils$9.getTintAppendFloatAlpha(src.altFillColor,src.altFillAlpha*alpha),fillTint.TL=fillTintColor,fillTint.TR=fillTintColor,fillTint.BL=fillTintColor,fillTint.BR=fillTintColor,y=0;y<gridHeight;y++)for(showAltCells&&(r=y%2),x=0;x<gridWidth;x++)!showAltCells||r?(r=0,cw=x<gridWidth-1?cellWidthA:cellWidthB,ch=y<gridHeight-1?cellHeightA:cellHeightB,pipeline.batchFillRect(x*cellWidth,y*cellHeight,cw,ch)):r=1;if(showOutline&&src.outlineFillAlpha>0){var strokeTint=pipeline.strokeTint,color=Utils$9.getTintAppendFloatAlpha(src.outlineFillColor,src.outlineFillAlpha*alpha);for(strokeTint.TL=color,strokeTint.TR=color,strokeTint.BL=color,strokeTint.BR=color,x=1;x<gridWidth;x++){var x1=x*cellWidth;pipeline.batchLine(x1,0,x1,height,1,1,1,0,!1)}for(y=1;y<gridHeight;y++){var y1=y*cellHeight;pipeline.batchLine(0,y1,width,y1,1,1,1,0,!1)}}renderer.pipelines.postBatch(src)},FillStyleCanvas$6=FillStyleCanvas_1,LineStyleCanvas$5=LineStyleCanvas_1,SetTransform$7=SetTransform_1,GridCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$7(renderer,ctx,src,camera,parentMatrix)){var dx=-src._displayOriginX,dy=-src._displayOriginY,alpha=camera.alpha*src.alpha,width=src.width,height=src.height,cellWidth=src.cellWidth,cellHeight=src.cellHeight,gridWidth=Math.ceil(width/cellWidth),gridHeight=Math.ceil(height/cellHeight),cellWidthA=cellWidth,cellHeightA=cellHeight,cellWidthB=cellWidth-(gridWidth*cellWidth-width),cellHeightB=cellHeight-(gridHeight*cellHeight-height),showCells=src.showCells,showAltCells=src.showAltCells,showOutline=src.showOutline,x=0,y=0,r=0,cw=0,ch=0;if(showOutline&&(cellWidthA--,cellHeightA--,cellWidthB===cellWidth&&cellWidthB--,cellHeightB===cellHeight&&cellHeightB--),showCells&&src.fillAlpha>0)for(FillStyleCanvas$6(ctx,src),y=0;y<gridHeight;y++)for(showAltCells&&(r=y%2),x=0;x<gridWidth;x++)showAltCells&&r?r=0:(r++,cw=x<gridWidth-1?cellWidthA:cellWidthB,ch=y<gridHeight-1?cellHeightA:cellHeightB,ctx.fillRect(dx+x*cellWidth,dy+y*cellHeight,cw,ch));if(showAltCells&&src.altFillAlpha>0)for(FillStyleCanvas$6(ctx,src,src.altFillColor,src.altFillAlpha*alpha),y=0;y<gridHeight;y++)for(showAltCells&&(r=y%2),x=0;x<gridWidth;x++)!showAltCells||r?(r=0,cw=x<gridWidth-1?cellWidthA:cellWidthB,ch=y<gridHeight-1?cellHeightA:cellHeightB,ctx.fillRect(dx+x*cellWidth,dy+y*cellHeight,cw,ch)):r=1;if(showOutline&&src.outlineFillAlpha>0){for(LineStyleCanvas$5(ctx,src,src.outlineFillColor,src.outlineFillAlpha*alpha),x=1;x<gridWidth;x++){var x1=x*cellWidth;ctx.beginPath(),ctx.moveTo(x1+dx,dy),ctx.lineTo(x1+dx,height+dy),ctx.stroke()}for(y=1;y<gridHeight;y++){var y1=y*cellHeight;ctx.beginPath(),ctx.moveTo(dx,y1+dy),ctx.lineTo(dx+width,y1+dy),ctx.stroke()}}
233ctx.restore()}},Shape$7=Shape_1,Grid$4=new Class_1({Extends:Shape$7,Mixins:[{renderWebGL:GridWebGLRenderer_1,renderCanvas:GridCanvasRenderer_1}],initialize:function(scene,x,y,width,height,cellWidth,cellHeight,fillColor,fillAlpha,outlineFillColor,outlineFillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=128),void 0===height&&(height=128),void 0===cellWidth&&(cellWidth=32),void 0===cellHeight&&(cellHeight=32),Shape$7.call(this,scene,"Grid",null),this.cellWidth=cellWidth,this.cellHeight=cellHeight,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(x,y),this.setSize(width,height),this.setFillStyle(fillColor,fillAlpha),void 0!==outlineFillColor&&this.setOutlineStyle(outlineFillColor,outlineFillAlpha),this.updateDisplayOrigin()},setFillStyle:function(fillColor,fillAlpha){return void 0===fillAlpha&&(fillAlpha=1),void 0===fillColor?this.showCells=!1:(this.fillColor=fillColor,this.fillAlpha=fillAlpha,this.showCells=!0),this},setAltFillStyle:function(fillColor,fillAlpha){return void 0===fillAlpha&&(fillAlpha=1),void 0===fillColor?this.showAltCells=!1:(this.altFillColor=fillColor,this.altFillAlpha=fillAlpha,this.showAltCells=!0),this},setOutlineStyle:function(fillColor,fillAlpha){return void 0===fillAlpha&&(fillAlpha=1),void 0===fillColor?this.showOutline=!1:(this.outlineFillColor=fillColor,this.outlineFillAlpha=fillAlpha,this.showOutline=!0),this}}),Grid_1$1=Grid$4,GetCalcMatrix$a=GetCalcMatrix_1,Utils$8=Utils$p,IsoBoxWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var tint,x0,y0,x1,y1,x2,y2,x3,y3,pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$a(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),size=src.width,height=src.height,sizeA=size/2,sizeB=size/src.projection,alpha=camera.alpha*src.alpha;src.isFilled&&(renderer.pipelines.preBatch(src),src.showTop&&(tint=Utils$8.getTintAppendFloatAlpha(src.fillTop,alpha),x0=calcMatrix.getX(-sizeA,-height),y0=calcMatrix.getY(-sizeA,-height),x1=calcMatrix.getX(0,-sizeB-height),y1=calcMatrix.getY(0,-sizeB-height),x2=calcMatrix.getX(sizeA,-height),y2=calcMatrix.getY(sizeA,-height),x3=calcMatrix.getX(0,sizeB-height),y3=calcMatrix.getY(0,sizeB-height),pipeline.batchQuad(src,x0,y0,x1,y1,x2,y2,x3,y3,0,0,1,1,tint,tint,tint,tint,2)),src.showLeft&&(tint=Utils$8.getTintAppendFloatAlpha(src.fillLeft,alpha),x0=calcMatrix.getX(-sizeA,0),y0=calcMatrix.getY(-sizeA,0),x1=calcMatrix.getX(0,sizeB),y1=calcMatrix.getY(0,sizeB),x2=calcMatrix.getX(0,sizeB-height),y2=calcMatrix.getY(0,sizeB-height),x3=calcMatrix.getX(-sizeA,-height),y3=calcMatrix.getY(-sizeA,-height),pipeline.batchQuad(src,x0,y0,x1,y1,x2,y2,x3,y3,0,0,1,1,tint,tint,tint,tint,2)),src.showRight&&(tint=Utils$8.getTintAppendFloatAlpha(src.fillRight,alpha),x0=calcMatrix.getX(sizeA,0),y0=calcMatrix.getY(sizeA,0),x1=calcMatrix.getX(0,sizeB),y1=calcMatrix.getY(0,sizeB),x2=calcMatrix.getX(0,sizeB-height),y2=calcMatrix.getY(0,sizeB-height),x3=calcMatrix.getX(sizeA,-height),y3=calcMatrix.getY(sizeA,-height),pipeline.batchQuad(src,x0,y0,x1,y1,x2,y2,x3,y3,0,0,1,1,tint,tint,tint,tint,2)),renderer.pipelines.postBatch(src))},FillStyleCanvas$5=FillStyleCanvas_1,SetTransform$6=SetTransform_1,IsoBoxCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$6(renderer,ctx,src,camera,parentMatrix)&&src.isFilled){var size=src.width,height=src.height,sizeA=size/2,sizeB=size/src.projection;src.showTop&&(FillStyleCanvas$5(ctx,src,src.fillTop),ctx.beginPath(),ctx.moveTo(-sizeA,-height),ctx.lineTo(0,-sizeB-height),ctx.lineTo(sizeA,-height),ctx.lineTo(sizeA,-1),ctx.lineTo(0,sizeB-1),ctx.lineTo(-sizeA,-1),ctx.lineTo(-sizeA,-height),ctx.fill()),src.showLeft&&(FillStyleCanvas$5(ctx,src,src.fillLeft),ctx.beginPath(),ctx.moveTo(-sizeA,0),ctx.lineTo(0,sizeB),ctx.lineTo(0,sizeB-height),ctx.lineTo(-sizeA,-height),ctx.lineTo(-sizeA,0),ctx.fill()),src.showRight&&(FillStyleCanvas$5(ctx,src,src.fillRight),ctx.beginPath(),ctx.moveTo(sizeA,0),ctx.lineTo(0,sizeB),ctx.lineTo(0,sizeB-height),ctx.lineTo(sizeA,-height),ctx.lineTo(sizeA,0),ctx.fill()),ctx.restore(
233)}},Shape$6=Shape_1,IsoBox$1=new Class_1({Extends:Shape$6,Mixins:[{renderWebGL:IsoBoxWebGLRenderer_1,renderCanvas:IsoBoxCanvasRenderer_1}],initialize:function(scene,x,y,size,height,fillTop,fillLeft,fillRight){void 0===x&&(x=0),void 0===y&&(y=0),void 0===size&&(size=48),void 0===height&&(height=32),void 0===fillTop&&(fillTop=15658734),void 0===fillLeft&&(fillLeft=10066329),void 0===fillRight&&(fillRight=13421772),Shape$6.call(this,scene,"IsoBox",null),this.projection=4,this.fillTop=fillTop,this.fillLeft=fillLeft,this.fillRight=fillRight,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(x,y),this.setSize(size,height),this.updateDisplayOrigin()},setProjection:function(value){return this.projection=value,this},setFaces:function(showTop,showLeft,showRight){return void 0===showTop&&(showTop=!0),void 0===showLeft&&(showLeft=!0),void 0===showRight&&(showRight=!0),this.showTop=showTop,this.showLeft=showLeft,this.showRight=showRight,this},setFillStyle:function(fillTop,fillLeft,fillRight){return this.fillTop=fillTop,this.fillLeft=fillLeft,this.fillRight=fillRight,this.isFilled=!0,this}}),IsoBox_1=IsoBox$1,GetCalcMatrix$9=GetCalcMatrix_1,Utils$7=Utils$p,IsoTriangleWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$9(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),size=src.width,height=src.height,sizeA=size/2,sizeB=size/src.projection,reversed=src.isReversed,alpha=camera.alpha*src.alpha;if(src.isFilled){var tint,x0,y0,x1,y1,x2,y2;if(renderer.pipelines.preBatch(src),src.showTop&&reversed){tint=Utils$7.getTintAppendFloatAlpha(src.fillTop,alpha),x0=calcMatrix.getX(-sizeA,-height),y0=calcMatrix.getY(-sizeA,-height),x1=calcMatrix.getX(0,-sizeB-height),y1=calcMatrix.getY(0,-sizeB-height),x2=calcMatrix.getX(sizeA,-height),y2=calcMatrix.getY(sizeA,-height);var x3=calcMatrix.getX(0,sizeB-height),y3=calcMatrix.getY(0,sizeB-height);pipeline.batchQuad(src,x0,y0,x1,y1,x2,y2,x3,y3,0,0,1,1,tint,tint,tint,tint,2)}src.showLeft&&(tint=Utils$7.getTintAppendFloatAlpha(src.fillLeft,alpha),reversed?(x0=calcMatrix.getX(-sizeA,-height),y0=calcMatrix.getY(-sizeA,-height),x1=calcMatrix.getX(0,sizeB),y1=calcMatrix.getY(0,sizeB),x2=calcMatrix.getX(0,sizeB-height),y2=calcMatrix.getY(0,sizeB-height)):(x0=calcMatrix.getX(-sizeA,0),y0=calcMatrix.getY(-sizeA,0),x1=calcMatrix.getX(0,sizeB),y1=calcMatrix.getY(0,sizeB),x2=calcMatrix.getX(0,sizeB-height),y2=calcMatrix.getY(0,sizeB-height)),pipeline.batchTri(src,x0,y0,x1,y1,x2,y2,0,0,1,1,tint,tint,tint,2)),src.showRight&&(tint=Utils$7.getTintAppendFloatAlpha(src.fillRight,alpha),reversed?(x0=calcMatrix.getX(sizeA,-height),y0=calcMatrix.getY(sizeA,-height),x1=calcMatrix.getX(0,sizeB),y1=calcMatrix.getY(0,sizeB),x2=calcMatrix.getX(0,sizeB-height),y2=calcMatrix.getY(0,sizeB-height)):(x0=calcMatrix.getX(sizeA,0),y0=calcMatrix.getY(sizeA,0),x1=calcMatrix.getX(0,sizeB),y1=calcMatrix.getY(0,sizeB),x2=calcMatrix.getX(0,sizeB-height),y2=calcMatrix.getY(0,sizeB-height)),pipeline.batchTri(src,x0,y0,x1,y1,x2,y2,0,0,1,1,tint,tint,tint,2)),renderer.pipelines.postBatch(src)}},FillStyleCanvas$4=FillStyleCanvas_1,SetTransform$5=SetTransform_1,IsoTriangleCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$5(renderer,ctx,src,camera,parentMatrix)&&src.isFilled){var size=src.width,height=src.height,sizeA=size/2,sizeB=size/src.projection,reversed=src.isReversed;src.showTop&&reversed&&(FillStyleCanvas$4(ctx,src,src.fillTop),ctx.beginPath(),ctx.moveTo(-sizeA,-height),ctx.lineTo(0,-sizeB-height),ctx.lineTo(sizeA,-height),ctx.lineTo(0,sizeB-height),ctx.fill()),src.showLeft&&(FillStyleCanvas$4(ctx,src,src.fillLeft),ctx.beginPath(),reversed?(ctx.moveTo(-sizeA,-height),ctx.lineTo(0,sizeB),ctx.lineTo(0,sizeB-height)):(ctx.moveTo(-sizeA,0),ctx.lineTo(0,sizeB),ctx.lineTo(0,sizeB-height)),ctx.fill()),src.showRight&&(FillStyleCanvas$4(ctx,src,src.fillRight),ctx.beginPath(),reversed?(ctx.moveTo(sizeA,-height),ctx.lineTo(0,sizeB),ctx.lineTo(0,sizeB-height)):(ctx.moveTo(sizeA,0),ctx.lineTo(0,sizeB),ctx.lineTo(0,sizeB-height)),ctx.fill()),ctx.restore(
233)}},Shape$5=Shape_1,IsoTriangle$1=new Class_1({Extends:Shape$5,Mixins:[{renderWebGL:IsoTriangleWebGLRenderer_1,renderCanvas:IsoTriangleCanvasRenderer_1}],initialize:function(scene,x,y,size,height,reversed,fillTop,fillLeft,fillRight){void 0===x&&(x=0),void 0===y&&(y=0),void 0===size&&(size=48),void 0===height&&(height=32),void 0===reversed&&(reversed=!1),void 0===fillTop&&(fillTop=15658734),void 0===fillLeft&&(fillLeft=10066329),void 0===fillRight&&(fillRight=13421772),Shape$5.call(this,scene,"IsoTriangle",null),this.projection=4,this.fillTop=fillTop,this.fillLeft=fillLeft,this.fillRight=fillRight,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=reversed,this.isFilled=!0,this.setPosition(x,y),this.setSize(size,height),this.updateDisplayOrigin()},setProjection:function(value){return this.projection=value,this},setReversed:function(reversed){return this.isReversed=reversed,this},setFaces:function(showTop,showLeft,showRight){return void 0===showTop&&(showTop=!0),void 0===showLeft&&(showLeft=!0),void 0===showRight&&(showRight=!0),this.showTop=showTop,this.showLeft=showLeft,this.showRight=showRight,this},setFillStyle:function(fillTop,fillLeft,fillRight){return this.fillTop=fillTop,this.fillLeft=fillLeft,this.fillRight=fillRight,this.isFilled=!0,this}}),IsoTriangle_1=IsoTriangle$1,GetCalcMatrix$8=GetCalcMatrix_1,Utils$6=Utils$p,LineWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$8(src,camera,parentMatrix);pipeline.calcMatrix.copyFrom(result.calc);var dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;if(renderer.pipelines.preBatch(src),src.isStroked){var strokeTint=pipeline.strokeTint,color=Utils$6.getTintAppendFloatAlpha(src.strokeColor,src.strokeAlpha*alpha);strokeTint.TL=color,strokeTint.TR=color,strokeTint.BL=color,strokeTint.BR=color;var startWidth=src._startWidth,endWidth=src._endWidth;pipeline.batchLine(src.geom.x1-dx,src.geom.y1-dy,src.geom.x2-dx,src.geom.y2-dy,startWidth,endWidth,1,0,!1,result.sprite,result.camera)}renderer.pipelines.postBatch(src)},LineStyleCanvas$4=LineStyleCanvas_1,SetTransform$4=SetTransform_1,LineCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$4(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX,dy=src._displayOriginY;src.isStroked&&(LineStyleCanvas$4(ctx,src),ctx.beginPath(),ctx.moveTo(src.geom.x1-dx,src.geom.y1-dy),ctx.lineTo(src.geom.x2-dx,src.geom.y2-dy),ctx.stroke()),ctx.restore()}},Shape$4=Shape_1,GeomLine=Line_1$1,Line$8=new Class_1({Extends:Shape$4,Mixins:[{renderWebGL:LineWebGLRenderer_1,renderCanvas:LineCanvasRenderer_1}],initialize:function(scene,x,y,x1,y1,x2,y2,strokeColor,strokeAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===x1&&(x1=0),void 0===y1&&(y1=0),void 0===x2&&(x2=128),void 0===y2&&(y2=0),Shape$4.call(this,scene,"Line",new GeomLine(x1,y1,x2,y2));var width=Math.max(1,this.geom.right-this.geom.left),height=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(x,y),this.setSize(width,height),void 0!==strokeColor&&this.setStrokeStyle(1,strokeColor,strokeAlpha),this.updateDisplayOrigin()},setLineWidth:function(startWidth,endWidth){return void 0===endWidth&&(endWidth=startWidth),this._startWidth=startWidth,this._endWidth=endWidth,this.lineWidth=startWidth,this},setTo:function(x1,y1,x2,y2){return this.geom.setTo(x1,y1,x2,y2),this}}
233),Line_1=Line$8,FillPathWebGL$1=FillPathWebGL_1,GetCalcMatrix$7=GetCalcMatrix_1,StrokePathWebGL$3=StrokePathWebGL_1,PolygonWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$7(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;renderer.pipelines.preBatch(src),src.isFilled&&FillPathWebGL$1(pipeline,calcMatrix,src,alpha,dx,dy),src.isStroked&&StrokePathWebGL$3(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas$3=FillStyleCanvas_1,LineStyleCanvas$3=LineStyleCanvas_1,SetTransform$3=SetTransform_1,PolygonCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$3(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX,dy=src._displayOriginY,path=src.pathData,pathLength=path.length-1,px1=path[0]-dx,py1=path[1]-dy;ctx.beginPath(),ctx.moveTo(px1,py1),src.closePath||(pathLength-=2);for(var i=2;i<pathLength;i+=2){var px2=path[i]-dx,py2=path[i+1]-dy;ctx.lineTo(px2,py2)}ctx.closePath(),src.isFilled&&(FillStyleCanvas$3(ctx,src),ctx.fill()),src.isStroked&&(LineStyleCanvas$3(ctx,src),ctx.stroke()),ctx.restore()}},PolygonRender$1={renderWebGL:PolygonWebGLRenderer_1,renderCanvas:PolygonCanvasRenderer_1},Rectangle$g=Rectangle_1$1,GetAABB_1=function(polygon,out){void 0===out&&(out=new Rectangle$g);for(var p,minX=1/0,minY=1/0,maxX=-minX,maxY=-minY,i=0;i<polygon.points.length;i++)p=polygon.points[i],minX=Math.min(minX,p.x),minY=Math.min(minY,p.y),maxX=Math.max(maxX,p.x),maxY=Math.max(maxY,p.y);return out.x=minX,out.y=minY,out.width=maxX-minX,out.height=maxY-minY,out},Contains_1$1=function(polygon,x,y){for(var inside=!1,i=-1,j=polygon.points.length-1;++i<polygon.points.length;j=i){var ix=polygon.points[i].x,iy=polygon.points[i].y,jx=polygon.points[j].x,jy=polygon.points[j].y;(iy<=y&&y<jy||jy<=y&&y<iy)&&x<(jx-ix)*(y-iy)/(jy-iy)+ix&&(inside=!inside)}return inside},Length$5=Length_1,Line$7=Line_1$1,Perimeter_1$1=function(polygon){for(var points=polygon.points,perimeter=0,i=0;i<points.length;i++){var pointA=points[i],pointB=points[(i+1)%points.length],line=new Line$7(pointA.x,pointA.y,pointB.x,pointB.y);perimeter+=Length$5(line)}return perimeter},Length$4=Length_1,Line$6=Line_1$1,Perimeter$1=Perimeter_1$1,GetPoints_1$1=function(polygon,quantity,stepRate,out){void 0===out&&(out=[]);var points=polygon.points,perimeter=Perimeter$1(polygon);!quantity&&stepRate>0&&(quantity=perimeter/stepRate);for(var i=0;i<quantity;i++)for(var position=perimeter*(i/quantity),accumulatedPerimeter=0,j=0;j<points.length;j++){var pointA=points[j],pointB=points[(j+1)%points.length],line=new Line$6(pointA.x,pointA.y,pointB.x,pointB.y),length=Length$4(line);if(!(position<accumulatedPerimeter||position>accumulatedPerimeter+length)){var point=line.getPoint((position-accumulatedPerimeter)/length);out.push(point);break}accumulatedPerimeter+=length}return out},Contains$c=Contains_1$1,GetPoints$2=GetPoints_1$1,GEOM_CONST$2=_const$c,Polygon$4=new Class_1({initialize:function(points){this.type=GEOM_CONST$2.POLYGON,this.area=0,this.points=[],points&&this.setTo(points)},contains:function(x,y){return Contains$c(this,x,y)},setTo:function(points){if(this.area=0,this.points=[],"string"==typeof points&&(points=points.split(" ")),!Array.isArray(points))return this;for(var p,y0=Number.MAX_VALUE,i=0;i<points.length;i++)p={x:0,y:0},"number"==typeof points[i]||"string"==typeof points[i]?(p.x=parseFloat(points[i]),p.y=parseFloat(points[i+1]),i++):Array.isArray(points[i])?(p.x=points[i][0],p.y=points[i][1]):(p.x=points[i].x,p.y=points[i].y),this.points.push(p),p.y<y0&&(y0=p.y);return this.calculateArea(y0),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var p1,p2,sum=0,i=0;i<this.points.length-1;i++)p1=this.points[i],sum+=((p2=this.points[i+1]).x-p1.x)*(p1.y+p2.y);return p1=this.points[0],p2=this.points[this.points.length-1],sum+=(p1.x-p2.x)*(p2.y+p1.y),this.area=.5*-sum,this.area},getPoints:function(quantity,step,output){return GetPoints$2(this,quantity,step,output)}}),Polygon_1$1=Polygon$4,copy=function(out,a){return out[0]=a[0],out[1]=a[1],out},Smooth_1=function(polygon){var i,points=[],data=polygon.points;for(i=0;i<data.length;i++)points.push([data[i].x,data[i].y]);var output=[];for(points.length>0&&output.push(copy([0,0],points[0])),i=0;i<points.length-1;i++){var p0=points[i],p1=points[i+1],p0x=p0[0],p0y=p0[1],p1x=p1[0],p1y=
233p1[1];output.push([.85*p0x+.15*p1x,.85*p0y+.15*p1y]),output.push([.15*p0x+.85*p1x,.15*p0y+.85*p1y])}return points.length>1&&output.push(copy([0,0],points[points.length-1])),polygon.setTo(output)},Earcut$1=Earcut$7,GetAABB=GetAABB_1,GeomPolygon=Polygon_1$1,Shape$3=Shape_1,Smooth=Smooth_1,Polygon$3=new Class_1({Extends:Shape$3,Mixins:[PolygonRender$1],initialize:function(scene,x,y,points,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),Shape$3.call(this,scene,"Polygon",new GeomPolygon(points));var bounds=GetAABB(this.geom);this.setPosition(x,y),this.setSize(bounds.width,bounds.height),void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateDisplayOrigin(),this.updateData()},smooth:function(iterations){void 0===iterations&&(iterations=1);for(var i=0;i<iterations;i++)Smooth(this.geom);return this.updateData()},updateData:function(){for(var path=[],points=this.geom.points,i=0;i<points.length;i++)path.push(points[i].x,points[i].y);return path.push(points[0].x,points[0].y),this.pathIndexes=Earcut$1(path),this.pathData=path,this}}),Polygon_1=Polygon$3,GetCalcMatrix$6=GetCalcMatrix_1,StrokePathWebGL$2=StrokePathWebGL_1,Utils$5=Utils$p,RectangleWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$6(src,camera,parentMatrix);pipeline.calcMatrix.copyFrom(result.calc);var dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;if(renderer.pipelines.preBatch(src),src.isFilled){var fillTint=pipeline.fillTint,fillTintColor=Utils$5.getTintAppendFloatAlpha(src.fillColor,src.fillAlpha*alpha);fillTint.TL=fillTintColor,fillTint.TR=fillTintColor,fillTint.BL=fillTintColor,fillTint.BR=fillTintColor,pipeline.batchFillRect(-dx,-dy,src.width,src.height)}src.isStroked&&StrokePathWebGL$2(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas$2=FillStyleCanvas_1,LineStyleCanvas$2=LineStyleCanvas_1,SetTransform$2=SetTransform_1,RectangleCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$2(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX,dy=src._displayOriginY;src.isFilled&&(FillStyleCanvas$2(ctx,src),ctx.fillRect(-dx,-dy,src.width,src.height)),src.isStroked&&(LineStyleCanvas$2(ctx,src),ctx.beginPath(),ctx.rect(-dx,-dy,src.width,src.height),ctx.stroke()),ctx.restore()}},GeomRectangle=Rectangle_1$1,Shape$2=Shape_1,Rectangle$f=new Class_1({Extends:Shape$2,Mixins:[{renderWebGL:RectangleWebGLRenderer_1,renderCanvas:RectangleCanvasRenderer_1}],initialize:function(scene,x,y,width,height,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=128),void 0===height&&(height=128),Shape$2.call(this,scene,"Rectangle",new GeomRectangle(0,0,width,height)),this.setPosition(x,y),this.setSize(width,height),void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateDisplayOrigin(),this.updateData()},setSize:function(width,height){return this.width=width,this.height=height,this.geom.setSize(width,height),this.updateData(),this},updateData:function(){var path=[],rect=this.geom,line=this._tempLine;return rect.getLineA(line),path.push(line.x1,line.y1,line.x2,line.y2),rect.getLineB(line),path.push(line.x2,line.y2),rect.getLineC(line),path.push(line.x2,line.y2),rect.getLineD(line),path.push(line.x2,line.y2),this.pathData=path,this}}),Rectangle_1=Rectangle$f,FillPathWebGL=FillPathWebGL_1,GetCalcMatrix$5=GetCalcMatrix_1,StrokePathWebGL$1=StrokePathWebGL_1,StarWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$5(src,camera,parentMatrix),calcMatrix=pipeline.calcMatrix.copyFrom(result.calc),dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;renderer.pipelines.preBatch(src),src.isFilled&&FillPathWebGL(pipeline,calcMatrix,src,alpha,dx,dy),src.isStroked&&StrokePathWebGL$1(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas$1=FillStyleCanvas_1,LineStyleCanvas$1=LineStyleCanvas_1,SetTransform$1=SetTransform_1,StarCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform$1(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX,dy=src._displayOriginY,path=src.pathData,pathLength=path.length-1,px1=path[0]-dx,py1=path[1]-dy;
vendor: 6,013 bytes, line 233
233ctx.beginPath(),ctx.moveTo(px1,py1),src.closePath||(pathLength-=2);for(var i=2;i<pathLength;i+=2){var px2=path[i]-dx,py2=path[i+1]-dy;ctx.lineTo(px2,py2)}ctx.closePath(),src.isFilled&&(FillStyleCanvas$1(ctx,src),ctx.fill()),src.isStroked&&(LineStyleCanvas$1(ctx,src),ctx.stroke()),ctx.restore()}},Earcut=Earcut$7,Shape$1=Shape_1,Star$1=new Class_1({Extends:Shape$1,Mixins:[{renderWebGL:StarWebGLRenderer_1,renderCanvas:StarCanvasRenderer_1}],initialize:function(scene,x,y,points,innerRadius,outerRadius,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===points&&(points=5),void 0===innerRadius&&(innerRadius=32),void 0===outerRadius&&(outerRadius=64),Shape$1.call(this,scene,"Star",null),this._points=points,this._innerRadius=innerRadius,this._outerRadius=outerRadius,this.setPosition(x,y),this.setSize(2*outerRadius,2*outerRadius),void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateDisplayOrigin(),this.updateData()},setPoints:function(value){return this._points=value,this.updateData()},setInnerRadius:function(value){return this._innerRadius=value,this.updateData()},setOuterRadius:function(value){return this._outerRadius=value,this.updateData()},points:{get:function(){return this._points},set:function(value){this._points=value,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(value){this._innerRadius=value,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(value){this._outerRadius=value,this.updateData()}},updateData:function(){var path=[],points=this._points,innerRadius=this._innerRadius,outerRadius=this._outerRadius,rot=Math.PI/2*3,step=Math.PI/points,x=outerRadius,y=outerRadius;path.push(x,y+-outerRadius);for(var i=0;i<points;i++)path.push(x+Math.cos(rot)*outerRadius,y+Math.sin(rot)*outerRadius),rot+=step,path.push(x+Math.cos(rot)*innerRadius,y+Math.sin(rot)*innerRadius),rot+=step;return path.push(x,y+-outerRadius),this.pathIndexes=Earcut(path),this.pathData=path,this}}),Star_1=Star$1,Contains_1=function(triangle,x,y){var v0x=triangle.x3-triangle.x1,v0y=triangle.y3-triangle.y1,v1x=triangle.x2-triangle.x1,v1y=triangle.y2-triangle.y1,v2x=x-triangle.x1,v2y=y-triangle.y1,dot00=v0x*v0x+v0y*v0y,dot01=v0x*v1x+v0y*v1y,dot02=v0x*v2x+v0y*v2y,dot11=v1x*v1x+v1y*v1y,dot12=v1x*v2x+v1y*v2y,b=dot00*dot11-dot01*dot01,inv=0===b?0:1/b,u=(dot11*dot02-dot01*dot12)*inv,v=(dot00*dot12-dot01*dot02)*inv;return u>=0&&v>=0&&u+v<1},Point$o=Point_1,Length$3=Length_1,GetPoint_1=function(triangle,position,out){void 0===out&&(out=new Point$o);var line1=triangle.getLineA(),line2=triangle.getLineB(),line3=triangle.getLineC();if(position<=0||position>=1)return out.x=line1.x1,out.y=line1.y1,out;var length1=Length$3(line1),length2=Length$3(line2),length3=Length$3(line3),p=(length1+length2+length3)*position,localPosition=0;return p<length1?(localPosition=p/length1,out.x=line1.x1+(line1.x2-line1.x1)*localPosition,out.y=line1.y1+(line1.y2-line1.y1)*localPosition):p>length1+length2?(localPosition=(p-=length1+length2)/length3,out.x=line3.x1+(line3.x2-line3.x1)*localPosition,out.y=line3.y1+(line3.y2-line3.y1)*localPosition):(localPosition=(p-=length1)/length2,out.x=line2.x1+(line2.x2-line2.x1)*localPosition,out.y=line2.y1+(line2.y2-line2.y1)*localPosition),out},Length$2=Length_1,Point$n=Point_1,GetPoints_1=function(triangle,quantity,stepRate,out){void 0===out&&(out=[]);var line1=triangle.getLineA(),line2=triangle.getLineB(),line3=triangle.getLineC(),length1=Length$2(line1),length2=Length$2(line2),length3=Length$2(line3),perimeter=length1+length2+length3;!quantity&&stepRate>0&&(quantity=perimeter/stepRate);for(var i=0;i<quantity;i++){var p=perimeter*(i/quantity),localPosition=0,point=new Point$n;p<length1?(localPosition=p/length1,point.x=line1.x1+(line1.x2-line1.x1)*localPosition,point.y=line1.y1+(line1.y2-line1.y1)*localPosition):p>length1+length2?(localPosition=(p-=length1+length2)/length3,point.x=line3.x1+(line3.x2-line3.x1)*localPosition,point.y=line3.y1+(line3.y2-line3.y1)*localPosition):(localPosition=(p-=length1)/length2,point.x=line2.x1+(line2.x2-line2.x1)*localPosition,point.y=line2.y1+(line2.y2-line2.y1)*localPosition),out.push(point)}return out},Contains$a=Contains_1,GetPoint=GetPoint_1,GetPoints=GetPoints_1,GEOM_CONST$1=_const$c,Line$5=Line_1$1,Random=Random_1$1,Triangle$8=new Class_1({initialize:function(x1,y1,x2,y2,x3,y3){void 0===x1&&(x1=0),void 0===y1&&(y1=0),void 0===x2&&(x2=0),void 0===y2&&(y2=0),void 0===x3&&(x3=0),void 0===y3&&(y3=0),this.type=GEOM_CONST$1.TRIANGLE,this.x1=x1,this.y1=y1,this.x2=x2,this.y2=y2,this.x3=x3,this.y3=y3},contains:function(x,y){return Contains$a(this,x,y)},getPoint:function(position,output){return GetPoint(this,position,output)},getPoints:function(quantity,stepRate,output){return GetPoints(this,quantity,stepRate,output)},getRandomPoint:function(point){return Random(this,point)},setTo:function(x1,y1,x2,y2,x3,y3){return void 0===x1&&(x1=0),void 0===y1&&(y1=0),void 0===x2&&(x2=0),void 0===y2&&(y2=0),void 0===x3&&(x3=0),void 0===y3&&(y3=0),this.x1=x1,this.y1=y1,this.x2=x2,this.y2=y2,this.x3=x3,this.y3=y3,this},getLineA:function(line){return void 0===line&&(line=new Line$5),line.setTo(this.x1,this.y1,this.x2,this.y2),line},getLineB:function(line){return void 0===line&&(line=new Line$5),line.setTo(this.x2,this.y2,this.x3,this.y3),line},getLineC:function(line){return void 0===line&&(line=new Line$5),line.setTo(this.x3,this.y3,this.x1,this.y1),line},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(value){var diff=0;diff=this.x1<=this.x2&&this.x1<=this.x3?this.x1-value:this.x2<=this.x1&&this.x2<=this.x3?this.x2-value:this.x3-value,this.x1-=diff,this.x2-=diff,this.x3-=diff}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(value){var diff=0;diff=this.x1>=this.x2&&this.x1>=this.x3?this.x1-value:this.x2>=this.x1&&this.x2>=this.x3?this.x2-value:this.x3-value,this.x1-=diff,this.x2-=diff,this.x3-=diff}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)}
233,set:function(value){var diff=0;diff=this.y1<=this.y2&&this.y1<=this.y3?this.y1-value:this.y2<=this.y1&&this.y2<=this.y3?this.y2-value:this.y3-value,this.y1-=diff,this.y2-=diff,this.y3-=diff}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(value){var diff=0;diff=this.y1>=this.y2&&this.y1>=this.y3?this.y1-value:this.y2>=this.y1&&this.y2>=this.y3?this.y2-value:this.y3-value,this.y1-=diff,this.y2-=diff,this.y3-=diff}}}),Triangle_1$1=Triangle$8,GetCalcMatrix$4=GetCalcMatrix_1,StrokePathWebGL=StrokePathWebGL_1,Utils$4=Utils$p,TriangleWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),result=GetCalcMatrix$4(src,camera,parentMatrix);pipeline.calcMatrix.copyFrom(result.calc);var dx=src._displayOriginX,dy=src._displayOriginY,alpha=camera.alpha*src.alpha;if(renderer.pipelines.preBatch(src),src.isFilled){var fillTint=pipeline.fillTint,fillTintColor=Utils$4.getTintAppendFloatAlpha(src.fillColor,src.fillAlpha*alpha);fillTint.TL=fillTintColor,fillTint.TR=fillTintColor,fillTint.BL=fillTintColor,fillTint.BR=fillTintColor;var x1=src.geom.x1-dx,y1=src.geom.y1-dy,x2=src.geom.x2-dx,y2=src.geom.y2-dy,x3=src.geom.x3-dx,y3=src.geom.y3-dy;pipeline.batchFillTriangle(x1,y1,x2,y2,x3,y3,result.sprite,result.camera)}src.isStroked&&StrokePathWebGL(pipeline,src,alpha,dx,dy),renderer.pipelines.postBatch(src)},FillStyleCanvas=FillStyleCanvas_1,LineStyleCanvas=LineStyleCanvas_1,SetTransform=SetTransform_1,TriangleCanvasRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var ctx=renderer.currentContext;if(SetTransform(renderer,ctx,src,camera,parentMatrix)){var dx=src._displayOriginX,dy=src._displayOriginY,x1=src.geom.x1-dx,y1=src.geom.y1-dy,x2=src.geom.x2-dx,y2=src.geom.y2-dy,x3=src.geom.x3-dx,y3=src.geom.y3-dy;ctx.beginPath(),ctx.moveTo(x1,y1),ctx.lineTo(x2,y2),ctx.lineTo(x3,y3),ctx.closePath(),src.isFilled&&(FillStyleCanvas(ctx,src),ctx.fill()),src.isStroked&&(LineStyleCanvas(ctx,src),ctx.stroke()),ctx.restore()}},Shape=Shape_1,GeomTriangle=Triangle_1$1,Triangle$7=new Class_1({Extends:Shape,Mixins:[{renderWebGL:TriangleWebGLRenderer_1,renderCanvas:TriangleCanvasRenderer_1}],initialize:function(scene,x,y,x1,y1,x2,y2,x3,y3,fillColor,fillAlpha){void 0===x&&(x=0),void 0===y&&(y=0),void 0===x1&&(x1=0),void 0===y1&&(y1=128),void 0===x2&&(x2=64),void 0===y2&&(y2=0),void 0===x3&&(x3=128),void 0===y3&&(y3=128),Shape.call(this,scene,"Triangle",new GeomTriangle(x1,y1,x2,y2,x3,y3));var width=this.geom.right-this.geom.left,height=this.geom.bottom-this.geom.top;this.setPosition(x,y),this.setSize(width,height),void 0!==fillColor&&this.setFillStyle(fillColor,fillAlpha),this.updateDisplayOrigin(),this.updateData()},setTo:function(x1,y1,x2,y2,x3,y3){return this.geom.setTo(x1,y1,x2,y2,x3,y3),this.updateData()},updateData:function(){var path=[],tri=this.geom,line=this._tempLine;return tri.getLineA(line),path.push(line.x1,line.y1,line.x2,line.y2),tri.getLineB(line),path.push(line.x2,line.y2),tri.getLineC(line),path.push(line.x2,line.y2),this.pathData=path,this}}),Triangle_1=Triangle$7,Blitter$1=Blitter_1;
234/**
235	 * @author       Richard Davey <[email protected]>
236	 * @copyright    2020 Photon Storm Ltd.
237	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
238	 */GameObjectFactory_1.register("blitter",(function(x,y,key,frame){return this.displayList.add(new Blitter$1(this.scene,x,y,key,frame))}));var Container$1=Container_1;
239/**
240	 * @author       Richard Davey <[email protected]>
241	 * @author       Felipe Alfonso <@bitnenfer>
242	 * @copyright    2020 Photon Storm Ltd.
243	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
244	 */GameObjectFactory_1.register("container",(function(x,y,children){return this.displayList.add(new Container$1(this.scene,x,y,children))}));var DOMElement=DOMElement_1;
245/**
246	 * @author       Richard Davey <[email protected]>
247	 * @copyright    2020 Photon Storm Ltd.
248	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
249	 */GameObjectFactory_1.register("dom",(function(x,y,element,style,innerText){var gameObject=ne
249w DOMElement(this.scene,x,y,element,style,innerText);return this.displayList.add(gameObject),gameObject}));var DynamicBitmapText=DynamicBitmapText_1;
250/**
251	 * @author       Richard Davey <[email protected]>
252	 * @copyright    2020 Photon Storm Ltd.
253	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
254	 */GameObjectFactory_1.register("dynamicBitmapText",(function(x,y,font,text,size){return this.displayList.add(new DynamicBitmapText(this.scene,x,y,font,text,size))}));var Extern=Extern_1;
255/**
256	 * @author       Richard Davey <[email protected]>
257	 * @copyright    2020 Photon Storm Ltd.
258	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
259	 */GameObjectFactory_1.register("extern",(function(){var extern=new Extern(this.scene);return this.displayList.add(extern),extern}));var Graphics$1=Graphics_1;
260/**
261	 * @author       Richard Davey <[email protected]>
262	 * @copyright    2020 Photon Storm Ltd.
263	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
264	 */GameObjectFactory_1.register("graphics",(function(config){return this.displayList.add(new Graphics$1(this.scene,config))}));var Group$3=Group_1;
265/**
266	 * @author       Richard Davey <[email protected]>
267	 * @copyright    2020 Photon Storm Ltd.
268	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
269	 */GameObjectFactory_1.register("group",(function(children,config){return this.updateList.add(new Group$3(this.scene,children,config))}));var Image$4=Image_1;
270/**
271	 * @author       Richard Davey <[email protected]>
272	 * @copyright    2020 Photon Storm Ltd.
273	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
274	 */GameObjectFactory_1.register("image",(function(x,y,key,frame){return this.displayList.add(new Image$4(this.scene,x,y,key,frame))}));var Layer$1=Layer_1;
275/**
276	 * @author       Richard Davey <[email protected]>
277	 * @copyright    2020 Photon Storm Ltd.
278	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
279	 */GameObjectFactory_1.register("layer",(function(children){return this.displayList.add(new Layer$1(this.scene,children))}));var ParticleEmitterManager$1=ParticleEmitterManager_1;
280/**
281	 * @author       Richard Davey <[email protected]>
282	 * @copyright    2020 Photon Storm Ltd.
283	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
284	 */GameObjectFactory_1.register("particles",(function(key,frame,emitters){return this.displayList.add(new ParticleEmitterManager$1(this.scene,key,frame,emitters))}));var PathFollower=PathFollower_1;
285/**
286	 * @author       Richard Davey <[email protected]>
287	 * @copyright    2020 Photon Storm Ltd.
288	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
289	 */GameObjectFactory_1.register("follower",(function(path,x,y,key,frame){var sprite=new PathFollower(this.scene,path,x,y,key,frame);return this.displayList.add(sprite),this.updateList.add(sprite),sprite}));var RenderTexture$1=RenderTexture_1;
290/**
291	 * @author       Richard Davey <[email protected]>
292	 * @copyright    2020 Photon Storm Ltd.
293	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
294	 */GameObjectFactory_1.register("renderTexture",(function(x,y,width,height,key,frame){return this.displayList.add(new RenderTexture$1(this.scene,x,y,width,height,key,frame))}));var Rope$1=Rope_1;
295/**
296	 * @author       Richard Davey <[email protected]>
297	 * @copyright    2020 Photon Storm Ltd.
298	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
299	 */GameObjectFactory_1.register("rope",(function(x,y,texture,frame,points,horizontal,colors,alphas){return this.displayList.add(new Rope$1(this.scene,x,y,texture,frame,points,horizontal,colors,alphas))}));var Sprite$4=Sprite_1;
300/**
301	 * @author       Richard Davey <[email protected]>
302	 * @copyright    2020 Photon Storm Ltd.
303	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
304	 */GameObjectFactory_1.register("sprite",(function(x,y,key,frame){var sprite=new Sprite$4(this.scene,x,y,key,frame);return this.displayList.add(sprite),sprite}));var BitmapText$2=BitmapText_1;
305/**
306	 * @author       Richard Davey <[email protected]>
307	 * @copyright    2020 Photon Storm Ltd.
308	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
309	 */GameObjectFactory_1.register("bitmapText",(function(x,y,font,text,size,align){return this.displayList.add(new BitmapText$2(this.scene,x,y,font,text,size,align))}));var Text$1=Text_1;
310/**
311	 * @author       Richard Davey <[email protected]>
312	 * @copyright    2020 Photon Storm Ltd.
313	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
314	 */GameObjectFactory_1.register("text",(function(x,y,text,style){return this.displayList.add(new Text$1(this.scene,x,y,text,style))}));var TileSprite$1=TileSprite_1;
315/**
316	 * @author       Richard Davey <[email protected]>
317	 * @copyright    2020 Photon Storm Ltd.
318	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
319	 */GameObjectFactory_1.register("tileSprite",(function(x,y,width,height,key,frame){return this.displayList.add(new TileSprite$1(this.scene,x,y,width,height,key,frame))}));var Zone$1=Zone_1;
320/**
321	 * @author       Richard Davey <[email protected]>
322	 * @copyright    2020 Photon Storm Ltd.
323	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
324	 */GameObjectFactory_1.register("zone",(function(x,y,width,height){return this.displayList.add(new Zone$1(this.scene,x,y,width,height))}));var Video$1=Video_1;
325/**
326	 * @author       Richard Davey <[email protected]>
327	 * @copyright    2020 Photon Storm Ltd.
328	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
329	 */GameObjectFactory_1.register("video",(function(x,y,key){return this.displayList.add(new Video$1(this.scene,x,y,key))}));var Arc=Arc_1,GameObjectFactory$f=GameObjectFactory_1;
330/**
331	 * @author       Richard Davey <[email protected]>
332	 * @copyright    2020 Photon Storm Ltd.
333	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
334	 */GameObjectFactory$f.register("arc",(function(x,y,radius,startAngle,endAngle,anticlockwise,fillColor,fillAlpha){return this.displayList.add(new Arc(this.scene,x,y,radius,startAngle,endAngle,anticlockwise,fillColor,fillAlpha))})),GameObjectFactory$f.register("circle",(function(x,y,radius,fillColor,fillAlpha){return this.displayList.add(new Arc(this.scene,x,y,radius,0,360,!1,fillColor,fillAlpha))}));var Curve=Curve_1;
335/**
336	 * @author       Richard Davey <[email protected]>
337	 * @copyright    2020 Photon Storm Ltd.
338	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
339	 */GameObjectFactory_1.register("curve",(function(x,y,curve,fillColor,fillAlpha){return this.displayList.add(new Curve(this.scene,x,y,curve,fillColor,fillAlpha))}));var Ellipse$3=Ellipse_1;
340/**
341	 * @author       Richard Davey <[email protected]>
342	 * @copyright    2020 Photon Storm Ltd.
343	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
344	 */GameObjectFactory_1.register("ellipse",(function(x,y,width,height,fillColor,fillAlpha){return this.displayList.add(new Ellipse$3(this.scene,x,y,width,height,fillColor,fillAlpha))}));var Grid$3=Grid_1$1;
345/**
346	 * @author       Richard Davey <[email protected]>
347	 * @copyright    2020 Photon Storm Ltd.
348	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
349	 */GameObjectFactory_1.register("grid",(function(x,y,width,height,cellWidth,cellHeight,fillColor,fillAlpha,outlineFillColor,outlineFillAlpha){return this.displayList.add(new Grid$3(this.scene,x,y,width,height,cellWidth,cellHeight,fillColor,fillAlpha,outlineFillColor,outlineFillAlpha))}));var IsoBox=IsoBox_1;
350/**
351	 * @author       Richard Davey <[email protected]>
352	 * @copyright    2020 Photon Storm Ltd.
353	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
354	 */GameObjectFactory_1.register("isobox",(function(x,y,size,height,fillTop,fillLeft,fillRight){return this.displayList.add(new IsoBox(this.scene,x,y,size,height,fillTop,fillLeft,fillRight))}));var IsoTriangle=IsoTriangle_1;
355/**
356	 * @author       Richard Davey <[email protected]>
357	 * @copyright    2020 Photon Storm Ltd.
358	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
359	 */GameObjectFactory_1.register("isotriangle",(function(x,y,size,height,reversed,fillTop,fillLeft,fillRight){return this.displayList.add(new IsoTriangle(this.scene,x,y,size,height,reversed,fillTop,fillLeft,fillRight))}));var Line$4=Line_1;
360/**
361	 * @author       Richard Davey <[email protected]>
362	 * @copyright    2020 Photon Storm Ltd.
363	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
364	 */GameObjectFactory_1.register("line",(function(x,y,x1,y1,x2,y2,strokeColor,strokeAlpha){return this.displayList.add(new Line$4(this.scene,x,y,x1,y1,x2,y2,strokeColor,strokeAlpha))}));var Polygon$2=Polygon_1;
365/**
366	 * @author       Richard Davey <[email protected]>
367	 * @copyright    2020 Photon Storm Ltd.
368	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
369	 */GameObjectFactory_1.register("polygon",(function(x,y,points,fillColor,fillAlpha){return this.displayList.add(new Polygon$2(this.scene,x,y,points,fillColor,fillAlpha))}));var Rectangle$e=Rectangle_1;
370/**
371	 * @author       Richard Davey <[email protected]>
372	 * @copyright    2020 Photon Storm Ltd.
373	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
374	 */GameObjectFactory_1.register("rectangle",(function(x,y,width,height,fillColor,fillAlpha){return this.displayList.add(new Rectangle$e(this.scene,x,y,width,height,fillColor,fillAlpha))}));var Star=Star_1;
375/**
376	 * @author       Richard Davey <[email protected]>
377	 * @copyright    2020 Photon Storm Ltd.
378	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
379	 */GameObjectFactory_1.register("star",(function(x,y,points,innerRadius,outerRadius,fillColor,fillAlpha){return this.displayList.add(new Star(this.scene,x,y,points,innerRadius,outerRadius,fillColor,fillAlpha))}));var Triangle$6=Triangle_1;
380/**
381	 * @author       Richard Davey <[email protected]>
382	 * @copyright    2020 Photon Storm Ltd.
383	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
384	 */GameObjectFactory_1.register("triangle",(function(x,y,x1,y1,x2,y2,x3,y3,fillColor,fillAlpha){return this.displayList.add(new Triangle$6(this.scene,x,y,x1,y1,x2,y2,x3,y3,fillColor,fillAlpha))}));var Blitter=Blitter_1,BuildGameObject$e=BuildGameObject_1,GetAdvancedValue$j=GetAdvancedValue_1;
385/**
386	 * @author       Richard Davey <[email protected]>
387	 * @copyright    2020 Photon Storm Ltd.
388	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
389	 */GameObjectCreator_1.register("blitter",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$j(config,"key",null),frame=GetAdvancedValue$j(config,"frame",null),blitter=new Blitter(this.scene,0,0,key,frame);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$e(this.scene,blitter,config),blitter}));var BuildGameObject$d=BuildGameObject_1,Container=Container_1,GetAdvancedValue$i=GetAdvancedValue_1;
390/**
391	 * @author       Richard Davey <[email protected]>
392	 * @author       Felipe Alfonso <@bitnenfer>
393	 * @copyright    2020 Photon Storm Ltd.
394	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
395	 */GameObjectCreator_1.register("container",(function(config,addToScene){void 0===config&&(config={});var x=GetAdvancedValue$i(config,"x",0),y=GetAdvancedValue$i(config,"y",0),children=GetAdvancedValue$i(config,"children",null),container=new Container(this.scene,x,y,children);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$d(this.scene,container,config),container}));var BitmapText$1=DynamicBitmapText_1,BuildGameObject$c=BuildGameObject_1,GetAdvancedValue$h=GetAdvancedValue_1;
396/**
397	 * @author       Richard Davey <[email protected]>
398	 * @copyright    2020 Photon Storm Ltd.
399	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
400	 */GameObjectCreator_1.register("dynamicBitmapText",(function(config,addToScene){void 0===config&&(config={});var font=GetAdvancedValue$h(config,"font",""),text=GetAdvancedValue$h(config,"text",""),size=GetAdvancedValue$h(config,"size",!1),bitmapText=new BitmapText$1(this.scene,0,0,font,text,size);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$c(this.scene,bitmapText,config),bitmapText}));var Graphics=Graphics_1;
401/**
402	 * @author       Richard Davey <[email protected]>
403	 * @copyright    2020 Photon Storm Ltd.
404	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
405	 */GameObjectCreator_1.register("graphics",(function(config,addToScene){void 0===config&&(config={}),void 0!==addToScene&&(config.add=addToScene);var graphics=new Graphics(this.scene,config);return config.add&&this.scene.sys.displayList.add(graphics),graphics}));var Group$2=Group_1;
406/**
407	 * @author       Richard Davey <[email protected]>
408	 * @copyright    2020 Photon Storm Ltd.
409	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
410	 */GameObjectCreator_1.register("group",(function(config){return new Group$2(this.scene,null,config)}));var BuildGameObject$b=BuildGameObject_1,GetAdvancedValue$g=GetAdvancedValue_1,Image$3=Image_1;
411/**
412	 * @author       Richard Davey <[email protected]>
413	 * @copyright    2020 Photon Storm Ltd.
414	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
415	 */GameObjectCreator_1.register("image",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$g(config,"key",null),frame=GetAdvancedValue$g(config,"frame",null),image=new Image$3(this.scene,0,0,key,frame);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$b(this.scene,image,config),image}));var BuildGameObject$a=BuildGameObject_1,Layer=Layer_1,GetAdvancedValue$f=GetAdvancedValue_1;
416/**
417	 * @author       Richard Davey <[email protected]>
418	 * @copyright    2020 Photon Storm Ltd.
419	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
420	 */GameObjectCreator_1.register("layer",(function(config,addToScene){void 0===config&&(config={});var children=GetAdvancedValue$f(config,"children",null),layer=new Layer(this.scene,children);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$a(this.scene,layer,config),layer}));var GetAdvancedValue$e=GetAdvancedValue_1,GetFastValue$U=GetFastValue_1,ParticleEmitterManager=ParticleEmitterManager_1;
421/**
422	 * @author       Richard Davey <[email protected]>
423	 * @copyright    2020 Photon Storm Ltd.
424	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
425	 */GameObjectCreator_1.register("particles",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$e(config,"key",null),frame=GetAdvancedValue$e(config,"frame",null),emitters=GetFastValue$U(config,"emitters",null),manager=new ParticleEmitterManager(this.scene,key,frame,emitters);return void 0!==addToScene&&(config.add=addToScene),GetFastValue$U(config,"add",!1)?this.displayList.add(manager):this.updateList.add(manager),manager}));var BuildGameObject$9=BuildGameObject_1,GetAdvancedValue$d=GetAdvancedValue_1,RenderTexture=RenderTexture_1;
426/**
427	 * @author       Richard Davey <[email protected]>
428	 * @copyright    2020 Photon Storm Ltd.
429	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
430	 */GameObjectCreator_1.register("renderTexture",(function(config,addToScene){void 0===config&&(config={});var x=GetAdvancedValue$d(config,"x",0),y=GetAdvancedValue$d(config,"y",0),width=GetAdvancedValue$d(config,"width",32),height=GetAdvancedValue$d(config,"height",32),key=GetAdvancedValue$d(config,"key",void 0),frame=GetAdvancedValue$d(config,"frame",void 0),renderTexture=new RenderTexture(this.scene,x,y,width,height,key,frame);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$9(this.scene,renderTexture,config),renderTexture}));var BuildGameObject$8=BuildGameObject_1,GetAdvancedValue$c=GetAdvancedValue_1,GetValue$g=GetValue_1,Rope=Rope_1;
431/**
432	 * @author       Richard Davey <[email protected]>
433	 * @copyright    2020 Photon Storm Ltd.
434	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
435	 */GameObjectCreator_1.register("rope",(function(config,addToScene){void 0===config&&(
435config={});var key=GetAdvancedValue$c(config,"key",null),frame=GetAdvancedValue$c(config,"frame",null),horizontal=GetAdvancedValue$c(config,"horizontal",!0),points=GetValue$g(config,"points",void 0),colors=GetValue$g(config,"colors",void 0),alphas=GetValue$g(config,"alphas",void 0),rope=new Rope(this.scene,0,0,key,frame,points,horizontal,colors,alphas);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$8(this.scene,rope,config),config.add||this.updateList.add(rope),rope}));var BuildGameObject$7=BuildGameObject_1,BuildGameObjectAnimation=BuildGameObjectAnimation_1,GetAdvancedValue$b=GetAdvancedValue_1,Sprite$3=Sprite_1;
436/**
437	 * @author       Richard Davey <[email protected]>
438	 * @copyright    2020 Photon Storm Ltd.
439	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
440	 */GameObjectCreator_1.register("sprite",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$b(config,"key",null),frame=GetAdvancedValue$b(config,"frame",null),sprite=new Sprite$3(this.scene,0,0,key,frame);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$7(this.scene,sprite,config),BuildGameObjectAnimation(sprite,config),sprite}));var BitmapText=BitmapText_1,BuildGameObject$6=BuildGameObject_1,GetAdvancedValue$a=GetAdvancedValue_1,GetValue$f=GetValue_1;
441/**
442	 * @author       Richard Davey <[email protected]>
443	 * @copyright    2020 Photon Storm Ltd.
444	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
445	 */GameObjectCreator_1.register("bitmapText",(function(config,addToScene){void 0===config&&(config={});var font=GetValue$f(config,"font",""),text=GetAdvancedValue$a(config,"text",""),size=GetAdvancedValue$a(config,"size",!1),align=GetValue$f(config,"align",0),bitmapText=new BitmapText(this.scene,0,0,font,text,size,align);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$6(this.scene,bitmapText,config),bitmapText}));var BuildGameObject$5=BuildGameObject_1,GetAdvancedValue$9=GetAdvancedValue_1,Text=Text_1;
446/**
447	 * @author       Richard Davey <[email protected]>
448	 * @copyright    2020 Photon Storm Ltd.
449	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
450	 */GameObjectCreator_1.register("text",(function(config,addToScene){void 0===config&&(config={});var content=GetAdvancedValue$9(config,"text",""),style=GetAdvancedValue$9(config,"style",null),padding=GetAdvancedValue$9(config,"padding",null);null!==padding&&(style.padding=padding);var text=new Text(this.scene,0,0,content,style);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$5(this.scene,text,config),text.autoRound=GetAdvancedValue$9(config,"autoRound",!0),text.resolution=GetAdvancedValue$9(config,"resolution",1),text}));var BuildGameObject$4=BuildGameObject_1,GetAdvancedValue$8=GetAdvancedValue_1,TileSprite=TileSprite_1;
451/**
452	 * @author       Richard Davey <[email protected]>
453	 * @copyright    2020 Photon Storm Ltd.
454	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
455	 */GameObjectCreator_1.register("tileSprite",(function(config,addToScene){void 0===config&&(config={});var x=GetAdvancedValue$8(config,"x",0),y=GetAdvancedValue$8(config,"y",0),width=GetAdvancedValue$8(config,"width",512),height=GetAdvancedValue$8(config,"height",512),key=GetAdvancedValue$8(config,"key",""),frame=GetAdvancedValue$8(config,"frame",""),tile=new TileSprite(this.scene,x,y,width,height,key,frame);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$4(this.scene,tile,config),tile}));var GetAdvancedValue$7=GetAdvancedValue_1,Zone=Zone_1;
456/**
457	 * @author       Richard Davey <[email protected]>
458	 * @copyright    2020 Photon Storm Ltd.
459	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
460	 */GameObjectCreator_1.register("zone",(function(config){var x=GetAdvancedValue$7(config,"x",0),y=GetAdvancedValue$7(config,"y",0),width=GetAdvancedValue$7(config,"width",1),height=GetAdvancedValue$7(config,"height",width);return new Zone(this.scene,x,y,width,height)}));var BuildGameObject$3=BuildGameObject_1,GetAdvancedValue$6=GetAdvancedValue_1,Video=Video_1;
461/**
462	 * @author       Richard Davey <[email protected]>
463	 * @copyright    2020 Photon Storm Ltd.
464	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
465	 */GameObjectCreator_1.register("video",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$6(config,"key",null),video=new Video(this.scene,0,0,key);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$3(this.scene,video,config),config.add||this.updateList.add(video),video}));
466/**
467	 * @author       Richard Davey <[email protected]>
468	 * @copyright    2020 Photon Storm Ltd.
469	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
470	 */
471var SetValue_1=function(source,key,value){if(!source||"number"==typeof source)return!1;if(source.hasOwnProperty(key))return source[key]=value,!0;if(-1!==key.indexOf(".")){for(var keys=key.split("."),parent=source,prev=source,i=0;i<keys.length;i++){if(!parent.hasOwnProperty(keys[i]))return!1;prev=parent,parent=parent[keys[i]]}return prev[keys[keys.length-1]]=value,!0}return!1},GetCalcMatrix$3=GetCalcMatrix_1,ShaderWebGLRenderer_1=function(renderer,src,camera,parentMatrix){if(src.shader){if(camera.addToRenderList(src),renderer.pipelines.clear(),src.renderToTexture)src.load(),src.flush();else{var calcMatrix=GetCalcMatrix$3(src,camera,parentMatrix).calc;renderer.width===src._rendererWidth&&renderer.height===src._rendererHeight||src.projOrtho(0,renderer.width,renderer.height,0),src.load(calcMatrix.matrix),src.flush()}renderer.pipelines.rebind()}},GameObject$5=GameObject_1,GetFastValue$T=GetFastValue_1,Extend$f=Extend_1$1,SetValue=SetValue_1,TransformMatrix$2=TransformMatrix_1,Shader$3=new Class_1({Extends:GameObject$5,Mixins:[components$3.ComputedSize,components$3.Depth,components$3.GetBounds,components$3.Mask,components$3.Origin,components$3.ScrollFactor,components$3.Transform,components$3.Visible,{renderWebGL:ShaderWebGLRenderer_1,renderCanvas:function(){}}],initialize:function(scene,key,x,y,width,height,textures,textureData){void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=128),void 0===height&&(height=128),GameObject$5.call(this,scene,"Shader"),this.blendMode=-1,this.shader;var renderer=scene.sys.renderer;this.renderer=renderer,this.gl=renderer.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=renderer.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new TransformMatrix$2,this._tempMatrix2=new TransformMatrix$2,this._tempMatrix3=new TransformMatrix$2,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=renderer.width,this._rendererHeight=renderer.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(x,y),this.setSize(width,height),this.setOrigin(.5,.5),this.setShader(key,textures,textureData)},willRender:function(camera){return!!this.renderToTexture||!(GameObject$5.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&camera.id
471)},setRenderToTexture:function(key,flipY){if(void 0===flipY&&(flipY=!1),!this.renderToTexture){var width=this.width,height=this.height,renderer=this.renderer;this.glTexture=renderer.createTextureFromSource(null,width,height,0),this.glTexture.flipY=flipY,this.framebuffer=renderer.createFramebuffer(width,height,this.glTexture,!1),this._rendererWidth=width,this._rendererHeight=height,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),key&&(this.texture=this.scene.sys.textures.addGLTexture(key,this.glTexture,width,height))}return this.shader&&(renderer.pipelines.clear(),this.load(),this.flush(),renderer.pipelines.rebind()),this},setShader:function(key,textures,textureData){if(void 0===textures&&(textures=[]),"string"==typeof key){var cache=this.scene.sys.cache.shader;if(!cache.has(key))return console.warn("Shader missing: "+key),this;this.shader=cache.get(key)}else this.shader=key;var gl=this.gl,renderer=this.renderer;this.program&&gl.deleteProgram(this.program);var program=renderer.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);gl.uniformMatrix4fv(gl.getUniformLocation(program,"uViewMatrix"),!1,this.viewMatrix),gl.uniformMatrix4fv(gl.getUniformLocation(program,"uProjectionMatrix"),!1,this.projectionMatrix),gl.uniform2f(gl.getUniformLocation(program,"uResolution"),this.width,this.height),this.program=program;var d=new Date,defaultUniforms={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[d.getFullYear(),d.getMonth(),d.getDate(),60*d.getHours()*60+60*d.getMinutes()+d.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=Extend$f(!0,{},this.shader.uniforms,defaultUniforms):this.uniforms=defaultUniforms;for(var i=0;i<4;i++)textures[i]&&this.setSampler2D("iChannel"+i,textures[i],i,textureData);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(pointer){return this.pointer=pointer,this},projOrtho:function(left,right,bottom,top){var leftRight=1/(left-right),bottomTop=1/(bottom-top),pm=this.projectionMatrix;pm[0]=-2*leftRight,pm[5]=-2*bottomTop,pm[10]=-.001,pm[12]=(left+right)*leftRight,pm[13]=(top+bottom)*bottomTop,pm[14]=-0;var program=this.program,gl=this.gl;this.renderer.setProgram(program),gl.uniformMatrix4fv(gl.getUniformLocation(program,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=right,this._rendererHeight=bottom},initUniforms:function(){var gl=this.gl,map=this.renderer.glFuncMap,program=this.program;for(var key in this._textureCount=0,this.uniforms){var uniform=this.uniforms[key],type=uniform.type,data=map[type];uniform.uniformLocation=gl.getUniformLocation(program,key),"sampler2D"!==type&&(uniform.glMatrix=data.matrix,uniform.glValueLength=data.length,uniform.glFunc=data.func)}},setSampler2DBuffer:function(uniformKey,texture,width,height,textureIndex,textureData){void 0===textureIndex&&(textureIndex=0),void 0===textureData&&(textureData={});var uniform=this.uniforms[uniformKey];return uniform.value=texture,textureData.width=width,textureData.height=height,uniform.textureData=textureData,this._textureCount=textureIndex,this.initSampler2D(uniform),this},setSampler2D:function(uniformKey,textureKey,textureIndex,textureData){void 0===textureIndex&&(textureIndex=0);var textureManager=this.scene.sys.textures;if(textureManager.exists(textureKey)){var frame=textureManager.getFrame(textureKey);if(frame.glTexture&&frame.glTexture.isRenderTexture)return this.setSampler2DBuffer(uniformKey,frame.glTexture,frame.width,frame.height,textureIndex,textureData);var uniform=this.uniforms[uniformKey],source=frame.source;uniform.textureKey=textureKey,uniform.source=source.image,uniform.value=frame.glTexture,source.isGLTexture&&(textureData||(textureData={}),textureData.width=source.width,textureData.height=source.height),textureData&&(uniform.textureData=textureData),this._textureCount=textureIndex,this.initSampler2D(uniform)}return this},setUniform:function(key,value){return SetValue(this.uniforms,key,value),this},getUniform:function(key){return GetFastValue$T(this.uniforms,key,null)},setChannel0:function(textureKey,textureData){return this.setSampler2D("iChannel0",textureKey,0,textureData)},setChannel1:function(textureKey,textureData){return this.setSampler2D("iChannel1",textureKey,1,textureData)},setChannel2:function(textureKey,textureData){return this.setSampler2D("iChannel2",textureKey,2,textureData)},setChannel3:function(textureKey,textureData){return this.setSampler2D("iChannel3",textureKey,3,textureData)},initSampler2D:function(uniform){if(uniform.value){var gl=this.gl;gl.activeTexture(gl.TEXTURE0+this._textureCount),gl.bindTexture(gl.TEXTURE_2D,uniform.value);var data=uniform.textureData;if(data&&!uniform.value.isRenderTexture){var magFilter=gl[GetFastValue$T(data,"magFilter","linear").toUpperCase()],minFilter=gl[GetFastValue$T(data,"minFilter","linear").toUpperCase()],wrapS=gl[GetFastValue$T(data,"wrapS","repeat").toUpperCase()],wrapT=gl[GetFastValue$T(data,"wrapT","repeat").toUpperCase()],format=gl[GetFastValue$T(data,"format","rgba").toUpperCase()];if(data.repeat&&(wrapS=gl.REPEAT,wrapT=gl.REPEAT),gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,!!data.flipY),data.width){var width=GetFastValue$T(data,"width",512),height=GetFastValue$T(data,"height",2),border=GetFastValue$T(data,"border",0);gl.texImage2D(gl.TEXTURE_2D,0,format,width,height,border,format,gl.UNSIGNED_BYTE,null)}else gl.texImage2D(gl.TEXTURE_2D,0,format,gl.RGBA,gl.UNSIGNED_BYTE,uniform.source);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,magFilter),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,minFilter),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,wrapS),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,wrapT)}this.renderer.setProgram(this.program),gl.uniform1i(uniform.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var uniform,length,glFunc,location,value,gl=this.gl,uniforms=this.uniforms,textureCount=0;for(var key in uniforms)glFunc=(uniform=uniforms[key]).glFunc,length=uniform.glValueLength,location=uniform.uniformLocation,null!==(value=uniform.value)&&(1===length?uniform.glMatrix?glFunc.call(gl,location,uniform.transpose,value):glFunc.call(gl,location,value):2===length?glFunc.call(gl,location,value.x,value.y):3===length?glFunc.call(gl,location,value.x,value.y,value.z):4===length?glFunc.call(gl,location,value.x,value.y,value.z,value.w):"sampler2D"===uniform.type&&(gl.activeTexture(gl.TEXTURE0+textureCount),gl.bindTexture(gl.TEXTURE_2D,value),gl.uniform1i(location,textureCount),textureCount++))},load:function(matrix2D){var gl=this.gl,width=this.width,height=this.height,renderer=this.renderer,program=this.program,vm=this.viewMatrix;if(!this.renderToTexture){var x=-this._displayOriginX,y=-this._displayOriginY;vm[0]=matrix2D[0],vm[1]=matrix2D[1],vm[4]=matrix2D[2],vm[5]=matrix2D[3],vm[8]=matrix2D[4],vm[9]=matrix2D[5],vm[12]=vm[0]*x+vm[4]*y,vm[13]=vm[1]*x+vm[5]*y}gl.useProgram(program),gl.uniformMatrix4fv(gl.getUniformLocation(program,"uViewMatrix"),!1,vm),gl.uniform2f(gl.getUniformLocation(program,"uResolution"),this.width,this.height);var uniforms=this.uniforms,res=uniforms.resolution;res.value.x=width,res.value.y=height,uniforms.time.value=renderer.game.loop.getDuration();var pointer=this.pointer;if(pointer){var mouse=uniforms.mouse,px=pointer.x/width,py=1-pointer.y/height;
471mouse.value.x=px.toFixed(2),mouse.value.y=py.toFixed(2)}this.syncUniforms()},flush:function(){var width=this.width,height=this.height,program=this.program,gl=this.gl,vertexBuffer=this.vertexBuffer,renderer=this.renderer,vertexSize=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(renderer.setFramebuffer(this.framebuffer),gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT)),gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer);var location=gl.getAttribLocation(program,"inPosition");-1!==location&&(gl.enableVertexAttribArray(location),gl.vertexAttribPointer(location,2,gl.FLOAT,!1,vertexSize,0));var vf=this.vertexViewF32;vf[3]=height,vf[4]=width,vf[5]=height,vf[8]=width,vf[9]=height,vf[10]=width;gl.bufferSubData(gl.ARRAY_BUFFER,0,this.bytes.subarray(0,6*vertexSize)),gl.drawArrays(gl.TRIANGLES,0,6),this.renderToTexture&&renderer.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var gl=this.gl;gl.deleteProgram(this.program),gl.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}}),Shader_1=Shader$3,Rectangle$d=Rectangle_1$1,Vector2$r=Vector2_1;function GetLength(x1,y1,x2,y2){var x=x1-x2,y=y1-y2,magnitude=x*x+y*y;return Math.sqrt(magnitude)}var Face$4=new Class_1({initialize:function(vertex1,vertex2,vertex3){this.vertex1=vertex1,this.vertex2=vertex2,this.vertex3=vertex3,this.bounds=new Rectangle$d,this._inCenter=new Vector2$r},getInCenter:function(local){void 0===local&&(local=!0);var v1x,v1y,v2x,v2y,v3x,v3y,v1=this.vertex1,v2=this.vertex2,v3=this.vertex3;local?(v1x=v1.x,v1y=v1.y,v2x=v2.x,v2y=v2.y,v3x=v3.x,v3y=v3.y):(v1x=v1.vx,v1y=v1.vy,v2x=v2.vx,v2y=v2.vy,v3x=v3.vx,v3y=v3.vy);var d1=GetLength(v3x,v3y,v2x,v2y),d2=GetLength(v1x,v1y,v3x,v3y),d3=GetLength(v2x,v2y,v1x,v1y),p=d1+d2+d3;return this._inCenter.set((v1x*d1+v2x*d2+v3x*d3)/p,(v1y*d1+v2y*d2+v3y*d3)/p)},contains:function(x,y,calcMatrix){var vertex1=this.vertex1,vertex2=this.vertex2,vertex3=this.vertex3,v1x=vertex1.vx,v1y=vertex1.vy,v2x=vertex2.vx,v2y=vertex2.vy,v3x=vertex3.vx,v3y=vertex3.vy;if(calcMatrix){var a=calcMatrix.a,b=calcMatrix.b,c=calcMatrix.c,d=calcMatrix.d,e=calcMatrix.e,f=calcMatrix.f;v1x=vertex1.vx*a+vertex1.vy*c+e,v1y=vertex1.vx*b+vertex1.vy*d+f,v2x=vertex2.vx*a+vertex2.vy*c+e,v2y=vertex2.vx*b+vertex2.vy*d+f,v3x=vertex3.vx*a+vertex3.vy*c+e,v3y=vertex3.vx*b+vertex3.vy*d+f}var t0x=v3x-v1x,t0y=v3y-v1y,t1x=v2x-v1x,t1y=v2y-v1y,t2x=x-v1x,t2y=y-v1y,dot00=t0x*t0x+t0y*t0y,dot01=t0x*t1x+t0y*t1y,dot02=t0x*t2x+t0y*t2y,dot11=t1x*t1x+t1y*t1y,dot12=t1x*t2x+t1y*t2y,bc=dot00*dot11-dot01*dot01,inv=0===bc?0:1/bc,u=(dot11*dot02-dot01*dot12)*inv,v=(dot00*dot12-dot01*dot02)*inv;return u>=0&&v>=0&&u+v<1},isCounterClockwise:function(z){var v1=this.vertex1,v2=this.vertex2,v3=this.vertex3,d=(v2.vx-v1.vx)*(v3.vy-v1.vy)-(v2.vy-v1.vy)*(v3.vx-v1.vx);return z<=0?d>=0:d<0},load:function(F32,U32,offset,textureUnit,tintEffect){return offset=this.vertex1.load(F32,U32,offset,textureUnit,tintEffect),offset=this.vertex2.load(F32,U32,offset,textureUnit,tintEffect),offset=this.vertex3.load(F32,U32,offset,textureUnit,tintEffect)},transformCoordinatesLocal:function(transformMatrix,width,height,cameraZ){return this.vertex1.transformCoordinatesLocal(transformMatrix,width,height,cameraZ),this.vertex2.transformCoordinatesLocal(transformMatrix,width,height,cameraZ),this.vertex3.transformCoordinatesLocal(transformMatrix,width,height,cameraZ),this},updateBounds:function(){var v1=this.vertex1,v2=this.vertex2,v3=this.vertex3,bounds=this.bounds;return bounds.x=Math.min(v1.vx,v2.vx,v3.vx),bounds.y=Math.min(v1.vy,v2.vy,v3.vy),bounds.width=Math.max(v1.vx,v2.vx,v3.vx)-bounds.x,bounds.height=Math.max(v1.vy,v2.vy,v3.vy)-bounds.y,this},isInView:function(camera,hideCCW,z,alpha,a,b,c,d,e,f,roundPixels){var v1=this.vertex1.update(a,b,c,d,e,f,roundPixels,alpha),v2=this.vertex2.update(a,b,c,d,e,f,roundPixels,alpha),v3=this.vertex3.update(a,b,c,d,e,f,roundPixels,alpha);if(v1.ta<=0&&v2.ta<=0&&v3.ta<=0)return!1;if(hideCCW&&!this.isCounterClockwise(z))return!1;var bounds=this.bounds;bounds.x=Math.min(v1.tx,v2.tx,v3.tx),bounds.y=Math.min(v1.ty,v2.ty,v3.ty),bounds.width=Math.max(v1.tx,v2.tx,v3.tx)-bounds.x,bounds.height=Math.max(v1.ty,v2.ty,v3.ty)-bounds.y;var cr=camera.x+camera.width,cb=camera.y+camera.height;return!(bounds.width<=0||bounds.height<=0||camera.width<=0||camera.height<=0)&&!(bounds.right<camera.x||bounds.bottom<camera.y||bounds.x>cr||bounds.y>cb)},translate:function(x,y){void 0===y&&(y=0);var v1=this.vertex1,v2=this.vertex2,v3=this.vertex3;return v1.x+=x,v1.y+=y,v2.x+=x,v2.y+=y,v3.x+=x,v3.y+=y,this},x:{get:function(){return this.getInCenter().x},set:function(value){var current=this.getInCenter();this.translate(value-current.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(value){var current=this.getInCenter();this.translate(0,value-current.y)}},alpha:{get:function(){var v1=this.vertex1,v2=this.vertex2,v3=this.vertex3;return(v1.alpha+v2.alpha+v3.alpha)/3},set:function(value){this.vertex1.alpha=value,this.vertex2.alpha=value,this.vertex3.alpha=value}},depth:{get:function(){var v1=this.vertex1,v2=this.vertex2,v3=this.vertex3;return(v1.vz+v2.vz+v3.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}}),Face_1=Face$4,Utils$3=Utils$p,Vector3$6=Vector3_1,Vertex$4=new Class_1({Extends:Vector3$6,initialize:function(x,y,z,u,v,color,alpha,nx,ny,nz){void 0===color&&(color=16777215),void 0===alpha&&(alpha=1),void 0===nx&&(nx=0),void 0===ny&&(ny=0),void 0===nz&&(nz=0),Vector3$6.call(this,x,y,z),this.vx=0,this.vy=0,this.vz=0,this.nx=nx,this.ny=ny,this.nz=nz,this.u=u,this.v=v,this.color=color,this.alpha=alpha,this.tx=0,this.ty=0,this.ta=0},setUVs:function(u,v){return this.u=u,this.v=v,this},transformCoordinatesLocal:function(transformMatrix,width,height,cameraZ){var x=this.x,y=this.y,z=this.z,m=transformMatrix.val,tx=x*m[0]+y*m[4]+z*m[8]+m[12],ty=x*m[1]+y*m[5]+z*m[9]+m[13],tz=x*m[2]+y*m[6]+z*m[10]+m[14],tw=x*m[3]+y*m[7]+z*m[11]+m[15];this.vx=tx/tw*width,this.vy=-ty/tw*height,this.vz=cameraZ<=0?tz/tw:-tz/tw},update:function(a,b,c,d,e,f,roundPixels,alpha){var tx=this.vx*a+this.vy*c+e,ty=this.vx*b+this.vy*d+f;return roundPixels&&(tx=Math.round(tx),ty=Math.round(ty)),this.tx=tx,this.ty=ty,this.ta=this.alpha*alpha,this},load:function(F32,U32,offset,textureUnit,tintEffect){return F32[++offset]=this.tx,F32[++offset]=this.ty,F32[++offset]=this.u,F32[++offset]=this.v,F32[++offset]=textureUnit,F32[++offset]=tintEffe
471ct,U32[++offset]=Utils$3.getTintAppendFloatAlpha(this.color,this.ta),offset}}),Vertex_1=Vertex$4,Face$3=Face_1,Vertex$3=Vertex_1,GenerateVerts_1=function(vertices,uvs,indicies,containsZ,normals,colors,alphas){if(void 0===containsZ&&(containsZ=!1),void 0===colors&&(colors=16777215),void 0===alphas&&(alphas=1),vertices.length===uvs.length){var i,x,y,z,u,v,color,alpha,normalX,normalY,normalZ,result={faces:[],vertices:[]},iInc=containsZ?3:2,isColorArray=Array.isArray(colors),isAlphaArray=Array.isArray(alphas);if(Array.isArray(indicies)&&indicies.length>0)for(i=0;i<indicies.length;i++){var index1=indicies[i],index2=2*indicies[i],index3=indicies[i]*iInc;x=vertices[index3],y=vertices[index3+1],z=containsZ?vertices[index3+2]:0,u=uvs[index2],v=uvs[index2+1],color=isColorArray?colors[index1]:colors,alpha=isAlphaArray?alphas[index1]:alphas,normalX=0,normalY=0,normalZ=0,normals&&(normalX=normals[index3],normalY=normals[index3+1],normalZ=containsZ?normals[index3+2]:0),result.vertices.push(new Vertex$3(x,y,z,u,v,color,alpha,normalX,normalY,normalZ))}else{var uvIndex=0,colorIndex=0;for(i=0;i<vertices.length;i+=iInc)x=vertices[i],y=vertices[i+1],z=containsZ?vertices[i+2]:0,u=uvs[uvIndex],v=uvs[uvIndex+1],color=isColorArray?colors[colorIndex]:colors,alpha=isAlphaArray?alphas[colorIndex]:alphas,normalX=0,normalY=0,normalZ=0,normals&&(normalX=normals[i],normalY=normals[i+1],normalZ=containsZ?normals[i+2]:0),result.vertices.push(new Vertex$3(x,y,z,u,v,color,alpha,normalX,normalY,normalZ)),uvIndex+=2,colorIndex++}for(i=0;i<result.vertices.length;i+=3){var vert1=result.vertices[i],vert2=result.vertices[i+1],vert3=result.vertices[i+2];result.faces.push(new Face$3(vert1,vert2,vert3))}return result}console.warn("GenerateVerts: vertices and uvs count not equal")},Face$2=Face_1,Matrix4$2=Matrix4_1,Vector3$5=Vector3_1,Vertex$2=Vertex_1,tempPosition$1=new Vector3$5,tempRotation$1=new Vector3$5,tempMatrix$1=new Matrix4$2,GenerateObjVerts_1=function(data,mesh,scale,x,y,z,rotateX,rotateY,rotateZ,zIsUp){void 0===scale&&(scale=1),void 0===x&&(x=0),void 0===y&&(y=0),void 0===z&&(z=0),void 0===rotateX&&(rotateX=0),void 0===rotateY&&(rotateY=0),void 0===rotateZ&&(rotateZ=0),void 0===zIsUp&&(zIsUp=!0);var result={faces:[],verts:[]},materials=data.materials;tempPosition$1.set(x,y,z),tempRotation$1.set(rotateX,rotateY,rotateZ),tempMatrix$1.fromRotationXYTranslation(tempRotation$1,tempPosition$1,zIsUp);for(var m=0;m<data.models.length;m++)for(var model=data.models[m],vertices=model.vertices,textureCoords=model.textureCoords,faces=model.faces,i=0;i<faces.length;i++){var face=faces[i],v1=face.vertices[0],v2=face.vertices[1],v3=face.vertices[2],m1=vertices[v1.vertexIndex],m2=vertices[v2.vertexIndex],m3=vertices[v3.vertexIndex],t1=v1.textureCoordsIndex,t2=v2.textureCoordsIndex,t3=v3.textureCoordsIndex,uv1=-1===t1?{u:0,v:1}:textureCoords[t1],uv2=-1===t2?{u:0,v:0}:textureCoords[t2],uv3=-1===t3?{u:1,v:1}:textureCoords[t3],color=16777215;""!==face.material&&materials[face.material]&&(color=materials[face.material]);var vert1=new Vertex$2(m1.x*scale,m1.y*scale,m1.z*scale,uv1.u,uv1.v,color).transformMat4(tempMatrix$1),vert2=new Vertex$2(m2.x*scale,m2.y*scale,m2.z*scale,uv2.u,uv2.v,color).transformMat4(tempMatrix$1),vert3=new Vertex$2(m3.x*scale,m3.y*scale,m3.z*scale,uv3.u,uv3.v,color).transformMat4(tempMatrix$1);result.verts.push(vert1,vert2,vert3),result.faces.push(new Face$2(vert1,vert2,vert3))}return mesh&&(mesh.faces=mesh.faces.concat(result.faces),mesh.vertices=mesh.vertices.concat(result.verts)),result},GetCalcMatrix$2=GetCalcMatrix_1,MeshWebGLRenderer_1=function(renderer,src,camera,parentMatrix){var faces=src.faces,totalFaces=faces.length;if(0!==totalFaces){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline,src),calcMatrix=GetCalcMatrix$2(src,camera,parentMatrix).calc,textureUnit=pipeline.setGameObject(src),F32=pipeline.vertexViewF32,U32=pipeline.vertexViewU32,vertexOffset=pipeline.vertexCount*pipeline.currentShader.vertexComponentCount-1,tintEffect=src.tintFill,debugFaces=[],debugCallback=src.debugCallback,a=calcMatrix.a,b=calcMatrix.b,c=calcMatrix.c,d=calcMatrix.d,e=calcMatrix.e,f=calcMatrix.f,z=src.viewPosition.z,hideCCW=sr
471c.hideCCW,roundPixels=camera.roundPixels,alpha=camera.alpha*src.alpha,totalFacesRendered=0;renderer.pipelines.preBatch(src);for(var i=0;i<totalFaces;i++){var face=faces[i];face.isInView(camera,hideCCW,z,alpha,a,b,c,d,e,f,roundPixels)&&(pipeline.shouldFlush(3)&&(pipeline.flush(),vertexOffset=0),vertexOffset=face.load(F32,U32,vertexOffset,textureUnit,tintEffect),totalFacesRendered++,pipeline.vertexCount+=3,debugCallback&&debugFaces.push(face))}src.totalFrame+=totalFacesRendered,debugCallback&&debugCallback.call(src,src,debugFaces),renderer.pipelines.postBatch(src)}},DegToRad$3=DegToRad_1,Face$1=Face_1,GameObject$4=GameObject_1,GenerateVerts=GenerateVerts_1,GenerateObjVerts=GenerateObjVerts_1,GetCalcMatrix$1=GetCalcMatrix_1,Matrix4$1=Matrix4_1,StableSort$1=StableSort_1,Vector3$4=Vector3_1,Vertex$1=Vertex_1,Mesh$3=new Class_1({Extends:GameObject$4,Mixins:[components$3.AlphaSingle,components$3.BlendMode,components$3.Depth,components$3.Mask,components$3.Pipeline,components$3.Size,components$3.Texture,components$3.Transform,components$3.Visible,components$3.ScrollFactor,{renderWebGL:MeshWebGLRenderer_1,renderCanvas:function(){}}],initialize:function(scene,x,y,texture,frame,vertices,uvs,indicies,containsZ,normals,colors,alphas){void 0===x&&(x=0),void 0===y&&(y=0),void 0===texture&&(texture="__WHITE"),GameObject$4.call(this,scene,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new Vector3$4,this.modelScale=new Vector3$4(1,1,1),this.modelRotation=new Vector3$4,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new Matrix4$1,this.viewPosition=new Vector3$4,this.viewMatrix=new Matrix4$1,this.projectionMatrix=new Matrix4$1,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var renderer=scene.sys.renderer;this.setPosition(x,y),this.setTexture(texture,frame),this.setSize(renderer.width,renderer.height),this.initPipeline(),this.setPerspective(renderer.width,renderer.height),vertices&&this.addVertices(vertices,uvs,indicies,containsZ,normals,colors,alphas)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(v){return this.viewPosition.addScale(Vector3$4.LEFT,v),this.dirtyCache[10]=1,this},panY:function(v){return this.viewPosition.y+=Vector3$4.DOWN.y*v,this.dirtyCache[10]=1,this},panZ:function(amount){return this.viewPosition.z+=amount,this.dirtyCache[10]=1,this},setPerspective:function(width,height,fov,near,far){return void 0===fov&&(fov=45),void 0===near&&(near=.01),void 0===far&&(far=1e3),this.projectionMatrix.perspective(DegToRad$3(fov),width/height,near,far),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(scaleX,scaleY,near,far){return void 0===scaleX&&(scaleX=this.scene.sys.renderer.getAspectRatio()),void 0===scaleY&&(scaleY=1),void 0===near&&(near=-1e3),void 0===far&&(far=1e3),this.projectionMatrix.ortho(-scaleX,scaleX,-scaleY,scaleY,near,far),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(face){face.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(key,scale,x,y,z,rotateX,rotateY,rotateZ,zIsUp){var data=this.scene.sys.cache.obj.get(key);return data&&GenerateObjVerts(data,this,scale,x,y,z,rotateX,rotateY,rotateZ,zIsUp),this},sortByDepth:function(faceA,faceB){return faceA.depth-faceB.depth},depthSort:function(){return StableSort$1(this.faces,this.sortByDepth),this},addVertex:function(x,y,z,u,v,color,alpha){var vert=new Vertex$1(x,y,z,u,v,color,alpha);return this.vertices.push(vert),vert},addFace:function(vertex1,vertex2,vertex3){var face=new Face$1(vertex1,vertex2,vertex3);return this.faces.push(face),this.dirtyCache[9]=-1,face},addVertices:function(vertices,uvs,indicies,containsZ,normals,colors,alphas){var result=GenerateVerts(vertices,uvs,indicies,containsZ,normals,colors,alphas);return result&&(this.faces=this.faces.concat(result.faces),this.vertices=this.vertices.concat(result.vertices)),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(index){return this.faces[index]}
471,getFaceAt:function(x,y,camera){void 0===camera&&(camera=this.scene.sys.cameras.main);for(var calcMatrix=GetCalcMatrix$1(this,camera).calc,faces=this.faces,results=[],i=0;i<faces.length;i++){var face=faces[i];face.contains(x,y,calcMatrix)&&results.push(face)}return StableSort$1(results,this.sortByDepth)},setDebug:function(graphic,callback){return this.debugGraphic=graphic,this.debugCallback=graphic||callback?callback||this.renderDebug:null,this},isDirty:function(){var position=this.modelPosition,rotation=this.modelRotation,scale=this.modelScale,dirtyCache=this.dirtyCache,px=position.x,py=position.y,pz=position.z,rx=rotation.x,ry=rotation.y,rz=rotation.z,sx=scale.x,sy=scale.y,sz=scale.z,faces=this.getFaceCount(),pxCached=dirtyCache[0],pyCached=dirtyCache[1],pzCached=dirtyCache[2],rxCached=dirtyCache[3],ryCached=dirtyCache[4],rzCached=dirtyCache[5],sxCached=dirtyCache[6],syCached=dirtyCache[7],szCached=dirtyCache[8],fCached=dirtyCache[9];return dirtyCache[0]=px,dirtyCache[1]=py,dirtyCache[2]=pz,dirtyCache[3]=rx,dirtyCache[4]=ry,dirtyCache[5]=rz,dirtyCache[6]=sx,dirtyCache[7]=sy,dirtyCache[8]=sz,dirtyCache[9]=faces,pxCached!==px||pyCached!==py||pzCached!==pz||rxCached!==rx||ryCached!==ry||rzCac
471hed!==rz||sxCached!==sx||syCached!==sy||szCached!==sz||fCached!==faces},preUpdate:function(){this.totalRendered=this.totalFrame,this.totalFrame=0;var dirty=this.dirtyCache;if(this.ignoreDirtyCache||dirty[10]||this.isDirty()){var width=this.width,height=this.height,viewMatrix=this.viewMatrix,viewPosition=this.viewPosition;dirty[10]&&(viewMatrix.identity(),viewMatrix.translate(viewPosition),viewMatrix.invert(),dirty[10]=0);var transformMatrix=this.transformMatrix;transformMatrix.setWorldMatrix(this.modelRotation,this.modelPosition,this.modelScale,this.viewMatrix,this.projectionMatrix);for(var z=viewPosition.z,faces=this.faces,i=0;i<faces.length;i++)faces[i].transformCoordinatesLocal(transformMatrix,width,height,z);this.depthSort()}},renderDebug:function(src,faces){for(var graphic=src.debugGraphic,i=0;i<faces.length;i++){var face=faces[i],x0=face.vertex1.tx,y0=face.vertex1.ty,x1=face.vertex2.tx,y1=face.vertex2.ty,x2=face.vertex3.tx,y2=face.vertex3.ty;graphic.strokeTriangle(x0,y0,x1,y1,x2,y2)}},preDestroy:function(){this.clear(),this.debugCallback=null,this.debugGraphic=null}}),Mesh_1=Mesh$3,GetCalcMatrix=GetCalcMatrix_1,PointLightWebGLRenderer_1=function(renderer,src,camera,parentMatrix){camera.addToRenderList(src);var pipeline=renderer.pipelines.set(src.pipeline),calcMatrix=GetCalcMatrix(src,camera,parentMatrix).calc,width=src.width,height=src.height,x=-src._radius,y=-src._radius,xw=x+width,yh=y+height,lightX=calcMatrix.getX(0,0),lightY=calcMatrix.getY(0,0),tx0=calcMatrix.getX(x,y),ty0=calcMatrix.getY(x,y),tx1=calcMatrix.getX(x,yh),ty1=calcMatrix.getY(x,yh),tx2=calcMatrix.getX(xw,yh),ty2=calcMatrix.getY(xw,yh),tx3=calcMatrix.getX(xw,y),ty3=calcMatrix.getY(xw,y);renderer.pipelines.preBatch(src),pipeline.batchPointLight(src,camera,tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,lightX,lightY),renderer.pipelines.postBatch(src)},GameObject$3=GameObject_1,IntegerToColor=IntegerToColor_1,PIPELINES_CONST=_const$9,PointLight$3=new Class_1({Extends:GameObject$3,Mixins:[components$3.AlphaSingle,components$3.BlendMode,components$3.Depth,components$3.GetBounds,components$3.Mask,components$3.Pipeline,components$3.ScrollFactor,components$3.Transform,components$3.Visible,{renderWebGL:PointLightWebGLRenderer_1,renderCanvas:NOOP_1}],initialize:function(scene,x,y,color,radius,intensity,attenuation){void 0===color&&(color=16777215),void 0===radius&&(radius=128),void 0===intensity&&(intensity=1),void 0===attenuation&&(attenuation=.1),GameObject$3.call(this,scene,"PointLight"),this.initPipeline(PIPELINES_CONST.POINTLIGHT_PIPELINE),this.setPosition(x,y),this.color=IntegerToColor(color),this.intensity=intensity,this.attenuation=attenuation,this.width=2*radius,this.height=2*radius,this._radius=radius},radius:{get:function(){return this._radius},set:function(value){this._radius=value,this.width=2*value,this.height=2*value}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}}),PointLight_1=PointLight$3,Shader$2=Shader_1;GameObjectFactory_1.register("shader",(function(key,x,y,width,height,textures,textureData){return this.displayList.add(new Shader$2(this.scene,key,x,y,width,height,textures,textureData))}));var Mesh$2=Mesh_1;
472/**
473	 * @author       Richard Davey <[email protected]>
474	 * @copyright    2020 Photon Storm Ltd.
475	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
476	 */GameObjectFactory_1.register("mesh",(function(x,y,texture,frame,vertices,uvs,indicies,containsZ,normals,colors,alphas){return this.displayList.add(new Mesh$2(this.scene,x,y,texture,frame,vertices,uvs,indicies,containsZ,normals,colors,alphas))}));var PointLight$2=PointLight_1;
477/**
478	 * @author       Richard Davey <[email protected]>
479	 * @copyright    2020 Photon Storm Ltd.
480	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
481	 */GameObjectFactory_1.register("pointlight",(function(x,y,color,radius,intensity,attenuation){return this.displayList.add(new PointLight$2(this.scene,x,y,color,radius,intensity,attenuation))}));var BuildGameObject$2=BuildGameObject_1,GetAdvancedValue$5=GetAdvancedValue_1,Shader$1=Shader_1;
482/**
483	 * @author       Richard Davey <[email protected]>
484	 * @copyright    2020 Photon Storm Ltd.
485	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
486	 */GameObjectCreator_1.register("shader",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$5(config,"key",null),x=GetAdvancedValue$5(config,"x",0),y=GetAdvancedValue$5(config,"y",0),width=GetAdvancedValue$5(config,"width",128),height=GetAdvancedValue$5(config,"height",128),shader=new Shader$1(this.scene,key,x,y,width,height);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$2(this.scene,shader,config),shader}));var BuildGameObject$1=BuildGameObject_1,GetAdvancedValue$4=GetAdvancedValue_1,GetValue$e=GetValue_1,Mesh$1=Mesh_1;
487/**
488	 * @author       Richard Davey <[email protected]>
489	 * @copyright    2020 Photon Storm Ltd.
490	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
491	 */GameObjectCreator_1.register("mesh",(function(config,addToScene){void 0===config&&(config={});var key=GetAdvancedValue$4(config,"key",null),frame=GetAdvancedValue$4(config,"frame",null),vertices=GetValue$e(config,"vertices",[]),uvs=GetValue$e(config,"uvs",[]),indicies=GetValue$e(config,"indicies",[]),containsZ=GetValue$e(config,"containsZ",!1),normals=GetValue$e(config,"normals",[]),colors=GetValue$e(config,"colors",16777215),alphas=GetValue$e(config,"alphas",1),mesh=new Mesh$1(this.scene,0,0,key,frame,vertices,uvs,indicies,containsZ,normals,colors,alphas);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject$1(this.scene,mesh,config),mesh}));var BuildGameObject=BuildGameObject_1,GetAdvancedValue$3=GetAdvancedValue_1,PointLight$1=PointLight_1;
492/**
493	 * @author       Richard Davey <[email protected]>
494	 * @copyright    2020 Photon Storm Ltd.
495	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
496	 */GameObjectCreator_1.register("pointlight",(function(config,addToScene){void 0===config&&(config={});var color=GetAdvancedValue$3(config,"color",16777215),radius=GetAdvancedValue$3(config,"radius",128),intensity=GetAdvancedValue$3(config,"intensity",1),attenuation=GetAdvancedValue$3(config,"attenuation",.1),layer=new PointLight$1(this.scene,0,0,color,radius,intensity,attenuation);return void 0!==addToScene&&(config.add=addToScene),BuildGameObject(this.scene,layer,config),layer}));
497/**
498	 * @author       Richard Davey <[email protected]>
499	 * @copyright    2020 Photon Storm Ltd.
500	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
501	 */
502var Circle$5=Circle_1,RGB$1=RGB_1,Utils$2=Utils$p,Light$1=new Class_1({Extends:Circle$5,Mixins:[components$3.ScrollFactor,components$3.Visible],initialize:function(x,y,radius,r,g,b,intensity){Circle$5.call(this,x,y,radius),this.color=new RGB$1(r,g,b),this.intensity=intensity,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1)},willRender:function(camera){return!(Light$1.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&camera.id
vendor: 2,859 bytes, line 502
502)},setColor:function(rgb){var color=Utils$2.getFloatsFromUintRGB(rgb);return this.color.set(color[0],color[1],color[2]),this},setIntensity:function(intensity){return this.intensity=intensity,this},setRadius:function(radius){return this.radius=radius,this}});Light$1.RENDER_MASK=15;var Light_1=Light$1,CircleToRectangle_1=function(circle,rect){var halfWidth=rect.width/2,halfHeight=rect.height/2,cx=Math.abs(circle.x-rect.x-halfWidth),cy=Math.abs(circle.y-rect.y-halfHeight),xDist=halfWidth+circle.radius,yDist=halfHeight+circle.radius;if(cx>xDist||cy>yDist)return!1;if(cx<=halfWidth||cy<=halfHeight)return!0;var xCornerDist=cx-halfWidth,yCornerDist=cy-halfHeight;return xCornerDist*xCornerDist+yCornerDist*yCornerDist<=circle.radius*circle.radius},CircleToRectangle$2=CircleToRectangle_1,DistanceBetween$5=DistanceBetween_1,Light=Light_1,PointLight=PointLight_1,RGB=RGB_1,SpliceOne$1=SpliceOne_1,StableSort=StableSort_1,Utils$1=Utils$p,LightsManager$1=new Class_1({initialize:function(){this.lights=[],this.ambientColor=new RGB(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(x,y,color,radius,intensity,attenuation){return this.systems.displayList.add(new PointLight(this.scene,x,y,color,radius,intensity,attenuation))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(camera){for(var lights=this.lights,worldView=camera.worldView,visibleLights=[],i=0;i<lights.length;i++){var light=lights[i];light.willRender(camera)&&CircleToRectangle$2(light,worldView)&&visibleLights.push({light:light,distance:DistanceBetween$5(light.x,light.y,worldView.centerX,worldView.centerY)})}return visibleLights.length>this.maxLights&&(StableSort(visibleLights,this.sortByDistance),visibleLights=visibleLights.slice(0,this.maxLights)),this.visibleLights=visibleLights.length,visibleLights},sortByDistance:function(a,b){return a.distance>=b.distance},setAmbientColor:function(rgb){var color=Utils$1.getFloatsFromUintRGB(rgb);return this.ambientColor.set(color[0],color[1],color[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(x,y,radius,rgb,intensity){void 0===x&&(x=0),void 0===y&&(y=0),void 0===radius&&(radius=128),void 0===rgb&&(rgb=16777215),void 0===intensity&&(intensity=1);var color=Utils$1.getFloatsFromUintRGB(rgb),light=new Light(x,y,radius,color[0],color[1],color[2],intensity);return this.lights.push(light),light},removeLight:function(light){var index=this.lights.indexOf(light);return index>=0&&SpliceOne$1(this.lights,index),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}}),LightsManager_1=LightsManager$1,LightsManager=LightsManager_1,PluginCache$7=PluginCache_
5021,SceneEvents$8=events$g,LightsPlugin=new Class_1({Extends:LightsManager,initialize:function(scene){this.scene=scene,this.systems=scene.sys,scene.sys.settings.isBooted||scene.sys.events.once(SceneEvents$8.BOOT,this.boot,this),LightsManager.call(this)},boot:function(){var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents$8.SHUTDOWN,this.shutdown,this),eventEmitter.on(SceneEvents$8.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});
503/**
504	 * @author       Richard Davey <[email protected]>
505	 * @copyright    2020 Photon Storm Ltd.
506	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
507	 */PluginCache$7.register("LightsPlugin",LightsPlugin,"lights");var LightsPlugin_1=LightsPlugin,GameObjects={Events:events$h,DisplayList:DisplayList_1,GameObjectCreator:GameObjectCreator_1,GameObjectFactory:GameObjectFactory_1,UpdateList:UpdateList_1,Components:components$3,GetCalcMatrix:GetCalcMatrix_1,BuildGameObject:BuildGameObject_1,BuildGameObjectAnimation:BuildGameObjectAnimation_1,GameObject:GameObject_1,BitmapText:BitmapText_1,Blitter:Blitter_1,Bob:Bob_1,Container:Container_1,DOMElement:DOMElement_1,DynamicBitmapText:DynamicBitmapText_1,Extern:Extern_1,Graphics:Graphics_1,Group:Group_1,Image:Image_1,Layer:Layer_1,Particles:particles,PathFollower:PathFollower_1,RenderTexture:RenderTexture_1,RetroFont:RetroFont_1,Rope:Rope_1,Sprite:Sprite_1,Text:Text_1,GetTextSize:GetTextSize_1,MeasureText:MeasureText_1,TextStyle:TextStyle_1,TileSprite:TileSprite_1,Zone:Zone_1,Video:Video_1,Shape:Shape_1,Arc:Arc_1,Curve:Curve_1,Ellipse:Ellipse_1,Grid:Grid_1$1,IsoBox:IsoBox_1,IsoTriangle:IsoTriangle_1,Line:Line_1,Polygon:Polygon_1,Rectangle:Rectangle_1,Star:Star_1,Triangle:Triangle_1,Factories:{Blitter:{},Container:{},DOMElement:{},DynamicBitmapText:{},Extern:{},Graphics:{},Group:{},Image:{},Layer:{},Particles:{},PathFollower:{},RenderTexture:{},Rope:{},Sprite:{},StaticBitmapText:{},Text:{},TileSprite:{},Zone:{},Video:{},Arc:{},Curve:{},Ellipse:{},Grid:{},IsoBox:{},IsoTriangle:{},Line:{},Polygon:{},Rectangle:{},Star:{},Triangle:{}},Creators:{Blitter:{},Container:{},DynamicBitmapText:{},Graphics:{},Group:{},Image:{},Layer:{},Particles:{},RenderTexture:{},Rope:{},Sprite:{},StaticBitmapText:{},Text:{},TileSprite:{},Zone:{},Video:{}}};
508/**
509	 * @author       Richard Davey <[email protected]>
510	 * @copyright    2020 Photon Storm Ltd.
511	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
512	 */GameObjects.Shader=Shader_1,GameObjects.Mesh=Mesh_1,GameObjects.PointLight=PointLight_1,GameObjects.Factories.Shader={},GameObjects.Factories.Mesh={},GameObjects.Factories.PointLight={},GameObjects.Creators.Shader={},GameObjects.Creators.Mesh={},GameObjects.Creators.PointLight={},GameObjects.Light=Light_1,GameObjects.LightsManager=LightsManager_1,GameObjects.LightsPlugin=LightsPlugin_1;var gameobjects=GameObjects,Area_1$3=function(circle){return circle.radius>0?Math.PI*circle.radius*circle.radius:0},Circle$4=Circle_1,Clone_1$6=function(source){return new Circle$4(source.x,source.y,source.radius)},Contains$9=Contains_1$4,ContainsPoint_1$4=function(circle,point){return Contains$9(circle,point.x,point.y)},Contains$8=Contains_1$4,ContainsRect_1$2=function(circle,rect){return Contains$8(circle,rect.x,rect.y)&&Contains$8(circle,rect.right,rect.y)&&Contains$8(circle,rect.x,rect.bottom)&&Contains$8(circle,rect.right,rect.bottom)},CopyFrom_1$5=function(source,dest){return dest.setTo(source.x,source.y,source.radius)},Equals_1$5=function(circle,toCompare){return circle.x===toCompare.x&&circle.y===toCompare.y&&circle.radius===toCompare.radius},Rectangle$c=Rectangle_1$1,GetBounds_1$1=function(circle,out){return void 0===out&&(out=new Rectangle$c),out.x=circle.left,out.y=circle.top,out.width=circle.diameter,out.height=circle.diameter,out}
512,Offset_1$4=function(circle,x,y){return circle.x+=x,circle.y+=y,circle},OffsetPoint_1$2=function(circle,point){return circle.x+=point.x,circle.y+=point.y,circle},Circle$3=Circle_1;
513/**
514	 * @author       Richard Davey <[email protected]>
515	 * @copyright    2020 Photon Storm Ltd.
516	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
517	 */Circle$3.Area=Area_1$3,Circle$3.Circumference=Circumference_1$1,Circle$3.CircumferencePoint=CircumferencePoint_1$1,Circle$3.Clone=Clone_1$6,Circle$3.Contains=Contains_1$4,Circle$3.ContainsPoint=ContainsPoint_1$4,Circle$3.ContainsRect=ContainsRect_1$2,Circle$3.CopyFrom=CopyFrom_1$5,Circle$3.Equals=Equals_1$5,Circle$3.GetBounds=GetBounds_1$1,Circle$3.GetPoint=GetPoint_1$4,Circle$3.GetPoints=GetPoints_1$5,Circle$3.Offset=Offset_1$4,Circle$3.OffsetPoint=OffsetPoint_1$2,Circle$3.Random=Random_1$5;var circle=Circle$3,Area_1$2=function(ellipse){return ellipse.isEmpty()?0:ellipse.getMajorRadius()*ellipse.getMinorRadius()*Math.PI},Ellipse$2=Ellipse_1$1,Clone_1$5=function(source){return new Ellipse$2(source.x,source.y,source.width,source.height)},Contains$7=Contains_1$2,ContainsPoint_1$3=function(ellipse,point){return Contains$7(ellipse,point.x,point.y)},Contains$6=Contains_1$2,ContainsRect_1$1=function(ellipse,rect){return Contains$6(ellipse,rect.x,rect.y)&&Contains$6(ellipse,rect.right,rect.y)&&Contains$6(ellipse,rect.x,rect.bottom)&&Contains$6(ellipse,rect.right,rect.bottom)},CopyFrom_1$4=function(source,dest){return dest.setTo(source.x,source.y,source.width,source.height)},Equals_1$4=function(ellipse,toCompare){return ellipse.x===toCompare.x&&ellipse.y===toCompare.y&&ellipse.width===toCompare.width&&ellipse.height===toCompare.height},Rectangle$b=Rectangle_1$1,GetBounds_1=function(ellipse,out){return void 0===out&&(out=new Rectangle$b),out.x=ellipse.left,out.y=ellipse.top,out.width=ellipse.width,out.height=ellipse.height,out},Offset_1$3=function(ellipse,x,y){return ellipse.x+=x,ellipse.y+=y,ellipse},OffsetPoint_1$1=function(ellipse,point){return ellipse.x+=point.x,ellipse.y+=point.y,ellipse},Ellipse$1=Ellipse_1$1;
518/**
519	 * @author       Richard Davey <[email protected]>
520	 * @copyright    2020 Photon Storm Ltd.
521	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
522	 */Ellipse$1.Area=Area_1$2,Ellipse$1.Circumference=Circumference_1,Ellipse$1.CircumferencePoint=CircumferencePoint_1,Ellipse$1.Clone=Clone_1$5,Ellipse$1.Contains=Contains_1$2,Ellipse$1.ContainsPoint=ContainsPoint_1$3,Ellipse$1.ContainsRect=ContainsRect_1$1,Ellipse$1.CopyFrom=CopyFrom_1$4,Ellipse$1.Equals=Equals_1$4,Ellipse$1.GetBounds=GetBounds_1,Ellipse$1.GetPoint=GetPoint_1$1,Ellipse$1.GetPoints=GetPoints_1$2,Ellipse$1.Offset=Offset_1$3,Ellipse$1.OffsetPoint=OffsetPoint_1$1,Ellipse$1.Random=Random_1$2;var ellipse=Ellipse$1,DistanceBetween$4=DistanceBetween_1,CircleToCircle_1=function(circleA,circleB){return DistanceBetween$4(circleA.x,circleA.y,circleB.x,circleB.y)<=circleA.radius+circleB.radius},Point$m=Point_1,CircleToCircle$1=CircleToCircle_1,GetCircleToCircle_1=function(circleA,circleB,out){if(void 0===out&&(out=[]),CircleToCircle$1(circleA,circleB)){var coefficientA,coefficientB,lambda,x,x0=circleA.x,y0=circleA.y,r0=circleA.radius,x1=circleB.x,y1=circleB.y,r1=circleB.radius;if(y0===y1)0===(lambda=(coefficientB=-2*y1)*coefficientB-4*(coefficientA=1)*(x1*x1+(x=(r1*r1-r0*r0-x1*x1+x0*x0)/(2*(x0-x1)))*x-2*x1*x+y1*y1-r1*r1))?out.push(new Point$m(x,-coefficientB/(2*coefficientA))):lambda>0&&(out.push(new Point$m(x,(-coefficientB+Math.sqrt(lambda))/(2*coefficientA))),out.push(new Point$m(x,(-coefficientB-Math.sqrt(lambda))/(2*coefficientA))));else{var v1=(x0-x1)/(y0-y1),n=(r1*r1-r0*r0-x1*x1+x0*x0-y1*y1+y0*y0)/(2*(y0-y1));0===(lambda=(coefficientB=2*y0*v1-2*n*v1-2*x0)*coefficientB-4*(coefficientA=v1*v1+1)*(x0*x0+y0*y0+n*n-r0*r0-2*y0*n))?(x=-coefficientB/(2*coefficientA),out.push(new Point$m(x,n-x*v1))):lambda>0&&(x=(-coefficientB+Math.sqrt(lambda))/(2*coefficientA),out.push(new Point$m(x,n-x*v1)),x=(-coefficientB-Math.sqrt(lambda))/(2*coefficientA),out.push(new Point$m(x,n-x*v1)))}}return out},Contains$5=Contains_1$4,tmp=new Point_1,LineToCircle_1=function(line,cir
522cle,nearest){if(void 0===nearest&&(nearest=tmp),Contains$5(circle,line.x1,line.y1))return nearest.x=line.x1,nearest.y=line.y1,!0;if(Contains$5(circle,line.x2,line.y2))return nearest.x=line.x2,nearest.y=line.y2,!0;var dx=line.x2-line.x1,dy=line.y2-line.y1,lcx=circle.x-line.x1,lcy=circle.y-line.y1,dLen2=dx*dx+dy*dy,px=dx,py=dy;if(dLen2>0){var dp=(lcx*dx+lcy*dy)/dLen2;px*=dp,py*=dp}return nearest.x=line.x1+px,nearest.y=line.y1+py,px*px+py*py<=dLen2&&px*dx+py*dy>=0&&Contains$5(circle,nearest.x,nearest.y)},Point$k=Point_1,LineToCircle$1=LineToCircle_1,GetLineToCircle_1=function(line,circle,out){if(void 0===out&&(out=[]),LineToCircle$1(line,circle)){var x,y,lx1=line.x1,ly1=line.y1,lx2=line.x2,ly2=line.y2,cx=circle.x,cy=circle.y,cr=circle.radius,lDirX=lx2-lx1,lDirY=ly2-ly1,oDirX=lx1-cx,oDirY=ly1-cy,coefficientA=lDirX*lDirX+lDirY*lDirY,coefficientB=2*(lDirX*oDirX+lDirY*oDirY),lambda=coefficientB*coefficientB-4*coefficientA*(oDirX*oDirX+oDirY*oDirY-cr*cr);if(0===lambda){var root=-coefficientB/(2*coefficientA);x=lx1+root*lDirX,y=ly1+root*lDirY,root>=0&&root<=1&&out.push(new Point$k(x,y))}else if(lambda>0){var root1=(-coefficientB-Math.sqrt(lambda))/(2*coefficientA);x=lx1+root1*lDirX,y=ly1+root1*lDirY,root1>=0&&root1<=1&&out.push(new Point$k(x,y));var root2=(-coefficientB+Math.sqrt(lambda))/(2*coefficientA);x=lx1+root2*lDirX,y=ly1+root2*lDirY,root2>=0&&root2<=1&&out.push(new Point$k(x,y))}}return out},GetLineToCircle$1=GetLineToCircle_1,CircleToRectangle$1=CircleToRectangle_1,GetCircleToRectangle_1=function(circle,rect,out){if(void 0===out&&(out=[]),CircleToRectangle$1(circle,rect)){var lineA=rect.getLineA(),lineB=rect.getLineB(),lineC=rect.getLineC(),lineD=rect.getLineD();GetLineToCircle$1(lineA,circle,out),GetLineToCircle$1(lineB,circle,out),GetLineToCircle$1(lineC,circle,out),GetLineToCircle$1(lineD,circle,out)}return out},Vector3$3=Vector3_1,GetLineToLine_1=function(line1,line2,out){var x1=line1.x1,y1=line1.y1,x2=line1.x2,y2=line1.y2,x3=line2.x1,y3=line2.y1,dx1=x2-x1,dy1=y2-y1,dx2=line2.x2-x3,dy2=line2.y2-y3;if(0===dx1||0===dy2*dx1-dx2*dy1)return!1;var T2=(dx1*(y3-y1)+dy1*(x1-x3))/(dx2*dy1-dy2*dx1),T1=(x3+dx2*T2-x1)/dx1;return T1<0||T2<0||T2>1?null:(void 0===out&&(out=new Vector3$3),out.set(x1+dx1*T1,y1+dy1*T1,T1))},Vector3$2=Vector3_1,GetLineToLine=GetLineToLine_1,segment$1=new Line_1$1,tempIntersect$1=new Vector3$2,GetLineToPoints_1=function(line,points,out){void 0===out&&(out=new Vector3$2);var closestIntersect=!1;out.set(),tempIntersect$1.set();for(var prev=points[0],i=1;i<points.length;i++){var current=points[i];segment$1.setTo(prev.x,prev.y,current.x,current.y),prev=current,GetLineToLine(line,segment$1,tempIntersect$1)&&(!closestIntersect||tempIntersect$1.z<out.z)&&(out.copy(tempIntersect$1),closestIntersect=!0)}return closestIntersect?out:null},Vector4$1=Vector4_1,GetLineToPoints=GetLineToPoints_1,tempIntersect=new Vector3_1,GetLineToPolygon_1=function(line,polygons,out){void 0===out&&(out=new Vector4$1),Array.isArray(polygons)||(polygons=[polygons]);var closestIntersect=!1;out.set(),tempIntersect.set();for(var i=0;i<polygons.length;i++)GetLineToPoints(line,polygons[i].points,tempIntersect)&&(!closestIntersect||tempIntersect.z<out.z)&&(out.set(tempIntersect.x,tempIntersect.y,tempIntersect.z,i),closestIntersect=!0);return closestIntersect?out:null},Point$j=Point_1,LineToLine_1=function(line1,line2,out){void 0===out&&(out=new Point$j);var x1=line1.x1,y1=line1.y1,x2=line1.x2,y2=line1.y2,x3=line2.x1,y3=line2.y1,x4=line2.x2,y4=line2.y2,deNom=(y4-y3)*(x2-x1)-(x4-x3)*(y2-y1);if(0===deNom)return!1;var uA=((x4-x3)*(y1-y3)-(y4-y3)*(x1-x3))/deNom,uB=((x2-x1)*(y1-y3)-(y2-y1)*(x1-x3))/deNom;return uA>=0&&uA<=1&&uB>=0&&uB<=1&&(out.x=x1+uA*(x2-x1),out.y=y1+uA*(y2-y1),!0)},LineToRectangle_1=function(line,rect){var x1=line.x1,y1=line.y1,x2=line.x2,y2=line.y2,bx1=rect.x,by1=rect.y,bx2=rect.right,by2=rect.bottom,t=0;if(x1>=bx1&&x1<=bx2&&y1>=by1&&y1<=by2||x2>=bx1&&x2<=bx2&&y2>=by1&&y2<=by2)return!0;if(x1<bx1&&x2>=bx1){if((t=y1+(y2-y1)*(bx1-x1)/(x2-x1))>by1&&t<=by2)return!0}else if(x1>bx2&&x2<=bx2&&(t=y1+(y2-y1)*(bx2-x1)/(x2-x1))>=by1&&t<=by2)return!0;
522if(y1<by1&&y2>=by1){if((t=x1+(x2-x1)*(by1-y1)/(y2-y1))>=bx1&&t<=bx2)return!0}else if(y1>by2&&y2<=by2&&(t=x1+(x2-x1)*(by2-y1)/(y2-y1))>=bx1&&t<=bx2)return!0;return!1},Point$i=Point_1,LineToLine$4=LineToLine_1,LineToRectangle=LineToRectangle_1,GetLineToRectangle_1=function(line,rect,out){if(void 0===out&&(out=[]),LineToRectangle(line,rect))for(var lineA=rect.getLineA(),lineB=rect.getLineB(),lineC=rect.getLineC(),lineD=rect.getLineD(),output=[new Point$i,new Point$i,new Point$i,new Point$i],result=[LineToLine$4(lineA,line,output[0]),LineToLine$4(lineB,line,output[1]),LineToLine$4(lineC,line,output[2]),LineToLine$4(lineD,line,output[3])],i=0;i<4;i++)result[i]&&out.push(output[i]);return out},Vector4=Vector4_1,GetLineToPolygon=GetLineToPolygon_1,segment=new Line_1$1;
523/**
524	 * @author       Richard Davey <[email protected]>
525	 * @copyright    2020 Photon Storm Ltd.
526	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
527	 */function CheckIntersects(angle,x,y,polygons,intersects){var dx=Math.cos(angle),dy=Math.sin(angle);segment.setTo(x,y,x+dx,y+dy);var closestIntersect=GetLineToPolygon(segment,polygons);closestIntersect&&intersects.push(new Vector4(closestIntersect.x,closestIntersect.y,angle,closestIntersect.w))}function SortIntersects(a,b){return a.z-b.z}var GetRaysFromPointToPolygon_1=function(x,y,polygons){Array.isArray(polygons)||(polygons=[polygons]);for(var intersects=[],angles=[],i=0;i<polygons.length;i++)for(var points=polygons[i].points,p=0;p<points.length;p++){var angle=Math.atan2(points[p].y-y,points[p].x-x);-1===angles.indexOf(angle)&&(CheckIntersects(angle,x,y,polygons,intersects),CheckIntersects(angle-1e-5,x,y,polygons,intersects),CheckIntersects(angle+1e-5,x,y,polygons,intersects),angles.push(angle))}return intersects.sort(SortIntersects)},RectangleToRectangle_1=function(rectA,rectB){return!(rectA.width<=0||rectA.height<=0||rectB.width<=0||rectB.height<=0)&&!(rectA.right<rectB.x||rectA.bottom<rectB.y||rectA.x>rectB.right||rectA.y>rectB.bottom)},Rectangle$a=Rectangle_1$1,RectangleToRectangle$1=RectangleToRectangle_1,GetLineToRectangle$1=GetLineToRectangle_1,RectangleToRectangle=RectangleToRectangle_1,ContainsArray_1=function(triangle,points,returnFirst,out){void 0===returnFirst&&(returnFirst=!1),void 0===out&&(out=[]);for(var u,v,v2x,v2y,dot02,dot12,v0x=triangle.x3-triangle.x1,v0y=triangle.y3-triangle.y1,v1x=triangle.x2-triangle.x1,v1y=triangle.y2-triangle.y1,dot00=v0x*v0x+v0y*v0y,dot01=v0x*v1x+v0y*v1y,dot11=v1x*v1x+v1y*v1y,b=dot00*dot11-dot01*dot01,inv=0===b?0:1/b,x1=triangle.x1,y1=triangle.y1,i=0;i<points.length&&(v=(dot00*(dot12=v1x*(v2x=points[i].x-x1)+v1y*(v2y=points[i].y-y1))-dot01*(dot02=v0x*v2x+v0y*v2y))*inv,!((u=(dot11*dot02-dot01*dot12)*inv)>=0&&v>=0&&u+v<1&&(out.push({x:points[i].x,y:points[i].y}),returnFirst)));i++);return out},Decompose_1$1=function(rect,out){return void 0===out&&(out=[]),out.push({x:rect.x,y:rect.y}),out.push({x:rect.right,y:rect.y}),out.push({x:rect.right,y:rect.bottom}),out.push({x:rect.x,y:rect.bottom}),out},LineToLine$3=LineToLine_1,Contains$4=Contains_1$3,ContainsArray$1=ContainsArray_1,Decompose$2=Decompose_1$1,RectangleToTriangle_1=function(rect,triangle){if(triangle.left>rect.right||triangle.right<rect.left||triangle.top>rect.bottom||triangle.bottom<rect.top)return!1;var triA=triangle.getLineA(),triB=triangle.getLineB(),triC=triangle.getLineC();if(Contains$4(rect,triA.x1,triA.y1)||Contains$4(rect,triA.x2,triA.y2))return!0;if(Contains$4(rect,triB.x1,triB.y1)||Contains$4(rect,triB.x2,triB.y2))return!0;if(Contains$4(rect,triC.x1,triC.y1)||Contains$4(rect,triC.x2,triC.y2))return!0;var rectA=rect.getLineA(),rectB=rect.getLineB(),rectC=rect.getLineC(),rectD=rect.getLineD();if(LineToLine$3(triA,rectA)||LineToLine$3(triA,rectB)||LineToLine$3(triA,rectC)||LineToLine$3(triA,rectD))return!0;if(LineToLine$3(triB,rectA)||LineToLine$3(triB,rectB)||LineToLine$3(triB,rectC)||LineToLine$3(triB,rectD))return!0;if(LineToLine$3(triC,rectA)||LineToLine$3(triC,rectB)||LineToLine$3(triC,rectC)||LineToLine$3(triC,rectD))return!0;var points=Decompose$2(rect);return ContainsArray$1(triangle,points,!0).length>0},RectangleToTriangle=RectangleToTriangle_1,GetLineToRectangle=GetLineToRectangle_1,GetRectangleToTriangle_1=function(rect,triangle,out){if(void 0===out&&(out=[]),RectangleToTriangle(rect,triangle)){var lineA=triangle.getLineA(),lineB=triangle.getLineB(),lineC=triangle.getLineC();GetLineToRectangle(lineA,rect,out),GetLineToRectangle(lineB,rect,out),GetLineToRectangle(lineC,rect,out)}return out},LineToCircle=LineToCircle_1,Contains$3=Contains_1,TriangleToCircle_1=function(triangle,circle){return!(triangle.left>circle.right||triangle.right<circle.left||triangle.top>
527circle.bottom||triangle.bottom<circle.top)&&(!!Contains$3(triangle,circle.x,circle.y)||(!!LineToCircle(triangle.getLineA(),circle)||(!!LineToCircle(triangle.getLineB(),circle)||!!LineToCircle(triangle.getLineC(),circle))))},GetLineToCircle=GetLineToCircle_1,TriangleToCircle=TriangleToCircle_1,GetTriangleToCircle_1=function(triangle,circle,out){if(void 0===out&&(out=[]),TriangleToCircle(triangle,circle)){var lineA=triangle.getLineA(),lineB=triangle.getLineB(),lineC=triangle.getLineC();GetLineToCircle(lineA,circle,out),GetLineToCircle(lineB,circle,out),GetLineToCircle(lineC,circle,out)}return out},LineToLine$2=LineToLine_1,TriangleToLine_1=function(triangle,line){return!(!triangle.contains(line.x1,line.y1)&&!triangle.contains(line.x2,line.y2))||(!!LineToLine$2(triangle.getLineA(),line)||(!!LineToLine$2(triangle.getLineB(),line)||!!LineToLine$2(triangle.getLineC(),line)))},Point$h=Point_1,TriangleToLine=TriangleToLine_1,LineToLine$1=LineToLine_1,GetTriangleToLine_1=function(triangle,line,out){if(void 0===out&&(out=[]),TriangleToLine(triangle,line))for(var lineA=triangle.getLineA(),lineB=triangle.getLineB(),lineC=triangle.getLineC(),output=[new Point$h,new Point$h,new Point$h],result=[LineToLine$1(lineA,line,output[0]),LineToLine$1(lineB,line,output[1]),LineToLine$1(lineC,line,output[2])],i=0;i<3;i++)result[i]&&out.push(output[i]);return out},Decompose_1=function(triangle,out){return void 0===out&&(out=[]),out.push({x:triangle.x1,y:triangle.y1}),out.push({x:triangle.x2,y:triangle.y2}),out.push({x:triangle.x3,y:triangle.y3}),out}
527,ContainsArray=ContainsArray_1,Decompose=Decompose_1,LineToLine=LineToLine_1,TriangleToTriangle_1=function(triangleA,triangleB){if(triangleA.left>triangleB.right||triangleA.right<triangleB.left||triangleA.top>triangleB.bottom||triangleA.bottom<triangleB.top)return!1;var lineAA=triangleA.getLineA(),lineAB=triangleA.getLineB(),lineAC=triangleA.getLineC(),lineBA=triangleB.getLineA(),lineBB=triangleB.getLineB(),lineBC=triangleB.getLineC();if(LineToLine(lineAA,lineBA)||LineToLine(lineAA,lineBB)||LineToLine(lineAA,lineBC))return!0;if(LineToLine(lineAB,lineBA)||LineToLine(lineAB,lineBB)||LineToLine(lineAB,lineBC))return!0;if(LineToLine(lineAC,lineBA)||LineToLine(lineAC,lineBB)||LineToLine(lineAC,lineBC))return!0;var points=Decompose(triangleA),within=ContainsArray(triangleB,points,!0);return within.length>0||(points=Decompose(triangleB),(within=ContainsArray(triangleA,points,!0)).length>0)},TriangleToTriangle=TriangleToTriangle_1,GetTriangleToLine=GetTriangleToLine_1,PointToLine_1=function(point,line,lineThickness){void 0===lineThickness&&(lineThickness=1);var x1=line.x1,y1=line.y1,x2=line.x2,y2=line.y2,px=point.x,py=point.y,L2=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);if(0===L2)return!1;var r=((px-x1)*(x2-x1)+(py-y1)*(y2-y1))/L2;if(r<0)return Math.sqrt((x1-px)*(x1-px)+(y1-py)*(y1-py))<=lineThickness;if(r>=0&&r<=1){var s=((y1-py)*(x2-x1)-(x1-px)*(y2-y1))/L2;return Math.abs(s)*Math.sqrt(L2)<=lineThickness}return Math.sqrt((x2-px)*(x2-px)+(y2-py)*(y2-py))<=lineThickness},PointToLine=PointToLine_1,PointToLineSegment_1=function(point,line){if(!PointToLine(point,line))return!1;var xMin=Math.min(line.x1,line.x2),xMax=Math.max(line.x1,line.x2),yMin=Math.min(line.y1,line.y2),yMax=Math.max(line.y1,line.y2);return point.x>=xMin&&point.x<=xMax&&point.y>=yMin&&point.y<=yMax},intersects$1={CircleToCircle:CircleToCircle_1,CircleToRectangle:CircleToRectangle_1,GetCircleToCircle:GetCircleToCircle_1,GetCircleToRectangle:GetCircleToRectangle_1,GetLineToCircle:GetLineToCircle_1,GetLineToLine:GetLineToLine_1,GetLineToPoints:GetLineToPoints_1,GetLineToPolygon:GetLineToPolygon_1,GetLineToRectangle:GetLineToRectangle_1,GetRaysFromPointToPolygon:GetRaysFromPointToPolygon_1,GetRectangleIntersection:function(rectA,rectB,output){return void 0===output&&(output=new Rectangle$a),RectangleToRectangle$1(rectA,rectB)&&(output.x=Math.max(rectA.x,rectB.x),output.y=Math.max(rectA.y,rectB.y),output.width=Math.min(rectA.right,rectB.right)-output.x,output.height=Math.min(rectA.bottom,rectB.bottom)-output.y),output},GetRectangleToRectangle:function(rectA,rectB,out){if(void 0===out&&(out=[]),RectangleToRectangle(rectA,rectB)){var lineA=rectA.getLineA(),lineB=rectA.getLineB(),lineC=rectA.getLineC(),lineD=rectA.getLineD();GetLineToRectangle$1(lineA,rectB,out),GetLineToRectangle$1(lineB,rectB,out),GetLineToRectangle$1(lineC,rectB,out),GetLineToRectangle$1(lineD,rectB,out)}return out},GetRectangleToTriangle:GetRectangleToTriangle_1,GetTriangleToCircle:GetTriangleToCircle_1,GetTriangleToLine:GetTriangleToLine_1,GetTriangleToTriangle:function(triangleA,triangleB,out){if(void 0===out&&(out=[]),TriangleToTriangle(triangleA,triangleB)){var lineA=triangleB.getLineA(),lineB=triangleB.getLineB(),lineC=triangleB.getLineC();GetTriangleToLine(triangleA,lineA,out),GetTriangleToLine(triangleA,lineB,out),GetTriangleToLine(triangleA,lineC,out)}return out},LineToCircle:LineToCircle_1,LineToLine:LineToLine_1,LineToRectangle:LineToRectangle_1,PointToLine:PointToLine_1,PointToLineSegment:PointToLineSegment_1,RectangleToRectangle:RectangleToRectangle_1,RectangleToTriangle:RectangleToTriangle_1,RectangleToValues:function(rect,left,right,top,bottom,tolerance){return void 0===tolerance&&(tolerance=0),!(left>rect.right+tolerance||right<rect.left-tolerance||top>rect.bottom+tolerance||bottom<rect.top-tolerance)},TriangleToCircle:TriangleToCircle_1,TriangleToLine:TriangleToLine_1,TriangleToTriangle:TriangleToTriangle_1},Angle_1=function(line){return Math.atan2(line.y2-line.y1,line.x2-line.x1)},CenterOn_1$1=function(line,x,y){var tx=x-(line.x1+line.x2)/2,ty=y-(line.y1+line.y2)/2;return line.x1+=tx,line.y1+=ty,line.x2+=tx,line.y2+=ty,line},Line$1=Line_1$1,Clone_1$4=function(source){return new Line$1(source.x1,source.y1,source.x2,source.y2)},CopyFrom_1$3=function(source,dest){return dest.setTo(source.x1,source.y1,source.x2,source.y2)},Equals_1$3=function(line,toCompare){return line.x1===toCompare.x1&&line.y1===toCompare.y1&&line.x2===toCompare.x2&&line.y2===toCompare.y2},Length$1=Length_1,Extend_1=function(line,left,right){void 0===right&&(right=left);var length=Length$1(line),slopX=line.x2-line.x1,slopY=line.y2-line.y1;return left&&(line.x1=line.x1-slopX/length*left,line.y1=line.y1-slopY/length*left),right&&(line.x2=line.x2+slopX/length*right,line.y2=line.y2+slopY/length*right),line}
527,DistanceBetweenPoints=DistanceBetweenPoints_1,GetEaseFunction$4=GetEaseFunction_1,Point$g=Point_1,GetEasedPoints_1=function(line,ease,quantity,collinearThreshold,easeParams){void 0===collinearThreshold&&(collinearThreshold=0),void 0===easeParams&&(easeParams=[]);var i,v,results=[],x1=line.x1,y1=line.y1,spaceX=line.x2-x1,spaceY=line.y2-y1,easeFunc=GetEaseFunction$4(ease,easeParams),q=quantity-1;for(i=0;i<q;i++)v=easeFunc(i/q),results.push(new Point$g(x1+spaceX*v,y1+spaceY*v));if(v=easeFunc(1),results.push(new Point$g(x1+spaceX*v,y1+spaceY*v)),collinearThreshold>0){var prevPoint=results[0],sortedResults=[prevPoint];for(i=1;i<results.length-1;i++){var point=results[i];DistanceBetweenPoints(prevPoint,point)>=collinearThreshold&&(sortedResults.push(point),prevPoint=point)}var endPoint=results[results.length-1];return DistanceBetweenPoints(prevPoint,endPoint)<collinearThreshold&&sortedResults.pop(),sortedResults.push(endPoint),sortedResults}return results},Point$f=Point_1,GetMidPoint_1=function(line,out){return void 0===out&&(out=new Point$f),out.x=(line.x1+line.x2)/2,out.y=(line.y1+line.y2)/2,out},Point$e=Point_1,GetNearestPoint_1=function(line,point,out){void 0===out&&(out=new Point$e);var x1=line.x1,y1=line.y1,x2=line.x2,y2=line.y2,L2=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);if(0===L2)return out;var r=((point.x-x1)*(x2-x1)+(point.y-y1)*(y2-y1))/L2;return out.x=x1+r*(x2-x1),out.y=y1+r*(y2-y1),out},MATH_CONST$7=_const$b,Angle$4=Angle_1,Point$d=Point_1,GetNormal_1=function(line,out){void 0===out&&(out=new Point$d);var a=Angle$4(line)-MATH_CONST$7.TAU;return out.x=Math.cos(a),out.y=Math.sin(a),out},GetShortestDistance_1=function(line,point){var x1=line.x1,y1=line.y1,x2=line.x2,y2=line.y2,L2=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);if(0===L2)return!1;var s=((y1-point.y)*(x2-x1)-(x1-point.x)*(y2-y1))/L2;return Math.abs(s)*Math.sqrt(L2)},Height_1=function(line){return Math.abs(line.y1-line.y2)},MATH_CONST$6=_const$b,Wrap$1=Wrap_1$1,Angle$3=Angle_1,NormalAngle_1=function(line){var angle=Angle$3(line)-MATH_CONST$6.TAU;return Wrap$1(angle,-Math.PI,Math.PI)},MATH_CONST$5=_const$b,Angle$2=Angle_1,NormalX_1=function(line){return Math.cos(Angle$2(line)-MATH_CONST$5.TAU)},MATH_CONST$4=_const$b,Angle$1=Angle_1,NormalY_1=function(line){return Math.sin(Angle$1(line)-MATH_CONST$4.TAU)},Offset_1$2=function(line,x,y){return line.x1+=x,line.y1+=y,line.x2+=x,line.y2+=y,line},PerpSlope_1=function(line){return-(line.x2-line.x1)/(line.y2-line.y1)},Angle=Angle_1,NormalAngle=NormalAngle_1,ReflectAngle_1=function(lineA,lineB){return 2*NormalAngle(lineB)-Math.PI-Angle(lineA)},RotateAroundXY_1$1=function(line,x,y,angle){var c=Math.cos(angle),s=Math.sin(angle),tx=line.x1-x,ty=line.y1-y;return line.x1=tx*c-ty*s+x,line.y1=tx*s+ty*c+y,tx=line.x2-x,ty=line.y2-y,line.x2=tx*c-ty*s+x,line.y2=tx*s+ty*c+y,line}
527,RotateAroundXY$4=RotateAroundXY_1$1,Rotate_1$1=function(line,angle){var x=(line.x1+line.x2)/2,y=(line.y1+line.y2)/2;return RotateAroundXY$4(line,x,y,angle)},RotateAroundXY$3=RotateAroundXY_1$1,RotateAroundPoint_1$1=function(line,point,angle){return RotateAroundXY$3(line,point.x,point.y,angle)},SetToAngle_1=function(line,x,y,angle,length){return line.x1=x,line.y1=y,line.x2=x+Math.cos(angle)*length,line.y2=y+Math.sin(angle)*length,line},Slope_1=function(line){return(line.y2-line.y1)/(line.x2-line.x1)},Width_1=function(line){return Math.abs(line.x1-line.x2)},Line=Line_1$1;Line.Angle=Angle_1,Line.BresenhamPoints=BresenhamPoints_1,Line.CenterOn=CenterOn_1$1,Line.Clone=Clone_1$4,Line.CopyFrom=CopyFrom_1$3,Line.Equals=Equals_1$3,Line.Extend=Extend_1,Line.GetEasedPoints=GetEasedPoints_1,Line.GetMidPoint=GetMidPoint_1,Line.GetNearestPoint=GetNearestPoint_1,Line.GetNormal=GetNormal_1,Line.GetPoint=GetPoint_1$2,Line.GetPoints=GetPoints_1$3,Line.GetShortestDistance=GetShortestDistance_1,Line.Height=Height_1,Line.Length=Length_1,Line.NormalAngle=NormalAngle_1,Line.NormalX=NormalX_1,Line.NormalY=NormalY_1,Line.Offset=Offset_1$2,Line.PerpSlope=PerpSlope_1,Line.Random=Random_1$4,Line.ReflectAngle=ReflectAngle_1,Line.Rotate=Rotate_1$1,Line.RotateAroundPoint=RotateAroun
527dPoint_1$1,Line.RotateAroundXY=RotateAroundXY_1$1,Line.SetToAngle=SetToAngle_1,Line.Slope=Slope_1,Line.Width=Width_1;var line=Line,Face=Face_1,GetFastValue$S=GetFastValue_1,Matrix4=Matrix4_1,Vector3=Vector3_1,Vertex=Vertex_1,tempPosition=new Vector3,tempRotation=new Vector3,tempMatrix=new Matrix4,GenerateGridVerts_1=function(config){var mesh=GetFastValue$S(config,"mesh"),texture=GetFastValue$S(config,"texture",null),frame=GetFastValue$S(config,"frame"),width=GetFastValue$S(config,"width",1),height=GetFastValue$S(config,"height",width),widthSegments=GetFastValue$S(config,"widthSegments",1),heightSegments=GetFastValue$S(config,"heightSegments",widthSegments),posX=GetFastValue$S(config,"x",0),posY=GetFastValue$S(config,"y",0),posZ=GetFastValue$S(config,"z",0),rotateX=GetFastValue$S(config,"rotateX",0),rotateY=GetFastValue$S(config,"rotateY",0),rotateZ=GetFastValue$S(config,"rotateZ",0),zIsUp=GetFastValue$S(config,"zIsUp",!0),isOrtho=GetFastValue$S(config,"isOrtho",!!mesh&&mesh.dirtyCache[11]),colors=GetFastValue$S(config,"colors",[16777215]),alphas=GetFastValue$S(config,"alphas",[1]),tile=GetFastValue$S(config,"tile",!1),flipY=GetFastValue$S(config,"flipY",!1),widthSet=GetFastValue$S(config,"width",null),result={faces:[],verts:[]};if(tempPosition.set(posX,posY,posZ),tempRotation.set(rotateX,rotateY,rotateZ),tempMatrix.fromRotationXYTranslation(tempRotation,tempPosition,zIsUp),!texture&&mesh)texture=mesh.texture;else{if(!mesh||"string"!=typeof texture)return result;texture=mesh.scene.sys.textures.get(texture)}var textureFrame=texture.get(frame);!widthSet&&isOrtho&&texture&&mesh&&(width=textureFrame.width/mesh.height,height=textureFrame.height/mesh.height);var ix,iy,halfWidth=width/2,halfHeight=height/2,gridX=Math.floor(widthSegments),gridY=Math.floor(heightSegments),gridX1=gridX+1,gridY1=gridY+1,segmentWidth=width/gridX,segmentHeight=height/gridY,uvs=[],vertices=[],frameU0=0,frameU1=1,frameV0=0,frameV1=1;textureFrame&&(frameU0=textureFrame.u0,frameU1=textureFrame.u1,flipY?(frameV0=textureFrame.v1,frameV1=textureFrame.v0):(frameV0=textureFrame.v0,frameV1=textureFrame.v1));var frameU=frameU1-frameU0,frameV=frameV1-frameV0;for(iy=0;iy<gridY1;iy++){var y=iy*segmentHeight-halfHeight;for(ix=0;ix<gridX1;ix++){var x=ix*segmentWidth-halfWidth;vertices.push(x,-y);var tu=frameU0+frameU*(ix/gridX),tv=frameV0+frameV*(iy/gridY);uvs.push(tu,tv)}}Array.isArray(colors)||(colors=[colors]),Array.isArray(alphas)||(alphas=[alphas]);var alphaIndex=0,colorIndex=0;for(iy=0;iy<gridY;iy++)for(ix=0;ix<gridX;ix++){var a=2*(ix+gridX1*iy),b=2*(ix+gridX1*(iy+1)),c=2*(ix+1+gridX1*(iy+1)),d=2*(ix+1+gridX1*iy),color=colors[colorIndex],alpha=alphas[alphaIndex],vert1=new Vertex(vertices[a],vertices[a+1],0,uvs[a],uvs[a+1],color,alpha).transformMat4(tempMatrix),vert2=new Vertex(vertices[b],vertices[b+1],0,uvs[b],uvs[b+1],color,alpha).transformMat4(tempMatrix),vert3=new Vertex(vertices[d],vertices[d+1],0,uvs[d],uvs[d+1],color,alpha).transformMat4(tempMatrix),vert4=new Vertex(vertices[b],vertices[b+1],0,uvs[b],uvs[b+1],color,alpha).transformMat4(tempMatrix),vert5=new Vertex(vertices[c],vertices[c+1],0,uvs[c],uvs[c+1],color,alpha).transformMat4(tempMatrix),vert6=new Vertex(vertices[d],vertices[d+1],0,uvs[d],uvs[d+1],color,alpha).transformMat4(tempMatrix);tile&&(vert1.setUVs(frameU0,frameV1),vert2.setUVs(frameU0,frameV0),vert3.setUVs(frameU1,frameV1),vert4.setUVs(frameU0,frameV0),vert5.setUVs(frameU1,frameV0),vert6.setUVs(frameU1,frameV1)),++colorIndex===colors.length&&(colorIndex=0),++alphaIndex===alphas.length&&(alphaIndex=0),result.verts.push(vert1,vert2,vert3,vert4,vert5,vert6),result.faces.push(new Face(vert1,vert2,vert3),new Face(vert4,vert5,vert6))}return mesh&&(mesh.faces=mesh.faces.concat(result.faces),mesh.vertices=mesh.vertices.concat(result.verts)),result},flip=!0,currentGroup="",currentMaterial="";
528/**
529	 * @author       Richard Davey <[email protected]>
530	 * @copyright    2020 Photon Storm Ltd.
531	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
532	 */function stripComments(line){var idx=line.indexOf("#");return idx>-1?line.substring(0,idx):line}function currentModel(result){return 0===result.models.length&&result.models.push({faces:[],name:"untitled",textureCoords:[],vertexNormals:[],vertices:[]}),currentGroup="",result.models[result.models.length-1]}function parseObject(lineItems,result){var modelName=lineItems.length>=2?lineItems[1]:"untitled";result.models.push({faces:[],name:modelName,textureCoords:[],vertexNormals:[],vertices:[]}),currentGroup=""}function parseGroup(lineItems){2===lineItems.length&&(currentGroup=lineItems[1])}function parseVertexCoords(lineItems,result){var len=lineItems.length,x=len>=2?parseFloat(lineItems[1]):0,y=len>=3?parseFloat(lineItems[2]):0,z=len>=4?parseFloat(lineItems[3]):0;currentModel(result).vertices.push({x:x,y:y,z:z})}function parseTextureCoords(lineItems,result){var len=lineItems.length,u=len>=2?parseFloat(lineItems[1]):0,v=len>=3?parseFloat(lineItems[2]):0,w=len>=4?parseFloat(lineItems[3]):0;isNaN(u)&&(u=0),isNaN(v)&&(v=0),isNaN(w)&&(w=0),flip&&(v=1-v),currentModel(result).textureCoords.push({u:u,v:v,w:w})}function parseVertexNormal(lineItems,result){var len=lineItems.length,x=len>=2?parseFloat(lineItems[1]):0,y=len>=3?parseFloat(lineItems[2]):0,z=len>=4?parseFloat(lineItems[3]):0;currentModel(result).vertexNormals.push({x:x,y:y,z:z})}
532function parsePolygon(lineItems,result){var totalVertices=lineItems.length-1;if(!(totalVertices<3)){for(var face={group:currentGroup,material:currentMaterial,vertices:[]},i=0;i<totalVertices;i++){var vertexValues=lineItems[i+1].split("/"),vvLen=vertexValues.length;if(!(vvLen<1||vvLen>3)){var vertexIndex=0,textureCoordsIndex=0,vertexNormalIndex=0;vertexIndex=parseInt(vertexValues[0],10),vvLen>1&&""!==vertexValues[1]&&(textureCoordsIndex=parseInt(vertexValues[1],10)),vvLen>2&&(vertexNormalIndex=parseInt(vertexValues[2],10)),0!==vertexIndex&&(vertexIndex<0&&(vertexIndex=currentModel(result).vertices.length+1+vertexIndex),textureCoordsIndex-=1,vertexIndex-=1,vertexNormalIndex-=1,face.vertices.push({textureCoordsIndex:textureCoordsIndex,vertexIndex:vertexIndex,vertexNormalIndex:vertexNormalIndex}))}}currentModel(result).faces.push(face)}}function parseMtlLib(lineItems,result){lineItems.length>=2&&result.materialLibraries.push(lineItems[1])}function parseUseMtl(lineItems){lineItems.length>=2&&(currentMaterial=lineItems[1])}var ParseObj_1=function(data,flipUV){void 0===flipUV&&(flipUV=!0),flip=flipUV;var result={materials:{},materialLibraries:[],models:[]};currentGroup="",currentMaterial="";for(var lines=data.split("\n"),i=0;i<lines.length;i++){var lineItems=stripComments(lines[i]).replace(/\s\s+/g," ").trim().split(" ");switch(lineItems[0].toLowerCase()){case"o":parseObject(lineItems,result);break;case"g":parseGroup(lineItems);break;case"v":parseVertexCoords(lineItems,result);break;case"vt":parseTextureCoords(lineItems,result);break;case"vn":parseVertexNormal(lineItems,result);break;case"f":parsePolygon(lineItems,result);break;case"mtllib":parseMtlLib(lineItems,result);break;case"usemtl":parseUseMtl(lineItems)}}return result},GetColor=GetColor_1,ParseObjMaterial_1=function(mtl){for(var output={},lines=mtl.split("\n"),currentMaterial="",i=0;i<lines.length;i++){var line=lines[i].trim();if(0!==line.indexOf("#")&&""!==line){var lineItems=line.replace(/\s\s+/g," ").trim().split(" ");switch(lineItems[0].toLowerCase()){case"newmtl":currentMaterial=lineItems[1];break;
532case"kd":var r=Math.floor(255*lineItems[1]),g=lineItems.length>=2?Math.floor(255*lineItems[2]):r,b=lineItems.length>=3?Math.floor(255*lineItems[3]):r;output[currentMaterial]=GetColor(r,g,b)}}}return output},RotateFace_1=function(face,angle,cx,cy){var x,y;if(void 0===cx&&void 0===cy){var inCenter=face.getInCenter();x=inCenter.x,y=inCenter.y}var c=Math.cos(angle),s=Math.sin(angle),v1=face.vertex1,v2=face.vertex2,v3=face.vertex3,tx=v1.x-x,ty=v1.y-y;v1.set(tx*c-ty*s+x,tx*s+ty*c+y),tx=v2.x-x,ty=v2.y-y,v2.set(tx*c-ty*s+x,tx*s+ty*c+y),tx=v3.x-x,ty=v3.y-y,v3.set(tx*c-ty*s+x,tx*s+ty*c+y)},mesh={Face:Face_1,GenerateGridVerts:GenerateGridVerts_1,GenerateObjVerts:GenerateObjVerts_1,GenerateVerts:GenerateVerts_1,ParseObj:ParseObj_1,ParseObjMaterial:ParseObjMaterial_1,RotateFace:RotateFace_1,Vertex:Vertex_1},Ceil_1$1=function(point){return point.setTo(Math.ceil(point.x),Math.ceil(point.y))},Point$c=Point_1,Clone_1$3=function(source){return new Point$c(source.x,source.y)},CopyFrom_1$2=function(source,dest){return dest.setTo(source.x,source.y)},Equals_1$2=function(point,toCompare){return point.x===toCompare.x&&point.y===toCompare.y},Floor_1$1=function(point){return point.setTo(Math.floor(point.x),Math.floor(point.y))},Point$b=Point_1,GetCentroid_1=function(points,out){if(void 0===out&&(out=new Point$b),!Array.isArray(points))throw new Error("GetCentroid points argument must be an array");var len=points.length;if(len<1)throw new Error("GetCentroid points array must not be empty");if(1===len)out.x=points[0].x,out.y=points[0].y;else{for(var i=0;i<len;i++)out.x+=points[i].x,out.y+=points[i].y;out.x/=len,out.y/=len}return out},GetMagnitude_1=function(point){return Math.sqrt(point.x*point.x+point.y*point.y)},GetMagnitudeSq_1=function(point){return point.x*point.x+point.y*point.y},Rectangle$9=Rectangle_1$1,GetRectangleFromPoints_1=function(points,out){void 0===out&&(out=new Rectangle$9);for(var xMax=Number.NEGATIVE_INFINITY,xMin=Number.POSITIVE_INFINITY,yMax=Number.NEGATIVE_INFINITY,yMin=Number.POSITIVE_INFINITY,i=0;i<points.length;i++){var point=points[i];point.x>xMax&&(xMax=point.x),point.x<xMin&&(xMin=point.x),point.y>yMax&&(yMax=point.y),point.y<yMin&&(yMin=point.y)}return out.x=xMin,out.y=yMin,out.width=xMax-xMin,out.height=yMax-yMin,out},Point$a=Point_1,Interpolate_1=function(pointA,pointB,t,out){return void 0===t&&(t=0),void 0===out&&(out=new Point$a),out.x=pointA.x+(pointB.x-pointA.x)*t,out.y=pointA.y+(pointB.y-pointA.y)*t,out},Invert_1=function(point){return point.setTo(point.y,point.x)},Point$9=Point_1,Negative_1=function(point,out){return void 0===out&&(out=new Point$9),out.setTo(-point.x,-point.y)},Point$8=Point_1,GetMagnitudeSq=GetMagnitudeSq_1,Project_1=function(pointA,pointB,out){void 0===out&&(out=new Point$8);var amt=(pointA.x*pointB.x+pointA.y*pointB.y)/GetMagnitudeSq(pointB);return 0!==amt&&(out.x=amt*pointB.x,out.y=amt*pointB.y),out},Point$7=Point_1,ProjectUnit_1=function(pointA,pointB,out){void 0===out&&(out=new Point$7);var amt=pointA.x*pointB.x+pointA.y*pointB.y;return 0!==amt&&(out.x=amt*pointB.x,out.y=amt*pointB.y),out},GetMagnitude=GetMagnitude_1,SetMagnitude_1=function(point,magnitude){if(0!==point.x||0!==point.y){var m=GetMagnitude(point);point.x/=m,point.y/=m}return point.x*=magnitude,point.y*=magnitude,point},Point$6=Point_1;
532Point$6.Ceil=Ceil_1$1,Point$6.Clone=Clone_1$3,Point$6.CopyFrom=CopyFrom_1$2,Point$6.Equals=Equals_1$2,Point$6.Floor=Floor_1$1,Point$6.GetCentroid=GetCentroid_1,Point$6.GetMagnitude=GetMagnitude_1,Point$6.GetMagnitudeSq=GetMagnitudeSq_1,Point$6.GetRectangleFromPoints=GetRectangleFromPoints_1,Point$6.Interpolate=Interpolate_1,Point$6.Invert=Invert_1,Point$6.Negative=Negative_1,Point$6.Project=Project_1,Point$6.ProjectUnit=ProjectUnit_1,Point$6.SetMagnitude=SetMagnitude_1;var point$6=Point$6,Polygon$1=Polygon_1$1,Clone_1$2=function(polygon){return new Polygon$1(polygon.points)},Contains$2=Contains_1$1,ContainsPoint_1$2=function(polygon,point){return Contains$2(polygon,point.x,point.y)},GetNumberArray_1=function(polygon,output){void 0===output&&(output=[]);for(var i=0;i<polygon.points.length;i++)output.push(polygon.points[i].x),output.push(polygon.points[i].y);return output},Reverse_1$1=function(polygon){return polygon.points.reverse(),polygon};
533/**
534	 * @author       Richard Davey <[email protected]>
535	 * @copyright    2020 Photon Storm Ltd.
536	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
537	 */function getSqSegDist(p,p1,p2){var x=p1.x,y=p1.y,dx=p2.x-x,dy=p2.y-y;if(0!==dx||0!==dy){var t=((p.x-x)*dx+(p.y-y)*dy)/(dx*dx+dy*dy);t>1?(x=p2.x,y=p2.y):t>0&&(x+=dx*t,y+=dy*t)}return(dx=p.x-x)*dx+(dy=p.y-y)*dy}function simplifyDPStep(points,first,last,sqTolerance,simplified){for(var index,maxSqDist=sqTolerance,i=first+1;i<last;i++){var sqDist=getSqSegDist(points[i],points[first],points[last]);sqDist>maxSqDist&&(index=i,maxSqDist=sqDist)}maxSqDist>sqTolerance&&(index-first>1&&simplifyDPStep(points,first,index,sqTolerance,simplified),simplified.push(points[index]),last-index>1&&simplifyDPStep(points,index,last,sqTolerance,simplified))}function simplifyDouglasPeucker(points,sqTolerance){var last=points.length-1,simplified=[points[0]];return simplifyDPStep(points,0,last,sqTolerance,simplified),simplified.push(points[last]),simplified}var Simplify_1=function(polygon,tolerance,highestQuality){void 0===tolerance&&(tolerance=1),void 0===highestQuality&&(highestQuality=!1);var points=polygon.points;if(points.length>2){var sqTolerance=tolerance*tolerance;highestQuality||(points=function(points,sqTolerance){for(var point,p1,p2,dx,dy,prevPoint=points[0],newPoints=[prevPoint],i=1,len=points.length;i<len;i++)point=points[i],p2=prevPoint,dx=void 0,dy=void 0,dx=(p1=point).x-p2.x,dy=p1.y-p2.y,dx*dx+dy*dy>sqTolerance&&(newPoints.push(point),prevPoint=point);return prevPoint!==point&&newPoints.push(point),newPoints}(points,sqTolerance)),polygon.setTo(simplifyDouglasPeucker(points,sqTolerance))}return polygon},Translate_1=function(polygon,x,y){for(var points=polygon.points,i=0;i<points.length;i++)points[i].x+=x,points[i].y+=y;return polygon},Polygon=Polygon_1$1;Polygon.Clone=Clone_1$2,Polygon.Contains=Contains_1$1,Polygon.ContainsPoint=ContainsPoint_1$2,Polygon.Earcut=Earcut$7,Polygon.GetAABB=GetAABB_1,Polygon.GetNumberArray=GetNumberArray_1,Polygon.GetPoints=GetPoints_1$1,Polygon.Perimeter=Perimeter_1$1,Polygon.Reverse=Reverse_1$1,Polygon.Simplify=Simplify_1,Polygon.Smooth=Smooth_1,Polygon.Translate=Translate_1;var polygon=Polygon,Area_1$1=function(rect){return rect.width*rect.height},Ceil_1=function(rect){return rect.x=Math.ceil(rect.x),rect.y=Math.ceil(rect.y),rect},CeilAll_1=function(rect){return rect.x=Math.ceil(rect.x),rect.y=Math.ceil(rect.y),rect.width=Math.ceil(rect.width),rect.height=Math.ceil(rect.height),rect},Rectangle$8=Rectangle_1$1,Clone_1$1=function(source){return new Rectangle$8(source.x,source.y,source.width,source.height)},Contains$1=Contains_1$3,ContainsPoint_1$1=function(rect,point){return Contains$1(rect,point.x,point.y)},ContainsRect_1=function(rectA,rectB){return!(rectB.width*rectB.height>rectA.width*rectA.height)&&(rectB.x>rectA.x&&rectB.x<rectA.right&&rectB.right>rectA.x&&rectB.right<rectA.right&&rectB.y>rectA.y&&rectB.y<rectA.bottom&&rectB.bottom>rectA.y&&rectB.bottom<rectA.bottom)},CopyFrom_1$1=function(source,dest){return dest.setTo(source.x,source.y,source.width,source.height)},Equals_1$1=function(rect,toCompare){return rect.x===toCompare.x&&rect.y===toCompare.y&&rect.width===toCompare.width&&rect.height===toCompare.height},GetAspectRatio_1=function(rect){return 0===rect.height?NaN:rect.width/rect.height},GetAspectRatio$1=GetAspectRatio_1,FitInside_1=function(target,source){var ratio=GetAspectRatio$1(target);return ratio<GetAspectRatio$1(source)?target.setSize(source.height*ratio,source.height):target.setSize(source.width,source.width/ratio),target.setPosition(source.centerX-target.width/2,source.centerY-target.height/2)},GetAspectRatio=GetAspectRatio_1,FitOutside_1=function(target,source){var ratio=GetAspectRatio(target);return ratio>GetAspectRatio(source)?target.setSize(source.height*ratio,source.height):target.setSize(source.width,source.width/ratio),target.setPosition(source.centerX-target.width/2,source.centerY-target.height/2)},Floor_1=function(rect){return rect.x=Math.floor(rect.x),rect.y=Math.floor(rect.y),rect},FloorAll_1=function(rect){return rect.x=Math.floor(rect.x),rect.y=Math.floor(rect.y),rect.width=Math.floor(rect.width),rect.height=Math.floor(rect.height),rect},Rectangle$7=Rectangle_1$1,FromXY_1=function(x1,y1,x2,y2,out){return void 0===out&&(out=new Rectangle$7),out.setTo(Math.min(x1,x2),Math.min(y1,y2),Math.abs(x1-x2),Math.abs(y1-y2))},Point$5=Point_1,GetCenter_1=function(rect,out){return void 0===out&&(out=new Point$5),out.x=rect.centerX,out.y=rect.centerY,out},Point$4=Point_1,GetSize_1=function(rect,out){return void 0===out&&(out=new Point$4),out.x=rect.width,out.y=rect.height,out},CenterOn$1=CenterOn_1$2,Inflate_1=function(rect,x,y){var cx=rect.centerX,cy=rect.centerY;return rect.setSize(rect.width+2*x,rect.height+2*y),CenterOn$1(rect,cx,cy)},Rectangle$6=Rectangle_1$1,Intersects$1=RectangleToRectangle_1,Intersection_1=function(rectA,rectB,out){return void 0===out&&(out=new Rectangle$6),Intersects$1(rectA,rectB)?(out.x=Math.max(rectA.x,rectB.x),out.y=Math.max(rectA.y,rectB.y),out.width=Math.min(rectA.right,rectB.right)-out.x,out.height=Math.min(rectA.bottom,rectB.bottom)-out.
537y):out.setEmpty(),out},MergePoints_1=function(target,points){for(var minX=target.x,maxX=target.right,minY=target.y,maxY=target.bottom,i=0;i<points.length;i++)minX=Math.min(minX,points[i].x),maxX=Math.max(maxX,points[i].x),minY=Math.min(minY,points[i].y),maxY=Math.max(maxY,points[i].y);return target.x=minX,target.y=minY,target.width=maxX-minX,target.height=maxY-minY,target},MergeRect_1=function(target,source){var minX=Math.min(target.x,source.x),maxX=Math.max(target.right,source.right);target.x=minX,target.width=maxX-minX;var minY=Math.min(target.y,source.y),maxY=Math.max(target.bottom,source.bottom);return target.y=minY,target.height=maxY-minY,target},MergeXY_1=function(target,x,y){var minX=Math.min(target.x,x),maxX=Math.max(target.right,x);target.x=minX,target.width=maxX-minX;var minY=Math.min(target.y,y),maxY=Math.max(target.bottom,y);return target.y=minY,target.height=maxY-minY,target},Offset_1$1=function(rect,x,y){return rect.x+=x,rect.y+=y,rect},OffsetPoint_1=function(rect,point){return rect.x+=point.x,rect.y+=point.y,rect},Overlaps_1=function(rectA,rectB){return rectA.x<rectB.right&&rectA.right>rectB.x&&rectA.y<rectB.bottom&&rectA.bottom>rectB.y},Point$3=Point_1,DegToRad$2=DegToRad_1,PerimeterPoint_1=function(rectangle,angle,out){void 0===out&&(out=new Point$3),angle=DegToRad$2(angle);var s=Math.sin(angle),c=Math.cos(angle),dx=c>0?rectangle.width/2:rectangle.width/-2,dy=s>0?rectangle.height/2:rectangle.height/-2;return Math.abs(dx*s)<Math.abs(dy*c)?dy=dx*s/c:dx=dy*c/s,out.x=dx+rectangle.centerX,out.y=dy+rectangle.centerY,out},Between=Between_1,ContainsRect=ContainsRect_1,Point$2=Point_1,RandomOutside_1=function(outer,inner,out){if(void 0===out&&(out=new Point$2),ContainsRect(outer,inner))switch(Between(0,3)){case 0:out.x=outer.x+Math.random()*(inner.right-outer.x),out.y=outer.y+Math.random()*(inner.top-outer.y);break;case 1:out.x=inner.x+Math.random()*(outer.right-inner.x),out.y=inner.bottom+Math.random()*(outer.bottom-inner.bottom);break;case 2:out.x=outer.x+Math.random()*(inner.x-outer.x),out.y=inner.y+Math.random()*(outer.bottom-inner.y);break;case 3:out.x=inner.right+Math.random()*(outer.right-inner.right),out.y=outer.y+Math.random()*(inner.bottom-outer.y)}return out},SameDimensions_1=function(rect,toCompare){return rect.width===toCompare.width&&rect.height===toCompare.height},Scale_1=function(rect,x,y){return void 0===y&&(y=x),rect.width*=x,rect.height*=y,rect},Rectangle$5=Rectangle_1$1;
538/**
539	 * @author       Richard Davey <[email protected]>
540	 * @copyright    2020 Photon Storm Ltd.
541	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
542	 */Rectangle$5.Area=Area_1$1,Rectangle$5.Ceil=Ceil_1,Rectangle$5.CeilAll=CeilAll_1,Rectangle$5.CenterOn=CenterOn_1$2,Rectangle$5.Clone=Clone_1$1,Rectangle$5.Contains=Contains_1$3,Rectangle$5.ContainsPoint=ContainsPoint_1$1,Rectangle$5.ContainsRect=ContainsRect_1,Rectangle$5.CopyFrom=CopyFrom_1$1,Rectangle$5.Decompose=Decompose_1$1,Rectangle$5.Equals=Equals_1$1,Rectangle$5.FitInside=FitInside_1,Rectangle$5.FitOutside=FitOutside_1,Rectangle$5.Floor=Floor_1,Rectangle$5.FloorAll=FloorAll_1,Rectangle$5.FromPoints=FromPoints_1,Rectangle$5.FromXY=FromXY_1,Rectangle$5.GetAspectRatio=GetAspectRatio_1,Rectangle$5.GetCenter=GetCenter_1,Rectangle$5.GetPoint=GetPoint_1$3,Rectangle$5.GetPoints=GetPoints_1$4,Rectangle$5.GetSize=GetSize_1,Rectangle$5.Inflate=Inflate_1,Rectangle$5.Intersection=Intersection_1,Rectangle$5.MarchingAnts=MarchingAnts_1,Rectangle$5.MergePoints=MergePoints_1,Rectangle$5.MergeRect=MergeRect_1,Rectangle$5.MergeXY=MergeXY_1,Rectangle$5.Offset=Offset_1$1,Rectangle$5.OffsetPoint=OffsetPoint_1,Rectangle$5.Overlaps=Overlaps_1,Rectangle$5.Perimeter=Perimeter_1$2,Rectangle$5.PerimeterPoint=PerimeterPoint_1,Rectangle$5.Random=Random_1$3,Rectangle$5.RandomOutside=RandomOutside_1,Rectangle$5.SameDimensions=SameDimensions_1,Rectangle$5.Scale=Scale_1,Rectangle$5.Union=Union_1;var rectangle=Rectangle$5,Area_1=function(triangle){var x1=triangle.x1,y1=triangle.y1,x2=triangle.x2,y2=triangle.y2,x3=triangle.x3,y3=triangle.y3;return Math.abs(((x3-x1)*(y2-y1)-(x2-x1)*(y3-y1))/2)}
542,Triangle$5=Triangle_1$1,BuildEquilateral_1=function(x,y,length){var height=length*(Math.sqrt(3)/2);return new Triangle$5(x,y,x+length/2,y+height,x-length/2,y+height)},EarCut=Earcut$7,Triangle$4=Triangle_1$1,BuildFromPolygon_1=function(data,holes,scaleX,scaleY,out){void 0===holes&&(holes=null),void 0===scaleX&&(scaleX=1),void 0===scaleY&&(scaleY=1),void 0===out&&(out=[]);for(var a,b,c,x1,y1,x2,y2,x3,y3,tris=EarCut(data,holes),i=0;i<tris.length;i+=3)a=tris[i],b=tris[i+1],c=tris[i+2],x1=data[2*a]*scaleX,y1=data[2*a+1]*scaleY,x2=data[2*b]*scaleX,y2=data[2*b+1]*scaleY,x3=data[2*c]*scaleX,y3=data[2*c+1]*scaleY,out.push(new Triangle$4(x1,y1,x2,y2,x3,y3));return out},Triangle$3=Triangle_1$1,BuildRight_1=function(x,y,width,height){return void 0===height&&(height=width),new Triangle$3(x,y,x,y-height,x+width,y)},Point$1=Point_1,Centroid_1=function(triangle,out){return void 0===out&&(out=new Point$1),out.x=(triangle.x1+triangle.x2+triangle.x3)/3,out.y=(triangle.y1+triangle.y2+triangle.y3)/3,out},Offset_1=function(triangle,x,y){return triangle.x1+=x,triangle.y1+=y,triangle.x2+=x,triangle.y2+=y,triangle.x3+=x,triangle.y3+=y,triangle},Centroid=Centroid_1,Offset=Offset_1,CenterOn_1=function(triangle,x,y,centerFunc){void 0===centerFunc&&(centerFunc=Centroid);var center=centerFunc(triangle),diffX=x-center.x,diffY=y-center.y;return Offset(triangle,diffX,diffY)},Vector2$q=Vector2_1;
543/**
544	 * @author       Richard Davey <[email protected]>
545	 * @copyright    2020 Photon Storm Ltd.
546	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
547	 */function det(m00,m01,m10,m11){return m00*m11-m01*m10}var CircumCenter_1=function(triangle,out){void 0===out&&(out=new Vector2$q);var cx=triangle.x3,cy=triangle.y3,ax=triangle.x1-cx,ay=triangle.y1-cy,bx=triangle.x2-cx,by=triangle.y2-cy,denom=2*det(ax,ay,bx,by),numx=det(ay,ax*ax+ay*ay,by,bx*bx+by*by),numy=det(ax,ax*ax+ay*ay,bx,bx*bx+by*by);return out.x=cx-numx/denom,out.y=cy+numy/denom,out},Circle$2=Circle_1,CircumCircle_1=function(triangle,out){void 0===out&&(out=new Circle$2);var dx,dy,x1=triangle.x1,y1=triangle.y1,x2=triangle.x2,y2=triangle.y2,x3=triangle.x3,y3=triangle.y3,A=x2-x1,B=y2-y1,C=x3-x1,D=y3-y1,E=A*(x1+x2)+B*(y1+y2),F=C*(x1+x3)+D*(y1+y3),G=2*(A*(y3-y2)-B*(x3-x2));if(Math.abs(G)<1e-6){var minX=Math.min(x1,x2,x3),minY=Math.min(y1,y2,y3);dx=.5*(Math.max(x1,x2,x3)-minX),dy=.5*(Math.max(y1,y2,y3)-minY),out.x=minX+dx,out.y=minY+dy,out.radius=Math.sqrt(dx*dx+dy*dy)}else out.x=(D*E-B*F)/G,out.y=(A*F-C*E)/G,dx=out.x-x1,dy=out.y-y1,out.radius=Math.sqrt(dx*dx+dy*dy);return out},Triangle$2=Triangle_1$1,Clone_1=function(source){return new Triangle$2(source.x1,source.y1,source.x2,source.y2,source.x3,source.y3)},Contains=Contains_1,ContainsPoint_1=function(triangle,point){return Contains(triangle,point.x,point.y)},CopyFrom_1=function(source,dest){return dest.setTo(source.x1,source.y1,source.x2,source.y2,source.x3,source.y3)},Equals_1=function(triangle,toCompare){return triangle.x1===toCompare.x1&&triangle.y1===toCompare.y1&&triangle.x2===toCompare.x2&&triangle.y2===toCompare.y2&&triangle.x3===toCompare.x3&&triangle.y3===toCompare.y3},Point=Point_1;function getLength(x1,y1,x2,y2){var x=x1-x2,y=y1-y2,magnitude=x*x+y*y;return Math.sqrt(magnitude)}var InCenter_1=function(triangle,out){void 0===out&&(out=new Point);var x1=triangle.x1,y1=triangle.y1,x2=triangle.x2,y2=triangle.y2,x3=triangle.x3,y3=triangle.y3,d1=getLength(x3,y3,x2,y2),d2=getLength(x1,y1,x3,y3),d3=getLength(x2,y2,x1,y1),p=d1+d2+d3;return out.x=(x1*d1+x2*d2+x3*d3)/p,out.y=(y1*d1+y2*d2+y3*d3)/p,out},Length=Length_1,Perimeter_1=function(triangle){var line1=triangle.getLineA(),line2=triangle.getLineB(),line3=triangle.getLineC();return Length(line1)+Length(line2)+Length(line3)},RotateAroundXY_1=function(triangle,x,y,angle){var c=Math.cos(angle),s=Math.sin(angle),tx=triangle.x1-x,ty=triangle.y1-y;return triangle.x1=tx*c-ty*s+x,triangle.y1=tx*s+ty*c+y,tx=triangle.x2-x,ty=triangle.y2-y,triangle.x2=tx*c-ty*s+x,triangle.y2=tx*s+ty*c+y,tx=triangle.x3-x,ty=triangle.y3-y,triangle.x3=tx*c-ty*s+x,triangle.y3=tx*s+ty*c+y,triangle}
547,RotateAroundXY$1=RotateAroundXY_1,InCenter=InCenter_1,Rotate_1=function(triangle,angle){var point=InCenter(triangle);return RotateAroundXY$1(triangle,point.x,point.y,angle)},RotateAroundXY=RotateAroundXY_1,RotateAroundPoint_1=function(triangle,point,angle){return RotateAroundXY(triangle,point.x,point.y,angle)},Triangle$1=Triangle_1$1;Triangle$1.Area=Area_1,Triangle$1.BuildEquilateral=BuildEquilateral_1,Triangle$1.BuildFromPolygon=BuildFromPolygon_1,Triangle$1.BuildRight=BuildRight_1,Triangle$1.CenterOn=CenterOn_1,Triangle$1.Centroid=Centroid_1,Triangle$1.CircumCenter=CircumCenter_1,Triangle$1.CircumCircle=CircumCircle_1,Triangle$1.Clone=Clone_1,Triangle$1.Contains=Contains_1,Triangle$1.ContainsArray=ContainsArray_1,Triangle$1.ContainsPoint=ContainsPoint_1,Triangle$1.CopyFrom=CopyFrom_1,Triangle$1.Decompose=Decompose_1,Triangle$1.Equals=Equals_1,Triangle$1.GetPoint=GetPoint_1,Triangle$1.GetPoints=GetPoints_1,Triangle$1.InCenter=InCenter_1,Triangle$1.Perimeter=Perimeter_1,Triangle$1.Offset=Offset_1,Triangle$1.Random=Random_1$1,Triangle$1.Rotate=Rotate_1,Triangle$1.RotateAroundPoint=RotateAroun
vendor: 10,904 bytes, lines 547-552
547dPoint_1,Triangle$1.RotateAroundXY=RotateAroundXY_1;var Geom$1={Circle:circle,Ellipse:ellipse,Intersects:intersects$1,Line:line,Mesh:mesh,Point:point$6,Polygon:polygon,Rectangle:rectangle,Triangle:Triangle$1},geom=Geom$1=Extend_1$1(!1,Geom$1,_const$c),CreatePixelPerfectHandler_1=function(textureManager,alphaTolerance){return function(hitArea,x,y,gameObject){var alpha=textureManager.getPixelAlpha(x,y,gameObject.texture.key,gameObject.frame.name);return alpha&&alpha>=alphaTolerance}},CreateInteractiveObject_1=function(gameObject,hitArea,hitAreaCallback){return{gameObject:gameObject,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:hitArea,hitAreaCallback:hitAreaCallback,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}},Axis_1=new Class_1({initialize:function(pad,index){this.pad=pad,this.events=pad.events,this.index=index,this.value=0,this.threshold=.1},update:function(value){this.value=value},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}}),events$4={BUTTON_DOWN:"down",BUTTON_UP:"up",CONNECTED:"connected",DISCONNECTED:"disconnected",GAMEPAD_BUTTON_DOWN:"down",GAMEPAD_BUTTON_UP:"up"},Events$k=events$4,Button_1=new Class_1({initialize:function(pad,index){this.pad=pad,this.events=pad.manager,this.index=index,this.value=0,this.threshold=1,this.pressed=!1},update:function(value){this.value=value;var pad=this.pad,index=this.index;value>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(Events$k.BUTTON_DOWN,pad,this,value),this.pad.emit(Events$k.GAMEPAD_BUTTON_DOWN,index,value,this)):this.pressed&&(this.pressed=!1,this.events.emit(Events$k.BUTTON_UP,pad,this,value),this.pad.emit(Events$k.GAMEPAD_BUTTON_UP,index,value,this))},destroy:function(){this.pad=null,this.events=null}}),Axis=Axis_1,Button=Button_1,EventEmitter$a=eventemitter3.exports,Vector2$p=Vector2_1,Gamepad$1=new Class_1({Extends:EventEmitter$a,initialize:function(manager,pad){EventEmitter$a.call(this),this.manager=manager,this.pad=pad,this.id=pad.id,this.index=pad.index;for(var buttons=[],i=0;i<pad.buttons.length;i++)buttons.push(new Button(this,i));this.buttons=buttons;var axes=[];for(i=0;i<pad.axes.length;i++)axes.push(new Axis(this,i));this.axes=axes,this.vibration=pad.vibrationActuator;var _noButton={value:0,pressed:!1};this._LCLeft=buttons[14]?buttons[14]:_noButton,this._LCRight=buttons[15]?buttons[15]:_noButton,this._LCTop=buttons[12]?buttons[12]:_noButton,this._LCBottom=buttons[13]?buttons[13]:_noButton,this._RCLeft=buttons[2]?buttons[2]:_noButton,this._RCRight=buttons[1]?buttons[1]:_noButton,this._RCTop=buttons[3]?buttons[3]:_noButton,this._RCBottom=buttons[0]?buttons[0]:_noButton,this._FBLeftTop=buttons[4]?buttons[4]:_noButton,this._FBLeftBottom=buttons[6]?buttons[6]:_noButton,this._FBRightTop=buttons[5]?buttons[5]:_noButton,this._FBRightBottom=buttons[7]?buttons[7]:_noButton;var _noAxis={value:0};this._HAxisLeft=axes[0]?axes[0]:_noAxis,this._VAxisLeft=axes[1]?axes[1]:_noAxis,this._HAxisRight=axes[2]?axes[2]:_noAxis,this._VAxisRight=axes[3]?axes[3]:_noAxis,this.leftStick=new Vector2$p,this.rightStick=new Vector2$p,this._created=performance.now()},getAxisTotal:function(){return this.axes.length},getAxisValue:function(index){return this.axes[index].getValue()},setAxisThreshold:function(value){for(var i=0;i<this.axes.length;i++)this.axes[i].threshold=value},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(index){return this.buttons[index].value},isButtonDown:function(index){return this.buttons[index].pressed},update:function(pad){if(!(pad.timestamp<this._created)){var i,localButtons=this.buttons,gamepadButtons=pad.buttons,len=localButtons.length;for(i=0;i<len;i++)localButtons[i].update(gamepadButtons[i].value);var localAxes=this.axes,gamepadAxes=pad.axes;for(len=localAxes.length,i=0;i<len;i++)localAxes[i].update(gamepadAxes[i]);len>=2&&(this.leftStick.set(localAxes[0].getValue(),localAxes[1].getValue()),len>=4&&this.rightStick.set(localAxes[2].getValue(),localAxes[3].getValue()))}},destroy:function(){var i;for(this.removeAllListeners(),this.manager=null,this.pad=null,i=0;i<this.buttons.length;i++)this.buttons[i].destroy();for(i=0;i<this.axes.length;i++)this.axes[i].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}}),Gamepad_1=Gamepad$1,GetValue$d=GetValue_1,inputPlugins={},InputPluginCache$3={register:function(key,plugin,mapping,settingsKey,configKey){inputPlugins[key]={plugin:plugin,mapping:mapping,settingsKey:settingsKey,configKey:configKey}},getPlugin:function(key){return inputPlugins[key]},install:function(target){var sys=target.scene.sys,settings=sys.settings.input,config=sys.game.config;for(var key in inputPlugins){var source=inputPlugins[key].plugin,mapping=inputPlugins[key].mapping,settingsKey=inputPlugins[key].settingsKey,configKey=inputPlugins[key].configKey;GetValue$d(settings,settingsKey,config[configKey])&&(target[mapping]=new source(target))}},remove:function(key){inputPlugins.hasOwnProperty(key)&&delete inputPlugins[key]}},InputPluginCache_1=InputPluginCache$3,EventEmitter$9=eventemitter3.exports,Events$j=events$4,Gamepad=Gamepad_1,GetValue$c=GetValue_1,InputPluginCache$2=InputPluginCache_1,InputEvents$2=events$8,GamepadPlugin=new Class_1({Extends:EventEmitter$9,initialize:function(sceneInputPlugin){EventEmitter$9.call(this),this.scene=sceneInputPlugin.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=sceneInputPlugin,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,sceneInputPlugin.pluginEvents.once(InputEvents$2.BOOT,this.boot,this),sceneInputPlugin.pluginEvents.on(InputEvents$2.START,this.start,this)},boot:function(){var game=this.scene.sys.game,settings=this.settings.input,config=game.config;this.enabled=GetValue$c(settings,"gamepad",config.inputGamepad)&&game.device.input.gamepads,this.target=GetValue$c(settings,"gamepad.target",config.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(InputEvents$2.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(InputEvents$2.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var _this=this,target=this.target,handler=function(event){!event.defaultPrevented&&_this.isActive()&&(_this.refreshPads(),_this.queue.push(event))};this.onGamepadHandler=handler,target.addEventListener("gamepadconnected",handler,!1),target.addEventListener("gamepaddisconnected",handler,!1),this.sceneInputPlugin.pluginEvents.on(InputEvents$2.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(InputEvents$2.UPDATE,this.update);for(var i=0;i<this.gamepads.length;i++)this.gamepads[i].removeAllListeners()},disconnectAll:function(){for(var i=0;i<this.gamepads.length;i++)this.gamepads[i].pad.connected=!1},refreshPads:function(){var connectedPads=navigator.getGamepads();if(connectedPads)for(var currentPads=this.gamepads,i=0;i<connectedPads.length;i++){var livePad=connectedPads[i];if(livePad){var id=livePad.id,index=livePad.index,currentPad=currentPads[index];if(currentPad)currentPad.id!==id?(currentPad.destroy(),currentPads[index]=new Gamepad(this,livePad)):currentPad.update(livePad);else{var newPad=new Gamepad(this,livePad);currentPads[index]=newPad,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=newPad):this._pad3=newPad:this._pad2=newPad:this._pad1=newPad}}}else this.disconnectAll()},getAll:function(){for(var out=[],pads=this.gamepads,i=0;i<pads.length;i++)pads[i]&&out.push(pads[i]);return out},getPad:function(index){for(var pads=this.gamepads,i=0;i<pads.length;i++)if(pads[i]&&pads[i].index===index)return pads[i]},update:function(){if(this.enabled){this.refreshPads();var len=this.queue.length;if(0!==len)for(var queue=this.queue.splice(0,len),i=0;i<len;i++){var event=queue[i],pad=this.getPad(event.gamepad.index);"gamepadconnected"===event.type?this.emit(Events$j.CONNECTED,pad,event):"gamepaddisconnected"===event.type&&this.emit(Events$j.DISCONNECTED,pad,event)}}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var i=0;i<this.gamepads.length;i++)this.gamepads[i]&&this.gamepads[i].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});
548/**
549	 * @author       Richard Davey <[email protected]>
550	 * @copyright    2020 Photon Storm Ltd.
551	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
552	 */InputPluginCache$2.register("GamepadPlugin",GamepadPlugin,"gamepad","gamepad","inputGamepad");var gamepad={Axis:Axis_1,Button:Button_1,Events:events$4,Gamepad:Gamepad_1,GamepadPlugin:GamepadPlugin,Configs:{DUALSHOCK_4:{UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3},SNES_USB:{UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5},XBOX_360:{UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}}},Circle$1=Circle_1,CircleContains$1=Contains_1$4,CONST$R=_const$6,CreateInteractiveObject=CreateInteractiveObject_1,CreatePixelPerfectHandler=CreatePixelPerfectHandler_1,DistanceBetween$3=DistanceBetween_1,Ellipse=Ellipse_1$1,EllipseContains=Contains_1$2,Events$i=events$8,EventEmitter$8=eventemitter3.exports,GetFastValue$R=GetFastValue_1,GEOM_CONST=_const$c,InputPluginCache$1=InputPluginCache_
5521,IsPlainObject$t=IsPlainObject_1,PluginCache$6=PluginCache_1,Rectangle$4=Rectangle_1$1,RectangleContains$2=Contains_1$3,SceneEvents$7=events$g,Triangle=Triangle_1$1,TriangleContains=Contains_1,InputPlugin=new Class_1({Extends:EventEmitter$8,initialize:function(scene){EventEmitter$8.call(this),this.scene=scene,this.systems=scene.sys,this.settings=scene.sys.settings,this.manager=scene.sys.game.input,this.pluginEvents=new EventEmitter$8,this.enabled=!0,this.displayList,this.cameras,InputPluginCache$1.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var _eventData={cancelled:!1};this._eventContainer={stopPropagation:function(){_eventData.cancelled=!0}},this._eventData=_eventData,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,scene.sys.events.once(SceneEvents$7.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$7.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(SceneEvents$7.DESTROY,this.destroy,this),this.pluginEvents.emit(Events$i.BOOT)},start:function(){var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents$7.TRANSITION_START,this.transitionIn,this),eventEmitter.on(SceneEvents$7.TRANSITION_OUT,this.transitionOut,this),eventEmitter.on(SceneEvents$7.TRANSITION_COMPLETE,this.transitionComplete,this),eventEmitter.on(SceneEvents$7.PRE_UPDATE,this.preUpdate,this),eventEmitter.once(SceneEvents$7.SHUTDOWN,this.shutdown,this),this.manager.events.on(Events$i.GAME_OUT,this.onGameOut,this),this.manager.events.on(Events$i.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(Events$i.START)},onGameOver:function(event){this.isActive()&&this.emit(Events$i.GAME_OVER,event.timeStamp,event)},onGameOut:function(event){this.isActive()&&this.emit(Events$i.GAME_OUT,event.timeStamp,event)},preUpdate:function(){this.pluginEvents.emit(Events$i.PRE_UPDATE);var removeList=this._pendingRemoval,insertList=this._pendingInsertion,toRemove=removeList.length,toInsert=insertList.length;if(0!==toRemove||0!==toInsert){for(var current=this._list,i=0;i<toRemove;i++){var gameObject=removeList[i],index=current.indexOf(gameObject);index>-1&&(current.splice(index,1),this.clear(gameObject,!0))}removeList.length=0,this._pendingRemoval.length=0,this._list=current.concat(insertList.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(time,delta){if(!this.isActive())return!1;if(this.pluginEvents.emit(Events$i.UPDATE,time,delta),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,manager=this.manager,pointers=manager.pointers,pointersTotal=manager.pointersTotal;for(i=0;i<pointersTotal;i++)pointers[i].updateMotion();if(0===this._list.length)return!1;var rate=this.pollRate;if(-1===rate)return!1;if(rate>0){if(this._pollTimer-=delta,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var captured=!1;for(i=0;i<pointersTotal;i++){var total=0,pointer=pointers[i];this._tempZones=[],this._temp=this.hitTestPointer(pointer),this.sortGameObjects(this._temp,pointer),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),total+=this.processOverOutEvents(pointer),2===this.getDragState(pointer)&&this.processDragThresholdEvent(pointer,time),total>0&&(captured=!0)}return captured},update:function(type,pointers){if(!this.isActive())return!1;for(var pointersTotal=pointers.length,captured=!1,i=0;i<pointersTotal;i++){var total=0,pointer=pointers[i];switch(this._tempZones=[],this._temp=this.hitTestPointer(pointer),this.sortGameObjects(this._temp,pointer),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),type){case CONST$R.MOUSE_DOWN:total+=this.processDragDownEvent(pointer),total+=this.processDownEvents(pointer),total+=this.processOverOutEvents(pointer);break;case CONST$R.MOUSE_UP:total+=this.processDragUpEvent(pointer),total+=this.processUpEvents(pointer),total+=this.processOverOutEvents(pointer);break;case CONST$R.TOUCH_START:total+=this.processDragDownEvent(pointer),total+=this.processDownEvents(pointer),total+=this.processOverEvents(pointer);break;case CONST$R.TOUCH_END:case CONST$R.TOUCH_CANCEL:total+=this.processDragUpEvent(pointer),total+=this.processUpEvents(pointer),total+=this.processOutEvents(pointer);break;case CONST$R.MOUSE_MOVE:case CONST$R.TOUCH_MOVE:total+=this.processDragMoveEvent(pointer),total+=this.processMoveEvents(pointer),total+=this.processOverOutEvents(pointer);break;case CONST$R.MOUSE_WHEEL:total+=this.processWheelEvent(pointer)}total>0&&(captured=!0)}return this._updatedThisFrame=!0,captured},clear:function(gameObject,skipQueue){void 0===skipQueue&&(skipQueue=!1);var input=gameObject.input;if(input){skipQueue||this.queueForRemoval(gameObject),input.gameObject=void 0,input.target=void 0,input.hitArea=void 0,input.hitAreaCallback=void 0,input.callbackContext=void 0,gameObject.input=null;var index=this._draggable.indexOf(gameObject);return index>-1&&this._draggable.splice(index,1),(index=this._drag[0].indexOf(gameObject))>-1&&this._drag[0].splice(index,1),(index=this._over[0].indexOf(gameObject))>-1&&(this._over[0].splice(index,1),this.manager.resetCursor(input)),gameObject}},disable:function(gameObject){gameObject.input.enabled=!1},enable:function(gameObject,hitArea,hitAreaCallback,dropZone){return void 0===dropZone&&(dropZone=!1),gameObject.input?gameObject.input.enabled=!0:this.setHitArea(gameObject,hitArea,hitAreaCallback),gameObject.input&&dropZone&&!gameObject.input.dropZone&&(gameObject.input.dropZone=
552dropZone),this},hitTestPointer:function(pointer){for(var cameras=this.cameras.getCamerasBelowPointer(pointer),c=0;c<cameras.length;c++){for(var camera=cameras[c],over=this.manager.hitTest(pointer,this._list,camera),i=0;i<over.length;i++){var obj=over[i];obj.input.dropZone&&this._tempZones.push(obj)}if(over.length>0)return pointer.camera=camera,over}return pointer.camera=cameras[0],[]},processDownEvents:function(pointer){var total=0,currentlyOver=this._temp,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;for(var aborted=!1,i=0;i<currentlyOver.length;i++){var gameObject=currentlyOver[i];if(gameObject.input){if(total++,gameObject.emit(Events$i.GAMEOBJECT_POINTER_DOWN,pointer,gameObject.input.localX,gameObject.input.localY,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}if(this.emit(Events$i.GAMEOBJECT_DOWN,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}}}return!aborted&&this.manager&&(pointer.downElement===this.manager.game.canvas?this.emit(Events$i.POINTER_DOWN,pointer,currentlyOver):this.emit(Events$i.POINTER_DOWN_OUTSIDE,pointer)),total},getDragState:function(pointer){return this._dragState[pointer.id]},setDragState:function(pointer,state){this._dragState[pointer.id]=state},processDragThresholdEvent:function(pointer,time){var passed=!1,timeThreshold=this.dragTimeThreshold,distanceThreshold=this.dragDistanceThreshold;if((distanceThreshold>0&&DistanceBetween$3(pointer.x,pointer.y,pointer.downX,pointer.downY)>=distanceThreshold||timeThreshold>0&&time>=pointer.downTime+timeThreshold)&&(passed=!0),passed)return this.setDragState(pointer,3),this.processDragStartList(pointer)},processDragStartList:function(pointer){if(3!==this.getDragState(pointer))return 0;for(var list=this._drag[pointer.id],i=0;i<list.length;i++){var gameObject=list[i],input=gameObject.input;input.dragState=2,input.dragStartX=gameObject.x,input.dragStartY=gameObject.y,input.dragStartXGlobal=pointer.worldX,input.dragStartYGlobal=pointer.worldY,input.dragX=input.dragStartXGlobal-input.dragStartX,input.dragY=input.dragStartYGlobal-input.dragStartY,gameObject.emit(Events$i.GAMEOBJECT_DRAG_START,pointer,input.dragX,input.dragY),this.emit(Events$i.DRAG_START,pointer,gameObject)}return this.setDragState(pointer,4),list.length},processDragDownEvent:function(pointer){var currentlyOver=this._temp;if(0===this._draggable.length||0===currentlyOver.length||!pointer.primaryDown||0!==this.getDragState(pointer))return 0;this.setDragState(pointer,1);for(var draglist=[],i=0;i<currentlyOver.length;i++){var gameObject=currentlyOver[i];gameObject.input.draggable&&0===gameObject.input.dragState&&draglist.push(gameObject)}return 0===draglist.length?(this.setDragState(pointer,0),0):(draglist.length>1&&(this.sortGameObjects(draglist,pointer),this.topOnly&&draglist.splice(1)),this._drag[pointer.id]=draglist,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(pointer,3),this.processDragStartList(pointer)):(this.setDragState(pointer,2),0))},processDragMoveEvent:function(pointer){if(2===this.getDragState(pointer)&&this.processDragThresholdEvent(pointer,this.manager.game.loop.now),4!==this.getDragState(pointer))return 0;for(var dropZones=this._tempZones,list=this._drag[pointer.id],i=0;i<list.length;i++){var dragX,dragY,gameObject=list[i],input=gameObject.input,target=input.target;if(target){var index=dropZones.indexOf(target);0===index?(gameObject.emit(Events$i.GAMEOBJECT_DRAG_OVER,pointer,target),this.emit(Events$i.DRAG_OVER,pointer,gameObject,target)):index>0?(gameObject.emit(Events$i.GAMEOBJECT_DRAG_LEAVE,pointer,target),this.emit(Events$i.DRAG_LEAVE,pointer,gameObject,target),input.target=dropZones[0],target=input.target,gameObject.emit(Events$i.GAMEOBJECT_DRAG_ENTER,pointer,target),this.emit(Events$i.DRAG_ENTER,pointer,gameObject,target)):(gameObject.emit(Events$i.GAMEOBJECT_DRAG_LEAVE,pointer,target),this.emit(Events$i.DRAG_LEAVE,pointer,gameObject,target),dropZones[0]?(input.target=dropZones[0],target=input.target,gameObject.emit(Events$i.GAMEOBJECT_DRAG_ENTER,pointer,target),this.emit
552(Events$i.DRAG_ENTER,pointer,gameObject,target)):input.target=null)}else!target&&dropZones[0]&&(input.target=dropZones[0],target=input.target,gameObject.emit(Events$i.GAMEOBJECT_DRAG_ENTER,pointer,target),this.emit(Events$i.DRAG_ENTER,pointer,gameObject,target));if(gameObject.parentContainer){var dx=pointer.worldX-input.dragStartXGlobal,dy=pointer.worldY-input.dragStartYGlobal,rotation=gameObject.getParentRotation(),dxRotated=dx*Math.cos(rotation)+dy*Math.sin(rotation),dyRotated=dy*Math.cos(rotation)-dx*Math.sin(rotation);dxRotated*=1/gameObject.parentContainer.scaleX,dyRotated*=1/gameObject.parentContainer.scaleY,dragX=dxRotated+input.dragStartX,dragY=dyRotated+input.dragStartY}else dragX=pointer.worldX-input.dragX,dragY=pointer.worldY-input.dragY;gameObject.emit(Events$i.GAMEOBJECT_DRAG,pointer,dragX,dragY),this.emit(Events$i.DRAG,pointer,gameObject,dragX,dragY)}return list.length},processDragUpEvent:function(pointer){for(var list=this._drag[pointer.id],i=0;i<list.length;i++){var gameObject=list[i],input=gameObject.input;if(input&&2===input.dragState){input.dragState=0,input.dragX=input.localX-gameObject.displayOriginX,input.dragY=input.localY-gameObject.displayOriginY;var dropped=!1,target=input.target;target&&(gameObject.emit(Events$i.GAMEOBJECT_DROP,pointer,target),this.emit(Events$i.DROP,pointer,gameObject,target),input.target=null,dropped=!0),gameObject.input&&(gameObject.emit(Events$i.GAMEOBJECT_DRAG_END,pointer,input.dragX,input.dragY,dropped),this.emit(Events$i.DRAG_END,pointer,gameObject,dropped))}}return this.setDragState(pointer,0),list.splice(0),0},processMoveEvents:function(pointer){var total=0,currentlyOver=this._temp,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;for(var aborted=!1,i=0;i<currentlyOver.length;i++){var gameObject=currentlyOver[i];if(gameObject.input){if(total++,gameObject.emit(Events$i.GAMEOBJECT_POINTER_MOVE,pointer,gameObject.input.localX,gameObject.input.localY,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}
552if(this.emit(Events$i.GAMEOBJECT_MOVE,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}if(this.topOnly)break}}return aborted||this.emit(Events$i.POINTER_MOVE,pointer,currentlyOver),total},processWheelEvent:function(pointer){var total=0,currentlyOver=this._temp,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;for(var aborted=!1,dx=pointer.deltaX,dy=pointer.deltaY,dz=pointer.deltaZ,i=0;i<currentlyOver.length;i++){var gameObject=currentlyOver[i];if(gameObject.input){if(total++,gameObject.emit(Events$i.GAMEOBJECT_POINTER_WHEEL,pointer,dx,dy,dz,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}if(this.emit(Events$i.GAMEOBJECT_WHEEL,pointer,gameObject,dx,dy,dz,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}}}return aborted||this.emit(Events$i.POINTER_WHEEL,pointer,currentlyOver,dx,dy,dz),total},processOverEvents:function(pointer){var currentlyOver=this._temp,totalInteracted=0,total=currentlyOver.length,justOver=[];if(total>0){var manager=this.manager,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;for(var aborted=!1,i=0;i<total;i++){var gameObject=currentlyOver[i];if(gameObject.input){if(justOver.push(gameObject),manager.setCursor(gameObject.input),gameObject.emit(Events$i.GAMEOBJECT_POINTER_OVER,pointer,gameObject.input.localX,gameObject.input.localY,_eventContainer),totalInteracted++,_eventData.cancelled||!gameObject.input){aborted=!0;break}
552if(this.emit(Events$i.GAMEOBJECT_OVER,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}}}aborted||this.emit(Events$i.POINTER_OVER,pointer,justOver)}return this._over[pointer.id]=justOver,totalInteracted},processOutEvents:function(pointer){var previouslyOver=this._over[pointer.id],totalInteracted=0,total=previouslyOver.length;if(total>0){var manager=this.manager,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;var aborted=!1;this.sortGameObjects(previouslyOver,pointer);for(var i=0;i<total;i++){var gameObject=previouslyOver[i];if((gameObject=previouslyOver[i]).input){if(manager.resetCursor(gameObject.input),gameObject.emit(Events$i.GAMEOBJECT_POINTER_OUT,pointer,_eventContainer),totalInteracted++,_eventData.cancelled||!gameObject.input){aborted=!0;break}if(this.emit(Events$i.GAMEOBJECT_OUT,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}aborted||this.emit(Events$i.POINTER_OUT,pointer,previouslyOver)}}this._over[pointer.id]=[]}return totalInteracted},processOverOutEvents:function(pointer){var i,gameObject,currentlyOver=this._temp,justOut=[],justOver=[],stillOver=[],previouslyOver=this._over[pointer.id],currentlyDragging=this._drag[pointer.id],manager=this.manager;for(i=0;i<previouslyOver.length;i++)gameObject=previouslyOver[i],-1===currentlyOver.indexOf(gameObject)&&-1===currentlyDragging.indexOf(gameObject)?justOut.push(gameObject):stillOver.push(gameObject);for(i=0;i<currentlyOver.length;i++)gameObject=currentlyOver[i],-1===previouslyOver.indexOf(gameObject)&&justOver.push(gameObject);var total=justOut.length,totalInteracted=0,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;var aborted=!1;if(total>0){for(this.sortGameObjects(justOut,pointer),i=0;i<total;i++)if((gameObject=justOut[i]).input){if(manager.resetCursor(gameObject.input),gameObject.emit(Events$i.GAMEOBJECT_POINTER_OUT,pointer,_eventContainer),totalInteracted++,_eventData.cancelled||!gameObject.input){aborted=!0;break}
552if(this.emit(Events$i.GAMEOBJECT_OUT,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}}aborted||this.emit(Events$i.POINTER_OUT,pointer,justOut)}if(total=justOver.length,_eventData.cancelled=!1,aborted=!1,total>0){for(this.sortGameObjects(justOver,pointer),i=0;i<total;i++)if((gameObject=justOver[i]).input){if(manager.setCursor(gameObject.input),gameObject.emit(Events$i.GAMEOBJECT_POINTER_OVER,pointer,gameObject.input.localX,gameObject.input.localY,_eventContainer),totalInteracted++,_eventData.cancelled||!gameObject.input){aborted=!0;break}if(this.emit(Events$i.GAMEOBJECT_OVER,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}}aborted||this.emit(Events$i.POINTER_OVER,pointer,justOver)}return previouslyOver=stillOver.concat(justOver),this._over[pointer.id]=this.sortGameObjects(previouslyOver,pointer),totalInteracted},processUpEvents:function(pointer){var currentlyOver=this._temp,_eventData=this._eventData,_eventContainer=this._eventContainer;_eventData.cancelled=!1;for(var aborted=!1,i=0;i<currentlyOver.length;i++){var gameObject=currentlyOver[i];if(gameObject.input){if(gameObject.emit(Events$i.GAMEOBJECT_POINTER_UP,pointer,gameObject.input.localX,gameObject.input.localY,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}
vendor: 11,117 bytes, lines 552-557
552if(this.emit(Events$i.GAMEOBJECT_UP,pointer,gameObject,_eventContainer),_eventData.cancelled||!gameObject.input){aborted=!0;break}}}return!aborted&&this.manager&&(pointer.upElement===this.manager.game.canvas?this.emit(Events$i.POINTER_UP,pointer,currentlyOver):this.emit(Events$i.POINTER_UP_OUTSIDE,pointer)),currentlyOver.length},queueForInsertion:function(child){return-1===this._pendingInsertion.indexOf(child)&&-1===this._list.indexOf(child)&&this._pendingInsertion.push(child),this},queueForRemoval:function(child){return this._pendingRemoval.push(child),this},setDraggable:function(gameObjects,value){void 0===value&&(value=!0),Array.isArray(gameObjects)||(gameObjects=[gameObjects]);for(var i=0;i<gameObjects.length;i++){var gameObject=gameObjects[i];gameObject.input.draggable=value;var index=this._draggable.indexOf(gameObject);value&&-1===index?this._draggable.push(gameObject):!value&&index>-1&&this._draggable.splice(index,1)}return this},makePixelPerfect:function(alphaTolerance){void 0===alphaTolerance&&(alphaTolerance=1);var textureManager=this.systems.textures;return CreatePixelPerfectHandler(textureManager,alphaTolerance)},setHitArea:function(gameObjects,hitArea,hitAreaCallback){if(void 0===hitArea)return this.setHitAreaFromTexture(gameObjects);Array.isArray(gameObjects)||(gameObjects=[gameObjects]);var draggable=!1,dropZone=!1,cursor=!1,useHandCursor=!1,pixelPerfect=!1,customHitArea=!0;if(IsPlainObject$t(hitArea)){var config=hitArea;hitArea=GetFastValue$R(config,"hitArea",null),hitAreaCallback=GetFastValue$R(config,"hitAreaCallback",null),draggable=GetFastValue$R(config,"draggable",!1),dropZone=GetFastValue$R(config,"dropZone",!1),cursor=GetFastValue$R(config,"cursor",!1),useHandCursor=GetFastValue$R(config,"useHandCursor",!1),pixelPerfect=GetFastValue$R(config,"pixelPerfect",!1);var alphaTolerance=GetFastValue$R(config,"alphaTolerance",1);pixelPerfect&&(hitArea={},hitAreaCallback=this.makePixelPerfect(alphaTolerance)),hitArea&&hitAreaCallback||(this.setHitAreaFromTexture(gameObjects),customHitArea=!1)}else"function"!=typeof hitArea||hitAreaCallback||(hitAreaCallback=hitArea,hitArea={});for(var i=0;i<gameObjects.length;i++){var gameObject=gameObjects[i];if(pixelPerfect&&"Container"===gameObject.type)console.warn("Cannot pixelPerfect test a Container. Use a custom callback.");else{var io=gameObject.input?gameObject.input:CreateInteractiveObject(gameObject,hitArea,hitAreaCallback);io.customHitArea=customHitArea,io.dropZone=dropZone,io.cursor=useHandCursor?"pointer":cursor,gameObject.input=io,draggable&&this.setDraggable(gameObject),this.queueForInsertion(gameObject)}}return this},setHitAreaCircle:function(gameObjects,x,y,radius,callback){void 0===callback&&(callback=CircleContains$1);var shape=new Circle$1(x,y,radius);return this.setHitArea(gameObjects,shape,callback)},setHitAreaEllipse:function(gameObjects,x,y,width,height,callback){void 0===callback&&(callback=EllipseContains);var shape=new Ellipse(x,y,width,height);return this.setHitArea(gameObjects,shape,callback)},setHitAreaFromTexture:function(gameObjects,callback){void 0===callback&&(callback=RectangleContains$2),Array.isArray(gameObjects)||(gameObjects=[gameObjects]);for(var i=0;i<gameObjects.length;i++){var gameObject=gameObjects[i],frame=gameObject.frame,width=0,height=0;gameObject.width?(width=gameObject.width,height=gameObject.height):frame&&(width=frame.realWidth,height=frame.realHeight),"Container"!==gameObject.type||0!==width&&0!==height?0!==width&&0!==height&&(gameObject.input=CreateInteractiveObject(gameObject,new Rectangle$4(0,0,width,height),callback),this.queueForInsertion(gameObject)):console.warn("Container.setInteractive must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(gameObjects,x,y,width,height,callback){void 0===callback&&(callback=RectangleContains$2);var shape=new Rectangle$4(x,y,width,height);return this.setHitArea(gameObjects,shape,callback)},setHitAreaTriangle:function(gameObjects,x1,y1,x2,y2,x3,y3,callback){void 0===callback&&(callback=TriangleContains);var shape=new Triangle(x1,y1,x2,y2,x3,y3);return this.setHitArea(gameObjects,shape,callback)},enableDebug:function(gameObject,color){void 0===color&&(color=65280);var input=gameObject.input;if(!input||!input.hitArea)return this;var shape=input.hitArea,shapeType=shape.type,debug=input.hitAreaDebug,factory=this.systems.add,updateList=this.systems.updateList;debug&&(updateList.remove(debug),debug.destroy(),debug=null);var offsetx=0,offsety=0;switch(shapeType){case GEOM_CONST.CIRCLE:debug=factory.arc(0,0,shape.radius),offsetx=shape.x-shape.radius,offsety=shape.y-shape.radius;break;case GEOM_CONST.ELLIPSE:debug=factory.ellipse(0,0,shape.width,shape.height),offsetx=shape.x-shape.width/2,offsety=shape.y-shape.height/2;break;case GEOM_CONST.LINE:debug=factory.line(0,0,shape.x1,shape.y1,shape.x2,shape.y2);break;case GEOM_CONST.POLYGON:debug=factory.polygon(0,0,shape.points);break;case GEOM_CONST.RECTANGLE:debug=factory.rectangle(0,0,shape.width,shape.height),offsetx=shape.x,offsety=shape.y;break;case GEOM_CONST.TRIANGLE:debug=factory.triangle(0,0,shape.x1,shape.y1,shape.x2,shape.y2,shape.x3,shape.y3)}return debug&&(debug.isFilled=!1,debug.preUpdate=function(){debug.setStrokeStyle(1/gameObject.scale,color),debug.setDisplayOrigin(gameObject.displayOriginX,gameObject.displayOriginY);var x=gameObject.x,y=gameObject.y,rotation=gameObject.rotation,scaleX=gameObject.scaleX,scaleY=gameObject.scaleY;if(gameObject.parentContainer){var matrix=gameObject.getWorldTransformMatrix();x=matrix.tx,y=matrix.ty,rotation=matrix.rotation,scaleX=matrix.scaleX,scaleY=matrix.scaleY}debug.setRotation(rotation),debug.setScale(scaleX,scaleY),debug.setPosition(x+offsetx,y+offsety),debug.setScrollFactor(gameObject.scrollFactorX,gameObject.scrollFactorY),debug.setDepth(gameObject.depth)},updateList.add(debug),input.hitAreaDebug=debug),this},removeDebug:function(gameObject){var input=gameObject.input;if(input&&input.hitAreaDebug){var debug=input.hitAreaDebug;this.systems.updateList.remove(debug),debug.destroy(),input.hitAreaDebug=null}return this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(value){return this.pollRate=value,this._pollTimer=0,this},setGlobalTopOnly:function(value){return this.manager.globalTopOnly=value,this},setTopOnly:function(value){return this.topOnly=value,this},sortGameObjects:function(gameObjects,pointer){if(gameObjects.length<2)return gameObjects;var list=pointer.camera.renderList;return gameObjects.sort((function(childA,childB){return list.indexOf(childB)-list.indexOf(childA)}))},sortDropZones:function(gameObjects){return gameObjects.length<2?gameObjects:(this.scene.sys.depthSort(),gameObjects.sort(this.sortDropZoneHandler.bind(this)))},sortDropZoneHandler:function(childA,childB){if(childA.parentContainer||childB.parentContainer){if(childA.parentContainer===childB.parentContainer)return childB.parentContainer.getIndex(childB)-childA.parentContainer.getIndex(childA);if(childA.parentContainer===childB)return-1;if(childB.parentContainer===childA)return 1;for(var listA=childA.getIndexList(),listB=childB.getIndexList(),len=Math.min(listA.length,listB.length),i=0;i<len;i++){var indexA=listA[i],indexB=listB[i];if(indexA!==indexB)return indexB-indexA}return listB.length-listA.length}return this.displayList.getIndex(childB)-this.displayList.getIndex(childA)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(quantity){return this.manager.addPointer(quantity)},setDefaultCursor:function(cursor){return this.manager.setDefaultCursor(cursor),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit(Events$i.SHUTDOWN),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0,this._dragState.length=0;for(var i=0;i<10;i++)this._drag[i]=[],this._over[i]=[];this.removeAllListeners();var manager=this.manager;manager.canvas.style.cursor=manager.defaultCursor;var eventEmitter=this.systems.events;eventEmitter.off(SceneEvents$7.TRANSITION_START,this.transitionIn,this),eventEmitter.off(SceneEvents$7.TRANSITION_OUT,this.transitionOut,this),eventEmitter.off(SceneEvents$7.TRANSITION_COMPLETE,this.transitionComplete,this),eventEmitter.off(SceneEvents$7.PRE_UPDATE,this.preUpdate,this),manager.events.off(Events$i.GAME_OUT,this.onGameOut,this),manager.events.off(Events$i.GAME_OVER,this.onGameOver,this),eventEmitter.off(SceneEvents$7.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit(Events$i.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(SceneEvents$7.START,this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},isOver:{get:function(){return this.manager.isOver}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});
553/**
554	 * @author       Richard Davey <[email protected]>
555	 * @copyright    2020 Photon Storm Ltd.
556	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
557	 */PluginCache$6.register("InputPlugin",InputPlugin,"input");var InputPlugin_1=InputPlugin,events$3={ANY_KEY_DOWN:"keydown",ANY_KEY_UP:"keyup",COMBO_MATCH:"keycombomatch",DOWN:"down",KEY_DOWN:"keydown-",KEY_UP:"keyup-",UP:"up"},EventEmitter$7=eventemitter3.exports,Events$h=events$3,Key_1=new Class_1({Extends:EventEmitter$7,initialize:function(plugin,keyCode){EventEmitter$7.call(this),this.plugin=plugin,this.keyCode=keyCode,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(value){return this.emitOnRepeat=value,this},onDown:function(event){this.originalEvent=event,this.enabled&&(this.altKey=event.altKey,this.ctrlKey=event.ctrlKey,this.shiftKey=event.shiftKey,this.metaKey=event.metaKey,this.location=event.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit
557(Events$h.DOWN,this,event):(this.isDown=!0,this.isUp=!1,this.timeDown=event.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(Events$h.DOWN,this,event)))},onUp:function(event){this.originalEvent=event,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=event.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(Events$h.UP,this,event))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}}),AdvanceKeyCombo_1=function(event,combo){return combo.timeLastMatched=event.timeStamp,combo.index++,combo.index===combo.size||(combo.current=combo.keyCodes[combo.index],!1)},AdvanceKeyCombo=AdvanceKeyCombo_1,ProcessKeyCombo_1=function(event,combo){if(combo.matched)return!0;var comboMatched=!1,keyMatched=!1;if(event.keyCode===combo.current)if(combo.index>0&&combo.maxKeyDelay>0){var timeLimit=combo.timeLastMatched+combo.maxKeyDelay;event.timeStamp<=timeLimit&&(keyMatched=!0,comboMatched=AdvanceKeyCombo(event,combo))}else keyMatched=!0,comboMatched=AdvanceKeyCombo(event,combo);return!keyMatched&&combo.resetOnWrongKey&&(combo.index=0,combo.current=combo.keyCodes[0]),comboMatched&&(combo.timeLastMatched=event.timeStamp,combo.matched=!0,combo.timeMatched=event.timeStamp),comboMatched},ResetKeyCombo_1=function(combo){return combo.current=combo.keyCodes[0],combo.index=0,combo.timeLastMatched=0,combo.matched=!1,combo.timeMatched=0,combo},Events$g=events$3,GetFastValue$Q=GetFastValue_1,ProcessKeyCombo=ProcessKeyCombo_1,ResetKeyCombo=ResetKeyCombo_1,KeyCombo$1=new Class_1({initialize:function(keyboardPlugin,keys,config){if(void 0===config&&(config={}),keys.length<2)return!1;this.manager=keyboardPlugin,this.enabled=!0,this.keyCodes=[];for(var i=0;i<keys.length;i++){var char=keys[i];"string"==typeof char?this.keyCodes.push(char.toUpperCase().charCodeAt(0)):"number"==typeof char?this.keyCodes.push(char):char.hasOwnProperty("keyCode")&&this.keyCodes.push(char.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=GetFastValue$Q(config,"resetOnWrongKey",!0),this.maxKeyDelay=GetFastValue$Q(config,"maxKeyDelay",0),this.resetOnMatch=GetFastValue$Q(config,"resetOnMatch",!1),this.deleteOnMatch=GetFastValue$Q(config,"deleteOnMatch",!1);var _this=this;this.onKeyDown=function(event){!_this.matched&&_this.enabled&&(ProcessKeyCombo(event,_this)&&(_this.manager.emit(Events$g.COMBO_MATCH,_this,event),_this.resetOnMatch?ResetKeyCombo(_this):_this.deleteOnMatch&&_this.destroy()))},this.manager.on(Events$g.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(Events$g.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}}),KeyCombo_1=KeyCombo$1,KeyCodes$1=KeyCodes_1,KeyMap$1={};
558/**
559	 * @author       Richard Davey <[email protected]>
560	 * @copyright    2020 Photon Storm Ltd.
561	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
562	 */for(var key in KeyCodes$1)KeyMap$1[KeyCodes$1[key]]=key;var EventEmitter$6=eventemitter3.exports,Events$f=events$3,GameEvents=events$k,GetValue$b=GetValue_1,InputEvents$1=events$8,InputPluginCache=InputPluginCache_1,Key=Key_1,KeyCodes=KeyCodes_1,KeyCombo=KeyCombo_1,KeyMap=KeyMap$1,SceneEvents$6=events$g,SnapFloor$3=SnapFloor_1,KeyboardPlugin=new Class_1({Extends:EventEmitter$6,initialize:function(sceneInputPlugin){EventEmitter$6.call(this),this.game=sceneInputPlugin.systems.game,this.scene=sceneInputPlugin.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=sceneInputPlugin,this.manager=sceneInputPlugin.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,sceneInputPlugin.pluginEvents.once(InputEvents$1.BOOT,this.boot,this),sceneInputPlugin.pluginEvents.on(InputEvents$1.START,this.start,this)},boot:function(){var settings=this.settings.input;
vendor: 5,438 bytes, lines 562-567
562this.enabled=GetValue$b(settings,"keyboard",!0);var captures=GetValue$b(settings,"keyboard.capture",null);captures&&this.addCaptures(captures),this.sceneInputPlugin.pluginEvents.once(InputEvents$1.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(InputEvents$1.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(InputEvents$1.SHUTDOWN,this.shutdown,this),this.game.events.on(GameEvents.BLUR,this.resetKeys,this),this.scene.sys.events.on(SceneEvents$6.PAUSE,this.resetKeys,this),this.scene.sys.events.on(SceneEvents$6.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(keycode){return this.manager.addCapture(keycode),this},removeCapture:function(keycode){return this.manager.removeCapture(keycode),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:KeyCodes.UP,down:KeyCodes.DOWN,left:KeyCodes.LEFT,right:KeyCodes.RIGHT,space:KeyCodes.SPACE,shift:KeyCodes.SHIFT})},addKeys:function(keys,enableCapture,emitOnRepeat){void 0===enableCapture&&(enableCapture=!0),void 0===emitOnRepeat&&(emitOnRepeat=!1);var output={};if("string"==typeof keys){keys=keys.split(",");for(var i=0;i<keys.length;i++){var currentKey=keys[i].trim();currentKey&&(output[currentKey]=this.addKey(currentKey,enableCapture,emitOnRepeat))}}else for(var key in keys)output[key]=this.addKey(keys[key],enableCapture,emitOnRepeat);return output},addKey:function(key,enableCapture,emitOnRepeat){void 0===enableCapture&&(enableCapture=!0),void 0===emitOnRepeat&&(emitOnRepeat=!1);var keys=this.keys;if(key instanceof Key){var idx=keys.indexOf(key);return idx>-1?keys[idx]=key:keys[key.keyCode]=key,enableCapture&&this.addCapture(key.keyCode),key.setEmitOnRepeat(emitOnRepeat),key}return"string"==typeof key&&(key=KeyCodes[key.toUpperCase()]),keys[key]||(keys[key]=new Key(this,key),enableCapture&&this.addCapture(key),keys[key].setEmitOnRepeat(emitOnRepeat)),keys[key]},removeKey:function(key,destroy){void 0===destroy&&(destroy=!1);var ref,keys=this.keys;if(key instanceof Key){var idx=keys.indexOf(key);idx>-1&&(ref=this.keys[idx],this.keys[idx]=void 0)}else"string"==typeof key&&(key=KeyCodes[key.toUpperCase()]);return keys[key]&&(ref=keys[key],keys[key]=void 0),ref&&(ref.plugin=null,destroy&&ref.destroy()),this},removeAllKeys:function(destroy){for(var keys=this.keys,i=0;i<keys.length;i++){var key=keys[i];key&&(keys[i]=void 0,destroy&&key.destroy())}return this},createCombo:function(keys,config){return new KeyCombo(this,keys,config)},checkDown:function(key,duration){if(void 0===duration&&(duration=0),this.enabled&&key.isDown){var t=SnapFloor$3(this.time-key.timeDown,duration);if(t>key._tick)return key._tick=t,!0}return!1},update:function(){var queue=this.manager.queue,len=queue.length;if(this.isActive()&&0!==len)for(var keys=this.keys,i=0;i<len;i++){var event=queue[i],code=event.keyCode,key=keys[code],repeat=!1;void 0===event.cancelled&&(event.cancelled=0,event.stopImmediatePropagation=function(){event.cancelled=1},event.stopPropagation=function(){event.cancelled=-1}),-1!==event.cancelled&&(code===this.prevCode&&event.timeStamp===this.prevTime&&event.type===this.prevType||(this.prevCode=code,this.prevTime=event.timeStamp,this.prevType=event.type,"keydown"===event.type?(key&&(repeat=key.isDown,key.onDown(event)),event.cancelled||key&&repeat||(KeyMap[code]&&this.emit(Events$f.KEY_DOWN+KeyMap[code],event),event.cancelled||this.emit(Events$f.ANY_KEY_DOWN,event))):(key&&key.onUp(event),event.cancelled||(KeyMap[code]&&this.emit(Events$f.KEY_UP+KeyMap[code],event),event.cancelled||this.emit(Events$f.ANY_KEY_UP,event))),1===event.cancelled&&(event.cancelled=0)))}},resetKeys:function(){for(var keys=this.keys,i=0;i<keys.length;i++)keys[i]&&keys[i].reset();return this},shutdown:function(){this.removeAllKeys(!0),this.removeAllListeners(),this.sceneInputPlugin.manager.events.off(InputEvents$1.MANAGER_PROCESS,this.update,this),this.game.events.off(GameEvents.BLUR,this.resetKeys),this.scene.sys.events.off(SceneEvents$6.PAUSE,this.resetKeys,this),this.scene.sys.events.off(SceneEvents$6.SLEEP,this.resetKeys,this),this.queue=[]},destroy:function(){this.shutdown();for(var keys=this.keys,i=0;i<keys.length;i++)keys[i]&&keys[i].destroy();this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.manager=null},time:{get:function(){return this.sceneInputPlugin.manager.time}}});
563/**
564	 * @author       Richard Davey <[email protected]>
565	 * @copyright    2020 Photon Storm Ltd.
566	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
567	 */InputPluginCache.register("KeyboardPlugin",KeyboardPlugin,"keyboard","keyboard","inputKeyboard");var JustDown_1=function(key){return!!key._justDown&&(key._justDown=!1,!0)},JustUp_1=function(key){return!!key._justUp&&(key._justUp=!1,!0)},DownDuration_1=function(key,duration){void 0===duration&&(duration=50);var current=key.plugin.game.loop.time-key.timeDown;return key.isDown&&current<duration},UpDuration_1=function(key,duration){void 0===duration&&(duration=50);var current=key.plugin.game.loop.time-key.timeUp;return key.isUp&&current<duration}
567,Input={CreatePixelPerfectHandler:CreatePixelPerfectHandler_1,CreateInteractiveObject:CreateInteractiveObject_1,Events:events$8,Gamepad:gamepad,InputManager:InputManager_1,InputPlugin:InputPlugin_1,InputPluginCache:InputPluginCache_1,Keyboard:{Events:events$3,KeyboardManager:KeyboardManager_1,KeyboardPlugin:KeyboardPlugin,Key:Key_1,KeyCodes:KeyCodes_1,KeyCombo:KeyCombo_1,AdvanceKeyCombo:AdvanceKeyCombo_1,ProcessKeyCombo:ProcessKeyCombo_1,ResetKeyCombo:ResetKeyCombo_1,JustDown:JustDown_1,JustUp:JustUp_1,DownDuration:DownDuration_1,UpDuration:UpDuration_1},Mouse:{MouseManager:MouseManager_1},Pointer:Pointer_1,Touch:{TouchManager:TouchManager_1}},input=Input=Extend_1$1(!1,Input,_const$6),_const$3={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19},GetURL_1=function(file,baseURL){return!!file.url&&(file.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?file.url:baseURL+file.url)},XHRSettings_1=function(responseType,async,user,password,timeout,withCredentials){return void 0===responseType&&(responseType=""),void 0===async&&(async=!0),void 0===user&&(user=""),void 0===password&&(password=""),void 0===timeout&&(timeout=0),void 0===withCredentials&&(withCredentials=!1),{responseType:responseType,async:async,user:user,password:password,timeout:timeout,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:withCredentials}},Extend$b=Extend_1$1,XHRSettings$2=XHRSettings_1,MergeXHRSettings_1=function(global,local){var output=void 0===global?XHRSettings$2():Extend$b({},global);if(local)for(var setting in local)void 0!==local[setting]&&(output[setting]=local[setting]);return output},MergeXHRSettings$1=MergeXHRSettings_1,XHRLoader_1=function(file,globalXHRSettings){var config=MergeXHRSettings$1(globalXHRSettings,file.xhrSettings),xhr=new XMLHttpRequest;if(xhr.open("GET",file.src,config.async,config.user,config.password),xhr.responseType=file.xhrSettings.responseType,xhr.timeout=config.timeout,config.headers)for(var key in config.headers)xhr.setRequestHeader(key,config.headers[key]);return config.header&&config.headerValue&&xhr.setRequestHeader(config.header,config.headerValue),config.requestedWith&&xhr.setRequestHeader("X-Requested-With",config.requestedWith),config.overrideMimeType&&xhr.overrideMimeType(config.overrideMimeType),config.withCredentials&&(xhr.withCredentials=!0),xhr.onload=file.onLoad.bind(file,xhr),xhr.onerror=file.onError.bind(file,xhr),xhr.onprogress=file.onProgress.bind(file),xhr.send(),xhr},CONST$P=_const$3,Events$e=events$7,GetFastValue$P=GetFastValue_1,GetURL$2=GetURL_1,MergeXHRSettings=MergeXHRSettings_1,XHRLoader=XHRLoader_1,XHRSettings$1=XHRSettings_1,File$j=new Class_1({initialize:function(loader,fileConfig){this.loader=loader,this.cache=GetFastValue$P(fileConfig,"cache",!1),this.type=GetFastValue$P(fileConfig,"type",!1),this.key=GetFastValue$P(fileConfig,"key",!1);var loadKey=this.key;if(loader.prefix&&""!==loader.prefix&&(this.key=loader.prefix+loadKey),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var url=GetFastValue$P(fileConfig,"url");void 0===url?url=loader.path+loadKey+"."+GetFastValue$P(fileConfig,"extension",""):"string"!=typeof url||url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)||(url=loader.path+url),this.url=url,this.src="",this.xhrSettings=XHRSettings$1(GetFastValue$P(fileConfig,"responseType",void 0)),GetFastValue$P(fileConfig,"xhrSettings",!1)&&(this.xhrSettings=MergeXHRSettings(this.xhrSettings,GetFastValue$P(fileConfig,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?CONST$P.FILE_POPULATED:CONST$P.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=GetFastValue$P(fileConfig,"config",{}),this.multiFile,this.linkFile},setLink:function(fileB){this.linkFile=fileB,fileB.linkFile=this}
567,resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===CONST$P.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=CONST$P.FILE_LOADING,this.src=GetURL$2(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=XHRLoader(this,this.loader.xhr))},onLoad:function(xhr,event){var localFileOk=xhr.responseURL&&(0===xhr.responseURL.indexOf("file://")||0===xhr.responseURL.indexOf("capacitor://"))&&0===event.target.status,success=!(event.target&&200!==event.target.status)||localFileOk;4===xhr.readyState&&xhr.status>=400&&xhr.status<=599&&(success=!1),this.state=CONST$P.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,success)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(event){event.lengthComputable&&(this.bytesLoaded=event.loaded,this.bytesTotal=event.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(Events$e.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=CONST$P.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=CONST$P.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=CONST$P.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(data){void 0===data&&(data=this.data);
567var key=this.key,type=this.type;this.loader.emit(Events$e.FILE_COMPLETE,key,type,data),this.loader.emit(Events$e.FILE_KEY_COMPLETE+type+"-"+key,key,type,data),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});
568/**
569	 * @author       Richard Davey <[email protected]>
570	 * @copyright    2020 Photon Storm Ltd.
571	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
572	 */File$j.createObjectURL=function(image,blob,defaultType){if("function"==typeof URL)image.src=URL.createObjectURL(blob);else{var reader=new FileReader;reader.onload=function(){image.removeAttribute("crossOrigin"),image.src="data:"+(blob.type||defaultType)+";base64,"+reader.result.split(",")[1]},reader.onerror=image.onerror,reader.readAsDataURL(blob)}},File$j.revokeObjectURL=function(image){"function"==typeof URL&&URL.revokeObjectURL(image.src)};var File_1=File$j,CONST$O=_const$3,File$i=File_1,FileTypesManager$v=FileTypesManager_1,GetFastValue$O=GetFastValue_1,GetValue$a=GetValue_1,IsPlainObject$s=IsPlainObject_1,JSONFile$8=new Class_1({Extends:File$i,initialize:function(loader,key,url,xhrSettings,dataKey){var extension="json";if(IsPlainObject$s(key)){var config=key;key=GetFastValue$O(config,"key"),url=GetFastValue$O(config,"url"),xhrSettings=GetFastValue$O(config,"xhrSettings"),extension=GetFastValue$O(config,"extension",extension),dataKey=GetFastValue$O(config,"dataKey",dataKey)}var fileConfig={type:"json",cache:loader.cacheManager.json,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings,config:dataKey};File$i.call(this,loader,fileConfig),IsPlainObject$s(url)&&(this.data=dataKey?GetValue$a(url,dataKey):url,this.state=CONST$O.FILE_POPULATED)},onProcess:function(){if(this.state!==CONST$O.FILE_POPULATED){this.state=CONST$O.FILE_PROCESSING;try{var json=JSON.parse(this.xhrLoader.responseText)}catch(e){throw console.warn("Invalid JSON: "+this.key),this.onProcessError(),e}var key=this.config;this.data="string"==typeof key?GetValue$a(json,key,json):json}this.onProcessComplete()}});
573/**
574	 * @author       Richard Davey <[email protected]>
575	 * @copyright    2020 Photon Storm Ltd.
576	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
577	 */FileTypesManager$v.register("json",(function(key,url,dataKey,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new JSONFile$8(this,key[i]));else this.addFile(new JSONFile$8(this,key,url,xhrSettings,dataKey));return this}));var JSONFile_1=JSONFile$8,FileTypesManager$u=FileTypesManager_1,JSONFile$7=JSONFile_1,LoaderEvents=events$7,AnimationJSONFile=new Class_1({Extends:JSONFile$7,initialize:function(loader,key,url,xhrSettings,dataKey){JSONFile$7.call(this,loader,key,url,xhrSettings,dataKey),this.type="animationJSON"},onProcess:function(){this.loader.once(LoaderEvents.POST_PROCESS,this.onLoadComplete,this),JSONFile$7.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});
578/**
579	 * @author       Richard Davey <[email protected]>
580	 * @copyright    2020 Photon Storm Ltd.
581	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
582	 */FileTypesManager$u.register("animation",(function(key,url,dataKey,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new AnimationJSONFile(this,key[i]));else this.addFile(new AnimationJSONFile(this,key,url,xhrSettings,dataKey));return this}));var AnimationJSONFile_1=AnimationJSONFile,CONST$N=_const$3,File$h=File_1,FileTypesManager$t=FileTypesManager_1,GetFastValue$N=GetFastValue_1,IsPlainObject$r=IsPlainObject_1,ImageFile$7=new Class_1({Extends:File$h,initialize:function ImageFile(loader,key,url,xhrSettings,frameConfig){var normalMapURL,extension="png";if(IsPlainObject$r(key)){var config=key;key=GetFastValue$N(config,"key"),url=GetFastValue$N(config,"url"),normalMapURL=GetFastValue$N(config,"normalMap"),xhrSettings=GetFastValue$N(config,"xhrSettings"),extension=GetFastValue$N(config,"extension",extension),frameConfig=GetFastValue$N(config,"frameConfig")}Array.isArray(url)&&(normalMapURL=url[1],url=url[0]);var fileConfig={type:"image",cache:loader.textureManager,extension:extension,responseType:"blob",key:key,url:url,xhrSettings:xhrSettings,config:frameC
582onfig};if(File$h.call(this,loader,fileConfig),normalMapURL){var normalMap=new ImageFile(loader,this.key,normalMapURL,xhrSettings,frameConfig);normalMap.type="normalMap",this.setLink(normalMap),loader.addFile(normalMap)}},onProcess:function(){this.state=CONST$N.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var _this=this;this.data.onload=function(){File$h.revokeObjectURL(_this.data),_this.onProcessComplete()},this.data.onerror=function(){File$h.revokeObjectURL(_this.data),_this.onProcessError()},File$h.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var texture,linkFile=this.linkFile;linkFile&&linkFile.state===CONST$N.FILE_COMPLETE?(texture="image"===this.type?this.cache.addImage(this.key,this.data,linkFile.data):this.cache.addImage(linkFile.key,linkFile.data,this.data),this.pendingDestroy(texture),linkFile.pendingDestroy(texture)):linkFile||(texture=this.cache.addImage(this.key,this.data),this.pendingDestroy(texture))}});
583/**
584	 * @author       Richard Davey <[email protected]>
585	 * @copyright    2020 Photon Storm Ltd.
586	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
587	 */FileTypesManager$t.register("image",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new ImageFile$7(this,key[i]));else this.addFile(new ImageFile$7(this,key,url,xhrSettings));return this}));var ImageFile_1=ImageFile$7,MultiFile$9=new Class_1({initialize:function(loader,type,key,files){var finalFiles=[];files.forEach((function(file){file&&finalFiles.push(file)})),this.loader=loader,this.type=type,this.key=key,this.multiKeyIndex=loader.multiKeyIndex++,this.files=finalFiles,this.complete=!1,this.pending=finalFiles.length,this.failed=0,this.config={},this.baseURL=loader.baseURL,this.path=loader.path,this.prefix=loader.prefix;for(var i=0;i<finalFiles.length;i++)finalFiles[i].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(file){return this.files.push(file),file.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(file){-1!==this.files.indexOf(file)&&this.pending--},onFileFailed:function(file){-1!==this.files.indexOf(file)&&this.failed++}}),MultiFile_1=MultiFile$9,FileTypesManager$s=FileTypesManager_1,GetFastValue$M=GetFastValue_1,ImageFile$6=ImageFile_1,IsPlainObject$q=IsPlainObject_1,JSONFile$6=JSONFile_1,MultiFile$8=MultiFile_1,AsepriteFile=new Class_1({Extends:MultiFile$8,initialize:function(loader,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var image,data;if(IsPlainObject$q(key)){var config=key;key=GetFastValue$M(config,"key"),image=new ImageFile$6(loader,{key:key,url:GetFastValue$M(config,"textureURL"),extension:GetFastValue$M(config,"textureExtension","png"),normalMap:GetFastValue$M(config,"normalMap"),xhrSettings:GetFastValue$M(config,"textureXhrSettings")}),data=new JSONFile$6(loader,{key:key,url:GetFastValue$M(config,"atlasURL"),extension:GetFastValue$M(config,"atlasExtension","json"),xhrSettings:GetFastValue$M(config,"atlasXhrSettings")})}else image=new ImageFile$6(loader,key,textureURL,textureXhrSettings),data=new JSONFile$6(loader,key,atlasURL,atlasXhrSettings);image.linkFile?MultiFile$8.call(this,loader,"atlasjson",key,[image,data,image.linkFile]):MultiFile$8.call(this,loader,"atlasjson",key,[image,data])},addToCache:function(){if(this.isReadyToProcess()){var image=this.files[0],json=this.files[1],normalMap=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(image.key,image.data,json.data,normalMap),json.addToCache(),this.complete=!0}}});
588/**
589	 * @author       Richard Davey <[email protected]>
590	 * @copyright    2020 Photon Storm Ltd.
591	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
592	 */FileTypesManager$s.register("aseprite",(function(key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new AsepriteFile(this,key[i]),this.addFile(multifile.files);else multifile=new AsepriteFile(this,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings),this.addFile(multifile.files);return this}));var AsepriteFile_1=AsepriteFile,FileTypesManager$r=FileTypesManager_1,GetFastValue$L=GetFastValue_1,ImageFile$5=ImageFile_1,IsPlainObject$p=IsPlainObject_1,JSONFile$5=JSONFile_1,MultiFile$7=MultiFile_1,AtlasJSONFile=ne
592w Class_1({Extends:MultiFile$7,initialize:function(loader,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var image,data;if(IsPlainObject$p(key)){var config=key;key=GetFastValue$L(config,"key"),image=new ImageFile$5(loader,{key:key,url:GetFastValue$L(config,"textureURL"),extension:GetFastValue$L(config,"textureExtension","png"),normalMap:GetFastValue$L(config,"normalMap"),xhrSettings:GetFastValue$L(config,"textureXhrSettings")}),data=new JSONFile$5(loader,{key:key,url:GetFastValue$L(config,"atlasURL"),extension:GetFastValue$L(config,"atlasExtension","json"),xhrSettings:GetFastValue$L(config,"atlasXhrSettings")})}else image=new ImageFile$5(loader,key,textureURL,textureXhrSettings),data=new JSONFile$5(loader,key,atlasURL,atlasXhrSettings);image.linkFile?MultiFile$7.call(this,loader,"atlasjson",key,[image,data,image.linkFile]):MultiFile$7.call(this,loader,"atlasjson",key,[image,data])},addToCache:function(){if(this.isReadyToProcess()){var image=this.files[0],json=this.files[1],normalMap=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(image.key,image.data,json.data,normalMap),json.pendingDestroy(),this.complete=!0}}});
593/**
594	 * @author       Richard Davey <[email protected]>
595	 * @copyright    2020 Photon Storm Ltd.
596	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
597	 */FileTypesManager$r.register("atlas",(function(key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new AtlasJSONFile(this,key[i]),this.addFile(multifile.files);else multifile=new AtlasJSONFile(this,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings),this.addFile(multifile.files);return this}));var AtlasJSONFile_1=AtlasJSONFile,CONST$M=_const$3,File$g=File_1,FileTypesManager$q=FileTypesManager_1,GetFastValue$K=GetFastValue_1,IsPlainObject$o=IsPlainObject_1,ParseXML=ParseXML_1,XMLFile$2=new Class_1({Extends:File$g,initialize:function(loader,key,url,xhrSettings){var extension="xml";if(IsPlainObject$o(key)){var config=key;key=GetFastValue$K(config,"key"),url=GetFastValue$K(config,"url"),xhrSettings=GetFastValue$K(config,"xhrSettings"),extension=GetFastValue$K(config,"extension",extension)}var fileConfig={type:"xml",cache:loader.cacheManager.xml,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$g.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$M.FILE_PROCESSING,this.data=ParseXML(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});
598/**
599	 * @author       Richard Davey <[email protected]>
600	 * @copyright    2020 Photon Storm Ltd.
601	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
602	 */FileTypesManager$q.register("xml",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new XMLFile$2(this,key[i]));else this.addFile(new XMLFile$2(this,key,url,xhrSettings));return this}));var XMLFile_1=XMLFile$2,FileTypesManager$p=FileTypesManager_1,GetFastValue$J=GetFastValue_1,ImageFile$4=ImageFile_1,IsPlainObject$n=IsPlainObject_1,MultiFile$6=MultiFile_1,XMLFile$1=XMLFile_1,AtlasXMLFile=new Class_1({Extends:MultiFile$6,initialize:function(loader,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var image,data;if(IsPlainObject$n(key)){var config=key;key=GetFastValue$J(config,"key"),image=new ImageFile$4(loader,{key:key,url:GetFastValue$J(config,"textureURL"),extension:GetFastValue$J(config,"textureExtension","png"),normalMap:GetFastValue$J(config,"normalMap"),xhrSettings:GetFastValue$J(config,"textureXhrSettings")}),data=new XMLFile$1(loader,{key:key,url:GetFastValue$J(config,"atlasURL"),extension:GetFastValue$J(config,"atlasExtension","xml"),xhrSettings:GetFastValue$J(config,"atlasXhrSettings")})}else image=new ImageFile$4(loader,key,textureURL,textureXhrSettings),data=new XMLFile$1(loader,key,atlasURL,atlasXhrSettings);image.linkFile?MultiFile$6.call(this,loader,"atlasxml",key,[image,data,image.linkFile]):MultiFile$6.call(this,loader,"atlasxml",ke
vendor: 10,951 bytes, lines 602-623
602y,[image,data])},addToCache:function(){if(this.isReadyToProcess()){var image=this.files[0],xml=this.files[1],normalMap=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(image.key,image.data,xml.data,normalMap),xml.pendingDestroy(),this.complete=!0}}});
603/**
604	 * @author       Richard Davey <[email protected]>
605	 * @copyright    2020 Photon Storm Ltd.
606	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
607	 */FileTypesManager$p.register("atlasXML",(function(key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new AtlasXMLFile(this,key[i]),this.addFile(multifile.files);else multifile=new AtlasXMLFile(this,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings),this.addFile(multifile.files);return this}));var AtlasXMLFile_1=AtlasXMLFile,Events$d=events$7,File$f=File_1,GetFastValue$I=GetFastValue_1,GetURL$1=GetURL_1,IsPlainObject$m=IsPlainObject_1,HTML5AudioFile$1=new Class_1({Extends:File$f,initialize:function(loader,key,urlConfig,audioConfig){if(IsPlainObject$m(key)){var config=key;key=GetFastValue$I(config,"key"),audioConfig=GetFastValue$I(config,"config",audioConfig)}var fileConfig={type:"audio",cache:loader.cacheManager.audio,extension:urlConfig.type,key:key,url:urlConfig.url,config:audioConfig};File$f.call(this,loader,fileConfig),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var i=0;i<this.data.length;i++){var audio=this.data[i];audio.oncanplaythrough=null,audio.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(event){var audio=event.target;audio.oncanplaythrough=null,audio.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit(Events$d.FILE_PROGRESS,this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var instances=this.config&&this.config.instances||1;this.filesTotal=instances,this.filesLoaded=0,this.percentComplete=0;for(var i=0;i<instances;i++){var audio=new Audio;audio.dataset||(audio.dataset={}),audio.dataset.name=this.key+("0"+i).slice(-2),audio.dataset.used="false",this.locked?audio.dataset.locked="true":(audio.dataset.locked="false",audio.preload="auto",audio.oncanplaythrough=this.onProgress.bind(this),audio.onerror=this.onError.bind(this)),this.data.push(audio)}for(i=0;i<this.data.length;i++)(audio=this.data[i]).src=GetURL$1(this,this.loader.baseURL),this.locked||audio.load();this.locked&&setTimeout(this.onLoad.bind(this))}}),HTML5AudioFile_1=HTML5AudioFile$1,CONST$L=_const$3,File$e=File_1,FileTypesManager$o=FileTypesManager_1,GetFastValue$H=GetFastValue_1,HTML5AudioFile=HTML5AudioFile_1,IsPlainObject$l=IsPlainObject_1,AudioFile$1=new Class_1({Extends:File$e,initialize:function(loader,key,urlConfig,xhrSettings,audioContext){if(IsPlainObject$l(key)){var config=key;key=GetFastValue$H(config,"key"),xhrSettings=GetFastValue$H(config,"xhrSettings"),audioContext=GetFastValue$H(config,"context",audioContext)}var fileConfig={type:"audio",cache:loader.cacheManager.audio,extension:urlConfig.type,responseType:"arraybuffer",key:key,url:urlConfig.url,xhrSettings:xhrSettings,config:{context:audioContext}};File$e.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$L.FILE_PROCESSING;var _this=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(audioBuffer){_this.data=audioBuffer,_this.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+_this.key+" - ",e?e.message:null),_this.onProcessError()})),this.config.context=null}});
608/**
609	 * @author       Richard Davey <[email protected]>
610	 * @copyright    2020 Photon Storm Ltd.
611	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
612	 */AudioFile$1.create=function(loader,key,urls,config,xhrSettings){var game=loader.systems.game,audioConfig=game.config.audio,deviceAudio=game.device.audio;IsPlainObject$l(key)&&(urls=GetFastValue$H(key,"url",[]),config=GetFastValue$H(key,"config",{}));var urlConfig=AudioFile$1.getAudioURL(game,urls);return urlConfig?deviceAudio.webAudio&&!audioConfig.disableWebAudio?new AudioFile$1(loader,key,urlConfig,xhrSettings,game.sound.context):new HTML5AudioFile(loader,key,urlConfig,config):null},AudioFile$1.getAudioURL=function(game,urls){Array.isArray(urls)||(urls=[urls]);for(var i=0;i<urls.length;i++){var url=GetFastValue$H(urls[i],"url",urls[i]);if(0===url.indexOf("blob:")||0===url.indexOf("data:"))return{url:url,type:""};var audioType=url.match(/\.([a-zA-Z0-9]+)($|\?)/);if(audioType=GetFastValue$H(urls[i],"type",audioType?audioType[1]:"").toLowerCase(),game.device.audio[audioType])return{url:url,type:audioType}}return null},FileTypesManager$o.register("audio",(function(key,urls,config,xhrSettings){var audioFile,game=this.systems.game,audioConfig=game.config.audio,deviceAudio=game.device.audio;if(audioConfig.noAudio||!deviceAudio.webAudio&&!deviceAudio.audioData)return this;if(Array.isArray(key))for(var i=0;i<key.length;i++)(audioFile=AudioFile$1.create(this,key[i]))&&this.addFile(audioFile);else(audioFile=AudioFile$1.create(this,key,urls,config,xhrSettings))&&this.addFile(audioFile);return this}));var AudioFile_1=AudioFile$1,AudioFile=AudioFile_1,FileTypesManager$n=FileTypesManager_1,GetFastValue$G=GetFastValue_1,IsPlainObject$k=IsPlainObject_1,JSONFile$4=JSONFile_1,MultiFile$5=MultiFile_1,AudioSpriteFile=new Class_1({Extends:MultiFile$5,initialize:function(loader,key,jsonURL,audioURL,audioConfig,audioXhrSettings,jsonXhrSettings){if(IsPlainObject$k(key)){var config=key;key=GetFastValue$G(config,"key"),jsonURL=GetFastValue$G(config,"jsonURL"),audioURL=GetFastValue$G(config,"audioURL"),audioConfig=GetFastValue$G(config,"audioConfig"),audioXhrSettings=GetFastValue$G(config,"audioXhrSettings"),jsonXhrSettings=GetFastValue$G(config,"jsonXhrSettings")}var data;if(audioURL){var audio=AudioFile.create(loader,key,audioURL,audioConfig,audioXhrSettings);audio&&(data=new JSONFile$4(loader,key,jsonURL,jsonXhrSettings),MultiFile$5.call(this,loader,"audiosprite",key,[audio,data]),this.config.resourceLoad=!1)}else data=new JSONFile$4(loader,key,jsonURL,jsonXhrSettings),MultiFile$5.call(this,loader,"audiosprite",key,[data]),this.config.resourceLoad=!0,this.config.audioConfig=audioConfig,this.config.audioXhrSettings=audioXhrSettings},onFileComplete:function(file){if(-1!==this.files.indexOf(file)&&(this.pending--,this.config.resourceLoad&&"json"===file.type&&file.data.hasOwnProperty("resources"))){var urls=file.data.resources,audioConfig=GetFastValue$G(this.config,"audioConfig"),audioXhrSettings=GetFastValue$G(this.config,"audioXhrSettings"),audio=AudioFile.create(this.loader,file.key,urls,audioConfig,audioXhrSettings);audio&&(this.addToMultiFile(audio),this.loader.addFile(audio))}},addToCache:function(){if(this.isReadyToProcess()){var fileA=this.files[0],fileB=this.files[1];fileA.addToCache(),fileB.addToCache(),this.complete=!0}}});FileTypesManager$n.register("audioSprite",(function(key,jsonURL,audioURL,audioConfig,audioXhrSettings,jsonXhrSettings){var multifile,game=this.systems.game,gameAudioConfig=game.config.audio,deviceAudio=game.device.audio;if(gameAudioConfig&&gameAudioConfig.noAudio||!deviceAudio.webAudio&&!deviceAudio.audioData)return this;if(Array.isArray(key))for(var i=0;i<key.length;i++)(multifile=new AudioSpriteFile(this,key[i])).files&&this.addFile(multifile.files);else(multifile=new AudioSpriteFile(this,key,jsonURL,audioURL,audioConfig,audioXhrSettings,jsonXhrSettings)).files&&this.addFile(multifile.files);return this}));
613/**
614	 * @author       Richard Davey <[email protected]>
615	 * @copyright    2020 Photon Storm Ltd.
616	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
617	 */
618var CONST$K=_const$3,File$d=File_1,FileTypesManager$m=FileTypesManager_1,GetFastValue$F=GetFastValue_1,IsPlainObject$j=IsPlainObject_1,BinaryFile=new Class_1({Extends:File$d,initialize:function(loader,key,url,xhrSettings,dataType){var extension="bin";if(IsPlainObject$j(key)){var config=key;key=GetFastValue$F(config,"key"),url=GetFastValue$F(config,"url"),xhrSettings=GetFastValue$F(config,"xhrSettings"),extension=GetFastValue$F(config,"extension",extension),dataType=GetFastValue$F(config,"dataType",dataType)}var fileConfig={type:"binary",cache:loader.cacheManager.binary,extension:extension,responseType:"arraybuffer",key:key,url:url,xhrSettings:xhrSettings,config:{dataType:dataType}};File$d.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$K.FILE_PROCESSING;var ctor=this.config.dataType;this.data=ctor?new ctor(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});FileTypesManager$m.register("binary",(function(key,url,dataType,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new BinaryFile(this,key[i]));else this.addFile(new BinaryFile(this,key,url,xhrSettings,dataType));return this}));var BinaryFile_1=BinaryFile,FileTypesManager$l=FileTypesManager_1,GetFastValue$E=GetFastValue_1,ImageFile$3=ImageFile_1,IsPlainObject$i=IsPlainObject_1,MultiFile$4=MultiFile_1,ParseXMLBitmapFont=ParseXMLBitmapFont_1,XMLFile=XMLFile_1,BitmapFontFile=new Class_1({Extends:MultiFile$4,initialize:function(loader,key,textureURL,fontDataURL,textureXhrSettings,fontDataXhrSettings){var image,data;if(IsPlainObject$i(key)){var config=key;key=GetFastValue$E(config,"key"),image=new ImageFile$3(loader,{key:key,url:GetFastValue$E(config,"textureURL"),extension:GetFastValue$E(config,"textureExtension","png"),normalMap:GetFastValue$E(config,"normalMap"),xhrSettings:GetFastValue$E(config,"textureXhrSettings")}),data=new XMLFile(loader,{key:key,url:GetFastValue$E(config,"fontDataURL"),extension:GetFastValue$E(config,"fontDataExtension","xml"),xhrSettings:GetFastValue$E(config,"fontDataXhrSettings")})}else image=new ImageFile$3(loader,key,textureURL,textureXhrSettings),data=new XMLFile(loader,key,fontDataURL,fontDataXhrSettings);image.linkFile?MultiFile$4.call(this,loader,"bitmapfont",key,[image,data,image.linkFile]):MultiFile$4.call(this,loader,"bitmapfont",key,[image,data])},addToCache:function(){if(this.isReadyToProcess()){var image=this.files[0],xml=this.files[1];image.addToCache(),xml.pendingDestroy();var texture=image.cache.get(image.key),data=ParseXMLBitmapFont(xml.data,image.cache.getFrame(image.key),0,0,texture);this.loader.cacheManager.bitmapFont.add(image.key,{data:data,texture:image.key,frame:null}),this.complete=!0}}});
619/**
620	 * @author       Richard Davey <[email protected]>
621	 * @copyright    2020 Photon Storm Ltd.
622	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
623	 */FileTypesManager$l.register("bitmapFont",(function(key,textureURL,fontDataURL,textureXhrSettings,fontDataXhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;
623i++)multifile=new BitmapFontFile(this,key[i]),this.addFile(multifile.files);else multifile=new BitmapFontFile(this,key,textureURL,fontDataURL,textureXhrSettings,fontDataXhrSettings),this.addFile(multifile.files);return this}));var BitmapFontFile_1=BitmapFontFile,CONST$J=_const$3,File$c=File_1,FileTypesManager$k=FileTypesManager_1,GetFastValue$D=GetFastValue_1,IsPlainObject$h=IsPlainObject_1,CSSFile=new Class_1({Extends:File$c,initialize:function(loader,key,url,xhrSettings){var extension="css";if(IsPlainObject$h(key)){var config=key;key=GetFastValue$D(config,"key"),url=GetFastValue$D(config,"url"),xhrSettings=GetFastValue$D(config,"xhrSettings"),extension=GetFastValue$D(config,"extension",extension)}var fileConfig={type:"script",cache:!1,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$c.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$J.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});
624/**
625	 * @author       Richard Davey <[email protected]>
626	 * @copyright    2020 Photon Storm Ltd.
627	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
628	 */FileTypesManager$k.register("css",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new CSSFile(this,key[i]));else this.addFile(new CSSFile(this,key,url,xhrSettings));return this}));var CSSFile_1=CSSFile,CONST$I=_const$3,File$b=File_1,FileTypesManager$j=FileTypesManager_1,GetFastValue$C=GetFastValue_1,IsPlainObject$g=IsPlainObject_1,Shader=BaseShader_1,GLSLFile=new Class_1({Extends:File$b,initialize:function(loader,key,url,shaderType,xhrSettings){var extension="glsl";if(IsPlainObject$g(key)){var config=key;key=GetFastValue$C(config,"key"),url=GetFastValue$C(config,"url"),shaderType=GetFastValue$C(config,"shaderType","fragment"),xhrSettings=GetFastValue$C(config,"xhrSettings"),extension=GetFastValue$C(config,"extension",extension)}else void 0===shaderType&&(shaderType="fragment");var fileConfig={type:"glsl",cache:loader.cacheManager.shader,extension:extension,responseType:"text",key:key,url:url,config:{shaderType:shaderType},xhrSettings:xhrSettings};File$b.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$I.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var data=this.data.split("\n"),block=this.extractBlock(data,0);if(block)for(;block;){var key=this.getShaderName(block.header),shaderType=this.getShaderType(block.header),uniforms=this.getShaderUniforms(block.header),shaderSrc=block.shader;if(this.cache.has(key)){var shader=this.cache.get(key);"fragment"===shaderType?shader.fragmentSrc=shaderSrc:shader.vertexSrc=shaderSrc,shader.uniforms||(shader.uniforms=uniforms)}else"fragment"===shaderType?this.cache.add(key,new Shader(key,shaderSrc,"",uniforms)):this.cache.add(key,new Shader(key,"",shaderSrc,uniforms));block=this.extractBlock(data,block.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new Shader(this.key,this.data)):this.cache.add(this.key,new Shader(this.key,"",this.data));this.pendingDestroy()},getShaderName:function(headerSource){for(var i=0;i<headerSource.length;i++){var line=headerSource[i].trim();if("name:"===line.substring(0,5))return line.substring(5).trim()}return this.key},getShaderType:function(headerSource){for(var i=0;i<headerSource.length;i++){var line=headerSource[i].trim();if("type:"===line.substring(0,5))return line.substring(5).trim()}return this.config.shaderType},getShaderUniforms:function(headerSource){for(var uniforms={},i=0;i<headerSource.length;i++){var line=headerSource[i].trim();if("uniform."===line.substring(0,8)){var pos=line.indexOf(":");if(pos){var key=line.substring(8,pos);try{uniforms[key]=JSON.parse(line.substring(pos+1))}catch(e){console.warn("Invalid uniform JSON: "+key)}}}}return uniforms},extractBlock:function(data,offset){for(var headerStart=-1,headerEnd=-1,blockEnd=-1,headerOpen=!1,captureSource=!1,headerSource=[],shaderSource=[],i=offset;i<data.length;i++){var line=data[i].trim();if("---"===line)if(-1===headerStart)headerStart=i,headerOpen=!0;else{if(!headerOpen){captureSource=!1;break}headerEnd=i,headerOpen=!1,captureSource=!0}
628else headerOpen?headerSource.push(line):captureSource&&(shaderSource.push(line),blockEnd=i)}return headerOpen||-1===headerEnd?null:{header:headerSource,shader:shaderSource.join("\n"),offset:blockEnd}}});
629/**
630	 * @author       Richard Davey <[email protected]>
631	 * @copyright    2020 Photon Storm Ltd.
632	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
633	 */FileTypesManager$j.register("glsl",(function(key,url,shaderType,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new GLSLFile(this,key[i]));else this.addFile(new GLSLFile(this,key,url,shaderType,xhrSettings));return this}));var GLSLFile_1=GLSLFile,CONST$H=_const$3,File$a=File_1,FileTypesManager$i=FileTypesManager_1,GetFastValue$B=GetFastValue_1,IsPlainObject$f=IsPlainObject_1,HTMLFile=new Class_1({Extends:File$a,initialize:function(loader,key,url,xhrSettings){var extension="html";if(IsPlainObject$f(key)){var config=key;key=GetFastValue$B(config,"key"),url=GetFastValue$B(config,"url"),xhrSettings=GetFastValue$B(config,"xhrSettings"),extension=GetFastValue$B(config,"extension",extension)}var fileConfig={type:"text",cache:loader.cacheManager.html,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$a.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$H.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});
634/**
635	 * @author       Richard Davey <[email protected]>
636	 * @copyright    2020 Photon Storm Ltd.
637	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
638	 */FileTypesManager$i.register("html",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new HTMLFile(this,key[i]));else this.addFile(new HTMLFile(this,key,url,xhrSettings));return this}));var HTMLFile_1=HTMLFile,CONST$G=_const$3,File$9=File_1,FileTypesManager$h=FileTypesManager_1,GetFastValue$A=GetFastValue_1,IsPlainObject$e=IsPlainObject_1,HTMLTextureFile=new Class_1({Extends:File$9,initialize:function(loader,key,url,width,height,xhrSettings){void 0===width&&(width=512),void 0===height&&(height=512);var extension="html";if(IsPlainObject$e(key)){var config=key;key=GetFastValue$A(config,"key"),url=GetFastValue$A(config,"url"),xhrSettings=GetFastValue$A(config,"xhrSettings"),extension=GetFastValue$A(config,"extension",extension),width=GetFastValue$A(config,"width",width),height=GetFastValue$A(config,"height",height)}var fileConfig={type:"html",cache:loader.textureManager,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings,config:{width:width,height:height}};File$9.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$G.FILE_PROCESSING;var w=this.config.width,h=this.config.height,data=[];data.push('<svg width="'+w+'px" height="'+h+'px" viewBox="0 0 '+w+" "+h+'" xmlns="http://www.w3.org/2000/svg">'),data.push('<foreignObject width="100%" height="100%">'),data.push('<body xmlns="http://www.w3.org/1999/xhtml">'),data.push(this.xhrLoader.responseText),data.push("</body>"),data.push("</foreignObject>"),data.push("</svg>");var svg=[data.join("\n")],_this=this;try{var blob=new window.Blob(svg,{type:"image/svg+xml;charset=utf-8"})}catch(e){return _this.state=CONST$G.FILE_ERRORED,void _this.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){File$9.revokeObjectURL(_this.data),_this.onProcessComplete()},this.data.onerror=function(){File$9.revokeObjectURL(_this.data),_this.onProcessError()},File$9.createObjectURL(this.data,blob,"image/svg+xml")},addToCache:function(){var texture=this.cache.addImage(this.key,this.data);this.pendingDestroy(texture)}});
639/**
640	 * @author       Richard Davey <[email protected]>
641	 * @copyright    2020 Photon Storm Ltd.
642	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
643	 */FileTypesManager$h.register("htmlTexture",(function(key,url,width,height,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new HTMLTextureFile(this,key[i]));else this.addFile(new HTMLTextureFile(this,key,url,width,height,xhrSettings));return this}));var HTMLTextureFile_1=HTMLTextureFile,FileTypesManager$g=FileTypesManager_1,GetFastValue$z=GetFastValue_1,ImageFile$2=ImageFile_1,IsPlainObject$d=IsPlainObject_1,JSONFile$3=JSONFile_1,MultiFile$3=MultiFile_1,MultiAtlasFile=new Class_1({Extends:MultiFile$3,initialize:function(loader,key,atlasURL,path,baseURL,atlasXhrSettings,textureXhrSettings){if(IsPlainObject$d(key)){var config=key;key=GetFastValue$z(config,"key"),atlasURL=GetFastValue$z(config,"url",!1)?GetFastValue$z(config,"url"):GetFastValue$z(config,"atlasURL"),atlasXhrSettings=GetFastValue$z(config,"xhrSettings"),path=GetFastValue$z(config,"path"),baseURL=GetFastValue$z(config,"baseURL"),textureXhrSettings=GetFastValue$z(config,"textureXhrSettings")}var data=new JSONFile$3(loader,key,atlasURL,atlasXhrSettings);MultiFile$3.call(this,loader,"multiatlas",key,[data]),this.config.path=path,this.config.baseURL=baseURL,this.config.textureXhrSettings=textureXhrSettings},onFileComplete:function(file){if(-1!==this.files.indexOf(file)&&(this.pending--,"json"===file.type&&file.data.hasOwnProperty("textures"))){var textures=file.data.textures,config=this.config,loader=this.loader,currentBaseURL=loader.baseURL,currentPath=loader.path,currentPrefix=loader.prefix,baseURL=GetFastValue$z(config,"baseURL",this.baseURL),path=GetFastValue$z(config,"path",this.path),prefix=GetFastValue$z(config,"prefix",this.prefix),textureXhrSettings=GetFastValue$z(config,"textureXhrSettings");loader.setBaseURL(baseURL),loader.setPath(path),loader.setPrefix(prefix);for(var i=0;i<textures.length;i++){var textureURL=textures[i].image,key="MA"+this.multiKeyIndex+"_"+textureURL,image=new ImageFile$2(loader,key,textureURL,textureXhrSettings);if(this.addToMultiFile(image),loader.addFile(image),textures[i].normalMap){var normalMap=new ImageFile$2(loader,key,textures[i].normalMap,textureXhrSettings);normalMap.type="normalMap",image.setLink(normalMap),this.addToMultiFile(normalMap),loader.addFile(normalMap)}}loader.setBaseURL(currentBaseURL),loader.setPath(currentPath),loader.setPrefix(currentPrefix)}},addToCache:function(){if(this.isReadyToProcess()){for(var fileJSON=this.files[0],data=[],images=[],normalMaps=[],i=1;i<this.files.length;i++){var file=this.files[i];if("normalMap"!==file.type)for(var pos=file.key.indexOf("_"),key=file.key.substr(pos+1),image=file.data,t=0;t<fileJSON.data.textures.length;t++){var item=fileJSON.data.textures[t];if(item.image===key){images.push(image),data.push(item),file.linkFile&&normalMaps.push(file.linkFile.data);break}}}for(0===normalMaps.length&&(normalMaps=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,images,data,normalMaps),this.complete=!0,i=0;i<this.files.length;i++)this.files[i].pendingDestroy()}}});
644/**
645	 * @author       Richard Davey <[email protected]>
646	 * @copyright    2020 Photon Storm Ltd.
647	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
648	 */FileTypesManager$g.register("multiatlas",(function(key,atlasURL,path,baseURL,atlasXhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new MultiAtlasFile(this,key[i]),this.addFile(multifile.files);else multifile=new MultiAtlasFile(this,key,atlasURL,path,baseURL,atlasXhrSettings),this.addFile(multifile.files);return this}));var MultiAtlasFile_1=MultiAtlasFile,CONST$F=_const$3,File$8=File_1,FileTypesManager$f=FileTypesManager_1,GetFastValue$y=GetFastValue_1,IsPlainObject$c=IsPlainObject_1,ScriptFile$1=new Class_1({Extends:File$8,initialize:function(loader,key,url,xhrSettings){var extension="js";if(IsPlainObject$c(key)){var config=key;key=GetFastValue$y(config,"key"),url=GetFastValue$y(config,"url"),xhrSettings=GetFastValue$y(config,"xhrSettings"),extension=GetFastValue$y(config,"extension",extension)}var fileConfig={type:"script",cache:!1,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$8.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$F.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLo
648ader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});
649/**
650	 * @author       Richard Davey <[email protected]>
651	 * @copyright    2020 Photon Storm Ltd.
652	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
653	 */FileTypesManager$f.register("script",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new ScriptFile$1(this,key[i]));else this.addFile(new ScriptFile$1(this,key,url,xhrSettings));return this}));var ScriptFile_1=ScriptFile$1,FileTypesManager$e=FileTypesManager_1,GetFastValue$x=GetFastValue_1,IsPlainObject$b=IsPlainObject_1,MultiFile$2=MultiFile_1,ScriptFile=ScriptFile_1,MultiScriptFile=new Class_1({Extends:MultiFile$2,initialize:function(loader,key,url,xhrSettings){var extension="js",files=[];if(IsPlainObject$b(key)){var config=key;key=GetFastValue$x(config,"key"),url=GetFastValue$x(config,"url"),xhrSettings=GetFastValue$x(config,"xhrSettings"),extension=GetFastValue$x(config,"extension",extension)}Array.isArray(url)||(url=[url]);for(var i=0;i<url.length;i++){var scriptFile=new ScriptFile(loader,{key:key+"_"+i.toString(),url:url[i],extension:extension,xhrSettings:xhrSettings});scriptFile.onProcess=function(){this.onProcessComplete()},files.push(scriptFile)}MultiFile$2.call(this,loader,"scripts",key,files)},addToCache:function(){if(this.isReadyToProcess()){for(var i=0;i<this.files.length;i++){var file=this.files[i];file.data=document.createElement("script"),file.data.language="javascript",file.data.type="text/javascript",file.data.defer=!1,file.data.text=file.xhrLoader.responseText,document.head.appendChild(file.data)}this.complete=!0}}});
654/**
655	 * @author       Richard Davey <[email protected]>
656	 * @copyright    2020 Photon Storm Ltd.
657	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
658	 */FileTypesManager$e.register("scripts",(function(key,url,xhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new MultiScriptFile(this,key[i]),this.addFile(multifile.files);else multifile=new MultiScriptFile(this,key,url,xhrSettings),this.addFile(multifile.files);return this}));var MultiScriptFile_1=MultiScriptFile,CONST$E=_const$3,File$7=File_1,FileTypesManager$d=FileTypesManager_1,GetFastValue$w=GetFastValue_1,IsPlainObject$a=IsPlainObject_1,TextFile$2=new Class_1({Extends:File$7,initialize:function(loader,key,url,xhrSettings){var type="text",extension="txt",cache=loader.cacheManager.text;if(IsPlainObject$a(key)){var config=key;key=GetFastValue$w(config,"key"),url=GetFastValue$w(config,"url"),xhrSettings=GetFastValue$w(config,"xhrSettings"),extension=GetFastValue$w(config,"extension",extension),type=GetFastValue$w(config,"type",type),cache=GetFastValue$w(config,"cache",cache)}var fileConfig={type:type,cache:cache,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$7.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$E.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});
659/**
660	 * @author       Richard Davey <[email protected]>
661	 * @copyright    2020 Photon Storm Ltd.
662	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
663	 */FileTypesManager$d.register("text",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new TextFile$2(this,key[i]));else this.addFile(new TextFile$2(this,key,url,xhrSettings));return this}));var TextFile_1=TextFile$2,FileTypesManager$c=FileTypesManager_1,GetFastValue$v=GetFastValue_1,IsPlainObject$9=IsPlainObject_1,MultiFile$1=MultiFile_1,ParseObj=ParseObj_1,ParseObjMaterial=ParseObjMaterial_1,TextFile$1=TextFile_1,OBJFile=new Class_1({Extends:MultiFile$1,initialize:function(loader,key,objURL,matURL,flipUV,xhrSettings){var obj,mat,cache=loader.cacheManager.obj;if(IsPlainObject$9(key)){var config=key;key=GetFastValue$v(config,"key"),obj=new TextFile$1(loader,{key:key,type:"obj",cache:cache,url:GetFastValue$v(config,"url"),extension:GetFastValue$v(config,"extension","obj"),xhrSettings:GetFastValue$v(config,"xhrSettings"),config:{flipUV:GetFastValue$v(config,"flipUV",flipUV)}}),(matURL=GetFastValue$v(config,"matURL"))&&(mat=new TextFile$1(loader,{key:key,type:"mat",cache:cache,url:matURL,extension:GetFastValue$v(config,"matExtension","mat"),xhrSettings:GetFastValue$v(config,"xhrSettings")}))}else obj=new TextFile$1(loader,{key:key,url:objURL,type:"obj",cache:cache,extension:"obj",xhrSettings:xhrSettings,config:{flipUV:flipUV}}),matURL&&(mat=new TextFile$1(loader,{key:key,url:matURL,type:"mat",cache:cache,extension:"mat",x
663hrSettings:xhrSettings}));MultiFile$1.call(this,loader,"obj",key,[obj,mat])},addToCache:function(){if(this.isReadyToProcess()){var obj=this.files[0],mat=this.files[1],objData=ParseObj(obj.data,obj.config.flipUV);mat&&(objData.materials=ParseObjMaterial(mat.data)),obj.cache.add(obj.key,objData),this.complete=!0}}});
664/**
665	 * @author       Richard Davey <[email protected]>
666	 * @copyright    2020 Photon Storm Ltd.
667	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
668	 */FileTypesManager$c.register("obj",(function(key,objURL,matURL,flipUVs,xhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new OBJFile(this,key[i]),this.addFile(multifile.files);else multifile=new OBJFile(this,key,objURL,matURL,flipUVs,xhrSettings),this.addFile(multifile.files);return this}));var OBJFile_1=OBJFile,CONST$D=_const$3,FileTypesManager$b=FileTypesManager_1,JSONFile$2=JSONFile_1,PackFile=new Class_1({Extends:JSONFile$2,initialize:function(loader,key,url,xhrSettings,dataKey){JSONFile$2.call(this,loader,key,url,xhrSettings,dataKey),this.type="packfile"},onProcess:function(){this.state!==CONST$D.FILE_POPULATED&&(this.state=CONST$D.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});
669/**
670	 * @author       Richard Davey <[email protected]>
671	 * @copyright    2020 Photon Storm Ltd.
672	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
673	 */FileTypesManager$b.register("pack",(function(key,url,packKey,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new PackFile(this,key[i]));else this.addFile(new PackFile(this,key,url,xhrSettings,packKey));return this}));var PackFile_1=PackFile,CONST$C=_const$3,File$6=File_1,FileTypesManager$a=FileTypesManager_1,GetFastValue$u=GetFastValue_1,IsPlainObject$8=IsPlainObject_1,PluginFile=new Class_1({Extends:File$6,initialize:function(loader,key,url,start,mapping,xhrSettings){var extension="js";if(IsPlainObject$8(key)){var config=key;key=GetFastValue$u(config,"key"),url=GetFastValue$u(config,"url"),xhrSettings=GetFastValue$u(config,"xhrSettings"),extension=GetFastValue$u(config,"extension",extension),start=GetFastValue$u(config,"start"),mapping=GetFastValue$u(config,"mapping")}var fileConfig={type:"plugin",cache:!1,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings,config:{start:start,mapping:mapping}};File$6.call(this,loader,fileConfig),"function"==typeof url&&(this.data=url,this.state=CONST$C.FILE_POPULATED)},onProcess:function(){var pluginManager=this.loader.systems.plugins,config=this.config,start=GetFastValue$u(config,"start",!1),mapping=GetFastValue$u(config,"mapping",null);if(this.state===CONST$C.FILE_POPULATED)pluginManager.install(this.key,this.data,start,mapping);else{this.state=CONST$C.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var plugin=pluginManager.install(this.key,window[this.key],start,mapping);(start||mapping)&&(this.loader.systems[mapping]=plugin,this.loader.scene[mapping]=plugin)}this.onProcessComplete()}});
674/**
675	 * @author       Richard Davey <[email protected]>
676	 * @copyright    2020 Photon Storm Ltd.
677	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
678	 */FileTypesManager$a.register("plugin",(function(key,url,start,mapping,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new PluginFile(this,key[i]));else this.addFile(new PluginFile(this,key,url,start,mapping,xhrSettings));return this}));var PluginFile_1=PluginFile,CONST$B=_const$3,File$5=File_1,FileTypesManager$9=FileTypesManager_1,GetFastValue$t=GetFastValue_1,IsPlainObject$7=IsPlainObject_1,SceneFile=new Class_1({Extends:File$5,initialize:function(loader,key,url,xhrSettings){var extension="js";if(IsPlainObject$7(key)){var config=key;key=GetFastValue$t(config,"key"),url=GetFastValue$t(config,"url"),xhrSettings=GetFastValue$t(config,"xhrSettings"),extension=GetFastValue$t(config,"extension",extension)}var fileConfig={type:"text",extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$5.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$B.FILE_PROCESSING,this.data=this.xhrLo
vendor: 4,439 bytes, lines 678-693
678ader.responseText,this.onProcessComplete()},addToCache:function(){var code=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),eval2=eval;this.loader.sceneManager.add(this.key,eval2(code)),this.complete=!0}});
679/**
680	 * @author       Richard Davey <[email protected]>
681	 * @copyright    2020 Photon Storm Ltd.
682	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
683	 */FileTypesManager$9.register("sceneFile",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new SceneFile(this,key[i]));else this.addFile(new SceneFile(this,key,url,xhrSettings));return this}));var SceneFile_1=SceneFile,CONST$A=_const$3,File$4=File_1,FileTypesManager$8=FileTypesManager_1,GetFastValue$s=GetFastValue_1,IsPlainObject$6=IsPlainObject_1,ScenePluginFile=new Class_1({Extends:File$4,initialize:function(loader,key,url,systemKey,sceneKey,xhrSettings){var extension="js";if(IsPlainObject$6(key)){var config=key;key=GetFastValue$s(config,"key"),url=GetFastValue$s(config,"url"),xhrSettings=GetFastValue$s(config,"xhrSettings"),extension=GetFastValue$s(config,"extension",extension),systemKey=GetFastValue$s(config,"systemKey"),sceneKey=GetFastValue$s(config,"sceneKey")}var fileConfig={type:"scenePlugin",cache:!1,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings,config:{systemKey:systemKey,sceneKey:sceneKey}};File$4.call(this,loader,fileConfig),"function"==typeof url&&(this.data=url,this.state=CONST$A.FILE_POPULATED)},onProcess:function(){var pluginManager=this.loader.systems.plugins,config=this.config,key=this.key,systemKey=GetFastValue$s(config,"systemKey",key),sceneKey=GetFastValue$s(config,"sceneKey",key);this.state===CONST$A.FILE_POPULATED?pluginManager.installScenePlugin(systemKey,this.data,sceneKey,this.loader.scene,!0):(this.state=CONST$A.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),pluginManager.installScenePlugin(systemKey,window[this.key],sceneKey,this.loader.scene,!0)),this.onProcessComplete()}});
684/**
685	 * @author       Richard Davey <[email protected]>
686	 * @copyright    2020 Photon Storm Ltd.
687	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
688	 */FileTypesManager$8.register("scenePlugin",(function(key,url,systemKey,sceneKey,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new ScenePluginFile(this,key[i]));else this.addFile(new ScenePluginFile(this,key,url,systemKey,sceneKey,xhrSettings));return this}));var ScenePluginFile_1=ScenePluginFile,FileTypesManager$7=FileTypesManager_1,ImageFile$1=ImageFile_1,SpriteSheetFile=new Class_1({Extends:ImageFile$1,initialize:function(loader,key,url,frameConfig,xhrSettings){ImageFile$1.call(this,loader,key,url,xhrSettings,frameConfig),this.type="spritesheet"},addToCache:function(){var texture=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(texture)}});
689/**
690	 * @author       Richard Davey <[email protected]>
691	 * @copyright    2020 Photon Storm Ltd.
692	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
693	 */FileTypesManager$7.register("spritesheet",(function(key,url,frameConfig,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new SpriteSheetFile(this,key[i]));else this.addFile(new SpriteSheetFile(this,key,url,frameConfig,xhrSettings));return this}));var SpriteSheetFile_1=SpriteSheetFile,CONST$z=_const$3,File$3=File_1,FileTypesManager$6=FileTypesManager_1,GetFastValue$r=GetFastValue_1,IsPlainObject$5=IsPlainObject_1,SVGFile=new Class_1({Extends:File$3,initialize:function(loader,key,url,svgConfig,xhrSettings){var extension="svg";if(IsPlainObject$5(key)){var config=key;key=GetFastValue$r(config,"key"),url=GetFastValue$r(config,"url"),svgConfig=GetFastValue$r(config,"svgConfig",{}),xhrSettings=GetFastValue$r(config,"xhrSettings"),extension=GetFastValue$r(config,"extension",extension)}var fileConfig={type:"svg",cache:loader.textureManager,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings,config:{width:GetFastValue$r(svgConfig,"width"),height:GetFastValue$r(svgConfig,"height"),scale:GetFastValue$r(svgConfig,"scale")}};File$3.call(this,loader,fileConfig)},onProcess:function(){this.state=CONST$z.FILE_PROCESSING;
693var text=this.xhrLoader.responseText,svg=[text],width=this.config.width,height=this.config.height,scale=this.config.scale;resize:if(width&&height||scale){var svgXML=(new DOMParser).parseFromString(text,"text/xml").getElementsByTagName("svg")[0],hasViewBox=svgXML.hasAttribute("viewBox"),svgWidth=parseFloat(svgXML.getAttribute("width")),svgHeight=parseFloat(svgXML.getAttribute("height"));if(!hasViewBox&&svgWidth&&svgHeight)svgXML.setAttribute("viewBox","0  0 "+svgWidth+" "+svgHeight);else if(hasViewBox&&!svgWidth&&!svgHeight){var viewBox=svgXML.getAttribute("viewBox").split(/\s+|,/);svgWidth=viewBox[2],svgHeight=viewBox[3]}if(scale){if(!svgWidth||!svgHeight)break resize;width=svgWidth*scale,height=svgHeight*scale}svgXML.setAttribute("width",width.toString()+"px"),svgXML.setAttribute("height",height.toString()+"px"),svg=[(new XMLSerializer).serializeToString(svgXML)]}try{var blob=new window.Blob(svg,{type:"image/svg+xml;charset=utf-8"})}catch(e){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var _this=this,retry=!1;this.data.onload=function(){retry||File$3.revokeObjectURL(_this.data),_this.onProcessComplete()},this.data.onerror=function(){retry?_this.onProcessError():(retry=!0,File$3.revokeObjectURL(_this.data),_this.data.src="data:image/svg+xml,"+encodeURIComponent(svg.join("")))},File$3.createObjectURL(this.data,blob,"image/svg+xml")},addToCache:function(){var texture=this.cache.addImage(this.key,this.data);this.pendingDestroy(texture)}});
694/**
695	 * @author       Richard Davey <[email protected]>
696	 * @copyright    2020 Photon Storm Ltd.
697	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
698	 */FileTypesManager$6.register("svg",(function(key,url,svgConfig,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new SVGFile(this,key[i]));else this.addFile(new SVGFile(this,key,url,svgConfig,xhrSettings));return this}));var SVGFile_1=SVGFile,Formats$7={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3},CONST$y=_const$3,File$2=File_1,FileTypesManager$5=FileTypesManager_1,GetFastValue$q=GetFastValue_1,IsPlainObject$4=IsPlainObject_1,TILEMAP_FORMATS$2=Formats$7,TilemapCSVFile=new Class_1({Extends:File$2,initialize:function(loader,key,url,xhrSettings){var extension="csv";if(IsPlainObject$4(key)){var config=key;key=GetFastValue$q(config,"key"),url=GetFastValue$q(config,"url"),xhrSettings=GetFastValue$q(config,"xhrSettings"),extension=GetFastValue$q(config,"extension",extension)}var fileConfig={type:"tilemapCSV",cache:loader.cacheManager.tilemap,extension:extension,responseType:"text",key:key,url:url,xhrSettings:xhrSettings};File$2.call(this,loader,fileConfig),this.tilemapFormat=TILEMAP_FORMATS$2.CSV},onProcess:function(){this.state=CONST$y.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var tiledata={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,tiledata),this.pendingDestroy(tiledata)}});
699/**
700	 * @author       Richard Davey <[email protected]>
701	 * @copyright    2020 Photon Storm Ltd.
702	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
703	 */FileTypesManager$5.register("tilemapCSV",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new TilemapCSVFile(this,key[i]));else this.addFile(new TilemapCSVFile(this,key,url,xhrSettings));return this}));var TilemapCSVFile_1=TilemapCSVFile,FileTypesManager$4=FileTypesManager_1,JSONFile$1=JSONFile_1,TILEMAP_FORMATS$1=Formats$7,TilemapImpactFile=new Class_1({Extends:JSONFile$1,initialize:function(loader,key,url,xhrSettings){JSONFile$1.call(this,loader,key,url,xhrSettings),this.type="tilemapJSON",this.cache=loader.cacheManager.tilemap},addToCache:function(){var tiledata={format:TILEMAP_FORMATS$1.WELTMEISTER,data:this.data};this.cache.add(this.key,tiledata),this.pendingDestroy(tiledata)}});
704/**
705	 * @author       Richard Davey <[email protected]>
706	 * @copyright    2020 Photon Storm Ltd.
707	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
708	 */FileTypesManager$4.register("tilemapImpact",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new TilemapImpactFile(this,key[i]));else this.addFile(new TilemapImpactFile(this,key,url,xhrSettings));return this}));var TilemapImpactFile_1=TilemapImpactFile,FileTypesManager$3=FileTypesManager_1,JSONFile=JSONFile_1,TILEMAP_FORMATS=Formats$7,TilemapJSONFile=ne
708w Class_1({Extends:JSONFile,initialize:function(loader,key,url,xhrSettings){JSONFile.call(this,loader,key,url,xhrSettings),this.type="tilemapJSON",this.cache=loader.cacheManager.tilemap},addToCache:function(){var tiledata={format:TILEMAP_FORMATS.TILED_JSON,data:this.data};this.cache.add(this.key,tiledata),this.pendingDestroy(tiledata)}});
709/**
710	 * @author       Richard Davey <[email protected]>
711	 * @copyright    2020 Photon Storm Ltd.
712	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
713	 */FileTypesManager$3.register("tilemapTiledJSON",(function(key,url,xhrSettings){if(Array.isArray(key))for(var i=0;i<key.length;i++)this.addFile(new TilemapJSONFile(this,key[i]));else this.addFile(new TilemapJSONFile(this,key,url,xhrSettings));return this}));var TilemapJSONFile_1=TilemapJSONFile,FileTypesManager$2=FileTypesManager_1,GetFastValue$p=GetFastValue_1,ImageFile=ImageFile_1,IsPlainObject$3=IsPlainObject_1,MultiFile=MultiFile_1,TextFile=TextFile_1,UnityAtlasFile=new Class_1({Extends:MultiFile,initialize:function(loader,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var image,data;if(IsPlainObject$3(key)){var config=key;key=GetFastValue$p(config,"key"),image=new ImageFile(loader,{key:key,url:GetFastValue$p(config,"textureURL"),extension:GetFastValue$p(config,"textureExtension","png"),normalMap:GetFastValue$p(config,"normalMap"),xhrSettings:GetFastValue$p(config,"textureXhrSettings")}),data=new TextFile(loader,{key:key,url:GetFastValue$p(config,"atlasURL"),extension:GetFastValue$p(config,"atlasExtension","txt"),xhrSettings:GetFastValue$p(config,"atlasXhrSettings")})}else image=new ImageFile(loader,key,textureURL,textureXhrSettings),data=new TextFile(loader,key,atlasURL,atlasXhrSettings);image.linkFile?MultiFile.call(this,loader,"unityatlas",key,[image,data,image.linkFile]):MultiFile.call(this,loader,"unityatlas",key,[image,data])},addToCache:function(){if(this.isReadyToProcess()){var image=this.files[0],text=this.files[1],normalMap=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(image.key,image.data,text.data,normalMap),text.pendingDestroy(),this.complete=!0}}});
714/**
715	 * @author       Richard Davey <[email protected]>
716	 * @copyright    2020 Photon Storm Ltd.
717	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
718	 */FileTypesManager$2.register("unityAtlas",(function(key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings){var multifile;if(Array.isArray(key))for(var i=0;i<key.length;i++)multifile=new UnityAtlasFile(this,key[i]),this.addFile(multifile.files);else multifile=new UnityAtlasFile(this,key,textureURL,atlasURL,textureXhrSettings,atlasXhrSettings),this.addFile(multifile.files);return this}));var UnityAtlasFile_1=UnityAtlasFile,CONST$x=_const$3,File$1=File_1,FileTypesManager$1=FileTypesManager_1,GetURL=GetURL_1,GetFastValue$o=GetFastValue_1,IsPlainObject$2=IsPlainObject_1,VideoFile=new Class_1({Extends:File$1,initialize:function(loader,key,urlConfig,loadEvent,asBlob,noAudio,xhrSettings){void 0===loadEvent&&(loadEvent="loadeddata"),void 0===asBlob&&(asBlob=!1),void 0===noAudio&&(noAudio=!1),"loadeddata"!==loadEvent&&"canplay"!==loadEvent&&"canplaythrough"!==loadEvent&&(loadEvent="loadeddata");var fileConfig={type:"video",cache:loader.cacheManager.video,extension:urlConfig.type,responseType:"blob",key:key,url:urlConfig.url,xhrSettings:xhrSettings,config:{loadEvent:loadEvent,asBlob:asBlob,noAudio:noAudio}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),File$1.call(this,loader,fileConfig)},onProcess:function(){if(this.state=CONST$x.FILE_PROCESSING,this.config.asBlob){var video=this.createVideoElement();this.data=video;var _this=this;this.data.onloadeddata=function(){_this.onProcessComplete()},this.data.onerror=function(){File$1.revokeObjectURL(_this.data),_this.onProcessError()}
718,File$1.createObjectURL(video,this.xhrLoader.response,""),video.load()}else this.onProcessComplete()},createVideoElement:function(){var video=document.createElement("video");return video.controls=!1,video.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(video.muted=!0,video.defaultMuted=!0,video.setAttribute("autoplay","autoplay")),video.setAttribute("playsinline","playsinline"),video.setAttribute("preload","auto"),video},onVideoLoadHandler:function(event){var video=event.target;video.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),video.removeEventListener("error",this.onErrorCallback,!0),this.data=video,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(event){var video=event.target;video&&(video.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),video.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var loadEvent=this.config.loadEvent;if(this.config.asBlob)File$1.prototype.load.call(this);else{this.percentComplete=0;var video=this.createVideoElement();video.addEventListener(loadEvent,this.onLoadCallback,!0),video.addEventListener("error",this.onErrorCallback,!0),video.src=GetURL(this,this.loader.baseURL),video.load()}}});
719/**
720	 * @author       Richard Davey <[email protected]>
721	 * @copyright    2020 Photon Storm Ltd.
722	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
723	 */VideoFile.create=function(loader,key,urls,loadEvent,asBlob,noAudio,xhrSettings){var game=loader.systems.game;IsPlainObject$2(key)&&(urls=GetFastValue$o(key,"url",[]),loadEvent=GetFastValue$o(key,"loadEvent","loadeddata"),asBlob=GetFastValue$o(key,"asBlob",!1),noAudio=GetFastValue$o(key,"noAudio",!1),xhrSettings=GetFastValue$o(key,"xhrSettings"),key=GetFastValue$o(key,"key"));var urlConfig=VideoFile.getVideoURL(game,urls);if(urlConfig)return new VideoFile(loader,key,urlConfig,loadEvent,asBlob,noAudio,xhrSettings)},VideoFile.getVideoURL=function(game,urls){Array.isArray(urls)||(urls=[urls]);for(var i=0;i<urls.length;i++){var videoType,url=GetFastValue$o(urls[i],"url",urls[i]);if(0===url.indexOf("blob:"))return{url:url,type:""};if(videoType=0===url.indexOf("data:")?url.split(",")[0].match(/\/(.*?);/):url.match(/\.([a-zA-Z0-9]+)($|\?)/),videoType=GetFastValue$o(urls[i],"type",videoType?videoType[1]:"").toLowerCase(),game.device.video[videoType])return{url:url,type:videoType}}return null},FileTypesManager$1.register("video",(function(key,urls,loadEvent,asBlob,noAudio,xhrSettings){var videoFile;if(Array.isArray(key))for(var i=0;i<key.length;i++)(videoFile=VideoFile.create(this,key[i]))&&this.addFile(videoFile);else(videoFile=VideoFile.create(this,key,urls,loadEvent,asBlob,noAudio,xhrSettings))&&this.addFile(videoFile);return this}));var filetypes={AnimationJSONFile:AnimationJSONFile_1,AsepriteFile:AsepriteFile_1,AtlasJSONFile:AtlasJSONFile_1,AtlasXMLFile:AtlasXMLFile_1,AudioFile:AudioFile_1,AudioSpriteFile:{},BinaryFile:BinaryFile_1,BitmapFontFile:BitmapFontFile_1,CSSFile:CSSFile_1,GLSLFile:GLSLFile_1,HTML5AudioFile:HTML5AudioFile_1,HTMLFile:HTMLFile_1,HTMLTextureFile:HTMLTextureFile_1,ImageFile:ImageFile_1,JSONFile:JSONFile_1,MultiAtlasFile:MultiAtlasFile_1,MultiScriptFile:MultiScriptFile_1,OBJFile:OBJFile_1,PackFile:PackFile_1,PluginFile:PluginFile_1,SceneFile:SceneFile_1,ScenePluginFile:ScenePluginFile_1,ScriptFile:ScriptFile_1,SpriteSheetFile:SpriteSheetFile_1,SVGFile:SVGFile_1,TextFile:TextFile_1,TilemapCSVFile:TilemapCSVFile_1,TilemapImpactFile:TilemapImpactFile_1,TilemapJSONFile:TilemapJSONFile_1,UnityAtlasFile:UnityAtlasFile_1,VideoFile:VideoFile,XMLFile:XMLFile_1},CONST$w=_const$3,CustomSet=_Set,EventEmitter$5=eventemitter3.exports,Events$c=events$7,FileTypesManager=FileTypesManager_1,GetFastValue$n=GetFastValue_1,PluginCache$5=PluginCache_
7231,SceneEvents$5=events$g,XHRSettings=XHRSettings_1,LoaderPlugin=new Class_1({Extends:EventEmitter$5,initialize:function(scene){EventEmitter$5.call(this);var gameConfig=scene.sys.game.config,sceneConfig=scene.sys.settings.loader;this.scene=scene,this.systems=scene.sys,this.cacheManager=scene.sys.cache,this.textureManager=scene.sys.textures,this.sceneManager=scene.sys.game.scene,FileTypesManager.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(GetFastValue$n(sceneConfig,"baseURL",gameConfig.loaderBaseURL)),this.setPath(GetFastValue$n(sceneConfig,"path",gameConfig.loaderPath)),this.setPrefix(GetFastValue$n(sceneConfig,"prefix",gameConfig.loaderPrefix)),this.maxParallelDownloads=GetFastValue$n(sceneConfig,"maxParallelDownloads",gameConfig.loaderMaxParallelDownloads),this.xhr=XHRSettings(GetFastValue$n(sceneConfig,"responseType",gameConfig.loaderResponseType),GetFastValue$n(sceneConfig,"async",gameConfig.loaderAsync),GetFastValue$n(sceneConfig,"user",gameConfig.loaderUser),GetFastValue$n(sceneConfig,"password",gameConfig.loaderPassword),GetFastValue$n(sceneConfig,"timeout",gameConfig.loaderTimeout),GetFastValue$n(sceneConfig,"withCredentials",gameConfig.loaderWithCredentials)),this.crossOrigin=GetFastValue$n(sceneConfig,"crossOrigin",gameConfig.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new CustomSet,this.inflight=new CustomSet,this.queue=new CustomSet,this._deleteQueue=new CustomSet,this.totalFailed=0,this.totalComplete=0,this.state=CONST$w.LOADER_IDLE,this.multiKeyIndex=0,scene.sys.events.once(SceneEvents$5.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$5.START,this.pluginStart,this)},boot:function(){this.systems.events.once(SceneEvents$5.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(SceneEvents$5.SHUTDOWN,this.shutdown,this)},setBaseURL:function(url){return void 0===url&&(url=""),""!==url&&"/"!==url.substr(-1)&&(url=url.concat("/")),this.baseURL=url,this},setPath:function(path){return void 0===path&&(path=""),""!==path&&"/"!==path.substr(-1)&&(path=path.concat("/")),this.path=path,this},setPrefix:function(prefix){return void 0===prefix&&(prefix=""),this.prefix=prefix,this},setCORS:function(crossOrigin){return this.crossOrigin=crossOrigin,this},addFile:function(file){Array.isArray(file)||(file=[file]);for(var i=0;i<file.length;i++){var item=file[i];this.keyExists(item)||(this.list.set(item),this.emit(Events$c.ADD,item.key,item.type,this,item),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(file){var keyConflict=file.hasCacheConflict();return keyConflict||this.list.iterate((function(item){if(item.type===file.type&&item.key===file.key)return keyConflict=!0,!1})),!keyConflict&&this.isLoading()&&(this.inflight.iterate((function(item){if(item.type===file.type&&item.key===file.key)return keyConflict=!0,!1})),this.queue.iterate((function(item){if(item.type===file.type&&item.key===file.key)return keyConflict=!0,!1}))),keyConflict},addPack:function(pack,packKey){packKey&&pack.hasOwnProperty(packKey)&&(pack={packKey:pack[packKey]});var total=0,currentBaseURL=this.baseURL,currentPath=this.path,currentPrefix=this.prefix;for(var key in pack)if(Object.prototype.hasOwnProperty.call(pack,key)){var config=pack[key],baseURL=GetFastValue$n(config,"baseURL",currentBaseURL),path=GetFastValue$n(config,"path",currentPath),prefix=GetFastValue$n(config,"prefix",currentPrefix),files=GetFastValue$n(config,"files",null),defaultType=GetFastValue$n(config,"defaultType","void");if(Array.isArray(files)){this.setBaseURL(baseURL),this.setPath(path),this.setPrefix(prefix);for(var i=0;i<files.length;i++){var file=files[i],type=file.hasOwnProperty("type")?file.type:defaultType;this[type]&&(this[type](file),total++)}}}return this.setBaseURL(currentBaseURL),this.setPath(currentPath),this.setPrefix(currentPrefix),total>0},isLoading:function(){return this.state===CONST$w.LOADER_LOADING||this.state===CONST$w.LOADER_PROCESSING},isReady:function(){return this.state===CONST$w.LOADER_IDLE||this.state===CONST$w.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit
723(Events$c.START,this),0===this.list.size?this.loadComplete():(this.state=CONST$w.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(SceneEvents$5.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(Events$c.PROGRESS,this.progress)},update:function(){this.state===CONST$w.LOADER_LOADING&&this.list.size>0&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each((function(file){if((file.state===CONST$w.FILE_POPULATED||file.state===CONST$w.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(file),this.list.delete(file),file.crossOrigin||(file.crossOrigin=this.crossOrigin),file.load()),this.inflight.size===this.maxParallelDownloads)return!1}),this)},nextFile:function(file,success){this.inflight&&(this.inflight.delete(file),this.updateProgress(),success?(this.totalComplete++,this.queue.set(file),this.emit(Events$c.FILE_LOAD,file),file.onProcess()):(this.totalFailed++,this._deleteQueue.set(file),this.emit(Events$c.FILE_LOAD_ERROR,file),this.fileProcessComplete(file)))},fileProcessComplete:function(file){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(file.state===CONST$w.FILE_ERRORED?file.multiFile&&file.multiFile.onFileFailed(file):file.state===CONST$w.FILE_COMPLETE&&(file.multiFile?file.multiFile.isReadyToProcess()&&file.multiFile.addToCache():file.addToCache()),this.queue.delete(file),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(Events$c.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=CONST$w.LOADER_COMPLETE,this.systems.events.off(SceneEvents$5.UPDATE,this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit(Events$c.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(file){this._deleteQueue.set(file)},saveJSON:function(data,filename){return this.save(JSON.stringify(data),filename)},save:function(data,filename,filetype){void 0===filename&&(filename="file.json"),void 0===filetype&&(filetype="application/json");var blob=new Blob([data],{type:filetype}),url=URL.createObjectURL(blob),a=document.createElement("a");return a.download=filename,a.textContent="Download "+filename,a.href=url,a.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var gameConfig=this.systems.game.config,sceneConfig=this.systems.settings.loader;this.setBaseURL(GetFastValue$n(sceneConfig,"baseURL",gameConfig.loaderBaseURL)),this.setPath(GetFastValue$n(sceneConfig,"path",gameConfig.loaderPath)),this.setPrefix(GetFastValue$n(sceneConfig,"prefix",gameConfig.loaderPrefix)),this.state=CONST$w.LOADER_IDLE},shutdown:function(){this.reset(),this.state=CONST$w.LOADER_SHUTDOWN,this.systems.events.off(SceneEvents$5.UPDATE,this.update,this),this.systems.events.off(SceneEvents$5.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=CONST$w.LOADER_DESTROYED,this.systems.events.off(SceneEvents$5.UPDATE,this.update,this),this.systems.events.off(SceneEvents$5.START,this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null,this.sceneManager=null}});
724/**
725	 * @author       Richard Davey <[email protected]>
726	 * @copyright    2020 Photon Storm Ltd.
727	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
728	 */PluginCache$5.register("Loader",LoaderPlugin,"load");var Loader={Events:events$7,FileTypes:filetypes,File:File_1,FileTypesManager:FileTypesManager_1,GetURL:GetURL_1,LoaderPlugin:LoaderPlugin,MergeXHRSettings:MergeXHRSettings_1,MultiFile:MultiFile_1,XHRLoader:XHRLoader_1,XHRSettings:XHRSettings_1},loader=Loader=Extend_1$1(!1,Loader,_const$3),_const$2={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14},OverlapRect_1=function(world,x,y,width,height,includeDynamic,includeStatic){void 0===includeDynamic&&(includeDynamic=!0),void 0===includeStatic&&(includeStatic=!1);var dynamicBodies=[],staticBodies=[],minMax=world.treeMinMax;if(minMax.minX=x,minMax.minY=y,minMax.maxX=x+width,minMax.maxY=y+height,includeStatic&&(staticBodies=world.staticTree.search(minMax)),includeDynamic&&world.useTree)dynamicBodies=world.tree.search(minMax);else if(includeDynamic){var bodies=world.bodies,fakeBody={position:{x:x,y:y},left:x,top:y,right:x+width,bottom:y+height,isCircle:!1},intersects=world.intersects;bodies.iterate((function(target){intersects(target,fakeBody)&&dynamicBodies.push(target)}))}return staticBodies.concat(dynamicBodies)},OverlapRect$1=OverlapRect_1,Circle=Circle_1,CircleToCircle=CircleToCircle_1,CircleToRectangle=CircleToRectangle_1,OverlapCirc_1=function(world,x,y,radius,includeDynamic,includeStatic){var bodiesInRect=OverlapRect$1(world,x-radius,y-radius,2*radius,2*radius,includeDynamic,includeStatic);if(0===bodiesInRect.length)return bodiesInRect;for(var area=new Circle(x,y,radius),circFromBody=new Circle,bodiesInArea=[],i=0;i<bodiesInRect.length;i++){var body=bodiesInRect[i];body.isCircle?(circFromBody.setTo(body.center.x,body.center.y,body.halfWidth),CircleToCircle(area,circFromBody)&&bodiesInArea.push(body)):CircleToRectangle(area,body)&&bodiesInArea.push(body)}return bodiesInArea},components$2={Acceleration:{setAcceleration:function(x,y){return this.body.acceleration.set(x,y),this},setAccelerationX:function(value){return this.body.acceleration.x=value,this},setAccelerationY:function(value){return this.body.acceleration.y=value,this}},Angular:{setAngularVelocity:function(value){return this.body.angularVelocity=value,this},setAngularAcceleration:function(value){return this.body.angularAcceleration=value,this},setAngularDrag:function(value){return this.body.angularDrag=value,this}},Bounce:{setBounce:function(x,y){return this.body.bounce.set(x,y),this},setBounceX:function(value){return this.body.bounce.x=value,this},setBounceY:function(value){return this.body.bounce.y=value,this},setCollideWorldBounds:function(value,bounceX,bounceY){return this.body.setCollideWorldBounds(value,bounceX,bounceY),this}},Debug:{setDebug:function(showBody,showVelocity,bodyColor){return this.debugShowBody=showBody,this.debugShowVelocity=showVelocity,this.debugBodyColor=bodyColor,this},setDebugBodyColor:function(value){return this.body.debugBodyColor=value,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(value){this.body.debugShowBody=value}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(value){this.body.debugShowVelocity=value}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(value){this.body.debugBodyColor=value}}},Drag:{setDrag:function(x,y){return this.body.drag.set(x,y),this},setDragX:function(value){return this.body.drag.x=value,this},setDragY:function(value){return this.body.drag.y=value,this},setDamping:function(value){return this.body.useDamping=value,this}},Enable:{enableBody:function(reset,x,y,enableGameObject,showGameObject){return reset&&this.body.reset(x,y),enableGameObject&&(this.body.gameObject.active=!0),showGameObject&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(disableGameObject,hideGameObject){return void 0===disableGameObject&&(disableGameObject=!1),void 0===hideGameObject&&(hideGameObject=!1),this.body.stop(),this.body.enable=!1,disableGameObject&&(this.body.gameObject.active=!1),hideGameObject&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}},Friction:{setFriction:function(x,y){return this.body.friction.set(x,y),this},setFrictionX:function(x){return this.body.friction.x=x,this},setFrictionY:function(y){return this.body.friction.y=y,this}},Gravity:{setGravity:function(x,y){return this.body.gravity.set(x,y),this},setGravityX:function(x){return this.body.gravity.x=x,this},setGravityY:function(y){return this.body.gravity.y=y,this}},Immovable:{setImmovable:function(value){return void 0===value&&(value=!0),this.body.immovable=value,this}},Mass:{setMass:function(value){return this.body.mass=value,this}},OverlapCirc:OverlapCirc_1,OverlapRect:OverlapRect_1,Pushable:{setPushable:function(value){return void 0===value&&(value=!0),this.body.pushable=value,this}},Size:{setOffset:function(x,y){return this.body.setOffset(x,y),this},setSize:function(width,height,center){return this.body.setSize(width,height,center),this},setBodySize:function(width,height,center){return this.body.setSize(width,height,center),this},setCircle:function(radius,offsetX,offsetY){return this.body.setCircle(radius,offsetX,offsetY),this}},Velocity:{setVelocity:function(x,y){return this.body.setVelocity(x,y),this},setVelocityX:function(x){return this.body.setVelocityX(x),this},setVelocityY:function(y){return this.body.setVelocityY(y),this},setMaxVelocity:function(x,y){return this.body.maxVelocity.set(x,y),this}}},Image$2=Image_1,ArcadeImage$1=new Class_1({Extends:Image$2,Mixins:[components$2.Acceleration,components$2.Angular,components$2.Bounce,components$2.Debug,components$2.Drag,components$2.Enable,components$2.Friction,components$2.Gravity,components$2.Immovable,components$2.Mass,components$2.Pushable,components$2.Size,components$2.Velocity],initialize:function(scene,x,y,texture,frame){Image$2.call(this,scene,x,y,texture,frame),this.body=null}}
728),ArcadeImage_1=ArcadeImage$1,Sprite$2=Sprite_1,ArcadeSprite$3=new Class_1({Extends:Sprite$2,Mixins:[components$2.Acceleration,components$2.Angular,components$2.Bounce,components$2.Debug,components$2.Drag,components$2.Enable,components$2.Friction,components$2.Gravity,components$2.Immovable,components$2.Mass,components$2.Pushable,components$2.Size,components$2.Velocity],initialize:function(scene,x,y,texture,frame){Sprite$2.call(this,scene,x,y,texture,frame),this.body=null}}),ArcadeSprite_1=ArcadeSprite$3,ArcadeSprite$2=ArcadeSprite_1,CONST$t=_const$2,GetFastValue$m=GetFastValue_1,Group$1=Group_1,IsPlainObject$1=IsPlainObject_1,PhysicsGroup$1=new Class_1({Extends:Group$1,initialize:function(world,scene,children,config){if(children||config)if(IsPlainObject$1(children))config=children,children=null,config.internalCreateCallback=this.createCallbackHandler,config.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(children)&&IsPlainObject$1(children[0])){config=children[0];var _this=this;children.forEach((function(singleConfig){singleConfig.internalCreateCallback=_this.createCallbackHandler,singleConfig.internalRemoveCallback=_this.removeCallbackHandler})),children=null}else config={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else config={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=world,config.classType=GetFastValue$m(config,"classType",ArcadeSprite$2),this.physicsType=CONST$t.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:GetFastValue$m(config,"collideWorldBounds",!1),setBoundsRectangle:GetFastValue$m(config,"customBoundsRectangle",null),setAccelerationX:GetFastValue$m(config,"accelerationX",0),setAccelerationY:GetFastValue$m(config,"accelerationY",0),setAllowDrag:GetFastValue$m(config,"allowDrag",!0),setAllowGravity:GetFastValue$m(config,"allowGravity",!0),setAllowRotation:GetFastValue$m(config,"allowRotation",!0),setBounceX:GetFastValue$m(config,"bounceX",0),setBounceY:GetFastValue$m(config,"bounceY",0),setDragX:GetFastValue$m(config,"dragX",0),setDragY:GetFastValue$m(config,"dragY",0),setEnable:GetFastValue$m(config,"enable",!0),setGravityX:GetFastValue$m(config,"gravityX",0),setGravityY:GetFastValue$m(config,"gravityY",0),setFrictionX:GetFastValue$m(config,"frictionX",0),setFrictionY:GetFastValue$m(config,"frictionY",0),setMaxVelocityX:GetFastValue$m(config,"maxVelocityX",1e4),setMaxVelocityY:GetFastValue$m(config,"maxVelocityY",1e4),setVelocityX:GetFastValue$m(config,"velocityX",0),setVelocityY:GetFastValue$m(config,"velocityY",0),setAngularVelocity:GetFastValue$m(config,"angularVelocity",0),setAngularAcceleration:GetFastValue$m(config,"angularAcceleration",0),setAngularDrag:GetFastValue$m(config,"angularDrag",0),setMass:GetFastValue$m(config,"mass",1),setImmovable:GetFastValue$m(config,"immovable",!1)},Group$1.call(this,scene,children,config),this.type="PhysicsGroup"},createCallbackHandler:function(child){child.body||this.world.enableBody(child,CONST$t.DYNAMIC_BODY);var body=child.body;for(var key in this.defaults)body[key](this.defaults[key])},removeCallbackHandler:function(child){child.body&&this.world.disableBody(child)},setVelocity:function(x,y,step){void 0===step&&(step=0);for(var items=this.getChildren(),i=0;i<items.length;i++)items[i].body.velocity.set(x+i*step,y+i*step);return this},setVelocityX:function(value,step){void 0===step&&(step=0);for(var items=this.getChildren(),i=0;i<items.length;i++)items[i].body.velocity.x=value+i*step;return this},setVelocityY:function(value,step){void 0===step&&(step=0);for(var items=this.getChildren(),i=0;i<items.length;i++)items[i].body.velocity.y=value+i*step;return this}}),PhysicsGroup_1=PhysicsGroup$1,ArcadeSprite$1=ArcadeSprite_1,CONST$s=_const$2,GetFastValue$l=GetFastValue_1,Group=Group_1,IsPlainObject=IsPlainObject_1,StaticPhysicsGroup$1=new Class_1({Extends:Group,initialize:function(world,scene,children,config){children||config?IsPlainObject(children)?(config=children,children=null,config.internalCreateCallback=this.createCallbackHandler,config.internalRemoveCallback=this.removeCallbackHandler,config.createMultipleCallback=this.createMultipleCallbackHandler,config.classType=GetFastValue$l(config,"classType",ArcadeSprite$1)):Array.isArray(children)&&IsPlainObject(children[0])?(config=children,children=null,config.forEach((function(singleConfig){singleConfig.internalCreateCallback=this.createCallbackHandler,singleConfig.internalRemoveCallback=this.removeCallbackHandler,singleConfig.createMultipleCallback=this.createMultipleCallbackHandler,singleConfig.classType=GetFastValue$l(singleConfig,"classType",ArcadeSprite$1)}))):config={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:config={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:ArcadeSprite$1},this.world=world,this.physicsType=CONST$s.STATIC_BODY,Group.call(this,scene,children,config),this.type="StaticPhysicsGroup"},createCallbackHandler:function(child){child.body||this.world.enableBody(child,CONST$s.STATIC_BODY)},removeCallbackHandler:function(child){child.body&&this.world.disableBody(child)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var children=this.children.entries,i=0;i<children.length;i++)children[i].body.reset();return this}}),StaticPhysicsGroup_1=StaticPhysicsGroup$1,ArcadeImage=ArcadeImage_1,ArcadeSprite=ArcadeSprite_1,CONST$r=_const$2,PhysicsGroup=PhysicsGroup_1,StaticPhysicsGroup=StaticPhysicsGroup_1,Factory$3=new Class_1({initialize:function(world){this.world=world,this.scene=world.scene,this.sys=world.scene.sys},collider:function(object1,object2,collideCallback,processCallback,callbackContext){return this.world.addCollider(object1,object2,collideCallback,processCallback,callbackContext)},overlap:function(object1,object2,collideCallback,processCallback,callbackContext){return this.world.addOverlap(object1,object2,collideCallback,processCallback,callbackContext)},existing:function(gameObject,isStatic){var type=isStatic?CONST$r.STATIC_BODY:CONST$r.DYNAMIC_BODY;return this.world.enableBody(gameObject,type),gameObject},staticImage:function(x,y,key,frame){var image=new ArcadeImage(this.scene,x,y,key,frame);return this.sys.displayList.add(image),this.world.enableBody(image,CONST$r.STATIC_BODY),image},image:function(x,y,key,frame){var image=new ArcadeImage(this.scene,x,y,key,frame);return this.sys.displayList.add(image),this.world.enableBody(image,CONST$r.DYNAMIC_BODY),image},staticSprite:function(x,y,key,frame){var sprite=new ArcadeSprite(this.scene,x,y,key,frame);return this.sys.displayList.add(sprite),this.sys.updateList.add(sprite),this.world.enableBody(sprite,CONST$r.STATIC_BODY),sprite},sprite:function(x,y,key,frame){var sprite=new ArcadeSprite(this.scene,x,y,key,frame);return this.sys.displayList.add(sprite),this.sys.updateList.add(sprite),this.world.enableBody(sprite,CONST$r.DYNAMIC_BODY),sprite},staticGroup:function(children,config){return this.sys.updateList.add(new StaticPhysicsGroup(this.world,this.world.scene,children,config))},group:function(children,config){return this.sys.updateList.add(new PhysicsGroup(this.world,this.world.scene,children,config))},destroy:function(){this.world=null,this.scene=null,this.sys=null}}),Factory_1$1=Factory$3,events$2={COLLIDE:"collide",OVERLAP:"overlap",PAUSE:"pause",RESUME:"resume",TILE_COLLIDE:"tilecollide",TILE_OVERLAP:"tileoverlap",WORLD_BOUNDS:"worldbounds",WORLD_STEP:"worldstep"},CONST$q=_const$2,Events$b=events$2,RadToDeg=RadToDeg_1,Rectangle$3=Rectangle_1$1,RectangleContains$1=Contains_1$3,Vector2$o=Vector2_1,Body$h=new Class_1({initialize:function(world,gameObject){var width=gameObject.displayWidth?gameObject.displayWidth:64,height=gameObject.displayHeight?gameObject.displayHeight:64;this.world=world,this.gameObject=gameObject,this.transform={x:gameObject.x,y:gameObject.y,rotation:gameObject.angle,scaleX:gameObject.scaleX,scaleY:gameObject.scaleY,displayOriginX:gameObject.displayOriginX,displayOriginY:gameObject.displayOriginY},this.debugShowBody=world.defaults.debugShowBody,this.debugShowVelocity=world.defaults.debugShowVelocity,this.debugBodyColor=world.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new Vector2$o,this.position=new Vector2$o(gameObject.x-gameObject.scaleX*gameObject.displayOriginX,gameObject.y-gameObject.scaleY*gameObject.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=gameObject.angle,this.preRotation=gameObject.angle,this.width=width,this.height=height,this.sourceWidth=width,this.sourceHeight=height,gameObject.frame&&(this.sourceWidth=gameObject.frame.realWidth,this.sourceHeight=gameObject.frame.realHeight),this.halfWidth=Math.abs(width/2),this.halfHeight=Math.abs(height/2),this.center=new Vector2$o(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new Vector2$o,this.newVelocity=new Vector2$o,this.deltaMax=new Vector2$o,this.acceleration=new Vector2$o,this.allowDrag=!0,this.drag=new Vector2$o,this.allowGravity=!0,this.gravity=new Vector2$o,this.bounce=new Vector2$o,this.worldBounce=null,this.customBoundsRectangle=world.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new Vector2$o(1e4,1e4),this.maxSpeed=-1,this.friction=new Vector2$o(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=CONST$q.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=CONST$q.DYNAMIC_BODY,this._sx=gameObject.scaleX,this._sy=gameObject.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new Rectangle$3},updateBounds:function(){var sprite=this.gameObject,transform=this.transform;if(sprite.parentContainer){var matrix=sprite.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);transform.x=matrix.tx,transform.y=matrix.ty,transform.rotation=RadToDeg(matrix.rotation),transform.scaleX=matrix.scaleX,transform.scaleY=matrix.scaleY,transform.displayOriginX=sprite.displayOriginX,transform.displayOriginY=sprite.displayOriginY}else transform.x=sprite.x,transform.y=sprite.y,transform.rotation=sprite.angle,transform.scaleX=sprite.scaleX,transform.scaleY=sprite.scaleY,transform.displayOriginX=sprite.displayOriginX,transform.displayOriginY=sprite.displayOriginY;var recalc=!1;if(this.syncBounds){var b=sprite.getBounds(this._bounds);
728this.width=b.width,this.height=b.height,recalc=!0}else{var asx=Math.abs(transform.scaleX),asy=Math.abs(transform.scaleY);this._sx===asx&&this._sy===asy||(this.width=this.sourceWidth*asx,this.height=this.sourceHeight*asy,this._sx=asx,this._sy=asy,recalc=!0)}recalc&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var transform=this.transform;this.position.x=transform.x+transform.scaleX*(this.offset.x-transform.displayOriginX),this.position.y=transform.y+transform.scaleY*(this.offset.y-transform.displayOriginY),this.updateCenter()},resetFlags:function(clear){void 0===clear&&(clear=!1);var wasTouching=this.wasTouching,touching=this.touching,blocked=this.blocked;clear?(wasTouching.none=!0,wasTouching.up=!1,wasTouching.down=!1,wasTouching.left=!1,wasTouching.right=!1):(wasTouching.none=touching.none,wasTouching.up=touching.up,wasTouching.down=touching.down,wasTouching.left=touching.left,wasTouching.right=touching.right),touching.none=!0,touching.up=!1,touching.down=!1,touching.left=!1,touching.right=!1,blocked.none=!0,blocked.up=!1,blocked.down=!1,blocked.left=!1,blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(willStep,delta){willStep&&this.resetFlags(),this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),willStep&&this.update(delta)},update:function(delta){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,delta);var vx=this.velocity.x,vy=this.velocity.y;this.newVelocity.set(vx*delta,vy*delta),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(vy,vx),this.speed=Math.sqrt(vx*vx+vy*vy),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(Events$b.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var dx=this.position.x-this.prevFrame.x,dy=this.position.y-this.prevFrame.y;if(this.moves){var mx=this.deltaMax.x,my=this.deltaMax.y;0!==mx&&0!==dx&&(dx<0&&dx<-mx?dx=-mx:dx>0&&dx>mx&&(dx=mx)),0!==my&&0!==dy&&(dy<0&&dy<-my?dy=-my:dy>0&&dy>my&&(dy=my)),this.gameObject.x+=dx,this.gameObject.y+=dy}dx<0?this.facing=CONST$q.FACING_LEFT:dx>0&&(this.facing=CONST$q.FACING_RIGHT),dy<0?this.facing=CONST$q.FACING_UP:dy>0&&(this.facing=CONST$q.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this._tx=dx,this._ty=dy},setBoundsRectangle:function(bounds){return this.customBoundsRectangle=bounds||this.world.bounds,this},checkWorldBounds:function(){var pos=this.position,bounds=this.customBoundsRectangle,check=this.world.checkCollision,bx=this.worldBounce?-this.worldBounce.x:-this.bounce.x,by=this.worldBounce?-this.worldBounce.y:-this.bounce.y,wasSet=!1;return pos.x<bounds.x&&check.left?(pos.x=bounds.x,this.velocity.x*=bx,this.blocked.left=!0,wasSet=!0):this.right>bounds.right&&check.right&&(pos.x=bounds.right-this.width,this.velocity.x*=bx,this.blocked.right=!0,wasSet=!0),pos.y<bounds.y&&check.up?(pos.y=bounds.y,this.velocity.y*=by,this.blocked.up=!0,wasSet=!0):this.bottom>bounds.bottom&&check.down&&(pos.y=bounds.bottom-this.height,this.velocity.y*=by,this.blocked.down=!0,wasSet=!0),wasSet&&(this.blocked.none=!1,this.updateCenter()),wasSet},setOffset:function(x,y){return void 0===y&&(y=x),this.offset.set(x,y),this},setSize:function(width,height,center){void 0===center&&(center=!0);var gameObject=this.gameObject;if(!width&&gameObject.frame&&(width=gameObject.frame.realWidth),!height&&gameObject.frame&&(height=gameObject.frame.realHeight),this.sourceWidth=width,this.sourceHeight=height,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),center&&gameObject.getCenter){var ox=(gameObject.width-width)/2,oy=(gameObject.height-height)/2;this.offset.set(ox,oy)}return this.isCircle=!1,this.radius=0,this},setCircle:function(radius,offsetX,offsetY){return void 0===offsetX&&(offsetX=this.offset.x),void 0===offsetY&&(offsetY=this.offset.y),radius>0?(this.isCircle=!0,this.radius=radius,this.sourceWidth=2*radius,this.sourceHeight=2*radius,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(offsetX,offsetY),this.updateCenter()):this.isCircle=!1,this},reset:function(x,y){this.stop();var gameObject=this.gameObject;gameObject.setPosition(x,y),gameObject.getTopLeft?gameObject.getTopLeft(this.position):this.position.set(x,y),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=gameObject.angle,this.preRotation=gameObject.angle,this.updateBounds(),this.updateCenter(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(obj){return obj.x=this.x,obj.y=this.y,obj.right=this.right,obj.bottom=this.bottom,obj},hitTest:function(x,y){return this.isCircle?this.radius>0&&x>=this.left&&x<=this.right&&y>=this.top&&y<=this.bottom&&(this.center.x-x)*(this.center.x-x)+(this.center.y-y)*(this.center.y-y)<=this.radius*this.radius:RectangleContains$1(this,x,y)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>
vendor: 13,182 bytes, lines 728-733
7280?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(graphic){var pos=this.position,x=pos.x+this.halfWidth,y=pos.y+this.halfHeight;this.debugShowBody&&(graphic.lineStyle(graphic.defaultStrokeWidth,this.debugBodyColor),this.isCircle?graphic.strokeCircle(x,y,this.width/2):(this.checkCollision.up&&graphic.lineBetween(pos.x,pos.y,pos.x+this.width,pos.y),this.checkCollision.right&&graphic.lineBetween(pos.x+this.width,pos.y,pos.x+this.width,pos.y+this.height),this.checkCollision.down&&graphic.lineBetween(pos.x,pos.y+this.height,pos.x+this.width,pos.y+this.height),this.checkCollision.left&&graphic.lineBetween(pos.x,pos.y,pos.x,pos.y+this.height))),this.debugShowVelocity&&(graphic.lineStyle(graphic.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),graphic.lineBetween(x,y,x+this.velocity.x/2,y+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(value,bounceX,bounceY,onWorldBounds){void 0===value&&(value=!0),this.collideWorldBounds=value;var setBounceX=void 0!==bounceX,setBounceY=void 0!==bounceY;return(setBounceX||setBounceY)&&(this.worldBounce||(this.worldBounce=new Vector2$o),setBounceX&&(this.worldBounce.x=bounceX),setBounceY&&(this.worldBounce.y=bounceY)),void 0!==onWorldBounds&&(this.onWorldBounds=onWorldBounds),this},setVelocity:function(x,y){return this.velocity.set(x,y),x=this.velocity.x,y=this.velocity.y,this.speed=Math.sqrt(x*x+y*y),this},setVelocityX:function(value){this.velocity.x=value;var x=value,y=this.velocity.y;return this.speed=Math.sqrt(x*x+y*y),this},setVelocityY:function(value){this.velocity.y=value;var x=this.velocity.x,y=value;return this.speed=Math.sqrt(x*x+y*y),this},setMaxVelocity:function(x,y){return this.maxVelocity.set(x,y),this},setMaxVelocityX:function(value){return this.maxVelocity.x=value,this},setMaxVelocityY:function(value){return this.maxVelocity.y=value,this},setMaxSpeed:function(value){return this.maxSpeed=value,this},setBounce:function(x,y){return this.bounce.set(x,y),this},setBounceX:function(value){return this.bounce.x=value,this},setBounceY:function(value){return this.bounce.y=value,this},setAcceleration:function(x,y){return this.acceleration.set(x,y),this},setAccelerationX:function(value){return this.acceleration.x=value,this},setAccelerationY:function(value){return this.acceleration.y=value,this},setAllowDrag:function(value){return void 0===value&&(value=!0),this.allowDrag=value,this},setAllowGravity:function(value){return void 0===value&&(value=!0),this.allowGravity=value,this},setAllowRotation:function(value){return void 0===value&&(value=!0),this.allowRotation=value,this},setDrag:function(x,y){return this.drag.set(x,y),this},setDamping:function(value){return this.useDamping=value,this},setDragX:function(value){return this.drag.x=value,this},setDragY:function(value){return this.drag.y=value,this},setGravity:function(x,y){return this.gravity.set(x,y),this},setGravityX:function(value){return this.gravity.x=value,this},setGravityY:function(value){return this.gravity.y=value,this},setFriction:function(x,y){return this.friction.set(x,y),this},setFrictionX:function(value){return this.friction.x=value,this},setFrictionY:function(value){return this.friction.y=value,this},setAngularVelocity:function(value){return this.angularVelocity=value,this},setAngularAcceleration:function(value){return this.angularAcceleration=value,this},setAngularDrag:function(value){return this.angularDrag=value,this},setMass:function(value){return this.mass=value,this},setImmovable:function(value){return void 0===value&&(value=!0),this.immovable=value,this},setEnable:function(value){return void 0===value&&(value=!0),this.enable=value,this},processX:function(x,vx,left,right){this.x+=x,this.updateCenter(),null!==vx&&(this.velocity.x=vx);var blocked=this.blocked;left&&(blocked.left=!0),right&&(blocked.right=!0)},processY:function(y,vy,up,down){this.y+=y,this.updateCenter(),null!==vy&&(this.velocity.y=vy);var blocked=this.blocked;up&&(blocked.up=!0),down&&(blocked.down=!0)},x:{get:function(){return this.position.x},set:function(value){this.position.x=value}},y:{get:function(){return this.position.y},set:function(value){this.position.y=value}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}}),Body_1$1=Body$h,Collider$1=new Class_1({initialize:function(world,overlapOnly,object1,object2,collideCallback,processCallback,callbackContext){this.world=world,this.name="",this.active=!0,this.overlapOnly=overlapOnly,this.object1=object1,this.object2=object2,this.collideCallback=collideCallback,this.processCallback=processCallback,this.callbackContext=callbackContext},setName:function(name){return this.name=name,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}}),Collider_1=Collider$1,CONST$p=_const$2,GetOverlapX_1=function(body1,body2,overlapOnly,bias){var overlap=0,maxOverlap=body1.deltaAbsX()+body2.deltaAbsX()+bias;return 0===body1._dx&&0===body2._dx?(body1.embedded=!0,body2.embedded=!0):body1._dx>body2._dx?(overlap=body1.right-body2.x)>maxOverlap&&!overlapOnly||!1===body1.checkCollision.right||!1===body2.checkCollision.left?overlap=0:(body1.touching.none=!1,body1.touching.right=!0,body2.touching.none=!1,body2.touching.left=!0,body2.physicsType!==CONST$p.STATIC_BODY||overlapOnly||(body1.blocked.none=!1,body1.blocked.right=!0),body1.physicsType!==CONST$p.STATIC_BODY||overlapOnly||(body2.blocked.none=!1,body2.blocked.left=!0)):body1._dx<body2._dx&&(-(overlap=body1.x-body2.width-body2.x)>maxOverlap&&!overlapOnly||!1===body1.checkCollision.left||!1===body2.checkCollision.right?overlap=0:(body1.touching.none=!1,body1.touching.left=!0,body2.touching.none=!1,body2.touching.right=!0,body2.physicsType!==CONST$p.STATIC_BODY||overlapOnly||(body1.blocked.none=!1,body1.blocked.left=!0),body1.physicsType!==CONST$p.STATIC_BODY||overlapOnly||(body2.blocked.none=!1,body2.blocked.right=!0))),body1.overlapX=overlap,body2.overlapX=overlap,overlap},CONST$o=_const$2,GetOverlapY_1=function(body1,body2,overlapOnly,bias){var overlap=0,maxOverlap=body1.deltaAbsY()+body2.deltaAbsY()+bias;return 0===body1._dy&&0===body2._dy?(body1.embedded=!0,body2.embedded=!0):body1._dy>body2._dy?(overlap=body1.bottom-body2.y)>maxOverlap&&!overlapOnly||!1===body1.checkCollision.down||!1===body2.checkCollision.up?overlap=0:(body1.touching.none=!1,body1.touching.down=!0,body2.touching.none=!1,body2.touching.up=!0,body2.physicsType!==CONST$o.STATIC_BODY||overlapOnly||(body1.blocked.none=!1,body1.blocked.down=!0),body1.physicsType!==CONST$o.STATIC_BODY||overlapOnly||(body2.blocked.none=!1,body2.blocked.up=!0)):body1._dy<body2._dy&&(-(overlap=body1.y-body2.bottom)>maxOverlap&&!overlapOnly||!1===body1.checkCollision.up||!1===body2.checkCollision.down?overlap=0:(body1.touching.none=!1,body1.touching.up=!0,body2.touching.none=!1,body2.touching.down=!0,body2.physicsType!==CONST$o.STATIC_BODY||overlapOnly||(body1.blocked.none=!1,body1.blocked.up=!0),body1.physicsType!==CONST$o.STATIC_BODY||overlapOnly||(body2.blocked.none=!1,body2.blocked.down=!0))),body1.overlapY=overlap,body2.overlapY=overlap,overlap},GetFastValue$k=GetFastValue_1,GetTilesWithin_1=function(tileX,tileY,width,height,filteringOptions,layer){void 0===tileX&&(tileX=0),void 0===tileY&&(tileY=0),void 0===width&&(width=layer.width),void 0===height&&(height=layer.height),filteringOptions||(filteringOptions={});var isNotEmpty=GetFastValue$k(filteringOptions,"isNotEmpty",!1),isColliding=GetFastValue$k(filteringOptions,"isColliding",!1),hasInterestingFace=GetFastValue$k(filteringOptions,"hasInterestingFace",!1);tileX<0&&(width+=tileX,tileX=0),tileY<0&&(height+=tileY,tileY=0),tileX+width>layer.width&&(width=Math.max(layer.width-tileX,0)),tileY+height>layer.height&&(height=Math.max(layer.height-tileY,0));for(var results=[],ty=tileY;ty<tileY+height;ty++)for(var tx=tileX;tx<tileX+width;tx++){var tile=layer.data[ty][tx];if(null!==tile){if(isNotEmpty&&-1===tile.index)continue;if(isColliding&&!tile.collides)continue;if(hasInterestingFace&&!tile.hasInterestingFace)continue;results.push(tile)}}return results},GetTilesWithin$f=GetTilesWithin_1,Vector2$n=Vector2_1,pointStart$1=new Vector2$n,pointEnd$1=new Vector2$n,GetTilesWithinWorldXY_1=function(worldX,worldY,width,height,filteringOptions,camera,layer){var worldToTileXY=layer.tilemapLayer.tilemap._convert.WorldToTileXY;worldToTileXY(worldX,worldY,!0,pointStart$1,camera,layer);var xStart=pointStart$1.x,yStart=pointStart$1.y;worldToTileXY(worldX+width,worldY+height,!1,pointEnd$1,camera,layer);var xEnd=Math.ceil(pointEnd$1.x),yEnd=Math.ceil(pointEnd$1.y);return GetTilesWithin$f(xStart,yStart,xEnd-xStart,yEnd-yStart,filteringOptions,layer)},ProcessTileCallbacks_1=function(tile,sprite){return tile.collisionCallback?!tile.collisionCallback.call(tile.collisionCallbackContext,sprite,tile):!tile.layer.callbacks[tile.index]||!tile.layer.callbacks[tile.index].callback.call(tile.layer.callbacks[tile.index].callbackContext,sprite,tile)},quickselect=QuickSelect_1;
729/**
730	 * @author       Richard Davey <[email protected]>
731	 * @copyright    2020 Photon Storm Ltd.
732	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
733	 */function rbush(maxEntries){if(!(this instanceof rbush))return new rbush(maxEntries,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,maxEntries||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function findItem(item,items,equalsFn){if(!equalsFn)return items.indexOf(item);for(var i=0;i<items.length;i++)if(equalsFn(item,items[i]))return i;return-1}function calcBBox(node,toBBox){distBBox(node,0,node.children.length,toBBox,node)}function distBBox(node,k,p,toBBox,destNode){destNode||(destNode=createNode(null)),destNode.minX=1/0,destNode.minY=1/0,destNode.maxX=-1/0,destNode.maxY=-1/0;for(var child,i=k;i<p;i++)child=node.children[i],extend(destNode,node.leaf?toBBox(child):child);return destNode}function extend(a,b){return a.minX=Math.min(a.minX,b.minX),a.minY=Math.min(a.minY,b.minY),a.maxX=Math.max(a.maxX,b.maxX),a.maxY=Math.max(a.maxY,b.maxY),a}function compareNodeMinX(a,b){return a.minX-b.minX}function compareNodeMinY(a,b){return a.minY-b.minY}function bboxArea(a){return(a.maxX-a.minX)*(a.maxY-a.minY)}function bboxMargin(a){return a.maxX-a.minX+(a.maxY-a.minY)}function contains(a,b){return a.minX<=b.minX&&a.minY<=b.minY&&b.maxX<=a.maxX&&b.maxY<=a.maxY}function intersects(a,b){return b.minX<=a.maxX&&b.minY<=a.maxY&&b.maxX>=a.minX&&b.maxY>=a.minY}function createNode(children){return{children:children,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(arr,left,right,n,compare){for(var mid,stack=[left,right];stack.length;)(right=stack.pop())-(left=stack.pop())<=n||(mid=left+Math.ceil((right-left)/n/2)*n,quickselect(arr,mid,left,right,compare),stack.push(left,mid,mid,right))}rbush.prototype={all:function(){return this._all(this.data,[])},search:function(bbox){var node=this.data,result=[],toBBox=this.toBBox;if(!intersects(bbox,node))return result;for(var i,len,child,childBBox,nodesToSearch=[];node;){for(i=0,len=node.children.length;i<len;i++)child=node.children[i],intersects(bbox,childBBox=node.leaf?toBBox(child):child)&&(node.leaf?result.push(child):contains(bbox,childBBox)?this._all(child,result):nodesToSearch.push(child));node=nodesToSearch.pop()}return result},collides:function(bbox){var node=this.data,toBBox=this.toBBox;if(!intersects(bbox,node))return!1;for(var i,len,child,childBBox,nodesToSearch=[];node;){for(i=0,len=node.children.length;i<len;i++)if(child=node.children[i],intersects(bbox,childBBox=node.leaf?toBBox(child):child)){if(node.leaf||contains(bbox,childBBox))return!0;nodesToSearch.push(child)}node=nodesToSearch.pop()}return!1},load:function(data){if(!data||!data.length)return this;if(data.length<this._minEntries){for(var i=0,len=data.length;i<len;i++)this.insert(data[i]);return this}var node=this._build(data.slice(),0,data.length-1,0);if(this.data.children.length)if(this.data.height===node.height)this._splitRoot(this.data,node);else{if(this.data.height<node.height){var tmpNode=this.data;this.data=node,node=tmpNode}this._insert(node,this.data.height-node.height-1,!0)}else this.data=node;return this},insert:function(item){return item&&this._insert(item,this.data.height-1),this},clear:function(){return this.data=createNode([]),this},remove:function(item,equalsFn){if(!item)return this;for(var i,parent,index,goingUp,node=this.data,bbox=this.toBBox(item),path=[],indexes=[];node||path.length;
vendor: 4,121 bytes, line 733
733){if(node||(node=path.pop(),parent=path[path.length-1],i=indexes.pop(),goingUp=!0),node.leaf&&-1!==(index=findItem(item,node.children,equalsFn)))return node.children.splice(index,1),path.push(node),this._condense(path),this;goingUp||node.leaf||!contains(node,bbox)?parent?(i++,node=parent.children[i],goingUp=!1):node=null:(path.push(node),indexes.push(i),i=0,parent=node,node=node.children[0])}return this},toBBox:function(item){return item},compareMinX:compareNodeMinX,compareMinY:compareNodeMinY,toJSON:function(){return this.data},fromJSON:function(data){return this.data=data,this},_all:function(node,result){for(var nodesToSearch=[];node;)node.leaf?result.push.apply(result,node.children):nodesToSearch.push.apply(nodesToSearch,node.children),node=nodesToSearch.pop();return result},_build:function(items,left,right,height){var node,N=right-left+1,M=this._maxEntries;if(N<=M)return calcBBox(node=createNode(items.slice(left,right+1)),this.toBBox),node;height||(height=Math.ceil(Math.log(N)/Math.log(M)),M=Math.ceil(N/Math.pow(M,height-1))),(node=createNode([])).leaf=!1,node.height=height;var i,j,right2,right3,N2=Math.ceil(N/M),N1=N2*Math.ceil(Math.sqrt(M));for(multiSelect(items,left,right,N1,this.compareMinX),i=left;i<=right;i+=N1)for(multiSelect(items,i,right2=Math.min(i+N1-1,right),N2,this.compareMinY),j=i;j<=right2;j+=N2)right3=Math.min(j+N2-1,right2),node.children.push(this._build(items,j,right3,height-1));return calcBBox(node,this.toBBox),node},_chooseSubtree:function(bbox,node,level,path){for(var i,len,child,targetNode,area,enlargement,minArea,minEnlargement,a,b;path.push(node),!node.leaf&&path.length-1!==level;){for(minArea=minEnlargement=1/0,i=0,len=node.children.length;i<len;i++)area=bboxArea(child=node.children[i]),a=bbox,b=child,(enlargement=(Math.max(b.maxX,a.maxX)-Math.min(b.minX,a.minX))*(Math.max(b.maxY,a.maxY)-Math.min(b.minY,a.minY))-area)<minEnlargement?(minEnlargement=enlargement,minArea=area<minArea?area:minArea,targetNode=child):enlargement===minEnlargement&&area<minArea&&(minArea=area,targetNode=child);node=targetNode||node.children[0]}return node},_insert:function(item,level,isNode){var toBBox=this.toBBox,bbox=isNode?item:toBBox(item),insertPath=[],node=this._chooseSubtree(bbox,this.data,level,insertPath);for(node.children.push(item),extend(node,bbox);level>=0&&insertPath[level].children.length>this._maxEntries;)this._split(insertPath,level),level--;this._adjustParentBBoxes(bbox,insertPath,level)},_split:function(insertPath,level){var node=insertPath[level],M=node.children.length,m=this._minEntries;this._chooseSplitAxis(node,m,M);var splitIndex=this._chooseSplitIndex(node,m,M),newNode=createNode(node.children.splice(splitIndex,node.children.length-splitIndex));newNode.height=node.height,newNode.leaf=node.leaf,calcBBox(node,this.toBBox),calcBBox(newNode,this.toBBox),level?insertPath[level-1].children.push(newNode):this._splitRoot(node,newNode)},_splitRoot:function(node,newNode){this.data=createNode([node,newNode]),this.data.height=node.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},_chooseSplitIndex:function(node,m,M){var i,bbox1,bbox2,overlap,area,minOverlap,minArea,index,a,b,minX,minY,maxX,maxY;for(minOverlap=minArea=1/0,i=m;i<=M-m;i++)bbox1=distBBox(node,0,i,this.toBBox),bbox2=distBBox(node,i,M,this.toBBox),a=bbox1,b=bbox2,minX=void 0,minY=void 0,maxX=void 0,maxY=void 0,minX=Math.max(a.minX,b.minX),minY=Math.max(a.minY,b.minY),maxX=Math.min(a.maxX,b.maxX),maxY=Math.min(a.maxY,b.maxY),overlap=Math.max(0,maxX-minX)*Math.max(0,maxY-minY),area=bboxArea(bbox1)+bboxArea(bbox2),overlap<minOverlap?(minOverlap=overlap,index=i,minArea=area<minArea?area:minArea):overlap===minOverlap&&area<minArea&&(minArea=area,index=i);return index},_chooseSplitAxis:function(node,m,M){var compareMinX=node.leaf?this.compareMinX:compareNodeMinX,compareMinY=node.leaf?this.compareMinY:compareNodeMinY;this._allDistMargin(node,m,M,compareMinX)<this._allDistMargin(node,m,M,compareMinY)&&node.children.sort(compareMinX)},_allDistMargin:function(node,m,M,compare){node.children.sort(compare);var i,child,toBBox=this.toBBox,leftBBox=distBBox(node,0,m,toBBox
vendor: 21,617 bytes, line 733
733),rightBBox=distBBox(node,M-m,M,toBBox),margin=bboxMargin(leftBBox)+bboxMargin(rightBBox);for(i=m;i<M-m;i++)child=node.children[i],extend(leftBBox,node.leaf?toBBox(child):child),margin+=bboxMargin(leftBBox);for(i=M-m-1;i>=m;i--)child=node.children[i],extend(rightBBox,node.leaf?toBBox(child):child),margin+=bboxMargin(rightBBox);return margin},_adjustParentBBoxes:function(bbox,path,level){for(var i=level;i>=0;i--)extend(path[i],bbox)},_condense:function(path){for(var siblings,i=path.length-1;i>=0;i--)0===path[i].children.length?i>0?(siblings=path[i-1].children).splice(siblings.indexOf(path[i]),1):this.clear():calcBBox(path[i],this.toBBox)},compareMinX:function(a,b){return a.left-b.left},compareMinY:function(a,b){return a.top-b.top},toBBox:function(a){return{minX:a.left,minY:a.top,maxX:a.right,maxY:a.bottom}}};var body1$1,body2$1,body1Pushable$1,body2Pushable$1,body1MassImpact$1,body2MassImpact$1,body1FullImpact$1,body2FullImpact$1,body1MovingLeft,body1MovingRight,body1Stationary$1,body2MovingLeft,body2MovingRight,body2Stationary$1,body1OnLeft,body2OnLeft,overlap$1,body1,body2,body1Pushable,body2Pushable,body1MassImpact,body2MassImpact,body1FullImpact,body2FullImpact,body1MovingUp,body1MovingDown,body1Stationary,body2MovingUp,body2MovingDown,body2Stationary,body1OnTop,body2OnTop,overlap,RTree$1=rbush,ProcessTileSeparationX_1=function(body,x){x<0?(body.blocked.none=!1,body.blocked.left=!0):x>0&&(body.blocked.none=!1,body.blocked.right=!0),body.position.x-=x,0===body.bounce.x?body.velocity.x=0:body.velocity.x=-body.velocity.x*body.bounce.x},ProcessTileSeparationX=ProcessTileSeparationX_1,TileCheckX_1=function(body,tile,tileLeft,tileRight,tileBias,isLayer){var ox=0,faceLeft=tile.faceLeft,faceRight=tile.faceRight,collideLeft=tile.collideLeft,collideRight=tile.collideRight;return isLayer||(faceLeft=!0,faceRight=!0,collideLeft=!0,collideRight=!0),body.deltaX()<0&&collideRight&&body.checkCollision.left?faceRight&&body.x<tileRight&&(ox=body.x-tileRight)<-tileBias&&(ox=0):body.deltaX()>0&&collideLeft&&body.checkCollision.right&&faceLeft&&body.right>tileLeft&&(ox=body.right-tileLeft)>tileBias&&(ox=0),0!==ox&&(body.customSeparateX?body.overlapX=ox:ProcessTileSeparationX(body,ox)),ox},ProcessTileSeparationY_1=function(body,y){y<0?(body.blocked.none=!1,body.blocked.up=!0):y>0&&(body.blocked.none=!1,body.blocked.down=!0),body.position.y-=y,0===body.bounce.y?body.velocity.y=0:body.velocity.y=-body.velocity.y*body.bounce.y},ProcessTileSeparationY=ProcessTileSeparationY_1,TileCheckY_1=function(body,tile,tileTop,tileBottom,tileBias,isLayer){var oy=0,faceTop=tile.faceTop,faceBottom=tile.faceBottom,collideUp=tile.collideUp,collideDown=tile.collideDown;return isLayer||(faceTop=!0,faceBottom=!0,collideUp=!0,collideDown=!0),body.deltaY()<0&&collideDown&&body.checkCollision.up?faceBottom&&body.y<tileBottom&&(oy=body.y-tileBottom)<-tileBias&&(oy=0):body.deltaY()>0&&collideUp&&body.checkCollision.down&&faceTop&&body.bottom>tileTop&&(oy=body.bottom-tileTop)>tileBias&&(oy=0),0!==oy&&(body.customSeparateY?body.overlapY=oy:ProcessTileSeparationY(body,oy)),oy},TileIntersectsBody_1=function(tileWorldRect,body){return!(body.right<=tileWorldRect.left||body.bottom<=tileWorldRect.top||body.position.x>=tileWorldRect.right||body.position.y>=tileWorldRect.bottom)},TileCheckX=TileCheckX_1,TileCheckY=TileCheckY_1,TileIntersectsBody$1=TileIntersectsBody_1,SeparateTile_1=function(i,body,tile,tileWorldRect,tilemapLayer,tileBias,isLayer){var tileLeft=tileWorldRect.left,tileTop=tileWorldRect.top,tileRight=tileWorldRect.right,tileBottom=tileWorldRect.bottom,faceHorizontal=tile.faceLeft||tile.faceRight,faceVertical=tile.faceTop||tile.faceBottom;if(isLayer||(faceHorizontal=!0,faceVertical=!0),!faceHorizontal&&!faceVertical)return!1;var ox=0,oy=0,minX=0,minY=1;if(body.deltaAbsX()>body.deltaAbsY()?minX=-1:body.deltaAbsX()<body.deltaAbsY()&&(minY=-1),0!==body.deltaX()&&0!==body.deltaY()&&faceHorizontal&&faceVertical&&(minX=Math.min(Math.abs(body.position.x-tileRight),Math.abs(body.right-tileLeft)),minY=Math.min(Math.abs(body.position.y-tileBottom),Math.abs(body.bottom-tileTop))),minX<minY){if(faceHorizontal&&0!==(ox=TileCheckX(body,tile,tileLeft,tileRight,tileBias,isLayer))&&!TileIntersectsBody$1(tileWorldRect,body))return!0;faceVertical&&(oy=TileCheckY(body,tile,tileTop,tileBottom,tileBias,isLayer))}else{if(faceVertical&&0!==(oy=TileCheckY(body,tile,tileTop,tileBottom,tileBias,isLayer))&&!TileIntersectsBody$1(tileWorldRect,body))return!0;faceHorizontal&&(ox=TileCheckX(body,tile,tileLeft,tileRight,tileBias,isLayer))}return 0!==ox||0!==oy},BlockCheck$1=function(){return body1MovingRight&&body1OnLeft&&body2$1.blocked.right?(body1$1.processX(-overlap$1,body1FullImpact$1,!1,!0),1):body1MovingLeft&&body2OnLeft&&body2$1.blocked.left?(body1$1.processX(overlap$1,body1FullImpact$1,!0),1):body2MovingRight&&body2OnLeft&&body1$1.blocked.right?(body2$1.processX(-overlap$1,body2FullImpact$1,!1,!0),2):body2MovingLeft&&body1OnLeft&&body1$1.blocked.left?(body2$1.processX(overlap$1,body2FullImpact$1,!0),2):0},Run$1=function(side){if(body1Pushable$1&&body2Pushable$1)overlap$1*=.5,0===side||3===side?(body1$1.processX(overlap$1,body1MassImpact$1),body2$1.processX(-overlap$1,body2MassImpact$1)):(body1$1.processX(-overlap$1,body1MassImpact$1),body2$1.processX(overlap$1,body2MassImpact$1));else if(body1Pushable$1&&!body2Pushable$1)0===side||3===side?body1$1.processX(overlap$1,body1FullImpact$1,!0):body1$1.processX(-overlap$1,body1FullImpact$1,!1,!0);else if(!body1Pushable$1&&body2Pushable$1)0===side||3===side?body2$1.processX(-overlap$1,body2FullImpact$1,!1,!0):body2$1.processX(overlap$1,body2FullImpact$1,!0);else{var halfOverlap=.5*overlap$1;0===side?body2Stationary$1?(body1$1.processX(overlap$1,0,!0),body2$1.processX(0,null,!1,!0)):body2MovingRight?(body1$1.processX(halfOverlap,0,!0),body2$1.processX(-halfOverlap,0,!1,!0)):(body1$1.processX(halfOverlap,body2$1.velocity.x,!0),body2$1.processX(-halfOverlap,null,!1,!0)):1===side?body1Stationary$1?(body1$1.processX(0,null,!1,!0),body2$1.processX(overlap$1,0,!0)):body1MovingRight?(body1$1.processX(-halfOverlap,0,!1,!0),body2$1.processX(halfOverlap,0,!0)):(body1$1.processX(-halfOverlap,null,!1,!0),body2$1.processX(halfOverlap,body1$1.velocity.x,!0)):2===side?body2Stationary$1?(body1$1.processX(-overlap$1,0,!1,!0),body2$1.processX(0,null,!0)):body2MovingLeft?(body1$1.processX(-halfOverlap,0,!1,!0),body2$1.processX(halfOverlap,0,!0)):(body1$1.processX(-halfOverlap,body2$1.velocity.x,!1,!0),body2$1.processX(halfOverlap,null,!0)):3===side&&(body1Stationary$1?(body1$1.processX(0,null,!0),body2$1.processX(-overlap$1,0,!1,!0)):body1MovingLeft?(body1$1.processX(halfOverlap,0,!0),body2$1.processX(-halfOverlap,0,!1,!0)):(body1$1.processX(halfOverlap,body2$1.velocity.y,!0),body2$1.processX(-halfOverlap,null,!1,!0)))}return!0},GetOverlapX$1=GetOverlapX_1,ProcessX={BlockCheck:BlockCheck$1,Check:function(){var v1=body1$1.velocity.x,v2=body2$1.velocity.x,nv1=Math.sqrt(v2*v2*body2$1.mass/body1$1.mass)*(v2>0?1:-1),nv2=Math.sqrt(v1*v1*body1$1.mass/body2$1.mass)*(v1>0?1:-1),avg=.5*(nv1+nv2);return nv2-=avg,body1MassImpact$1=avg+(nv1-=avg)*body1$1.bounce.x,body2MassImpact$1=avg+nv2*body2$1.bounce.x,body1MovingLeft&&body2OnLeft?Run$1(0):body2MovingLeft&&body1OnLeft?Run$1(1):body1MovingRight&&body1OnLeft?Run$1(2):!(!body2MovingRight||!body2OnLeft)&&Run$1(3)},Set:function(b1,b2,ov){body2$1=b2;var v1=(body1$1=b1).velocity.x,v2=body2$1.velocity.x;return body1Pushable$1=body1$1.pushable,body1MovingLeft=body1$1._dx<0,body1MovingRight=body1$1._dx>0,body1Stationary$1=0===body1$1._dx,body1OnLeft=Math.abs(body1$1.right-body2$1.x)<=Math.abs(body2$1.right-body1$1.x),body1FullImpact$1=v2-v1*body1$1.bounce.x,body2Pushable$1=body2$1.pushable,body2MovingLeft=body2$1._dx<0,body2MovingRight=body2$1._dx>0,body2Stationary$1=0===body2$1._dx,body2OnLeft=!body1OnLeft,body2FullImpact$1=v1-v2*body2$1.bounce.x,overlap$1=Math.abs(ov),BlockCheck$1()},Run:Run$1,RunImmovableBody1:function(blockedState){1===blockedState?body2$1.velocity.x=0:body1OnLeft?body2$1.processX(overlap$1,body2FullImpact$1,!0):body2$1.processX(-overlap$1,body2FullImpact$1,!1,!0),body1$1.moves&&(body2$1.y+=(body1$1.y-body1$1.prev.y)*body1$1.friction.y,body2$1._dy=body2$1.y-body2$1.prev.y)},RunImmovableBody2:function(blockedState){2===blockedState?body1$1.velocity.x=0:body2OnLeft?body1$1.processX(overlap$1,body1FullImpact$1,!0):body1$1.processX(-overlap$1,body1FullImpact$1,!1,!0),body2$1.moves&&(body1$1.y+=(body2$1.y-body2$1.prev.y)*body2$1.friction.y,body1$1._dy=body1$1.y-body1$1.prev.y)}},SeparateX_1=function(body1,body2,overlapOnly,bias){var overlap=GetOverlapX$1(body1,body2,overlapOnly,bias),body1Immovable=body1.immovable,body2Immovable=body2.immovable;if(overlapOnly||0===overlap||body1Immovable&&body2Immovable||body1.customSeparateX||body2.customSeparateX)return 0!==overlap||body1.embedded&&body2.embedded;var blockedState=ProcessX.Set(body1,body2,overlap);return body1Immovable||body2Immovable?(body1Immovable?ProcessX.RunImmovableBody1(blockedState):body2Immovable&&ProcessX.RunImmovableBody2(blockedState),!0):blockedState>0||ProcessX.Check()},BlockCheck=function(){return body1MovingDown&&body1OnTop&&body2.blocked.down?(body1.processY(-overlap,body1FullImpact,!1,!0),1):body1MovingUp&&body2OnTop&&body2.blocked.up?(body1.processY(overlap,body1FullImpact,!0),1):body2MovingDown&&body2OnTop&&body1.blocked.down?(body2.processY(-overlap,body2FullImpact,!1,!0),2):body2MovingUp&&body1OnTop&&body1.blocked.up?(body2.processY(overlap,body2FullImpact,!0),2):0},Run=function(side){if(body1Pushable&&body2Pushable)overlap*=.5,0===side||3===side?(body1.processY(overlap,body1MassImpact),body2.processY(-overlap,body2MassImpact)):(body1.processY(-overlap,body1MassImpact),body2.processY(overlap,body2MassImpact));else if(body1Pushable&&!body2Pushable)0===side||3===side?body1.processY(overlap,body1FullImpact,!0):body1.processY(-overlap,body1FullImpact,!1,!0);else if(!body1Pushable&&body2Pushable)0===side||3===side?body2.processY(-overlap,body2FullImpact,!1,!0):body2.processY(overlap,body2FullImpact,!0);else{var halfOverlap=.5*overlap;0===side?body2Stationary?(body1.processY(overlap,0,!0),body2.processY(0,null,!1,!0)):body2MovingDown?(body1.processY(halfOverlap,0,!0),body2.processY(-halfOverlap,0,!1,!0)):(body1.processY(halfOverlap,body2.velocity.y,!0),body2.processY(-halfOverlap,null,!1,!0)):1===side?body1Stationary?(body1.processY(0,null,!1,!0),body2.processY(overlap,0,!0)):body1MovingDown?(body1.processY(-halfOverlap,0,!1,!0),body2.processY(halfOverlap,0,!0)):(body1.processY(-halfOverlap,null,!1,!0),body2.processY(halfOverlap,body1.velocity.y,!0)):2===side?body2Stationary?(body1.processY(-overlap,0,!1,!0),body2.processY(0,null,!0)):body2MovingUp?(body1.processY(-halfOverlap,0,!1,!0),body2.processY(halfOverlap,0,!0)):(body1.processY(-halfOverlap,body2.velocity.y,!1,!0),body2.processY(halfOverlap,null,!0)):3===side&&(body1Stationary?(body1.processY(0,null,!0),body2.processY(-overlap,0,!1,!0)):body1MovingUp?(body1.processY(halfOverlap,0,!0),body2.processY(-halfOverlap,0,!1,!0)):(body1.processY(halfOverlap,body2.velocity.y,!0),body2.processY(-halfOverlap,null,!1,!0)))}return!0},GetOverlapY$1=GetOverlapY_1,ProcessY={BlockCheck:BlockCheck,Check:function(){var v1=body1.velocity.y,v2=body2.velocity.y,nv1=Math.sqrt(v2*v2*body2.mass/body1.mass)*(v2>0?1:-1),nv2=Math.sqrt(v1*v1*body1.mass/body2.mass)*(v1>0?1:-1),avg=.5*(nv1+nv2);return nv2-=avg,body1MassImpact=avg+(nv1-=avg)*body1.bounce.y,body2MassImpact=avg+nv2*body2.bounce.y,body1MovingUp&&body2OnTop?Run(0):body2MovingUp&&body1OnTop?Run(1):body1MovingDown&&body1OnTop?Run(2):!(!body2MovingDown||!body2OnTop)&&Run(3)},Set:function(b1,b2,ov){body2=b2;var v1=(body1=b1).velocity.y,v2=body2.velocity.y;return body1Pushable=body1.pushable,body1MovingUp=body1._dy<0,body1MovingDown=body1._dy>0,body1Stationary=0===body1._dy,body1OnTop=Math.abs(body1.bottom-body2.y)<=Math.abs(body2.bottom-body1.y),body1FullImpact=v2-v1*body1.bounce.y,body2Pushable=body2.pushable,body2MovingUp=body2._dy<0,body2MovingDown=body2._dy>0,body2Stationary=0===body2._dy,body2OnTop=!body1OnTop,body2FullImpact=v1-v2*body2.bounce.y,overlap=Math.abs(ov),BlockCheck()},Run:Run,RunImmovableBody1:function(blockedState){1===blockedState?body2.velocity.y=0:body1OnTop?body2.processY(overlap,body2FullImpact,!0):body2.processY(-overlap,body2FullImpact,!1,!0),body1.moves&&(body2.x+=(body1.x-body1.prev.x)*body1.friction.x,body2._dx=body2.x-body2.prev.x)},RunImmovableBody2:function(blockedState){2===blockedState?body1.velocity.y=0:body2OnTop?body1.processY(overlap,body1FullImpact,!0):body1.processY(-overlap,body1FullImpact,!1,!0),body2.moves&&(body1.x+=(body2.x-body2.prev.x)*body2.friction.x,body1._dx=body1.x-body1.prev.x)}},SeparateY_1=function(body1,body2,overlapOnly,bias){var overlap=GetOverlapY$1(body1,body2,overlapOnly,bias),body1Immovable=body1.immovable,body2Immovable=body2.immovable;if(overlapOnly||0===overlap||body1Immovable&&body2Immovable||body1.customSeparateY||body2.customSeparateY)return 0!==overlap||body1.embedded&&body2.embedded;var blockedState=ProcessY.Set(body1,body2,overlap);return body1Immovable||body2Immovable?(body1Immovable?ProcessY.RunImmovableBody1(blockedState):body2Immovable&&ProcessY.RunImmovableBody2(blockedState),!0):blockedState>0||ProcessY.Check()},CircleContains=Contains_1$4,CONST$n=_const$2,RectangleContains=Contains_1$3,Vector2$m=Vector2_1,StaticBody_1=new Class_1({initialize:function(world,gameObject){var width=gameObject.displayWidth?gameObject.displayWidth:64,height=gameObject.displayHeight?gameObject.displayHeight:64;this.world=world,this.gameObject=gameObject,this.debugShowBody=world.defaults.debugShowStaticBody,this.debugBodyColor=world.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new Vector2$m,this.position=new Vector2$m(gameObject.x-width*gameObject.originX,gameObject.y-height*gameObject.originY),this.width=width,this.height=height,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new Vector2$m(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=Vector2$m.ZERO,this.allowGravity=!1,this.gravity=Vector2$m.ZERO,this.bounce=Vector2$m.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=CONST$n.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(gameObject,update){return gameObject&&gameObject!==this.gameObject&&(this.gameObject.body=null,gameObject.body=this,this.gameObject=gameObject),update&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var gameObject=this.gameObject;return gameObject.getTopLeft(this.position),this.width=gameObject.displayWidth,this.height=gameObject.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(x,y){return void 0===y&&(y=x),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(x,y),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(width,height,center){void 0===center&&(center=!0);var gameObject=this.gameObject;if(!width&&gameObject.frame&&(width=gameObject.frame.realWidth),!height&&gameObject.frame&&(height=gameObject.frame.realHeight),this.world.staticTree.remove(this),this.width=width,this.height=height,this.halfWidth=Math.floor(width/2),this.halfHeight=Math.floor(height/2),center&&gameObject.getCenter){var ox=gameObject.displayWidth/2,oy=gameObject.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(ox-this.halfWidth,oy-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(radius,offsetX,offsetY){return void 0===offsetX&&(offsetX=this.offset.x),void 0===offsetY&&(offsetY=this.offset.y),radius>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=radius,this.width=2*radius,this.height=2*radius,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(offsetX,offsetY),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(x,y){var gameObject=this.gameObject;void 0===x&&(x=gameObject.x),void 0===y&&(y=gameObject.y),this.world.staticTree.remove(this),gameObject.setPosition(x,y),gameObject.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(obj){return obj.x=this.x,obj.y=this.y,obj.right=this.right,obj.bottom=this.bottom,obj},hitTest:function(x,y){return this.isCircle?CircleContains(this,x,y):RectangleContains(this,x,y)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(graphic){var pos=this.position,x=pos.x+this.halfWidth,y=pos.y+this.halfHeight;this.debugShowBody&&(graphic.lineStyle(graphic.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?graphic.strokeCircle(x,y,this.width/2):graphic.strokeRect(pos.x,pos.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(value){return value<=0&&(value=.1),this.mass=value,this},x:{get:function(){return this.position.x},set:function(value){this.world.staticTree.remove(this),this.position.x=value,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(value){this.world.staticTree.remove(this),this.position.y=value,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}}),AngleBetweenPoints=BetweenPoints_1,Body$g=Body_1$1,Clamp$2=Clamp_1,Collider=Collider_1,CONST$m=_const$2,DistanceBetween$2=DistanceBetween_1,EventEmitter$4=eventemitter3.exports,Events$a=events$2,FuzzyEqual=Equal_1,FuzzyGreaterThan=GreaterThan_1,FuzzyLessThan=LessThan_1,GetOverlapX=GetOverlapX_1,GetOverlapY=GetOverlapY_1,GetTilesWithinWorldXY=GetTilesWithinWorldXY_1,GetValue$9=GetValue_1,MATH_CONST$3=_const$b,ProcessQueue=ProcessQueue_1,ProcessTileCallbacks=ProcessTileCallbacks_1,Rectangle$2=Rectangle_1$1,RTree=RTree$1,SeparateTile=SeparateTile_1,SeparateX=SeparateX_1,SeparateY=SeparateY_1,Set$1=_Set,StaticBody=StaticBody_1,TileIntersectsBody=TileIntersectsBody_1,TransformMatrix$1=TransformMatrix_1,Vector2$l=Vector2_1,Wrap=Wrap_1$1,World$5=new Class_1({Extends:EventEmitter$4,initialize:function(scene,config){EventEmitter$4.call(this),this.scene=scene,this.bodies=new Set$1,this.staticBodies=new Set$1,this.pendingDestroy=new Set$1,this.colliders=new ProcessQueue,this.gravity=new Vector2$l(GetValue$9(config,"gravity.x",0),GetValue$9(config,"gravity.y",0)),this.bounds=new Rectangle$2(GetValue$9(config,"x",0),GetValue$9(config,"y",0),GetValue$9(config,"width",scene.sys.scale.width),GetValue$9(config,"height",scene.sys.scale.height)),this.checkCollision={up:GetValue$9(config,"checkCollision.up",!0),down:GetValue$9(config,"checkCollision.down",!0),left:GetValue$9(config,"checkCollision.left",!0),right:GetValue$9(config,"checkCollision.right",!0)},this.fps=GetValue$9(config,"fps",60),this.fixedStep=GetValue$9(config,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=GetValue$9(config,"timeScale",1),this.OVERLAP_BIAS=GetValue$9(config,"overlapBias",4),this.TILE_BIAS=GetValue$9(config,"tileBias",16),this.forceX=GetValue$9(config,"forceX",!1),this.isPaused=GetValue$9(config,"isPaused",!1),this._total=0,this.drawDebug=GetValue$9(config,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:GetValue$9(config,"debugShowBody",!0),debugShowStaticBody:GetValue$9(config,"debugShowStaticBody",!0),debugShowVelocity:GetValue$9(config,"debugShowVelocity",!0),bodyDebugColor:GetValue$9(config,"debugBodyColor",16711935),staticBodyDebugColor:GetValue$9(config,"debugStaticBodyColor",255),velocityDebugColor:GetValue$9(config,"debugVelocityColor",65280)},this.maxEntries=GetValue$9(config,"maxEntries",16),this.useTree=GetValue$9(config,"useTree",!0),this.tree=new RTree(this.maxEntries),this.staticTree=new RTree(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new TransformMatrix$1,this._tempMatrix2=new TransformMatrix$1,this.drawDebug&&this.createDebugGraphic()},enable:function(object,bodyType){void 0===bodyType&&(bodyType=CONST$m.DYNAMIC_BODY),Array.isArray(object)||(object=[object]);for(var i=0;i<object.length;i++){var entry=object[i];if(entry.isParent)for(var children=entry.getChildren(),c=0;c<children.length;c++){var child=children[c];
733child.isParent?this.enable(child,bodyType):this.enableBody(child,bodyType)}else this.enableBody(entry,bodyType)}},enableBody:function(object,bodyType){return void 0===bodyType&&(bodyType=CONST$m.DYNAMIC_BODY),object.body||(bodyType===CONST$m.DYNAMIC_BODY?object.body=new Body$g(this,object):bodyType===CONST$m.STATIC_BODY&&(object.body=new StaticBody(this,object))),this.add(object.body),object},add:function(body){return body.physicsType===CONST$m.DYNAMIC_BODY?this.bodies.set(body):body.physicsType===CONST$m.STATIC_BODY&&(this.staticBodies.set(body),this.staticTree.insert(body)),body.enable=!0,body},disable:function(object){Array.isArray(object)||(object=[object]);for(var i=0;i<object.length;i++){var entry=object[i];if(entry.isParent)for(var children=entry.getChildren(),c=0;c<children.length;c++){var child=children[c];child.isParent?this.disable(child):this.disableBody(child.body)}else this.disableBody(entry.body)}},disableBody:function(body){this.remove(body),body.enable=!1},remove:function(body){body.physicsType===CONST$m.DYNAMIC_BODY?(this.tree.remove(body),this.bodies.delete(body)):body.physicsType===CONST$m.STATIC_BODY&&(this.staticBodies.delete(body),this.staticTree.remove(body))},createDebugGraphic:function(){var graphic=this.scene.sys.add.graphics({x:0,y:0});return graphic.setDepth(Number.MAX_VALUE),this.debugGraphic=graphic,this.drawDebug=!0,graphic},setBounds:function(x,y,width,height,checkLeft,checkRight,checkUp,checkDown){return this.bounds.setTo(x,y,width,height),void 0!==checkLeft&&this.setBoundsCollision(checkLeft,checkRight,checkUp,checkDown),this},setBoundsCollision:function(left,right,up,down){return void 0===left&&(left=!0),void 0===right&&(right=!0),void 0===up&&(up=!0),void 0===down&&(down=!0),this.checkCollision.left=left,this.checkCollision.right=right,this.checkCollision.up=up,this.checkCollision.down=down,this},pause:function(){return this.isPaused=!0,this.emit(Events$a.PAUSE),this},resume:function(){return this.isPaused=!1,this.emit(Events$a.RESUME),this},addCollider:function(object1,object2,collideCallback,processCallback,callbackContext){void 0===collideCallback&&(collideCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=collideCallback);var collider=new Collider(this,!1,object1,object2,collideCallback,processCallback,callbackContext);return this.colliders.add(collider),collider},addOverlap:function(object1,object2,collideCallback,processCallback,callbackContext){void 0===collideCallback&&(collideCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=collideCallback);var collider=new Collider(this,!0,object1,object2,collideCallback,processCallback,callbackContext);return this.colliders.add(collider),collider},removeCollider:function(collider){return this.colliders.remove(collider),this},setFPS:function(framerate){return this.fps=framerate,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(time,delta){if(!this.isPaused&&0!==this.bodies.size){var i,body,fixedDelta=this._frameTime,msPerFrame=this._frameTimeMS*this.timeScale;this._elapsed+=delta;var bodies=this.bodies.entries,willStep=this._elapsed>=msPerFrame;for(this.fixedStep||(fixedDelta=.001*delta,willStep=!0,this._elapsed=0),i=0;i<bodies.length;i++)(body=bodies[i]).enable&&body.preUpdate(willStep,fixedDelta);if(willStep){this._elapsed-=msPerFrame,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(bodies));var colliders=this.colliders.update();for(i=0;i<colliders.length;i++){var collider=colliders[i];collider.active&&collider.update()}this.emit(Events$a.WORLD_STEP,fixedDelta)}for(;this._elapsed>=msPerFrame;)this._elapsed-=msPerFrame,this.step(fixedDelta)}},step:function(delta){var i,body,bodies=this.bodies.entries,len=bodies.length;for(i=0;i<len;i++)(body=bodies[i]).enable&&body.update(delta);this.useTree&&(this.tree.clear(),this.tree.load(bodies));var colliders=this.colliders.update();for(i=0;i<colliders.length;i++){var collider=colliders[i];collider.active&&collider.update()}
733this.emit(Events$a.WORLD_STEP,delta),this.stepsLastFrame++},postUpdate:function(){var i,body,bodies=this.bodies.entries,len=bodies.length,dynamic=this.bodies,staticBodies=this.staticBodies;if(this.stepsLastFrame)for(this.stepsLastFrame=0,i=0;i<len;i++)(body=bodies[i]).enable&&body.postUpdate();if(this.drawDebug){var graphics=this.debugGraphic;for(graphics.clear(),i=0;i<len;i++)(body=bodies[i]).willDrawDebug()&&body.drawDebug(graphics);for(len=(bodies=staticBodies.entries).length,i=0;i<len;i++)(body=bodies[i]).willDrawDebug()&&body.drawDebug(graphics)}var pending=this.pendingDestroy;if(pending.size>0){var dynamicTree=this.tree,staticTree=this.staticTree;for(len=(bodies=pending.entries).length,i=0;i<len;i++)(body=bodies[i]).physicsType===CONST$m.DYNAMIC_BODY?(dynamicTree.remove(body),dynamic.delete(body)):body.physicsType===CONST$m.STATIC_BODY&&(staticTree.remove(body),staticBodies.delete(body)),body.world=void 0,body.gameObject=void 0;pending.clear()}},updateMotion:function(body,delta){body.allowRotation&&this.computeAngularVelocity(body,delta),this.computeVelocity(body,delta)},computeAngularVelocity:function(body,delta){var velocity=body.angularVelocity,acceleration=body.angularAcceleration,drag=body.angularDrag,max=body.maxAngular;acceleration?velocity+=acceleration*delta:body.allowDrag&&drag&&(FuzzyGreaterThan(velocity-(drag*=delta),0,.1)?velocity-=drag:FuzzyLessThan(velocity+drag,0,.1)?velocity+=drag:velocity=0);var velocityDelta=(velocity=Clamp$2(velocity,-max,max))-body.angularVelocity;body.angularVelocity+=velocityDelta,body.rotation+=body.angularVelocity*delta},computeVelocity:function(body,delta){var velocityX=body.velocity.x,accelerationX=body.acceleration.x,dragX=body.drag.x,maxX=body.maxVelocity.x,velocityY=body.velocity.y,accelerationY=body.acceleration.y,dragY=body.drag.y,maxY=body.maxVelocity.y,speed=body.speed,maxSpeed=body.maxSpeed,allowDrag=body.allowDrag,useDamping=body.useDamping;body.allowGravity&&(velocityX+=(this.gravity.x+body.gravity.x)*delta,velocityY+=(this.gravity.y+body.gravity.y)*delta),accelerationX?velocityX+=accelerationX*delta:allowDrag&&dragX&&(useDamping?(velocityX*=dragX=Math.pow(dragX,delta),speed=Math.sqrt(velocityX*velocityX+velocityY*velocityY),FuzzyEqual(speed,0,.001)&&(velocityX=0)):FuzzyGreaterThan(velocityX-(dragX*=delta),0,.01)?velocityX-=dragX:FuzzyLessThan(velocityX+dragX,0,.01)?velocityX+=dragX:velocityX=0),accelerationY?velocityY+=accelerationY*delta:allowDrag&&dragY&&(useDamping?(velocityY*=dragY=Math.pow(dragY,delta),speed=Math.sqrt(velocityX*velocityX+velocityY*velocityY),FuzzyEqual(speed,0,.001)&&(velocityY=0)):FuzzyGreaterThan(velocityY-(dragY*=delta),0,.01)?velocityY-=dragY:FuzzyLessThan(velocityY+dragY,0,.01)?velocityY+=dragY:velocityY=0),velocityX=Clamp$2(velocityX,-maxX,maxX),velocityY=Clamp$2(velocityY,-maxY,maxY),body.velocity.set(velocityX,velocityY),maxSpeed>-1&&speed>maxSpeed&&(body.velocity.normalize().scale(maxSpeed),speed=maxSpeed),body.speed=speed},separate:function(body1,body2,processCallback,callbackContext,overlapOnly,intersects){if(!intersects&&!body1.enable||!body2.enable||body1.checkCollision.none||body2.checkCollision.none||!this.intersects(body1,body2))return!1;if(processCallback&&!1===processCallback.call(callbackContext,body1.gameObject,body2.gameObject))return!1;if(body1.isCircle&&body2.isCircle)return this.separateCircle(body1,body2,overlapOnly);if(body1.isCircle!==body2.isCircle){var bodyRect=body1.isCircle?body2:body1,bodyCircle=body1.isCircle?body1:body2,rect={x:bodyRect.x,y:bodyRect.y,right:bodyRect.right,bottom:bodyRect.bottom},circle=bodyCircle.center;if((circle.y<rect.y||circle.y>rect.bottom)&&(circle.x<rect.x||circle.x>rect.right))return this.separateCircle(body1,body2,overlapOnly)}var resultX=!1,resultY=!1;overlapOnly?(resultX=SeparateX(body1,body2,overlapOnly,this.OVERLAP_BIAS),resultY=SeparateY(body1,body2,overlapOnly,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+body1.gravity.y)<Math.abs(this.gravity.x+body1.gravity.x)?(resultX=SeparateX(body1,body2,overlapOnly,this.OVERLAP_BIAS),this.intersects(body1,body2)&&(resultY=SeparateY(body1,body2,overlapOnly,this.OVERLAP_BIAS))):(resultY=SeparateY(body1,body2,overlapOnly,this.OVERLAP_BIAS),this.intersects(body1,body2)&&(resultX=SeparateX(body1,body2,overlapOnly,this.OVERLAP_BIAS)));var result=resultX||resultY;return result&&(overlapOnly?(body1.onOverlap||body2.onOverlap)&&this.emit
733(Events$a.OVERLAP,body1.gameObject,body2.gameObject,body1,body2):(body1.onCollide||body2.onCollide)&&this.emit(Events$a.COLLIDE,body1.gameObject,body2.gameObject,body1,body2)),result},separateCircle:function(body1,body2,overlapOnly,bias){GetOverlapX(body1,body2,!1,bias),GetOverlapY(body1,body2,!1,bias);var overlap=0;if(body1.isCircle!==body2.isCircle){var rect={x:body2.isCircle?body1.position.x:body2.position.x,y:body2.isCircle?body1.position.y:body2.position.y,right:body2.isCircle?body1.right:body2.right,bottom:body2.isCircle?body1.bottom:body2.bottom},circle={x:body1.isCircle?body1.center.x:body2.center.x,y:body1.isCircle?body1.center.y:body2.center.y,radius:body1.isCircle?body1.halfWidth:body2.halfWidth};circle.y<rect.y?circle.x<rect.x?overlap=DistanceBetween$2(circle.x,circle.y,rect.x,rect.y)-circle.radius:circle.x>rect.right&&(overlap=DistanceBetween$2(circle.x,circle.y,rect.right,rect.y)-circle.radius):circle.y>rect.bottom&&(circle.x<rect.x?overlap=DistanceBetween$2(circle.x,circle.y,rect.x,rect.bottom)-circle.radius:circle.x>rect.right&&(overlap=DistanceBetween$2(circle.x,circle.y,rect.right,rect.bottom)-circle.radius)),overlap*=-1}else overlap=body1.halfWidth+body2.halfWidth-DistanceBetween$2(body1.center.x,body1.center.y,body2.center.x,body2.center.y);if(body1.overlapR=overlap,body2.overlapR=overlap,overlapOnly||0===overlap||body1.immovable&&body2.immovable||body1.customSeparateX||body2.customSeparateX)return 0!==overlap&&(body1.onOverlap||body2.onOverlap)&&this.emit(Events$a.OVERLAP,body1.gameObject,body2.gameObject,body1,body2),0!==overlap;var dx=body1.center.x-body2.center.x,dy=body1.center.y-body2.center.y,d=Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2)),nx=(body2.center.x-body1.center.x)/d||0,ny=(body2.center.y-body1.center.y)/d||0,p=2*(body1.velocity.x*nx+body1.velocity.y*ny-body2.velocity.x*nx-body2.velocity.y*ny)/(body1.mass+body2.mass);(body1.immovable||body2.immovable)&&(p*=2),body1.immovable||(body1.velocity.x=body1.velocity.x-p/body1.mass*nx,body1.velocity.y=body1.velocity.y-p/body1.mass*ny),body2.immovable||(body2.velocity.x=body2.velocity.x+p/body2.mass*nx,body2.velocity.y=body2.velocity.y+p/body2.mass*ny),body1.immovable||body2.immovable||(overlap/=2);var angle=AngleBetweenPoints(body1.center,body2.center),overlapX=(overlap+MATH_CONST$3.EPSILON)*Math.cos(angle),overlapY=(overlap+MATH_CONST$3.EPSILON)*Math.sin(angle);return body1.immovable||(body1.x-=overlapX,body1.y-=overlapY,body1.updateCenter()),body2.immovable||(body2.x+=overlapX,body2.y+=overlapY,body2.updateCenter()),body1.velocity.x*=body1.bounce.x,body1.velocity.y*=body1.bounce.y,body2.velocity.x*=body2.bounce.x,body2.velocity.y*=body2.bounce.y,(body1.onCollide||body2.onCollide)&&this.emit(Events$a.COLLIDE,body1.gameObject,body2.gameObject,body1,body2),!0},intersects:function(body1,body2){return body1!==body2&&(body1.isCircle||body2.isCircle?body1.isCircle?body2.isCircle?DistanceBetween$2(body1.center.x,body1.center.y,body2.center.x,body2.center.y)<=body1.halfWidth+body2.halfWidth:this.circleBodyIntersects(body1,body2):this.circleBodyIntersects(body2,body1):!(body1.right<=body2.position.x||body1.bottom<=body2.position.y||body1.position.x>=body2.right||body1.position.y>=body2.bottom))},circleBodyIntersects:function(circle,body){var x=Clamp$2(circle.center.x,body.left,body.right),y=Clamp$2(circle.center.y,body.top,body.bottom);return(circle.center.x-x)*(circle.center.x-x)+(circle.center.y-y)*(circle.center.y-y)<=circle.halfWidth*circle.halfWidth},overlap:function(object1,object2,overlapCallback,processCallback,callbackContext){return void 0===overlapCallback&&(overlapCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=overlapCallback),this.collideObjects(object1,object2,overlapCallback,processCallback,callbackContext,!0)},collide:function(object1,object2,collideCallback,processCallback,callbackContext){return void 0===collideCallback&&(collideCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=collideCallback),this.collideObjects(object1,object2,collideCallback,processCallback,callbackContext,!1)},collideObjects:function(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly){var i,j;object1.isParent&&void 0===object1.physicsType&&(object1=object1.children.entries),object2&&object2.isParent&&void 0===object2.physicsType&&(object2=object2.children.entries);var object1isArray=Array.isArray(object1),object2isArray=Array.isArray(object2);if(this._total=0,object1isArray||object2isArray)if(!object1isArray&&object2isArray)for(i=0;i<object2.length;i++)this.collideHandler(object1,object2[i],collideCallback,processCallback,callbackContext,overlapOnly);else if(object1isArray&&!object2isArray)if(object2)for(i=0;i<object1.length;i++)this.collideHandler(object1[i],object2,collideCallback,processCallback,callbackContext,overlapOnly);else for(i=0;i<object1.length;i++){var child=object1[i];for(j=i+1;j<object1.length;j++)i!==j&&this.collideHandler(child,object1[j],collideCallback,processCallback,callbackContext,overlapOnly)}else for(i=0;i<object1.length;i++)for(j=0;j<object2.length;j++)this.collideHandler(object1[i],object2[j],collideCallback,processCallback,callbackContext,overlapOnly);else this.collideHandler(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly);return this._total>0},collideHandler:function(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly){if(void 0===object2&&object1.isParent)return this.collideGroupVsGroup(object1,object1,collideCallback,processCallback,callbackContext,overlapOnly);if(!object1||!object2)return!1;if(object1.body){if(object2.body)return this.collideSpriteVsSprite(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly);if(object2.isParent)return this.collideSpriteVsGroup(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly);if(object2.isTilemap)return this.collideSpriteVsTilemapLayer(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly)}else if(object1.isParent){if(object2.body)return this.collideSpriteVsGroup(object2,object1,collideCallback,processCallback,callbackContext,overlapOnly);if(object2.isParent)return this.collideGroupVsGroup(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly);if(object2.isTilemap)return this.collideGroupVsTilemapLayer(object1,object2,collideCallback,processCallback,callbackContext,overlapOnly)}else if(object1.isTilemap){if(object2.body)return this.collideSpriteVsTilemapLayer(object2,object1,collideCallback,processCallback,callbackContext,overlapOnly);if(object2.isParent)return this.collideGroupVsTilemapLayer(object2,object1,collideCallback,processCallback,callbackContext,overlapOnly)}},collideSpriteVsSprite:function(sprite1,sprite2,collideCallback,processCallback,callbackContext,overlapOnly){return!(!sprite1.body||!sprite2.body)&&(this.separate(sprite1.body,sprite2.body,processCallback,callbackContext,overlapOnly)&&
733(collideCallback&&collideCallback.call(callbackContext,sprite1,sprite2),this._total++),!0)},collideSpriteVsGroup:function(sprite,group,collideCallback,processCallback,callbackContext,overlapOnly){var i,len,bodyB,bodyA=sprite.body;if(0!==group.length&&bodyA&&bodyA.enable&&!bodyA.checkCollision.none)if(this.useTree||group.physicsType===CONST$m.STATIC_BODY){var minMax=this.treeMinMax;minMax.minX=bodyA.left,minMax.minY=bodyA.top,minMax.maxX=bodyA.right,minMax.maxY=bodyA.bottom;var results=group.physicsType===CONST$m.DYNAMIC_BODY?this.tree.search(minMax):this.staticTree.search(minMax);for(len=results.length,i=0;i<len;i++)bodyA!==(bodyB=results[i])&&bodyB.enable&&!bodyB.checkCollision.none&&group.contains(bodyB.gameObject)&&this.separate(bodyA,bodyB,processCallback,callbackContext,overlapOnly,!0)&&(collideCallback&&collideCallback.call(callbackContext,bodyA.gameObject,bodyB.gameObject),this._total++)}else{var children=group.getChildren(),skipIndex=group.children.entries.indexOf(sprite);for(len=children.length,i=0;i<len;i++)(bodyB=children[i].body)&&i!==skipIndex&&bodyB.enable&&this.separate(bodyA,bodyB,processCallback,callbackContext,overlapOnly)&&(collideCallback&&collideCallback.call(callbackContext,bodyA.gameObject,bodyB.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(group,tilemapLayer,collideCallback,processCallback,callbackContext,overlapOnly){var children=group.getChildren();if(0===children.length)return!1;for(var didCollide=!1,i=0;i<children.length;i++)children[i].body&&this.collideSpriteVsTilemapLayer(children[i],tilemapLayer,collideCallback,processCallback,callbackContext,overlapOnly)&&(didCollide=!0);return didCollide},collideTiles:function(sprite,tiles,collideCallback,processCallback,callbackContext){return!(!sprite.body.enable||0===tiles.length)&&this.collideSpriteVsTilesHandler(sprite,tiles,collideCallback,processCallback,callbackContext,!1,!1)},overlapTiles:function(sprite,tiles,collideCallback,processCallback,callbackContext){return!(!sprite.body.enable||0===tiles.length)&&this.collideSpriteVsTilesHandler(sprite,tiles,collideCallback,processCallback,callbackContext,!0,!1)},collideSpriteVsTilemapLayer:function(sprite,tilemapLayer,collideCallback,processCallback,callbackContext,overlapOnly){var body=sprite.body;if(!body.enable||body.checkCollision.none)return!1;var x=body.position.x,y=body.position.y,w=body.width,h=body.height,layerData=tilemapLayer.layer;if(layerData.tileWidth>layerData.baseTileWidth){var xDiff=(layerData.tileWidth-layerData.baseTileWidth)*tilemapLayer.scaleX;x-=xDiff,w+=xDiff}layerData.tileHeight>layerData.baseTileHeight&&(h+=(layerData.tileHeight-layerData.baseTileHeight)*tilemapLayer.scaleY);var mapData=GetTilesWithinWorldXY(x,y,w,h,null,tilemapLayer.scene.cameras.main,tilemapLayer.layer);return 0!==mapData.length&&this.collideSpriteVsTilesHandler(sprite,mapData,collideCallback,processCallback,callbackContext,overlapOnly,!0)},collideSpriteVsTilesHandler:function(sprite,tiles,collideCallback,processCallback,callbackContext,overlapOnly,isLayer){for(var tile,tilemapLayer,body=sprite.body,tileWorldRect={left:0,right:0,top:0,bottom:0},collision=!1,i=0;i<tiles.length;i++){var point=(tilemapLayer=(tile=tiles[i]).tilemapLayer).tileToWorldXY(tile.x,tile.y);tileWorldRect.left=point.x,tileWorldRect.top=point.y,tile.baseHeight!==tile.height&&(tileWorldRect.top-=(tile.height-tile.baseHeight)*tilemapLayer.scaleY),tileWorldRect.right=tileWorldRect.left+tile.width*tilemapLayer.scaleX,tileWorldRect.bottom=tileWorldRect.top+tile.height*tilemapLayer.scaleY,TileIntersectsBody(tileWorldRect,body)&&(!processCallback||processCallback.call(callbackContext,sprite,tile))&&ProcessTileCallbacks(tile,sprite)&&(overlapOnly||SeparateTile(i,body,tile,tileWorldRect,tilemapLayer,this.TILE_BIAS,isLayer))&&(this._total++,collision=!0,collideCallback&&collideCallback.call(callbackContext,sprite,tile),overlapOnly&&body.onOverlap?this.emit(Events$a.TILE_OVERLAP,sprite,tile,body):body.onCollide&&this.emit(Events$a.TILE_COLLIDE,sprite,tile,body))}return collision},collideGroupVsGroup:function(group1,group2,collideCallback,processCallback,callbackContext,overlapOnly){if(0!==group1.length&&0!==group2.length)for(var children=group1.getChildren(),i=0;i<children.length;i++)this.collideSpriteVsGroup(children[i],group2,collideCallback,processCallback,callbackContext,overlapOnly)},wrap:function(object,padding){object.body?this.wrapObject(object,padding):object.getChildren?this.wrapArray(object.getChildren(),padding):Array.isArray(object)?this.wrapArray(object,padding):this.wrapObject(object,padding)},wrapArray:function(objects,padding){for(var i=0;i<objects.length;i++)this.wrapObject(objects[i],padding)},wrapObject:function(object,padding){void 0===padding&&(padding=0),object.x=Wrap(object.x,this.bounds.left-padding,this.bounds.right+padding),object.y=Wrap(object.y,this.bounds.top-padding,this.bounds.bottom+padding)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null}}),World_1$2=World$5,DegToRad$1=DegToRad_1,DistanceBetween$1=DistanceBetween_1,DistanceSquared=DistanceSquared_1,Factory$2=Factory_1$1,GetFastValue$j=GetFastValue_1,Merge$2=Merge_1,OverlapCirc=OverlapCirc_1,OverlapRect=OverlapRect_1,PluginCache$4=PluginCache_
vendor: 12,605 bytes, lines 733-743
7331,SceneEvents$4=events$g,Vector2$k=Vector2_1,World$4=World_1$2,ArcadePhysics=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.config=this.getConfig(),this.world,this.add,scene.sys.events.once(SceneEvents$4.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$4.START,this.start,this)},boot:function(){this.world=new World$4(this.scene,this.config),this.add=new Factory$2(this.world),this.systems.events.once(SceneEvents$4.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new World$4(this.scene,this.config),this.add=new Factory$2(this.world));var eventEmitter=this.systems.events;GetFastValue$j(this.config,"customUpdate",!1)||eventEmitter.on(SceneEvents$4.UPDATE,this.world.update,this.world),eventEmitter.on(SceneEvents$4.POST_UPDATE,this.world.postUpdate,this.world),eventEmitter.once(SceneEvents$4.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(SceneEvents$4.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(SceneEvents$4.UPDATE,this.world.update,this.world)},getConfig:function(){var gameConfig=this.systems.game.config.physics,sceneConfig=this.systems.settings.physics;return Merge$2(GetFastValue$j(sceneConfig,"arcade",{}),GetFastValue$j(gameConfig,"arcade",{}))},overlap:function(object1,object2,overlapCallback,processCallback,callbackContext){return void 0===overlapCallback&&(overlapCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=overlapCallback),this.world.collideObjects(object1,object2,overlapCallback,processCallback,callbackContext,!0)},collide:function(object1,object2,collideCallback,processCallback,callbackContext){return void 0===collideCallback&&(collideCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=collideCallback),this.world.collideObjects(object1,object2,collideCallback,processCallback,callbackContext,!1)},collideTiles:function(sprite,tiles,collideCallback,processCallback,callbackContext){return this.world.collideTiles(sprite,tiles,collideCallback,processCallback,callbackContext)},overlapTiles:function(sprite,tiles,collideCallback,processCallback,callbackContext){return this.world.overlapTiles(sprite,tiles,collideCallback,processCallback,callbackContext)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(gameObject,x,y,speed,xSpeedMax,ySpeedMax){void 0===speed&&(speed=60);var angle=Math.atan2(y-gameObject.y,x-gameObject.x);return gameObject.body.acceleration.setToPolar(angle,speed),void 0!==xSpeedMax&&void 0!==ySpeedMax&&gameObject.body.maxVelocity.set(xSpeedMax,ySpeedMax),angle},accelerateToObject:function(gameObject,destination,speed,xSpeedMax,ySpeedMax){return this.accelerateTo(gameObject,destination.x,destination.y,speed,xSpeedMax,ySpeedMax)},closest:function(source,targets){targets||(targets=this.world.bodies.entries);for(var min=Number.MAX_VALUE,closest=null,x=source.x,y=source.y,len=targets.length,i=0;i<len;i++){var target=targets[i],body=target.body||target;if(source!==target&&source!==body&&source!==body.gameObject&&source!==body.center){var distance=DistanceSquared(x,y,body.center.x,body.center.y);distance<min&&(closest=target,min=distance)}}return closest},furthest:function(source,targets){targets||(targets=this.world.bodies.entries);for(var max=-1,farthest=null,x=source.x,y=source.y,len=targets.length,i=0;i<len;i++){var target=targets[i],body=target.body||target;if(source!==target&&source!==body&&source!==body.gameObject&&source!==body.center){var distance=DistanceSquared(x,y,body.center.x,body.center.y);distance>max&&(farthest=target,max=distance)}}return farthest},moveTo:function(gameObject,x,y,speed,maxTime){void 0===speed&&(speed=60),void 0===maxTime&&(maxTime=0);var angle=Math.atan2(y-gameObject.y,x-gameObject.x);return maxTime>0&&(speed=DistanceBetween$1(gameObject.x,gameObject.y,x,y)/(maxTime/1e3)),gameObject.body.velocity.setToPolar(angle,speed),angle},moveToObject:function(gameObject,destination,speed,maxTime){return this.moveTo(gameObject,destination.x,destination.y,speed,maxTime)},velocityFromAngle:function(angle,speed,vec2){return void 0===speed&&(speed=60),void 0===vec2&&(vec2=new Vector2$k),vec2.setToPolar(DegToRad$1(angle),speed)},velocityFromRotation:function(rotation,speed,vec2){return void 0===speed&&(speed=60),void 0===vec2&&(vec2=new Vector2$k),vec2.setToPolar(rotation,speed)},overlapRect:function(x,y,width,height,includeDynamic,includeStatic){return OverlapRect(this.world,x,y,width,height,includeDynamic,includeStatic)},overlapCirc:function(x,y,radius,includeDynamic,includeStatic){return OverlapCirc(this.world,x,y,radius,includeDynamic,includeStatic)},shutdown:function(){if(this.world){var eventEmitter=this.systems.events;eventEmitter.off(SceneEvents$4.UPDATE,this.world.update,this.world),eventEmitter.off(SceneEvents$4.POST_UPDATE,this.world.postUpdate,this.world),eventEmitter.off(SceneEvents$4.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(SceneEvents$4.START,this.start,this),this.scene=null,this.systems=null}});
734/**
735	 * @author       Richard Davey <[email protected]>
736	 * @copyright    2020 Photon Storm Ltd.
737	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
738	 */PluginCache$4.register("ArcadePhysics",ArcadePhysics,"arcadePhysics");var Arcade={ArcadePhysics:ArcadePhysics,Body:Body_1$1,Collider:Collider_1,Components:components$2,Events:events$2,Factory:Factory_1$1,GetOverlapX:GetOverlapX_1,GetOverlapY:GetOverlapY_1,SeparateX:SeparateX_1,SeparateY:SeparateY_1,Group:PhysicsGroup_1,Image:ArcadeImage_1,Sprite:ArcadeSprite_1,StaticBody:StaticBody_1,StaticGroup:StaticPhysicsGroup_1,Tilemap:{ProcessTileCallbacks:ProcessTileCallbacks_1,ProcessTileSeparationX:ProcessTileSeparationX_1,ProcessTileSeparationY:ProcessTileSeparationY_1,SeparateTile:SeparateTile_1,TileCheckX:TileCheckX_1,TileCheckY:TileCheckY_1,TileIntersectsBody:TileIntersectsBody_1},World:World_1$2},arcade=Arcade=Extend_1$1(!1,Arcade,_const$2),Vector2$j=Vector2_1,BodyBounds_1=new Class_1({initialize:function(){this.boundsCenter=new Vector2$j,this.centerDiff=new Vector2$j},parseBody:function(body){if(!(body=body.hasOwnProperty("body")?body.body:body).hasOwnProperty("bounds")||!body.hasOwnProperty("centerOfMass"))return!1;var boundsCenter=this.boundsCenter,centerDiff=this.centerDiff,boundsWidth=body.bounds.max.x-body.bounds.min.x,boundsHeight=body.bounds.max.y-body.bounds.min.y,bodyCenterX=boundsWidth*body.centerOfMass.x,bodyCenterY=boundsHeight*body.centerOfMass.y;return boundsCenter.set(boundsWidth/2,boundsHeight/2),centerDiff.set(bodyCenterX-boundsCenter.x,bodyCenterY-boundsCenter.y),!0},getTopLeft:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x+center.x+diff.x,y+center.y+diff.y)}return!1},getTopCenter:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x+diff.x,y+center.y+diff.y)}return!1},getTopRight:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x-(center.x-diff.x),y+center.y+diff.y)}return!1},getLeftCenter:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x+center.x+diff.x,y+diff.y)}return!1},getCenter:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var diff=this.centerDiff;return new Vector2$j(x+diff.x,y+diff.y)}return!1},getRightCenter:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x-(center.x-diff.x),y+diff.y)}return!1},getBottomLeft:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x+center.x+diff.x,y-(center.y-diff.y))}return!1},getBottomCenter:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x+diff.x,y-(center.y-diff.y))}return!1},getBottomRight:function(body,x,y){if(void 0===x&&(x=0),void 0===y&&(y=0),this.parseBody(body)){var center=this.boundsCenter,diff=this.centerDiff;return new Vector2$j(x-(center.x-diff.x),y-(center.y-diff.y))}return!1}}),Bounce_1={setBounce:function(value){return this.body.restitution=value,this}},Collision={setCollisionCategory:function(value){return this.body.collisionFilter.category=value,this},setCollisionGroup:function(value){return this.body.collisionFilter.group=value,this},setCollidesWith:function(categories){var flags=0;if(Array.isArray(categories))for(var i=0;i<categories.length;i++)flags|=categories[i];else flags=categories;return this.body.collisionFilter.mask=flags,this},setOnCollide:function(callback){return this.body.onCollideCallback=callback,this},setOnCollideEnd:function(callback){return this.body.onCollideEndCallback=callback,this},setOnCollideActive:function(callback){return this.body.onCollideActiveCallback=callback,this},setOnCollideWith:function(body,callback){Array.isArray(body)||(body=[body]);for(var i=0;i<body.length;i++){var src=body[i].hasOwnProperty("body")?body[i].body:body[i];this.body.setOnCollideWith(src,callback)}return this}},Collision_1=Collision,Vector$a={},Vector_1=Vector$a;
739/**
740	 * @author       Richard Davey <[email protected]>
741	 * @copyright    2020 Photon Storm Ltd.
742	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
743	 */Vector$a.create=function(x,y){return{x:x||0,y:y||0}},Vector$a.clone=function(vector){return{x:vector.x,y:vector.y}},Vector$a.magnitude=function(vector){return Math.sqrt(vector.x*vector.x+vector.y*vector.y)},Vector$a.magnitudeSquared=function(vector){return vector.x*vector.x+vector.y*vector.y},Vector$a.rotate=function(vector,angle,output){var cos=Math.cos(angle),sin=Math.sin(angle);output||(output={});var x=vector.x*cos-vector.y*sin;return output.y=vector.x*sin+vector.y*cos,output.x=x,output},Vector$a.rotateAbout=function(vector,angle,point,output){var cos=Math.cos(angle),sin=Math.sin(angle);output||(output={});var x=point.x+((vector.x-point.x)*cos-(vector.y-point.y)*sin);return output.y=point.y+((vector.x-point.x)*sin+(vector.y-point.y)*cos),output.x=x,output},Vector$a.normalise=function(vector){var magnitude=Vector$a.magnitude(vector);return 0===magnitude?{x:0,y:0}:{x:vector.x/magnitude,y:vector.y/magnitude}},Vector$a.dot=function(vectorA,vectorB){return vectorA.x*vectorB.x+vectorA.y*vectorB.y},Vector$a.cross=function(vectorA,vectorB){return vectorA.x*vectorB.y-vectorA.y*vectorB.x},Vector$a.cross3=function(vectorA,vectorB,vectorC){return(vectorB.x-vectorA.x)*(vectorC.y-vectorA.y)-(vectorB.y-vectorA.y)*(vectorC.x-vectorA.x)},Vector$a.add=function(vectorA,vectorB,output){return output||(output={}),output.x=vectorA.x+vectorB.x,output.y=vectorA.y+vectorB.y,output},Vector$a.sub=function(vectorA,vectorB,output){return output||(output={}),output.x=vectorA.x-vectorB.x,output.y=vectorA.y-vectorB.y,output},Vector$a.mult=function(vector,scalar){return{x:vector.x*scalar,y:vector.y*scalar}},Vector$a.div=function(vector,scalar){return{x:vector.x/scalar,y:vector.y/scalar}},Vector$a.perp=function(vector,negate){return{x:(negate=!0===negate?-1:1)*-vector.y,y:negate*vector.x}},Vector$a.neg=function(vector){return{x:-vector.x,y:-vector.y}},Vector$a.angle=function(vectorA,vectorB){return Math.atan2(vectorB.y-vectorA.y,vectorB.x-vectorA.x)},Vector$a._temp=[Vector$a.create(),Vector$a.create(),Vector$a.create(),Vector$a.create(),Vector$a.create(),Vector$a.create()];var Common$j={},Common_1=Common$j;!function(){Common$j._nextId=0,Common$j._seed=0,Common$j._nowStartTime=+new Date,Common$j.extend=function(obj,deep){var argsStart,deepClone;"boolean"==typeof deep?(argsStart=2,deepClone=deep):(argsStart=1,deepClone=!0);for(var i=argsStart;i<arguments.length;i++){var source=arguments[i];if(source)for(var prop in source)deepClone&&source[prop]&&source[prop].constructor===Object?obj[prop]&&obj[prop].constructor!==Object?obj[prop]=source[prop]:(obj[prop]=obj[prop]||{},Common$j.extend(obj[prop],deepClone,source[prop])):obj[prop]=source[prop]}return obj},Common$j.clone=function(obj,deep){return Common$j.extend({},deep,obj)}
vendor: 5,039 bytes, line 743
743,Common$j.keys=function(obj){if(Object.keys)return Object.keys(obj);var keys=[];for(var key in obj)keys.push(key);return keys},Common$j.values=function(obj){var values=[];if(Object.keys){for(var keys=Object.keys(obj),i=0;i<keys.length;i++)values.push(obj[keys[i]]);return values}for(var key in obj)values.push(obj[key]);return values},Common$j.get=function(obj,path,begin,end){path=path.split(".").slice(begin,end);for(var i=0;i<path.length;i+=1)obj=obj[path[i]];return obj},Common$j.set=function(obj,path,val,begin,end){var parts=path.split(".").slice(begin,end);return Common$j.get(obj,path,0,-1)[parts[parts.length-1]]=val,val},Common$j.shuffle=function(array){for(var i=array.length-1;i>0;i--){var j=Math.floor(Common$j.random()*(i+1)),temp=array[i];array[i]=array[j],array[j]=temp}return array},Common$j.choose=function(choices){return choices[Math.floor(Common$j.random()*choices.length)]},Common$j.isElement=function(obj){return"undefined"!=typeof HTMLElement?obj instanceof HTMLElement:!!(obj&&obj.nodeType&&obj.nodeName)},Common$j.isArray=function(obj){return"[object Array]"===Object.prototype.toString.call(obj)},Common$j.isFunction=function(obj){return"function"==typeof obj},Common$j.isPlainObject=function(obj){return"object"==typeof obj&&obj.constructor===Object},Common$j.isString=function(obj){return"[object String]"===Object.prototype.toString.call(obj)},Common$j.clamp=function(value,min,max){return value<min?min:value>max?max:value},Common$j.sign=function(value){return value<0?-1:1},Common$j.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-Common$j._nowStartTime},Common$j.random=function(min,max){return max=void 0!==max?max:1,(min=void 0!==min?min:0)+_seededRandom()*(max-min)};var _seededRandom=function(){return Common$j._seed=(9301*Common$j._seed+49297)%233280,Common$j._seed/233280};Common$j.colorToNumber=function(colorString){return 3==(colorString=colorString.replace("#","")).length&&(colorString=colorString.charAt(0)+colorString.charAt(0)+colorString.charAt(1)+colorString.charAt(1)+colorString.charAt(2)+colorString.charAt(2)),parseInt(colorString,16)},Common$j.logLevel=1,Common$j.log=function(){console&&Common$j.logLevel>0&&Common$j.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},Common$j.info=function(){console&&Common$j.logLevel>0&&Common$j.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},Common$j.warn=function(){console&&Common$j.logLevel>0&&Common$j.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},Common$j.nextId=function(){return Common$j._nextId++},Common$j.indexOf=function(haystack,needle){if(haystack.indexOf)return haystack.indexOf(needle);for(var i=0;i<haystack.length;i++)if(haystack[i]===needle)return i;return-1},Common$j.map=function(list,func){if(list.map)return list.map(func);for(var mapped=[],i=0;i<list.length;i+=1)mapped.push(func(list[i]));return mapped},Common$j.topologicalSort=function(graph){var result=[],visited=[],temp=[];for(var node in graph)visited[node]||temp[node]||Common$j._topologicalSort(node,visited,temp,graph,result);return result},Common$j._topologicalSort=function(node,visited,temp,graph,result){var neighbors=graph[node]||[];temp[node]=!0;for(var i=0;i<neighbors.length;i+=1){var neighbor=neighbors[i];temp[neighbor]||(visited[neighbor]||Common$j._topologicalSort(neighbor,visited,temp,graph,result))}temp[node]=!1,visited[node]=!0,result.push(node)},Common$j.chain=function(){for(var funcs=[],i=0;i<arguments.length;i+=1){var func=arguments[i];func._chained?funcs.push.apply(funcs,func._chained):funcs.push(func)}var chain=function(){for(var lastResult,args=new Array(arguments.length),i=0,l=arguments.length;i<l;i++)args[i]=arguments[i];for(i=0;i<funcs.length;i+=1){var result=funcs[i].apply(lastResult,args);void 0!==result&&(lastResult=result)}return lastResult};return chain._chained=funcs,chain},Common$j.chainPathBefore=function(base,path,func){return Common$j.set(base,path,Common$j.chain(func,Common$j.get(base,path)))},Common$j.chainPathAfter=function(base,path,func){return Common$j.set(base,path,Common$j.chain(Common$j.get(base,path),func))}}();var Vertices$c={},Vertices_1=Vertices$c,Vector$9=Vector_1,Common$i=Common_1;Vertices$c.create=function(points,body){for(var vertices=[],i=0;i<points.length;i++){var point=points[i],vertex={x:point.x,y:point.y,index:i,body:body,isInternal:!1,contact:null,offset:null};vertex.contact={vertex:vertex,normalImpulse:0,tangentImpulse:0},vertices.push(vertex)}return vertices},Vertices$c.fromPath=function(path,body){var points=[];return path.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,(function(match,x,y){points.push({x:parseFloat(x),y:parseFloat(y)})})),Vertices$c.create(points,body)},Vertices$c.centre=function(vertices){for(var cross,temp,j,area=Vertices$c.area(vert
743ices,!0),centre={x:0,y:0},i=0;i<vertices.length;i++)j=(i+1)%vertices.length,cross=Vector$9.cross(vertices[i],vertices[j]),temp=Vector$9.mult(Vector$9.add(vertices[i],vertices[j]),cross),centre=Vector$9.add(centre,temp);return Vector$9.div(centre,6*area)},Vertices$c.mean=function(vertices){for(var average={x:0,y:0},i=0;i<vertices.length;i++)average.x+=vertices[i].x,average.y+=vertices[i].y;return Vector$9.div(average,vertices.length)},Vertices$c.area=function(vertices,signed){for(var area=0,j=vertices.length-1,i=0;i<vertices.length;i++)area+=(vertices[j].x-vertices[i].x)*(vertices[j].y+vertices[i].y),j=i;return signed?area/2:Math.abs(area)/2},Vertices$c.inertia=function(vertices,mass){for(var cross,j,numerator=0,denominator=0,v=vertices,n=0;n<v.length;n++)j=(n+1)%v.length,numerator+=(cross=Math.abs(Vector$9.cross(v[j],v[n])))*(Vector$9.dot(v[j],v[j])+Vector$9.dot(v[j],v[n])+Vector$9.dot(v[n],v[n])),denominator+=cross;return mass/6*(numerator/denominator)},Vertices$c.translate=function(vertices,vector,scalar){var i;if(scalar)for(i=0;i<vertices.length;i++)vertices[i].x+=vector.x*scalar,vertices[i].y+=vector.y*scalar;else for(i=0;i<vertices.length;i++)vertices[i].x+=vector.x,vertices[i].y+=vector.y;return vertices},Vertices$c.rotate=function(vertices,angle,point){if(0!==angle){for(var cos=Math.cos(angle),sin=Math.sin(angle),i=0;i<vertices.length;i++){var vertice=vertices[i],dx=vertice.x-point.x,dy=vertice.y-point.y;vertice.x=point.x+(dx*cos-dy*sin),vertice.y=point.y+(dx*sin+dy*cos)}return vertices}},Vertices$c.contains=function(vertices,point){for(var i=0;i<vertices.length;i++){var vertice=vertices[i],nextVertice=vertices[(i+1)%vertices.length];if((point.x-vertice.x)*(nextVertice.y-vertice.y)+(point.y-vertice.y)*(vertice.x-nextVertice.x)>0)return!1}return!0},Vertices$c.scale=function(vertices,scaleX,scaleY,point){if(1===scaleX&&1===scaleY)return vertices;var vertex,delta;point=point||Vertices$c.centre(vertices);for(var i=0;i<vertices.length;i++)vertex=vertices[i],delta=Vector$9.sub(vertex,point),vertices[i].x=point.x+delta.x*scaleX,vertices[i].y=point.y+delta.y*scaleY;return vertices},Vertices$c.chamfer=function(vertices,radius,quality,qualityMin,qualityMax){radius="number"==typeof radius?[radius]:radius||[8],quality=void 0!==quality?quality:-1,qualityMin=qualityMin||2,qualityMax=qualityMax||14;for(var newVertices=[],i=0;i<vertices.length;i++){var prevVertex=vertices[i-1>=0?i-1:vertices.length-1],vertex=vertices[i],nextVertex=vertices[(i+1)%vertices.length],currentRadius=radius[i<radius.length?i:radius.length-1];if(0!==currentRadius){var prevNormal=Vector$9.normalise({x:vertex.y-prevVertex.y,y:prevVertex.x-vertex.x}),nextNormal=Vector$9.normalise({x:nextVertex.y-vertex.y,y:vertex.x-nextVertex.x}),diagonalRadius=Math.sqrt(2*Math.pow(currentRadius,2)),radiusVector=Vector$9.mult(Common$i.clone(prevNormal),currentRadius),midNormal=Vector$9.normalise(Vector$9.mult(Vector$9.add(prevNormal,nextNormal),.5)),scaledVertex=Vector$9.sub(vertex,Vector$9.mult(midNormal,diagonalRadius)),precision=quality;-1===quality&&(precision=1.75*Math.pow(currentRadius,.32)),(precision=Common$i.clamp(precision,qualityMin,qualityMax))%2==1&&(precision+=1);for(var theta=Math.acos(Vector$9.dot(prevNormal,nextNormal))/precision,j=0;j<precision;j++)newVertices.push(Vector$9.add(Vector$9.rotate(radiusVector,theta*j),scaledVertex))}else newVertices.push(vertex)}return newVertices},Vertices$c.clockwiseSort=function(vertices){var centre=Vertices$c.mean(vertices);return vertices.sort((function(vertexA,vertexB){return Vector$9.angle(centre,vertexA)-Vector$9.angle(centre,vertexB)})),vertices},Vertices$c.isConvex=function(vertices){var i,j,k,z,flag=0,n=vertices.length;if(n<3)return null;for(i=0;i<n;i++)if(k=(i+2)%n,z=(vertices[j=(i+1)%n].x-vertices[i].x)*(vertices[k].y-vertices[j].y),(z-=(vertices[j].y-vertices[i].y)*(vertices[k].x-vertices[j].x))<0?flag|=1:z>0&&(flag|=2),3===flag)return!1;return 0!==flag||null},Vertices$c.hull=function(vertices){var vertex,i,upper=[],lower=[];for((vertices=vertices.slice(0)).sort((function(vertexA,vertexB){var dx=vertexA.x-vertexB.x;return 0!==dx?dx:vertexA.y-vertexB.y})),i=0;i<vertices.length;i+=1){for(vertex=vertices[i];lower.length>=2&&Vector$9.cross3(lower[lower.length-2],lower[lower.length-1],vertex)<=0;)lower.pop();lower.push(vertex)}for(i=vertices.length-1;i>=0;i-=1){for(vertex=vertices[i];upper.length>=2&&Vector$9.cross3(upper[upper.length-2],upper[upper.length-1],vertex)<=0;)upper.pop();upper.push(vertex)}return upper.pop(),lower.pop(),upper.concat(lower)};var Events$9={},Events_1=Events$9,Common$h=Common_1;Events$9.on=function(object,eventNames,callback){for(var name,names=eventNames.split(" "),i=0;i<names.length;i++)name=names[i],object.events=object.events||{},object.events[name]=object.events[name]||[],object.events[name].push(callback);return callback},Events$9.off=function(object,eventNames,callback){if(eventNames){"function"==typeof eventNames&&(callback=eventNames,eventNames=Common$h.keys(object.events).join(" "));for(var names=eventNames.split(" "),i=0;i<names.length;i++){var callbacks=object.events[names[i]],newCallbacks=[];if(callback&&callbacks)for(var j=0;j<callbacks.length;j++)callbacks[j]!==callback&&newCallbacks.push(callbacks[j]);object.events[names[i]]=newCallbacks}}else object.events={}},Events$9.trigger=function(object,eventNames,event){var names,name,callbacks,eventClone,events=object.events;if(events&&Common$h.keys(events).length>0){event||(event={}),names=eventNames.split(" ");for(var i=0;i<names.length;i++)if(callbacks=events[name=names[i]]){(eventClone=Common$h.clone(event,!1)).name=name,eventClone.source=object;for(var j=0;j<callbacks.length;j++)callbacks[j].apply(object,[eventClone])}}};var Sleeping$5={},Sleeping_1=Sleeping$5,Events$8=Events_1;Sleeping$5._motionWakeThreshold=.18,Sleeping$5._motionSleepThreshold=.08,Sleeping$5._minBias=.9,Sleeping$5.update=function(bodies,timeScale){for(var timeFactor=timeScale*timeScale*timeScale,i=0;i<bodies.length;i++){var body=bodies[i],motion=body.speed*body.speed+body.angularSpeed*body.angularSpeed;if(0===body.force.x&&0===body.force.y){var minMotion=Math.min(body.motion,motion),maxMotion=Math.max(body.motion,motion);body.motion=Sleeping$5._minBias*minMotion+(1-Sleeping$5._minBias)*maxMotion,body.sleepThreshold>0&&body.motion<Sleeping$5._motionSleepThreshold*timeFactor?(body.sleepCounter+=1,body.sleepCounter>=body.sleepThreshold&&Sleeping$5.set(body,!0)):body.sleepCounter>0&&(body.sleepCounter-=1)}else Sleeping$5.set(body,!1)}},Sleeping$5.afterCollisions=function(pairs,timeScale){for(var timeFactor=timeScale*timeScale*timeScale,i=0;i<pairs.length;i++){var pair=pairs[i];if(pair.isActive){var collision=pair.collision,bodyA=collision.bodyA.parent,bodyB=collision.bodyB.parent;if(!(bodyA.isSleeping&&bodyB.isSleeping||bodyA.isStatic||bodyB.isStatic)&&(bodyA.isSleeping||bodyB.isSleeping)){var sleepingBody=bodyA.isSleeping&&!bodyA.isStatic?bodyA:bodyB,movingBody=sleepingBody===bodyA?bodyB:bodyA;!sleepingBody.isStatic&&movingBody.motion>Sleeping$5._motionWakeThreshold*timeFactor&&Sleeping$5.set(sleepingBody,!1)}}}},Sleeping$5.set=function(body,isSleeping){var wasSleeping=body.isSleeping;isSleeping?(body.isSleeping=!0,body.sleepCounter=body.sleepThreshold,body.positionImpulse.x=0,body.positionImpulse.y=0,body.positionPrev.x=body.position.x,body.positionPrev.y=body.position.y,body.anglePrev=body.angle,body.speed=0,body.angularSpeed=0,body.motion=0,wasSleeping||Events$8.trigger(body,"sleepStart")):(body.isSleeping=!1,body.sleepCounter=0,wasSleeping&&Events$8.trigger(body,"sleepEnd"))};var Bounds$9={},Bounds_1=Bounds$9;Bounds$9.create=function(vertices){var bounds={min:{x:0,y:0},max:{x:0,y:0}};return vertices&&Bounds$9.update(bounds,vertices),bounds}
vendor: 11,912 bytes, line 743
743,Bounds$9.update=function(bounds,vertices,velocity){bounds.min.x=1/0,bounds.max.x=-1/0,bounds.min.y=1/0,bounds.max.y=-1/0;for(var i=0;i<vertices.length;i++){var vertex=vertices[i];vertex.x>bounds.max.x&&(bounds.max.x=vertex.x),vertex.x<bounds.min.x&&(bounds.min.x=vertex.x),vertex.y>bounds.max.y&&(bounds.max.y=vertex.y),vertex.y<bounds.min.y&&(bounds.min.y=vertex.y)}velocity&&(velocity.x>0?bounds.max.x+=velocity.x:bounds.min.x+=velocity.x,velocity.y>0?bounds.max.y+=velocity.y:bounds.min.y+=velocity.y)},Bounds$9.contains=function(bounds,point){return point.x>=bounds.min.x&&point.x<=bounds.max.x&&point.y>=bounds.min.y&&point.y<=bounds.max.y},Bounds$9.overlaps=function(boundsA,boundsB){return boundsA.min.x<=boundsB.max.x&&boundsA.max.x>=boundsB.min.x&&boundsA.max.y>=boundsB.min.y&&boundsA.min.y<=boundsB.max.y},Bounds$9.translate=function(bounds,vector){bounds.min.x+=vector.x,bounds.max.x+=vector.x,bounds.min.y+=vector.y,bounds.max.y+=vector.y},Bounds$9.shift=function(bounds,position){var deltaX=bounds.max.x-bounds.min.x,deltaY=bounds.max.y-bounds.min.y;bounds.min.x=position.x,bounds.max.x=position.x+deltaX,bounds.min.y=position.y,bounds.max.y=position.y+deltaY};var Axes$3={},Axes_1=Axes$3,Vector$8=Vector_1,Common$g=Common_1;Axes$3.fromVertices=function(vertices){for(var axes={},i=0;i<vertices.length;i++){var j=(i+1)%vertices.length,normal=Vector$8.normalise({x:vertices[j].y-vertices[i].y,y:vertices[i].x-vertices[j].x}),gradient=0===normal.y?1/0:normal.x/normal.y;axes[gradient=gradient.toFixed(3).toString()]=normal}return Common$g.values(axes)},Axes$3.rotate=function(axes,angle){if(0!==angle)for(var cos=Math.cos(angle),sin=Math.sin(angle),i=0;i<axes.length;i++){var xx,axis=axes[i];xx=axis.x*cos-axis.y*sin,axis.y=axis.x*sin+axis.y*cos,axis.x=xx}};var Body$f={},Body_1=Body$f,Vertices$b=Vertices_1,Vector$7=Vector_1,Sleeping$4=Sleeping_1,Common$f=Common_1,Bounds$8=Bounds_1,Axes$2=Axes_1;!function(){Body$f._inertiaScale=4,Body$f._nextCollidingGroupId=1,Body$f._nextNonCollidingGroupId=-1,Body$f._nextCategory=1,Body$f.create=function(options){var defaults={id:Common$f.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!options.hasOwnProperty("position")&&options.hasOwnProperty("vertices")?options.position=Vertices$b.centre(options.vertices):options.hasOwnProperty("vertices")||(defaults.vertices=Vertices$b.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var body=Common$f.extend(defaults,options);return _initProperties(body,options),body.setOnCollideWith=function(body,callback){return callback?this.onCollideWith[body.id]=callback:delete this.onCollideWith[body.id],this},body},Body$f.nextGroup=function(isNonColliding){return isNonColliding?Body$f._nextNonCollidingGroupId--:Body$f._nextCollidingGroupId++},Body$f.nextCategory=function(){return Body$f._nextCategory=Body$f._nextCategory<<1,Body$f._nextCategory};var _initProperties=function(body,options){options=options||{},Body$f.set(body,{bounds:body.bounds||Bounds$8.create(body.vertices),positionPrev:body.positionPrev||Vector$7.clone(body.position),anglePrev:body.anglePrev||body.angle,vertices:body.vertices,parts:body.parts||[body],isStatic:body.isStatic,isSleeping:body.isSleeping,parent:body.parent||body});var bounds=body.bounds;if(Vertices$b.rotate(body.vertices,body.angle,body.position),Axes$2.rotate(body.axes,body.angle),Bounds$8.update(bounds,body.vertices,body.velocity),Body$f.set(body,{axes:options.axes||body.axes,area:options.area||body.area,mass:options.mass||body.mass,inertia:options.inertia||body.inertia}),1===body.parts.length){var centerOfMass=body.centerOfMass,centerOffset=body.centerOffset,bodyWidth=bounds.max.x-bounds.min.x,bodyHeight=bounds.max.y-bounds.min.y;centerOfMass.x=-(bounds.min.x-body.position.x)/bodyWidth,centerOfMass.y=-(bounds.min.y-body.position.y)/bodyHeight,centerOffset.x=bodyWidth*centerOfMass.x,centerOffset.y=bodyHeight*centerOfMass.y}};Body$f.set=function(body,settings,value){var property;for(property in"string"==typeof settings&&(property=settings,(settings={})[property]=value),settings)if(Object.prototype.hasOwnProperty.call(settings,property))switch(value=settings[property],property){case"isStatic":Body$f.setStatic(body,value);break;case"isSleeping":Sleeping$4.set(body,value);break;case"mass":Body$f.setMass(body,value);break;case"density":Body$f.setDensity(body,value);break;case"inertia":Body$f.setInertia(body,value);break;case"vertices":Body$f.setVertices(body,value);break;case"position":Body$f.setPosition(body,value);break;case"angle":Body$f.setAngle(body,value);break;case"velocity":Body$f.setVelocity(body,value);break;case"angularVelocity":Body$f.setAngularVelocity(body,value);break;case"parts":Body$f.setParts(body,value);break;case"centre":Body$f.setCentre(body,value);break;default:body[property]=value}},Body$f.setStatic=function(body,isStatic){for(var i=0;i<body.parts.length;i++){var part=body.parts[i];part.isStatic=isStatic,isStatic?(part._original={restitution:part.restitution,friction:part.friction,mass:part.mass,inertia:part.inertia,density:part.density,inverseMass:part.inverseMass,inverseInertia:part.inverseInertia},part.restitution=0,part.friction=1,part.mass=part.inertia=part.density=1/0,part.inverseMass=part.inverseInertia=0,part.positionPrev.x=part.position.x,part.positionPrev.y=part.position.y,part.anglePrev=part.angle,part.angularVelocity=0,part.speed=0,part.angularSpeed=0,part.motion=0):part._original&&(part.restitution=part._original.restitution,part.friction=part._original.friction,part.mass=part._original.mass,part.inertia=part._original.inertia,part.density=part._original.density,part.inverseMass=part._original.inverseMass,part.inverseInertia=part._original.inverseInertia,part._original=null)}},Body$f.setMass=function(body,mass){var moment=body.inertia/(body.mass/6);body.inertia=moment*(mass/6),body.inverseInertia=1/body.inertia,body.mass=mass,body.inverseMass=1/body.mass,body.density=body.mass/body.area},Body$f.setDensity=function(body,density){Body$f.setMass(body,density*body.area),body.density=density},Body$f.setInertia=function(body,inertia){body.inertia=inertia,body.inverseInertia=1/body.inertia},Body$f.setVertices=function(body,vertices){vertices[0].body===body?body.vertices=vertices:body.vertices=Vertices$b.create(vertices,body),body.axes=Axes$2.fromVertices(body.vertices),body.area=Vertices$b.area(body.vertices),Body$f.setMass(body,body.density*body.area);var centre=Vertices$b.centre(body.vertices);Vertices$b.translate(body.vertices,centre,-1),Body$f.setInertia(body,Body$f._inertiaScale*Vertices$b.inertia(body.vertices,body.mass)),Vertices$b.translate(body.vertices,body.position),Bounds$8.update(body.bounds,body.vertices,body.velocity)},Body$f.setParts=function(body,parts,autoHull){var i;for(parts=parts.slice(0),body.parts.length=0,body.parts.push(body),body.parent=body,i=0;i<parts.length;i++){var part=parts[i];part!==body&&(part.parent=body,body.parts.push(part))}if(1!==body.parts.length){if(autoHull=void 0===autoHull||autoHull){var vertices=[];for(i=0;i<parts.length;i++)vertices=vertices.concat(parts[i].vertices);Vertices$b.clockwiseSort(vertices);var hull=Vertices$b.hull(vertices),hullCentre=Vertices$b.centre(hull);Body$f.setVertices(body,hull),Vertices$b.translate(body.vertices,hullCentre)}var total=Body$f._totalProperties(body),cx=total.centre.x,cy=total.centre.y,bounds=body.bounds,centerOfMass=body.centerOfMass,centerOffset=body.centerOffset;Bounds$8.update(bounds,body.vertices,body.velocity),centerOfMass.x=-(bounds.min.x-cx)/(bounds.max.x-bounds.min.x),centerOfMass.y=-(bounds.min.y-cy)/(bounds.max.y-bounds.min.y),centerOffset.x=cx,centerOffset.y=cy,body.area=total.area,body.parent=body,body.position.x=cx,body.position.y=cy,body.positionPrev.x=cx,body.positionPrev.y=cy,Body$f.setMass(body,total.mass),Body$f.setInertia(body,total.inertia),Body$f.setPosition(body,total.centre)}},Body$f.setCentre=function(body,centre,relative){relative?(body.positionPrev.x+=centre.x,body.positionPrev.y+=centre.y,body.position.x+=centre.x,body.position.y+=centre.y):(body.positionPrev.x=centre.x-(body.position.x-body.positionPrev.x),body.positionPrev.y=centre.y-(body.position.y-body.positionPrev.y),body.position.x=centre.x,body.position.y=centre.y)},Body$f.setPosition=function(body,position){var delta=Vector$7.sub(position,body.position);body.positionPrev.x+=delta.x,body.positionPrev.y+=delta.y;for(var i=0;i<body.parts.length;i++){var part=body.parts[i];part.position.x+=delta.x,part.position.y+=delta.y,Vertices$b.translate(part.vertices,delta),Bounds$8.update(part.bounds,part.vertices,body.velocity)}},Body$f.setAngle=function(body,angle){var delta=angle-body.angle;body.anglePrev+=delta;for(var i=0;i<body.parts.length;i++){var part=body.parts[i];part.angle+=delta,Vertices$b.rotate(part.vertices,delta,body.position),Axes$2.rotate(part.axes,delta),Bounds$8.update(part.bounds,part.vertices,body.velocity),i>0&&Vector$7.rotateAbout(part.position,delta,body.position,part.position)}},Body$f.setVelocity=function(body,velocity){body.positionPrev.x=body.position.x-velocity.x,body.positionPrev.y=body.position.y-velocity.y,body.velocity.x=velocity.x,body.velocity.y=velocity.y,body.speed=Vector$7.magnitude(body.velocity)},Body$f.setAngularVelocity=function(body,velocity){body.anglePrev=body.angle-velocity,body.angularVelocity=velocity,body.angularSpeed=Math.abs(body.angularVelocity)},Body$f.translate=function(body,translation){Body$f.setPosition(body,Vector$7.add(body.position,translation))},Body$f.rotate=function(body,rotation,point){if(point){var cos=Math.cos(rotation),sin=Math.sin(rotation),dx=body.position.x-point.x,dy=body.position.y-point.y;Body$f.setPosition(body,{x:point.x+(dx*cos-dy*sin),y:point.y+(dx*sin+dy*cos)}),Body$f.setAngle(body,body.angle+rotation)}else Body$f.setAngle(body,body.angle+rotation)},Body$f.scale=function(body,scaleX,scaleY,point){var totalArea=0,totalInertia=0;point=point||body.position;for(var i=0;i<body.parts.length;i++){var part=body.parts[i];part.scale.x=scaleX,part.scale.y=scaleY,Vertices$b.scale(part.vertices,scaleX,scaleY,point),part.axes=Axes$2.fromVertices(part.vertices),part.area=Vertices$b.area(part.vertices),Body$f.setMass(part,body.density*part.area),Vertices$b.translate(part.vertices,{x:-part.position.x,y:-part.position.y}),Body$f.setInertia(part,Body$f._inertiaScale*Vertices$b.inertia(part.vertices,part.mass)),Vertices$b.translate(part.vertices,{x:part.position.x,y:part.position.y}),i>0&&(totalArea+=part.area,totalInertia+=part.inertia),part.position.x=point.x+(part.position.x-point.x)*scaleX,part.position.y=point.y+(part.position.y-point.y)*scaleY,Bounds$8.update(part.bounds,part.vertices,body.velocity)}body.parts.length>1&&(body.area=totalArea,body.isStatic||(Body$f.setMass(body,body.density*totalArea),Body$f.setInertia(body,totalInertia))),body.circleRadius&&(scaleX===scaleY?body.circleRadius*=scaleX:body.circleRadius=null)},Body$f.update=function(body,deltaTime,timeScale,correction){var deltaT
743imeSquared=Math.pow(deltaTime*timeScale*body.timeScale,2),frictionAir=1-body.frictionAir*timeScale*body.timeScale,velocityPrevX=body.position.x-body.positionPrev.x,velocityPrevY=body.position.y-body.positionPrev.y;body.velocity.x=velocityPrevX*frictionAir*correction+body.force.x/body.mass*deltaTimeSquared,body.velocity.y=velocityPrevY*frictionAir*correction+body.force.y/body.mass*deltaTimeSquared,body.positionPrev.x=body.position.x,body.positionPrev.y=body.position.y,body.position.x+=body.velocity.x,body.position.y+=body.velocity.y,body.angularVelocity=(body.angle-body.anglePrev)*frictionAir*correction+body.torque/body.inertia*deltaTimeSquared,body.anglePrev=body.angle,body.angle+=body.angularVelocity,body.speed=Vector$7.magnitude(body.velocity),body.angularSpeed=Math.abs(body.angularVelocity);for(var i=0;i<body.parts.length;i++){var part=body.parts[i];Vertices$b.translate(part.vertices,body.velocity),i>0&&(part.position.x+=body.velocity.x,part.position.y+=body.velocity.y),0!==body.angularVelocity&&(Vertices$b.rotate(part.vertices,body.angularVelocity,body.position),Axes$2.rotate(part.axes,body.angularVelocity),i>0&&Vector$7.rotateAbout(part.position,body.angularVelocity,body.position,part.position)),Bounds$8.update(part.bounds,part.vertices,body.velocity)}},Body$f.applyForce=function(body,position,force){body.force.x+=force.x,body.force.y+=force.y;var offset_x=position.x-body.position.x,offset_y=position.y-body.position.y;body.torque+=offset_x*force.y-offset_y*force.x},Body$f._totalProperties=function(body){for(var properties={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===body.parts.length?0:1;i<body.parts.length;i++){var part=body.parts[i],mass=part.mass!==1/0?part.mass:1;properties.mass+=mass,properties.area+=part.area,properties.inertia+=part.inertia,properties.centre=Vector$7.add(properties.centre,Vector$7.mult(part.position,mass))}return properties.centre=Vector$7.div(properties.centre,properties.mass),properties}}();
744/**
745	 * @author       Richard Davey <[email protected]>
746	 * @copyright    2020 Photon Storm Ltd.
747	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
748	 */
749var Body$e=Body_1,Force={applyForce:function(force){return this._tempVec2.set(this.body.position.x,this.body.position.y),Body$e.applyForce(this.body,this._tempVec2,force),this},applyForceFrom:function(position,force){return Body$e.applyForce(this.body,position,force),this},thrust:function(speed){var angle=this.body.angle;return this._tempVec2.set(speed*Math.cos(angle),speed*Math.sin(angle)),Body$e.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(speed){var angle=this.body.angle-Math.PI/2;return this._tempVec2.set(speed*Math.cos(angle),speed*Math.sin(angle)),Body$e.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(speed){var angle=this.body.angle+Math.PI/2;return this._tempVec2.set(speed*Math.cos(angle),speed*Math.sin(angle)),Body$e.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(speed){var angle=this.body.angle-Math.PI;return this._tempVec2.set(speed*Math.cos(angle),speed*Math.sin(angle)),Body$e.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}},Force_1=Force,Friction_1={setFriction:function(value,air,fstatic){return this.body.friction=value,void 0!==air&&(this.body.frictionAir=air),void 0!==fstatic&&(this.body.frictionStatic=fstatic),this},setFrictionAir:function(value){return this.body.frictionAir=value,this},setFrictionStatic:function(value){return this.body.frictionStatic=value,this}},Gravity_1={setIgnoreGravity:function(value){return this.body.ignoreGravity=value,this}},Body$d=Body_1,Vector2$i=Vector2_1,Mass_1={setMass:function(value){return Body$d.setMass(this.body,value),this},setDensity:function(value){return Body$d.setDensity(this.body,value),this},centerOfMass:{get:function(){return new Vector2$i(this.body.centerOfMass.x,this.body.centerOfMass.y)}}},Sensor_1={setSensor:function(value){return this.body.isSensor=value,this},isSensor:function(){return this.body.isSensor}},polyDecomp={decomp:function(polygon){var edges=polygonGetCutEdges(polygon);return edges.length>0?polygonSlice(polygon,edges):[polygon]},quickDecomp:function polygonQuickDecomp(polygon,result,reflexVertices,steinerPoints,delta,maxlevel,level){maxlevel=maxlevel||100,level=level||0,delta=delta||25,result=void 0!==result?result:[],reflexVertices=reflexVertices||[],steinerPoints=steinerPoints||[];var upperInt=[0,0],lowerInt=[0,0],p=[0,0],upperDist=0,lowerDist=0,d=0,closestDist=0,upperIndex=0,lowerIndex=0,closestIndex=0,lowerPoly=[],upperPoly=[],poly=polygon,v=polygon;if(v.length<3)return result;if(++level>maxlevel)return console.warn("quickDecomp: max level ("+maxlevel+") reached."),result;for(var i=0;i<polygon.length;++i)if(polygonIsReflex(poly,i)){reflexVertices.push(poly[i]),upperDist=lowerDist=Number.MAX_VALUE;for(var j=0;j<polygon.length;++j)isLeft(polygonAt(poly,i-1),polygonAt(poly,i),polygonAt(poly,j))&&isRightOn(polygonAt(poly,i-1),polygonAt(poly,i),polygonAt(poly,j-1))&&(p=getIntersectionPoint(polygonAt(poly,i-1),polygonAt(poly,i),polygonAt(poly,j),polygonAt(poly,j-1)),isRight(polygonAt(poly,i+1),pol
vendor: 10,470 bytes, line 749
749ygonAt(poly,i),p)&&(d=sqdist(poly[i],p))<lowerDist&&(lowerDist=d,lowerInt=p,lowerIndex=j)),isLeft(polygonAt(poly,i+1),polygonAt(poly,i),polygonAt(poly,j+1))&&isRightOn(polygonAt(poly,i+1),polygonAt(poly,i),polygonAt(poly,j))&&(p=getIntersectionPoint(polygonAt(poly,i+1),polygonAt(poly,i),polygonAt(poly,j),polygonAt(poly,j+1)),isLeft(polygonAt(poly,i-1),polygonAt(poly,i),p)&&(d=sqdist(poly[i],p))<upperDist&&(upperDist=d,upperInt=p,upperIndex=j));if(lowerIndex===(upperIndex+1)%polygon.length)p[0]=(lowerInt[0]+upperInt[0])/2,p[1]=(lowerInt[1]+upperInt[1])/2,steinerPoints.push(p),i<upperIndex?(polygonAppend(lowerPoly,poly,i,upperIndex+1),lowerPoly.push(p),upperPoly.push(p),0!==lowerIndex&&polygonAppend(upperPoly,poly,lowerIndex,poly.length),polygonAppend(upperPoly,poly,0,i+1)):(0!==i&&polygonAppend(lowerPoly,poly,i,poly.length),polygonAppend(lowerPoly,poly,0,upperIndex+1),lowerPoly.push(p),upperPoly.push(p),polygonAppend(upperPoly,poly,lowerIndex,i+1));else{if(lowerIndex>upperIndex&&(upperIndex+=polygon.length),closestDist=Number.MAX_VALUE,upperIndex<lowerIndex)return result;for(j=lowerIndex;j<=upperIndex;++j)isLeftOn(polygonAt(poly,i-1),polygonAt(poly,i),polygonAt(poly,j))&&isRightOn(polygonAt(poly,i+1),polygonAt(poly,i),polygonAt(poly,j))&&(d=sqdist(polygonAt(poly,i),polygonAt(poly,j)))<closestDist&&polygonCanSee2(poly,i,j)&&(closestDist=d,closestIndex=j%polygon.length);i<closestIndex?(polygonAppend(lowerPoly,poly,i,closestIndex+1),0!==closestIndex&&polygonAppend(upperPoly,poly,closestIndex,v.length),polygonAppend(upperPoly,poly,0,i+1)):(0!==i&&polygonAppend(lowerPoly,poly,i,v.length),polygonAppend(lowerPoly,poly,0,closestIndex+1),polygonAppend(upperPoly,poly,closestIndex,i+1))}return lowerPoly.length<upperPoly.length?(polygonQuickDecomp(lowerPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level),polygonQuickDecomp(upperPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level)):(polygonQuickDecomp(upperPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level),polygonQuickDecomp(lowerPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level)),result}return result.push(polygon),result},isSimple:function(polygon){var i,path=polygon;for(i=0;i<path.length-1;i++)for(var j=0;j<i-1;j++)if(lineSegmentsIntersect(path[i],path[i+1],path[j],path[j+1]))return!1;for(i=1;i<path.length-2;i++)if(lineSegmentsIntersect(path[0],path[path.length-1],path[i],path[i+1]))return!1;return!0},removeCollinearPoints:function(polygon,precision){for(var num=0,i=polygon.length-1;polygon.length>3&&i>=0;--i)collinear(polygonAt(polygon,i-1),polygonAt(polygon,i),polygonAt(polygon,i+1),precision)&&(polygon.splice(i%polygon.length,1),num++);return num},removeDuplicatePoints:function(polygon,precision){for(var i=polygon.length-1;i>=1;--i)for(var pi=polygon[i],j=i-1;j>=0;--j)points_eq(pi,polygon[j],precision)&&polygon.splice(i,1)},makeCCW:function(polygon){for(var br=0,v=polygon,i=1;i<polygon.length;++i)(v[i][1]<v[br][1]||v[i][1]===v[br][1]&&v[i][0]>v[br][0])&&(br=i);return!isLeft(polygonAt(polygon,br-1),polygonAt(polygon,br),polygonAt(polygon,br+1))&&(function(polygon){for(var tmp=[],N=polygon.length,i=0;i!==N;i++)tmp.push(polygon.pop());for(i=0;i!==N;i++)polygon[i]=tmp[i]}(polygon),!0)}};function lineInt(l1,l2,precision){precision=precision||0;var a1,b1,c1,a2,b2,c2,det,i=[0,0];return a1=l1[1][1]-l1[0][1],b1=l1[0][0]-l1[1][0],c1=a1*l1[0][0]+b1*l1[0][1],a2=l2[1][1]-l2[0][1],b2=l2[0][0]-l2[1][0],c2=a2*l2[0][0]+b2*l2[0][1],scalar_eq(det=a1*b2-a2*b1,0,precision)||(i[0]=(b2*c1-b1*c2)/det,i[1]=(a1*c2-a2*c1)/det),i}function lineSegmentsIntersect(p1,p2,q1,q2){var dx=p2[0]-p1[0],dy=p2[1]-p1[1],da=q2[0]-q1[0],db=q2[1]-q1[1];if(da*dy-db*dx==0)return!1;var s=(dx*(q1[1]-p1[1])+dy*(p1[0]-q1[0]))/(da*dy-db*dx),t=(da*(p1[1]-q1[1])+db*(q1[0]-p1[0]))/(db*dx-da*dy);return s>=0&&s<=1&&t>=0&&t<=1}function triangleArea(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])}function isLeft(a,b,c){return triangleArea(a,b,c)>0}function isLeftOn(a,b,c){return triangleArea(a,b,c)>=0}function isRight(a,b,c){return triangleArea(a,b,c)<0}function isRightOn(a,b,c){return triangleArea(a,b,c)<=0}var tmpPoint1=[],tmpPoint2=[];function collinear(a,b,c,thresholdAngle){if(thresholdAngle){var ab=tmpPoint1,bc=tmpPoint2;ab[0]=b[0]-a[0],ab[1]=b[1]-a[1],bc[0]=c[0]-b[0],bc[1]=c[1]-b[1];var dot=ab[0]*bc[0]+ab[1]*bc[1],magA=Math.sqrt(ab[0]*ab[0]+ab[1]*ab[1]),magB=Math.sqrt(bc[0]*bc[0]+bc[1]*bc[1]);return Math.acos(dot/(magA*magB))<thresholdAngle}return 0===triangleArea(a,b,c)}function sqdist(a,b){var dx=b[0]-a[0],dy=b[1]-a[1];return dx*dx+dy*dy}function polygonAt(polygon,i){var s=polygon.length;return polygon[i<0?i%s+s:i%s]}function polygonAppend(polygon,poly,from,to){for(var i=from;i<to;i++)polygon.push(poly[i])}function polygonIsReflex(polygon,i){return isRight(polygonAt(polygon,i-1),polygonAt(polygon,i),polygonAt(polygon,i+1))}var tmpLine1=[],tmpLine2=[];function polygonCanSee(polygon,a,b){var p,dist,l1=tmpLine1,l2=tmpLine2;if(isLeftOn(polygonAt(polygon,a+1),polygonAt(polygon,a),polygonAt(polygon,b))&&isRightOn(polygonAt(polygon,a-1),polygonAt(polygon,a),polygonAt(polygon,b)))return!1;dist=sqdist(polygonAt(polygon,a),polygonAt(polygon,b));for(var i=0;i!==polygon.length;++i)if((i+1)%polygon.length!==a&&i!==a&&isLeftOn(polygonAt(polygon,a),polygonAt(polygon,b),polygonAt(polygon,i+1))&&isRightOn(polygonAt(polygon,a),polygonAt(polygon,b),polygonAt(polygon,i))&&(l1[0]=polygonAt(polygon,a),l1[1]=polygonAt(polygon,b),l2[0]=polygonAt(polygon,i),l2[1]=polygonAt(polygon,i+1),p=lineInt(l1,l2),sqdist(polygonAt(polygon,a),p)<dist))return!1;return!0}function polygonCanSee2(polygon,a,b){for(var i=0;i!==polygon.length;++i)if(i!==a&&i!==b&&(i+1)%polygon.length!==a&&(i+1)%polygon.length!==b&&lineSegmentsIntersect(polygonAt(polygon,a),polygonAt(polygon,b),polygonAt(polygon,i),polygonAt(polygon,i+1)))return!1;return!0}function polygonCopy(polygon,i,j,targetPoly){var p=targetPoly||[];if(function(polygon){polygon.length=0}(p),i<j)for(var k=i;k<=j;k++)p.push(polygon[k]);else{for(k=0;k<=j;k++)p.push(polygon[k]);for(k=i;k<polygon.length;k++)p.push(polygon[k])}return p}function polygonGetCutEdges(polygon){for(var min=[],tmp1=[],tmp2=[],tmpPoly=[],nDiags=Number.MAX_VALUE,i=0;i<polygon.length;++i)if(polygonIsReflex(polygon,i))for(var j=0;j<polygon.length;++j)if(polygonCanSee(polygon,i,j)){tmp1=polygonGetCutEdges(polygonCopy(polygon,i,j,tmpPoly)),tmp2=polygonGetCutEdges(polygonCopy(polygon,j,i,tmpPoly));for(var k=0;k<tmp2.length;k++)tmp1.push(tmp2[k]);tmp1.length<nDiags&&(min=tmp1,nDiags=tmp1.length,min.push([polygonAt(polygon,i),polygonAt(polygon,j)]))}return min}function polygonSlice(polygon,cutEdges){if(0===cutEdges.length)return[polygon];if(cutEdges instanceof Array&&cutEdges.length&&cutEdges[0]instanceof Array&&2===cutEdges[0].length&&cutEdges[0][0]instanceof Array){for(var polys=[polygon],i=0;i<cutEdges.length;i++)for(var cutEdge=cutEdges[i],j=0;j<polys.length;j++){var result=polygonSlice(polys[j],cutEdge);if(result){polys.splice(j,1),polys.push(result[0],result[1]);break}}return polys}cutEdge=cutEdges,i=polygon.indexOf(cutEdge[0]),j=polygon.indexOf(cutEdge[1]);return-1!==i&&-1!==j&&[polygonCopy(polygon,i,j),polygonCopy(polygon,j,i)]}function getIntersectionPoint(p1,p2,q1,q2,delta){delta=delta||0;var a1=p2[1]-p1[1],b1=p1[0]-p2[0],c1=a1*p1[0]+b1*p1[1],a2=q2[1]-q1[1],b2=q1[0]-q2[0],c2=a2*q1[0]+b2*q1[1],det=a1*b2-a2*b1;return scalar_eq(det,0,delta)?[0,0]:[(b2*c1-b1*c2)/det,(a1*c2-a2*c1)/det]}function scalar_eq(a,b,precision){return precision=precision||0,Math.abs(a-b)<=precision}function points_eq(a,b,precision){return scalar_eq(a[0],b[0],precision)&&scalar_eq(a[1],b[1],precision)}var Bodies$9={},Bodies_1=Bodies$9,Vertices$a=Vertices_1,Common$e=Common_1,Body$c=Body_1,Bounds$7=Bounds_1,Vector$6=Vector_1,decomp=polyDecomp;Bodies$9.rectangle=function(x,y,width,height,options){options=options||{};var rectangle={label:"Rectangle Body",position:{x:x,y:y},vertices:Vertices$a.fromPath("L 0 0 L "+width+" 0 L "+width+" "+height+" L 0 "+height)};if(options.chamfer){var chamfer=options.chamfer;rectangle.vertices=Vertices$a.chamfer(rectangle.vertices,chamfer.radius,chamfer.quality,chamfer.qualityMin,chamfer.qualityMax),delete options.chamfer}return Body$c.create(Common$e.extend({},rectangle,options))},Bodies$9.trapezoid=function(x,y,width,height,slope,options){options=options||{};var verticesPath,x1=width*(slope*=.5),x2=x1+(1-2*slope)*width,x3=x2+x1;verticesPath=slope<.5?"L 0 0 L "+x1+" "+-height+" L "+x2+" "+-height+" L "+x3+" 0":"L 0 0 L "+x2+" "+-height+" L "+x3+" 0";var trapezoid={label:"Trapezoid Body",position:{x:x,y:y},vertices:Vertices$a.fromPath(verticesPath)};if(options.chamfer){var chamfer=options.chamfer;trapezoid.vertices=Vertices$a.chamfer(trapezoid.vertices,chamfer.radius,chamfer.quality,chamfer.qualityMin,chamfer.qualityMax),delete options.chamfer}return Body$c.create(Common$e.extend({},trapezoid,options))},Bodies$9.circle=function(x,y,radius,options,maxSides){options=options||{};var circle={label:"Circle Body",circleRadius:radius};maxSides=maxSides||25;var sides=Math.ceil(Math.max(10,Math.min(maxSides,radius)));return sides%2==1&&(sides+=1),Bodies$9.polygon(x,y,sides,radius,Common$e.extend({},circle,options))},Bodies$9.polygon=function(x,y,sides,radius,options){if(options=options||{},sides<3)return Bodies$9.circle(x,y,radius,options);for(var theta=2*Math.PI/sides,path="",offset=.5*theta,i=0;i<sides;i+=1){var angle=offset+i*theta,xx=Math.cos(angle)*radius,yy=Math.sin(angle)*radius;path+="L "+xx.toFixed(3)+" "+yy.toFixed(3)+" "}var polygon={label:"Polygon Body",position:{x:x,y:y},vertices:Vertices$a.fromPath(path)};if(options.chamfer){var chamfer=options.chamfer;polygon.vertices=Vertices$a.chamfer(polygon.vertices,chamfer.radius,chamfer.quality,chamfer.qualityMin,chamfer.qualityMax),delete options.chamfer}return Body$c.create(Common$e.extend({},polygon,options))},Bodies$9.fromVertices=function(x,y,vertexSets,options,flagInternal,removeCollinear,minimumArea){var body,parts,isConvex,vertices,i,v;for(options=options||{},parts=[],flagInternal=void 0!==flagInternal&&flagInternal,removeCollinear=void 0!==removeCollinear?removeCollinear:.01,minimumArea=void 0!==minimumArea?minimumArea:10,decomp||Common$e.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),Common$e.isArray(vertexSets[0])||(vertexSets=[vertexSets]),v=0;v<vertexSets.length;v+=1)if(vertices=vertexSets[v],(isConvex=Vertices$a.isConvex(vert
749ices))||!decomp)vertices=isConvex?Vertices$a.clockwiseSort(vertices):Vertices$a.hull(vertices),parts.push({position:{x:x,y:y},vertices:vertices});else{var concave=vertices.map((function(vertex){return[vertex.x,vertex.y]}));decomp.makeCCW(concave),!1!==removeCollinear&&decomp.removeCollinearPoints(concave,removeCollinear);var decomposed=decomp.quickDecomp(concave);for(i=0;i<decomposed.length;i++){var chunkVertices=decomposed[i].map((function(vertices){return{x:vertices[0],y:vertices[1]}}));minimumArea>0&&Vertices$a.area(chunkVertices)<minimumArea||parts.push({position:Vertices$a.centre(chunkVertices),vertices:chunkVertices})}}for(i=0;i<parts.length;i++)parts[i]=Body$c.create(Common$e.extend(parts[i],options));return flagInternal&&Bodies$9.flagCoincidentParts(parts,5),parts.length>1?(body=Body$c.create(Common$e.extend({parts:parts.slice(0)},options)),Body$c.setPosition(body,{x:x,y:y}),body):parts[0]},Bodies$9.flagCoincidentParts=function(parts,maxDistance){void 0===maxDistance&&(maxDistance=5);for(var i=0;i<parts.length;i++)for(var partA=parts[i],j=i+1;j<parts.length;j++){var partB=parts[j];if(Bounds$7.overlaps(partA.bounds,partB.bounds))for(var pav=partA.vertices,pbv=partB.vertices,k=0;k<partA.vertices.length;k++)for(var z=0;z<partB.vertices.length;z++){var da=Vector$6.magnitudeSquared(Vector$6.sub(pav[(k+1)%pav.length],pbv[z])),db=Vector$6.magnitudeSquared(Vector$6.sub(pav[k],pbv[(z+1)%pbv.length]));da<maxDistance&&db<maxDistance&&(pav[k].isInternal=!0,pbv[z].isInternal=!0)}}return parts};
750/**
751	 * @author       Joachim Grill <[email protected]>
752	 * @author       Richard Davey <[email protected]>
753	 * @copyright    2018 CodeAndWeb GmbH
754	 * @copyright    2020 Photon Storm Ltd.
755	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
756	 */
757var Bodies$8=Bodies_1,Body$b=Body_1,Common$d=Common_1,GetFastValue$i=GetFastValue_1,Vertices$9=Vertices_1,PhysicsEditorParser$2={parseBody:function(x,y,config,options){void 0===options&&(options={});for(var fixtureConfigs=GetFastValue$i(config,"fixtures",[]),fixtures=[],fc=0;fc<fixtureConfigs.length;fc++)for(var fixtureParts=this.parseFixture(fixtureConfigs[fc]),i=0;i<fixtureParts.length;i++)fixtures.push(fixtureParts[i]);var matterConfig=Common$d.clone(config,!0);Common$d.extend(matterConfig,options,!0),delete matterConfig.fixtures,delete matterConfig.type;var body=Body$b.create(matterConfig);return Body$b.setParts(body,fixtures),Body$b.setPosition(body,{x:x,y:y}),body},parseFixture:function(fixtureConfig){var fixtures,matterConfig=Common$d.extend({},!1,fixtureConfig);if(delete matterConfig.circle,delete matterConfig.vertices,fixtureConfig.circle){var x=GetFastValue$i(fixtureConfig.circle,"x"),y=GetFastValue$i(fixtureConfig.circle,"y"),r=GetFastValue$i(fixtureConfig.circle,"radius");fixtures=[Bodies$8.circle(x,y,r,matterConfig)]}else fixtureConfig.vertices&&(fixtures=this.parseVertices(fixtureConfig.vertices,matterConfig));return fixtures},parseVertices:function(vertexSets,options){void 0===options&&(options={});for(var parts=[],v=0;v<vertexSets.length;v++)Vertices$9.clockwiseSort(vertexSets[v]),parts.push(Body$b.create(Common$d.extend({position:Vertices$9.centre(vertexSets[v]),vertices:vertexSets[v]},options)));return Bodies$8.flagCoincidentParts(parts)}},PhysicsEditorParser_1=PhysicsEditorParser$2,Bodies$7=Bodies_1,Body$a=Body_1,PhysicsJSONParser$2={parseBody:function(x,y,config,options){var body;void 0===options&&(options={});var vertexSets=config.vertices;if(1===vertexSets.length)options.vertices=vertexSets[0],body=Body$a.create(options),Bodies$7.flagCoincidentParts(body.parts);else{for(var parts=[],i=0;i<vertexSets.length;i++){var part=Body$a.create({vertices:vertexSets[i]});parts.push(part)}Bodies$7.flagCoincidentParts(parts),options.parts=parts,body=Body$a.create(options)}return body.label=config.label,Body$a.setPosition(body,{x:x,y:y}),body}},PhysicsJSONParser_1=PhysicsJSONParser$2,Bodies$6=Bodies_1,Body$9=Body_1,FuzzyEquals=Equal_1,GetFastValue$h=GetFastValue_1,PhysicsEditorParser$1=PhysicsEditorParser_1,PhysicsJSONParser$1=PhysicsJSONParser_1,Vertices$8=Vertices_1,SetBody={setRectangle:function(width,height,options){return this.setBody({type:"rectangle",width:width,height:height},options)},setCircle:function(radius,options){return this.setBody({type:"circle",radius:radius},options)},setPolygon:function(radius,sides,options){return this.setBody({type:"polygon",sides:sides,radius:radius},options)},setTrapezoid:function(width,height,slope,options){return this.setBody({type:"trapezoid",width:width,height:height,slope:slope},options)},setExistingBody:function(body,addToWorld){void 0===addToWorld&&(addToWorld=!0),this.body&&this.world.remove(this.body,!0),this.body=body;for(var i=0;i<body.parts.length;i++)body.parts[i].gameObject=this;var _this=this;if(body.destroy=function(){_this.world.remove(_this.body,!0),_this.body.gameObject=null},addToWorld&&(this.world.has(body)&&this.world.remove(body,!0),this.world.add(body)),this._originComponent){var rx=body.render.sprite.xOffset,ry=body.render.sprite.yOffset,comx=body.centerOfMass.x,comy=body.centerOfMass.y;if(FuzzyEquals(comx,.5)&&FuzzyEquals(comy,.5))this.setOrigin(rx+.5,ry+.5);else{var cx=body.centerOffset.x,cy=body.centerOffset.y;this.setOrigin(rx+cx/this.displayWidth,ry+cy/this.displayHeight)}}return this},setBody:function(config,options){if(!config)return this;var body;"string"==typeof config&&(config={type:config});var shapeType=GetFastValue$h(config,"type","rectangle"),bodyX=GetFastValue$h(config,"x",this._tempVec2.x),bodyY=GetFastValue$h(config,"y",this._tempVec2.y),bodyWidth=GetFastValue$h(config,"width",this.width),bodyHeight=GetFastValue$h(config,"height",this.height);
vendor: 17,061 bytes, line 757
757switch(shapeType){case"rectangle":body=Bodies$6.rectangle(bodyX,bodyY,bodyWidth,bodyHeight,options);break;case"circle":var radius=GetFastValue$h(config,"radius",Math.max(bodyWidth,bodyHeight)/2),maxSides=GetFastValue$h(config,"maxSides",25);body=Bodies$6.circle(bodyX,bodyY,radius,options,maxSides);break;case"trapezoid":var slope=GetFastValue$h(config,"slope",.5);body=Bodies$6.trapezoid(bodyX,bodyY,bodyWidth,bodyHeight,slope,options);break;case"polygon":var sides=GetFastValue$h(config,"sides",5),pRadius=GetFastValue$h(config,"radius",Math.max(bodyWidth,bodyHeight)/2);body=Bodies$6.polygon(bodyX,bodyY,sides,pRadius,options);break;case"fromVertices":case"fromVerts":var verts=GetFastValue$h(config,"verts",null);if(verts)if("string"==typeof verts&&(verts=Vertices$8.fromPath(verts)),this.body&&!this.body.hasOwnProperty("temp"))Body$9.setVertices(this.body,verts),body=this.body;else{var flagInternal=GetFastValue$h(config,"flagInternal",!1),removeCollinear=GetFastValue$h(config,"removeCollinear",.01),minimumArea=GetFastValue$h(config,"minimumArea",10);body=Bodies$6.fromVertices(bodyX,bodyY,verts,options,flagInternal,removeCollinear,minimumArea)}break;case"fromPhysicsEditor":body=PhysicsEditorParser$1.parseBody(bodyX,bodyY,config,options);break;case"fromPhysicsTracer":body=PhysicsJSONParser$1.parseBody(bodyX,bodyY,config,options)}return body&&this.setExistingBody(body,config.addToWorld),this}},events$1={AFTER_ADD:"afteradd",AFTER_REMOVE:"afterremove",AFTER_UPDATE:"afterupdate",BEFORE_ADD:"beforeadd",BEFORE_REMOVE:"beforeremove",BEFORE_UPDATE:"beforeupdate",COLLISION_ACTIVE:"collisionactive",COLLISION_END:"collisionend",COLLISION_START:"collisionstart",DRAG_END:"dragend",DRAG:"drag",DRAG_START:"dragstart",PAUSE:"pause",RESUME:"resume",SLEEP_END:"sleepend",SLEEP_START:"sleepstart"},Events$7=events$1,Sleeping$3=Sleeping_1,MatterEvents$1=Events_1,Body$8=Body_1,Body$7=Body_1,MATH_CONST$2=_const$b,WrapAngle=Wrap_1,WrapAngleDegrees=WrapDegrees_1,Transform={x:{get:function(){return this.body.position.x},set:function(value){this._tempVec2.set(value,this.y),Body$7.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(value){this._tempVec2.set(this.x,value),Body$7.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(value){var factorX=1/this._scaleX,factorY=1/this._scaleY;this._scaleX=value,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,Body$7.scale(this.body,factorX,factorY),Body$7.scale(this.body,value,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(value){var factorX=1/this._scaleX,factorY=1/this._scaleY;this._scaleY=value,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,Body$7.scale(this.body,factorX,factorY),Body$7.scale(this.body,this._scaleX,value)}},angle:{get:function(){return WrapAngleDegrees(this.body.angle*MATH_CONST$2.RAD_TO_DEG)},set:function(value){this.rotation=WrapAngleDegrees(value)*MATH_CONST$2.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(value){this._rotation=WrapAngle(value),Body$7.setAngle(this.body,this._rotation)}},setPosition:function(x,y){return void 0===x&&(x=0),void 0===y&&(y=x),this._tempVec2.set(x,y),Body$7.setPosition(this.body,this._tempVec2),this},setRotation:function(radians){return void 0===radians&&(radians=0),this._rotation=WrapAngle(radians),Body$7.setAngle(this.body,radians),this},setFixedRotation:function(){return Body$7.setInertia(this.body,1/0),this},setAngle:function(degrees){return void 0===degrees&&(degrees=0),this.angle=degrees,Body$7.setAngle(this.body,this.rotation),this},setScale:function(x,y,point){void 0===x&&(x=1),void 0===y&&(y=x);var factorX=1/this._scaleX,factorY=1/this._scaleY;return this._scaleX=x,this._scaleY=y,Body$7.scale(this.body,factorX,factorY,point),Body$7.scale(this.body,x,y,point),this}},Body$6=Body_1,components$1={Bounce:Bounce_1,Collision:Collision_1,Force:Force_1,Friction:Friction_1,Gravity:Gravity_1,Mass:Mass_1,Sensor:Sensor_1,SetBody:SetBody,Sleep:{setToSleep:function(){return Sleeping$3.set(this.body,!0),this},setAwake:function(){return Sleeping$3.set(this.body,!1),this},setSleepThreshold:function(value){return void 0===value&&(value=60),this.body.sleepThreshold=value,this},setSleepEvents:function(start,end){return this.setSleepStartEvent(start),this.setSleepEndEvent(end),this},setSleepStartEvent:function(value){if(value){var world=this.world;MatterEvents$1.on(this.body,"sleepStart",(function(event){world.emit(Events$7.SLEEP_START,event,this)}))}else MatterEvents$1.off(this.body,"sleepStart");return this},setSleepEndEvent:function(value){if(value){var world=this.world;MatterEvents$1.on(this.body,"sleepEnd",(function(event){world.emit(Events$7.SLEEP_END,event,this)}))}else MatterEvents$1.off(this.body,"sleepEnd");return this}},Static:{setStatic:function(value){return Body$8.setStatic(this.body,value),this},isStatic:function(){return this.body.isStatic}},Transform:Transform,Velocity:{setAngularVelocity:function(value){return Body$6.setAngularVelocity(this.body,value),this},setVelocityX:function(x){return this._tempVec2.set(x,this.body.velocity.y),Body$6.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(y){return this._tempVec2.set(this.body.velocity.x,y),Body$6.setVelocity(this.body,this._tempVec2),this},setVelocity:function(x,y){return this._tempVec2.set(x,y),Body$6.setVelocity(this.body,this._tempVec2),this}}},Composite$7={},Composite_1=Composite$7,Events$6=Events_1,Common$c=Common_1,Bounds$6=Bounds_1,Body$5=Body_1;Composite$7.create=function(options){return Common$c.extend({id:Common$c.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},options)},Composite$7.setModified=function(composite,isModified,updateParents,updateChildren){if(Events$6.trigger(composite,"compositeModified",composite),composite.isModified=isModified,updateParents&&composite.parent&&Composite$7.setModified(composite.parent,isModified,updateParents,updateChildren),updateChildren)for(var i=0;i<composite.composites.length;i++){var childComposite=composite.composites[i];Composite$7.setModified(childComposite,isModified,updateParents,updateChildren)}},Composite$7.add=function(composite,object){var objects=[].concat(object);Events$6.trigger(composite,"beforeAdd",{object:object});for(var i=0;i<objects.length;i++){var obj=objects[i];switch(obj.type){case"body":if(obj.parent!==obj){Common$c.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}Composite$7.addBody(composite,obj);break;case"constraint":Composite$7.addConstraint(composite,obj);break;case"composite":Composite$7.addComposite(composite,obj);break;case"mouseConstraint":Composite$7.addConstraint(composite,obj.constraint)}}return Events$6.trigger(composite,"afterAdd",{object:object}),composite},Composite$7.remove=function(composite,object,deep){var objects=[].concat(object);Events$6.trigger(composite,"beforeRemove",{object:object});for(var i=0;i<objects.length;i++){var obj=objects[i];switch(obj.type){case"body":Composite$7.removeBody(composite,obj,deep);break;case"constraint":Composite$7.removeConstraint(composite,obj,deep);break;case"composite":Composite$7.removeComposite(composite,obj,deep);break;case"mouseConstraint":Composite$7.removeConstraint(composite,obj.constraint)}}return Events$6.trigger(composite,"afterRemove",{object:object}),composite},Composite$7.addComposite=function(compositeA,compositeB){return compositeA.composites.push(compositeB),compositeB.parent=compositeA,Composite$7.setModified(compositeA,!0,!0,!1),compositeA},Composite$7.removeComposite=function(compositeA,compositeB,deep){var position=compositeA.composites.indexOf(compositeB);if(-1!==position&&(Composite$7.removeCompositeAt(compositeA,position),Composite$7.setModified(compositeA,!0,!0,!1)),deep)for(var i=0;i<compositeA.composites.length;i++)Composite$7.removeComposite(compositeA.composites[i],compositeB,!0);return compositeA},Composite$7.removeCompositeAt=function(composite,position){return composite.composites.splice(position,1),Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.addBody=function(composite,body){return composite.bodies.push(body),Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.removeBody=function(composite,body,deep){var position=composite.bodies.indexOf(body);if(-1!==position&&(Composite$7.removeBodyAt(composite,position),Composite$7.setModified(composite,!0,!0,!1)),deep)for(var i=0;i<composite.composites.length;i++)Composite$7.removeBody(composite.composites[i],body,!0);return composite},Composite$7.removeBodyAt=function(composite,position){return composite.bodies.splice(position,1),Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.addConstraint=function(composite,constraint){return composite.constraints.push(constraint),Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.removeConstraint=function(composite,constraint,deep){var position=composite.constraints.indexOf(constraint);if(-1!==position&&Composite$7.removeConstraintAt(composite,position),deep)for(var i=0;i<composite.composites.length;i++)Composite$7.removeConstraint(composite.composites[i],constraint,!0);return composite},Composite$7.removeConstraintAt=function(composite,position){return composite.constraints.splice(position,1),Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.clear=function(composite,keepStatic,deep){if(deep)for(var i=0;i<composite.composites.length;i++)Composite$7.clear(composite.composites[i],keepStatic,!0);return keepStatic?composite.bodies=composite.bodies.filter((function(body){return body.isStatic})):composite.bodies.length=0,composite.constraints.length=0,composite.composites.length=0,Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.allBodies=function(composite){for(var bodies=[].concat(composite.bodies),i=0;i<composite.composites.length;i++)bodies=bodies.concat(Composite$7.allBodies(composite.composites[i]));return bodies},Composite$7.allConstraints=function(composite){for(var constraints=[].concat(composite.constraints),i=0;i<composite.composites.length;i++)constraints=constraints.concat(Composite$7.allConstraints(composite.composites[i]));return constraints},Composite$7.allComposites=function(composite){for(var composites=[].concat(composite.composites),i=0;i<composite.composites.length;i++)composites=composites.concat(Composite$7.allComposites(composite.composites[i]));return composites},Composite$7.get=function(composite,id,type){var objects,object;switch(type){case"body":objects=Composite$7.allBodies(composite);break;case"constraint":objects=Composite$7.allConstraints(composite);break;case"composite":objects=Composite$7.allComposites(composite).concat(composite)}return objects?0===(object=objects.filter((function(object){return object.id.toString()===id.toString()}))).length?null:object[0]:null},Composite$7.move=function(compositeA,objects,compositeB){return Composite$7.remove(compositeA,objects),Composite$7.add(compositeB,objects),compositeA},Composite$7.rebase=function(composite){for(var objects=Composite$7.allBodies(composite).concat(Composite$7.allConstraints(composite)).concat(Composite$7.allComposites(composite)),i=0;i<objects.length;i++)objects[i].id=Common$c.nextId();return Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.translate=function(composite,translation,recursive){for(var bodies=recursive?Composite$7.allBodies(composite):composite.bodies,i=0;i<bodies.length;i++)Body$5.translate(bodies[i],translation);return Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.rotate=function(composite,rotation,point,recursive){for(var cos=Math.cos(rotation),sin=Math.sin(rotation),bodies=recursive?Composite$7.allBodies(composite):composite.bodies,i=0;i<bodies.length;i++){var body=bodies[i],dx=body.position.x-point.x,dy=body.position.y-point.y;Body$5.setPosition(body,{x:point.x+(dx*cos-dy*sin),y:point.y+(dx*sin+dy*cos)}),Body$5.rotate(body,rotation)}return Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.scale=function(composite,scaleX,scaleY,point,recursive){for(var bodies=recursive?Composite$7.allBodies(composite):composite.bodies,i=0;i<bodies.length;i++){var body=bodies[i],dx=body.position.x-point.x,dy=body.position.y-point.y;Body$5.setPosition(body,{x:point.x+dx*scaleX,y:point.y+dy*scaleY}),Body$5.scale(body,scaleX,scaleY)}return Composite$7.setModified(composite,!0,!0,!1),composite},Composite$7.bounds=function(composite){for(var bodies=Composite$7.allBodies(composite),vertices=[],i=0;i<bodies.length;i+=1){var body=bodies[i];vertices.push(body.bounds.min,body.bounds.max)}return Bounds$6.create(vertices)};var Constraint$5={},Constraint_1=Constraint$5,Vertices$7=Vertices_1,Vector$5=Vector_1,Sleeping$2=Sleeping_1,Bounds$5=Bounds_1,Axes$1=Axes_1,Common$b=Common_1;Constraint$5._warming=.4,Constraint$5._torqueDampen=1,Constraint$5._minLength=1e-6,Constraint$5.create=function(options){var constraint=options;constraint.bodyA&&!constraint.pointA&&(constraint.pointA={x:0,y:0}),constraint.bodyB&&!constraint.pointB&&(constraint.pointB={x:0,y:0});var initialPointA=constraint.bodyA?Vector$5.add(constraint.bodyA.position,constraint.pointA):constraint.pointA,initialPointB=constraint.bodyB?Vector$5.add(constraint.bodyB.position,constraint.pointB):constraint.pointB,length=Vector$5.magnitude(Vector$5.sub(initialPointA,initialPointB));constraint.length=void 0!==constraint.length?constraint.length:length,constraint.id=constraint.id||Common$b.nextId(),constraint.label=constraint.label||"Constraint",constraint.type="constraint",constraint.stiffness=constraint.stiffness||(constraint.length>0?1:.7),constraint.damping=constraint.damping||0,constraint.angularStiffness=constraint.angularStiffness||0,constraint.angleA=constraint.bodyA?constraint.bodyA.angle:constraint.angleA,constraint.angleB=constraint.bodyB?constraint.bodyB.angle:constraint.angleB,constraint.plugin={};var render={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===constraint.length&&constraint.stiffness>.1?(render.type="pin",render.anchors=!1):constraint.stiffness<.9&&(render.type="spring"),constraint.render=Common$b.extend(render,constraint.render),constraint},Constraint$5.preSolveAll=function(bodies){for(var i=0;i<bodies.length;i+=1){var body=bodies[i],impulse=body.constraintImpulse;body.isStatic||0===impulse.x&&0===impulse.y&&0===impulse.angle||(body.position.x+=impulse.x,body.position.y+=impulse.y,body.angle+=impulse.angle)}},Constraint$5.solveAll=function(constraints,timeScale){for(var i=0;i<constraints.length;i+=1){var constraint=constraints[i],fixedA=!constraint.bodyA||constraint.bodyA&&constraint.bodyA.isStatic,fixedB=!constraint.bodyB||constraint.bodyB&&constraint.bodyB.isStatic;(fixedA||fixedB)&&Constraint$5.solve(constraints[i],timeScale)}for(i=0;i<constraints.length;i+=1)fixedA=!(constraint=constraints[i]).bodyA||constraint.bodyA&&constraint.bodyA.isStatic,fixedB=!constraint.bodyB||constraint.bodyB&&constraint.bodyB.isStatic,fixedA||fixedB||Constraint$5.solve(constraints[i],timeScale)},Constraint$5.solve=function(constraint,timeScale){var bodyA=constraint.bodyA,bodyB=constraint.bodyB,pointA=constraint.pointA,pointB=constraint.pointB;if(bodyA||bodyB){bodyA&&!bodyA.isStatic&&(Vector$5.rotate(pointA,bodyA.angle-constraint.angleA,pointA),constraint.angleA=bodyA.angle),bodyB&&!bodyB.isStatic&&(Vector$5.rotate(pointB,bodyB.angle-constraint.angleB,pointB),constraint.angleB=bodyB.angle);var pointAWorld=pointA,pointBWorld=pointB;if(bodyA&&(pointAWorld=Vector$5.add(bodyA.position,pointA)),bodyB&&(pointBWorld=Vector$5.add(bodyB.position,pointB)),pointAWorld&&pointBWorld){var delta=Vector$5.sub(pointAWorld,pointBWorld),currentLength=Vector$5.magnitude(delta);currentLength<Constraint$5._minLength&&(currentLength=Constraint$5._minLength);var torque,share,normal,normalVelocity,relativeVelocity,difference=(currentLength-constraint.length)/currentLength,stiffness=constraint.stiffness<1?constraint.stiffness*timeScale:constraint.stiffness,force=Vector$5.mult(delta,difference*stiffness),massTotal=(bodyA?bodyA.inverseMass:0)+(bodyB?bodyB.inverseMass:0),resistanceTotal=massTotal+((bodyA?bodyA.inverseInertia:0)+(bodyB?bodyB.inverseInertia:0));if(constraint.damping){var zero=Vector$5.create();normal=Vector$5.div(delta,currentLength),relativeVelocity=Vector$5.sub(bodyB&&Vector$5.sub(bodyB.position,bodyB.positionPrev)||zero,bodyA&&Vector$5.sub(bodyA.position,bodyA.positionPrev)||zero),normalVelocity=Vector$5.dot(normal,relativeVelocity)}bodyA&&!bodyA.isStatic&&(share=bodyA.inverseMass/massTotal,bodyA.constraintImpulse.x-=force.x*share,bodyA.constraintImpulse.y-=force.y*share,bodyA.position.x-=force.x*share,bodyA.position.y-=force.y*share,constraint.damping&&(bodyA.positionPrev.x-=constraint.damping*normal.x*normalVelocity*share,bodyA.positionPrev.y-=constraint.damping*normal.y*normalVelocity*share),torque=Vector$5.cross(p
vendor: 5,134 bytes, line 757
757ointA,force)/resistanceTotal*Constraint$5._torqueDampen*bodyA.inverseInertia*(1-constraint.angularStiffness),bodyA.constraintImpulse.angle-=torque,bodyA.angle-=torque),bodyB&&!bodyB.isStatic&&(share=bodyB.inverseMass/massTotal,bodyB.constraintImpulse.x+=force.x*share,bodyB.constraintImpulse.y+=force.y*share,bodyB.position.x+=force.x*share,bodyB.position.y+=force.y*share,constraint.damping&&(bodyB.positionPrev.x+=constraint.damping*normal.x*normalVelocity*share,bodyB.positionPrev.y+=constraint.damping*normal.y*normalVelocity*share),torque=Vector$5.cross(pointB,force)/resistanceTotal*Constraint$5._torqueDampen*bodyB.inverseInertia*(1-constraint.angularStiffness),bodyB.constraintImpulse.angle+=torque,bodyB.angle+=torque)}}},Constraint$5.postSolveAll=function(bodies){for(var i=0;i<bodies.length;i++){var body=bodies[i],impulse=body.constraintImpulse;if(!(body.isStatic||0===impulse.x&&0===impulse.y&&0===impulse.angle)){Sleeping$2.set(body,!1);for(var j=0;j<body.parts.length;j++){var part=body.parts[j];Vertices$7.translate(part.vertices,impulse),j>0&&(part.position.x+=impulse.x,part.position.y+=impulse.y),0!==impulse.angle&&(Vertices$7.rotate(part.vertices,impulse.angle,body.position),Axes$1.rotate(part.axes,impulse.angle),j>0&&Vector$5.rotateAbout(part.position,impulse.angle,body.position,part.position)),Bounds$5.update(part.bounds,part.vertices,body.velocity)}impulse.angle*=Constraint$5._warming,impulse.x*=Constraint$5._warming,impulse.y*=Constraint$5._warming}}},Constraint$5.pointAWorld=function(constraint){return{x:(constraint.bodyA?constraint.bodyA.position.x:0)+constraint.pointA.x,y:(constraint.bodyA?constraint.bodyA.position.y:0)+constraint.pointA.y}},Constraint$5.pointBWorld=function(constraint){return{x:(constraint.bodyB?constraint.bodyB.position.x:0)+constraint.pointB.x,y:(constraint.bodyB?constraint.bodyB.position.y:0)+constraint.pointB.y}};var Composites$2={},Composites_1=Composites$2,Composite$6=Composite_1,Constraint$4=Constraint_1,Common$a=Common_1,Body$4=Body_1,Bodies$5=Bodies_1;Composites$2.stack=function(xx,yy,columns,rows,columnGap,rowGap,callback){for(var lastBody,stack=Composite$6.create({label:"Stack"}),x=xx,y=yy,i=0,row=0;row<rows;row++){for(var maxHeight=0,column=0;column<columns;column++){var body=callback(x,y,column,row,lastBody,i);if(body){var bodyHeight=body.bounds.max.y-body.bounds.min.y,bodyWidth=body.bounds.max.x-body.bounds.min.x;bodyHeight>maxHeight&&(maxHeight=bodyHeight),Body$4.translate(body,{x:.5*bodyWidth,y:.5*bodyHeight}),x=body.bounds.max.x+columnGap,Composite$6.addBody(stack,body),lastBody=body,i+=1}else x+=columnGap}y+=maxHeight+rowGap,x=xx}return stack},Composites$2.chain=function(composite,xOffsetA,yOffsetA,xOffsetB,yOffsetB,options){for(var bodies=composite.bodies,i=1;i<bodies.length;i++){var bodyA=bodies[i-1],bodyB=bodies[i],bodyAHeight=bodyA.bounds.max.y-bodyA.bounds.min.y,bodyAWidth=bodyA.bounds.max.x-bodyA.bounds.min.x,bodyBHeight=bodyB.bounds.max.y-bodyB.bounds.min.y,defaults={bodyA:bodyA,pointA:{x:bodyAWidth*xOffsetA,y:bodyAHeight*yOffsetA},bodyB:bodyB,pointB:{x:(bodyB.bounds.max.x-bodyB.bounds.min.x)*xOffsetB,y:bodyBHeight*yOffsetB}},constraint=Common$a.extend(defaults,options);Composite$6.addConstraint(composite,Constraint$4.create(constraint))}return composite.label+=" Chain",composite},Composites$2.mesh=function(composite,columns,rows,crossBrace,options){var row,col,bodyA,bodyB,bodyC,bodies=composite.bodies;for(row=0;row<rows;row++){for(col=1;col<columns;col++)bodyA=bodies[col-1+row*columns],bodyB=bodies[col+row*columns],Composite$6.addConstraint(composite,Constraint$4.create(Common$a.extend({bodyA:bodyA,bodyB:bodyB},options)));if(row>0)for(col=0;col<columns;col++)bodyA=bodies[col+(row-1)*columns],bodyB=bodies[col+row*columns],Composite$6.addConstraint(composite,Constraint$4.create(Common$a.extend({bodyA:bodyA,bodyB:bodyB},options))),crossBrace&&col>0&&(bodyC=bodies[col-1+(row-1)*columns],Composite$6.addConstraint(composite,Constraint$4.create(Common$a.extend({bodyA:bodyC,bodyB:bodyB},options)))),crossBrace&&col<columns-1&&(bodyC=bodies[col+1+(row-1)*columns],Composite$6.addConstraint(composite,Constraint$4.create(Common$a.extend({bodyA:bodyC,bodyB:bodyB},options))))}return composite.label+=" Mesh",composite},Composites$2.pyramid=function(xx,yy,columns,rows,columnGap,rowGap,callback){return Composites$2.stack(xx,yy,columns,rows,columnGap,rowGap,(function(x,y,column,row,lastBody,i){var actualRows=Math.min(rows,Math.ceil(columns/2)),lastBodyWidth=lastBody?lastBody.bounds.max.x-lastBody.bounds.min.x:0;if(!(row>actualRows||column<(row=actualRows-row)||column>columns-1-row))return 1===i&&Body$4.translate(lastBody,{x:(column+(columns%2==1?1:-1))*lastBodyWidth,y:0}),callback(xx+(lastBody?column*lastBodyWidth:0)+column*columnGap,y,column,row,lastBody,i)}))},Composites$2.newtonsCradle=function(xx,yy,number,size,length){for(var newtonsCradle=Composite$6.create({label:"Newtons Cradle"}),i=0;i<number;i++){var circle=Bodies$5.circle(xx+i*(1.9*size),yy+length,size,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),constraint=Constraint$4.create({pointA:{x:xx+i*(1.9*size),y:yy},bodyB:circle});
vendor: 5,154 bytes, lines 757-763
757Composite$6.addBody(newtonsCradle,circle),Composite$6.addConstraint(newtonsCradle,constraint)}return newtonsCradle},Composites$2.car=function(xx,yy,width,height,wheelSize){var group=Body$4.nextGroup(!0),wheelAOffset=.5*-width+20,wheelBOffset=.5*width-20,car=Composite$6.create({label:"Car"}),body=Bodies$5.rectangle(xx,yy,width,height,{collisionFilter:{group:group},chamfer:{radius:.5*height},density:2e-4}),wheelA=Bodies$5.circle(xx+wheelAOffset,yy+0,wheelSize,{collisionFilter:{group:group},friction:.8}),wheelB=Bodies$5.circle(xx+wheelBOffset,yy+0,wheelSize,{collisionFilter:{group:group},friction:.8}),axelA=Constraint$4.create({bodyB:body,pointB:{x:wheelAOffset,y:0},bodyA:wheelA,stiffness:1,length:0}),axelB=Constraint$4.create({bodyB:body,pointB:{x:wheelBOffset,y:0},bodyA:wheelB,stiffness:1,length:0});return Composite$6.addBody(car,body),Composite$6.addBody(car,wheelA),Composite$6.addBody(car,wheelB),Composite$6.addConstraint(car,axelA),Composite$6.addConstraint(car,axelB),car},Composites$2.softBody=function(xx,yy,columns,rows,columnGap,rowGap,crossBrace,particleRadius,particleOptions,constraintOptions){particleOptions=Common$a.extend({inertia:1/0},particleOptions),constraintOptions=Common$a.extend({stiffness:.2,render:{type:"line",anchors:!1}},constraintOptions);var softBody=Composites$2.stack(xx,yy,columns,rows,columnGap,rowGap,(function(x,y){return Bodies$5.circle(x,y,particleRadius,particleOptions)}));return Composites$2.mesh(softBody,columns,rows,crossBrace,constraintOptions),softBody.label="Soft Body",softBody};var Svg$2={},Svg_1=Svg$2,Common$9=Common_1;Svg$2.pathToVertices=function(path,sampleLength){"undefined"==typeof window||"SVGPathSeg"in window||Common$9.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,il,total,point,segment,segments,segmentsQueue,lastSegment,lastPoint,lx,ly,points=[],length=0,x=0,y=0;sampleLength=sampleLength||15;var addPoint=function(px,py,pathSegType){var isRelative=pathSegType%2==1&&pathSegType>1;if(!lastPoint||px!=lastPoint.x||py!=lastPoint.y){lastPoint&&isRelative?(lx=lastPoint.x,ly=lastPoint.y):(lx=0,ly=0);var point={x:lx+px,y:ly+py};!isRelative&&lastPoint||(lastPoint=point),points.push(point),x=lx+px,y=ly+py}},addSegmentPoint=function(segment){var segType=segment.pathSegTypeAsLetter.toUpperCase();if("Z"!==segType){switch(segType){case"M":case"L":case"T":case"C":case"S":case"Q":x=segment.x,y=segment.y;break;case"H":x=segment.x;break;case"V":y=segment.y}addPoint(x,y,segment.pathSegType)}};for(Svg$2._svgPathToAbsolute(path),total=path.getTotalLength(),segments=[],i=0;i<path.pathSegList.numberOfItems;i+=1)segments.push(path.pathSegList.getItem(i));for(segmentsQueue=segments.concat();length<total;){if((segment=segments[path.getPathSegAtLength(length)])!=lastSegment){for(;segmentsQueue.length&&segmentsQueue[0]!=segment;)addSegmentPoint(segmentsQueue.shift());lastSegment=segment}switch(segment.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":point=path.getPointAtLength(length),addPoint(point.x,point.y,0)}length+=sampleLength}for(i=0,il=segmentsQueue.length;i<il;++i)addSegmentPoint(segmentsQueue[i]);return points},Svg$2._svgPathToAbsolute=function(path){for(var x0,y0,x1,y1,x2,y2,segs=path.pathSegList,x=0,y=0,len=segs.numberOfItems,i=0;i<len;++i){var seg=segs.getItem(i),segType=seg.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(segType))"x"in seg&&(x=seg.x),"y"in seg&&(y=seg.y);else switch("x1"in seg&&(x1=x+seg.x1),"x2"in seg&&(x2=x+seg.x2),"y1"in seg&&(y1=y+seg.y1),"y2"in seg&&(y2=y+seg.y2),"x"in seg&&(x+=seg.x),"y"in seg&&(y+=seg.y),segType){case"m":segs.replaceItem(path.createSVGPathSegMovetoAbs(x,y),i);break;case"l":segs.replaceItem(path.createSVGPathSegLinetoAbs(x,y),i);break;case"h":segs.replaceItem(path.createSVGPathSegLinetoHorizontalAbs(x),i);break;case"v":segs.replaceItem(path.createSVGPathSegLinetoVerticalAbs(y),i);break;case"c":segs.replaceItem(path.createSVGPathSegCurvetoCubicAbs(x,y,x1,y1,x2,y2),i);break;case"s":segs.replaceItem(path.createSVGPathSegCurvetoCubicSmoothAbs(x,y,x2,y2),i);break;case"q":segs.replaceItem(path.createSVGPathSegCurvetoQuadraticAbs(x,y,x1,y1),i);break;case"t":segs.replaceItem(path.createSVGPathSegCurvetoQuadraticSmoothAbs(x,y),i);break;case"a":segs.replaceItem(path.createSVGPathSegArcAbs(x,y,seg.r1,seg.r2,seg.angle,seg.largeArcFlag,seg.sweepFlag),i);break;case"z":case"Z":x=x0,y=y0}"M"!=segType&&"m"!=segType||(x0=x,y0=y)}};
758/**
759	 * @author       Richard Davey <[email protected]>
760	 * @copyright    2020 Photon Storm Ltd.
761	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
762	 */
763var Components$5=components$1,GetFastValue$g=GetFastValue_1,Vector2$h=Vector2_1;var MatterGameObject_1=function(world,gameObject,options,addToWorld){void 0===options&&(options={}),void 0===addToWorld&&(addToWorld=!0);var x=gameObject.x,y=gameObject.y;if(gameObject.body={temp:!0,position:{x:x,y:y}},[Components$5.Bounce,Components$5.Collision,Components$5.Force,Components$5.Friction,Components$5.Gravity,Components$5.Mass,Components$5.Sensor,Components$5.SetBody,Components$5.Sleep,Components$5.Static,Components$5.Transform,Components$5.Velocity].forEac
763h((function(mixin){for(var key in mixin)(def=mixin[key]).get&&"function"==typeof def.get||def.set&&"function"==typeof def.set?Object.defineProperty(gameObject,key,{get:mixin[key].get,set:mixin[key].set}):Object.defineProperty(gameObject,key,{value:mixin[key]});var def})),gameObject.world=world,gameObject._tempVec2=new Vector2$h(x,y),options.hasOwnProperty("type")&&"body"===options.type)gameObject.setExistingBody(options,addToWorld);else{var shape=GetFastValue$g(options,"shape",null);shape||(shape="rectangle"),options.addToWorld=addToWorld,gameObject.setBody(shape,options)}return gameObject},GameObject$2=GameObject_1,GetFastValue$f=GetFastValue_1,Vector2$g=Vector2_1,MatterImage_1=new Class_1({Extends:Image_1,Mixins:[components$1.Bounce,components$1.Collision,components$1.Force,components$1.Friction,components$1.Gravity,components$1.Mass,components$1.Sensor,components$1.SetBody,components$1.Sleep,components$1.Static,components$1.Transform,components$1.Velocity,Pipeline_1],initialize:function(world,x,y,texture,frame,options){GameObject$2.call(this,world.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(texture,frame),this.setSizeToFrame(),this.setOrigin(),this.world=world,this._tempVec2=new Vector2$g(x,y);var shape=GetFastValue$f(options,"shape",null);shape?this.setBody(shape,options):this.setRectangle(this.width,this.height,options),this.setPosition(x,y),this.initPipeline()}}),AnimationState=AnimationState_1,GameObject$1=GameObject_1,GetFastValue$e=GetFastValue_1,Vector2$f=Vector2_1,MatterSprite_1=new Class_1({Extends:Sprite_1,Mixins:[components$1.Bounce,components$1.Collision,components$1.Force,components$1.Friction,components$1.Gravity,components$1.Mass,components$1.Sensor,components$1.SetBody,components$1.Sleep,components$1.Static,components$1.Transform,components$1.Velocity,Pipeline_1],initialize:function(world,x,y,texture,frame,options){GameObject$1.call(this,world.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new AnimationState(this),this.setTexture(texture,frame),this.setSizeToFrame(),this.setOrigin(),this.world=world,this._tempVec2=new Vector2$f(x,y);var shape=GetFastValue$e(options,"shape",null);shape?this.setBody(shape,options):this.setRectangle(this.width,this.height,options),this.setPosition(x,y),this.initPipeline()}}),Bodies$4=Bodies_1,Body$3=Body_1,EventEmitter$3=eventemitter3.exports,GetFastValue$d=GetFastValue_1,HasValue$2=HasValue_1,Vertices$6=Vertices_1,MatterTileBody$2=new Class_1({Extends:EventEmitter$3,Mixins:[components$1.Bounce,components$1.Collision,components$1.Friction,components$1.Gravity,components$1.Mass,components$1.Sensor,components$1.Sleep,components$1.Static],initialize:function(world,tile,options){EventEmitter$3.call(this),this.tile=tile,this.world=world,tile.physics.matterBody&&tile.physics.matterBody.destroy(),tile.physics.matterBody=this;var body=GetFastValue$d(options,"body",null),addToWorld=GetFastValue$d(options,"addToWorld",!0);if(body)this.setBody(body,addToWorld);else{var collisionGroup=tile.getCollisionGroup();GetFastValue$d(collisionGroup,"objects",[]).length>0?this.setFromTileCollision(options):this.setFromTileRectangle(options)}},setFromTileRectangle:function(options){void 0===options&&(options={}),HasValue$2(options,"isStatic")||(options.isStatic=!0),HasValue$2(options,"addToWorld")||(options.addToWorld=!0);var bounds=this.tile.getBounds(),cx=bounds.x+bounds.width/2,cy=bounds.y+bounds.height/2,body=Bodies$4.rectangle(cx,cy,bounds.width,bounds.height,options);return this.setBody(body,options.addToWorld),this},setFromTileCollision:function(options){void 0===options&&(options={}),HasValue$2(options,"isStatic")||(options.isStatic=!0),HasValue$2(options,"addToWorld")||(options.addToWorld=!0);for(var sx=this.tile.tilemapLayer.scaleX,sy=this.tile.tilemapLayer.scaleY,tileX=this.tile.getLeft(),tileY=this.tile.getTop(),collisionGroup=this.tile.getCollisionGroup(),collisionObjects=GetFastValue$d(collisionGroup,"objects",[]),parts=[],i=0;i<collisionObjects.length;i++){var object=collisionObjects[i],ox=tileX+object.x*sx,oy=tileY+object.y*sy,ow=object.width*sx,oh=object.height*sy,body=null;if(object.rectangle)body=Bodies$4.rectangle(ox+ow/2,oy+oh/2,ow,oh,options);else if(object.ellipse)body=Bodies$4.circle(ox+ow/2,oy+oh/2,ow/2,o
763ptions);else if(object.polygon||object.polyline){var points=(object.polygon?object.polygon:object.polyline).map((function(p){return{x:p.x*sx,y:p.y*sy}})),vertices=Vertices$6.create(points),center=Vertices$6.centre(vertices);ox+=center.x,oy+=center.y,body=Bodies$4.fromVertices(ox,oy,vertices,options)}body&&parts.push(body)}return 1===parts.length?this.setBody(parts[0],options.addToWorld):parts.length>1&&(options.parts=parts,this.setBody(Body$3.create(options),options.addToWorld)),this},setBody:function(body,addToWorld){return void 0===addToWorld&&(addToWorld=!0),this.body&&this.removeBody(),this.body=body,this.body.gameObject=this,addToWorld&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}}),MatterTileBody_1=MatterTileBody$2,SAT$3={},SAT_1=SAT$3,Vertices$5=Vertices_1,Vector$4=Vector_1;SAT$3.collides=function(bodyA,bodyB,previousCollision){var overlapAB,overlapBA,minOverlap,collision,canReusePrevCol=!1;if(previousCollision){var parentA=bodyA.parent,parentB=bodyB.parent,motion=parentA.speed*parentA.speed+parentA.angularSpeed*parentA.angularSpeed+parentB.speed*parentB.speed+parentB.angularSpeed*parentB.angularSpeed;canReusePrevCol=previousCollision&&previousCollision.collided&&motion<.2,collision=previousCollision}else collision={collided:!1,bodyA:bodyA,bodyB:bodyB};if(previousCollision&&canReusePrevCol){var axisBodyA=collision.axisBody,axisBodyB=axisBodyA===bodyA?bodyB:bodyA,axes=[axisBodyA.axes[previousCollision.axisNumber]];if(minOverlap=SAT$3._overlapAxes(axisBodyA.vertices,axisBodyB.vertices,axes),collision.reused=!0,minOverlap.overlap<=0)return collision.collided=!1,collision}else{if((overlapAB=SAT$3._overlapAxes(bodyA.vertices,bodyB.vertices,bodyA.axes)).overlap<=0)return collision.collided=!1,collision;if((overlapBA=SAT$3._overlapAxes(bodyB.vertices,bodyA.vertices,bodyB.axes)).overlap<=0)return collision.collided=!1,collision;overlapAB.overlap<overlapBA.overlap?(minOverlap=overlapAB,collision.axisBody=bodyA):(minOverlap=overlapBA,collision.axisBody=bodyB),collision.axisNumber=minOverlap.axisNumber}collision.bodyA=bodyA.id<bodyB.id?bodyA:bodyB,collision.bodyB=bodyA.id<bodyB.id?bodyB:bodyA,collision.collided=!0,collision.depth=minOverlap.overlap,collision.parentA=collision.bodyA.parent,collision.parentB=collision.bodyB.parent,bodyA=collision.bodyA,bodyB=collision.bodyB,Vector$4.dot(minOverlap.axis,Vector$4.sub(bodyB.position,bodyA.position))<0?collision.normal={x:minOverlap.axis.x,y:minOverlap.axis.y}:collision.normal={x:-minOverlap.axis.x,y:-minOverlap.axis.y},collision.tangent=Vector$4.perp(collision.normal),collision.penetration=collision.penetration||{},collision.penetration.x=collision.normal.x*collision.depth,collision.penetration.y=collision.normal.y*collision.depth;var verticesB=SAT$3._findSupports(bodyA,bodyB,collision.normal),supports=[];if(Vertices$5.contains(bodyA.vertices,verticesB[0])&&supports.push(verticesB[0]),Vertices$5.contains(bodyA.vertices,verticesB[1])&&supports.push(verticesB[1]),supports.length<2){var verticesA=SAT$3._findSupports(bodyB,bodyA,Vector$4.neg(collision.normal));Vertices$5.contains(bodyB.vertices,verticesA[0])&&supports.push(verticesA[0]),supports.length<2&&Vertices$5.contains(bodyB.vertices,verticesA[1])&&supports.push(verticesA[1])}return supports.length<1&&(supports=[verticesB[0]]),collision.supports=supports,collision},SAT$3._overlapAxes=function(verticesA,verticesB,axes){for(var overlap,axis,projectionA=Vector$4._temp[0],projectionB=Vector$4._temp[1],result={overlap:Number.MAX_VALUE},i=0;i<axes.length;i++){if(axis=axes[i],SAT$3._projectToAxis(projectionA,verticesA,axis),SAT$3._projectToAxis(projectionB,verticesB,axis),(overlap=Math.min(projectionA.max-projectionB.min,projectionB.max-projectionA.min))<=0)return result.overlap=overlap,result;overlap<result.overlap&&(result.overlap=overlap,result.axis=axis,result.axisNumber=i)}return result},SAT$3._projectToAxis=function(projection,vertices,axis){for(var min=Vector$4.dot(vertices[0],axis),max=min,i=1;i<vertices.length;i+=1){var dot=Vector$4.dot(vertices[i],axis);dot>max?max=dot:dot<min&&(min=dot)}projection.min=min,projection.max=max},SAT$3._findSupports=function(bodyA,bodyB,normal){for(var distance,vertex,vertexA,vertexB,nearestDistance=Number.MAX_VALUE,vertexToBody=Vector$4._temp[0],vertices=bodyB.vertices,bodyAPosition=bodyA.position,i=0;i<vertices.length;i++)vertex=vertices[i],vertexToBody.x=vertex.x-bodyAPosition.x,vertexToBody.y=vertex.y-bodyAPosition.y,(distance=-Vector$4.dot(normal,vertexToBody))<nearestDistance&&(nearestDistance=distance,vertexA
763=vertex);return vertex=vertices[vertexA.index-1>=0?vertexA.index-1:vertices.length-1],vertexToBody.x=vertex.x-bodyAPosition.x,vertexToBody.y=vertex.y-bodyAPosition.y,nearestDistance=-Vector$4.dot(normal,vertexToBody),vertexB=vertex,vertex=vertices[(vertexA.index+1)%vertices.length],vertexToBody.x=vertex.x-bodyAPosition.x,vertexToBody.y=vertex.y-bodyAPosition.y,(distance=-Vector$4.dot(normal,vertexToBody))<nearestDistance&&(vertexB=vertex),[vertexA,vertexB]};var Pair$4={},Pair_1=Pair$4;Pair$4.create=function(collision,timestamp){var bodyA=collision.bodyA,bodyB=collision.bodyB,pair={id:Pair$4.id(bodyA,bodyB),bodyA:bodyA,bodyB:bodyB,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:bodyA.isSensor||bodyB.isSensor,timeCreated:timestamp,timeUpdated:timestamp,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return Pair$4.update(pair,collision,timestamp),pair},Pair$4.update=function(pair,collision,timestamp){if(pair.collision=collision,collision.collided){var supports=collision.supports,activeContacts=pair.activeContacts,parentA=collision.parentA,parentB=collision.parentB;pair.inverseMass=parentA.inverseMass+parentB.inverseMass,pair.friction=Math.min(parentA.friction,parentB.friction),pair.frictionStatic=Math.max(parentA.frictionStatic,parentB.frictionStatic),pair.restitution=Math.max(parentA.restitution,parentB.restitution),pair.slop=Math.max(parentA.slop,parentB.slop);for(var i=0;i<supports.length;i++)activeContacts[i]=supports[i].contact;var supportCount=supports.length;supportCount<activeContacts.length&&(activeContacts.length=supportCount),pair.separation=collision.depth,Pair$4.setActive(pair,!0,timestamp)}else!0===pair.isActive&&Pair$4.setActive(pair,!1,timestamp)},Pair$4.setActive=function(pair,isActive,timestamp){isActive?(pair.isActive=!0,pair.timeUpdated=timestamp):(pair.isActive=!1,pair.activeContacts.length=0)},Pair$4.id=function(bodyA,bodyB){return bodyA.id<bodyB.id?"A"+bodyA.id+"B"+bodyB.id:"A"+bodyB.id+"B"+bodyA.id};var Detector$3={},Detector_1=Detector$3,SAT$2=SAT_1,Pair$3=Pair_1,Bounds$4=Bounds_1;Detector$3.collisions=function(broadphasePairs,engine){for(var collisions=[],pairsTable=engine.pairs.table,metrics=engine.metrics,i=0;i<broadphasePairs.length;i++){var bodyA=broadphasePairs[i][0],bodyB=broadphasePairs[i][1];if((!bodyA.isStatic&&!bodyA.isSleeping||!bodyB.isStatic&&!bodyB.isSleeping)&&Detector$3.canCollide(bodyA.collisionFilter,bodyB.collisionFilter)&&(metrics.midphaseTests+=1,Bounds$4.overlaps(bodyA.bounds,bodyB.bounds)))for(var j=bodyA.parts.length>1?1:0;j<bodyA.parts.length;j++)for(var partA=bodyA.parts[j],k=bodyB.parts.length>1?1:0;k<bodyB.parts.length;k++){var partB=bodyB.parts[k];if(partA===bodyA&&partB===bodyB||Bounds$4.overlaps(partA.bounds,partB.bounds)){var previousCollision,pair=pairsTable[Pair$3.id(partA,partB)];previousCollision=pair&&pair.isActive?pair.collision:null;var collision=SAT$2.collides(partA,partB,previousCollision);metrics.narrowphaseTests+=1,collision.reused&&(metrics.narrowReuseCount+=1),collision.collided&&(collisions.push(collision),metrics.narrowDetections+=1)}}}return collisions},Detector$3.canCollide=function(filterA,filterB){return filterA.group===filterB.group&&0!==filterA.group?filterA.group>0:0!=(filterA.mask&filterB.category)&&0!=(filterB.mask&filterA.category)};
764/**
765	 * @author       Richard Davey <[email protected]>
766	 * @copyright    2020 Photon Storm Ltd.
767	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
768	 */
769var Bounds$3=Bounds_1,Composite$5=Composite_1,Constraint$3=Constraint_1,Detector$2=Detector_1,Events$5=events$1,InputEvents=events$8,Merge$1=Merge_1,Sleeping$1=Sleeping_1,Vector2$e=Vector2_1,Vertices$4=Vertices_1,PointerConstraint$1=new Class_1({initialize:function(scene,world,options){void 0===options&&(options={});this.scene=scene,this.world=world,this.camera=null,this.pointer=null,this.active=!0,this.position=new Vector2$e,this.body=null,this.part=null,this.constraint=Constraint$3.create(Merge$1(options,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(Events$5.BEFORE_UPDATE,this.update,this),scene.sys.input.on(InputEvents.POINTER_DOWN,this.onDown,this),scene.sys.input.on(InputEvents.POINTER_UP,this.onUp,this)},onDown:function(pointer){this.pointer||(this.pointer=pointer,this.camera=pointer.camera)},onUp:function(pointer){pointer===this.pointer&&(this.pointer=null)},getBody:function(pointer){var pos=this.position,constraint=this.constraint;this.camera.getWorldPoint(pointer.x,pointer.y,pos);for(var bodies=Composite$5.allBodies(this.world.localWorld),i=0;i<bodies.length;i++){var body=bodies[i];if(!body.ignorePointer&&Bounds$3.contains(body.bounds,pos)&&Detector$2.canCollide(body.collisionFilter,constraint.collisionFilter)&&this.hitTestBody(body,pos))return this.world.emit(Events$5.DRAG_START,body,this.part,this),!0}return!1},hitTestBody:function(body,position){for(var constraint=this.constraint,partsLength=body.parts.length,i=partsLength>1?1:0;i<partsLength;i++){var part=body.parts[i];if(Vertices$4.contains(part.vertices,position))return constraint.pointA=position,constraint.pointB={x:position.x-body.position.x,y:position.y-body.position.y},constraint.bodyB=body,constraint.angleB=body.angle,Sleeping$1.set(body,!1),this.part=part,this.body=body,!0}return!1},update:function(){var pointer=this.pointer,body=this.body;if(this.active&&pointer)if(pointer.isDown||!body){if(pointer.isDown){if(!body&&!this.getBody(pointer))return;body=this.body;var pos=this.position,constraint=this.constraint;this.camera.getWorldPoint(pointer.x,pointer.y,pos),constraint.pointA.x=pos.x,constraint.pointA.y=pos.y,Sleeping$1.set(body,!1),this.world.emit(Events$5.DRAG,body,this)}}
769else this.stopDrag();else body&&this.stopDrag()},stopDrag:function(){var body=this.body,constraint=this.constraint;constraint.bodyB=null,constraint.pointB=null,this.pointer=null,this.body=null,this.part=null,body&&this.world.emit(Events$5.DRAG_END,body,this)},destroy:function(){this.world.removeConstraint(this.constraint),this.pointer=null,this.constraint=null,this.body=null,this.part=null,this.world.off(Events$5.BEFORE_UPDATE,this.update),this.scene.sys.input.off(InputEvents.POINTER_DOWN,this.onDown,this),this.scene.sys.input.off(InputEvents.POINTER_UP,this.onUp,this)}}),PointerConstraint_1=PointerConstraint$1,Bodies$3=Bodies_1,Composites$1=Composites_1,Constraint$2=Constraint_1,Svg$1=Svg_1,MatterGameObject=MatterGameObject_1,MatterImage=MatterImage_1,MatterSprite=MatterSprite_1,MatterTileBody$1=MatterTileBody_1,PhysicsEditorParser=PhysicsEditorParser_1,PhysicsJSONParser=PhysicsJSONParser_1,PointerConstraint=PointerConstraint_1,Vertices$3=Vertices_1,Factory$1=new Class_1({initialize:function(world){this.world=world,this.scene=world.scene,this.sys=world.scene.sys},rectangle:function(x,y,width,height,options){var body=Bodies$3.rectangle(x,y,width,height,options);return this.world.add(body),body},trapezoid:function(x,y,width,height,slope,options){var body=Bodies$3.trapezoid(x,y,width,height,slope,options);return this.world.add(body),body},circle:function(x,y,radius,options,maxSides){var body=Bodies$3.circle(x,y,radius,options,maxSides);return this.world.add(body),body},polygon:function(x,y,sides,radius,options){var body=Bodies$3.polygon(x,y,sides,radius,options);return this.world.add(body),body},fromVertices:function(x,y,vertexSets,options,flagInternal,removeCollinear,minimumArea){"string"==typeof vertexSets&&(vertexSets=Vertices$3.fromPath(vertexSets));var body=Bodies$3.fromVertices(x,y,vertexSets,options,flagInternal,removeCollinear,minimumArea);return this.world.add(body),body},fromPhysicsEditor:function(x,y,config,options,addToWorld){void 0===addToWorld&&(addToWorld=!0);var body=PhysicsEditorParser.parseBody(x,y,config,options);return addToWorld&&!this.world.has(body)&&this.world.add(body),body},fromSVG:function(x,y,xml,scale,options,addToWorld){void 0===scale&&(scale=1),void 0===options&&(options={}),void 0===addToWorld&&(addToWorld=!0);for(var path=xml.getElementsByTagName("path"),vertexSets=[],i=0;i<path.length;i++){var points=Svg$1.pathToVertices(path[i],30);1!==scale&&Vertices$3.scale(points,scale,scale),vertexSets.push(points)}var body=Bodies$3.fromVertices(x,y,vertexSets,options);return addToWorld&&this.world.add(body),body},fromJSON:function(x,y,config,options,addToWorld){void 0===options&&(options={}),void 0===addToWorld&&(addToWorld=!0);var body=PhysicsJSONParser.parseBody(x,y,config,options);return body&&addToWorld&&this.world.add(body),body},imageStack:function(key,frame,x,y,columns,rows,columnGap,rowGap,options){void 0===columnGap&&(columnGap=0),void 0===rowGap&&(rowGap=0),void 0===options&&(options={});var world=this.world,displayList=this.sys.displayList;options.addToWorld=!1;var stack=Composites$1.stack(x,y,columns,rows,columnGap,rowGap,(function(x,y){var image=new MatterImage(world,x,y,key,frame,options);return displayList.add(image),image.body}));return world.add(stack),stack},stack:function(x,y,columns,rows,columnGap,rowGap,callback){var stack=Composites$1.stack(x,y,columns,rows,columnGap,rowGap,callback);return this.world.add(stack),stack},pyramid:function(x,y,columns,rows,columnGap,rowGap,callback){var stack=Composites$1.pyramid(x,y,columns,rows,columnGap,rowGap,callback);return this.world.add(stack),stack},chain:function(composite,xOffsetA,yOffsetA,xOffsetB,yOffsetB,options){return Composites$1.chain(composite,xOffsetA,yOffsetA,xOffsetB,yOffsetB,options)},mesh:function(composite,columns,rows,crossBrace,options){return Composites$1.mesh(composite,columns,rows,crossBrace,options)},newtonsCradle:function(x,y,number,size,length){var composite=Composites$1.newtonsCradle(x,y,number,size,length);return this.world.add(composite),composite},car:function(x,y,width,height,wheelSize){var composite=Composites$1.car(x,y,width,height,wheelSize);return this.world.add(composite),composite},softBody:function(x,y,columns,rows,columnGap,rowGap,crossBrace,particleRadius,particleOptions,constraintOptions){var composite=Composites$1.softBody(x,y,columns,rows,columnGap,rowGap,crossBrace,particleRadius,particleOptions,constraintOptions);return this.world.add(composite),composite},joint:function(bodyA,bodyB,length,stiffness,options){return this.constraint(bodyA,bodyB,length,stiffness,options)},spring:function(bodyA,bodyB,length,stiffness,options){return this.constraint(bodyA,bodyB,length,stiffness,options)},constraint:function(bodyA,bodyB,length,stiffness,options){void 0===stiffness&&(stiffness=1),void 0===options&&(options={}),options.bodyA="body"===bodyA.type?bodyA:bodyA.body,options.bodyB="body"===bodyB.type?bodyB:bodyB.body,isNaN(length)||(options.length=length),options.stiffness=stiffness;var constraint=Constraint$2.create(options);return this.world.add(constraint),constraint},worldConstraint:function(body,length,stiffness,options){void 0===stiffness&&(stiffness=1),void 0===options&&(options={}),options.bodyB="body"===body.type?body:body.body,isNaN(length)||(options.length=length),options.stiffness=stiffness;var constraint=Constraint$2.create(options);return this.world.add(constraint),constraint},mouseSpring:function(options){return this.pointerConstraint(options)},pointerConstraint:function(options){void 0===options&&(options={}),options.hasOwnProperty("render")||(options.render={visible:!1});var pointerConstraint=new PointerConstraint(this.scene,this.world,options);return this.world.add(pointerConstraint.constraint),pointerConstraint},image:function(x,y,key,frame,options){var image=new MatterImage(this.world,x,y,key,frame,options);return this.sys.displayList.add(image),image},tileBody:function(tile,options){return new MatterTileBody$1(this.world,tile,options)},sprite:function(x,y,key,frame,options){var sprite=new MatterSprite(this.world,x,y,key,frame,options);return this.sys.displayList.add(sprite),this.sys.updateList.add(sprite),sprite},gameObject:function(gameObject,options,addToWorld){return MatterGameObject(this.world,gameObject,options,addToWorld)},destroy:function(){this.world=null,this.scene=null,this.sys=null}}),Factory_1=Factory$1,Plugin$2={},Plugin_1=Plugin$2,Common$8=Common_1;Plugin$2._registry={},Plugin$2.register=function(plugin){if(Plugin$2.isPlugin(plugin)||C
769ommon$8.warn("Plugin.register:",Plugin$2.toString(plugin),"does not implement all required fields."),plugin.name in Plugin$2._registry){var registered=Plugin$2._registry[plugin.name],pluginVersion=Plugin$2.versionParse(plugin.version).number,registeredVersion=Plugin$2.versionParse(registered.version).number;pluginVersion>registeredVersion?(Common$8.warn("Plugin.register:",Plugin$2.toString(registered),"was upgraded to",Plugin$2.toString(plugin)),Plugin$2._registry[plugin.name]=plugin):pluginVersion<registeredVersion?Common$8.warn("Plugin.register:",Plugin$2.toString(registered),"can not be downgraded to",Plugin$2.toString(plugin)):plugin!==registered&&Common$8.warn("Plugin.register:",Plugin$2.toString(plugin),"is already registered to different plugin object")}else Plugin$2._registry[plugin.name]=plugin;return plugin},Plugin$2.resolve=function(dependency){return Plugin$2._registry[Plugin$2.dependencyParse(dependency).name]},Plugin$2.toString=function(plugin){return"string"==typeof plugin?plugin:(plugin.name||"anonymous")+"@"+(plugin.version||plugin.range||"0.0.0")},Plugin$2.isPlugin=function(obj){return obj&&obj.name&&obj.version&&obj.install},Plugin$2.isUsed=function(module,name){return module.used.indexOf(name)>-1},Plugin$2.isFor=function(plugin,module){var parsed=plugin.for&&Plugin$2.dependencyParse(plugin.for);return!plugin.for||module.name===parsed.name&&Plugin$2.versionSatisfies(module.version,parsed.range)},Plugin$2.use=function(module,plugins){if(module.uses=(module.uses||[]).concat(plugins||[]),0!==module.uses.length){for(var dependencies=Plugin$2.dependencies(module),sortedDependencies=Common$8.topologicalSort(dependencies),status=[],i=0;i<sortedDependencies.length;i+=1)if(sortedDependencies[i]!==module.name){var plugin=Plugin$2.resolve(sortedDependencies[i]);plugin?Plugin$2.isUsed(module,plugin.name)||(Plugin$2.isFor(plugin,module)||(Common$8.warn("Plugin.use:",Plugin$2.toString(plugin),"is for",plugin.for,"but installed on",Plugin$2.toString(module)+"."),plugin._warned=!0),plugin.install?plugin.install(module):(Common$8.warn("Plugin.use:",Plugin$2.toString(plugin),"does not specify an install function."),plugin._warned=!0),plugin._warned?(status.push("🔶 "+Plugin$2.toString(plugin)),delete plugin._warned):status.push("✅ "+Plugin$2.toString(plugin)),module.used.push(plugin.name)):status.push("❌ "+sortedDependencies[i])}status.length>0&&!plugin.silent&&Common$8.info(status.join("  "))}else Common$8.warn("Plugin.use:",Plugin$2.toString(module),"does not specify any dependencies to install.")},Plugin$2.dependencies=function(module,tracked){var parsedBase=Plugin$2.dependencyParse(module),name=parsedBase.name;if(!(name in(tracked=tracked||{}))){module=Plugin$2.resolve(module)||module,tracked[name]=Common$8.map(module.uses||[],(function(dependency){Plugin$2.isPlugin(dependency)&&Plugin$2.register(dependency);var parsed=Plugin$2.dependencyParse(dependency),resolved=Plugin$2.resolve(dependency);return resolved&&!Plugin$2.versionSatisfies(resolved.version,parsed.range)?(Common$8.warn("Plugin.dependencies:",Plugin$2.toString(resolved),"does not satisfy",Plugin$2.toString(parsed),"used by",Plugin$2.toString(parsedBase)+"."),resolved._warned=!0,module._warned=!0):resolved||(Common$8.warn("Plugin.dependencies:",Plugin$2.toString(dependency),"used by",Plugin$2.toString(parsedBase),"could not be resolved."),module._warned=!0),parsed.name}));for(var i=0;i<tracked[name].length;i+=1)Plugin$2.dependencies(tracked[name][i],tracked);return tracked}},Plugin$2.dependencyParse=function(dependency){return Common$8.isString(dependency)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(dependency)||Common$8.warn("Plugin.dependencyParse:",dependency,"is not a valid dependency string."),{name:dependency.split("@")[0],range:dependency.split("@")[1]||"*"}):{name:dependency.name,range:dependency.range||dependency.version}},Plugin$2.versionParse=function(range){/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(range)||Common$8.warn("Plugin.versionParse:",range,"is not a valid version or range.");var identifiers=range.split("-");range=identifiers[0];var isRange=isNaN(Number(range[0])),version=isRange?range.substr(1):range,parts=Common$8.map(version.split("."),(function(part){return Number(part)}));return{isRange:isRange,version:version,range:range,operator:isRange?range[0]:"",parts:parts,prerelease:identifiers[1],number:1e8*parts[0]+1e4*parts[1]+parts[2]}},Plugin$2.versionSatisfies=function(version,range){range=range||"*";var rangeParsed=Plugin$2.versionParse(range),rangeParts=rangeParsed.parts,versionParsed=Plugin$2.versionParse(version),versionParts=versionParsed.parts;if(rangeParsed.isRange){if("*"===rangeParsed.operator||"*"===version)return!0;
769if("~"===rangeParsed.operator)return versionParts[0]===rangeParts[0]&&versionParts[1]===rangeParts[1]&&versionParts[2]>=rangeParts[2];if("^"===rangeParsed.operator)return rangeParts[0]>0?versionParts[0]===rangeParts[0]&&versionParsed.number>=rangeParsed.number:rangeParts[1]>0?versionParts[1]===rangeParts[1]&&versionParts[2]>=rangeParts[2]:versionParts[2]===rangeParts[2]}return version===range||"*"===version};var Matter$3={},Matter_1=Matter$3,Plugin$1=Plugin_1,Common$7=Common_1;Matter$3.name="matter-js",Matter$3.version="0.14.2",Matter$3.uses=[],Matter$3.used=[],Matter$3.use=function(){Plugin$1.use(Matter$3,Array.prototype.slice.call(arguments))},Matter$3.before=function(path,func){return path=path.replace(/^Matter./,""),Common$7.chainPathBefore(Matter$3,path,func)},Matter$3.after=function(path,func){return path=path.replace(/^Matter./,""),Common$7.chainPathAfter(Matter$3,path,func)};var World$3={},World_1$1=World$3,Composite$4=Composite_1,Common$6=Common_1;World$3.create=function(options){var composite=Composite$4.create(),defaults={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return Common$6.extend(composite,defaults,options)};var Grid$2={},Grid_1=Grid$2,Pair$2=Pair_1,Detector$1=Detector_1,Common$5=Common_1;Grid$2.create=function(options){var defaults={controller:Grid$2,detector:Detector$1.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return Common$5.extend(defaults,options)},Grid$2.update=function(grid,bodies,engine,forceUpdate){var i,col,row,bucket,bucketId,world=engine.world,buckets=grid.buckets,gridChanged=!1,metrics=engine.metrics;for(metrics.broadphaseTests=0,i=0;i<bodies.length;i++){var body=bodies[i];if((!body.isSleeping||forceUpdate)&&!(body.bounds.max.x<world.bounds.min.x||body.bounds.min.x>world.bounds.max.x||body.bounds.max.y<world.bounds.min.y||body.bounds.min.y>world.bounds.max.y)){var newRegion=Grid$2._getRegion(grid,body);if(!body.region||newRegion.id!==body.region.id||forceUpdate){metrics.broadphaseTests+=1,body.region&&!forceUpdate||(body.region=newRegion);var union=Grid$2._regionUnion(newRegion,body.region);for(col=union.startCol;col<=union.endCol;col++)for(row=union.startRow;row<=union.endRow;row++){bucket=buckets[bucketId=Grid$2._getBucketId(col,row)];var isInsideNewRegion=col>=newRegion.startCol&&col<=newRegion.endCol&&row>=newRegion.startRow&&row<=newRegion.endRow,isInsideOldRegion=col>=body.region.startCol&&col<=body.region.endCol&&row>=body.region.startRow&&row<=body.region.endRow;!isInsideNewRegion&&isInsideOldRegion&&isInsideOldRegion&&bucket&&Grid$2._bucketRemoveBody(grid,bucket,body),(body.region===newRegion||isInsideNewRegion&&!isInsideOldRegion||forceUpdate)&&(bucket||(bucket=Grid$2._createBucket(buckets,bucketId)),Grid$2._bucketAddBody(grid,bucket,body))}body.region=newRegion,gridChanged=!0}}}gridChanged&&(grid.pairsList=Grid$2._createActivePairsList(grid))},Grid$2.clear=function(grid){grid.buckets={},grid.pairs={},grid.pairsList=[]},Grid$2._regionUnion=function(regionA,regionB){var startCol=Math.min(regionA.startCol,regionB.startCol),endCol=Math.max(regionA.endCol,regionB.endCol),startRow=Math.min(regionA.startRow,regionB.startRow),endRow=Math.max(regionA.endRow,regionB.endRow);return Grid$2._createRegion(startCol,endCol,startRow,endRow)},Grid$2._getRegion=function(grid,body){var bounds=body.bounds,startCol=Math.floor(bounds.min.x/grid.bucketWidth),endCol=Math.floor(bounds.max.x/grid.bucketWidth),startRow=Math.floor(bounds.min.y/grid.bucketHeight),endRow=Math.floor(bounds.max.y/grid.bucketHeight);return Grid$2._createRegion(startCol,endCol,startRow,endRow)},Grid$2._createRegion=function(startCol,endCol,startRow,endRow){return{id:startCol+","+endCol+","+startRow+","+endRow,startCol:startCol,endCol:endCol,startRow:startRow,endRow:endRow}},Grid$2._getBucketId=function(column,row){return"C"+column+"R"+row},Grid$2._createBucket=function(buckets,bucketId){return buckets[bucketId]=[]},Grid$2._bucketAddBody=function(grid,bucket,body){for(var i=0;i<bucket.length;i++){var bodyB=bucket[i];if(!(body.id===bodyB.id||body.isStatic&&bodyB.isStatic)){var pairId=Pair$2.id(body,bodyB),pair=grid.pairs[pairId];pair?pair[2]+=1:grid.pairs[pairId]=[body,bodyB,1]}}bucket.push(body)},Grid$2._bucketRemoveBody=function(grid,bucket,body){bucket.splice(bucket.indexOf(body),1);for(var i=0;i<bucket.length;i++){var bodyB=bucket[i],pairId=Pair$2.id(body,bodyB),pair=grid.pairs[pairId];pair&&(pair[2]-=1)}}
769,Grid$2._createActivePairsList=function(grid){var pairKeys,pair,pairs=[];pairKeys=Common$5.keys(grid.pairs);for(var k=0;k<pairKeys.length;k++)(pair=grid.pairs[pairKeys[k]])[2]>0?pairs.push(pair):delete grid.pairs[pairKeys[k]];return pairs};var Pairs$2={},Pairs_1=Pairs$2,Pair$1=Pair_1,Common$4=Common_1;Pairs$2._pairMaxIdleLife=1e3,Pairs$2.create=function(options){return Common$4.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},options)},Pairs$2.update=function(pairs,collisions,timestamp){var collision,pairId,pair,i,pairsList=pairs.list,pairsTable=pairs.table,collisionStart=pairs.collisionStart,collisionEnd=pairs.collisionEnd,collisionActive=pairs.collisionActive;for(collisionStart.length=0,collisionEnd.length=0,collisionActive.length=0,i=0;i<pairsList.length;i++)pairsList[i].confirmedActive=!1;for(i=0;i<collisions.length;i++)(collision=collisions[i]).collided&&((pair=pairsTable[pairId=Pair$1.id(collision.bodyA,collision.bodyB)])?(pair.isActive?collisionActive.push(pair):collisionStart.push(pair),Pair$1.update(pair,collision,timestamp),pair.confirmedActive=!0):(pair=Pair$1.create(collision,timestamp),pairsTable[pairId]=pair,collisionStart.push(pair),pairsList.push(pair)));for(i=0;i<pairsList.length;i++)(pair=pairsList[i]).isActive&&!pair.confirmedActive&&(Pair$1.setActive(pair,!1,timestamp),collisionEnd.push(pair))},Pairs$2.removeOld=function(pairs,timestamp){var pair,collision,pairIndex,i,pairsList=pairs.list,pairsTable=pairs.table,indexesToRemove=[];for(i=0;i<pairsList.length;i++)(collision=(pair=pairsList[i]).collision).bodyA.isSleeping||collision.bodyB.isSleeping?pair.timeUpdated=timestamp:timestamp-pair.timeUpdated>Pairs$2._pairMaxIdleLife&&indexesToRemove.push(i);for(i=0;i<indexesToRemove.length;i++)delete pairsTable[(pair=pairsList[pairIndex=indexesToRemove[i]-i]).id],pairsList.splice(pairIndex,1)},Pairs$2.clear=function(pairs){return pairs.table={},pairs.list.length=0,pairs.collisionStart.length=0,pairs.collisionActive.length=0,pairs.collisionEnd.length=0,pairs};var Query$1={},Query_1=Query$1,Vector$3=Vector_1,SAT$1=SAT_1,Bounds$2=Bounds_1,Bodies$2=Bodies_1,Vertices$2=Vertices_1;Query$1.collides=function(body,bodies){for(var collisions=[],i=0;i<bodies.length;i++){var bodyA=bodies[i];if(body!==bodyA&&Bounds$2.overlaps(bodyA.bounds,body.bounds))for(var j=1===bodyA.parts.length?0:1;j<bodyA.parts.length;j++){var part=bodyA.parts[j];if(Bounds$2.overlaps(part.bounds,body.bounds)){var collision=SAT$1.collides(part,body);if(collision.collided){collisions.push(collision);break}}}}return collisions},Query$1.ray=function(bodies,startPoint,endPoint,rayWidth){rayWidth=rayWidth||1e-100;for(var rayAngle=Vector$3.angle(startPoint,endPoint),rayLength=Vector$3.magnitude(Vector$3.sub(startPoint,endPoint)),rayX=.5*(endPoint.x+startPoint.x),rayY=.5*(endPoint.y+startPoint.y),ray=Bodies$2.rectangle(rayX,rayY,rayLength,rayWidth,{angle:rayAngle}),collisions=Query$1.collides(ray,bodies),i=0;i<collisions.length;i+=1){var collision=collisions[i];collision.body=collision.bodyB=collision.bodyA}return collisions},Query$1.region=function(bodies,bounds,outside){for(var result=[],i=0;i<bodies.length;i++){var body=bodies[i],overlaps=Bounds$2.overlaps(body.bounds,bounds);(overlaps&&!outside||!overlaps&&outside)&&result.push(body)}return result},Query$1.point=function(bodies,point){for(var result=[],i=0;i<bodies.length;i++){var body=bodies[i];if(Bounds$2.contains(body.bounds,point))for(var j=1===body.parts.length?0:1;j<body.parts.length;j++){var part=body.parts[j];if(Bounds$2.contains(part.bounds,point)&&Vertices$2.contains(part.vertices,point)){result.push(body);break}}}return result};var Resolver$2={},Resolver_1=Resolver$2,Vertices$1=Vertices_1,Vector$2=Vector_1,Common$3=Common_1,Bounds$1=Bounds_1;Resolver$2._restingThresh=4,Resolver$2._restingThreshTangent=6,Resolver$2._positionDampen=.9,Resolver$2._positionWarming=.8,Resolver$2._frictionNormalMultiplier=5,Resolver$2.preSolvePosition=function(pairs){var i,pair,activeCount;for(i=0;i<pairs.length;i++)(pair=pairs[i]).isActive&&(activeCount=pair.activeContacts.length,pair.collision.parentA.totalContacts+=activeCount,pair.collision.parentB.totalContacts+=activeCount)}
769,Resolver$2.solvePosition=function(pairs,bodies,timeScale){var i,normalX,normalY,pair,collision,bodyA,bodyB,normal,separation,penetration,positionImpulseA,positionImpulseB,contactShare,bodyBtoAX,bodyBtoAY,positionImpulse,impulseCoefficient=timeScale*Resolver$2._positionDampen;for(i=0;i<bodies.length;i++){var body=bodies[i];body.previousPositionImpulse.x=body.positionImpulse.x,body.previousPositionImpulse.y=body.positionImpulse.y}for(i=0;i<pairs.length;i++)(pair=pairs[i]).isActive&&!pair.isSensor&&(bodyA=(collision=pair.collision).parentA,bodyB=collision.parentB,normal=collision.normal,positionImpulseA=bodyA.previousPositionImpulse,positionImpulseB=bodyB.previousPositionImpulse,penetration=collision.penetration,bodyBtoAX=positionImpulseB.x-positionImpulseA.x+penetration.x,bodyBtoAY=positionImpulseB.y-positionImpulseA.y+penetration.y,separation=(normalX=normal.x)*bodyBtoAX+(normalY=normal.y)*bodyBtoAY,pair.separation=separation,positionImpulse=(separation-pair.slop)*impulseCoefficient,(bodyA.isStatic||bodyB.isStatic)&&(positionImpulse*=2),bodyA.isStatic||bodyA.isSleeping||(contactShare=positionImpulse/bodyA.totalContacts,bodyA.positionImpulse.x+=normalX*contactShare,bodyA.positionImpulse.y+=normalY*contactShare),bodyB.isStatic||bodyB.isSleeping||(contactShare=positionImpulse/bodyB.totalContacts,bodyB.positionImpulse.x-=normalX*contactShare,bodyB.positionImpulse.y-=normalY*contactShare))},Resolver$2.postSolvePosition=function(bodies){for(var i=0;i<bodies.length;i++){var body=bodies[i];if(body.totalContacts=0,0!==body.positionImpulse.x||0!==body.positionImpulse.y){for(var j=0;j<body.parts.length;j++){var part=body.parts[j];Vertices$1.translate(part.vertices,body.positionImpulse),Bounds$1.update(part.bounds,part.vertices,body.velocity),part.position.x+=body.positionImpulse.x,part.position.y+=body.positionImpulse.y}body.positionPrev.x+=body.positionImpulse.x,body.positionPrev.y+=body.positionImpulse.y,Vector$2.dot(body.positionImpulse,body.velocity)<0?(body.positionImpulse.x=0,body.positionImpulse.y=0):(body.positionImpulse.x*=Resolver$2._positionWarming,body.positionImpulse.y*=Resolver$2._positionWarming)}}},Resolver$2.preSolveVelocity=function(pairs){var i,j,pair,contacts,collision,bodyA,bodyB,normal,tangent,contact,contactVertex,normalImpulse,tangentImpulse,offset,impulse=Vector$2._temp[0],tempA=Vector$2._temp[1];for(i=0;i<pairs.length;i++)if((pair=pairs[i]).isActive&&!pair.isSensor)for(contacts=pair.activeContacts,bodyA=(collision=pair.collision).parentA,bodyB=collision.parentB,normal=collision.normal,tangent=collision.tangent,j=0;j<contacts.length;j++)contactVertex=(contact=contacts[j]).vertex,normalImpulse=contact.normalImpulse,tangentImpulse=contact.tangentImpulse,0===normalImpulse&&0===tangentImpulse||(impulse.x=normal.x*normalImpulse+tangent.x*tangentImpulse,impulse.y=normal.y*normalImpulse+tangent.y*tangentImpulse,bodyA.isStatic||bodyA.isSleeping||(offset=Vector$2.sub(contactVertex,bodyA.position,tempA),bodyA.positionPrev.x+=impulse.x*bodyA.inverseMass,bodyA.positionPrev.y+=impulse.y*bodyA.inverseMass,bodyA.anglePrev+=Vector$2.cross(offset,impulse)*bodyA.inverseInertia),bodyB.isStatic||bodyB.isSleeping||(offset=Vector$2.sub(contactVertex,bodyB.position,tempA),bodyB.positionPrev.x-=impulse.x*bodyB.inverseMass,bodyB.positionPrev.y-=impulse.y*bodyB.inverseMass,bodyB.anglePrev-=Vector$2.cross(offset,impulse)*bodyB.inverseInertia))},Resolver$2.solveVelocity=function(pairs,timeScale){for(var timeScaleSquared=timeScale*timeScale,impulse=Vector$2._temp[0],tempA=Vector$2._temp[1],tempB=Vector$2._temp[2],tempC=Vector$2._temp[3],tempD=Vector$2._temp[4],tempE=Vector$2._temp[5],i=0;i<pairs.length;i++){var pair=pairs[i];if(pair.isActive&&!pair.isSensor){var collision=pair.collision,bodyA=collision.parentA,bodyB=collision.parentB,normal=collision.normal,tangent=collision.tangent,contacts=pair.activeContacts,contactShare=1/contacts.length;bodyA.velocity.x=bodyA.position.x-bodyA.positionPrev.x,bodyA.velocity.y=bodyA.position.y-bodyA.positionPrev.y,bodyB.velocity.x=bodyB.position.x-bodyB.positionPrev.x,bodyB.velocity.y=bodyB.position.y-bodyB.positionPrev.y,bodyA.angularVelocity=bodyA.angle-bodyA.anglePrev,bodyB.angularVelocity=bodyB.angle-bodyB.anglePrev;for(var j=0;j<contacts.length;j++){var contact=contacts[j],contactVertex=contact.vertex,offsetA=Vector$2.sub(contactVertex,bodyA.position,tempA),offsetB=Vector$2.sub(contactVertex,bodyB.position,tempB),velocityPointA=Vector$2.add(bodyA.velocity,Vector$2.mult(Vector$2.perp(offsetA),bodyA.angularVelocity),tempC),velocityPointB=Vector$2.add(bodyB.velocity,Vector$2.mult(Vector$2.perp(offsetB),bodyB.angularVelocity),tempD),relativeVelocity=Vector$2.sub(velocityPointA,velocityPointB,tempE),normalVelocity=Vector$2.dot(normal,relativeVelocity),tangentVelocity=Vector$2.dot(tangent,relativeVelocity),tangentSpeed=Math.abs(tangentVelocity),tangentVelocityDirection=Common$3.sign(tangentVelocity),normalImpulse=(1+pair.restitution)*normalVelocity,normalForce=Common$3.clamp(pair.separation+normalVelocity,0,1)*Resolver$2._frictionNormalMultiplier,tangentImpulse=tangentVelocity,maxFriction=1/0;tangentSpeed>pair.friction*pair.frictionStatic*normalForce*timeScaleSquared&&(maxFriction=tangentSpeed,tangentImpulse=Common$3.clamp(pair.friction*tangentVelocityDirection*timeScaleSquared,-maxFriction,maxFriction));var oAcN=Vector$2.cross(offsetA,normal),oBcN=Vector$2.cross(offsetB,normal),share=contactShare/(bodyA.inverseMass+bodyB.inverseMass+bodyA.inverseInertia*
769oAcN*oAcN+bodyB.inverseInertia*oBcN*oBcN);if(normalImpulse*=share,tangentImpulse*=share,normalVelocity<0&&normalVelocity*normalVelocity>Resolver$2._restingThresh*timeScaleSquared)contact.normalImpulse=0;else{var contactNormalImpulse=contact.normalImpulse;contact.normalImpulse=Math.min(contact.normalImpulse+normalImpulse,0),normalImpulse=contact.normalImpulse-contactNormalImpulse}if(tangentVelocity*tangentVelocity>Resolver$2._restingThreshTangent*timeScaleSquared)contact.tangentImpulse=0;else{var contactTangentImpulse=contact.tangentImpulse;contact.tangentImpulse=Common$3.clamp(contact.tangentImpulse+tangentImpulse,-maxFriction,maxFriction),tangentImpulse=contact.tangentImpulse-contactTangentImpulse}impulse.x=normal.x*normalImpulse+tangent.x*tangentImpulse,impulse.y=normal.y*normalImpulse+tangent.y*tangentImpulse,bodyA.isStatic||bodyA.isSleeping||(bodyA.positionPrev.x+=impulse.x*bodyA.inverseMass,bodyA.positionPrev.y+=impulse.y*bodyA.inverseMass,bodyA.anglePrev+=Vector$2.cross(offsetA,impulse)*bodyA.inverseInertia),bodyB.isStatic||bodyB.isSleeping||(bodyB.positionPrev.x-=impulse.x*bodyB.inverseMass,bodyB.positionPrev.y-=impulse.y*bodyB.inverseMass,bodyB.anglePrev-=Vector$2.cross(offsetB,impulse)*bodyB.inverseInertia)}}}};var Metrics$1={},Metrics_1=Metrics$1,Composite$3=Composite_1,Common$2=Common_1;Metrics$1.create=function(options){return Common$2.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,options)},Metrics$1.reset=function(metrics){metrics.extended&&(metrics.narrowDetections=0,metrics.narrowphaseTests=0,metrics.narrowReuse=0,metrics.narrowReuseCount=0,metrics.midphaseTests=0,metrics.broadphaseTests=0,metrics.narrowEff=0,metrics.midEff=0,metrics.broadEff=0,metrics.collisions=0,metrics.buckets=0,metrics.pairs=0,metrics.bodies=0)},Metrics$1.update=function(metrics,engine){if(metrics.extended){var world=engine.world,bodies=Composite$3.allBodies(world);metrics.collisions=metrics.narrowDetections,metrics.pairs=engine.pairs.list.length,metrics.bodies=bodies.length,metrics.midEff=(metrics.narrowDetections/(metrics.midphaseTests||1)).toFixed(2),metrics.narrowEff=(metrics.narrowDetections/(metrics.narrowphaseTests||1)).toFixed(2),metrics.broadEff=(1-metrics.broadphaseTests/(bodies.length||1)).toFixed(2),metrics.narrowReuse=(metrics.narrowReuseCount/(metrics.narrowphaseTests||1)).toFixed(2)}};var Engine$1={},Engine_1=Engine$1,World$2=World_1$1,Sleeping=Sleeping_1,Resolver$1=Resolver_1,Pairs$1=Pairs_1,Metrics=Metrics_1,Grid$1=Grid_1,Events$4=Events_1,Composite$2=Composite_1,Constraint$1=Constraint_1,Common$1=Common_1,Body$2=Body_1;Engine$1.create=function(element,options){options=(options=Common$1.isElement(element)?options:element)||{},((element=Common$1.isElement(element)?element:null)||options.render)&&Common$1.warn("Engine.create: engine.render is deprecated (see docs)");var defaults={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:Grid$1}},engine=Common$1.extend(defaults,options);return engine.world=options.world||World$2.create(engine.world),engine.pairs=Pairs$1.create(),engine.broadphase=engine.broadphase.controller.create(engine.broadphase),engine.metrics=engine.metrics||{extended:!1},engine.metrics=Metrics.create(engine.metrics),engine},Engine$1.update=function(engine,delta,correction){delta=delta||1e3/60,correction=correction||1;var i,world=engine.world,timing=engine.timing,broadphase=engine.broadphase,broadphasePairs=[];timing.timestamp+=delta*timing.timeScale;var event={timestamp:timing.timestamp};Events$4.trigger(engine,"beforeUpdate",event);var allBodies=Composite$2.allBodies(world),allConstraints=Composite$2.allConstraints(world);for(Metrics.reset(engine.metrics),engine.enableSleeping&&Sleeping.update(allBodies,timing.timeScale),Engine$1._bodiesApplyGravity(allBodies,world.gravity),Engine$1._bodiesUpdate(allBodies,delta,timing.timeScale,correction,world.bounds),Constraint$1.preSolveAll(allBodies),i=0;i<engine.constraintIterations;i++)Constraint$1.solveAll(allConstraints,timing.timeScale);Constraint$1.postSolveAll(allBodies),broadphase.controller?(world.isModified&&broadphase.controller.clear(broadphase),broadphase.controller.update(broadphase,allBodies,engine,world.isModified),broadphasePairs=broadphase.pairsList):broadphasePairs=allBodies,world.isModified&&Composite$2.setModified(world,!1,!1,!0);var collisions=broadphase.detector(broadphasePairs,engine),pairs=engine.pairs,timestamp=timing.timestamp;for(Pairs$1.update(pairs,collisions,timestamp),Pairs$1.removeOld(pairs,timestamp),engine.enableSleeping&&Sleeping.afterCollisions(pairs.list,timing.timeScale),pairs.collisionStart.length>0&&Events$4.trigger(engine,"collisionStart",{pairs:pairs.collisionStart}),Resolver$1.preSolvePosition(pairs.list),i=0;i<engine.positionIterations;i++)Resolver$1.solvePosition(pairs.list,allBodies,timing.timeScale);for(Resolver$1.postSolvePosition(allBodies),Constraint$1.preSolveAll(allBodies),i=0;i<engine.constraintIterations;i++)Constraint$1.solveAll(allConstraints,timing.timeScale);for(Constraint$1.postSolveAll(allBodies),Resolver$1.preSolveVelocity(pairs.list),i=0;i<engine.velocityIterations;i++)Resolver$1.solveVelocity(pairs.list,timing.timeScale);
769return pairs.collisionActive.length>0&&Events$4.trigger(engine,"collisionActive",{pairs:pairs.collisionActive}),pairs.collisionEnd.length>0&&Events$4.trigger(engine,"collisionEnd",{pairs:pairs.collisionEnd}),Metrics.update(engine.metrics,engine),Engine$1._bodiesClearForces(allBodies),Events$4.trigger(engine,"afterUpdate",event),engine},Engine$1.merge=function(engineA,engineB){if(Common$1.extend(engineA,engineB),engineB.world){engineA.world=engineB.world,Engine$1.clear(engineA);for(var bodies=Composite$2.allBodies(engineA.world),i=0;i<bodies.length;i++){var body=bodies[i];Sleeping.set(body,!1),body.id=Common$1.nextId()}}},Engine$1.clear=function(engine){var world=engine.world;Pairs$1.clear(engine.pairs);var broadphase=engine.broadphase;if(broadphase.controller){var bodies=Composite$2.allBodies(world);broadphase.controller.clear(broadphase),broadphase.controller.update(broadphase,bodies,engine,!0)}},Engine$1._bodiesClearForces=function(bodies){for(var i=0;i<bodies.length;i++){var body=bodies[i];body.force.x=0,body.force.y=0,body.torque=0}},Engine$1._bodiesApplyGravity=function(bodies,gravity){var gravityScale=void 0!==gravity.scale?gravity.scale:.001;if((0!==gravity.x||0!==gravity.y)&&0!==gravityScale)for(var i=0;i<bodies.length;i++){var body=bodies[i];body.ignoreGravity||body.isStatic||body.isSleeping||(body.force.x+=body.mass*gravity.x*gravityScale*body.gravityScale.x,body.force.y+=body.mass*gravity.y*gravityScale*body.gravityScale.y)}},Engine$1._bodiesUpdate=function(bodies,deltaTime,timeScale,correction,worldBounds){for(var i=0;i<bodies.length;i++){var body=bodies[i];body.isStatic||body.isSleeping||Body$2.update(body,deltaTime,timeScale,correction)}};
770/**
771	 * @author       Richard Davey <[email protected]>
772	 * @copyright    2020 Photon Storm Ltd.
773	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
774	 */
775var Matter$2=Matter_1;Matter$2.Body=Body_1,Matter$2.Composite=Composite_1,Matter$2.World=World_1$1,Matter$2.Detector=Detector_1,Matter$2.Grid=Grid_1,Matter$2.Pairs=Pairs_1,Matter$2.Pair=Pair_1,Matter$2.Query=Query_1,Matter$2.Resolver=Resolver_1,Matter$2.SAT=SAT_1,Matter$2.Constraint=Constraint_1,Matter$2.Common=Common_1,Matter$2.Engine=Engine_1,Matter$2.Events=Events_1,Matter$2.Sleeping=Sleeping_1,Matter$2.Plugin=Plugin_1,Matter$2.Bodies=Bodies_1,Matter$2.Composites=Composites_1,Matter$2.Axes=Axes_1,Matter$2.Bounds=Bounds_1,Matter$2.Svg=Svg_1,Matter$2.Vector=Vector_1,Matter$2.Vertices=Vertices_1,Matter$2.World.add=Matter$2.Composite.add,Matter$2.World.remove=Matter$2.Composite.remove,Matter$2.World.addComposite=Matter$2.Composite.addComposite,Matter$2.World.addBody=Matter$2.Composite.addBody,Matter$2.World.addConstraint=Matter$2.Composite.addConstraint,Matter$2.World.clear=Matter$2.Composite.clear;var CustomMain=Matter$2,Matter$1=CustomMain,MatterAttractors$1={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.14.2",silent:!0,install:function(base){base.after("Body.create",(function(){MatterAttractors$1.Body.init(this)})),base.before("Engine.update",(function(engine){MatterAttractors$1.Engine.update(engine)}))},Body:{init:function(body){body.plugin.attractors=body.plugin.attractors||[]}},Engine:{update:function(engine){for(var bodies=Matter$1.Composite.allBodies(engine.world),i=0;i<bodies.length;i++){var bodyA=bodies[i],attractors=bodyA.plugin.attractors;if(attractors&&attractors.length>0)for(var j=0;j<bodies.length;j++){var bodyB=bodies[j];if(i!==j)for(var k=0;k<attractors.length;k++){var attractor=attractors[k],forceVector=attractor;Matter$1.Common.isFunction(attractor)&&(forceVector=attractor(bodyA,bodyB)),forceVector&&Matter$1.Body.applyForce(bodyB,bodyB.position,forceVector)}}}}},Attractors:{gravityConstant:.001,gravity:function(bodyA,bodyB){var bToA=Matter$1.Vector.sub(bodyB.position,bodyA.position),distanceSq=Matter$1.Vector.magnitudeSquared(bToA)||1e-4,normal=Matter$1.Vector.normalise(bToA),magnitude=-MatterAttractors$1.Attractors.gravityConstant*(bodyA.mass*bodyB.mass/distanceSq),force=Matter$1.Vector.mult(normal,magnitude);Matter$1.Body.applyForce(bodyA,bodyA.position,Matter$1.Vector.neg(force)),Matter$1.Body.applyForce(bodyB,bodyB.position,force)}}},MatterAttractors_1=MatterAttractors$1,MatterCollisionEvents_1={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.14.2",silent:!0,install:function(matter){matter.after("Engine.create",(function(){matter.Events.on(this,"collisionStart",(function(event){event.pairs.map((function(pair){var bodyA=pair.bodyA,bodyB=pair.bodyB;bodyA.gameObject&&bodyA.gameObject.emit("collide",bodyA,bodyB,pair),bodyB.gameObject&&bodyB.gameObject.emit("collide",bodyB,bodyA,pair),matter.Events.trigger(bodyA,"onCollide",{pair:pair}),matter.Events.trigger(bodyB,"onCollide",{pair:pair}),bodyA.onCollideCallback&&bodyA.onCollideCallback(pair),bodyB.onCollideCallback&&bodyB.onCollideCallback(pair),bodyA.onCollideWith[bodyB.id]&&bodyA.onCollideWith[bodyB.id](bodyB,pair),bodyB.onCollideWith[bodyA.id]&&bodyB.onCollideWith[bodyA.id](bodyA,pair)}))}
775)),matter.Events.on(this,"collisionActive",(function(event){event.pairs.map((function(pair){var bodyA=pair.bodyA,bodyB=pair.bodyB;bodyA.gameObject&&bodyA.gameObject.emit("collideActive",bodyA,bodyB,pair),bodyB.gameObject&&bodyB.gameObject.emit("collideActive",bodyB,bodyA,pair),matter.Events.trigger(bodyA,"onCollideActive",{pair:pair}),matter.Events.trigger(bodyB,"onCollideActive",{pair:pair}),bodyA.onCollideActiveCallback&&bodyA.onCollideActiveCallback(pair),bodyB.onCollideActiveCallback&&bodyB.onCollideActiveCallback(pair)}))})),matter.Events.on(this,"collisionEnd",(function(event){event.pairs.map((function(pair){var bodyA=pair.bodyA,bodyB=pair.bodyB;bodyA.gameObject&&bodyA.gameObject.emit("collideEnd",bodyA,bodyB,pair),bodyB.gameObject&&bodyB.gameObject.emit("collideEnd",bodyB,bodyA,pair),matter.Events.trigger(bodyA,"onCollideEnd",{pair:pair}),matter.Events.trigger(bodyB,"onCollideEnd",{pair:pair}),bodyA.onCollideEndCallback&&bodyA.onCollideEndCallback(pair),bodyB.onCollideEndCallback&&bodyB.onCollideEndCallback(pair)}))}))}))}},Matter=CustomMain,MatterWrap$1={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.14.2",silent:!0,install:function(base){base.after("Engine.update",(function(){MatterWrap$1.Engine.update(this)}))},Engine:{update:function(engine){for(var world=engine.world,bodies=Matter.Composite.allBodies(world),composites=Matter.Composite.allComposites(world),i=0;i<bodies.length;i+=1){var body=bodies[i];body.plugin.wrap&&MatterWrap$1.Body.wrap(body,body.plugin.wrap)}for(i=0;i<composites.length;i+=1){var composite=composites[i];composite.plugin.wrap&&MatterWrap$1.Composite.wrap(composite,composite.plugin.wrap)}}},Bounds:{wrap:function(objectBounds,bounds){var x=null,y=null;if(void 0!==bounds.min.x&&void 0!==bounds.max.x&&(objectBounds.min.x>bounds.max.x?x=bounds.min.x-objectBounds.max.x:objectBounds.max.x<bounds.min.x&&(x=bounds.max.x-objectBounds.min.x)),void 0!==bounds.min.y&&void 0!==bounds.max.y&&(objectBounds.min.y>bounds.max.y?y=bounds.min.y-objectBounds.max.y:objectBounds.max.y<bounds.min.y&&(y=bounds.max.y-objectBounds.min.y)),null!==x||null!==y)return{x:x||0,y:y||0}}},Body:{wrap:function(body,bounds){var translation=MatterWrap$1.Bounds.wrap(body.bounds,bounds);return translation&&Matter.Body.translate(body,translation),translation}},Composite:{bounds:function(composite){for(var bodies=Matter.Composite.allBodies(composite),vertices=[],i=0;i<bodies.length;i+=1){var body=bodies[i];vertices.push(body.bounds.min,body.bounds.max)}return Matter.Bounds.create(vertices)},wrap:function(composite,bounds){var translation=MatterWrap$1.Bounds.wrap(MatterWrap$1.Composite.bounds(composite),bounds);return translation&&Matter.Composite.translate(composite,translation),translation}}},MatterWrap_1=MatterWrap$1,Bodies$1=Bodies_1,Body$1=Body_1,Common=Common_1,Composite$1=Composite_1,Engine=Engine_1,EventEmitter$2=eventemitter3.exports,Events$3=events$1,GetFastValue$c=GetFastValue_1,GetValue$8=GetValue_1,MatterBody=Body_1,MatterEvents=Events_1,MatterTileBody=MatterTileBody_1,MatterWorld=World_1$1,Vector$1=Vector_1,World$1=new Class_1({Extends:EventEmitter$2,initialize:function(scene,config){EventEmitter$2.call(this),this.scene=scene,this.engine=Engine.create(config),this.localWorld=this.engine.world;var gravity=GetValue$8(config,"gravity",null);gravity?this.setGravity(gravity.x,gravity.y,gravity.scale):!1===gravity&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=GetValue$8(config,"enabled",!0),this.correction=GetValue$8(config,"correction",1),this.getDelta=GetValue$8(config,"getDelta",this.update60Hz);var runnerConfig=GetFastValue$c(config,"runner",{}),hasFPS=GetFastValue$c(runnerConfig,"fps",!1),fps=GetFastValue$c(runnerConfig,"fps",60),delta=GetFastValue$c(runnerConfig,"delta",1e3/fps),deltaMin=GetFastValue$c(runnerConfig,"deltaMin",1e3/fps),deltaMax=GetFastValue$c(runnerConfig,"deltaMax",1e3/(.5*fps));hasFPS||(fps=1e3/delta),this.runner={fps:fps,correction:GetFastValue$c(runnerConfig,"correction",1),deltaSampleSize:GetFastValue$c(runnerConfig,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:GetFastValue$c(runnerConfig,"isFixed",!1),delta:delta,deltaMin:deltaMin,deltaMax:deltaMax},this.autoUpdate=GetValue$8(config,"autoUpdate",!0);var debugConfig=GetValue$8(config,"debug",!1);if(this.drawDebug="object"==typeof debugConfig||debugConfig,this.debugGraphic,this.debugConfig={showAxes:GetFastValue$c(debugConfig,"showAxes",!1),showAngleIndicator:GetFastValue$c(debugConfig,"showAngleIndicator",!1),angleColor:GetFastValue$c(debugConfig,"angleColor",15208787),showBroadphase:GetFastValue$c(debugConfig,"showBroadphase",!1),broadphaseColor:GetFastValue$c(debugConfig,"broadphaseColor",16757760),showBounds:GetFastValue$c(debugConfig,"showBounds",!1),boundsColor:GetFastValue$c(debugConfig,"boun
775dsColor",16777215),showVelocity:GetFastValue$c(debugConfig,"showVelocity",!1),velocityColor:GetFastValue$c(debugConfig,"velocityColor",44783),showCollisions:GetFastValue$c(debugConfig,"showCollisions",!1),collisionColor:GetFastValue$c(debugConfig,"collisionColor",16094476),showSeparations:GetFastValue$c(debugConfig,"showSeparations",!1),separationColor:GetFastValue$c(debugConfig,"separationColor",16753920),showBody:GetFastValue$c(debugConfig,"showBody",!0),showStaticBody:GetFastValue$c(debugConfig,"showStaticBody",!0),showInternalEdges:GetFastValue$c(debugConfig,"showInternalEdges",!1),renderFill:GetFastValue$c(debugConfig,"renderFill",!1),renderLine:GetFastValue$c(debugConfig,"renderLine",!0),fillColor:GetFastValue$c(debugConfig,"fillColor",1075465),fillOpacity:GetFastValue$c(debugConfig,"fillOpacity",1),lineColor:GetFastValue$c(debugConfig,"lineColor",2678297),lineOpacity:GetFastValue$c(debugConfig,"lineOpacity",1),lineThickness:GetFastValue$c(debugConfig,"lineThickness",1),staticFillColor:GetFastValue$c(debugConfig,"staticFillColor",857979),staticLineColor:GetFastValue$c(debugConfig,"staticLineColor",1255396),showSleeping:GetFastValue$c(debugConfig,"showSleeping",!1),staticBodySleepOpacity:GetFastValue$c(debugConfig,"staticBodySleepOpacity",.7),sleepFillColor:GetFastValue$c(debugConfig,"sleepFillColor",4605510),sleepLineColor:GetFastValue$c(debugConfig,"sleepLineColor",10066585),showSensors:GetFastValue$c(debugConfig,"showSensors",!0),sensorFillColor:GetFastValue$c(debugConfig,"sensorFillColor",857979),sensorLineColor:GetFastValue$c(debugConfig,"sensorLineColor",1255396),showPositions:GetFastValue$c(debugConfig,"showPositions",!0),positionSize:GetFastValue$c(debugConfig,"positionSize",4),positionColor:GetFastValue$c(debugConfig,"positionColor",14697178),showJoint:GetFastValue$c(debugConfig,"showJoint",!0),jointColor:GetFastValue$c(debugConfig,"jointColor",14737474),jointLineOpacity:GetFastValue$c(debugConfig,"jointLineOpacity",1),jointLineThickness:GetFastValue$c(debugConfig,"jointLineThickness",2),pinSize:GetFastValue$c(debugConfig,"pinSize",4),pinColor:GetFastValue$c(debugConfig,"pinColor",4382944),springColor:GetFastValue$c(debugConfig,"springColor",14697184),anchorColor:GetFastValue$c(debugConfig,"anchorColor",15724527),anchorSize:GetFastValue$c(debugConfig,"anchorSize",4),showConvexHulls:GetFastValue$c(debugConfig,"showConvexHulls",!1),hullColor:GetFastValue$c(debugConfig,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),GetFastValue$c(config,"setBounds",!1)){var boundsConfig=config.setBounds;if("boolean"==typeof boundsConfig)this.setBounds();else{var x=GetFastValue$c(boundsConfig,"x",0),y=GetFastValue$c(boundsConfig,"y",0),width=GetFastValue$c(boundsConfig,"width",scene.sys.scale.width),height=GetFastValue$c(boundsConfig,"height",scene.sys.scale.height),thickness=GetFastValue$c(boundsConfig,"thickness",64),left=GetFastValue$c(boundsConfig,"left",!0),right=GetFastValue$c(boundsConfig,"right",!0),top=GetFastValue$c(boundsConfig,"top",!0),bottom=GetFastValue$c(boundsConfig,"bottom",!0);this.setBounds(x,y,width,height,thickness,left,right,top,bottom)}}},setCompositeRenderStyle:function(composite){var i,obj,render,bodies=composite.bodies,constraints=composite.constraints,composites=composite.composites;for(i=0;i<bodies.length;i++)render=(obj=bodies[i]).render,this.setBodyRenderStyle(obj,render.lineColor,render.lineOpacity,render.lineThickness,render.fillColor,render.fillOpacity);for(i=0;i<constraints.length;i++)render=(obj=constraints[i]).render,this.setConstraintRenderStyle(obj,render.lineColor,render.lineOpacity,render.lineThickness,render.pinSize,render.anchorColor,render.anchorSize);for(i=0;i<composites.length;i++)obj=composites[i],this.setCompositeRenderStyle(obj);return this},setBodyRenderStyle:function(body,lineColor,lineOpacity,lineThickness,fillColor,fillOpacity){var render=body.render,config=this.debugConfig;return render?(null==lineColor&&(lineColor=body.isStatic?config.staticLineColor:config.lineColor),null==lineOpacity&&(lineOpacity=config.lineOpacity),null==lineThickness&&(lineThickness=config.lineThickness),null==fillColor&&(fillColor=body.isStatic?config.staticFillColor:config.fillColor),null==fillOpacity&&(fillOpacity=config.fillOpacity),!1!==lineColor&&(render.lineColor=lineColor),!1!==lineOpacity&&(render.lineOpacity=lineOpacity),!1!==lineThickness&&(render.lineThickness=lineThickness),!1!==fillColor&&(render.fillColor=fillColor),!1!==fillOpacity&&(render.fillOpacity=fillOpacity),this):this},setConstraintRenderStyle:function(constraint,lineColor,lineOpacity,lineThickness,pinSize,anchorColor,anchorSize){var render=constraint.render,config=this.debugConfig;if(!render)return this;if(null==lineColor){var type=render.type;"line"===type?lineColor=config.jointColor:"pin"===type?lineColor=config.pinColor:"spring"===type&&(lineColor=config.springColor)}return null==lineOpacity&&(lineOpacity=config.jointLineOpacity),null==lineThickness&&(lineThickness=config.jointLineThickness),null==pinSize&&(pinSize=config.pinSize),null==anchorColor&&(anchorColor=config.anchorColor),null==anchorSize&&(anchorSize=config.anchorSize),!1!==lineColor&&(render.lineColor=lineColor),!1!==lineOpacity&&(render.lineOpacity=lineOpacity),!1!==lineThickness&&(render.lineThickness=lineThickness),!1!==pinSize&&(render.pinSize=pinSize),!1!==anchorColor&&(render.anchorColor=anchorColor),!1!==anchorSize&&(render.anchorSize=anchorSize),this},setEventsProxy:function(){var _this=this,engine=this.engine,world=this.localWorld;this.drawDebug&&(MatterEvents.on(world,"compositeModified",(function(composite){_this.setCompositeRenderStyle(composite)})),MatterEvents.on(world,"beforeAdd",(function(event){for(var objects=[].concat(event.object),i=0;i<objects.length;i++){var obj=objects[i],render=obj.render;"body"===obj.type?_this.setBodyRenderStyle(obj,render.lineColor,render.lineOpacity,render.lineThickness,render.fillColor,render.fillOpacity):"composite"===obj.type?_this.setCompositeRenderStyle(obj):"constraint"===obj.type&&_this.setConstraintRenderStyle(obj,render.lineColor,render.lineOpacity,render.lineThickness,render.pinSize,render.anchorColor,render.anchorSize)}}))),MatterEvents.on(world,"beforeAdd",(function(event){_this.emit
775(Events$3.BEFORE_ADD,event)})),MatterEvents.on(world,"afterAdd",(function(event){_this.emit(Events$3.AFTER_ADD,event)})),MatterEvents.on(world,"beforeRemove",(function(event){_this.emit(Events$3.BEFORE_REMOVE,event)})),MatterEvents.on(world,"afterRemove",(function(event){_this.emit(Events$3.AFTER_REMOVE,event)})),MatterEvents.on(engine,"beforeUpdate",(function(event){_this.emit(Events$3.BEFORE_UPDATE,event)})),MatterEvents.on(engine,"afterUpdate",(function(event){_this.emit(Events$3.AFTER_UPDATE,event)})),MatterEvents.on(engine,"collisionStart",(function(event){var bodyA,bodyB,pairs=event.pairs;pairs.length>0&&(bodyA=pairs[0].bodyA,bodyB=pairs[0].bodyB),_this.emit(Events$3.COLLISION_START,event,bodyA,bodyB)})),MatterEvents.on(engine,"collisionActive",(function(event){var bodyA,bodyB,pairs=event.pairs;pairs.length>0&&(bodyA=pairs[0].bodyA,bodyB=pairs[0].bodyB),_this.emit(Events$3.COLLISION_ACTIVE,event,bodyA,bodyB)})),MatterEvents.on(engine,"collisionEnd",(function(event){var bodyA,bodyB,pairs=event.pairs;pairs.length>0&&(bodyA=pairs[0].bodyA,bodyB=pairs[0].bodyB),_this.emit(Events$3.COLLISION_END,event,bodyA,bodyB)}))},setBounds:function(x,y,width,height,thickness,left,right,top,bottom){return void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=this.scene.sys.scale.width),void 0===height&&(height=this.scene.sys.scale.height),void 0===thickness&&(thickness=64),void 0===left&&(left=!0),void 0===right&&(right=!0),void 0===top&&(top=!0),void 0===bottom&&(bottom=!0),this.updateWall(left,"left",x-thickness,y-thickness,thickness,height+2*thickness),this.updateWall(right,"right",x+width,y-thickness,thickness,height+2*thickness),this.updateWall(top,"top",x,y-thickness,width,thickness),this.updateWall(bottom,"bottom",x,y+height,width,thickness),this},updateWall:function(add,position,x,y,width,height){var wall=this.walls[position];add?(wall&&MatterWorld.remove(this.localWorld,wall),x+=width/2,y+=height/2,this.walls[position]=this.create(x,y,width,height,{isStatic:!0,friction:0,frictionStatic:0})):(wall&&MatterWorld.remove(this.localWorld,wall),this.walls[position]=null)},createDebugGraphic:function(){var graphic=this.scene.sys.add.graphics({x:0,y:0});return graphic.setDepth(Number.MAX_VALUE),this.debugGraphic=graphic,this.drawDebug=!0,graphic},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(x,y,scale){return void 0===x&&(x=0),void 0===y&&(y=1),this.localWorld.gravity.x=x,this.localWorld.gravity.y=y,void 0!==scale&&(this.localWorld.gravity.scale=scale),this},create:function(x,y,width,height,options){var body=Bodies$1.rectangle(x,y,width,height,options);return MatterWorld.add(this.localWorld,body),body},add:function(object){return MatterWorld.add(this.localWorld,object),this},remove:function(object,deep){Array.isArray(object)||(object=[object]);for(var i=0;i<object.length;i++){var entity=object[i],body=entity.body?entity.body:entity;Composite$1.remove(this.localWorld,body,deep)}return this},removeConstraint:function(constraint,deep){return Composite$1.remove(this.localWorld,constraint,deep),this},convertTilemapLayer:function(tilemapLayer,options){var layerData=tilemapLayer.layer,tiles=tilemapLayer.getTilesWithin(0,0,layerData.width,layerData.height,{isColliding:!0});return this.convertTiles(tiles,options),this},convertTiles:function(tiles,options){if(0===tiles.length)return this;for(var i=0;i<tiles.length;i++)new MatterTileBody(this,tiles[i],options);return this},nextGroup:function(isNonColliding){return MatterBody.nextGroup(isNonColliding)},nextCategory:function(){return MatterBody.nextCategory()},pause:function(){return this.enabled=!1,this.emit(Events$3.PAUSE),this},resume:function(){return this.enabled=!0,this.emit(Events$3.RESUME),this},update:function(time,delta){if(this.enabled&&this.autoUpdate){var engine=this.engine,runner=this.runner,timing=engine.timing,correction=this.correction;runner.isFixed?delta=this.getDelta(time,delta):(delta=time-runner.timePrev||runner.delta,runner.timePrev=time,runner.deltaHistory.push(delta),runner.deltaHistory=runner.deltaHistory.slice(-runner.deltaSampleSize),correction=(delta=(delta=(delta=Math.min.apply(null,runner.deltaHistory)
vendor: 11,604 bytes, line 775
775)<runner.deltaMin?runner.deltaMin:delta)>runner.deltaMax?runner.deltaMax:delta)/runner.delta,runner.delta=delta),0!==runner.timeScalePrev&&(correction*=timing.timeScale/runner.timeScalePrev),0===timing.timeScale&&(correction=0),runner.timeScalePrev=timing.timeScale,runner.correction=correction,runner.frameCounter+=1,time-runner.counterTimestamp>=1e3&&(runner.fps=runner.frameCounter*((time-runner.counterTimestamp)/1e3),runner.counterTimestamp=time,runner.frameCounter=0),Engine.update(engine,delta,correction)}},step:function(delta,correction){Engine.update(this.engine,delta,correction)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(body){var src=body.hasOwnProperty("body")?body.body:body;return null!==Composite$1.get(this.localWorld,src.id,src.type)},getAllBodies:function(){return Composite$1.allBodies(this.localWorld)},getAllConstraints:function(){return Composite$1.allConstraints(this.localWorld)},getAllComposites:function(){return Composite$1.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var config=this.debugConfig,engine=this.engine,graphics=this.debugGraphic,bodies=Composite$1.allBodies(this.localWorld);this.debugGraphic.clear(),config.showBroadphase&&engine.broadphase.controller&&this.renderGrid(engine.broadphase,graphics,config.broadphaseColor,.5),config.showBounds&&this.renderBodyBounds(bodies,graphics,config.boundsColor,.5),(config.showBody||config.showStaticBody)&&this.renderBodies(bodies),config.showJoint&&this.renderJoints(),(config.showAxes||config.showAngleIndicator)&&this.renderBodyAxes(bodies,graphics,config.showAxes,config.angleColor,.5),config.showVelocity&&this.renderBodyVelocity(bodies,graphics,config.velocityColor,1,2),config.showSeparations&&this.renderSeparations(engine.pairs.list,graphics,config.separationColor),config.showCollisions&&this.renderCollisions(engine.pairs.list,graphics,config.collisionColor)}},renderGrid:function(grid,graphics,lineColor,lineOpacity){graphics.lineStyle(1,lineColor,lineOpacity);for(var bucketKeys=Common.keys(grid.buckets),i=0;i<bucketKeys.length;i++){var bucketId=bucketKeys[i];if(!(grid.buckets[bucketId].length<2)){var region=bucketId.split(/C|R/);graphics.strokeRect(parseInt(region[1],10)*grid.bucketWidth,parseInt(region[2],10)*grid.bucketHeight,grid.bucketWidth,grid.bucketHeight)}}return this},renderSeparations:function(pairs,graphics,lineColor){graphics.lineStyle(1,lineColor,1);for(var i=0;i<pairs.length;i++){var pair=pairs[i];if(pair.isActive){var collision=pair.collision,bodyA=collision.bodyA,bodyB=collision.bodyB,posA=bodyA.position,posB=bodyB.position,penetration=collision.penetration,k=bodyA.isStatic||bodyB.isStatic?1:4;bodyB.isStatic&&(k=0),graphics.lineBetween(posB.x,posB.y,posB.x-penetration.x*k,posB.y-penetration.y*k),k=bodyA.isStatic||bodyB.isStatic?1:4,bodyA.isStatic&&(k=0),graphics.lineBetween(posA.x,posA.y,posA.x-penetration.x*k,posA.y-penetration.y*k)}}return this},renderCollisions:function(pairs,graphics,lineColor){var i,pair;for(graphics.lineStyle(1,lineColor,.5),graphics.fillStyle(lineColor,1),i=0;i<pairs.length;i++)if((pair=pairs[i]).isActive)for(var j=0;j<pair.activeContacts.length;j++){var vertex=pair.activeContacts[j].vertex;graphics.fillRect(vertex.x-2,vertex.y-2,5,5)}for(i=0;i<pairs.length;i++)if((pair=pairs[i]).isActive){var collision=pair.collision,contacts=pair.activeContacts;if(contacts.length>0){var normalPosX=contacts[0].vertex.x,normalPosY=contacts[0].vertex.y;2===contacts.length&&(normalPosX=(contacts[0].vertex.x+contacts[1].vertex.x)/2,normalPosY=(contacts[0].vertex.y+contacts[1].vertex.y)/2),collision.bodyB===collision.supports[0].body||collision.bodyA.isStatic?graphics.lineBetween(normalPosX-8*collision.normal.x,normalPosY-8*collision.normal.y,normalPosX,normalPosY):graphics.lineBetween(normalPosX+8*collision.normal.x,normalPosY+8*collision.normal.y,normalPosX,normalPosY)}}return this},renderBodyBounds:function(bodies,graphics,lineColor,lineOpacity){graphics.lineStyle(1,lineColor,lineOpacity);for(var i=0;i<bodies.length;i++){var body=bodies[i];if(body.render.visible){var bounds=body.bounds;if(bounds)graphics.strokeRect(bounds.min.x,bounds.min.y,bounds.max.x-bounds.min.x,bounds.max.y-bounds.min.y);else for(var parts=body.parts,j=parts.length>1?1:0;j<parts.length;j++){var part=parts[j];graphics.strokeRect(part.bounds.min.x,part.bounds.min.y,part.bounds.max.x-part.bounds.min.x,part.bounds.max.y-part.bounds.min.y)}}}return this},renderBodyAxes:function(bodies,graphics,showAxes,lineColor,lineOpacity){graphics.lineStyle(1,lineColor,lineOpacity);for(var i=0;i<bodies.length;i++){var part,j,k,body=bodies[i],parts=body.parts;if(body.render.visible)if(showAxes)for(j=parts.length>1?1:0;j<parts.length;j++)for(part=parts[j],k=0;k<part.axes.length;k++){var axis=part.axes[k];graphics.lineBetween(part.position.x,part.position.y,part.position.x+20*axis.x,part.position.y+20*axis.y)}else for(j=parts.length>1?1:0;j<parts.length;j++)for(part=parts[j],k=0;k<part.axes.length;k++)graphics.lineBetween(part.position.x,part.position.y,(part.vertices[0].x+part.vertices[part.vertices.length-1].x)/2,(part.vertices[0].y+part.vertices[part.vertices.length-1].y)/2)}return this},renderBodyVelocity:function(bodies,graphics,lineColor,lineOpacity,lineThickness){graphics.lineStyle(lineThickness,lineColor,lineOpacity);for(var i=0;i<bodies.length;i++){var body=bodies[i];body.render.visible&&graphics.lineBetween(body.position.x,body.position.y,body.position.x+2*(body.position.x-body.positionPrev.x),body.position.y+2*(body.position.y-body.positionPrev.y))}return this},renderBodies:function(bodies){for(var graphics=this.debugGraphic,config=this.debugConfig,showBody=config.showBody,showStaticBody=config.showStaticBody,showSleeping=config.showSleeping,showInternalEdges=config.showInternalEdges,showConvexHulls=config.showConvexHulls,renderFill=config.renderFill,renderLine=config.renderLine,staticBodySleepOpacity=config.staticBodySleepOpacity,sleepFillColor=config.sleepFillColor,sleepLineColor=config.sleepLineColor,hullColor=config.hullColor,i=0;i<bodies.length;i++){var body=bodies[i];if(body.render.visible&&((showStaticBody||!body.isStatic)&&(showBody||body.isStatic))){var lineColor=body.render.lineColor,lineOpacity=body.render.lineOpacity,lineThickness=body.render.lineThickness,fillColor=body.render.fillColor,fillOpacity=body.render.fillOpacity;showSleeping&&body.isSleeping&&(body.isStatic?(lineOpacity*=staticBodySleepOpacity,fillOpacity*=staticBodySleepOpacity):(lineColor=sleepLineColor,fillColor=sleepFillColor)),renderFill||(fillColor=null),renderLine||(lineColor=null),this.renderBody(body,graphics,showInternalEdges,lineColor,lineOpacity,lineThickness,fillColor,fillOpacity);var partsLength=body.parts.length;showConvexHulls&&partsLength>1&&this.renderConvexHull(body,graphics,hullColor,lineThickness)}}},renderBody:function(body,graphics,showInternalEdges,lineColor,lineOpacity,lineThickness,fillColor,fillOpacity){void 0===lineColor&&(lineColor=null),void 0===lineOpacity&&(lineOpacity=null),void 0===lineThickness&&(lineThickness=1),void 0===fillColor&&(fillColor=null),void 0===fillOpacity&&(fillOpacity=null);for(var config=this.debugConfig,sensorFillColor=config.sensorFillColor,sensorLineColor=config.sensorLineColor,parts=body.parts,partsLength=parts.length,k=partsLength>1?1:0;k<partsLength;k++){var part=parts[k],render=part.render,opacity=render.opacity;if(render.visible&&0!==opacity&&(!part.isSensor||config.showSensors)){var circleRadius=part.circleRadius;if(graphics.beginPath(),part.isSensor?(null!==fillColor&&graphics.fillStyle(sensorFillColor,fillOpacity*opacity),null!==lineColor&&graphics.lineStyle(lineThickness,sensorLineColor,lineOpacity*opacity)):(null!==fillColor&&graphics.fillStyle(fillColor,fillOpacity*opacity),null!==lineColor&&graphics.lineStyle(lineThickness,lineColor,lineOpacity*opacity)),circleRadius)graphics.arc(part.position.x,part.position.y,circleRadius,0,2*Math.PI);else{var vertices=part.vertices,vertLength=vertices.length;graphics.moveTo(vertices[0].x,vertices[0].y);for(var j=1;j<vertLength;j++){var vert=vertices[j];if(!vertices[j-1].isInternal||showInternalEdges?graphics.lineTo(vert.x,vert.y):graphics.moveTo(vert.x,vert.y),j<vertLength&&vert.isInternal&&!showInternalEdges){var nextIndex=(j+1)%vertLength;graphics.moveTo(vertices[nextIndex].x,vertices[nextIndex].y)}}graphics.closePath()}null!==fillColor&&graphics.fillPath(),null!==lineColor&&graphics.strokePath()}}if(config.showPositions&&!body.isStatic){var px=body.position.x,py=body.position.y,hs=Math.ceil(config.positionSize/2);graphics.fillStyle(config.positionColor,1),graphics.fillRect(px-hs,py-hs,config.positionSize,config.positionSize)}return this},renderConvexHull:function(body,graphics,hullColor,lineThickness){if(void 0===lineThickness&&(lineThickness=1),body.parts.length>1){var verts=body.vertices;graphics.lineStyle(lineThickness,hullColor),graphics.beginPath(),graphics.moveTo(verts[0].x,verts[0].y);for(var v=1;v<verts.length;v++)graphics.lineTo(verts[v].x,verts[v].y);graphics.lineTo(verts[0].x,verts[0].y),graphics.strokePath()}return this},renderJoints:function(){for(var graphics=this.debugGraphic,constraints=Composite$1.allConstraints(this.localWorld),i=0;i<constraints.length;i++){var config=constraints[i].render,lineColor=config.lineColor,lineOpacity=config.lineOpacity,lineThickness=config.lineThickness,pinSize=config.pinSize,anchorColor=config.anchorColor,anchorSize=config.anchorSize;this.renderConstraint(constraints[i],graphics,lineColor,lineOpacity,lineThickness,pinSize,anchorColor,anchorSize)}},renderConstraint:function(constraint,graphics,lineColor,lineOpacity,lineThickness,pinSize,anchorColor,anchorSize){var render=constraint.render;if(!render.visible||!constraint.pointA||!constraint.pointB)return this;graphics.lineStyle(lineThickness,lineColor,lineOpacity);var start,end,bodyA=constraint.bodyA,bodyB=constraint.bodyB;if(start=bodyA?Vector$1.add(bodyA.position,constraint.pointA):constraint.pointA,"pin"===render.type)graphics.strokeCircle(start.x,start.y,pinSize);else{if(end=bodyB?Vector$1.add(bodyB.position,constraint.pointB):constraint.pointB,graphics.beginPath(),graphics.moveTo(start.x,start.y),"spring"===render.type)for(var offset,delta=Vector$1.sub(end,start),normal=Vector$1.perp(Vector$1.normalise(delta)),coils=Math.ceil(Common.clamp(constraint.length/5,12,20)),j=1;j<coils;j+=1)offset=j%2==0?1:-1,graphics.lineTo(start.x+delta.x*(j/coils)+normal.x*offset*4,start.y+delta.y*(j/coils)+normal.y*offset*4);graphics.lineTo(end.x,end.y)}return graphics.strokePath(),render.anchors&&anchorSize>0&&(graphics.fillStyle(anchorColor),graphics.fillCircle(start.x,start.y,anchorSize),graphics.fillCircle(end.x,end.y,anchorSize)),this},resetCollisionIDs:function(){return Body$1._nextCollidingGroupId=1,Body$1._nextNonCollidingGroupId=-1,Body$1._nextCategory=1,this},shutdown:function(){MatterEvents.off(this.engine),this.removeAllListeners(),MatterWorld.clear(this.localWorld,!1),Engine.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}}),World_1=World$1,ALIGN_CONST=_const$d,Axes=Axes_1,Bodies=Bodies_1,Body=Body_1,BodyBounds=BodyBounds_1,Bounds=Bounds_1,Composite=Composite_1,Composites=Composites_1,Constraint=Constraint_1,Detector=Detector_1,DistanceBetween=DistanceBetween_1,Factory=Factory_1,GetFastValue$b=GetFastValue_1,GetValue$7=GetValue_1,Grid=Grid_1,MatterAttractors=MatterAttractors_1,MatterCollisionEvents=MatterCollisionEvents_1,MatterLib=Matter_1,MatterWrap=MatterWrap_1,Merge=Merge_1,Pair=Pair_1,Pairs=Pairs_1,Plugin=Plugin_1,PluginCache$3=PluginCache_
7751,Query=Query_1,Resolver=Resolver_1,SAT=SAT_1,SceneEvents$3=events$g,Svg=Svg_1,Vector=Vector_1,Vertices=Vertices_1,World=World_1,MatterPhysics=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=Body,this.composite=Composite,this.detector=Detector,this.grid=Grid,this.pair=Pair,this.pairs=Pairs,this.query=Query,this.resolver=Resolver,this.sat=SAT,this.constraint=Constraint,this.bodies=Bodies,this.composites=Composites,this.axes=Axes,this.bounds=Bounds,this.svg=Svg,this.vector=Vector,this.vertices=Vertices,this.verts=Vertices,this._tempVec2=Vector.create(),GetValue$7(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),GetValue$7(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),GetValue$7(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),Resolver._restingThresh=GetValue$7(this.config,"restingThresh",4),Resolver._restingThreshTangent=GetValue$7(this.config,"restingThreshTangent",6),Resolver._positionDampen=GetValue$7(this.config,"positionDampen",.9),Resolver._positionWarming=GetValue$7(this.config,"positionWarming",.8),Resolver._frictionNormalMultiplier=GetValue$7(this.config,"frictionNormalMultiplier",5),scene.sys.events.once(SceneEvents$3.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$3.START,this.start,this)},boot:function(){this.world=new World(this.scene,this.config),this.add=new Factory(this.world),this.bodyBounds=new BodyBounds,this.systems.events.once(SceneEvents$3.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new World(this.scene,this.config),this.add=new Factory(this.world));var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents$3.UPDATE,this.world.update,this.world),eventEmitter.on(SceneEvents$3.POST_UPDATE,this.world.postUpdate,this.world),eventEmitter.once(SceneEvents$3.SHUTDOWN,this.shutdown,this)},getConfig:function(){var gameConfig=this.systems.game.config.physics,sceneConfig=this.systems.settings.physics;return Merge(GetFastValue$b(sceneConfig,"matter",{}),GetFastValue$b(gameConfig,"matter",{}))},enableAttractorPlugin:function(){return Plugin.register(MatterAttractors),Plugin.use(MatterLib,MatterAttractors),this},enableWrapPlugin:function(){return Plugin.register(MatterWrap),Plugin.use(MatterLib,MatterWrap),this},enableCollisionEventsPlugin:function(){return Plugin.register(MatterCollisionEvents),Plugin.use(MatterLib,MatterCollisionEvents),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(delta,correction){this.world.step(delta,correction)},containsPoint:function(body,x,y){body=this.getMatterBodies(body);var position=Vector.create(x,y);return Query.point(body,position).length>0},intersectPoint:function(x,y,bodies){bodies=this.getMatterBodies(bodies);var position=Vector.create(x,y),output=[];return Query.point(bodies,position).forEach((function(body){-1===output.indexOf(body)&&output.push(body)})),output},intersectRect:function(x,y,width,height,outside,bodies){void 0===outside&&(outside=!1),bodies=this.getMatterBodies(bodies);var bounds={min:{x:x,y:y},max:{x:x+width,y:y+height}},output=[];return Query.region(bodies,bounds,outside).forEach((function(body){-1===output.indexOf(body)&&output.push(body)})),output},intersectRay:function(x1,y1,x2,y2,rayWidth,bodies){void 0===rayWidth&&(rayWidth=1),bodies=this.getMatterBodies(bodies);for(var result=[],collisions=Query.ray(bodies,Vector.create(x1,y1),Vector.create(x2,y2),rayWidth),i=0;i<collisions.length;i++)result.push(collisions[i].body);return result},intersectBody:function(body,bodies){bodies=this.getMatterBodies(bodies);for(var result=[],collisions=Query.collides(body,bodies),i=0;i<collisions.length;i++){var pair=collisions[i];pair.bodyA===body?result.push(pair.bodyB):result.push(pair.bodyA)}return result},overlap:function(target,bodies,overlapCallback,processCallback,callbackContext){void 0===overlapCallback&&(overlapCallback=null),void 0===processCallback&&(processCallback=null),void 0===callbackContext&&(callbackContext=overlapCallback),Array.isArray(target)||(target=[target]),target=this.getMatterBodies(target),bodies=this.getMatterBodies(bodies);for(var match=!1,i=0;i<target.length;i++)for(var entry=target[i],collisions=Query.collides(entry,bodies),c=0;c<collisions.length;c++){var info=collisions[c],bodyB=info.bodyA.id===entry.id?info.bodyB:info.bodyA;if(!processCallback||processCallback.call(callbackContext,entry,bodyB,info))if(match=!0,overlapCallback)overlapCallback.call(callbackContext,entry,bodyB,info);else if(!processCallback)return!0}return match},setCollisionCategory:function(bodies,value){return(bodies=this.getMatterBodies(bodies)).forEac
775h((function(body){body.collisionFilter.category=value})),this},setCollisionGroup:function(bodies,value){return(bodies=this.getMatterBodies(bodies)).forEach((function(body){body.collisionFilter.group=value})),this},setCollidesWith:function(bodies,categories){bodies=this.getMatterBodies(bodies);var flags=0;if(Array.isArray(categories))for(var i=0;i<categories.length;i++)flags|=categories[i];else flags=categories;return bodies.forEach((function(body){body.collisionFilter.mask=flags})),this},getMatterBodies:function(bodies){if(!bodies)return this.world.getAllBodies();Array.isArray(bodies)||(bodies=[bodies]);for(var output=[],i=0;i<bodies.length;i++){var body=bodies[i].hasOwnProperty("body")?bodies[i].body:bodies[i];output.push(body)}return output},setVelocity:function(bodies,x,y){bodies=this.getMatterBodies(bodies);var vec2=this._tempVec2;return vec2.x=x,vec2.y=y,bodies.forEach((function(body){Body.setVelocity(body,vec2)})),this},setVelocityX:function(bodies,x){bodies=this.getMatterBodies(bodies);var vec2=this._tempVec2;return vec2.x=x,bodies.forEach((function(body){vec2.y=body.velocity.y,Body.setVelocity(body,vec2)})),this},setVelocityY:function(bodies,y){bodies=this.getMatterBodies(bodies);var vec2=this._tempVec2;return vec2.y=y,bodies.forEach((function(body){vec2.x=body.velocity.x,Body.setVelocity(body,vec2)})),this},setAngularVelocity:function(bodies,value){return(bodies=this.getMatterBodies(bodies)).forEach((function(body){Body.setAngularVelocity(body,value)})),this},applyForce:function(bodies,force){bodies=this.getMatterBodies(bodies);var vec2=this._tempVec2;return bodies.forEach((function(body){vec2.x=body.position.x,vec2.y=body.position.y,Body.applyForce(body,vec2,force)})),this},applyForceFromPosition:function(bodies,position,speed,angle){bodies=this.getMatterBodies(bodies);var vec2=this._tempVec2;return bodies.forEach((function(body){void 0===angle&&(angle=body.angle),vec2.x=speed*Math.cos(angle),vec2.y=speed*Math.sin(angle),Body.applyForce(body,position,vec2)})),this},applyForceFromAngle:function(bodies,speed,angle){bodies=this.getMatterBodies(bodies);var vec2=this._tempVec2;return bodies.forEach((function(body){void 0===angle&&(angle=body.angle),vec2.x=speed*Math.cos(angle),vec2.y=speed*Math.sin(angle),Body.applyForce(body,{x:body.position.x,y:body.position.y},vec2)})),this},getConstraintLength:function(constraint){var aX=constraint.pointA.x,aY=constraint.pointA.y,bX=constraint.pointB.x,bY=constraint.pointB.y;return constraint.bodyA&&(aX+=constraint.bodyA.position.x,aY+=constraint.bodyA.position.y),constraint.bodyB&&(bX+=constraint.bodyB.position.x,bY+=constraint.bodyB.position.y),DistanceBetween(aX,aY,bX,bY)},alignBody:function(body,x,y,align){var pos;switch(body=body.hasOwnProperty("body")?body.body:body,align){case ALIGN_CONST.TOP_LEFT:case ALIGN_CONST.LEFT_TOP:pos=this.bodyBounds.getTopLeft(body,x,y);break;case ALIGN_CONST.TOP_CENTER:pos=this.bodyBounds.getTopCenter(body,x,y);break;case ALIGN_CONST.TOP_RIGHT:case ALIGN_CONST.RIGHT_TOP:pos=this.bodyBounds.getTopRight(body,x,y);break;case ALIGN_CONST.LEFT_CENTER:pos=this.bodyBounds.getLeftCenter(body,x,y);break;case ALIGN_CONST.CENTER:pos=this.bodyBounds.getCenter(body,x,y);break;case ALIGN_CONST.RIGHT_CENTER:pos=this.bodyBounds.getRightCenter(body,x,y);break;case ALIGN_CONST.LEFT_BOTTOM:case ALIGN_CONST.BOTTOM_LEFT:pos=this.bodyBounds.getBottomLeft(body,x,y);break;case ALIGN_CONST.BOTTOM_CENTER:pos=this.bodyBounds.getBottomCenter(body,x,y);break;case ALIGN_CONST.BOTTOM_RIGHT:case ALIGN_CONST.RIGHT_BOTTOM:pos=this.bodyBounds.getBottomRight(body,x,y)}return pos&&Body.setPosition(body,pos),this},shutdown:function(){var eventEmitter=this.systems.events;this.world&&(eventEmitter.off(SceneEvents$3.UPDATE,this.world.update,this.world),eventEmitter.off(SceneEvents$3.POST_UPDATE,this.world.postUpdate,this.world)),eventEmitter.off(SceneEvents$3.SHUTDOWN,this.shutdown,this),this.add&&this.add.destroy(),this.world&&this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off(SceneEvents$3.START,this.start,this),this.scene=null,this.systems=null}});PluginCache$3.register("MatterPhysics",MatterPhysics,"matterPhysics");var physics={Arcade:arcade,Matter:{BodyBounds:BodyBounds_1,Components:components$1,Events:events$1,Factory:Factory_1,MatterGameObject:MatterGameObject_1,Image:MatterImage_1,Matter:CustomMain,MatterPhysics:MatterPhysics,PolyDecomp:polyDecomp,Sprite:MatterSprite_1,TileBody:MatterTileBody_1,PhysicsEditorParser:PhysicsEditorParser_1,PhysicsJSONParser:PhysicsJSONParser_1,PointerConstraint:PointerConstraint_1,World:World_1}},BasePlugin_1=new Class_1({initialize:function(pluginManager){this.pluginManager=pluginManager,this.game=pluginManager.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}}),BasePlugin=BasePlugin_1,SceneEvents$2=events$g,ScenePlugin$1=new Class_1({Extends:BasePlugin,initialize:function(scene,pluginManager,pluginKey){BasePlugin.call(this,pluginManager),this.scene=scene,this.systems=scene.sys,this.pluginKey=pluginKey,scene.sys.events.once(SceneEvents$2.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}}),plugins={BasePlugin:BasePlugin_1,DefaultPlugins:DefaultPlugins_1,PluginCache:PluginCache_
7751,PluginManager:PluginManager_1,ScenePlugin:ScenePlugin$1},canvas={CanvasRenderer:CanvasRenderer_1,GetBlendModes:GetBlendModes_1,SetTransform:SetTransform_1},snapshot={Canvas:CanvasSnapshot_1,WebGL:WebGLSnapshot_1},PostFXFrag=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{","    gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n"),ColorMatrix=ColorMatrix_1,GetFastValue$a=GetFastValue_1,ShaderSourceFS=PostFXFrag,ShaderSourceVS=QuadVert,WebGLPipeline=WebGLPipeline_1,PostFXPipeline=new Class_1({Extends:WebGLPipeline,initialize:function(config){config.renderTarget=GetFastValue$a(config,"renderTarget",1),config.fragShader=GetFastValue$a(config,"fragShader",ShaderSourceFS),config.vertShader=GetFastValue$a(config,"vertShader",ShaderSourceVS),config.attributes=GetFastValue$a(config,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),config.batchSize=1,config.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],WebGLPipeline.call(this,config),this.isPostFX=!0,this.gameObject,this.colorMatrix=new ColorMatrix,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){WebGLPipeline.prototype.boot.call(this);var utility=this.manager.UTILITY_PIPELINE;this.fullFrame1=utility.fullFrame1,this.fullFrame2=utility.fullFrame2,this.halfFrame1=utility.halfFrame1,this.halfFrame2=utility.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(renderTarget){this.bindAndDraw(renderTarget)},copyFrame:function(source,target,brightness,clear,clearAlpha){this.manager.copyFrame(source,target,brightness,clear,clearAlpha)},copyToGame:function(source){this.manager.copyToGame(source)},drawFrame:function(source,target,clearAlpha){this.manager.drawFrame(source,target,clearAlpha,this.colorMatrix)},blendFrames:function(source1,source2,target,strength,clearAlpha){this.manager.blendFrames(source1,source2,target,strength,clearAlpha)},blendFramesAdditive:function(source1,source2,target,strength,clearAlpha){this.manager.blendFramesAdditive(source1,source2,target,strength,clearAlpha)},clearFrame:function(target,clearAlpha){this.manager.clearFrame(target,clearAlpha)},blitFrame:function(source,target,brightness,clear,clearAlpha,eraseMode){this.manager.blitFrame(source,target,brightness,clear,clearAlpha,eraseMode)},copyFrameRect:function(source,target,x,y,width,height,clear,clearAlpha){this.manager.copyFrameRect(source,target,x,y,width,height,clear,clearAlpha)},bindAndDraw:function(source,target,clear,clearAlpha,currentShader){void 0===clear&&(clear=!0),void 0===clearAlpha&&(clearAlpha=!0);var gl=this.gl,renderer=this.renderer;this.bind(currentShader),this.set1i("uMainSampler",0),target?(gl.viewport(0,0,target.width,target.height),gl.bindFramebuffer(gl.FRAMEBUFFER,target.framebuffer),gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,target.texture,0),clear&&(clearAlpha?gl.clearColor(0,0,0,0):gl.clearColor(0,0,0,1),gl.clear(gl.COLOR_BUFFER_BIT))):(renderer.popFramebuffer(!1,!1,!1),renderer.currentFramebuffer||gl.viewport(0,0,renderer.width,renderer.height)),gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,source.texture),gl.bufferData(gl.ARRAY_BUFFER,this.vertexData,gl.STATIC_DRAW),gl.drawArrays(gl.TRIANGLES,0,6),target?(gl.bindTexture(gl.TEXTURE_2D,null),gl.bindFramebuffer(gl.FRAMEBUFFER,null)):renderer.resetTextures()}}),Pipelines={BitmapMaskPipeline:BitmapMaskPipeline_1,Events:events$a,GraphicsPipeline:GraphicsPipeline_1,LightPipeline:LightPipeline_1,MultiPipeline:MultiPipeline_1,PointLightPipeline:PointLightPipeline_1,PostFXPipeline:PostFXPipeline,RopePipeline:RopePipeline_1,SinglePipeline:SinglePipeline_1,UtilityPipeline:UtilityPipeline_1},WebGL={PipelineManager:PipelineManager_1,Pipelines:Pipelines=Extend_1$1(!1,Pipelines,_const$9),RenderTarget:RenderTarget_1,Utils:Utils$p,WebGLPipeline:WebGLPipeline_1,WebGLRenderer:WebGLRenderer_1,WebGLShader:WebGLShader_1}
775,renderer={Canvas:canvas,Events:events$j,Snapshot:snapshot,WebGL:WebGL=Extend_1$1(!1,WebGL,_const$8)},Extend$6=Extend_1$1,CONST$j=_const$7,Scale={Center:CENTER_CONST,Events:events$c,Orientation:ORIENTATION_CONST$1,ScaleManager:ScaleManager_1,ScaleModes:SCALE_MODE_CONST,Zoom:ZOOM_CONST};
776/**
777	 * @author       Richard Davey <[email protected]>
778	 * @copyright    2020 Photon Storm Ltd.
779	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
780	 */Scale=Extend$6(!1,Scale,CONST$j.CENTER),Scale=Extend$6(!1,Scale,CONST$j.ORIENTATION),Scale=Extend$6(!1,Scale,CONST$j.SCALE_MODE);var scale=Scale=Extend$6(!1,Scale,CONST$j.ZOOM),Clamp$1=Clamp_1,Events$2=events$g,GetFastValue$9=GetFastValue_1,PluginCache$2=PluginCache_1,ScenePlugin=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.settings=scene.sys.settings,this.key=scene.sys.settings.key,this.manager=scene.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,scene.sys.events.once(Events$2.BOOT,this.boot,this),scene.sys.events.on(Events$2.START,this.pluginStart,this)},boot:function(){this.systems.events.once(Events$2.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(Events$2.SHUTDOWN,this.shutdown,this)},start:function(key,data){return void 0===key&&(key=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",key,data),this},restart:function(data){var key=this.key;return this.manager.queueOp("stop",key),this.manager.queueOp("start",key,data),this},transition:function(config){void 0===config&&(config={});var key=GetFastValue$9(config,"target",!1),target=this.manager.getScene(key);if(!key||!this.checkValidTransition(target))return!1;var duration=GetFastValue$9(config,"duration",1e3);this._elapsed=0,this._target=target,this._duration=duration,this._willSleep=GetFastValue$9(config,"sleep",!1),this._willRemove=GetFastValue$9(config,"remove",!1);var callback=GetFastValue$9(config,"onUpdate",null);callback&&(this._onUpdate=callback,this._onUpdateScope=GetFastValue$9(config,"onUpdateScope",this.scene));var allowInput=GetFastValue$9(config,"allowInput",!1);this.settings.transitionAllowInput=allowInput;var targetSettings=target.sys.settings;return targetSettings.isTransition=!0,targetSettings.transitionFrom=this.scene,targetSettings.transitionDuration=duration,targetSettings.transitionAllowInput=allowInput,GetFastValue$9(config,"moveAbove",!1)?this.manager.moveAbove(this.key,key):GetFastValue$9(config,"moveBelow",!1)&&this.manager.moveBelow(this.key,key),target.sys.isSleeping()?target.sys.wake(GetFastValue$9(config,"data")):this.manager.start(key,GetFastValue$9(config,"data")),this.systems.events.emit(Events$2.TRANSITION_OUT,target,duration),this.systems.events.on(Events$2.UPDATE,this.step,this),!0},checkValidTransition:function(target){return!(!target||target.sys.isActive()||target.sys.isTransitioning()||target===this.scene||this.systems.isTransitioning())},step:function(time,delta){this._elapsed+=delta,this.transitionProgress=Clamp$1(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var targetSys=this._target.sys,targetSettings=this._target.sys.settings;this.systems.events.off(Events$2.UPDATE,this.step,this),targetSys.events.emit(Events$2.TRANSITION_COMPLETE,this.scene),targetSettings.isTransition=!1,targetSettings.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(key,sceneConfig,autoStart,data){return this.manager.add(key,sceneConfig,autoStart,data)},launch:function(key,data){return key&&key!==this.key&&this.manager.queueOp("start",key,data),this},run:function(key,data){return key&&key!==this.key&&this.manager.queueOp("run",key,data),this},pause:function(key,data){return void 0===key&&(key=this.key),this.manager.queueOp("pause",key,data),this},resume:function(key,data){return void 0===key&&(key=this.key),this.manager.queueOp("resume",key,data),this},sleep:function(key,data){return void 0===key&&(key=this.key),this.manager.queueOp("sleep",key,data),this},wake:function(key,data){return void 0===key&&(key=this.key),this.manager.queueOp("wake",key,data),this},switch:function(key){return key!==this.key&&this.manager.queueOp("switch",this.key,key),this},stop:function(key,data){return void 0===key&&(key=this.key),this.manager.queueOp("stop",key,data),this},setActive:function(value,key,data){void 0===key&&(key=this.key);var scene=this.manager.getScene(key);return scene&&scene.sys.setActive(value,data),this},setVisible:function(value,key){void 0===key&&(key=this.key);var scene=this.manager.getScene(key);return scene&&scene.sys.setVisible(value),this},isSleeping:function(key){return void 0===key&&(key=this.key),this.manager.isSleeping(key)},isActive:function(key){return void 0===key&&(key=this.key),this.manager.isActive(key)},isPaused:function(key){return void 0===key&&(key=this.key),this.manager.isPaused(key)},isVisible:function(key){return void 0===key&&(key=this.key),this.manager.isVisible(key)},swapPosition:function(keyA,keyB){return void 0===keyB&&(keyB=this.key),keyA!==keyB&&this.manager.swapPosition(keyA,keyB),this},moveAbove:function(keyA,keyB){return void 0===keyB&&(keyB=this.key),keyA!==keyB&&this.manager.moveAbove(keyA,keyB),this},moveBelow:function(keyA,keyB){return void 0===keyB&&(keyB=this.key),keyA!==keyB&&this.manager.moveBelow(keyA,keyB),this},remove:function(key){return void 0===key&&(key=this.key),this.manager.remove(key),this},moveUp:function(key){return void 0===key&&(key=this.key),this.manager.moveUp(key),this},moveDown:function(key){return void 0===key&&(key=this.key),this.manager.moveDown(key),this},bringToTop:function(key){return void 0===key&&(key=this.key),this.manager.bringToTop(key),this},sendToBack:function(key){return void 0===key&&(key=this.key),this.manager.sendToBack(key),this},get:function(key){return this.manager.getScene(key)},getIndex:function(key){return void 0===key&&(key=this.key),this.manager.getIndex(key)},shutdown:function(){var eventEmitter=this.systems.events;eventEmitter.off(Events$2.SHUTDOWN,this.shutdown,this),eventEmitter.off(Events$2.POST_UPDATE,this.step,this),eventEmitter.off(Events$2.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(Events$2.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});
781/**
782	 * @author       Richard Davey <[email protected]>
783	 * @copyright    2020 Photon Storm Ltd.
784	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
785	 */PluginCache$2.register("ScenePlugin",ScenePlugin,"scenePlugin");var Scene={Events:events$g,GetPhysicsPlugins:GetPhysicsPlugins_1,GetScenePlugins:GetScenePlugins_1,SceneManager:SceneManager_1,ScenePlugin:ScenePlugin,Settings:Settings_1,Systems:Systems_1},scene=Scene=Extend_1$1(!1,Scene,_const$5),structs={Events:events$5,List:List_1,Map:_Map,ProcessQueue:ProcessQueue_1,RTree:RTree$1,Set:_Set,Size:Size_1$1},_const$1={LINEAR:0,NEAREST:1},Textures={CanvasTexture:CanvasTexture_1,Events:events$b,FilterMode:_const$1,Frame:Frame_1,Parsers:parsers$1,Texture:Texture_1,TextureManager:TextureManager_1,TextureSource:TextureSource_1},textures=Textures=Extend_1$1(!1,Textures,_const$1),ORIENTATION_CONST={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3},CONST$g={ORIENTATION:ORIENTATION_CONST},_const=CONST$g,IsInLayerBounds_1=function(tileX,tileY,layer){return tileX>=0&&tileX<layer.width&&tileY>=0&&tileY<layer.height},IsInLayerBounds$3=IsInLayerBounds_1,GetTileAt_1=function(tileX,tileY,nonNull,layer){if(void 0===nonNull&&(nonNull=!1),IsInLayerBounds$3(tileX,tileY,layer)){var tile=layer.data[tileY][tileX]||null;return tile?-1===tile.index?nonNull?tile:null:tile:null}return null},GetTileAt$2=GetTileAt_1,CalculateFacesAt_1=function(tileX,tileY,layer){var tile=GetTileAt$2(tileX,tileY,!0,layer),above=GetTileAt$2(tileX,tileY-1,!0,layer),below=GetTileAt$2(tileX,tileY+1,!0,layer),left
785=GetTileAt$2(tileX-1,tileY,!0,layer),right=GetTileAt$2(tileX+1,tileY,!0,layer),tileCollides=tile&&tile.collides;return tileCollides&&(tile.faceTop=!0,tile.faceBottom=!0,tile.faceLeft=!0,tile.faceRight=!0),above&&above.collides&&(tileCollides&&(tile.faceTop=!1),above.faceBottom=!tileCollides),below&&below.collides&&(tileCollides&&(tile.faceBottom=!1),below.faceTop=!tileCollides),left&&left.collides&&(tileCollides&&(tile.faceLeft=!1),left.faceRight=!tileCollides),right&&right.collides&&(tileCollides&&(tile.faceRight=!1),right.faceLeft=!tileCollides),tile&&!tile.collides&&tile.resetFaces(),tile},GetTileAt$1=GetTileAt_1,GetTilesWithin$e=GetTilesWithin_1,CalculateFacesWithin_1=function(tileX,tileY,width,height,layer){for(var above=null,below=null,left=null,right=null,tiles=GetTilesWithin$e(tileX,tileY,width,height,null,layer),i=0;i<tiles.length;i++){var tile=tiles[i];tile&&(tile.collides?(above=GetTileAt$1(tile.x,tile.y-1,!0,layer),below=GetTileAt$1(tile.x,tile.y+1,!0,layer),left=GetTileAt$1(tile.x-1,tile.y,!0,layer),right=GetTileAt$1(tile.x+1,tile.y,!0,layer),tile.faceTop=!above||!above.collides,tile.faceBottom=!below||!below.collides,tile.faceLeft=!left||!left.collides,tile.faceRight=!right||!right.collides):tile.resetFaces())}},Vector2$d=Vector2_1,point$5=new Vector2$d,CheckIsoBounds_1=function(tileX,tileY,layer,camera){var tilemapLayer=layer.tilemapLayer,cullPaddingX=tilemapLayer.cullPaddingX,cullPaddingY=tilemapLayer.cullPaddingY,pos=tilemapLayer.tilemap.tileToWorldXY(tileX,tileY,point$5,camera,tilemapLayer);return pos.x>camera.worldView.x+tilemapLayer.scaleX*layer.tileWidth*(-cullPaddingX-.5)&&pos.x<camera.worldView.right+tilemapLayer.scaleX*layer.tileWidth*(cullPaddingX-.5)&&pos.y>camera.worldView.y+tilemapLayer.scaleY*layer.tileHeight*(-cullPaddingY-1)&&pos.y<camera.worldView.bottom+tilemapLayer.scaleY*layer.tileHeight*(cullPaddingY-.5)},GetTilesWithin$d=GetTilesWithin_1,CalculateFacesWithin$7=CalculateFacesWithin_1,Copy_1=function(srcTileX,srcTileY,width,height,destTileX,destTileY,recalculateFaces,layer){void 0===recalculateFaces&&(recalculateFaces=!0),srcTileX<0&&(srcTileX=0),srcTileY<0&&(srcTileY=0);for(var srcTiles=GetTilesWithin$d(srcTileX,srcTileY,width,height,null,layer),offsetX=destTileX-srcTileX,offsetY=destTileY-srcTileY,i=0;i<srcTiles.length;i++){var tileX=srcTiles[i].x+offsetX,tileY=srcTiles[i].y+offsetY;tileX>=0&&tileX<layer.width&&tileY>=0&&tileY<layer.height&&layer.data[tileY][tileX]&&layer.data[tileY][tileX].copy(srcTiles[i])}recalculateFaces&&CalculateFacesWithin$7(destTileX-1,destTileY-1,width+2,height+2,layer)},GetTilesWithin$c=GetTilesWithin_1,ReplaceByIndex_1=function(findIndex,newIndex,tileX,tileY,width,height,layer){for(var tiles=GetTilesWithin$c(tileX,tileY,width,height,null,layer),i=0;i<tiles.length;i++)tiles[i]&&tiles[i].index===findIndex&&(tiles[i].index=newIndex)},GetTilesWithin$b=GetTilesWithin_1,ReplaceByIndex=ReplaceByIndex_1,CreateFromTiles_1=function(indexes,replacements,spriteConfig,scene,camera,layer){spriteConfig||(spriteConfig={}),Array.isArray(indexes)||(indexes=[indexes]);var tilemapLayer=layer.tilemapLayer;scene||(scene=tilemapLayer.scene),camera||(camera=scene.cameras.main);var i,tiles=GetTilesWithin$b(0,0,layer.width,layer.height,null,layer),sprites=[];for(i=0;i<tiles.length;i++){var tile=tiles[i];if(-1!==indexes.indexOf(tile.index)){var point=tilemapLayer.tileToWorldXY(tile.x,tile.y,void 0,camera,layer);spriteConfig.x=point.x,spriteConfig.y=point.y,sprites.push(scene.make.sprite(spriteConfig))}}if("number"==typeof replacements)for(i=0;i<indexes.length;i++)ReplaceByIndex(indexes[i],replacements,0,0,layer.width,layer.height,layer);else if(Array.isArray(replacements))for(i=0;i<indexes.length;i++)ReplaceByIndex(indexes[i],replacements[i],0,0,layer.width,layer.height,layer);return sprites},Rectangle$1=Rectangle_1$1,SnapCeil$2=SnapCeil_1,SnapFloor$2=SnapFloor_1,bounds=new Rectangle$1,CullBounds_1=function(layer,camera){var tilemap=layer.tilemapLayer.tilemap,tilemapLayer=layer.tilemapLayer,tileW=Math.floor(tilemap.tileWidth*tilemapLayer.scaleX),tileH=Math.floor(tilemap.tileHeight*tilemapLayer.scaleY),boundsLeft=SnapFloor$2(camera.worldView.x-tilemapLayer.x,tileW,0,!0)-tilemapLayer.cullPaddingX,boundsRight=SnapCeil$2(camera.worldView.right-tilemapLayer.x,tileW,0,!0)+tilemapLayer.cullPaddingX,boundsTop=SnapFloor$2(camera.worldView.y-tilemapLayer.y,tileH,0,!0)-tilemapLayer.cullPaddingY,boundsBottom=SnapCeil$2(camera.worldView.bottom-tilemapLayer.y,tileH,0,!0)+tilemapLayer.cullPaddingY;return bounds.setTo(boundsLeft,boundsTop,boundsRight-boundsLeft,boundsBottom-boundsTop)},RunCull_1=function(layer,bounds,renderOrder,outputArray){var x,y,tile,mapData=layer.data,mapWidth=layer.width,mapHeight=layer.height,tilemapLayer=layer.tilemapLayer,drawLeft=Math.max(0,bounds.left),drawRight=Math.min(mapWidth,bounds.right),drawTop=Math.max(0,bounds.top),drawBottom=Math.min(mapHeight,bounds.bottom);if(0===renderOrder)for(y=drawTop;y<drawBottom;y++)for(x=drawLeft;mapData[y]&&x<drawRight;x++)(tile=mapData[y][x])&&-1!==tile.index&&tile.visible&&0!==tile.alpha&&outputArray.push(tile);else if(1===renderOrder)for(y=drawTop;y<drawBottom;y++)for(x=drawRight;mapData[y]&&x>=drawLeft;x--)(tile=mapData[y][x])&&-1!==tile.index&&tile.visible&&0!==tile.alpha&&outputArray.push(tile);else if(2===renderOrder)for(y=drawBottom;y>=drawTop;y--)for(x=drawLeft;mapData[y]&&x<drawRight;x++)(tile=mapData[y][x])&&-1!==tile.index&&tile.visible&&0!==tile.alpha&&outputArray.push(tile);else if(3===renderOrder)for(y=drawBottom;y>=drawTop;y--)for(x=drawRight;mapData[y]&&x>=drawLeft;x--)(tile=mapData[y][x])&&-1!==tile.index&&tile.visible&&0!==tile.alpha&&outputArray.push(tile);return tilemapLayer.tilesDrawn=outputArray.length,tilemapLayer.tilesTotal=mapWidth*mapHeight,outputArray}
785,CullBounds$2=CullBounds_1,RunCull$2=RunCull_1,CullTiles_1=function(layer,camera,outputArray,renderOrder){void 0===outputArray&&(outputArray=[]),void 0===renderOrder&&(renderOrder=0),outputArray.length=0;var tilemapLayer=layer.tilemapLayer,bounds=CullBounds$2(layer,camera);return(tilemapLayer.skipCull||1!==tilemapLayer.scrollFactorX||1!==tilemapLayer.scrollFactorY)&&(bounds.left=0,bounds.right=layer.width,bounds.top=0,bounds.bottom=layer.height),RunCull$2(layer,bounds,renderOrder,outputArray),outputArray},SetTileCollision_1=function(tile,collides){collides?tile.setCollision(!0,!0,!0,!0,!1):tile.resetCollision(!1)},GetTilesWithin$a=GetTilesWithin_1,CalculateFacesWithin$6=CalculateFacesWithin_1,SetTileCollision$6=SetTileCollision_1,Fill_1=function(index,tileX,tileY,width,height,recalculateFaces,layer){for(var doesIndexCollide=-1!==layer.collideIndexes.indexOf(index),tiles=GetTilesWithin$a(tileX,tileY,width,height,null,layer),i=0;i<tiles.length;i++)tiles[i].index=index,SetTileCollision$6(tiles[i],doesIndexCollide);recalculateFaces&&CalculateFacesWithin$6(tileX-1,tileY-1,width+2,height+2,layer)},GetTilesWithin$9=GetTilesWithin_1,FilterTiles_1=function(callback,context,tileX,tileY,width,height,filteringOptions,layer){return GetTilesWithin$9(tileX,tileY,width,height,filteringOptions,layer).filter(callback,context)},FindByIndex_1=function(findIndex,skip,reverse,layer){void 0===skip&&(skip=0),void 0===reverse&&(reverse=!1);var tx,ty,tile,count=0;if(reverse){for(ty=layer.height-1;ty>=0;ty--)for(tx=layer.width-1;tx>=0;tx--)if((tile=layer.data[ty][tx])&&tile.index===findIndex){if(count===skip)return tile;count+=1}}else for(ty=0;ty<layer.height;ty++)for(tx=0;tx<layer.width;tx++)if((tile=layer.data[ty][tx])&&tile.index===findIndex){if(count===skip)return tile;count+=1}return null},GetTilesWithin$8=GetTilesWithin_1,FindTile_1=function(callback,context,tileX,tileY,width,height,filteringOptions,layer){return GetTilesWithin$8(tileX,tileY,width,height,filteringOptions,layer).find(callback,context)||null},GetTilesWithin$7=GetTilesWithin_1,ForEachTile_1=function(callback,context,tileX,tileY,width,height,filteringOptions,layer){GetTilesWithin$7(tileX,tileY,width,height,filteringOptions,layer).forEach(callback,context)},SnapCeil$1=SnapCeil_1,SnapFloor$1=SnapFloor_1,HexagonalCullBounds_1=function(layer,camera){var tilemap=layer.tilemapLayer.tilemap,tilemapLayer=layer.tilemapLayer,tileW=Math.floor(tilemap.tileWidth*tilemapLayer.scaleX),tileH=Math.floor(tilemap.tileHeight*tilemapLayer.scaleY),len=layer.hexSideLength,rowH=(tileH-len)/2+len;return{left:SnapFloor$1(camera.worldView.x-tilemapLayer.x,tileW,0,!0)-tilemapLayer.cullPaddingX,right:SnapCeil$1(camera.worldView.right-tilemapLayer.x,tileW,0,!0)+tilemapLayer.cullPaddingX,top:SnapFloor$1(camera.worldView.y-tilemapLayer.y,rowH,0,!0)-tilemapLayer.cullPaddingY,bottom:SnapCeil$1(camera.worldView.bottom-tilemapLayer.y,rowH,0,!0)+tilemapLayer.cullPaddingY}},CullBounds$1=HexagonalCullBounds_1,RunCull$1=RunCull_1,HexagonalCullTiles_1=function(layer,camera,outputArray,renderOrder){void 0===outputArray&&(outputArray=[]),void 0===renderOrder&&(renderOrder=0),outputArray.length=0;var tilemapLayer=layer.tilemapLayer;if(!tilemapLayer.skipCull&&1===tilemapLayer.scrollFactorX&&1===tilemapLayer.scrollFactorY){var bounds=CullBounds$1(layer,camera);RunCull$1(layer,bounds,renderOrder,outputArray)}return outputArray},CheckIsoBounds=CheckIsoBounds_1,IsometricCullTiles_1=function(layer,camera,outputArray,renderOrder){void 0===outputArray&&(outputArray=[]),void 0===renderOrder&&(renderOrder=0),outputArray.length=0;var x,y,tile,tilemapLayer=layer.tilemapLayer,mapData=layer.data,mapWidth=layer.width,mapHeight=layer.height,drawRight=mapWidth,drawBottom=mapHeight;if(!tilemapLayer.skipCull)if(0===renderOrder){for(y=0;y<drawBottom;y++)for(x=0;mapData[y]&&x<drawRight;x++)if(CheckIsoBounds(x,y,layer,camera)){if(!(tile=mapData[y][x])||-1===tile.index||!tile.visible||0===tile.alpha)continue;outputArray.push(tile)}}else if(1===renderOrder){for(y=0;y<drawBottom;y++)for(x=drawRight;mapData[y]&&x>=0;x--)if(CheckIsoBounds(x,y,layer,camera)){if(!(tile=mapData[y][x])||-1===tile.index||!tile.visible||0===tile.alpha)continue;outputArray.push(tile)}
785}else if(2===renderOrder){for(y=drawBottom;y>=0;y--)for(x=0;mapData[y]&&x<drawRight;x++)if(CheckIsoBounds(x,y,layer,camera)){if(!(tile=mapData[y][x])||-1===tile.index||!tile.visible||0===tile.alpha)continue;outputArray.push(tile)}}else if(3===renderOrder)for(y=drawBottom;y>=0;y--)for(x=drawRight;mapData[y]&&x>=0;x--)if(CheckIsoBounds(x,y,layer,camera)){if(!(tile=mapData[y][x])||-1===tile.index||!tile.visible||0===tile.alpha)continue;outputArray.push(tile)}return tilemapLayer.tilesDrawn=outputArray.length,tilemapLayer.tilesTotal=mapWidth*mapHeight,outputArray},SnapCeil=SnapCeil_1,SnapFloor=SnapFloor_1,StaggeredCullBounds_1=function(layer,camera){var tilemap=layer.tilemapLayer.tilemap,tilemapLayer=layer.tilemapLayer,tileW=Math.floor(tilemap.tileWidth*tilemapLayer.scaleX),tileH=Math.floor(tilemap.tileHeight*tilemapLayer.scaleY);return{left:SnapFloor(camera.worldView.x-tilemapLayer.x,tileW,0,!0)-tilemapLayer.cullPaddingX,right:SnapCeil(camera.worldView.right-tilemapLayer.x,tileW,0,!0)+tilemapLayer.cullPaddingX,top:SnapFloor(camera.worldView.y-tilemapLayer.y,tileH/2,0,!0)-tilemapLayer.cullPaddingY,bottom:SnapCeil(camera.worldView.bottom-tilemapLayer.y,tileH/2,0,!0)+tilemapLayer.cullPaddingY}},CullBounds=StaggeredCullBounds_1,RunCull=RunCull_1,StaggeredCullTiles_1=function(layer,camera,outputArray,renderOrder){void 0===outputArray&&(outputArray=[]),void 0===renderOrder&&(renderOrder=0),outputArray.length=0;var tilemapLayer=layer.tilemapLayer;if(!tilemapLayer.skipCull&&1===tilemapLayer.scrollFactorX&&1===tilemapLayer.scrollFactorY){var bounds=CullBounds(layer,camera);RunCull(layer,bounds,renderOrder,outputArray)}return outputArray},CONST$f=ORIENTATION_CONST,CullTiles=CullTiles_1,HexagonalCullTiles=HexagonalCullTiles_1,IsometricCullTiles=IsometricCullTiles_1,NOOP$7=NOOP_1,StaggeredCullTiles=StaggeredCullTiles_1,GetCullTilesFunction_1=function(orientation){return orientation===CONST$f.ORTHOGONAL?CullTiles:orientation===CONST$f.HEXAGONAL?HexagonalCullTiles:orientation===CONST$f.STAGGERED?StaggeredCullTiles:orientation===CONST$f.ISOMETRIC?IsometricCullTiles:NOOP$7},GetTileAt=GetTileAt_1,Vector2$c=Vector2_1,point$4=new Vector2$c,GetTileAtWorldXY_1=function(worldX,worldY,nonNull,camera,layer){return layer.tilemapLayer.worldToTileXY(worldX,worldY,!0,point$4,camera),GetTileAt(point$4.x,point$4.y,nonNull,layer)},Geom=geom,GetTilesWithin$6=GetTilesWithin_1,Intersects=intersects$1,NOOP$6=NOOP_1,Vector2$b=Vector2_1,TriangleToRectangle=function(triangle,rect){return Intersects.RectangleToTriangle(rect,triangle)},point$3=new Vector2$b,pointStart=new Vector2$b,pointEnd=new Vector2$b,GetTilesWithinShape_1=function(shape,filteringOptions,camera,layer){if(void 0===shape)return[];var intersectTest=NOOP$6;shape instanceof Geom.Circle?intersectTest=Intersects.CircleToRectangle:shape instanceof Geom.Rectangle?intersectTest=Intersects.RectangleToRectangle:shape instanceof Geom.Triangle?intersectTest=TriangleToRectangle:shape instanceof Geom.Line&&(intersectTest=Intersects.LineToRectangle),layer.tilemapLayer.worldToTileXY(shape.left,shape.top,!0,pointStart,camera);var xStart=pointStart.x,yStart=pointStart.y;layer.tilemapLayer.worldToTileXY(shape.right,shape.bottom,!0,pointEnd,camera);var xEnd=Math.ceil(pointEnd.x),yEnd=Math.ceil(pointEnd.y),width=Math.max(xEnd-xStart,1),height=Math.max(yEnd-yStart,1),tiles=GetTilesWithin$6(xStart,yStart,width,height,filteringOptions,layer),tileWidth=layer.tileWidth,tileHeight=layer.tileHeight;layer.tilemapLayer&&(tileWidth*=layer.tilemapLayer.scaleX,tileHeight*=layer.tilemapLayer.scaleY);for(var results=[],tileRect=new Geom.Rectangle(0,0,tileWidth,tileHeight),i=0;i<tiles.length;i++){var tile=tiles[i];layer.tilemapLayer.tileToWorldXY(tile.x,tile.y,point$3,camera),tileRect.x=point$3.x,tileRect.y=point$3.y,intersectTest(shape,tileRect)&&results.push(tile)}return results},TileToWorldX_1=function(tileX,camera,layer){var tileWidth=layer.baseTileWidth,tilemapLayer=layer.tilemapLayer,layerWorldX=0;return tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),layerWorldX=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX),layerWorldX+tileX*tileWidth},CONST$e=ORIENTATION_CONST,NOOP$5=NOOP_1,TileToWorldX$1=TileToWorldX_1,GetTileToWorldXFunction_1=function(orientation){return orientation===CONST$e.ORTHOGONAL?TileToWorldX$1:NOOP$5},Vector2$a=Vector2_1,HexagonalTileToWorldXY_1=function(tileX,tileY,point,camera,layer){point||(point=new Vector2$a);var tileWidth=layer.baseTileWidth,tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer,layerWorldX=0,layerWorldY=0;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),layerWorldX=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX,layerWorldY=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY);var len=layer.hexSideLength,x=layerWorldX+tileX*tileWidth+tileY%2*(tileWidth/2),y=layerWorldY+tileY*((tileHeight-len)/2+len);return point.set(x,y)},Vector2$9=Vector2_1,IsometricTileToWorldXY_1=function(tileX,tileY,point,camera,layer){point||(point=new Vector2$9);var tileWidth=layer.baseTileWidth,tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer,layerWorldX=0,layerWorldY=0;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),layerWorldX=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX,layerWorldY=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY);var x=layerWorldX+tileWidth/2*(tileX-tileY),y=layerWorldY+(tileX+tileY)*(tileHeight/2);return point.set(x,y)},Vector2$8=Vector2_1,StaggeredTileToWorldXY_1=function(tileX,tileY,point,camera,layer){point||(point=new Vector2$8);var tileWidth=layer.baseTileWidth,tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer,layerWorldX=0,layerWorldY=0;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),layerWorldX=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX,layerWorldY=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY);var x=layerWorldX+tileX*tileWidth+tileY%2*(tileWidth/2),y=layerWorldY+tileY*(tileHeight/2);return point.set(x,y)},TileToWorldY_1=function(tileY,camera,layer){var tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer,layerWorldY=0;return tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),layerWorldY=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY),layerWorldY+tileY*tileHeight},TileToWorldX=TileToWorldX_1,TileToWorldY$1=TileToWorldY_1,Vector2$7=Vector2_1,TileToWorldXY_1=function(tileX,tileY,point,camera,layer){return point||(point=new Vector2$7(0,0)),point.x=TileToWorldX(tileX,camera,layer),point.y=TileToWorldY$1(tileY,camera,layer),point},CONST$d=ORIENTATION_CONST,HexagonalTileToWorldXY=HexagonalTileToWorldXY_1,IsometricTileToWorldXY=IsometricTileToWorldXY_1,NOOP$4=NOOP_1,StaggeredTileToWorldXY=StaggeredTileToWorldXY_1,TileToWorldXY=TileToWorldXY_1,GetTileToWorldXYFunction_1=function(orientation){return orientation===CONST$d.ORTHOGONAL?TileToWorldXY:orientation===CONST$d.ISOMETRIC?IsometricTileToWorldXY:orientation===CONST$d.HEXAGONAL?HexagonalTileToWorldXY:orientation===CONST$d.STAGGERED?StaggeredTileToWorldXY:NOOP$4},HexagonalTileToWorldY_1=function(tileY,camera,layer){var tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer,layerWorldY=0;tilemapLayer&&(void 0===camera&&(camera=tilemapLayer.scene.cameras.main),layerWorldY=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY);var len=tilemapLayer.tilemap.hexSideLength;return layerWorldY+tileY*((tileHeight-len)/2+len)},StaggeredTileToWorldY_1=function(tileY,camera,layer){var tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer,layerWorldY=0;return tilemapLayer&&(void 0===camera&&(camera=tilemapLayer.scene.cameras.main),layerWorldY=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY),layerWorldY+tileY*(tileHeight/2)},CONST$c=ORIENTATION_CONST,HexagonalTileToWorldY=HexagonalTileToWorldY_1,NOOP$3=NOOP_1,StaggeredTileToWorldY=StaggeredTileToWorldY_1,TileToWorldY=TileToWorldY_1,GetTileToWorldYFunction_1=function(orientation){return orientation===CONST$c.ORTHOGONAL?TileToWorldY:orientation===CONST$c.HEXAGONAL?HexagonalTileToWorldY:orientation===CONST$c.STAGGERED?StaggeredTileToWorldY:NOOP$3},WorldToTileX_1=function(worldX,snapToFloor,camera,layer){void 0===snapToFloor&&(snapToFloor=!0);var tileWidth=layer.baseTileWidth,tilemapLayer=layer.tilemapLayer;return tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldX-=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX),snapToFloor?Math.floor(worldX/tileWidth):worldX/tileWidth},CONST$b=ORIENTATION_CONST,NOOP$2=NOOP_1,WorldToTileX$1=WorldToTileX_1,GetWorldToTileXFunction_1=function(orientation){return orientation===CONST$b.ORTHOGONAL?WorldToTileX$1:NOOP$2},Vector2$6=Vector2_1,HexagonalWorldToTileXY_1=function(worldX,worldY,snapToFloor,point,camera,layer){point||(point=new Vector2$6);var tileWidth=layer.baseTileWidth,tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldY-=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY,worldX-=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX);var len=layer.hexSideLength,rowHeight=(tileHeight-len)/2+len,y=snapToFloor?Math.floor(worldY/rowHeight):worldY/rowHeight,x=snapToFloor?Math.floor((worldX-y%2*.5*tileWidth)/tileWidth):(worldX-y%2*.5*tileWidth)/tileWidth;return point.set(x,y)},Vector2$5=Vector2_1,IsometricWorldToTileXY_1=function(worldX,worldY,snapToFloor,point,camera,layer){point||(point=new Vector2$5);var tileWidth=layer.baseTileWidth,tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldY-=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY,worldX-=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX);var x=snapToFloor?Math.floor((worldX/(tileWidth/2)+worldY/(tileHeight/2))/2):(worldX/(tileWidth/2)+worldY/(tileHeight/2))/2,y=snapToFloor?Math.floor((worldY/(tileHeight/2)-worldX/(tileWidth/2))/2):(worldY/(tileHeight/2)-worldX/(tileWidth/2))/2;return point.set(x,y)},Vector2$4=Vector2_1,StaggeredWorldToTileXY_1=function(worldX,worldY,snapToFloor,point,camera,layer){point||(point=new Vector2$4);var tileWidth=layer.baseTileWidth,tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldY-=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY,worldX-=tilemapLayer.x+camera.scrollX*(1-tilemapLayer.scrollFactorX),tileWidth*=tilemapLayer.scaleX);var y=snapToFloor?Math.floor(worldY/(tileHeight/2)):worldY/(tileHeight/2),x=snapToFloor?Math.floor((worldX+y%2*.5*tileWidth)/tileWidth):(worldX+y%2*.5*tileWidth)/tileWidth;return point.set(x,y)},WorldToTileY_1=function(worldY,snapToFloor,camera,layer){void 0===snapToFloor&&(snapToFloor=!0);var tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer;return tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldY-=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY),snapToFloor?Math.floor(worldY/tileHeight):worldY/tileHeight},WorldToTileX=WorldToTileX_1,WorldToTileY$1=WorldToTileY_1,Vector2$3=Vector2_1,WorldToTileXY_1=function(worldX,worldY,snapToFloor,point,camera,layer){return void 0===snapToFloor&&(snapToFloor=!0),point||(point=new Vector2$3(0,0)),point.x=WorldToTileX(worldX,snapToFloor,camera,layer),point.y=WorldToTileY$1(worldY,snapToFloor,camera,layer),point},CONST$a=ORIENTATION_CONST,HexagonalWorldToTileXY=HexagonalWorldToTileXY_1,IsometricWorldToTileXY=IsometricWorldToTileXY_1,NOOP$1=NOOP_1,StaggeredWorldToTileXY=StaggeredWorldToTileXY_1,WorldToTileXY=WorldToTileXY_1,GetWorldToTileXYFunction_1=function(orientation){return orientation===CONST$a.ORTHOGONAL?WorldToTileXY:orientation===CONST$a.ISOMETRIC?IsometricWorldToTileXY:orientation===CONST$a.HEXAGONAL?HexagonalWorldToTileXY:orientation===CONST$a.STAGGERED?StaggeredWorldToTileXY:NOOP$1},HexagonalWorldToTileY_1=function(worldY,snapToFloor,camera,layer){var tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer;tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldY-=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY);var len=layer.hexSideLength,rowHeight=(tileHeight-len)/2+len;return snapToFloor?Math.floor(worldY/rowHeight):worldY/rowHeight},StaggeredWorldToTileY_1=function(worldY,snapToFloor,camera,layer){var tileHeight=layer.baseTileHeight,tilemapLayer=layer.tilemapLayer;return tilemapLayer&&(camera||(camera=tilemapLayer.scene.cameras.main),worldY-=tilemapLayer.y+camera.scrollY*(1-tilemapLayer.scrollFactorY),tileHeight*=tilemapLayer.scaleY),snapToFloor?Math.floor(worldY/(tileHeight/2)):worldY/(tileHeight/2)},CONST$9=ORIENTATION_CONST,HexagonalWorldToTileY=HexagonalWorldToTileY_1,NOOP=NOOP_1,StaggeredWorldToTileY=StaggeredWorldToTileY_1,WorldToTileY=WorldToTileY_1,GetWorldToTileYFunction_1=function(orientation){return orientation===CONST$9.ORTHOGONAL?WorldToTileY:orientation===CONST$9.HEXAGONAL?HexagonalWorldToTileY:orientation===CONST$9.STAGGERED?StaggeredWorldToTileY:NOOP},IsInLayerBounds$2=IsInLayerBounds_1,HasTileAt_1=function(tileX,tileY,layer){if(IsInLayerBounds$2(tileX,tileY,layer)){var tile=layer.data[tileY][tileX];return null!==tile&&tile.index>-1}
785return!1},HasTileAt=HasTileAt_1,Vector2$2=Vector2_1,point$2=new Vector2$2,HasTileAtWorldXY_1=function(worldX,worldY,camera,layer){layer.tilemapLayer.worldToTileXY(worldX,worldY,!0,point$2,camera);var tileX=point$2.x,tileY=point$2.y;return HasTileAt(tileX,tileY,layer)},CONST$8=ORIENTATION_CONST,Class$c=Class_1,Components$1=components$3,Rectangle=rectangle,Tile$6=new Class$c({Mixins:[Components$1.Alpha,Components$1.Flip,Components$1.Visible],initialize:function(layer,index,x,y,width,height,baseWidth,baseHeight){this.layer=layer,this.index=index,this.x=x,this.y=y,this.width=width,this.height=height,this.right,this.bottom,this.baseWidth=void 0!==baseWidth?baseWidth:width,this.baseHeight=void 0!==baseHeight?baseHeight:height,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(x,y){return!(x<this.pixelX||y<this.pixelY||x>this.right||y>this.bottom)},copy:function(tile){return this.index=tile.index,this.alpha=tile.alpha,this.properties=tile.properties,this.visible=tile.visible,this.setFlip(tile.flipX,tile.flipY),this.tint=tile.tint,this.rotation=tile.rotation,this.collideUp=tile.collideUp,this.collideDown=tile.collideDown,this.collideLeft=tile.collideLeft,this.collideRight=tile.collideRight,this.collisionCallback=tile.collisionCallback,this.collisionCallbackContext=tile.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(camera){var tilemapLayer=this.tilemapLayer;return tilemapLayer?tilemapLayer.tileToWorldX(this.x,camera):this.x*this.baseWidth},getRight:function(camera){var tilemapLayer=this.tilemapLayer;return tilemapLayer?this.getLeft(camera)+this.width*tilemapLayer.scaleX:this.getLeft(camera)+this.width},getTop:function(camera){var tilemapLayer=this.tilemapLayer;return tilemapLayer?tilemapLayer.tileToWorldY(this.y,camera)-(this.height-this.baseHeight)*tilemapLayer.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(camera){var tilemapLayer=this.tilemapLayer;return tilemapLayer?this.getTop(camera)+this.height*tilemapLayer.scaleY:this.getTop(camera)+this.height},getBounds:function(camera,output){return void 0===output&&(output=new Rectangle),output.x=this.getLeft(),output.y=this.getTop(),output.width=this.getRight()-output.x,output.height=this.getBottom()-output.y,output},getCenterX:function(camera){return(this.getLeft(camera)+this.getRight(camera))/2},getCenterY:function(camera){return(this.getTop(camera)+this.getBottom(camera))/2},intersects:function(x,y,right,bottom){return!(right<=this.pixelX||bottom<=this.pixelY||x>=this.right||y>=this.bottom)},isInteresting:function(collides,faces){return collides&&faces?this.canCollide||this.hasInterestingFace:collides?this.collides:!!faces&&this.hasInterestingFace},resetCollision:function(recalculateFaces){(void 0===recalculateFaces&&(recalculateFaces=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,recalculateFaces)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(left,right,up,down,recalculateFaces){(void 0===right&&(right=left),void 0===up&&(up=left),void 0===down&&(down=left),void 0===recalculateFaces&&(recalculateFaces=!0),this.collideLeft=left,this.collideRight=right,this.collideUp=up,this.collideDown=down,this.faceLeft=left,this.faceRight=right,this.faceTop=up,this.faceBottom=down,recalculateFaces)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(callback,context){return null===callback?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=callback,this.collisionCallbackContext=context),this}
785,setSize:function(tileWidth,tileHeight,baseWidth,baseHeight){return void 0!==tileWidth&&(this.width=tileWidth),void 0!==tileHeight&&(this.height=tileHeight),void 0!==baseWidth&&(this.baseWidth=baseWidth),void 0!==baseHeight&&(this.baseHeight=baseHeight),this.updatePixelXY(),this},updatePixelXY:function(){var orientation=this.layer.orientation;if(orientation===CONST$8.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(orientation===CONST$8.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(orientation===CONST$8.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(orientation===CONST$8.HEXAGONAL){var len=this.layer.hexSideLength,rowHeight=(this.baseHeight-len)/2+len;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*rowHeight}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var tilemapLayer=this.layer.tilemapLayer;if(tilemapLayer){var tileset=tilemapLayer.gidMap[this.index];if(tileset)return tileset}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var tilemapLayer=this.tilemapLayer;return tilemapLayer?tilemapLayer.tilemap:null}}}),Tile_1=Tile$6,Tile$5=Tile_1,IsInLayerBounds$1=IsInLayerBounds_1,CalculateFacesAt$1=CalculateFacesAt_1,SetTileCollision$5=SetTileCollision_1,PutTileAt_1=function(tile,tileX,tileY,recalculateFaces,layer){if(void 0===recalculateFaces&&(recalculateFaces=!0),!IsInLayerBounds$1(tileX,tileY,layer))return null;var oldTile=layer.data[tileY][tileX],oldTileCollides=oldTile&&oldTile.collides;if(tile instanceof Tile$5)null===layer.data[tileY][tileX]&&(layer.data[tileY][tileX]=new Tile$5(layer,tile.index,tileX,tileY,layer.tileWidth,layer.tileHeight)),layer.data[tileY][tileX].copy(tile);else{var index=tile;null===layer.data[tileY][tileX]?layer.data[tileY][tileX]=new Tile$5(layer,index,tileX,tileY,layer.tileWidth,layer.tileHeight):layer.data[tileY][tileX].index=index}var newTile=layer.data[tileY][tileX],collides=-1!==layer.collideIndexes.indexOf(newTile.index);return SetTileCollision$5(newTile,collides),recalculateFaces&&oldTileCollides!==newTile.collides&&CalculateFacesAt$1(tileX,tileY,layer),newTile},PutTileAt$1=PutTileAt_1,Vector2$1=Vector2_1,point$1=new Vector2$1,PutTileAtWorldXY_1=function(tile,worldX,worldY,recalculateFaces,camera,layer){return layer.tilemapLayer.worldToTileXY(worldX,worldY,!0,point$1,camera,layer),PutTileAt$1(tile,point$1.x,point$1.y,recalculateFaces,layer)},CalculateFacesWithin$5=CalculateFacesWithin_1,PutTileAt=PutTileAt_1,PutTilesAt_1=function(tilesArray,tileX,tileY,recalculateFaces,layer){if(void 0===recalculateFaces&&(recalculateFaces=!0),!Array.isArray(tilesArray))return null;Array.isArray(tilesArray[0])||(tilesArray=[tilesArray]);for(var height=tilesArray.length,width=tilesArray[0].length,ty=0;ty<height;ty++)for(var tx=0;tx<width;tx++){var tile=tilesArray[ty][tx];PutTileAt(tile,tileX+tx,tileY+ty,!1,layer)}recalculateFaces&&CalculateFacesWithin$5(tileX-1,tileY-1,width+2,height+2,layer)},GetTilesWithin$5=GetTilesWithin_1,GetRandom=GetRandom_1,Randomize_1=function(tileX,tileY,width,height,indexes,layer){var i,tiles=GetTilesWithin$5(tileX,tileY,width,height,{},layer);if(!indexes)for(indexes=[],i=0;i<tiles.length;i++)-1===indexes.indexOf(tiles[i].index)&&indexes.push(tiles[i].index);for(i=0;i<tiles.length;i++)tiles[i].index=GetRandom(indexes)},Tile$4=Tile_1,IsInLayerBounds=IsInLayerBounds_1,CalculateFacesAt=CalculateFacesAt_1,RemoveTileAt_1=function(tileX,tileY,replaceWithNull,recalculateFaces,layer){if(void 0===replaceWithNull&&(replaceWithNull=!0),void 0===recalculateFaces&&(recalculateFaces=!0),!IsInLayerBounds(tileX,tileY,layer))return null;var tile=layer.data[tileY][tileX];return tile?(layer.data[tileY][tileX]=replaceWithNull?null:new Tile$4(layer,-1,tileX,tileY,layer.tileWidth,layer.tileHeight),recalculateFaces&&tile&&tile.collides&&CalculateFacesAt(tileX,tileY,layer),tile):null},RemoveTileAt=RemoveTileAt_1,point=new Vector2_1,RemoveTileAtWorldXY_1=function(worldX,worldY,replaceWithNull,recalculateFaces,camera,layer){return layer.tilemapLayer.worldToTileXY(worldX,worldY,!0,point,camera,layer),RemoveTileAt(point.x,point.y,replaceWithNull,recalculateFaces,layer)},GetTilesWithin$4=GetTilesWithin_1,Color=color,defaultTileColor=new Color(105,210,231,150),defaultCollidingTileColor=new Color(243,134,48,200),defaultFaceColor=new Color(40,39,37,150),RenderDebug_1=function(graphics,styleConfig,layer){void 0===styleConfig&&(styleConfig={});var tileColor=void 0!==styleConfig.tileColor?styleConfig.tileColor:defaultTileColor,collidingTileColor=void 0!==styleConfig.collidingTileColor?styleConfig.collidingTileColor:defaultCollidingTileColor,faceColor=void 0!==styleConfig.faceColor?styleConfig.faceColor:defaultFaceColor,tiles=GetTilesWithin$4(0,0,layer.width,layer.height,null,layer);graphics.translateCanvas(layer.tilemapLayer.x,layer.tilemapLayer.y),graphics.scaleCanvas(layer.tilemapLayer.scaleX,layer.tilemapLayer.scaleY);for(var i=0;i<tiles.length;i++){var tile=tiles[i],tw=tile.width,th=tile.height,x=tile.pixelX,y=tile.pixelY,color=tile.collides?collidingTileColor:tileColor;null!==color&&(graphics.fillStyle(color.color,color.alpha/255),graphics.fillRect(x,y,tw,th)),x+=1,y+=1,tw-=2,th-=2,null!==faceColor&&(graphics.lineStyle(1,faceColor.color,faceColor.alpha/255),tile.faceTop&&graphics.lineBetween(x,y,x+tw,y),tile.faceRight&&graphics.lineBetween(x+tw,y,x+tw,y+th),tile.faceBottom&&graphics.lineBetween(x,y+th,x+tw,y+th),tile.faceLeft&&graphics.lineBetween(x,y,x,y+th))}},SetLayerCollisionIndex_1=function(tileIndex,collides,layer){var loc=layer.collideIndexes.indexOf(tileIndex);collides&&-1===loc?layer.collideIndexes.push(tileIndex):collides||-1===loc||layer.collideIndexes.splice(loc,1)},SetTileCollision$4=SetTileCollision_1,CalculateFacesWithin$4=CalculateFacesWithin_1,SetLayerCollisionIndex$2=SetLayerCollisionIndex_1,SetCollision_1=function(indexe
785s,collides,recalculateFaces,layer,updateLayer){void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),void 0===updateLayer&&(updateLayer=!0),Array.isArray(indexes)||(indexes=[indexes]);for(var i=0;i<indexes.length;i++)SetLayerCollisionIndex$2(indexes[i],collides,layer);if(updateLayer)for(var ty=0;ty<layer.height;ty++)for(var tx=0;tx<layer.width;tx++){var tile=layer.data[ty][tx];tile&&-1!==indexes.indexOf(tile.index)&&SetTileCollision$4(tile,collides)}recalculateFaces&&CalculateFacesWithin$4(0,0,layer.width,layer.height,layer)},SetTileCollision$3=SetTileCollision_1,CalculateFacesWithin$3=CalculateFacesWithin_1,SetLayerCollisionIndex$1=SetLayerCollisionIndex_1,SetTileCollision$2=SetTileCollision_1,CalculateFacesWithin$2=CalculateFacesWithin_1,SetLayerCollisionIndex=SetLayerCollisionIndex_1,SetTileCollision$1=SetTileCollision_1,CalculateFacesWithin$1=CalculateFacesWithin_1,HasValue$1=HasValue_1,SetCollisionByProperty_1=function(properties,collides,recalculateFaces,layer){void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0);for(var ty=0;ty<layer.height;ty++)for(var tx=0;tx<layer.width;tx++){var tile=layer.data[ty][tx];if(tile)for(var property in properties)if(HasValue$1(tile.properties,property)){var values=properties[property];Array.isArray(values)||(values=[values]);for(var i=0;i<values.length;i++)tile.properties[property]===values[i]&&SetTileCollision$1(tile,collides)}}recalculateFaces&&CalculateFacesWithin$1(0,0,layer.width,layer.height,layer)},SetTileCollision=SetTileCollision_1,CalculateFacesWithin=CalculateFacesWithin_1,SetTileIndexCallback_1=function(indexes,callback,callbackContext,layer){if("number"==typeof indexes)layer.callbacks[indexes]=null!==callback?{callback:callback,callbackContext:callbackContext}:void 0;else for(var i=0,len=indexes.length;i<len;i++)layer.callbacks[indexes[i]]=null!==callback?{callback:callback,callbackContext:callbackContext}:void 0},GetTilesWithin$3=GetTilesWithin_1,SetTileLocationCallback_1=function(tileX,tileY,width,height,callback,callbackContext,layer){for(var tiles=GetTilesWithin$3(tileX,tileY,width,height,null,layer),i=0;i<tiles.length;i++)tiles[i].setCollisionCallback(callback,callbackContext)},GetTilesWithin$2=GetTilesWithin_1,ShuffleArray=Shuffle_1$2,Shuffle_1=function(tileX,tileY,width,height,layer){var tiles=GetTilesWithin$2(tileX,tileY,width,height,null,layer),indexes=tiles.map((function(tile){return tile.index}));ShuffleArray(indexes);for(var i=0;i<tiles.length;i++)tiles[i].index=indexes[i]},GetTilesWithin$1=GetTilesWithin_1,SwapByIndex_1=function(indexA,indexB,tileX,tileY,width,height,layer){for(var tiles=GetTilesWithin$1(tileX,tileY,width,height,null,layer),i=0;i<tiles.length;i++)tiles[i]&&(tiles[i].index===indexA?tiles[i].index=indexB:tiles[i].index===indexB&&(tiles[i].index=indexA))},GetTilesWithin=GetTilesWithin_1,WeightedRandomize_1=function(tileX,tileY,width,height,weightedIndexes,layer){if(weightedIndexes){var i,tiles=GetTilesWithin(tileX,tileY,width,height,null,layer),weightTotal=0;for(i=0;i<weightedIndexes.length;i++)weightTotal+=weightedIndexes[i].weight;if(!(weightTotal<=0))for(i=0;i<tiles.length;i++){for(var rand=Math.random()*weightTotal,sum=0,randomIndex=-1,j=0;j<weightedIndexes.length;j++)if(rand<=(sum+=weightedIndexes[j].weight)){var chosen=weightedIndexes[j].index;randomIndex=Array.isArray(chosen)?chosen[Math.floor(Math.random()*chosen.length)]:chosen;break}tiles[i].index=randomIndex}}},components={CalculateFacesAt:CalculateFacesAt_1,CalculateFacesWithin:CalculateFacesWithin_1,CheckIsoBounds:CheckIsoBounds_1,Copy:Copy_1,CreateFromTiles:CreateFromTiles_1,CullBounds:CullBounds_1,CullTiles:CullTiles_1,Fill:Fill_1,FilterTiles:FilterTiles_1,FindByIndex:FindByIndex_1,FindTile:FindTile_1,ForEachTile:ForEachTile_1,GetCullTilesFunction:GetCullTilesFunction_1,GetTileAt:GetTileAt_1,GetTileAtWorldXY:GetTileAtWorldXY_1,GetTilesWithin:GetTilesWithin_1,GetTilesWithinShape:GetTilesWithinShape_1,GetTilesWithinWorldXY:GetTilesWithinWorldXY_1,GetTileToWorldXFunction:GetTileToWorldXFunction_1,GetTileToWorldXYFunction:GetTileToWorldXYFunction_1,GetTileToWorldYFunction:GetTileToWorldYFunction_1,GetWorldToTileXFunction:GetWorldToTileXFunction_1,GetWorldToTileXYFunction:GetWorldToTileXYFunction_1,GetWorldToTileYFunction:GetWorldToTileYFunction_1,HasTileAt:HasTileAt_1,HasTileAtWorldXY:HasTileAtWorldXY_1,HexagonalCullBounds:HexagonalCullBounds_1,HexagonalCullTiles:HexagonalCullTiles_1,HexagonalTileToWorldXY:HexagonalTileToWorldXY_1,HexagonalTileToWorldY:HexagonalTileToWorldY_1,HexagonalWorldToTileXY:HexagonalWorldToTileXY_1,HexagonalWorldToTileY:HexagonalWorldToTileY_1,IsInLayerBounds:IsInLayerBounds_1,IsometricCullTiles:IsometricCullTiles_1,IsometricTileToWorldXY:IsometricTileToWorldXY_1,IsometricWorldToTileXY:IsometricWorldToTileXY_1,PutTileAt:PutTileAt_1,PutTileAtWorldXY:PutTileAtWorldXY_1,PutTilesAt:PutTilesAt_1,Randomize:Randomize_1,RemoveTileAt:RemoveTileAt_1,RemoveTileAtWorldXY:RemoveTileAtWorldXY_1,RenderDebug:RenderDebug_1,ReplaceByIndex:ReplaceByIndex_1,RunCull:RunCull_1,SetCollision:SetCollision_1,SetCollisionBetween:function(start,stop,collides,recalculateFaces,layer,updateLayer){if(void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),void 0===updateLayer&&(updateLayer=!0),!(start>stop)){for(var index=start;index<=stop;index++)SetLayerCollisionIndex$1(index,collides,layer);if(updateLayer)for(var ty=0;ty<layer.height;ty++)for(var tx=0;tx<layer.width;tx++){var tile=layer.data[ty][tx];tile&&tile.index>=start&&tile.index<=stop&&SetTileCollision$3(tile,collides)}recalculateFaces&&CalculateFacesWithin$3(0,0,layer.width,layer.height,layer)}}
vendor: 11,420 bytes, line 785
785,SetCollisionByExclusion:function(indexes,collides,recalculateFaces,layer){void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),Array.isArray(indexes)||(indexes=[indexes]);for(var ty=0;ty<layer.height;ty++)for(var tx=0;tx<layer.width;tx++){var tile=layer.data[ty][tx];tile&&-1===indexes.indexOf(tile.index)&&(SetTileCollision$2(tile,collides),SetLayerCollisionIndex(tile.index,collides,layer))}recalculateFaces&&CalculateFacesWithin$2(0,0,layer.width,layer.height,layer)},SetCollisionByProperty:SetCollisionByProperty_1,SetCollisionFromCollisionGroup:function(collides,recalculateFaces,layer){void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0);for(var ty=0;ty<layer.height;ty++)for(var tx=0;tx<layer.width;tx++){var tile=layer.data[ty][tx];if(tile){var collisionGroup=tile.getCollisionGroup();collisionGroup&&collisionGroup.objects&&collisionGroup.objects.length>0&&SetTileCollision(tile,collides)}}recalculateFaces&&CalculateFacesWithin(0,0,layer.width,layer.height,layer)},SetLayerCollisionIndex:SetLayerCollisionIndex_1,SetTileCollision:SetTileCollision_1,SetTileIndexCallback:SetTileIndexCallback_1,SetTileLocationCallback:SetTileLocationCallback_1,Shuffle:Shuffle_1,StaggeredCullBounds:StaggeredCullBounds_1,StaggeredCullTiles:StaggeredCullTiles_1,StaggeredTileToWorldXY:StaggeredTileToWorldXY_1,StaggeredTileToWorldY:StaggeredTileToWorldY_1,StaggeredWorldToTileXY:StaggeredWorldToTileXY_1,StaggeredWorldToTileY:StaggeredWorldToTileY_1,SwapByIndex:SwapByIndex_1,TileToWorldX:TileToWorldX_1,TileToWorldXY:TileToWorldXY_1,TileToWorldY:TileToWorldY_1,WeightedRandomize:WeightedRandomize_1,WorldToTileX:WorldToTileX_1,WorldToTileXY:WorldToTileXY_1,WorldToTileY:WorldToTileY_1},CONST$7=ORIENTATION_CONST,FromOrientationString_1=function(orientation){return"isometric"===(orientation=orientation.toLowerCase())?CONST$7.ISOMETRIC:"staggered"===orientation?CONST$7.STAGGERED:"hexagonal"===orientation?CONST$7.HEXAGONAL:CONST$7.ORTHOGONAL},CONST$6=ORIENTATION_CONST,GetFastValue$8=GetFastValue_1,LayerData_1=new Class_1({initialize:function(config){void 0===config&&(config={}),this.name=GetFastValue$8(config,"name","layer"),this.x=GetFastValue$8(config,"x",0),this.y=GetFastValue$8(config,"y",0),this.width=GetFastValue$8(config,"width",0),this.height=GetFastValue$8(config,"height",0),this.tileWidth=GetFastValue$8(config,"tileWidth",0),this.tileHeight=GetFastValue$8(config,"tileHeight",0),this.baseTileWidth=GetFastValue$8(config,"baseTileWidth",this.tileWidth),this.baseTileHeight=GetFastValue$8(config,"baseTileHeight",this.tileHeight),this.orientation=GetFastValue$8(config,"orientation",CONST$6.ORTHOGONAL),this.widthInPixels=GetFastValue$8(config,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=GetFastValue$8(config,"heightInPixels",this.height*this.baseTileHeight),this.alpha=GetFastValue$8(config,"alpha",1),this.visible=GetFastValue$8(config,"visible",!0),this.properties=GetFastValue$8(config,"properties",[]),this.indexes=GetFastValue$8(config,"indexes",[]),this.collideIndexes=GetFastValue$8(config,"collideIndexes",[]),this.callbacks=GetFastValue$8(config,"callbacks",[]),this.bodies=GetFastValue$8(config,"bodies",[]),this.data=GetFastValue$8(config,"data",[]),this.tilemapLayer=GetFastValue$8(config,"tilemapLayer",null),this.hexSideLength=GetFastValue$8(config,"hexSideLength",0)}}),CONST$5=ORIENTATION_CONST,GetFastValue$7=GetFastValue_1,MapData_1=new Class_1({initialize:function(config){void 0===config&&(config={}),this.name=GetFastValue$7(config,"name","map"),this.width=GetFastValue$7(config,"width",0),this.height=GetFastValue$7(config,"height",0),this.infinite=GetFastValue$7(config,"infinite",!1),this.tileWidth=GetFastValue$7(config,"tileWidth",0),this.tileHeight=GetFastValue$7(config,"tileHeight",0),this.widthInPixels=GetFastValue$7(config,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=GetFastValue$7(config,"heightInPixels",this.height*this.tileHeight),this.format=GetFastValue$7(config,"format",null),this.orientation=GetFastValue$7(config,"orientation",CONST$5.ORTHOGONAL),this.renderOrder=GetFastValue$7(config,"renderOrder","right-down"),this.version=GetFastValue$7(config,"version","1"),this.properties=GetFastValue$7(config,"properties",{}),this.layers=GetFastValue$7(config,"layers",[]),this.images=GetFastValue$7(config,"images",[]),this.objects=GetFastValue$7(config,"objects",{}),this.collision=GetFastValue$7(config,"collision",{}),this.tilesets=GetFastValue$7(config,"tilesets",[]),this.imageCollections=GetFastValue$7(config,"imageCollections",[]),this.tiles=GetFastValue$7(config,"tiles",[]),this.hexSideLength=GetFastValue$7(config,"hexSideLength",0)}}),Formats$6=Formats$7,LayerData$3=LayerData_1,MapData$3=MapData_1,Tile$3=Tile_1,Parse2DArray_1=function(name,data,tileWidth,tileHeight,insertNull){for(var layerData=new LayerData$3({tileWidth:tileWidth,tileHeight:tileHeight}),mapData=new MapData$3({name:name,tileWidth:tileWidth,tileHeight:tileHeight,format:Formats$6.ARRAY_2D,layers:[layerData]}),tiles=[],height=data.length,width=0,y=0;y<data.length;y++){tiles[y]=[];for(var row=data[y],x=0;x<row.length;x++){var tileIndex=parseInt(row[x],10);isNaN(tileIndex)||-1===tileIndex?tiles[y][x]=insertNull?null:new Tile$3(layerData,-1,x,y,tileWidth,tileHeight):tiles[y][x]=new Tile$3(layerData,tileIndex,x,y,tileWidth,tileHeight)}0===width&&(width=row.length)}return mapData.width=layerData.width=width,mapData.height=layerData.height=height,mapData.widthInPixels=layerData.widthInPixels=width*tileWidth,mapData.heightInPixels=layerData.heightInPixels=height*tileHeight,layerData.data=tiles,mapData},Formats$5=Formats$7,Parse2DArray$1=Parse2DArray_1,ParseCSV_1=function(name,data,tileWidth,tileHeight,insertNull){var array2D=data.trim().split("\n").map((function(row){return row.split(",")})),map=Parse2DArray$1(name,array2D,tileWidth,tileHeight,insertNull);return map.format=Formats$5.CSV,map},Extend$3=Extend_1$1,AssignTileProperties_1=function(mapData){for(var layerData,tile,sid,set,row,i=0;i<mapData.layers.length;i++){layerData=mapData.layers[i],set=null;for(var j=0;j<layerData.data.length;j++){row=layerData.data[j];for(var k=0;k<row.length;k++)null===(tile=row[k])||tile.index<0||(sid=mapData.tiles[tile.index][2],set=mapData.tilesets[sid],tile.width=set.tileWidth,tile.height=set.tileHeight,set.tileProperties&&set.tileProperties[tile.index-set.firstgid]&&(tile.properties=Extend$3(tile.properties,set.tileProperties[tile.index-set.firstgid])))}}},Tileset$4=new Class_1({initialize:function(name,firstgid,tileWidth,tileHeight,tileMargin,tileSpacing,tileProperties,tileData){(void 0===tileWidth||tileWidth<=0)&&(tileWidth=32),(void 0===tileHeight||tileHeight<=0)&&(tileHeight=32),void 0===tileMargin&&(tileMargin=0),void 0===tileSpacing&&(tileSpacing=0),void 0===tileProperties&&(tileProperties={}),void 0===tileData&&(tileData={}),this.name=name,this.firstgid=firstgid,this.tileWidth=tileWidth,this.tileHeight=tileHeight,this.tileMargin=tileMargin,this.tileSpacing=tileSpacing,this.tileProperties=tileProperties,this.tileData=tileData,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(tileIndex){return this.containsTileIndex(tileIndex)?this.tileProperties[tileIndex-this.firstgid]:null},getTileData:function(tileIndex){return this.containsTileIndex(tileIndex)?this.tileData[tileIndex-this.firstgid]:null},getTileCollisionGroup:function(tileIndex){var data=this.getTileData(tileIndex);return data&&data.objectgroup?data.objectgroup:null},containsTileIndex:function(tileIndex){return tileIndex>=this.firstgid&&tileIndex<this.firstgid+this.total},getTileTextureCoordinates:function(tileIndex){return this.containsTileIndex(tileIndex)?this.texCoordinates[tileIndex-this.firstgid]:null},setImage:function(texture){return this.image=texture,this.glTexture=texture.get().source.glTexture,this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setTileSize:function(tileWidth,tileHeight){return void 0!==tileWidth&&(this.tileWidth=tileWidth),void 0!==tileHeight&&(this.tileHeight=tileHeight),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(margin,spacing){return void 0!==margin&&(this.tileMargin=margin),void 0!==spacing&&(this.tileSpacing=spacing),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(imageWidth,imageHeight){var rowCount=(imageHeight-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),colCount=(imageWidth-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);rowCount%1==0&&colCount%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),rowCount=Math.floor(rowCount),colCount=Math.floor(colCount),this.rows=rowCount,this.columns=colCount,this.total=rowCount*colCount,this.texCoordinates.length=0;for(var tx=this.tileMargin,ty=this.tileMargin,y=0;y<this.rows;y++){for(var x=0;x<this.columns;x++)this.texCoordinates.push({x:tx,y:ty}),tx+=this.tileWidth+this.tileSpacing;tx=this.tileMargin,ty+=this.tileHeight+this.tileSpacing}return this}}),Tileset_1=Tileset$4,Tileset$3=Tileset_1,BuildTilesetIndex_1=function(mapData){var i,set,tiles=[];for(i=0;i<mapData.imageCollections.length;i++)for(var collection=mapData.imageCollections[i],images=collection.images,j=0;j<images.length;j++){var image=images[j];(set=new Tileset$3(image.image,image.gid,collection.imageWidth,collection.imageHeight,0,0)).updateTileData(collection.imageWidth,collection.imageHeight),mapData.tilesets.push(set)}for(i=0;i<mapData.tilesets.length;i++)for(var x=(set=mapData.tilesets[i]).tileMargin,y=set.tileMargin,count=0,countX=0,countY=0,t=set.firstgid;t<set.firstgid+set.total&&(tiles[t]=[x,y,i],x+=set.tileWidth+set.tileSpacing,++count!==set.total)&&(++countX!==set.columns||(x=set.tileMargin,y+=set.tileHeight+set.tileSpacing,countX=0,++countY!==set.rows));t++);return tiles},GetFastValue$6=GetFastValue_1,CreateGroupLayer_1=function(json,groupl,parentstate){if(!groupl)return{i:0,layers:json.layers,name:"",opacity:1,visible:!0,x:0,y:0};var layerX=groupl.x+GetFastValue$6(groupl,"startx",0)*json.tilewidth+GetFastValue$6(groupl,"offsetx",0),layerY=groupl.y+GetFastValue$6(groupl,"starty",0)*json.tileheight+GetFastValue$6(groupl,"offsety",0);return{i:0,layers:groupl.layers,name:parentstate.name+groupl.name+"/",opacity:parentstate.opacity*groupl.opacity,visible:parentstate.visible&&groupl.visible,x:parentstate.x+layerX,y:parentstate.y+layerY}},GetFastValue$5=GetFastValue_1,CreateGroupLayer$2=CreateGroupLayer_1,ParseImageLayers_1=function(json){for(var images=[],groupStack=[],curGroupState=CreateGroupLayer$2(json);curGroupState.i<curGroupState.layers.length||groupStack.length>0;)if(curGroupState.i>=curGroupState.layers.length){if(groupStack.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}curGroupState=groupStack.pop()}else{var curi=curGroupState.layers[curGroupState.i];if(curGroupState.i++,"imagelayer"===curi.type){var layerOffsetX=GetFastValue$5(curi,"offsetx",0)+GetFastValue$5(curi,"startx",0),layerOffsetY=GetFastValue$5(curi,"offsety",0)+GetFastValue$5(curi,"starty",0);images.push({name:curGroupState.name+curi.name,image:curi.image,x:curGroupState.x+layerOffsetX+curi.x,y:curGroupState.y+layerOffsetY+curi.y,alpha:curGroupState.o
785pacity*curi.opacity,visible:curGroupState.visible&&curi.visible,properties:GetFastValue$5(curi,"properties",{})})}else if("group"===curi.type){var nextGroupState=CreateGroupLayer$2(json,curi,curGroupState);groupStack.push(curGroupState),curGroupState=nextGroupState}}return images},HasValue=HasValue_1,Pick_1=function(object,keys){for(var obj={},i=0;i<keys.length;i++){var key=keys[i];HasValue(object,key)&&(obj[key]=object[key])}return obj},ParseGID_1=function(gid){var flippedHorizontal=Boolean(2147483648&gid),flippedVertical=Boolean(1073741824&gid),flippedAntiDiagonal=Boolean(536870912&gid);gid&=536870911;var rotation=0,flipped=!1;return flippedHorizontal&&flippedVertical&&flippedAntiDiagonal?(rotation=Math.PI/2,flipped=!0):flippedHorizontal&&flippedVertical&&!flippedAntiDiagonal?(rotation=Math.PI,flipped=!1):flippedHorizontal&&!flippedVertical&&flippedAntiDiagonal?(rotation=Math.PI/2,flipped=!1):!flippedHorizontal||flippedVertical||flippedAntiDiagonal?!flippedHorizontal&&flippedVertical&&flippedAntiDiagonal?(rotation=3*Math.PI/2,flipped=!1):flippedHorizontal||!flippedVertical||flippedAntiDiagonal?flippedHorizontal||flippedVertical||!flippedAntiDiagonal?flippedHorizontal||flippedVertical||flippedAntiDiagonal||(rotation=0,flipped=!1):(rotation=3*Math.PI/2,flipped=!0):(rotation=Math.PI,flipped=!0):(rotation=0,flipped=!0),{gid:gid,flippedHorizontal:flippedHorizontal,flippedVertical:flippedVertical,flippedAntiDiagonal:flippedAntiDiagonal,rotation:rotation,flipped:flipped}},Pick=Pick_1,ParseGID$1=ParseGID_1,copyPoints=function(p){return{x:p.x,y:p.y}},commonObjectProps=["id","name","type","rotation","properties","visible","x","y","width","height"],ParseObject_1=function(tiledObject,offsetX,offsetY){void 0===offsetX&&(offsetX=0),void 0===offsetY&&(offsetY=0);var parsedObject=Pick(tiledObject,commonObjectProps);if(parsedObject.x+=offsetX,parsedObject.y+=offsetY,tiledObject.gid){var gidInfo=ParseGID$1(tiledObject.gid);parsedObject.gid=gidInfo.gid,parsedObject.flippedHorizontal=gidInfo.flippedHorizontal,parsedObject.flippedVertical=gidInfo.flippedVertical,parsedObject.flippedAntiDiagonal=gidInfo.flippedAntiDiagonal}else tiledObject.polyline?parsedObject.polyline=tiledObject.polyline.map(copyPoints):tiledObject.polygon?parsedObject.polygon=tiledObject.polygon.map(copyPoints):tiledObject.ellipse?parsedObject.ellipse=tiledObject.ellipse:tiledObject.text?parsedObject.text=tiledObject.text:tiledObject.point?parsedObject.point=!0:parsedObject.rectangle=!0;return parsedObject},GetFastValue$4=GetFastValue_1,ObjectLayer_1=new Class_1({initialize:function(config){void 0===config&&(config={}),this.name=GetFastValue$4(config,"name","object layer"),this.opacity=GetFastValue$4(config,"opacity",1),this.properties=GetFastValue$4(config,"properties",{}),this.propertyTypes=GetFastValue$4(config,"propertytypes",{}),this.type=GetFastValue$4(config,"type","objectgroup"),this.visible=GetFastValue$4(config,"visible",!0),this.objects=GetFastValue$4(config,"objects",[])}}),GetFastValue$3=GetFastValue_1,ParseObject$1=ParseObject_1,ObjectLayer=ObjectLayer_1,CreateGroupLayer$1=CreateGroupLayer_1,ParseObjectLayers_1=function(json){for(var objectLayers=[],groupStack=[],curGroupState=CreateGroupLayer$1(json);curGroupState.i<curGroupState.layers.length||groupStack.length>0;)if(curGroupState.i>=curGroupState.layers.length){if(groupStack.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}curGroupState=groupStack.pop()}else{var curo=curGroupState.layers[curGroupState.i];if(curGroupState.i++,curo.opacity*=curGroupState.opacity,curo.visible=curGroupState.visible&&curo.visible,"objectgroup"===curo.type){curo.name=curGroupState.name+curo.name;for(var offsetX=curGroupState.x+GetFastValue$3(curo,"startx",0)+GetFastValue$3(curo,"offsetx",0),offsetY=curGroupState.y+GetFastValue$3(curo,"starty",0)+GetFastValue$3(curo,"offsety",0),objects=[],j=0;j<curo.objects.length;j++){var parsedObject=ParseObject$1(curo.objects[j],offsetX,offsetY);objects.push(parsedObject)}var objectLayer=new ObjectLayer(curo);objectLayer.objects=objects,objectLayers.push(objectLayer)}else if("group"===curo.type){var nextGroupState=CreateGroupLayer$1(json,curo,curGroupState);groupStack.push(curGroupState),curGroupState=nextGroupState}}return objectLayers},Base64Decode_1=function(data){for(var binaryString=window.atob(data),len=binaryString.length,bytes=new Array(len/4),i=0;i<len;i+=4)bytes[i/4]=(binaryString.charCodeAt(i)|binaryString.charCodeAt(i+1)<<8|binaryString.charCodeAt(i+2)<<16|binaryString.charCodeAt(i+3)<<24)>>>0;return bytes},Base64Decode=Base64Decode_1,CONST$4=ORIENTATION_CONST,CreateGroupLayer=CreateGroupLayer_1,FromOrientationString$1=FromOrientationString_1,GetFastValue$2=GetFastValue_1,LayerData$2=LayerData_1,ParseGID=ParseGID_1,Tile$2=Tile_1,ParseTileLayers_1$1=function(json,insertNull){for(var infiniteMap=GetFastValue$2(json,"infinite",!1),tileLayers=[],groupStack=[],curGroupState=CreateGroupLayer(json);curGroupState.i<curGroupState.layers.length||groupStack.length>0;)if(curGroupState.i>=curGroupState.layers.length){if(groupStack.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}curGroupState=groupStack.pop()}else{var curl=curGroupState.layers[curGroupState.i];if(curGroupState.i++,"tilelayer"===curl.type)if(curl.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+curl.name+"'");else{if(curl.encoding&&"base64"===curl.encoding){if(curl.chunks)for(var i=0;i<curl.chunks.length;i++)curl.chunks[i].data=Base64Decode(curl.chunks[i].data);curl.data&&(curl.data=Base64Decode(curl.data)),delete curl.encoding}var layerData,gidInfo,tile,blankTile,output=[],x=0;if(infiniteMap){var layerOffsetX=GetFastValue$2(curl,"startx",0)+curl.x,layerOffsetY=GetFastValue$2(curl,"starty",0)+curl.y;(layerData=new LayerData$2({name:curGroupState.name+curl.name,x:curGroupState.x+GetFastValue$2(curl,"offsetx",0)+layerOffsetX*json.tilewidth,y:curGroupState.y+GetFastValue$2(curl,"offsety",0)+layerOffsetY*json.tileheight,width:curl.width,height:curl.height,tileWidth:json.tilewidth,tileHeight:json.tileheight,alpha:curGroupState.o
vendor: 4,264 bytes, line 785
785pacity*curl.opacity,visible:curGroupState.visible&&curl.visible,properties:GetFastValue$2(curl,"properties",[]),orientation:FromOrientationString$1(json.orientation)})).orientation===CONST$4.HEXAGONAL&&(layerData.hexSideLength=json.hexsidelength);for(var c=0;c<curl.height;c++){output.push([null]);for(var j=0;j<curl.width;j++)output[c][j]=null}for(c=0,len=curl.chunks.length;c<len;c++)for(var chunk=curl.chunks[c],offsetX=chunk.x-layerOffsetX,offsetY=chunk.y-layerOffsetY,y=0,t=0,len2=chunk.data.length;t<len2;t++){var newOffsetX=x+offsetX,newOffsetY=y+offsetY;(gidInfo=ParseGID(chunk.data[t])).gid>0?((tile=new Tile$2(layerData,gidInfo.gid,newOffsetX,newOffsetY,json.tilewidth,json.tileheight)).rotation=gidInfo.rotation,tile.flipX=gidInfo.flipped,output[newOffsetY][newOffsetX]=tile):(blankTile=insertNull?null:new Tile$2(layerData,-1,newOffsetX,newOffsetY,json.tilewidth,json.tileheight),output[newOffsetY][newOffsetX]=blankTile),++x===chunk.width&&(y++,x=0)}}else{(layerData=new LayerData$2({name:curGroupState.name+curl.name,x:curGroupState.x+GetFastValue$2(curl,"offsetx",0)+curl.x,y:curGroupState.y+GetFastValue$2(curl,"offsety",0)+curl.y,width:curl.width,height:curl.height,tileWidth:json.tilewidth,tileHeight:json.tileheight,alpha:curGroupState.opacity*curl.opacity,visible:curGroupState.visible&&curl.visible,properties:GetFastValue$2(curl,"properties",[]),orientation:FromOrientationString$1(json.orientation)})).orientation===CONST$4.HEXAGONAL&&(layerData.hexSideLength=json.hexsidelength);for(var row=[],k=0,len=curl.data.length;k<len;k++)(gidInfo=ParseGID(curl.data[k])).gid>0?((tile=new Tile$2(layerData,gidInfo.gid,x,output.length,json.tilewidth,json.tileheight)).rotation=gidInfo.rotation,tile.flipX=gidInfo.flipped,row.push(tile)):(blankTile=insertNull?null:new Tile$2(layerData,-1,x,output.length,json.tilewidth,json.tileheight),row.push(blankTile)),++x===curl.width&&(output.push(row),x=0,row=[])}layerData.data=output,tileLayers.push(layerData)}else if("group"===curl.type){var nextGroupState=CreateGroupLayer(json,curl,curGroupState);groupStack.push(curGroupState),curGroupState=nextGroupState}}return tileLayers},ImageCollection$1=new Class_1({initialize:function(name,firstgid,width,height,margin,spacing,properties){(void 0===width||width<=0)&&(width=32),(void 0===height||height<=0)&&(height=32),void 0===margin&&(margin=0),void 0===spacing&&(spacing=0),this.name=name,this.firstgid=0|firstgid,this.imageWidth=0|width,this.imageHeight=0|height,this.imageMargin=0|margin,this.imageSpacing=0|spacing,this.properties=properties||{},this.images=[],this.total=0},containsImageIndex:function(imageIndex){return imageIndex>=this.firstgid&&imageIndex<this.firstgid+this.total},addImage:function(gid,image){return this.images.push({gid:gid,image:image}),this.total++,this}}),ImageCollection_1=ImageCollection$1,ParseWangsets_1=function(wangsets,datas){for(var w=0;w<wangsets.length;w++){var wangset=wangsets[w],identifier=w;if(wangset.name&&""!==wangset.name&&(identifier=wangset.name),Array.isArray(wangset.wangtiles)&&wangset.wangtiles.length>0){var c,color,colorIndex,edgeColors={},cornerColors={};if(Array.isArray(wangset.edgecolors))for(c=0;c<wangset.edgecolors.length;c++)colorIndex=1+c,""!==(color=wangset.edgecolors[c]).name&&(edgeColors[colorIndex]=color.name);if(Array.isArray(wangset.cornercolors))for(c=0;c<wangset.cornercolors.length;c++)colorIndex=1+c,""!==(color=wangset.cornercolors[c]).name&&(cornerColors[colorIndex]=color.name);if(Array.isArray(wangset.colors))for(c=0;c<wangset.colors.length;c++)colorIndex=1+c,""!==(color=wangset.colors[c]).name&&(edgeColors[colorIndex]=cornerColors[colorIndex]=color.name);for(var idLayout=[edgeColors,cornerColors,edgeColors,cornerColors,edgeColors,cornerColors,edgeColors,cornerColors],t=0;t<wangset.wangtiles.length;t++){var wangtile=wangset.wangtiles[t],obj=datas[wangtile.tileid]||(datas[wangtile.tileid]={});obj=obj.wangid||(obj.wangid={});for(var wangid=[],i=0;i<Math.min(idLayout.length,wangtile.wangid.length);i++)if(0!==(color=wangtile.wangid[i])){var renamed=idLayout[i][color];void 0===renamed?wangid.push(color):wangid.push(renamed)}else wangid.push(void 0);obj[identifier]=wangid}}}},Tileset$2=Tileset_1,ImageCollection=ImageCollection_1,ParseObject=ParseObject_1,ParseWangset
785s=ParseWangsets_1,ParseTilesets_1$1=function(json){for(var stringID,tilesets=[],imageCollections=[],lastSet=null,i=0;i<json.tilesets.length;i++){var set=json.tilesets[i];if(set.source)console.warn("External tilesets unsupported. Use Embed Tileset and re-export");else if(set.image){var newSet=new Tileset$2(set.name,set.firstgid,set.tilewidth,set.tileheight,set.margin,set.spacing);if(json.version>1){var datas=void 0,props=void 0;if(Array.isArray(set.tiles)){datas=datas||{},props=props||{};for(var t=0;t<set.tiles.length;t++){var tile=set.tiles[t];if(tile.properties){var newPropData={};tile.properties.forEach((function(propData){newPropData[propData.name]=propData.value})),props[tile.id]=newPropData}if(tile.objectgroup&&((datas[tile.id]||(datas[tile.id]={})).objectgroup=tile.objectgroup,tile.objectgroup.objects)){var parsedObjects2=tile.objectgroup.objects.map((function(obj){return ParseObject(obj)}));datas[tile.id].objectgroup.objects=parsedObjects2}tile.animation&&((datas[tile.id]||(datas[tile.id]={})).animation=tile.animation),tile.type&&((datas[tile.id]||(datas[tile.id]={})).type=tile.type)}}Array.isArray(set.wangsets)&&(datas=datas||{},props=props||{},ParseWangsets(set.wangsets,datas)),datas&&(newSet.tileData=datas,newSet.tileProperties=props)}else if(set.tileproperties&&(newSet.tileProperties=set.tileproperties),set.tiles)for(stringID in newSet.tileData=set.tiles,newSet.tileData){var objectGroup=newSet.tileData[stringID].objectgroup;if(objectGroup&&objectGroup.objects){var parsedObjects1=objectGroup.objects.map((function(obj){return ParseObject(obj)}));newSet.tileData[stringID].objectgroup.objects=parsedObjects1}}newSet.updateTileData(set.imagewidth,set.imageheight),tilesets.push(newSet)}else{var newCollection=new ImageCollection(set.name,set.firstgid,set.tilewidth,set.tileheight,set.margin,set.spacing,set.properties),maxId=0;for(t=0;t<set.tiles.length;t++){var image=(tile=set.tiles[t]).image,tileId=parseInt(tile.id,10),gid=set.firstgid+tileId;newCollection.addImage(gid,image),maxId=Math.max(tileId,maxId)}newCollection.maxId=maxId,imageCollections.push(newCollection)}lastSet&&(lastSet.lastgid=set.firstgid-1),lastSet=set}return{tilesets:tilesets,imageCollections:imageCollections}},AssignTileProperties=AssignTileProperties_1,BuildTilesetIndex=BuildTilesetIndex_1,CONST$3=ORIENTATION_CONST,Formats$4=Formats$7,FromOrientationString=FromOrientationString_1,MapData$2=MapData_1,ParseImageLayers=ParseImageLayers_1,ParseObjectLayers=ParseObjectLayers_1,ParseTileLayers$2=ParseTileLayers_1$1,ParseTilesets$2=ParseTilesets_1$1,ParseJSONTiled_1=function(name,json,insertNull){var mapData=new MapData$2({width:json.width,height:json.height,name:name,tileWidth:json.tilewidth,tileHeight:json.tileheight,orientation:FromOrientationString(json.orientation),format:Formats$4.TILED_JSON,version:json.version,properties:json.properties,renderOrder:json.renderorder,infinite:json.infinite});mapData.orientation===CONST$3.HEXAGONAL&&(mapData.hexSideLength=json.hexsidelength),mapData.layers=ParseTileLayers$2(json,insertNull),mapData.images=ParseImageLayers(json);var sets=ParseTilesets$2(json);return mapData.tilesets=sets.tilesets,mapData.imageCollections=sets.imageCollections,mapData.objects=ParseObjectLayers(json),mapData.tiles=BuildTilesetIndex(mapData),AssignTileProperties(mapData),mapData},LayerData$1=LayerData_1,Tile$1=Tile_1,ParseTileLayers_1=function(json,insertNull){for(var tileLayers=[],i=0;i<json.layer.length;i++){for(var layer=json.layer[i],layerData=new LayerData$1({name:layer.name,width:layer.width,height:layer.height,tileWidth:layer.tilesize,tileHeight:layer.tilesize,visible:1===layer.visible}),row=[],tileGrid=[],y=0;y<layer.data.length;y++){for(var x=0;x<layer.data[y].length;x++){var tile,index=layer.data[y][x]-1;tile=index>-1?new Tile$1(layerData,index,x,y,layer.tilesize,layer.tilesize):insertNull?null:new Tile$1(layerData,-1,x,y,layer.tilesize,layer.tilesize),row.push(tile)}tileGrid.push(row),row=[]}layerData.data=tileGrid,tileLayers.push(layerData)}return tileLayers},Tileset$1=Tileset_1,ParseTilesets_1=function(json){for(var tilesets=[],tilesetsNames=[],i=0;i<json.layer.length;i++){var layer=json.layer[i],tilesetName=layer.tilesetName;""!==tilesetName&&-1===tilesetsNames.indexOf(tilesetName)&&(tilesetsNames.push(tilesetName),tilesets.push(new Tileset$1(tilesetName,0,layer.tilesize,layer.tilesize,0,0)))}return tilesets},Formats$3=Formats$7,MapData$1=MapData_1,ParseTileLayers=ParseTileLayers_1,ParseTilesets=ParseTilesets_1,ParseWeltmeister_1=function(name,json,insertNull){if(0===json.layer.length)return console.warn("No layers found in the Weltmeister map: "+name),null;for(var width=0,height=0,i=0;i<json.layer.length;i++)json.layer[i].width>width&&(width=json.layer[i].width),json.layer[i].height>height&&(height=json.layer[i].height);var mapData=new MapData$1({width:width,height:height,name:name,tileWidth:json.layer[0].tilesize,tileHeight:json.layer[0].tilesize,format:Formats$3.WELTMEISTER});return mapData.layers=ParseTileLayers(json,insertNull),mapData.tilesets=ParseTilesets(json),mapData},Formats$2=Formats$7,Parse2DArray=Parse2DArray_1,ParseCSV=ParseCSV_1,ParseJSONTiled=ParseJSONTiled_1,ParseWeltmeister=ParseWeltmeister_1,Parse_1=function(name,mapFormat,data,tileWidth,tileHeight,insertNull){var newMap;switch(mapFormat){case Formats$2.ARRAY_2D:newMap=Parse2DArray(name,data,tileWidth,tileHeight,insertNull);break;case Formats$2.CSV:newMap=ParseCSV(name,data,tileWidth,tileHeight,insertNull);break;case Formats$2.TILED_JSON:newMap=ParseJSONTiled(name,data,insertNull);break;case Formats$2.WELTMEISTER:newMap=ParseWeltmeister(name,data,insertNull);break;default:console.warn("Unrecognized tilemap data format: "+mapFormat),newMap=null}return newMap},parsers={FromOrientationString:FromOrientationString_1,Parse:Parse_1,Parse2DArray:Parse2DArray_1,ParseCSV:ParseCSV_1,Impact:{ParseTileLayers:ParseTileLayers_1,ParseTilesets:ParseTilesets_1,ParseWeltmeister:ParseWeltmeister_1},Tiled:{AssignTileProperties:AssignTileProperties_1,Base64Decode:Base64Decode_1,BuildTilesetIndex:BuildTilesetIndex_1,CreateGroupLayer:CreateGroupLayer_1,ParseGID:ParseGID_1,ParseImageLayers:ParseImageLayers_1,ParseJSONTiled:ParseJSONTiled_1,ParseObject:ParseObject_1,ParseObjectLayers:ParseObjectLayers_1,ParseTileLayers:ParseTileLayers_1$1,ParseTilesets:ParseTilesets_1$1}},Utils=Utils$p,TilemapLayerWebGLRenderer_1=function(renderer,src,camera){var renderTiles=src.cull(camera),tileCount=renderTiles.length,alpha=camera.alpha*src.alpha;if(!(0===tileCount||alpha<=0)){var gidMap=src.gidMap,pipeline=renderer.pipelines.set(sr
785c.pipeline,src),getTint=Utils.getTintAppendFloatAlpha,scrollFactorX=src.scrollFactorX,scrollFactorY=src.scrollFactorY,x=src.x,y=src.y,sx=src.scaleX,sy=src.scaleY;renderer.pipelines.preBatch(src);for(var i=0;i<tileCount;i++){var tile=renderTiles[i],tileset=gidMap[tile.index];if(tileset){var tileTexCoords=tileset.getTileTextureCoordinates(tile.index);if(null!==tileTexCoords){var texture=tileset.glTexture,textureUnit=pipeline.setTexture2D(texture,src),frameWidth=tileset.tileWidth,frameHeight=tileset.tileHeight,frameX=tileTexCoords.x,frameY=tileTexCoords.y,tw=.5*tileset.tileWidth,th=.5*tileset.tileHeight,tint=getTint(tile.tint,alpha*tile.alpha);pipeline.batchTexture(src,texture,texture.width,texture.height,x+(tw+tile.pixelX)*sx,y+(th+tile.pixelY)*sy,tile.width,tile.height,sx,sy,tile.rotation,tile.flipX,tile.flipY,scrollFactorX,scrollFactorY,tw,th,frameX,frameY,frameWidth,frameHeight,tint,tint,tint,tint,!1,0,0,camera,null,!0,textureUnit)}}}renderer.pipelines.postBatch(src)}},TransformMatrix=TransformMatrix_1,tempMatrix1=new TransformMatrix,tempMatrix2=new TransformMatrix,tempMatrix3=new TransformMatrix,TilemapLayerCanvasRenderer_1=function(renderer,src,camera,parentMatrix){var renderTiles=src.cull(camera),tileCount=renderTiles.length,alpha=camera.alpha*src.alpha;if(!(0===tileCount||alpha<=0)){var camMatrix=tempMatrix1,layerMatrix=tempMatrix2,calcMatrix=tempMatrix3;layerMatrix.applyITRS(src.x,src.y,src.rotation,src.scaleX,src.scaleY),camMatrix.copyFrom(camera.matrix);var ctx=renderer.currentContext,gidMap=src.gidMap;ctx.save(),parentMatrix?(camMatrix.multiplyWithOffset(parentMatrix,-camera.scrollX*src.scrollFactorX,-camera.scrollY*src.scrollFactorY),layerMatrix.e=src.x,layerMatrix.f=src.y,camMatrix.multiply(layerMatrix,calcMatrix),calcMatrix.copyToContext(ctx)):(layerMatrix.e-=camera.scrollX*src.scrollFactorX,layerMatrix.f-=camera.scrollY*src.scrollFactorY,layerMatrix.copyToContext(ctx)),(!renderer.antialias||src.scaleX>1||src.scaleY>1)&&(ctx.imageSmoothingEnabled=!1);for(var i=0;i<tileCount;i++){var tile=renderTiles[i],tileset=gidMap[tile.index];if(tileset){var image=tileset.image.getSourceImage(),tileTexCoords=tileset.getTileTextureCoordinates(tile.index);if(null!==tileTexCoords){var tileWidth=tileset.tileWidth,tileHeight=tileset.tileHeight,halfWidth=.5*tileWidth,halfHeight=.5*tileHeight;ctx.save(),ctx.translate(tile.pixelX+halfWidth,tile.pixelY+halfHeight),0!==tile.rotation&&ctx.rotate(tile.rotation),(tile.flipX||tile.flipY)&&ctx.scale(tile.flipX?-1:1,tile.flipY?-1:1),ctx.globalAlpha=alpha*tile.alpha,ctx.drawImage(image,tileTexCoords.x,tileTexCoords.y,tileWidth,tileHeight,-halfWidth,-halfHeight,tileWidth,tileHeight),ctx.restore()}}}ctx.restore()}},GameObject=GameObject_1,TilemapComponents$1=components,TilemapLayer$1=new Class_1({Extends:GameObject,Mixins:[components$3.Alpha,components$3.BlendMode,components$3.ComputedSize,components$3.Depth,components$3.Flip,components$3.GetBounds,components$3.Origin,components$3.Pipeline,components$3.Transform,components$3.Visible,components$3.ScrollFactor,{renderWebGL:TilemapLayerWebGLRenderer_1,renderCanvas:TilemapLayerCanvasRenderer_1}],initialize:function(scene,tilemap,layerIndex,tileset,x,y){GameObject.call(this,scene,"TilemapLayer"),this.isTilemap=!0,this.tilemap=tilemap,this.layerIndex=layerIndex,this.layer=tilemap.layers[layerIndex],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=TilemapComponents$1.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(tileset),this.setAlpha(this.layer.alpha),this.setPosition(x,y),this.setOrigin(),this.setSize(tilemap.tileWidth*this.layer.width,tilemap.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(tilesets){var gidMap=[],setList=[],map=this.tilemap;Array.isArray(tilesets)||(tilesets=[tilesets]);for(var i=0;i<tilesets.length;i++){var tileset=tilesets[i];if("string"==typeof tileset&&(tileset=map.getTileset(tileset)),tileset){setList.push(tileset);for(var s=tileset.firstgid,t=0;t<tileset.total;t++)gidMap[s+t]=tileset}}this.gidMap=gidMap,this.tileset=setList},setRenderOrder:function(renderOrder){return"string"==typeof renderOrder&&(renderOrder=["right-down","left-down","right-up","left-up"].indexOf(renderOrder)),renderOrder>=0&&renderOrder<4&&(this._renderOrder=renderOrder),this},calculateFacesAt:function(tileX,tileY){return TilemapComponents$1.CalculateFacesAt(tileX,tileY,this.layer),this},calculateFacesWithin:function(tileX,tileY,width,height){return TilemapComponents$1.CalculateFacesWithin(tileX,tileY,width,height,this.layer),this}
vendor: 4,360 bytes, line 785
785,createFromTiles:function(indexes,replacements,spriteConfig,scene,camera){return TilemapComponents$1.CreateFromTiles(indexes,replacements,spriteConfig,scene,camera,this.layer)},cull:function(camera){return this.cullCallback(this.layer,camera,this.culledTiles,this._renderOrder)},copy:function(srcTileX,srcTileY,width,height,destTileX,destTileY,recalculateFaces){return TilemapComponents$1.Copy(srcTileX,srcTileY,width,height,destTileX,destTileY,recalculateFaces,this.layer),this},fill:function(index,tileX,tileY,width,height,recalculateFaces){return TilemapComponents$1.Fill(index,tileX,tileY,width,height,recalculateFaces,this.layer),this},filterTiles:function(callback,context,tileX,tileY,width,height,filteringOptions){return TilemapComponents$1.FilterTiles(callback,context,tileX,tileY,width,height,filteringOptions,this.layer)},findByIndex:function(findIndex,skip,reverse){return TilemapComponents$1.FindByIndex(findIndex,skip,reverse,this.layer)},findTile:function(callback,context,tileX,tileY,width,height,filteringOptions){return TilemapComponents$1.FindTile(callback,context,tileX,tileY,width,height,filteringOptions,this.layer)},forEachTile:function(callback,context,tileX,tileY,width,height,filteringOptions){return TilemapComponents$1.ForEachTile(callback,context,tileX,tileY,width,height,filteringOptions,this.layer),this},getTileAt:function(tileX,tileY,nonNull){return TilemapComponents$1.GetTileAt(tileX,tileY,nonNull,this.layer)},getTileAtWorldXY:function(worldX,worldY,nonNull,camera){return TilemapComponents$1.GetTileAtWorldXY(worldX,worldY,nonNull,camera,this.layer)},getTilesWithin:function(tileX,tileY,width,height,filteringOptions){return TilemapComponents$1.GetTilesWithin(tileX,tileY,width,height,filteringOptions,this.layer)},getTilesWithinShape:function(shape,filteringOptions,camera){return TilemapComponents$1.GetTilesWithinShape(shape,filteringOptions,camera,this.layer)},getTilesWithinWorldXY:function(worldX,worldY,width,height,filteringOptions,camera){return TilemapComponents$1.GetTilesWithinWorldXY(worldX,worldY,width,height,filteringOptions,camera,this.layer)},hasTileAt:function(tileX,tileY){return TilemapComponents$1.HasTileAt(tileX,tileY,this.layer)},hasTileAtWorldXY:function(worldX,worldY,camera){return TilemapComponents$1.HasTileAtWorldXY(worldX,worldY,camera,this.layer)},putTileAt:function(tile,tileX,tileY,recalculateFaces){return TilemapComponents$1.PutTileAt(tile,tileX,tileY,recalculateFaces,this.layer)},putTileAtWorldXY:function(tile,worldX,worldY,recalculateFaces,camera){return TilemapComponents$1.PutTileAtWorldXY(tile,worldX,worldY,recalculateFaces,camera,this.layer)},putTilesAt:function(tilesArray,tileX,tileY,recalculateFaces){return TilemapComponents$1.PutTilesAt(tilesArray,tileX,tileY,recalculateFaces,this.layer),this},randomize:function(tileX,tileY,width,height,indexes){return TilemapComponents$1.Randomize(tileX,tileY,width,height,indexes,this.layer),this},removeTileAt:function(tileX,tileY,replaceWithNull,recalculateFaces){return TilemapComponents$1.RemoveTileAt(tileX,tileY,replaceWithNull,recalculateFaces,this.layer)},removeTileAtWorldXY:function(worldX,worldY,replaceWithNull,recalculateFaces,camera){return TilemapComponents$1.RemoveTileAtWorldXY(worldX,worldY,replaceWithNull,recalculateFaces,camera,this.layer)},renderDebug:function(graphics,styleConfig){return TilemapComponents$1.RenderDebug(graphics,styleConfig,this.layer),this},replaceByIndex:function(findIndex,newIndex,tileX,tileY,width,height){return TilemapComponents$1.ReplaceByIndex(findIndex,newIndex,tileX,tileY,width,height,this.layer),this},setSkipCull:function(value){return void 0===value&&(value=!0),this.skipCull=value,this},setCullPadding:function(paddingX,paddingY){return void 0===paddingX&&(paddingX=1),void 0===paddingY&&(paddingY=1),this.cullPaddingX=paddingX,this.cullPaddingY=paddingY,this},setCollision:function(indexes,collides,recalculateFaces,updateLayer){return TilemapComponents$1.SetCollision(indexes,collides,recalculateFaces,this.layer,updateLayer),this},setCollisionBetween:function(start,stop,collides,recalculateFaces){return TilemapComponents$1.SetCollisionBetween(start,stop,collides,recalculateFaces,this.layer),this},setCollisionByProperty:function(properties,collides,recalculateFaces){return TilemapComponents$1.SetCollisionByProperty(properties,collides,recalculateFaces,this.layer),this}
785,setCollisionByExclusion:function(indexes,collides,recalculateFaces){return TilemapComponents$1.SetCollisionByExclusion(indexes,collides,recalculateFaces,this.layer),this},setCollisionFromCollisionGroup:function(collides,recalculateFaces){return TilemapComponents$1.SetCollisionFromCollisionGroup(collides,recalculateFaces,this.layer),this},setTileIndexCallback:function(indexes,callback,callbackContext){return TilemapComponents$1.SetTileIndexCallback(indexes,callback,callbackContext,this.layer),this},setTileLocationCallback:function(tileX,tileY,width,height,callback,callbackContext){return TilemapComponents$1.SetTileLocationCallback(tileX,tileY,width,height,callback,callbackContext,this.layer),this},shuffle:function(tileX,tileY,width,height){return TilemapComponents$1.Shuffle(tileX,tileY,width,height,this.layer),this},swapByIndex:function(indexA,indexB,tileX,tileY,width,height){return TilemapComponents$1.SwapByIndex(indexA,indexB,tileX,tileY,width,height,this.layer),this},tileToWorldX:function(tileX,camera){return this.tilemap.tileToWorldX(tileX,camera,this)},tileToWorldY:function(tileY,camera){return this.tilemap.tileToWorldY(tileY,camera,this)},tileToWorldXY:function(tileX,tileY,point,camera){return this.tilemap.tileToWorldXY(tileX,tileY,point,camera,this)},weightedRandomize:function(weightedIndexes,tileX,tileY,width,height){return TilemapComponents$1.WeightedRandomize(tileX,tileY,width,height,weightedIndexes,this.layer),this},worldToTileX:function(worldX,snapToFloor,camera){return this.tilemap.worldToTileX(worldX,snapToFloor,camera,this)},worldToTileY:function(worldY,snapToFloor,camera){return this.tilemap.worldToTileY(worldY,snapToFloor,camera,this)},worldToTileXY:function(worldX,worldY,snapToFloor,point,camera){return this.tilemap.worldToTileXY(worldX,worldY,snapToFloor,point,camera,this)},destroy:function(removeFromTilemap){void 0===removeFromTilemap&&(removeFromTilemap=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),removeFromTilemap&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],GameObject.prototype.destroy.call(this))}}),TilemapLayer_1=TilemapLayer$1,DegToRad=DegToRad_1,Formats$1=Formats$7,GetFastValue$1=GetFastValue_1,LayerData=LayerData_1,ORIENTATION=ORIENTATION_CONST,Rotate=Rotate_1$2,SpliceOne=SpliceOne_1,Sprite=Sprite_1,Tile=Tile_1,TilemapComponents=components,TilemapLayer=TilemapLayer_1,Tileset=Tileset_1,Tilemap$1=new Class_1({initialize:function(scene,mapData){this.scene=scene,this.tileWidth=mapData.tileWidth,this.tileHeight=mapData.tileHeight,this.width=mapData.width,this.height=mapData.height,this.orientation=mapData.orientation,this.renderOrder=mapData.renderOrder,this.format=mapData.format,this.version=mapData.version,this.properties=mapData.properties,this.widthInPixels=mapData.widthInPixels,this.heightInPixels=mapData.heightInPixels,this.imageCollections=mapData.imageCollections,this.images=mapData.images,this.layers=mapData.layers,this.tilesets=mapData.tilesets,this.objects=mapData.objects,this.currentLayerIndex=0,this.hexSideLength=mapData.hexSideLength;var orientation=this.orientation;this._convert={WorldToTileXY:TilemapComponents.GetWorldToTileXYFunction(orientation),WorldToTileX:TilemapComponents.GetWorldToTileXFunction(orientation),WorldToTileY:TilemapComponents.GetWorldToTileYFunction(orientation),TileToWorldXY:TilemapComponents.GetTileToWorldXYFunction(orientation),TileToWorldX:TilemapComponents.GetTileToWorldXFunction(orientation),TileToWorldY:TilemapComponents.GetTileToWorldYFunction(orientation)}},createBlankDynamicLayer:function(name,tileset,x,y,width,height,tileWidth,tileHeight){return console.warn("createBlankDynamicLayer is deprecated. Use createBlankLayer"),this.createBlankLayer(name,tileset,x,y,width,height,tileWidth,tileHeight)},createDynamicLayer:function(layerID,tileset,x,y){return console.warn("createDynamicLayer is deprecated. Use createLayer"),this.createLayer(layerID,tileset,x,y)},createStaticLayer:function(layerID,tileset,x,y){return console.warn("createStaticLayer is deprecated. Use createLayer"),this.createLayer(layerID,tileset,x,y)},setRenderOrder:function(renderOrder){var orders=["right-down","left-down","right-up","left-up"];return"number"==typeof renderOrder&&(renderOrder=orders[renderOrder]),orders.indexOf(renderOrder)>-1&&(this.renderOrder=renderOrder),this},addTilesetImage:function(tilesetName,key,tileWidth,tileHeight,tileMargin,tileSpacing,gid){if(void 0===tilesetName)return null;if(null==key&&(key=tilesetName),!this.scene.sys.textures.exists(key))return console.warn("Invalid Tileset Image: "+key),null;var texture=this.scene.sys.textures.get(key),index=this.getTilesetIndex(tilesetName);if(null===index&&this.format===Formats$1.TILED_JSON)return console.warn("No data found for Tileset: "+tilesetName),null;var tileset=this.tilesets[index];return tileset?(tileset.setTileSize(tileWidth,tileHeight),tileset.setSpacing(tileMargin,tileSpacing),tileset.setImage(texture),tileset):(void 0===tileWidth&&(tileWidth=this.tileWidth),void 0===tileHeight&&(tileHeight=this.tileHeight),void 0===tileMargin&&(tileMargin=0),void 0===tileSpacing&&(tileSpacing=0),void 0===gid&&(gid=0),(tileset=new Tileset(tilesetName,gid,tileWidth,tileHeight,tileMargin,tileSpacing)).setImage(texture),this.tilesets.push(tileset),tileset)},copy:function(srcTileX,srcTileY,width,height,destTileX,destTileY,recalculateFaces,layer){return null!==(layer=this.getLayer(layer))?(TilemapComponents.Copy(srcTileX,srcTileY,width,height,destTileX,destTileY,recalculateFaces,layer),this):null},createBlankLayer:function(name,tileset,x,y,width,height,tileWidth,tileHeight){if(void 0===x&&(x=0),void 0===y&&(y=0),void 0===width&&(width=this.width),void 0===height&&(height=this.height),void 0===tileWidth&&(tileWidth=this.tileWidth),void 0===tileHeight&&(tileHeight=this.tileHeight),null!==this.getLayerIndex(name))return console.warn("Invalid Tilemap Layer ID: "+name),null;for(var row,layerData=new LayerData({name:name,tileWidth:tileWidth,tileHeight:tileHeight,width:width,height:height,orientation:this.orientation}),tileY=0;tileY<height;tileY++){row=[];for(var tileX=0;tileX<width;tileX++)row.push(new Tile(layerData,-1,tileX,tileY,tileWidth,tileHeight,this.tileWidth,this.tileHeight));layerData.data.push(row)}this.layers.push(layerData),this.currentLayerIndex=this.layers.length-1;var layer=new TilemapLayer(this.scene,this,this.currentLayerIndex,tileset,x,y);return layer.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(layer),layer},createLayer:function(layerID,tileset,x,y){var index=this.getLayerIndex(layerID);if(null===index)return console.warn("Invalid Tilemap Layer ID: "+layerID),"string"==typeof layerID&&console.warn("Valid tilelayer names:\n\t"+this.getTileLayerNames().join(",\n\t")),null;var layerData=this.layers[index];if(layerData.tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+layerID),null;this.currentLayerIndex=index,void 0===x&&(x=layerData.x),void 0===y&&(y=layerData.y);var layer=new TilemapLayer(this.scene,this,index,tileset,x,y);return layer.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(layer),layer},createFromObjects:function(objectLayerName,config){var results=[],objectLayer=this.getObjectLayer(objectLayerName);if(!objectLayer)return console.warn("createFromObjects: Invalid objectLayerName given: "+objectLayerName),results;Array.isArray(config)||(config=[config]);for(var objects=objectLayer.objects,c=0;c<config.length;c++){for(var obj,singleConfig=config[c],id=GetFastValue$1(singleConfig,"id",null),gid=GetFastValue$1(singleConfig,"gid",null),name=GetFastValue$1(singleConfig,"name",null),toConvert=[],s=0;s<objects.length;s++)obj=objects[s],(null===id&&null===gid&&null===name||null!==id&&obj.id===id||null!==gid&&obj.gid===gid||null!==name&&obj.name===name)&&toConvert.push(obj);for(var classType=GetFastValue$1(singleConfig,"classType",Sprite),scene=GetFastValue$1(singleConfig,"scene",this.scene),container=GetFastValue$1(singleConfig,"container",null),texture=GetFastValue$1(singleConfig,"key",null),frame=GetFastValue$1(singleConfig,"frame",null),i=0;i<toConvert.length;i++){obj=toConvert[i];var sprite=new classType(scene);sprite.setName(obj.name),sprite.setPosition(obj.x,obj.y),sprite.setTexture(texture,frame),obj.width&&(sprite.displayWidth=obj.width),obj.height&&(sprite.displayHeight=obj.height);var offset={x:sprite.originX*obj.width,y:(sprite.originY-1)*obj.height};if(obj.rotation){var angle=DegToRad(obj.rotation);
785Rotate(offset,angle),sprite.rotation=angle}if(sprite.x+=offset.x,sprite.y+=offset.y,void 0===obj.flippedHorizontal&&void 0===obj.flippedVertical||sprite.setFlip(obj.flippedHorizontal,obj.flippedVertical),obj.visible||(sprite.visible=!1),Array.isArray(obj.properties))obj.properties.forEach((function(propData){var key=propData.name;void 0!==sprite[key]?sprite[key]=propData.value:sprite.setData(key,propData.value)}));else for(var key in obj.properties)void 0!==sprite[key]?sprite[key]=obj.properties[key]:sprite.setData(key,obj.properties[key]);container?container.add(sprite):scene.add.existing(sprite),results.push(sprite)}}return results},createFromTiles:function(indexes,replacements,spriteConfig,scene,camera,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.CreateFromTiles(indexes,replacements,spriteConfig,scene,camera,layer)},fill:function(index,tileX,tileY,width,height,recalculateFaces,layer){return void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.Fill(index,tileX,tileY,width,height,recalculateFaces,layer),this)},filterObjects:function(objectLayer,callback,context){if("string"==typeof objectLayer){var name=objectLayer;if(!(objectLayer=this.getObjectLayer(objectLayer)))return console.warn("No object layer found with the name: "+name),null}return objectLayer.objects.filter(callback,context)},filterTiles:function(callback,context,tileX,tileY,width,height,filteringOptions,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.FilterTiles(callback,context,tileX,tileY,width,height,filteringOptions,layer)},findByIndex:function(findIndex,skip,reverse,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.FindByIndex(findIndex,skip,reverse,layer)},findObject:function(objectLayer,callback,context){if("string"==typeof objectLayer){var name=objectLayer;if(!(objectLayer=this.getObjectLayer(objectLayer)))return console.warn("No object layer found with the name: "+name),null}return objectLayer.objects.find(callback,context)||null},findTile:function(callback,context,tileX,tileY,width,height,filteringOptions,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.FindTile(callback,context,tileX,tileY,width,height,filteringOptions,layer)},forEachTile:function(callback,context,tileX,tileY,width,height,filteringOptions,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.ForEachTile(callback,context,tileX,tileY,width,height,filteringOptions,layer),this)},getImageIndex:function(name){return this.getIndex(this.images,name)},getImageLayerNames:function(){return this.images&&Array.isArray(this.images)?this.images.map((function(image){return image.name})):[]},getIndex:function(location,name){for(var i=0;i<location.length;i++)if(location[i].name===name)return i;return null},getLayer:function(layer){var index=this.getLayerIndex(layer);return null!==index?this.layers[index]:null},getObjectLayer:function(name){var index=this.getIndex(this.objects,name);return null!==index?this.objects[index]:null},getObjectLayerNames:function(){return this.objects&&Array.isArray(this.objects)?this.objects.map((function(object){return object.name})):[]},getLayerIndex:function(layer){return void 0===layer?this.currentLayerIndex:"string"==typeof layer?this.getLayerIndexByName(layer):"number"==typeof layer&&layer<this.layers.length?layer:layer instanceof TilemapLayer?layer.layerIndex:null},getLayerIndexByName:function(name){return this.getIndex(this.layers,name)},getTileAt:function(tileX,tileY,nonNull,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.GetTileAt(tileX,tileY,nonNull,layer)},getTileAtWorldXY:function(worldX,worldY,nonNull,camera,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.GetTileAtWorldXY(worldX,worldY,nonNull,camera,layer)},getTileLayerNames:function(){return this.layers&&Array.isArray(this.layers)?this.layers.map((function(layer){return layer.name})):[]},getTilesWithin:function(tileX,tileY,width,height,filteringOptions,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.GetTilesWithin(tileX,tileY,width,height,filteringOptions,layer)},getTilesWithinShape:function(shape,filteringOptions,camera,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.GetTilesWithinShape(shape,filteringOptions,camera,layer)},getTilesWithinWorldXY:function(worldX,worldY,width,height,filteringOptions,camera,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.GetTilesWithinWorldXY(worldX,worldY,width,height,filteringOptions,camera,layer)},getTileset:function(name){var index=this.getIndex(this.tilesets,name);return null!==index?this.tilesets[index]:null},getTilesetIndex:function(name){return this.getIndex(this.tilesets,name)},hasTileAt:function(tileX,tileY,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.HasTileAt(tileX,tileY,layer)},hasTileAtWorldXY:function(worldX,worldY,camera,layer){return null===(layer=this.getLayer(layer))?null:TilemapComponents.HasTileAtWorldXY(worldX,worldY,camera,layer)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(layer){this.setLayer(layer)}},putTileAt:function(tile,tileX,tileY,recalculateFaces,layer){return void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:TilemapComponents.PutTileAt(tile,tileX,tileY,recalculateFaces,layer)},putTileAtWorldXY:function(tile,worldX,worldY,recalculateFaces,camera,layer){return void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:TilemapComponents.PutTileAtWorldXY(tile,worldX,worldY,recalculateFaces,camera,layer)},putTilesAt:function(tilesArray,tileX,tileY,recalculateFaces,layer){return void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.PutTilesAt(tilesArray,tileX,tileY,recalculateFaces,layer),this)},randomize:function(tileX,tileY,width,height,indexes,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.Randomize(tileX,tileY,width,height,indexes,layer),this)},calculateFacesAt:function(tileX,tileY,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.CalculateFacesAt(tileX,tileY,layer),this)},calculateFacesWithin:function(tileX,tileY,width,height,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.CalculateFacesWithin(tileX,tileY,width,height,layer),this)},removeLayer:function(layer){var index=this.getLayerIndex(layer);if(null!==index){SpliceOne(this.layers,index);for(var i=index;i<this.layers.length;i++)this.layers[i].tilemapLayer&&this.layers[i].tilemapLayer.layerIndex--;return this.currentLayerIndex===index&&(this.currentLayerIndex=0),this}return null},destroyLayer:function(layer){var index=this.getLayerIndex(layer);return null!==index?((layer=this.layers[index]).destroy(),SpliceOne(this.layers,index),this.currentLayerIndex===index&&(this.currentLayerIndex=0),this):null},removeAllLayers:function(){for(var layers=this.layers,i=0;i<layers.length;i++)layers[i].tilemapLayer&&layers[i].tilemapLayer.destroy(!1);return layers.length=0,this.currentLayerIndex=0,this},removeTile:function(tiles,replaceIndex,recalculateFaces){void 0===replaceIndex&&(replaceIndex=-1),void 0===recalculateFaces&&(recalculateFaces=!0);var removed=[];
vendor: 5,159 bytes, line 785
785Array.isArray(tiles)||(tiles=[tiles]);for(var i=0;i<tiles.length;i++){var tile=tiles[i];removed.push(this.removeTileAt(tile.x,tile.y,!0,recalculateFaces,tile.tilemapLayer)),replaceIndex>-1&&this.putTileAt(replaceIndex,tile.x,tile.y,recalculateFaces,tile.tilemapLayer)}return removed},removeTileAt:function(tileX,tileY,replaceWithNull,recalculateFaces,layer){return void 0===replaceWithNull&&(replaceWithNull=!0),void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:TilemapComponents.RemoveTileAt(tileX,tileY,replaceWithNull,recalculateFaces,layer)},removeTileAtWorldXY:function(worldX,worldY,replaceWithNull,recalculateFaces,camera,layer){return void 0===replaceWithNull&&(replaceWithNull=!0),void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:TilemapComponents.RemoveTileAtWorldXY(worldX,worldY,replaceWithNull,recalculateFaces,camera,layer)},renderDebug:function(graphics,styleConfig,layer){return null===(layer=this.getLayer(layer))?null:(this.orientation===ORIENTATION.ORTHOGONAL&&TilemapComponents.RenderDebug(graphics,styleConfig,layer),this)},renderDebugFull:function(graphics,styleConfig){for(var layers=this.layers,i=0;i<layers.length;i++)TilemapComponents.RenderDebug(graphics,styleConfig,layers[i]);return this},replaceByIndex:function(findIndex,newIndex,tileX,tileY,width,height,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.ReplaceByIndex(findIndex,newIndex,tileX,tileY,width,height,layer),this)},setCollision:function(indexes,collides,recalculateFaces,layer,updateLayer){return void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),void 0===updateLayer&&(updateLayer=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetCollision(indexes,collides,recalculateFaces,layer,updateLayer),this)},setCollisionBetween:function(start,stop,collides,recalculateFaces,layer){return void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetCollisionBetween(start,stop,collides,recalculateFaces,layer),this)},setCollisionByProperty:function(properties,collides,recalculateFaces,layer){return void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetCollisionByProperty(properties,collides,recalculateFaces,layer),this)},setCollisionByExclusion:function(indexes,collides,recalculateFaces,layer){return void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetCollisionByExclusion(indexes,collides,recalculateFaces,layer),this)},setCollisionFromCollisionGroup:function(collides,recalculateFaces,layer){return void 0===collides&&(collides=!0),void 0===recalculateFaces&&(recalculateFaces=!0),null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetCollisionFromCollisionGroup(collides,recalculateFaces,layer),this)},setTileIndexCallback:function(indexes,callback,callbackContext,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetTileIndexCallback(indexes,callback,callbackContext,layer),this)},setTileLocationCallback:function(tileX,tileY,width,height,callback,callbackContext,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.SetTileLocationCallback(tileX,tileY,width,height,callback,callbackContext,layer),this)},setLayer:function(layer){var index=this.getLayerIndex(layer);return null!==index&&(this.currentLayerIndex=index),this},setBaseTileSize:function(tileWidth,tileHeight){this.tileWidth=tileWidth,this.tileHeight=tileHeight,this.widthInPixels=this.width*tileWidth,this.heightInPixels=this.height*tileHeight;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=tileWidth,this.layers[i].baseTileHeight=tileHeight;for(var mapData=this.layers[i].data,mapWidth=this.layers[i].width,mapHeight=this.layers[i].height,row=0;row<mapHeight;row++)for(var col=0;col<mapWidth;col++){var tile=mapData[row][col];null!==tile&&tile.setSize(void 0,void 0,tileWidth,tileHeight)}}return this},setLayerTileSize:function(tileWidth,tileHeight,layer){if(null===(layer=this.getLayer(layer)))return this;layer.tileWidth=tileWidth,layer.tileHeight=tileHeight;for(var mapData=layer.data,mapWidth=layer.width,mapHeight=layer.height,row=0;row<mapHeight;row++)for(var col=0;col<mapWidth;col++){var tile=mapData[row][col];null!==tile&&tile.setSize(tileWidth,tileHeight)}return this},shuffle:function(tileX,tileY,width,height,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.Shuffle(tileX,tileY,width,height,layer),this)},swapByIndex:function(indexA,indexB,tileX,tileY,width,height,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.SwapByIndex(indexA,indexB,tileX,tileY,width,height,layer),this)},tileToWorldX:function(tileX,camera,layer){return null===(layer=this.getLayer(layer))?null:this._convert.TileToWorldX(tileX,camera,layer)},tileToWorldY:function(tileX,camera,layer){return null===(layer=this.getLayer(layer))?null:this._convert.TileToWorldY(tile
785X,camera,layer)},tileToWorldXY:function(tileX,tileY,vec2,camera,layer){return null===(layer=this.getLayer(layer))?null:this._convert.TileToWorldXY(tileX,tileY,vec2,camera,layer)},weightedRandomize:function(weightedIndexes,tileX,tileY,width,height,layer){return null===(layer=this.getLayer(layer))?null:(TilemapComponents.WeightedRandomize(tileX,tileY,width,height,weightedIndexes,layer),this)},worldToTileX:function(worldX,snapToFloor,camera,layer){return null===(layer=this.getLayer(layer))?null:this._convert.WorldToTileX(worldX,snapToFloor,camera,layer)},worldToTileY:function(worldY,snapToFloor,camera,layer){return null===(layer=this.getLayer(layer))?null:this._convert.WorldToTileY(worldY,snapToFloor,camera,layer)},worldToTileXY:function(worldX,worldY,snapToFloor,vec2,camera,layer){return null===(layer=this.getLayer(layer))?null:this._convert.WorldToTileXY(worldX,worldY,snapToFloor,vec2,camera,layer)},destroy:function(){this.removeAllLayers(),this.tilesets.length=0,this.objects.length=0,this.scene=null}}),Tilemap_1=Tilemap$1,Formats=Formats$7,MapData=MapData_1,Parse=Parse_1,Tilemap=Tilemap_1,ParseToTilemap_1=function(scene,key,tileWidth,tileHeight,width,height,data,insertNull){void 0===tileWidth&&(tileWidth=32),void 0===tileHeight&&(tileHeight=32),void 0===width&&(width=10),void 0===height&&(height=10),void 0===insertNull&&(insertNull=!1);var mapData=null;if(Array.isArray(data))mapData=Parse(void 0!==key?key:"map",Formats.ARRAY_2D,data,tileWidth,tileHeight,insertNull);else if(void 0!==key){var tilemapData=scene.cache.tilemap.get(key);tilemapData?mapData=Parse(key,tilemapData.format,tilemapData.data,tileWidth,tileHeight,insertNull):console.warn("No map data found for key "+key)}return null===mapData&&(mapData=new MapData({tileWidth:tileWidth,tileHeight:tileHeight,width:width,height:height})),new Tilemap(scene,mapData)},ParseToTilemap$1=ParseToTilemap_1;
786/**
787	 * @author       Richard Davey <[email protected]>
788	 * @copyright    2020 Photon Storm Ltd.
789	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
790	 */GameObjectCreator_1.register("tilemap",(function(config){var c=void 0!==config?config:{};return ParseToTilemap$1(this.scene,c.key,c.tileWidth,c.tileHeight,c.width,c.height,c.data,c.insertNull)}));var ParseToTilemap=ParseToTilemap_1;
791/**
792	 * @author       Richard Davey <[email protected]>
793	 * @copyright    2020 Photon Storm Ltd.
794	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
795	 */GameObjectFactory_1.register("tilemap",(function(key,tileWidth,tileHeight,width,height,data,insertNull){return null===key&&(key=void 0),null===tileWidth&&(tileWidth=void 0),null===tileHeight&&(tileHeight=void 0),null===width&&(width=void 0),null===height&&(height=void 0),ParseToTilemap(this.scene,key,tileWidth,tileHeight,width,height,data,insertNull)}));
796/**
797	 * @author       Richard Davey <[email protected]>
798	 * @copyright    2020 Photon Storm Ltd.
799	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
800	 */
801var Tilemaps={Components:components,Parsers:parsers,Formats:Formats$7,ImageCollection:ImageCollection_1,ParseToTilemap:ParseToTilemap_1,Tile:Tile_1,Tilemap:Tilemap_1,TilemapCreator:{},TilemapFactory:{},Tileset:Tileset_1,TilemapLayer:TilemapLayer_1,Orientation:ORIENTATION_CONST,LayerData:LayerData_1,MapData:MapData_1,ObjectLayer:ObjectLayer_1},tilemaps=Tilemaps=Extend_1$1(!1,Tilemaps,_const.ORIENTATION),GetFastValue=GetFastValue_1,TimerEvent_1=new Class_1({initialize:function(config){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(config)},reset:function(config){return this.delay=GetFastValue(config,"delay",0),this.repeat=GetFastValue(config,"repeat",0),this.loop=GetFastValue(config,"loop",!1),this.callback=GetFastValue(config,"callback",void 0),this.callbackScope=GetFastValue(config,"callbackScope",this.callback),this.args=GetFastValue(config,"args",[]),this.timeScale=GetFastValue(config,"timeScale",1),this.startAt=GetFastValue(config,"startAt",0),this.paused=GetFastValue(config,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var totalDuration=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/totalDuration}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(dispatchCallback){void 0===dispatchCallback&&(dispat
801chCallback=!1),this.elapsed=this.delay,this.hasDispatched=!dispatchCallback,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}}),PluginCache$1=PluginCache_1,SceneEvents$1=events$g,TimerEvent=TimerEvent_1,Remove=Remove_1,Clock=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],scene.sys.events.once(SceneEvents$1.BOOT,this.boot,this),scene.sys.events.on(SceneEvents$1.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(SceneEvents$1.DESTROY,this.destroy,this)},start:function(){var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents$1.PRE_UPDATE,this.preUpdate,this),eventEmitter.on(SceneEvents$1.UPDATE,this.update,this),eventEmitter.once(SceneEvents$1.SHUTDOWN,this.shutdown,this)},addEvent:function(config){var event;return config instanceof TimerEvent?(event=config,this.removeEvent(event),event.elapsed=event.startAt,event.hasDispatched=!1,event.repeatCount=-1===event.repeat||event.loop?999999999999:event.repeat):event=new TimerEvent(config),this._pendingInsertion.push(event),event},delayedCall:function(delay,callback,args,callbackScope){return this.addEvent({delay:delay,callback:callback,args:args,callbackScope:callbackScope})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(events){Array.isArray(events)||(events=[events]);for(var i=0;i<events.length;i++){var event=events[i];Remove(this._pendingRemoval,event),Remove(this._pendingInsertion,event),Remove(this._active,event)}return this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var toRemove=this._pendingRemoval.length,toInsert=this._pendingInsertion.length;if(0!==toRemove||0!==toInsert){var i,event;for(i=0;i<toRemove;i++){event=this._pendingRemoval[i];var index=this._active.indexOf(event);index>-1&&this._active.splice(index,1),event.destroy()}for(i=0;i<toInsert;i++)event=this._pendingInsertion[i],this._active.push(event);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(time,delta){if(this.now=time,!this.paused){delta*=this.timeScale;for(var i=0;i<this._active.length;i++){var event=this._active[i];if(!event.paused&&(event.elapsed+=delta*event.timeScale,event.elapsed>=event.delay)){var remainder=event.elapsed-event.delay;event.elapsed=event.delay,!event.hasDispatched&&event.callback&&(event.hasDispatched=!0,event.callback.apply(event.callbackScope,event.args)),event.repeatCount>0?(event.repeatCount--,event.elapsed=remainder,event.hasDispatched=!1):this._pendingRemoval.push(event)}}}},shutdown:function(){var i;for(i=0;i<this._pendingInsertion.length;i++)this._pendingInsertion[i].destroy();for(i=0;i<this._active.length;i++)this._active[i].destroy();for(i=0;i<this._pendingRemoval.length;i++)this._pendingRemoval[i].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var eventEmitter=this.systems.events;eventEmitter.off(SceneEvents$1.PRE_UPDATE,this.preUpdate,this),eventEmitter.off(SceneEvents$1.UPDATE,this.update,this),eventEmitter.off(SceneEvents$1.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(SceneEvents$1.START,this.start,this),this.scene=null,this.systems=null}});PluginCache$1.register("Clock",Clock,"time");var time={Clock:Clock,TimerEvent:TimerEvent_1},GetNewValue_1=function(source,key,defaultValue){var valueCallback;source.hasOwnProperty(key)?valueCallback="function"===typeof source[key]?function(target,targetKey,value,targetIndex,totalTargets,tween){return source[key](target,targetKey,value,targetIndex,totalTargets,tween)}:function(){return source[key]}:valueCallback="function"==typeof defaultValue?defaultValue:function(){return defaultValue};return valueCallback},RESERVED=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStart
801Scope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"],GetProps_1=function(config){var key,keys=[];if(config.hasOwnProperty("props"))for(key in config.props)"_"!==key.substr(0,1)&&keys.push({key:key,value:config.props[key]});else for(key in config)-1===RESERVED.indexOf(key)&&"_"!==key.substr(0,1)&&keys.push({key:key,value:config[key]});return keys},GetValue$6=GetValue_1,GetTargets_1=function(config){var targets=GetValue$6(config,"targets",null);return null===targets||("function"==typeof targets&&(targets=targets.call()),Array.isArray(targets)||(targets=[targets])),targets},GetValue$5=GetValue_1,GetTweens_1=function(config){var tweens=GetValue$5(config,"tweens",null);return null===tweens?[]:("function"==typeof tweens&&(tweens=tweens.call()),Array.isArray(tweens)||(tweens=[tweens]),tweens)};
802/**
803	 * @author       Richard Davey <[email protected]>
804	 * @copyright    2020 Photon Storm Ltd.
805	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
806	 */
807/**
808	 * @author       Richard Davey <[email protected]>
809	 * @copyright    2020 Photon Storm Ltd.
810	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
811	 */
812function hasGetActive(def){return!!def.getActive&&"function"==typeof def.getActive}function hasGetStart(def){return!!def.getStart&&"function"==typeof def.getStart}function hasGetEnd(def){return!!def.getEnd&&"function"==typeof def.getEnd}var GetValueOp$2=function(key,propertyValue){var callbacks,def,getEnd=function(target,key,value){return value},getStart=function(target,key,value){return value},getActive=null,t=typeof propertyValue;if("number"===t)getEnd=function(){return propertyValue};else if("string"===t){var op=propertyValue[0],num=parseFloat(propertyValue.substr(2));switch(op){case"+":getEnd=function(target,key,value){return value+num};break;case"-":getEnd=function(target,key,value){return value-num};break;case"*":getEnd=function(target,key,value){return value*num};break;case"/":getEnd=function(target,key,value){return value/num};break;default:getEnd=function(){return parseFloat(propertyValue)}}}else if("function"===t)getEnd=propertyValue;else if("object"===t)if(hasGetStart(def=propertyValue)||hasGetEnd(def)||hasGetActive(def))hasGetActive(propertyValue)&&(getActive=propertyValue.getActive),hasGetEnd(propertyValue)&&(getEnd=propertyValue.getEnd),hasGetStart(propertyValue)&&(getStart=propertyValue.getStart);else if(propertyValue.hasOwnProperty("value"))callbacks=GetValueOp$2(key,propertyValue.value);else{var hasTo=propertyValue.hasOwnProperty("to"),hasFrom=propertyValue.hasOwnProperty("from"),hasStart=propertyValue.hasOwnProperty("start");if(hasTo&&(hasFrom||hasStart)){if(callbacks=GetValueOp$2(key,propertyValue.to),hasStart){var startCallbacks=GetValueOp$2(key,propertyValue.start);callbacks.getActive=startCallbacks.getEnd}if(hasFrom){var fromCallbacks=GetValueOp$2(key,propertyValue.from);callbacks.getStart=fromCallbacks.getEnd}}}return callbacks||(callbacks={getActive:getActive,getEnd:getEnd,getStart:getStart}),callbacks},GetValueOp_1=GetValueOp$2,Defaults$3={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1},events={TIMELINE_COMPLETE:"complete",TIMELINE_LOOP:"loop",TIMELINE_PAUSE:"pause",TIMELINE_RESUME:"resume",TIMELINE_START:"start",TIMELINE_UPDATE:"update",TWEEN_ACTIVE:"active",TWEEN_COMPLETE:"complete",TWEEN_LOOP:"loop",TWEEN_REPEAT:"repeat",TWEEN_START:"start",TWEEN_STOP:"stop",TWEEN_UPDATE:"update",TWEEN_YOYO:"yoyo"},EventEmitter$1=eventemitter3.exports,Events$1=events,GameObjectCreator=GameObjectCreator_1,GameObjectFactory=GameObjectFactory_1,TWEEN_CONST$2=_const$a,MATH_CONST$1=_const$b,Tween$2=new Class_1({Extends:EventEmitter$1,initialize:function(parent,data,targets){EventEmitter$1.call(this),this.parent=parent,this.parentIsTimeline=parent.hasOwnProperty("isTimeline"),this.data=data,this.totalData=data.length,this.targets=targets,this.totalTargets=targets.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=TWEEN_CONST$2.PENDING_ADD,this._pausedState=TWEEN_CONST$2.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(index){return void 0===index&&(index=0),this.data[index].current},setTimeScale:function(value){return this.timeScale=value,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===TWEEN_CONST$2.ACTIVE},isPaused:function(){return this.state===TWEEN_CONST$2.PAUSED},hasTarget:function(target){return-1!==this.targets.indexOf(target)},updateTo:function(key,value,startToCurrent){void 0===startToCurrent&&(startToCurrent=!1);for(var i=0;i<this.totalData;i++){var tweenData=this.data[i];tweenData.key===key&&(tweenData.end=value,startToCurrent&&(tweenData.start=tweenData.current))}return this},restart:function(){return this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.state===TWEEN_CONST$2.ACTIVE?this.seek(0):this.state===TWEEN_CONST$2.REMOVED?(this.seek(0),this.parent.makeActive(this),this):this.state===TWEEN_CONST$2.PENDING_ADD?this:this.play()},calcDuration:function(){for(var maxDuration=0,minDelay=MATH_CONST$1.MAX_SAFE_INTEGER,data=this.data,i=0;i<this.totalData;i++){var tweenData=data[i];tweenData.t1=tweenData.duration+tweenData.hold,tweenData.yoyo&&(tweenData.t1+=tweenData.duration),tweenData.t2=tweenData.t1+tweenData.repeatDelay,tweenData.totalDuration=tweenData.delay+tweenData.t1,-1===tweenData.repeat?tweenData.totalDuration+=999999999999*tweenData.t2:tweenData.repeat>0&&(tweenData.totalDuration+=tweenData.t2*tweenData.repeat),tweenData.totalDuration>maxDuration&&(maxDuration=tweenData.totalDuration),tweenData.delay<minDelay&&(minDelay=tweenData.delay)}this.duration=Math.max(maxDuration,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=minDelay},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=TWEEN_CONST$2.PENDING_ADD,this._pausedState=TWEEN_CONST$2.INIT,!1;for(var data=this.data,totalTargets=this.totalTargets,i=0;i<this.totalData;i++){var tweenData=data[i],target=tweenData.target,gen=tweenData.gen,key=tweenData.key,targetIndex=tweenData.index;tweenData.delay=gen.delay(target,key,0,targetIndex,totalTargets,this),tweenData.duration=Math.max(gen.duration(target,key,0,targetIndex,totalTargets,this),.001),tweenData.hold=gen.hold(target,key,0,targetIndex,totalTargets,this),tweenData.repeat=gen.repeat(target,key,0,targetIndex,totalTargets,this),tweenData.repeatDelay=gen.repeatDelay(target,key,0,targetIndex,totalTargets,this)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.state=TWEEN_CONST$2.INIT,!0},makeActive:function(){this.parent.makeActive(this),this.dispatchTweenEvent(Events$1.TWEEN_ACTIVE,this.callbacks.onActive)},nextState:function(){this.loopCounter>0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=TWEEN_CONST$2.LOOP_DELAY):(this.state=TWEEN_CONST$2.ACTIVE,this.dispatchTweenEvent(Events$1.TWEEN_
812LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=TWEEN_CONST$2.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=TWEEN_CONST$2.PENDING_REMOVE,this.dispatchTweenEvent(Events$1.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===TWEEN_CONST$2.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=TWEEN_CONST$2.PAUSED),this},play:function(resetFromTimeline){void 0===resetFromTimeline&&(resetFromTimeline=!1);var state=this.state;return state!==TWEEN_CONST$2.INIT||this.parentIsTimeline?state===TWEEN_CONST$2.ACTIVE||state===TWEEN_CONST$2.PENDING_ADD&&this._pausedState===TWEEN_CONST$2.PENDING_ADD?this:this.parentIsTimeline||state!==TWEEN_CONST$2.PENDING_REMOVE&&state!==TWEEN_CONST$2.REMOVED?(this.parentIsTimeline?(this.resetTweenData(resetFromTimeline),0===this.calculatedOffset?this.state=TWEEN_CONST$2.ACTIVE:(this.countdown=this.calculatedOffset,this.state=TWEEN_CONST$2.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(resetFromTimeline),this.state=TWEEN_CONST$2.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=TWEEN_CONST$2.ACTIVE,this)},resetTweenData:function(resetFromLoop){for(var data=this.data,total=this.totalData,totalTargets=this.totalTargets,i=0;i<total;i++){var tweenData=data[i],target=tweenData.target,key=tweenData.key,targetIndex=tweenData.index;tweenData.progress=0,tweenData.elapsed=0,tweenData.repeatCounter=-1===tweenData.repeat?999999999999:tweenData.repeat,resetFromLoop?(tweenData.start=tweenData.getStartValue(target,key,tweenData.start,targetIndex,totalTargets,this),tweenData.end=tweenData.getEndValue(target,key,tweenData.end,targetIndex,totalTargets,this),tweenData.current=tweenData.start,tweenData.state=TWEEN_CONST$2.PLAYING_FORWARD):tweenData.state=TWEEN_CONST$2.PENDING_RENDER,tweenData.delay>0&&(tweenData.elapsed=tweenData.delay,tweenData.state=TWEEN_CONST$2.DELAY),tweenData.getActiveValue&&(target[key]=tweenData.getActiveValue(tweenData.target,tweenData.key,tweenData.start))}},resume:function(){return this.state===TWEEN_CONST$2.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(toPosition,delta){void 0===delta&&(delta=16.6),this.state===TWEEN_CONST$2.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var data=this.data,totalTargets=this.totalTargets,i=0;i<this.totalData;i++){var tweenData=data[i],target=tweenData.target,gen=tweenData.gen,key=tweenData.key,targetIndex=tweenData.index;tweenData.progress=0,tweenData.elapsed=0,tweenData.repeatCounter=-1===tweenData.repeat?999999999999:tweenData.repeat,tweenData.delay=gen.delay(target,key,0,targetIndex,totalTargets,this),tweenData.duration=Math.max(gen.duration(target,key,0,targetIndex,totalTargets,this),.001),tweenData.hold=gen.hold(target,key,0,targetIndex,totalTargets,this),tweenData.repeat=gen.repeat(target,key,0,targetIndex,totalTargets,this),tweenData.repeatDelay=gen.repeatDelay(target,key,0,targetIndex,totalTargets,this),tweenData.current=tweenData.start,tweenData.state=TWEEN_CONST$2.PLAYING_FORWARD,this.updateTweenData(this,tweenData,0,targetIndex,totalTargets),tweenData.delay>0&&(tweenData.elapsed=tweenData.delay,tweenData.state=TWEEN_CONST$2.DELAY)}this.calcDuration();var wasPaused=!1;this.state===TWEEN_CONST$2.PAUSED&&(wasPaused=!0,this.state=TWEEN_CONST$2.ACTIVE),this.isSeeking=!0;do{this.update(0,delta)}while(this.totalProgress<toPosition);return this.isSeeking=!1,wasPaused&&(this.state=TWEEN_CONST$2.PAUSED),this},setCallback:function(type,callback,params,scope){return this.callbacks[type]={func:callback,scope:scope,params:params},this},complete:function(delay){return void 0===delay&&(delay=0),delay?(this.state=TWEEN_CONST$2.COMPLETE_DELAY,this.countdown=delay):(this.state=TWEEN_CONST$2.PENDING_REMOVE,this.dispatchTweenEvent(Events$1.TWEEN_COMPLETE,this.callbacks.onComplete)),this},remove:function(){return this.parent.remove(this),this},stop:function(resetTo){return this.state===TWEEN_CONST$2.ACTIVE&&void 0!==resetTo&&this.seek(resetTo),this.state!==TWEEN_CONST$2.REMOVED&&(this.state!==TWEEN_CONST$2.PAUSED&&this.state!==TWEEN_CONST$2.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.dispatchTweenEvent(Events$1.TWEEN_STOP,this.callbacks.onStop),this.removeAllListeners(),this.state=TWEEN_CONST$2.PENDING_REMOVE),this},update:function(timestamp,delta){if(this.state===TWEEN_CONST$2.PAUSED)return!1;switch(this.useFrames&&(delta=1*this.parent.timeScale),delta*=this.timeScale,this.elapsed+=delta,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=delta,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case TWEEN_CONST$2.ACTIVE:this.hasStarted||this.isSeeking||(this.startDelay-=delta,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchTweenEvent(Events$1.TWEEN_START,this.callbacks.onStart)));for(var stillRunning=!1,i=0;i<this.totalData;i++){var tweenData=this.data[i];this.updateTweenData(this,tweenData,delta)&&(stillRunning=!0)}stillRunning||this.nextState();break;case TWEEN_CONST$2.LOOP_DELAY:this.countdown-=delta,this.countdown<=0&&(this.state=TWEEN_CONST$2.ACTIVE,this.dispatchTweenEvent(Events$1.TWEEN_
812LOOP,this.callbacks.onLoop));break;case TWEEN_CONST$2.OFFSET_DELAY:this.countdown-=delta,this.countdown<=0&&(this.state=TWEEN_CONST$2.ACTIVE);break;case TWEEN_CONST$2.COMPLETE_DELAY:this.countdown-=delta,this.countdown<=0&&(this.state=TWEEN_CONST$2.PENDING_REMOVE,this.dispatchTweenEvent(Events$1.TWEEN_COMPLETE,this.callbacks.onComplete))}return this.state===TWEEN_CONST$2.PENDING_REMOVE},dispatchTweenDataEvent:function(event,callback,tweenData){this.isSeeking||(this.emit(event,this,tweenData.key,tweenData.target,tweenData.current,tweenData.previous),callback&&(callback.params[1]=tweenData.target,callback.func.apply(callback.scope,callback.params)))},dispatchTweenEvent:function(event,callback){this.isSeeking||(this.emit(event,this,this.targets),callback&&(callback.params[1]=this.targets,callback.func.apply(callback.scope,callback.params)))},setStateFromEnd:function(tween,tweenData,diff){return tweenData.yoyo?(tweenData.elapsed=diff,tweenData.progress=diff/tweenData.duration,tweenData.flipX&&tweenData.target.toggleFlipX(),tweenData.flipY&&tweenData.target.toggleFlipY(),this.dispatchTweenDataEvent(Events$1.TWEEN_YOYO,tween.callbacks.onYoyo,tweenData),tweenData.start=tweenData.getStartValue(tweenData.target,tweenData.key,tweenData.start,tweenData.index,tween.totalTargets,tween),TWEEN_CONST$2.PLAYING_BACKWARD):tweenData.repeatCounter>0?(tweenData.repeatCounter--,tweenData.elapsed=diff,tweenData.progress=diff/tweenData.duration,tweenData.flipX&&tweenData.target.toggleFlipX(),tweenData.flipY&&tweenData.target.toggleFlipY(),tweenData.start=tweenData.getStartValue(tweenData.target,tweenData.key,tweenData.start,tweenData.index,tween.totalTargets,tween),tweenData.end=tweenData.getEndValue(tweenData.target,tweenData.key,tweenData.start,tweenData.index,tween.totalTargets,tween),tweenData.repeatDelay>0?(tweenData.elapsed=tweenData.repeatDelay-diff,tweenData.current=tweenData.start,tweenData.target[tweenData.key]=tweenData.current,TWEEN_CONST$2.REPEAT_DELAY):(this.dispatchTweenDataEvent(Events$1.TWEEN_REPEAT,tween.callbacks.onRepeat,tweenData),TWEEN_CONST$2.PLAYING_FORWARD)):TWEEN_CONST$2.COMPLETE},setStateFromStart:function(tween,tweenData,diff){return tweenData.repeatCounter>0?(tweenData.repeatCounter--,tweenData.elapsed=diff,tweenData.progress=diff/tweenData.duration,tweenData.flipX&&tweenData.target.toggleFlipX(),tweenData.flipY&&tweenData.target.toggleFlipY(),tweenData.end=tweenData.getEndValue(tweenData.target,tweenData.key,tweenData.start,tweenData.index,tween.totalTargets,tween),tweenData.repeatDelay>0?(tweenData.elapsed=tweenData.repeatDelay-diff,tweenData.current=tweenData.start,tweenData.target[tweenData.key]=tweenData.current,TWEEN_CONST$2.REPEAT_DELAY):(this.dispatchTweenDataEvent(Events$1.TWEEN_REPEAT,tween.callbacks.onRepeat,tweenData),TWEEN_CONST$2.PLAYING_FORWARD)):TWEEN_CONST$2.COMPLETE},updateTweenData:function(tween,tweenData,delta){var target=tweenData.target;switch(tweenData.state){case TWEEN_CONST$2.PLAYING_FORWARD:case TWEEN_CONST$2.PLAYING_BACKWARD:if(!target){tweenData.state=TWEEN_CONST$2.COMPLETE;break}var elapsed=tweenData.elapsed,duration=tweenData.duration,diff=0;(elapsed+=delta)>duration&&(diff=elapsed-duration,elapsed=duration);var forward=tweenData.state===TWEEN_CONST$2.PLAYING_FORWARD,progress=elapsed/duration;if(tweenData.elapsed=elapsed,tweenData.progress=progress,tweenData.previous=tweenData.current,1===progress)forward?(tweenData.current=tweenData.end,target[tweenData.key]=tweenData.end,tweenData.hold>0?(tweenData.elapsed=tweenData.hold-diff,tweenData.state=TWEEN_CONST$2.HOLD_DELAY):tweenData.state=this.setStateFromEnd(tween,tweenData,diff)):(tweenData.current=tweenData.start,target[tweenData.key]=tweenData.start,tweenData.state=this.setStateFromStart(tween,tweenData,diff));else{var v=forward?tweenData.ease(progress):tweenData.ease(1-progress);tweenData.current=tweenData.start+(tweenData.end-tweenData.start)*v,target[tweenData.key]=tweenData.current}this.dispatchTweenDataEvent(Events$1.TWEEN_UPDATE,tween.callbacks.onUpdate,tweenData);break;case TWEEN_CONST$2.DELAY:tweenData.elapsed-=delta,tweenData.elapsed<=0&&(tweenData.elapsed=Math.abs(tweenData.elapsed),tweenData.state=TWEEN_CONST$2.PENDING_RENDER);break;case TWEEN_CONST$2.REPEAT_DELAY:tweenData.elapsed-=delta,tweenData.elapsed<=0&&(tweenData.elapsed=Math.abs(tweenData.elapsed),tweenData.state=TWEEN_CONST$2.PLAYING_FORWARD,this.dispatchTweenDataEvent(Events$1.TWEEN_REPEAT,tween.callbacks.onRepeat,tweenData));break;case TWEEN_CONST$2.HOLD_DELAY:tweenData.elapsed-=delta,tweenData.elapsed<=0&&(tweenData.state=this.setStateFromEnd(tween,tweenData,Math.abs(tweenData.elapsed)));break;case TWEEN_CONST$2.PENDING_RENDER:target?(tweenData.start=tweenData.getStartValue(target,tweenData.key,target[tweenData.key],tweenData.index,tween.totalTargets,tween),tweenData.end=tweenData.getEndValue(target,tweenData.key,tweenData.start,tweenData.index,tween.totalTargets,tween),tweenData.current=tweenData.start,target[tweenData.key]=tweenData.start,tweenData.state=TWEEN_CONST$2.PLAYING_FORWARD):tweenData.state=TWEEN_CONST$2.COMPLETE}
812return tweenData.state!==TWEEN_CONST$2.COMPLETE}});Tween$2.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],GameObjectFactory.register("tween",(function(config){return this.scene.sys.tweens.add(config)})),GameObjectCreator.register("tween",(function(config){return this.scene.sys.tweens.create(config)}));var Tween_1=Tween$2,TweenData_1=function(target,index,key,getEnd,getStart,getActive,ease,delay,duration,yoyo,hold,repeat,repeatDelay,flipX,flipY){return{target:target,index:index,key:key,getActiveValue:getActive,getEndValue:getEnd,getStartValue:getStart,ease:ease,duration:0,totalDuration:0,delay:0,yoyo:yoyo,hold:0,repeat:0,repeatDelay:0,flipX:flipX,flipY:flipY,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:delay,duration:duration,hold:hold,repeat:repeat,repeatDelay:repeatDelay},state:0}},Defaults$2=Defaults$3,GetAdvancedValue$2=GetAdvancedValue_1,GetBoolean$2=GetBoolean_1,GetEaseFunction$3=GetEaseFunction_1,GetNewValue$2=GetNewValue_1,GetValue$4=GetValue_1,GetValueOp$1=GetValueOp_1,Tween$1=Tween_1,TweenData$1=TweenData_1,NumberTweenBuilder_1=function(parent,config,defaults){void 0===defaults&&(defaults=Defaults$2);var from=GetValue$4(config,"from",0),to=GetValue$4(config,"to",1),targets=[{value:from}],delay=GetNewValue$2(config,"delay",defaults.delay),duration=GetNewValue$2(config,"duration",defaults.duration),easeParams=GetValue$4(config,"easeParams",defaults.easeParams),ease=GetEaseFunction$3(GetValue$4(config,"ease",defaults.ease),easeParams),hold=GetNewValue$2(config,"hold",defaults.hold),repeat=GetNewValue$2(config,"repeat",defaults.repeat),repeatDelay=GetNewValue$2(config,"repeatDelay",defaults.repeatDelay),yoyo=GetBoolean$2(config,"yoyo",defaults.yoyo),data=[],ops=GetValueOp$1("value",to),tweenData=TweenData$1(targets[0],0,"value",ops.getEnd,ops.getStart,ops.getActive,ease,delay,duration,yoyo,hold,repeat,repeatDelay,!1,!1);tweenData.start=from,tweenData.current=from,tweenData.to=to,data.push(tweenData);var tween=new Tween$1(parent,data,targets);tween.offset=GetAdvancedValue$2(config,"offset",null),tween.completeDelay=GetAdvancedValue$2(config,"completeDelay",0),tween.loop=Math.round(GetAdvancedValue$2(config,"loop",0)),tween.loopDelay=Math.round(GetAdvancedValue$2(config,"loopDelay",0)),tween.paused=GetBoolean$2(config,"paused",!1),tween.useFrames=GetBoolean$2(config,"useFrames",!1);for(var scope=GetValue$4(config,"callbackScope",tween),tweenArray=[tween,null],callbacks=Tween$1.TYPES,i=0;i<callbacks.length;i++){var type=callbacks[i],callback=GetValue$4(config,type,!1);if(callback){var callbackScope=GetValue$4(config,type+"Scope",scope),callbackParams=GetValue$4(config,type+"Params",[]);tween.setCallback(type,callback,tweenArray.concat(callbackParams),callbackScope)}}return tween},GetEaseFunction$2=GetEaseFunction_1,GetValue$3=GetValue_1,MATH_CONST=_const$b,StaggerBuilder_1=function(value,options){var result;void 0===options&&(options={});var start=GetValue$3(options,"start",0),ease=GetValue$3(options,"ease",null),grid=GetValue$3(options,"grid",null),from=GetValue$3(options,"from",0),fromFirst="first"===from,fromCenter="center"===from,fromLast="last"===from,fromValue="number"==typeof from,isRange=Array.isArray(value),value1=isRange?parseFloat(value[0]):parseFloat(value),value2=isRange?parseFloat(value[1]):0,maxValue=Math.max(value1,value2);if(isRange&&(start+=value1),grid){var gridWidth=grid[0],gridHeight=grid[1],fromX=0,fromY=0,distanceX=0,distanceY=0,gridValues=[];fromLast?(fromX=gridWidth-1,fromY=gridHeight-1):fromValue?(fromX=from%gridWidth,fromY=Math.floor(from/gridWidth)):fromCenter&&(fromX=(gridWidth-1)/2,fromY=(gridHeight-1)/2);for(var gridMax=MATH_CONST.MIN_SAFE_INTEGER,toY=0;toY<gridHeight;toY++){gridValues[toY]=[];for(var toX=0;toX<gridWidth;toX++){distanceX=fromX-toX,distanceY=fromY-toY;var dist=Math.sqrt(distanceX*distanceX+distanceY*distanceY);dist>gridMax&&(gridMax=dist),gridValues[toY][toX]=dist}}}var easeFunction=ease?GetEaseFunction$2(ease):null;return result=grid?function(target,key,value,index){var output,gridSpace=0,toX=index%gridWidth,toY=Math.floor(index/gridWidth);if(toX>=0&&toX<gridWidth&&toY>=0&&toY<gridHeight&&(gridSpace=gridValues[toY][toX]),isRange){var diff=value2-value1;output=easeFunction?gridSpace/gridMax*diff*easeFunction(gridSpace/gridMax):gridSpace/gridMax*diff}else output=easeFunction?gridSpace*value1*easeFunction(gridSpace/gridMax):gridSpace*value1;return output+start}:function(target,key,value,index,total){var fromIndex,output,spacing;(total--,fromFirst?fromIndex=index:fromCenter?fromIndex=Math.abs(total/2-index):fromLast?fromIndex=total-index:fromValue&&(fromIndex=Math.abs(from-index)),isRange)?(spacing=fromCenter?(value2-value1)/total*(2*fromIndex):(value2-value1)/total*fromIndex,output=easeFunction?spacing*easeFunction(fromIndex/total):spacing):output=easeFunction?total*maxValue*easeFunction(fromIndex/total):fromIndex*value1;return output+start},result},Defaults$1=Defaults$3,GetAdvancedValue$1=GetAdvancedValue_1,GetBoolean$1=GetBoolean_1,GetEaseFunction$1=GetEaseFunction_1,GetNewValue$1=GetNewValue_1,GetProps=GetProps_1,GetTargets$1=GetTargets_1,GetValue$2=GetValue_1,GetValueOp=GetValueOp_1,Tween=Tween_1,TweenData=TweenData_1,TweenBuilder_1=function(parent,config,defaults){void 0===defaults&&(defaults=Defaults$1);for(var targets=defaults.targets?defaults.targets:GetTargets$1(config),props=GetProps(config),delay=GetNewValue$1(config,"delay",defaults.delay),duration=GetNewValue$1(config,"duration",defaults.duration),easeParams=GetValue$2(config,"easeParams",defaults.easeParams),ease=GetEaseFunction$1(GetValue$2(config,"ease",defaults.ease),easeParams),hold=GetNewValue$1(config,"hold",defaults.hold),repeat=GetNewValue$1(config,"repeat",defaults.repeat),repeatDelay=GetNewValue$1(config,"repeatDelay",defaults.repeatDelay),yoyo=GetBoolean$1(config,"yoyo",defaults.yoyo),flipX=GetBoolean$1(config,"flipX",defaults.flipX),flipY=GetBoolean$1(config,"flipY",defaults.flipY),data=[],p=0;p<props.length;p++)for(var key=props[p].key,value=props[p].value,t=0;t<targets.length;t++){var ops=GetValueOp(key,value),tweenData=TweenData(targets[t],t,key,ops.getEnd,ops.getStart,ops.getActive,GetEaseFunction$1(GetValue$2(value,"ease",ease),GetValue$2(value,"easeParams",easeParams)),GetNewValue$1(value,"delay",delay),GetNewValue$1(value,"duration",duration),GetBoolean$1(value,"yoyo",yoyo),GetNewValue$1(value,"hold",hold),GetNewValue$1(value,"repeat",repeat),GetNewValue$1(value,"repeatDelay",repeatDelay),GetBoolean$1(value,"flipX",flipX),GetBoolean$1(value,"flipY",flipY));data.push(tweenData)}var tween=new Tween(parent,data,targets);tween.offset=GetAdvancedValue$1(config,"offset",null),tween.completeDelay=GetAdvancedValue$1(config,"completeDelay",0),tween.loop=Math.round(GetAdvancedValue$1(config,"loop",0)),tween.loopDelay=Math.round(GetAdvancedValue$1(config,"loopDelay",0)),tween.paused=GetBoolean$1(config,"paused",!1),tween.useFrames=GetBoolean$1(config,"useFrames",!1);for(var scope=GetValue$2(config,"callbackScope",tween),tweenArray=[tween,null],callbacks=Tween.TYPES,i=0;i<callbacks.length;i++){var type=callbacks[i],callback=GetValue$2(config,type,!1);if(callback){var callbackScope=GetValue$2(config,type+"Scope",scope),callbackParams=GetValue$2(config,type+"Params",[]);tween.setCallback(type,callback,tweenArray.concat(callbackParams),callbackScope)}}return tween},EventEmitter=eventemitter3.exports,Events=events,TweenBuilder$2=TweenBuilder_1,TWEEN_CONST$1=_const$a,Timeline$1=new Class_1({Extends:EventEmitter,initialize:function(manager){EventEmitter.call(this),this.manager=manager,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=TWEEN_CONST$1.PENDING_ADD,this._pausedState=TWEEN_CONST$1.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope}
812,dispatchTimelineEvent:function(event,callback){this.emit(event,this),callback&&callback.func.apply(callback.scope,callback.params)},setTimeScale:function(value){return this.timeScale=value,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===TWEEN_CONST$1.ACTIVE},add:function(config){return this.queue(TweenBuilder$2(this,config))},queue:function(tween){return this.isPlaying()||(tween.parent=this,tween.parentIsTimeline=!0,this.data.push(tween),this.totalData=this.data.length),this},hasOffset:function(tween){return null!==tween.offset},isOffsetAbsolute:function(value){return"number"==typeof value},isOffsetRelative:function(value){if("string"===typeof value){var op=value[0];if("-"===op||"+"===op)return!0}return!1},getRelativeOffset:function(value,base){var op=value[0],num=parseFloat(value.substr(2)),result=base;switch(op){case"+":result+=num;break;case"-":result-=num}return Math.max(0,result)},calcDuration:function(){for(var prevEnd=0,totalDuration=0,offsetDuration=0,i=0;i<this.totalData;i++){var tween=this.data[i];tween.init(),this.hasOffset(tween)?this.isOffsetAbsolute(tween.offset)?(tween.calculatedOffset=tween.offset,0===tween.offset&&(offsetDuration=0)):this.isOffsetRelative(tween.offset)&&(tween.calculatedOffset=this.getRelativeOffset(tween.offset,prevEnd)):tween.calculatedOffset=offsetDuration,prevEnd=tween.totalDuration+tween.calculatedOffset,totalDuration+=tween.totalDuration,offsetDuration+=tween.totalDuration}this.duration=totalDuration,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=TWEEN_CONST$1.PAUSED,!1)},resetTweens:function(resetFromLoop){for(var i=0;i<this.totalData;i++){this.data[i].play(resetFromLoop)}},setCallback:function(type,callback,params,scope){return-1!==Timeline$1.TYPES.indexOf(type)&&(this.callbacks[type]={func:callback,scope:scope,params:params}),this},makeActive:function(tween){return this.manager.makeActive(tween)},play:function(){if(this.state!==TWEEN_CONST$1.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=TWEEN_CONST$1.ACTIVE,this.dispatchTimelineEvent(Events.TIMELINE_START,this.callbacks.onStart)}},nextState:function(){this.loopCounter>0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=TWEEN_CONST$1.LOOP_DELAY):(this.state=TWEEN_CONST$1.ACTIVE,this.dispatchTimelineEvent(Events.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=TWEEN_CONST$1.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=TWEEN_CONST$1.PENDING_REMOVE,this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(timestamp,delta){if(this.state!==TWEEN_CONST$1.PAUSED){switch(this.useFrames&&(delta=1*this.manager.timeScale),delta*=this.timeScale,this.elapsed+=delta,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=delta,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case TWEEN_CONST$1.ACTIVE:for(var stillRunning=this.totalData,i=0;i<this.totalData;i++){this.data[i].update(timestamp,delta)&&stillRunning--}this.dispatchTimelineEvent(Events.TIMELINE_UPDATE,this.callbacks.onUpdate),0===stillRunning&&this.nextState();break;case TWEEN_CONST$1.LOOP_DELAY:this.countdown-=delta,this.countdown<=0&&(this.state=TWEEN_CONST$1.ACTIVE,this.dispatchTimelineEvent(Events.TIMELINE_LOOP,this.callbacks.onLoop));break;case TWEEN_CONST$1.COMPLETE_DELAY:this.countdown-=delta,this.countdown<=0&&(this.state=TWEEN_CONST$1.PENDING_REMOVE,this.dispatchTimelineEvent(Events.TIMELINE_COMPLETE,this.callbacks.onComplete))}return this.state===TWEEN_CONST$1.PENDING_REMOVE}},stop:function(){this.state=TWEEN_CONST$1.PENDING_REMOVE},pause:function(){if(this.state!==TWEEN_CONST$1.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=TWEEN_CONST$1.PAUSED,this.emit
812(Events.TIMELINE_PAUSE,this),this},resume:function(){return this.state===TWEEN_CONST$1.PAUSED&&(this.paused=!1,this.state=this._pausedState,this.emit(Events.TIMELINE_RESUME,this)),this},hasTarget:function(target){for(var i=0;i<this.data.length;i++)if(this.data[i].hasTarget(target))return!0;return!1},destroy:function(){for(var i=0;i<this.data.length;i++)this.data[i].stop()}});
813/**
814	 * @author       Richard Davey <[email protected]>
815	 * @copyright    2020 Photon Storm Ltd.
816	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
817	 */Timeline$1.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"];var Timeline_1=Timeline$1,Clone$1=Clone_1$7,Defaults=Defaults$3,GetAdvancedValue=GetAdvancedValue_1,GetBoolean=GetBoolean_1,GetEaseFunction=GetEaseFunction_1,GetNewValue=GetNewValue_1,GetTargets=GetTargets_1,GetTweens=GetTweens_1,GetValue$1=GetValue_1,Timeline=Timeline_1,TweenBuilder$1=TweenBuilder_1,TimelineBuilder_1=function(manager,config){var timeline=new Timeline(manager);timeline.completeDelay=GetAdvancedValue(config,"completeDelay",0),timeline.loop=Math.round(GetAdvancedValue(config,"loop",0)),timeline.loopDelay=Math.round(GetAdvancedValue(config,"loopDelay",0)),timeline.paused=GetBoolean(config,"paused",!1),timeline.useFrames=GetBoolean(config,"useFrames",!1);var scope=GetValue$1(config,"callbackScope",timeline),timelineArray=[timeline],onStart=GetValue$1(config,"onStart",!1);if(onStart){var onStartScope=GetValue$1(config,"onStartScope",scope),onStartParams=GetValue$1(config,"onStartParams",[]);timeline.setCallback("onStart",onStart,timelineArray.concat(onStartParams),onStartScope)}var onUpdate=GetValue$1(config,"onUpdate",!1);if(onUpdate){var onUpdateScope=GetValue$1(config,"onUpdateScope",scope),onUpdateParams=GetValue$1(config,"onUpdateParams",[]);timeline.setCallback("onUpdate",onUpdate,timelineArray.concat(onUpdateParams),onUpdateScope)}var onLoop=GetValue$1(config,"onLoop",!1);if(onLoop){var onLoopScope=GetValue$1(config,"onLoopScope",scope),onLoopParams=GetValue$1(config,"onLoopParams",[]);timeline.setCallback("onLoop",onLoop,timelineArray.concat(onLoopParams),onLoopScope)}var onYoyo=GetValue$1(config,"onYoyo",!1);if(onYoyo){var onYoyoScope=GetValue$1(config,"onYoyoScope",scope),onYoyoParams=GetValue$1(config,"onYoyoParams",[]);timeline.setCallback("onYoyo",onYoyo,timelineArray.concat(null,onYoyoParams),onYoyoScope)}var onComplete=GetValue$1(config,"onComplete",!1);if(onComplete){var onCompleteScope=GetValue$1(config,"onCompleteScope",scope),onCompleteParams=GetValue$1(config,"onCompleteParams",[]);timeline.setCallback("onComplete",onComplete,timelineArray.concat(onCompleteParams),onCompleteScope)}var tweens=GetTweens(config);if(0===tweens.length)return timeline.paused=!0,timeline;var defaults=Clone$1(Defaults);defaults.targets=GetTargets(config);var totalDuration=GetAdvancedValue(config,"totalDuration",0);defaults.duration=totalDuration>0?Math.floor(totalDuration/tweens.length):GetNewValue(config,"duration",defaults.duration),defaults.delay=GetNewValue(config,"delay",defaults.delay),defaults.easeParams=GetValue$1(config,"easeParams",defaults.easeParams),defaults.ease=GetEaseFunction(GetValue$1(config,"ease",defaults.ease),defaults.easeParams),defaults.hold=GetNewValue(config,"hold",defaults.hold),defaults.repeat=GetNewValue(config,"repeat",defaults.repeat),defaults.repeatDelay=GetNewValue(config,"repeatDelay",defaults.repeatDelay),defaults.yoyo=GetBoolean(config,"yoyo",defaults.yoyo),defaults.flipX=GetBoolean(config,"flipX",defaults.flipX),defaults.flipY=GetBoolean(config,"flipY",defaults.flipY);for(var i=0;i<tweens.length;i++)timeline.queue(TweenBuilder$1(timeline,tweens[i],defaults));return timeline},builders={GetBoolean:GetBoolean_1,GetEaseFunction:GetEaseFunction_1,GetNewValue:GetNewValue_1,GetProps:GetProps_1,GetTargets:GetTargets_1,GetTweens:GetTweens_1,GetValueOp:GetValueOp_1,NumberTweenBuilder:NumberTweenBuilder_1,StaggerBuilder:StaggerBuilder_1,TimelineBuilder:TimelineBuilder_1,TweenBuilder:TweenBuilder_1},ArrayRemove=Remove_1,NumberTweenBuilder=NumberTweenBuilder_1,PluginCache=PluginCache_
8171,SceneEvents=events$g,StaggerBuilder=StaggerBuilder_1,TimelineBuilder=TimelineBuilder_1,TWEEN_CONST=_const$a,TweenBuilder=TweenBuilder_1,TweenManager=new Class_1({initialize:function(scene){this.scene=scene,this.systems=scene.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,scene.sys.events.once(SceneEvents.BOOT,this.boot,this),scene.sys.events.on(SceneEvents.START,this.start,this)},boot:function(){this.systems.events.once(SceneEvents.DESTROY,this.destroy,this)},start:function(){var eventEmitter=this.systems.events;eventEmitter.on(SceneEvents.PRE_UPDATE,this.preUpdate,this),eventEmitter.on(SceneEvents.UPDATE,this.update,this),eventEmitter.once(SceneEvents.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(config){return TimelineBuilder(this,config)},timeline:function(config){var timeline=TimelineBuilder(this,config);return timeline.paused||(this._add.push(timeline),this._toProcess++),timeline},create:function(config){return TweenBuilder(this,config)},add:function(config){var tween=TweenBuilder(this,config);return this._add.push(tween),this._toProcess++,tween},existing:function(tween){return this._add.push(tween),this._toProcess++,this},addCounter:function(config){var tween=NumberTweenBuilder(this,config);return this._add.push(tween),this._toProcess++,tween},stagger:function(value,options){return StaggerBuilder(value,options)},preUpdate:function(){if(0!==this._toProcess){var i,tween,list=this._destroy,active=this._active,pending=this._pe
817nding;for(i=0;i<list.length;i++){tween=list[i];var idx=active.indexOf(tween);-1===idx?(idx=pending.indexOf(tween))>-1&&(tween.state=TWEEN_CONST.REMOVED,pending.splice(idx,1)):(tween.state=TWEEN_CONST.REMOVED,active.splice(idx,1))}for(list.length=0,list=this._add,i=0;i<list.length;i++)(tween=list[i]).state===TWEEN_CONST.PENDING_ADD&&(tween.init()?(tween.play(),this._active.push(tween)):this._pending.push(tween));list.length=0,this._toProcess=0}},update:function(timestamp,delta){var tween,list=this._active;delta*=this.timeScale;for(var i=0;i<list.length;i++)(tween=list[i]).update(timestamp,delta)&&(this._destroy.push(tween),this._toProcess++)},remove:function(tween){return ArrayRemove(this._add,tween),ArrayRemove(this._pending,tween),ArrayRemove(this._active,tween),ArrayRemove(this._destroy,tween),tween.state=TWEEN_CONST.REMOVED,this},makeActive:function(tween){if(-1!==this._add.indexOf(tween)||-1!==this._active.indexOf(tween))return this;var idx=this._pending.indexOf(tween);return-1!==idx&&this._pending.splice(idx,1),this._add.push(tween),tween.state=TWEEN_CONST.PENDING_ADD,this._toProcess++,this},each:function(callback,scope){for(var args=[null],i=1;i<arguments.length;i++)args.push(arguments[i]);for(var texture in this.list)args[0]=this.list[texture],callback.apply(scope,args)},getAllTweens:function(){for(var list=this._active,output=[],i=0;i<list.length;i++)output.push(list[i]);return output},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(target,includePending){void 0===includePending&&(includePending=!1);var tween,i,t,list=this._active,output=[];for(Array.isArray(target)||(target=[target]),i=0;i<list.length;i++)for(tween=list[i],t=0;t<target.length;t++)tween.hasTarget(target[t])&&output.push(tween);
817if(includePending)for(list=this._pending,i=0;i<list.length;i++)for(tween=list[i],t=0;t<target.length;t++)tween.hasTarget(target[t])&&output.push(tween);return output},isTweening:function(target){for(var tween,list=this._active,i=0;i<list.length;i++)if((tween=list[i]).hasTarget(target)&&tween.isPlaying())return!0;return!1},killAll:function(){for(var tweens=this.getAllTweens(),i=0;i<tweens.length;i++)tweens[i].stop();return this},killTweensOf:function(target){for(var tweens=this.getTweensOf(target),i=0;i<tweens.length;i++)tweens[i].stop();return this},pauseAll:function(){for(var list=this._active,i=0;i<list.length;i++)list[i].pause();return this},resumeAll:function(){for(var list=this._active,i=0;i<list.length;i++)list[i].resume();return this},setGlobalTimeScale:function(value){return this.timeScale=value,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var eventEmitter=this.systems.events;eventEmitter.off(SceneEvents.PRE_UPDATE,this.preUpdate,this),eventEmitter.off(SceneEvents.UPDATE,this.update,this),eventEmitter.off(SceneEvents.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(SceneEvents.START,this.start,this),this.scene=null,this.systems=null}});
818/**
819	 * @author       Richard Davey <[email protected]>
820	 * @copyright    2020 Photon Storm Ltd.
821	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
822	 */PluginCache.register("TweenManager",TweenManager,"tweens");var Tweens={Builders:builders,Events:events,TweenManager:TweenManager,Tween:Tween_1,TweenData:TweenData_1,Timeline:Timeline_1};
823/**
824	 * @author       Richard Davey <[email protected]>
825	 * @copyright    2020 Photon Storm Ltd.
826	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
827	 */Tweens=Extend_1$1(!1,Tweens,_const$a);var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ArrayBufferToBase64_1=function(arrayBuffer,mediaType){for(var bytes=new Uint8Array(arrayBuffer),len=bytes.length,base64=mediaType?"data:"+mediaType+";base64,":"",i=0;i<len;i+=3)base64+=chars[bytes[i]>>2],base64+=chars[(3&bytes[i])<<4|bytes[i+1]>>4],base64+=chars[(15&bytes[i+1])<<2|bytes[i+2]>>6],base64+=chars[63&bytes[i+2]];return len%3==2?base64=base64.substring(0,base64.length-1)+"=":len%3==1&&(base64=base64.substring(0,base64.length-2)+"=="),base64},GetValue=GetValue_1,Clamp=Clamp_1,GetMinMaxValue_1=function(source,key,min,max,defaultValue){void 0===defaultValue&&(defaultValue=min);var value=GetValue(source,key,defaultValue);return Clamp(value,min,max)},HasAll_1=function(source,keys){for(var i=0;i<keys.length;i++)if(!source.hasOwnProperty(keys[i]))return!1;return!0},Clone=Clone_1$7,MergeRight_1=function(obj1,obj2){var clone=Clone(obj1);for(var key in obj2)clone.hasOwnProperty(key)&&(clone[key]=obj2[key]);return clone},Format_1=function(string,values){return string.replace(/%([0-9]+)/g,(function(s,n){return values[Number(n)-1]}))},RemoveAt_1=function(string,index){return 0===index?string.slice(1):string.slice(0,index-1)+string.slice(index)},Reverse_1=function(string){return string.split("").reverse().join("")},sound={SoundManagerCreator:SoundManagerCreator_1,Events:events$6,BaseSound:BaseSound_1,BaseSoundManager:BaseSoundManager_1,WebAudioSound:WebAudioSound_1,WebAudioSoundManager:WebAudioSoundManager_1,HTML5AudioSound:HTML5AudioSound_1,HTML5AudioSoundManager:HTML5AudioSoundManager_1,NoAudioSound:NoAudioSound_1,NoAudioSoundManager:NoAudioSoundManager_1},CONST=_const$e,Extend=Extend_1$1,Phaser$1={Actions:actions,Animations:animations,BlendModes:BlendModes$8,Cache:cache,Cameras:cameras,Core:core,Class:Class_1,Create:create,Curves:curves,Data:data,Display:display,DOM:dom,Events:events$9,Game:Game_1,GameObjects:gameobjects,Geom:geom,Input:input,Loader:loader,Math:math,Physics:physics,Plugins:plugins,Renderer:renderer,Scale:scale,ScaleModes:ScaleModes_1,Scene:Scene_1,Scenes:scene,Structs:structs,Textures:textures,Tilemaps:tilemaps,Time:time,Tweens:Tweens,Utils:{Array:array,Base64:{ArrayBufferToBase64:ArrayBufferToBase64_1,Base64ToArrayBuffer:Base64ToArrayBuffer_1},Objects:{Clone:Clone_1$7,DeepCopy:DeepCopy_1,Extend:Extend_1$1,GetAdvancedValue:GetAdvancedValue_1,GetFastValue:GetFastValue_1,GetMinMaxValue:GetMinMaxValue_1,GetValue:GetValue_1,HasAll:HasAll_1,HasAny:HasAny_1,HasValue:HasValue_1,IsPlainObject:IsPlainObject_1,Merge:Merge_1,MergeRight:MergeRight_1,Pick:Pick_1,SetValue:SetValue_1}
827,String:{Format:Format_1,Pad:Pad_1,RemoveAt:RemoveAt_1,Reverse:Reverse_1,UppercaseFirst:UppercaseFirst_1,UUID:UUID_1},NOOP:NOOP_1}};
828/**
829	 * @author       Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer)
830	 * @author       Richard Davey <[email protected]>
831	 * @copyright    2020 Photon Storm Ltd.
832	 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
833	 */Phaser$1.Sound=sound;var phaser=Phaser$1=Extend(!1,Phaser$1,CONST);global.Phaser=Phaser$1;
834/*! *****************************************************************************
835	Copyright (c) Microsoft Corporation.
836
837	Permission to use, copy, modify, and/or distribute this software for any
838	purpose with or without fee is hereby granted.
839
840	THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
841	REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
842	AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
843	INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
844	LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
845	OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
846	PERFORMANCE OF THIS SOFTWARE.
847	***************************************************************************** */
848var extendStatics$2=function(d,b){return extendStatics$2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},extendStatics$2(d,b)};function __extends$2(d,b){function __(){this.constructor=d}extendStatics$2(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var SessionStatus,RequestSessionStatus,Severity,Status,TransactionSamplingMethod,Outcome,__assign$4=function(){return __assign$4=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign$4.apply(this,arguments)};function __values$3(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read$5(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread$4(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read$5(arguments[i]));return ar}
849/*! *****************************************************************************
850	Copyright (c) Microsoft Corporation.
851
852	Permission to use, copy, modify, and/or distribute this software for any
853	purpose with or without fee is hereby granted.
854
855	THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
856	REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
857	AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
858	INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
859	LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
860	OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
861	PERFORMANCE OF THIS SOFTWARE.
862	***************************************************************************** */
863function __read$4(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread$3(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read$4(arguments[i]));return ar}
864/*! *****************************************************************************
865	Copyright (c) Microsoft Corporation.
866
867	Permission to use, copy, modify, and/or distribute this software for any
868	purpose with or without fee is hereby granted.
869
870	THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
871	REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
872	AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
873	INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
874	LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
875	OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
876	PERFORMANCE OF THIS SOFTWARE.
877	***************************************************************************** */!function(SessionStatus){SessionStatus.Ok="ok",SessionStatus.Exited="exited",SessionStatus.Crashed="crashed",SessionStatus.Abnormal="abnormal"}(SessionStatus||(SessionStatus={})),function(RequestSessionStatus){RequestSessionStatus.Ok="ok",RequestSessionStatus.Errored="errored",RequestSessionStatus.Crashed="crashed"}(RequestSessionStatus||(RequestSessionStatus={})),function(Severity){Severity.Fatal="fatal",Severity.Error="error",Severity.Warning="warning",Severity.Log="log",Severity.Info="info",Severity.Debug="debug",Severity.Critical="critical"}(Severity||(Severity={})),function(Severity){Severity.fromString=function(level){switch(level){case"debug":return Severity.Debug;case"info":return Severity.Info;case"warn":case"warning":return Severity.Warning;case"error":return Severity.Error;case"fatal":return Severity.Fatal;case"critical":return Severity.Critical;default:return Severity.Log}}}(Severity||(Severity={})),function(Status){Status.Unknown="unknown",Status.Skipped="skipped",Status.Success="success",Status.RateLimit="rate_limit",Status.Invalid="invalid",Status.Failed="failed"}(Status||(Status={})),function(Status){Status.fromHttpCode=function(code){return code>
877=200&&code<300?Status.Success:429===code?Status.RateLimit:code>=400&&code<500?Status.Invalid:code>=500?Status.Failed:Status.Unknown}}(Status||(Status={})),function(TransactionSamplingMethod){TransactionSamplingMethod.Explicit="explicitly_set",TransactionSamplingMethod.Sampler="client_sampler",TransactionSamplingMethod.Rate="client_rate",TransactionSamplingMethod.Inheritance="inheritance"}(TransactionSamplingMethod||(TransactionSamplingMethod={})),function(Outcome){Outcome.BeforeSend="before_send",Outcome.EventProcessor="event_processor",Outcome.NetworkError="network_error",Outcome.QueueOverflow="queue_overflow",Outcome.RateLimitBackoff="ratelimit_backoff",Outcome.SampleRate="sample_rate"}(Outcome||(Outcome={}));var __assign$3=function(){return __assign$3=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign$3.apply(this,arguments)};function __read$3(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread$2(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read$3(arguments[i]));return ar}function isNodeEnv(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function dynamicRequire(mod,request){return mod.require(request)}var fallbackGlobalObject={};function getGlobalObject(){return isNodeEnv()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:fallbackGlobalObject}function isError(wat){switch(Object.prototype.toString.call(wat)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(wat,Error)}}function isErrorEvent(wat){return"[object ErrorEvent]"===Object.prototype.toString.call(wat)}function isDOMError(wat){return"[object DOMError]"===Object.prototype.toString.call(wat)}function isString(wat){return"[object String]"===Object.prototype.toString.call(wat)}function isPrimitive(wat){return null===wat||"object"!=typeof wat&&"function"!=typeof wat}function isPlainObject(wat){return"[object Object]"===Object.prototype.toString.call(wat)}function isEvent(wat){return"undefined"!=typeof Event&&isInstanceOf(wat,Event)}function isElement(wat){return"undefined"!=typeof Element&&isInstanceOf(wat,Element)}function isThenable(wat){return Boolean(wat&&wat.then&&"function"==typeof wat.then)}function isInstanceOf(wat,base){try{return wat instanceof base}catch(_e){return!1}}function htmlTreeAsString(elem,keyAttrs){try{for(var currentElem=elem,out=[],height=0,len=0,sepLength=" > ".length,nextStr=void 0;currentElem&&height++<5&&!("html"===(nextStr=_htmlElementAsString(currentElem,keyAttrs))||height>1&&len+out.length*sepLength+nextStr.length>=80);)out.push(nextStr),len+=nextStr.length,currentElem=currentElem.parentNode;return out.reverse().join(" > ")}catch(_oO){return"<unknown>"}}function _htmlElementAsString(el,keyAttrs){var _a,_b,className,classes,key,attr,i,elem=el,out=[];if(!elem||!elem.tagName)return"";out.push(elem.tagName.toLowerCase());var keyAttrPairs=(null===(_a=keyAttrs)||void 0===_a?void 0:_a.length)?keyAttrs.filter((function(keyAttr){return elem.getAttribute(keyAttr)})).map((function(keyAttr){return[keyAttr,elem.getAttribute(keyAttr)]})):null;if(null===(_b=keyAttrPairs)||void 0===_b?void 0:_b.length)keyAttrPairs.forEach((function(keyAttrPair){out.push("["+keyAttrPair[0]+'="'+keyAttrPair[1]+'"]')}));else if(elem.id&&out.push("#"+elem.id),(className=elem.className)&&isString(className))for(classes=className.split(/\s+/),i=0;i<classes.length;i++)out.push("."+classes[i]);var allowedAttrs=["type","name","title","alt"];for(i=0;i<allowedAttrs.length;i++)key=allowedAttrs[i],(attr=elem.getAttribute(key))&&out.push("["+key+'="'+attr+'"]');return out.join("")}
878/*! *****************************************************************************
879	Copyright (c) Microsoft Corporation.
880
881	Permission to use, copy, modify, and/or distribute this software for any
882	purpose with or without fee is hereby granted.
883
884	THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
885	REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
886	AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
887	INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
888	LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
889	OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
890	PERFORMANCE OF THIS SOFTWARE.
891	***************************************************************************** */
892var extendStatics$1=function(d,b){return extendStatics$1=Object.
892setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},extendStatics$1(d,b)};var __assign$2=function(){return __assign$2=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign$2.apply(this,arguments)};function __values$2(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}var setPrototypeOf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(obj,proto){return obj.__proto__=proto,obj}:function(obj,proto){for(var prop in proto)Object.prototype.hasOwnProperty.call(obj,prop)||(obj[prop]=proto[prop]);return obj});var SentryError=function(_super){function SentryError(message){var _newTarget=this.constructor,_this=_super.call(this,message)||this;return _this.message=message,_this.name=_newTarget.prototype.constructor.name,setPrototypeOf(_this,_newTarget.prototype),_this}return function(d,b){function __(){this.constructor=d}extendStatics$1(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}(SentryError,_super),SentryError}(Error),DSN_REGEX=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,Dsn=function(){function Dsn(from){"string"==typeof from?this._fromString(from):this._fromComponents(from),this._validate()}return Dsn.prototype.toString=function(withPassword){void 0===withPassword&&(withPassword=!1);var _a=this,host=_a.host,path=_a.path,pass=_a.pass,port=_a.port,projectId=_a.projectId;return _a.protocol+"://"+_a.publicKey+(withPassword&&pass?":"+pass:"")+"@"+host+(port?":"+port:"")+"/"+(path?path+"/":path)+projectId},Dsn.prototype._fromString=function(str){var match=DSN_REGEX.exec(str);if(!match)throw new SentryError("Invalid Dsn");var _a=function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}(match.slice(1),6),protocol=_a[0],publicKey=_a[1],_b=_a[2],pass=void 0===_b?"":_b,host=_a[3],_c=_a[4],port=void 0===_c?"":_c,path="",projectId=_a[5],split=projectId.split("/");if(split.length>1&&(path=split.slice(0,-1).join("/"),projectId=split.pop()),projectId){var projectMatch=projectId.match(/^\d+/);projectMatch&&(projectId=projectMatch[0])}this._fromComponents({host:host,pass:pass,path:path,projectId:projectId,port:port,protocol:protocol,publicKey:publicKey})},Dsn.prototype._fromComponents=function(components){"user"in components&&!("publicKey"in components)&&(components.publicKey=components.user),this.user=components.publicKey||"",this.protocol=components.protocol,this.publicKey=components.publicKey||"",this.pass=components.pass||"",this.host=components.host,this.port=components.port||"",this.path=components.path||"",this.projectId=components.projectId},Dsn.prototype._validate=function(){var _this=this;if(["protocol","publicKey","host","projectId"].forEach((function(component){if(!_this[component])throw new SentryError("Invalid Dsn: "+component+" missing")})),!this.projectId.match(/^\d+$/))throw new SentryError("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new SentryError("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new SentryError("Invalid Dsn: Invalid port "+this.port)},Dsn}(),global$9=getGlobalObject(),PREFIX="Sentry Logger ";function consoleSandbox(callback){var global=getGlobalObject();if(!("console"in global))return callback();var originalConsole=global.console,wrappedLevels={};["debug","info","warn","error","log","assert"].forEach((function(level){level in global.console&&originalConsole[level].__sentry_original__&&(wrappedLevels[level]=originalConsole[level],originalConsole[level]=originalConsole[level].__sentry_original__)}));var result=callback();
892return Object.keys(wrappedLevels).forEach((function(level){originalConsole[level]=wrappedLevels[level]})),result}var Logger$1=function(){function Logger(){this._enabled=!1}return Logger.prototype.disable=function(){this._enabled=!1},Logger.prototype.enable=function(){this._enabled=!0},Logger.prototype.log=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._enabled&&consoleSandbox((function(){global$9.console.log(PREFIX+"[Log]: "+args.join(" "))}))},Logger.prototype.warn=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._enabled&&consoleSandbox((function(){global$9.console.warn(PREFIX+"[Warn]: "+args.join(" "))}))},Logger.prototype.error=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._enabled&&consoleSandbox((function(){global$9.console.error(PREFIX+"[Error]: "+args.join(" "))}))},Logger}();global$9.__SENTRY__=global$9.__SENTRY__||{};var logger$1=global$9.__SENTRY__.logger||(global$9.__SENTRY__.logger=new Logger$1),Memo=function(){function Memo(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return Memo.prototype.memoize=function(obj){if(this._hasWeakSet)return!!this._inner.has(obj)||(this._inner.add(obj),!1);for(var i=0;i<this._inner.length;i++){if(this._inner[i]===obj)return!0}return this._inner.push(obj),!1},Memo.prototype.unmemoize=function(obj){if(this._hasWeakSet)this._inner.delete(obj);else for(var i=0;i<this._inner.length;i++)if(this._inner[i]===obj){this._inner.splice(i,1);break}},Memo}();function getFunctionName(fn){try{return fn&&"function"==typeof fn&&fn.name||"<anonymous>"}catch(e){return"<anonymous>"}}function truncate(str,max){return void 0===max&&(max=0),"string"!=typeof str||0===max||str.length<=max?str:str.substr(0,max)+"..."}function safeJoin(input,delimiter){if(!Array.isArray(input))return"";for(var output=[],i=0;i<input.length;i++){var value=input[i];try{output.push(String(value))}catch(e){output.push("[value cannot be serialized]")}}return output.join(delimiter)}function isMatchingPattern(value,pattern){return!!isString(value)&&(wat=pattern,"[object RegExp]"===Object.prototype.toString.call(wat)?pattern.test(value):"string"==typeof pattern&&-1!==value.indexOf(pattern));var wat}function fill(source,name,replacementFactory){if(name in source){var original=source[name],wrapped=replacementFactory(original);if("function"==typeof wrapped)try{wrapped.prototype=wrapped.prototype||{},Object.defineProperties(wrapped,{__sentry_original__:{enumerable:!1,value:original}})}catch(_Oo){}source[name]=wrapped}}function getWalkSource(value){if(isError(value)){var error=value,err={message:error.message,name:error.name,stack:error.stack};for(var i in error)Object.prototype.hasOwnProperty.call(error,i)&&(err[i]=error[i]);return err}if(isEvent(value)){var event_1=value,source={};source.type=event_1.type;try{source.target=isElement(event_1.target)?htmlTreeAsString(event_1.target):Object.prototype.toString.call(event_1.target)}catch(_oO){source.target="<unknown>"}try{source.currentTarget=isElement(event_1.currentTarget)?htmlTreeAsString(event_1.currentTarget):Object.prototype.toString.call(event_1.currentTarget)}catch(_oO){source.currentTarget="<unknown>"}for(var attr in"undefined"!=typeof CustomEvent&&isInstanceOf(value,CustomEvent)&&(source.detail=event_1.detail),event_1)Object.prototype.hasOwnProperty.call(event_1,attr)&&(source[attr]=event_1[attr]);return source}return value}function jsonSize(value){return function(value){return~-encodeURI(value).split(/%..|./).length}(JSON.stringify(value))}function normalizeToSize(object,depth,maxSize){void 0===depth&&(depth=3),void 0===maxSize&&(maxSize=102400);var serialized=normalize(object,depth);return jsonSize(serialized)>maxSize?normalizeToSize(object,depth-1,maxSize):serialized}function normalizeValue(value,key){return"domain"===key&&value&&"object"==typeof value&&value._events?"[Domain]":"domainEmitter"===key?"[DomainEmitter]":void 0!==global&&value===global?"[Global]":"undefined"!=typeof window&&value===window?"[Window]":"undefined"!=typeof document&&value===document?"[Document]":isPlainObject(wat=value)&&"nativeEvent"in wat&&"preventDefault"in wat&&"stopPropagation"in wat?"[SyntheticEvent]":"number"==typeof value&&value!=value?"[NaN]":void 0===value?"[undefined]":"function"==typeof value?"[Function: "+getFunctionName(value)+"]":"symbol"==typeof value?"["+String(value)+"]":"bigint"==typeof value?"[BigInt: "+String(value)+"]":value;var wat}function walk(key,value,depth,memo){if(void 0===depth&&(depth=1/0),void 0===memo&&(memo=new Memo),0===depth)return function(value){var type=Object.prototype.toString.call(value);if("string"==typeof value)return value;if("[object Object]"===type)return"[Object]";if("[object Array]"===type)return"[Array]";var normalized=normalizeValue(value);return isPrimitive(normalized)?normalized:type}(value);if(null!=value&&"function"==typeof value.toJSON)return value.toJSON();var normalized=normalizeValue(value,key);if(isPrimitive(normalized))return normalized;var source=getWalkSource(value),acc=Array.isArray(value)?[]:{};if(memo.memoize(value))return"[Circular ~]";for(var innerKey in source)Object.prototype.hasOwnProperty.call(source,innerKey)&&(acc[innerKey]=walk(innerKey,source[innerKey],depth-1,memo));return memo.unmemoize(value),acc}function normalize(input,depth){try{return JSON.parse(JSON.stringify(input,(function(key,value){return walk(key,value,depth)})))}catch(_oO){return"**non-serializable**"}}function extractExceptionKeysForMessage(exception,maxLength){void 0===maxLength&&(maxLength=40);var keys=Object.keys(getWalkSource(exception));if(keys.sort(),!keys.length)return"[object has no keys]";if(keys[0].length>=maxLength)return truncate(keys[0],maxLength);for(var includedKeys=keys.length;includedKeys>0;includedKeys--){var serialized=keys.slice(0,includedKeys).join(", ");
892if(!(serialized.length>maxLength))return includedKeys===keys.length?serialized:truncate(serialized,maxLength)}return""}function dropUndefinedKeys(val){var e_1,_a;if(isPlainObject(val)){var obj=val,rv={};try{for(var _b=__values$2(Object.keys(obj)),_c=_b.next();!_c.done;_c=_b.next()){var key=_c.value;void 0!==obj[key]&&(rv[key]=dropUndefinedKeys(obj[key]))}}catch(e_1_1){e_1={error:e_1_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_1)throw e_1.error}}return rv}return Array.isArray(val)?val.map(dropUndefinedKeys):val}function supportsFetch(){if(!("fetch"in getGlobalObject()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function isNativeFetch(func){return func&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString())}function supportsReferrerPolicy(){if(!supportsFetch())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}var lastHref,global$8=getGlobalObject(),handlers={},instrumented={};function instrument(type){if(!instrumented[type])switch(instrumented[type]=!0,type){case"console":!function(){if(!("console"in global$8))return;["debug","info","warn","error","log","assert"].forEach((function(level){level in global$8.console&&fill(global$8.console,level,(function(originalConsoleLevel){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];triggerHandlers("console",{args:args,level:level}),originalConsoleLevel&&Function.prototype.apply.call(originalConsoleLevel,global$8.console,args)}}))}))}();break;case"dom":!function(){if(!("document"in global$8))return;var triggerDOMHandler=triggerHandlers.bind(null,"dom"),globalDOMEventHandler=makeDOMEventHandler(triggerDOMHandler,!0);global$8.document.addEventListener("click",globalDOMEventHandler,!1),global$8.document.addEventListener("keypress",globalDOMEventHandler,!1),["EventTarget","Node"].forEach((function(target){var proto=global$8[target]&&global$8[target].prototype;proto&&proto.hasOwnProperty&&proto.hasOwnProperty("addEventListener")&&(fill(proto,"addEventListener",(function(originalAddEventListener){return function(type,listener,options){if("click"===type||"keypress"==type)try{var el=this,handlers_1=el.__sentry_instrumentation_handlers__=el.__sentry_instrumentation_handlers__||{},handlerForType=handlers_1[type]=handlers_1[type]||{refCount:0};if(!handlerForType.handler){var handler=makeDOMEventHandler(triggerDOMHandler);handlerForType.handler=handler,originalAddEventListener.call(this,type,handler,options)}handlerForType.refCount+=1}catch(e){}return originalAddEventListener.call(this,type,listener,options)}})),fill(proto,"removeEventListener",(function(originalRemoveEventListener){return function(type,listener,options){if("click"===type||"keypress"==type)try{var el=this,handlers_2=el.__sentry_instrumentation_handlers__||{},handlerForType=handlers_2[type];handlerForType&&(handlerForType.refCount-=1,handlerForType.refCount<=0&&(originalRemoveEventListener.call(this,type,handlerForType.handler,options),handlerForType.handler=void 0,delete handlers_2[type]),0===Object.keys(handlers_2).length&&delete el.__sentry_instrumentation_handlers__)}catch(e){}return originalRemoveEventListener.call(this,type,listener,options)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in global$8))return;var requestKeys=[],requestValues=[],xhrproto=XMLHttpRequest.prototype;fill(xhrproto,"open",(function(originalOpen){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var xhr=this,url=args[1];xhr.__sentry_xhr__={method:isString(args[0])?args[0].toUpperCase():args[0],url:args[1]},isString(url)&&"POST"===xhr.__sentry_xhr__.method&&url.match(/sentry_key/)&&(xhr.__sentry_own_request__=!0);var onreadystatechangeHandler=function(){if(4===xhr.readyState){try{xhr.__sentry_xhr__&&(xhr.__sentry_xhr__.status_code=xhr.status)}catch(e){}try{var requestPos=requestKeys.indexOf(xhr);if(-1!==requestPos){requestKeys.splice(requestPos);var args_1=requestValues.splice(requestPos)[0];xhr.__sentry_xhr__&&void 0!==args_1[0]&&(xhr.__sentry_xhr__.body=args_1[0])}}catch(e){}triggerHandlers("xhr",{args:args,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:xhr})}};return"onreadystatechange"in xhr&&"function"==typeof xhr.onreadystatechange?fill(xhr,"onreadystatechange",(function(original){return function(){for(var readyStateArgs=[],_i=0;_i<arguments.length;_i++)readyStateArgs[_i]=arguments[_i];return onreadystatechangeHandler(),original.apply(xhr,readyStateArgs)}})):xhr.addEventListener("readystatechange",onreadystatechangeHandler),originalOpen.apply(xhr,args)}})),fill(xhrproto,"send",(function(originalSend){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return requestKeys.push(this),requestValues.push(args),triggerHandlers("xhr",{args:args,startTimestamp:Date.now(),xhr:this}),originalSend.apply(this,args)}}))}();break;case"fetch":!function(){if(!function(){if(!supportsFetch())return!1;var global=getGlobalObject();if(isNativeFetch(global.fetch))return!0;var result=!1,doc=global.document;if(doc&&"function"==typeof doc.createElement)try{var sandbox=doc.createElement("iframe");sandbox.hidden=!0,doc.head.appendChild(sandbox),sandbox.contentWindow&&sandbox.contentWindow.fetch&&(result=isNativeFetch(sandbox.contentWindow.fetch)),doc.head.removeChild(sandbox)}catch(err){logger$1.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",err)}return result}())return;fill(global$8,"fetch",(function(originalFetch){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var handlerData={args:args,fetchData:{method:getFetchMethod(args),url:getFetchUrl(
892args)},startTimestamp:Date.now()};return triggerHandlers("fetch",__assign$2({},handlerData)),originalFetch.apply(global$8,args).then((function(response){return triggerHandlers("fetch",__assign$2(__assign$2({},handlerData),{endTimestamp:Date.now(),response:response})),response}),(function(error){throw triggerHandlers("fetch",__assign$2(__assign$2({},handlerData),{endTimestamp:Date.now(),error:error})),error}))}}))}();break;case"history":!function(){if(!function(){var global=getGlobalObject(),chrome=global.chrome,isChromePackagedApp=chrome&&chrome.app&&chrome.app.runtime,hasHistoryApi="history"in global&&!!global.history.pushState&&!!global.history.replaceState;return!isChromePackagedApp&&hasHistoryApi}())return;var oldOnPopState=global$8.onpopstate;function historyReplacementFunction(originalHistoryFunction){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var url=args.length>2?args[2]:void 0;if(url){var from=lastHref,to=String(url);lastHref=to,triggerHandlers("history",{from:from,to:to})}return originalHistoryFunction.apply(this,args)}}global$8.onpopstate=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var to=global$8.location.href,from=lastHref;if(lastHref=to,triggerHandlers("history",{from:from,to:to}),oldOnPopState)try{return oldOnPopState.apply(this,args)}catch(_oO){}},fill(global$8.history,"pushState",historyReplacementFunction),fill(global$8.history,"replaceState",historyReplacementFunction)}();break;case"error":_oldOnErrorHandler=global$8.onerror,global$8.onerror=function(msg,url,line,column,error){return triggerHandlers("error",{column:column,error:error,line:line,msg:msg,url:url}),!!_oldOnErrorHandler&&_oldOnErrorHandler.apply(this,arguments)};break;case"unhandledrejection":_oldOnUnhandledRejectionHandler=global$8.onunhandledrejection,global$8.onunhandledrejection=function(e){return triggerHandlers("unhandledrejection",e),!_oldOnUnhandledRejectionHandler||_oldOnUnhandledRejectionHandler.apply(this,arguments)};break;default:logger$1.warn("unknown instrumentation type:",type)}}function addInstrumentationHandler(handler){handler&&"string"==typeof handler.type&&"function"==typeof handler.callback&&(handlers[handler.type]=handlers[handler.type]||[],handlers[handler.type].push(handler.callback),instrument(handler.type))}function triggerHandlers(type,data){var e_1,_a;if(type&&handlers[type])try{for(var _b=__values$2(handlers[type]||[]),_c=_b.next();!_c.done;_c=_b.next()){var handler=_c.value;try{handler(data)}catch(e){logger$1.error("Error while triggering instrumentation handler.\nType: "+type+"\nName: "+getFunctionName(handler)+"\nError: "+e)}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_1)throw e_1.error}}}function getFetchMethod(fetchArgs){return void 0===fetchArgs&&(fetchArgs=[]),"Request"in global$8&&isInstanceOf(fetchArgs[0],Request)&&fetchArgs[0].method?String(fetchArgs[0].method).toUpperCase():fetchArgs[1]&&fetchArgs[1].method?String(fetchArgs[1].method).toUpperCase():"GET"}function getFetchUrl(fetchArgs){return void 0===fetchArgs&&(fetchArgs=[]),"string"==typeof fetchArgs[0]?fetchArgs[0]:"Request"in global$8&&isInstanceOf(fetchArgs[0],Request)?fetchArgs[0].url:String(fetchArgs[0])}var debounceTimerID,lastCapturedEvent;function makeDOMEventHandler(handler,globalListener){return void 0===globalListener&&(globalListener=!1),function(event){if(event&&lastCapturedEvent!==event&&!function(event){if("keypress"!==event.type)return!1;try{var target=event.target;if(!target||!target.tagName)return!0;if("INPUT"===target.tagName||"TEXTAREA"===target.tagName||target.isContentEditable)return!1}catch(e){}return!0}(event)){var name="keypress"===event.type?"input":event.type;(void 0===debounceTimerID||function(previous,current){if(!previous)return!0;if(previous.type!==current.type)return!0;try{if(previous.target!==current.target)return!0}catch(e){}return!1}(lastCapturedEvent,event))&&(handler({event:event,name:name,global:globalListener}),lastCapturedEvent=event),clearTimeout(debounceTimerID),debounceTimerID=global$8.setTimeout((function(){debounceTimerID=void 0}),1e3)}}}var _oldOnErrorHandler=null;var _oldOnUnhandledRejectionHandler=null;function uuid4(){var global=getGlobalObject(),crypto=global.crypto||global.msCrypto;if(void 0!==crypto&&crypto.getRandomValues){var arr=new Uint16Array(8);crypto.getRandomValues(arr),arr[3]=4095&arr[3]|16384,arr[4]=16383&arr[4]|32768;var pad=function(num){for(var v=num.toString(16);v.length<4;)v="0"+v;return v};return pad(arr[0])+pad(arr[1])+pad(arr[2])+pad(arr[3])+pad(arr[4])+pad(arr[5])+pad(arr[6])+pad(arr[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=16*Math.random()|0;return("x"===c?r:3&r|8).toString(16)}))}function parseUrl(url){if(!url)return{};var match=url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!match)return{};var query=match[6]||"",fragment=match[8]||"";return{host:match[4],path:match[5],protocol:match[2],relative:match[5]+query+fragment}}function getEventDescription(event){if(event.message)return event.message;if(event.exception&&event.exception.values&&event.exception.values[0]){var exception=event.exception.values[0];return exception.type&&exception.value?exception.type+": "+exception.value:exception.type||exception.value||event.event_id||"<unknown>"}return event.event_id||"<unknown>"}function addExceptionTypeValue(event,value,type){event.exception=event.exception||{},event.exception.values=event.exception.values||[],event.exception.values[0]=event.exception.values[0]||{},event.exception.values[0].value=event.exception.values[0].value||value||"",event.exception.values[0].type=event.exception.values[0].type||type||"Error"}function addExceptionMechanism(event,newMechanism){var _a;if(event.exception&&event.exception.values){var exceptionValue0=event.exception.values[0],currentMechanism=exceptionValue0.mechanism;if(exceptionValue0.mechanism=__assign$2(__assign$2(__assign$2({},{type:"generic",handled:!0}),currentMechanism),newMechanism),newMechanism&&"data"in newMechanism){var mergedData=__assign$2(__assign$2({},null===(_a=currentMechanism)||void 0===_a?void 0:_a.data),newMechanism.data);exceptionValue0.mechanism.data=mergedData}}}function checkOrSetAlreadyCaught(exception){var _a;if(null===(_a=exception)||void 0===_a?void 0:_a.__sentry_captured__)return!0;try{Object.defineProperty(exception,"__sentry_captured__",{value:!0})}catch(err){}return!1}var SyncPromise=function(){function SyncPromise(executor){var _this=this;this._state="PENDING",this._handlers=[],this._resolve=function(value){_this._setResult("RESOLVED",value)},this._reject=function(reason){_this._setResult("REJECTED",reason)},this._setResult=function(state,value){"PENDING"===_this._state&&(isThenable(value)?value.then(_this._resolve,_this._reject):(_this._state=state,_this._value=value,_this._executeHandlers()))},this._attachHandler=function(handler){_this._handlers=_this._handlers.concat(handler),_this._executeHandlers()},this._executeHandlers=function(){if("PENDING"!==_this._state){var cachedHandlers=_this._handlers.slice();
892_this._handlers=[],cachedHandlers.forEach((function(handler){handler.done||("RESOLVED"===_this._state&&handler.onfulfilled&&handler.onfulfilled(_this._value),"REJECTED"===_this._state&&handler.onrejected&&handler.onrejected(_this._value),handler.done=!0)}))}};try{executor(this._resolve,this._reject)}catch(e){this._reject(e)}}return SyncPromise.resolve=function(value){return new SyncPromise((function(resolve){resolve(value)}))},SyncPromise.reject=function(reason){return new SyncPromise((function(_,reject){reject(reason)}))},SyncPromise.all=function(collection){return new SyncPromise((function(resolve,reject){if(Array.isArray(collection))if(0!==collection.length){var counter=collection.length,resolvedCollection=[];collection.forEach((function(item,index){SyncPromise.resolve(item).then((function(value){resolvedCollection[index]=value,0===(counter-=1)&&resolve(resolvedCollection)})).then(null,reject)}))}else resolve([]);else reject(new TypeError("Promise.all requires an array as input."))}))},SyncPromise.prototype.then=function(onfulfilled,onrejected){var _this=this;return new SyncPromise((function(resolve,reject){_this._attachHandler({done:!1,onfulfilled:function(result){if(onfulfilled)try{return void resolve(onfulfilled(result))}catch(e){return void reject(e)}else resolve(result)},onrejected:function(reason){if(onrejected)try{return void resolve(onrejected(reason))}catch(e){return void reject(e)}else reject(reason)}})}))},SyncPromise.prototype.catch=function(onrejected){return this.then((function(val){return val}),onrejected)},SyncPromise.prototype.finally=function(onfinally){var _this=this;return new SyncPromise((function(resolve,reject){var val,isRejected;return _this.then((function(value){isRejected=!1,val=value,onfinally&&onfinally()}),(function(reason){isRejected=!0,val=reason,onfinally&&onfinally()})).then((function(){isRejected?reject(val):resolve(val)}))}))},SyncPromise.prototype.toString=function(){return"[object SyncPromise]"},SyncPromise}(),PromiseBuffer=function(){function PromiseBuffer(_limit){this._limit=_limit,this._buffer=[]}return PromiseBuffer.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},PromiseBuffer.prototype.add=function(taskProducer){var _this=this;if(!this.isReady())return SyncPromise.reject(new SentryError("Not adding Promise due to buffer limit reached."));var task=taskProducer();return-1===this._buffer.indexOf(task)&&this._buffer.push(task),task.then((function(){return _this.remove(task)})).then(null,(function(){return _this.remove(task).then(null,(function(){}))})),task},PromiseBuffer.prototype.remove=function(task){return this._buffer.splice(this._buffer.indexOf(task),1)[0]},PromiseBuffer.prototype.length=function(){return this._buffer.length},PromiseBuffer.prototype.drain=function(timeout){var _this=this;return new SyncPromise((function(resolve){var capturedSetTimeout=setTimeout((function(){timeout&&timeout>0&&resolve(!1)}),timeout);SyncPromise.all(_this._buffer).then((function(){clearTimeout(capturedSetTimeout),resolve(!0)})).then(null,(function(){resolve(!0)}))}))},PromiseBuffer}(),dateTimestampSource={nowSeconds:function(){return Date.now()/1e3}};var platformPerformance=isNodeEnv()?function(){try{return dynamicRequire(module,"perf_hooks").performance}catch(_){return}}():function(){var performance=getGlobalObject().performance;if(performance&&performance.now)return{now:function(){return performance.now()},timeOrigin:Date.now()-performance.now()}}(),timestampSource=void 0===platformPerformance?dateTimestampSource:{nowSeconds:function(){return(platformPerformance.timeOrigin+platformPerformance.now())/1e3}},dateTimestampInSeconds=dateTimestampSource.nowSeconds.bind(dateTimestampSource),timestampInSeconds=timestampSource.nowSeconds.bind(timestampSource),timestampWithMs=timestampInSeconds,browserPerformanceTimeOrigin=function(){var performance=getGlobalObject().performance;if(performance&&performance.now){var performanceNow=performance.now(),dateNow=Date.now(),timeOriginDelta=performance.timeOrigin?Math.abs(performance.timeOrigin+performanceNow-dateNow):36e5,timeOriginIsReliable=timeOriginDelta<36e5,navigationStart=performance.timing&&performance.timing.navigationStart,navigationStartDelta="number"==typeof navigationStart?Math.abs(navigationStart+performanceNow-dateNow):36e5;return timeOriginIsReliable||navigationStartDelta<36e5?timeOriginDelta<=navigationStartDelta?performance.timeOrigin:navigationStart:dateNow}}(),Scope=function(){function Scope(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return Scope.clone=function(scope){var newScope=new Scope;return scope&&(newScope._breadcrumbs=__spread$2(scope._breadcrumbs),newScope._tags=__assign$3({},scope._tags),newScope._extra=__assign$3({},scope._extra),newScope._contexts=__assign$3({},scope._contexts),newScope._user=scope._user,newScope._level=scope._level,newScope._span=scope._span,newScope._session=scope._session,newScope._transactionName=scope._transactionName,newScope._fingerprint=scope._fingerprint,newScope._eventProcessors=__spread$2(scope._eventProcessors),newScope._requestSession=scope._requestSession),newScope},Scope.prototype.addScopeListener=function(callback){this._scopeListeners.push(callback)},Scope.prototype.addEventProcessor=function(callback){return this._eventProcessors.push(callback),this},Scope.prototype.setUser=function(user){return this._user=user||{},this._session&&this._session.update({user:user}),this._notifyScopeListeners(),this},Scope.prototype.getUser=function(){return this._user},Scope.prototype.getRequestSession=function(){return this._requestSession},Scope.prototype.setRequestSession=function(requestSession){return this._requestSession=requestSession,this},Scope.prototype.setTags=function(tags){return this._tags=__assign$3(__assign$3({},this._tags),tags),this._notifyScopeListeners(),this},Scope.prototype.setTag=function(key,value){var _a;return this._tags=__assign$3(__assign$3({},this._tags),((_a={})[key]=value,_a)),this._notifyScopeListeners(),this},Scope.prototype.setExtras=function(extras){return this._extra=__assign$3(__assign$3({},this._extra),extras),this._notifyScopeListeners(),this},Scope.prototype.setExtra=function(key,extra){var _a;return this._extra=__assign$3(__assign$3({},this._extra),((_a={})[key]=extra,_a)),this._notifyScopeListeners(),this},Scope.prototype.setFingerprint=function(fingerprint){return this._fingerprint=fingerprint,this._notifyScopeListeners(),this},Scope.prototype.setLevel=function(level){return this._level=level,this._notifyScopeListeners(),this},Scope.prototype.setTransactionName=function(name){return this._transactionName=name,this._notifyScopeListeners(),this},Scope.prototype.setTransaction=function(name){return this.setTransactionName(name)},Scope.prototype.setContext=function(key,context){var _a;return null===context?delete this._contexts[key]:this._contexts=__assign$3(__assign$3({},this._contexts),((_a={})[key]=context,_a)),this._notifyScopeListeners(),this},Scope.prototype.setSpan=function(span){return this._span=span,this._notifyScopeListeners(),this},Scope.prototype.getSpan=function(){return this._span},Scope.prototype.getTransaction=function(){var _a,_b,_c,_d,span=this.getSpan();return(null===(_a=span)||void 0===_a?void 0:_a.transaction)?null===(_b=span)||void 0===_b?void 0:_b.transaction:(null===(_d=null===(_c=span)||void 0===_c?void 0:_c.spanRecorder)||void 0===_d?void 0:_d.spans[0])?span.spanRecorder.spans[0]:void 0},Scope.prototype.setSession=function(session){return session?this._session=session:delete this._session,this._notifyScopeListeners(),this},Scope.prototype.getSession=function(){return this._session},Scope.prototype.update=function(captureContext){if(!captureContext)return this;if("function"==typeof captureContext){var updatedScope=captureContext(this);return updatedScope instanceof Scope?updatedScope:this}return captureContext instanceof Scope?(this._tags=__assign$3(__assign$3({},this._tags),captureContext._tags),this._extra=__assign$3(__assign$3({},this._extra),captureContext._extra),this._contexts=__assign$3(__assign$3({},this._contexts),captureContext._contexts),captureContext._user&&Object.keys(captureContext._user).length&&(this._user=captureContext._user),captureContext._level&&(this._level=captureContext._level),captureContext._fingerprint&&(this._fingerprint=captureContext._fingerprint),captureContext._requestSession&&(this._requestSession=captureContext._requestSession)):isPlainObject(captureContext)&&(captureContext=captureContext,this._tags=__assign$3(__assign$3({},this._tags),captureContext.tags),this._extra=__assign$3(__assign$3({},this._extra),captureContext.extra),this._contexts=__assign$3(__assign$3({},this._contexts),captureContext.contexts),captureContext.user&&(this._user=captureContext.user),captureContext.level&&(this._level=captureContext.level),captureContext.fingerprint&&(this._fingerprint=captureContext.fingerprint),captureContext.requestSession&&(this._requestSession=captureContext.requestSession)),this},Scope.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},Scope.prototype.addBreadcrumb=function(breadcrumb,maxBreadcrumbs){var maxCrumbs="number"==typeof maxBreadcrumbs?Math.min(maxBreadcrumbs,100):100;if(maxCrumbs<=0)return this;var mergedBreadcrumb=__assign$3({timestamp:dateTimestampInSeconds()},breadcrumb);return this._breadcrumbs=__spread$2(this._breadcrumbs,[mergedBreadcrumb]).slice(-maxCrumbs),this._notifyScopeListeners(),this},Scope.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},Scope.prototype.applyToEvent=function(event,hint){var _a;if(this._extra&&Object.keys(this._extra).length&&(event.extra=__assign$3(__assign$3({},this._extra),event.extra)),this._tags&&Object.keys(this._tags).length&&(event.tags=__assign$3(__assign$3({},this._tags),event.tags)),this._user&&Object.keys(this._user).length&&(event.user=__assign$3(__assign$3({},this._user),event.user)),this._contexts&&Object.keys(this._contexts).length&&(event.contexts=__assign$3(__assign$3({},this._contexts),event.contexts)),this._level&&(event.level=this._level),this._transactionName&&(event.transaction=this._transactionName),this._span){event.contexts=__assign$3({trace:this._span.getTraceContext()},event.contexts);var transactionName=null===(_a=this._span.transaction)||void 0===_a?void 0:_a.name;transactionName&&(event.tags=__assign$3({transaction:transactionName},event.tags))}return this._applyFingerprint(event),event.breadcrumbs=__spread$2(event.breadcrumbs||[],this._breadcrumbs),event.breadcrumbs=event.breadcrumbs.length>0?event.breadcrumbs:void 0,this._notifyEventProcessors(__spread$2(getGlobalEventProcessors(),this._eventProcessors),event,hint)},Scope.prototype._notifyEventProcessors=function(processors,event,hint,index){var _this=this;return void 0===index&&(index=0),new SyncPromise((function(resolve,reject){var processor=processors[index];if(null===event||"function"!=typeof processor)resolve(event);else{var result=processor(__assign$3({},event),hint);isThenable(result)?result.then((function(final){return _this._notifyEventProcessors(processors,final,hint,index+1).then(resolve)})).then(null,reject):_this._notifyEventProcessors(processors,result,hint,index+1).then(resolve).then(null,reject)}}))},Scope.prototype._notifyScopeListeners=function(){var _this=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
892h((function(callback){callback(_this)})),this._notifyingListeners=!1)},Scope.prototype._applyFingerprint=function(event){event.fingerprint=event.fingerprint?Array.isArray(event.fingerprint)?event.fingerprint:[event.fingerprint]:[],this._fingerprint&&(event.fingerprint=event.fingerprint.concat(this._fingerprint)),event.fingerprint&&!event.fingerprint.length&&delete event.fingerprint},Scope}();function getGlobalEventProcessors(){var global=getGlobalObject();return global.__SENTRY__=global.__SENTRY__||{},global.__SENTRY__.globalEventProcessors=global.__SENTRY__.globalEventProcessors||[],global.__SENTRY__.globalEventProcessors}function addGlobalEventProcessor(callback){getGlobalEventProcessors().push(callback)}var Session=function(){function Session(context){this.errors=0,this.sid=uuid4(),this.duration=0,this.status=SessionStatus.Ok,this.init=!0,this.ignoreDuration=!1;var startingTime=timestampInSeconds();this.timestamp=startingTime,this.started=startingTime,context&&this.update(context)}return Session.prototype.update=function(context){if(void 0===context&&(context={}),context.user&&(!this.ipAddress&&context.user.ip_address&&(this.ipAddress=context.user.ip_address),this.did||context.did||(this.did=context.user.id||context.user.email||context.user.username)),this.timestamp=context.timestamp||timestampInSeconds(),context.ignoreDuration&&(this.ignoreDuration=context.ignoreDuration),context.sid&&(this.sid=32===context.sid.length?context.sid:uuid4()),void 0!==context.init&&(this.init=context.init),!this.did&&context.did&&(this.did=""+context.did),"number"==typeof context.started&&(this.started=context.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof context.duration)this.duration=context.duration;else{var duration=this.timestamp-this.started;this.duration=duration>=0?duration:0}context.release&&(this.release=context.release),context.environment&&(this.environment=context.environment),!this.ipAddress&&context.ipAddress&&(this.ipAddress=context.ipAddress),!this.userAgent&&context.userAgent&&(this.userAgent=context.userAgent),"number"==typeof context.errors&&(this.errors=context.errors),context.status&&(this.status=context.status)},Session.prototype.close=function(status){status?this.update({status:status}):this.status===SessionStatus.Ok?this.update({status:SessionStatus.Exited}):this.update()},Session.prototype.toJSON=function(){return dropUndefinedKeys({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:dropUndefinedKeys({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},Session}(),Hub=function(){function Hub(client,scope,_version){void 0===scope&&(scope=new Scope),void 0===_version&&(_version=4),this._version=_version,this._stack=[{}],this.getStackTop().scope=scope,client&&this.bindClient(client)}return Hub.prototype.isOlderThan=function(version){return this._version<version},Hub.prototype.bindClient=function(client){this.getStackTop().client=client,client&&client.setupIntegrations&&client.setupIntegrations()},Hub.prototype.pushScope=function(){var scope=Scope.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:scope}),scope},Hub.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},Hub.prototype.withScope=function(callback){var scope=this.pushScope();try{callback(scope)}finally{this.popScope()}},Hub.prototype.getClient=function(){return this.getStackTop().client},Hub.prototype.getScope=function(){return this.getStackTop().scope},Hub.prototype.getStack=function(){return this._stack},Hub.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},Hub.prototype.captureException=function(exception,hint){var eventId=this._lastEventId=uuid4(),finalHint=hint;if(!hint){var syntheticException=void 0;try{throw new Error("Sentry syntheticException")}catch(exception){syntheticException=exception}finalHint={originalException:exception,syntheticException:syntheticException}}return this._invokeClient("captureException",exception,__assign$3(__assign$3({},finalHint),{event_id:eventId})),eventId},Hub.prototype.captureMessage=function(message,level,hint){var eventId=this._lastEventId=uuid4(),finalHint=hint;if(!hint){var syntheticException=void 0;try{throw new Error(message)}catch(exception){syntheticException=exception}finalHint={originalException:message,syntheticException:syntheticException}}return this._invokeClient("captureMessage",message,level,__assign$3(__assign$3({},finalHint),{event_id:eventId})),eventId},Hub.prototype.captureEvent=function(event,hint){var eventId=uuid4();return"transaction"!==event.type&&(this._lastEventId=eventId),this._invokeClient("captureEvent",event,__assign$3(__assign$3({},hint),{event_id:eventId})),eventId},Hub.prototype.lastEventId=function(){return this._lastEventId},Hub.prototype.addBreadcrumb=function(breadcrumb,hint){var _a=this.getStackTop(),scope=_a.scope,client=_a.
892client;if(scope&&client){var _b=client.getOptions&&client.getOptions()||{},_c=_b.beforeBreadcrumb,beforeBreadcrumb=void 0===_c?null:_c,_d=_b.maxBreadcrumbs,maxBreadcrumbs=void 0===_d?100:_d;if(!(maxBreadcrumbs<=0)){var timestamp=dateTimestampInSeconds(),mergedBreadcrumb=__assign$3({timestamp:timestamp},breadcrumb),finalBreadcrumb=beforeBreadcrumb?consoleSandbox((function(){return beforeBreadcrumb(mergedBreadcrumb,hint)})):mergedBreadcrumb;null!==finalBreadcrumb&&scope.addBreadcrumb(finalBreadcrumb,maxBreadcrumbs)}}},Hub.prototype.setUser=function(user){var scope=this.getScope();scope&&scope.setUser(user)},Hub.prototype.setTags=function(tags){var scope=this.getScope();scope&&scope.setTags(tags)},Hub.prototype.setExtras=function(extras){var scope=this.getScope();scope&&scope.setExtras(extras)},Hub.prototype.setTag=function(key,value){var scope=this.getScope();scope&&scope.setTag(key,value)},Hub.prototype.setExtra=function(key,extra){var scope=this.getScope();scope&&scope.setExtra(key,extra)},Hub.prototype.setContext=function(name,context){var scope=this.getScope();scope&&scope.setContext(name,context)},Hub.prototype.configureScope=function(callback){var _a=this.getStackTop(),scope=_a.scope,client=_a.client;scope&&client&&callback(scope)},Hub.prototype.run=function(callback){var oldHub=makeMain(this);try{callback(this)}finally{makeMain(oldHub)}},Hub.prototype.getIntegration=function(integration){var client=this.getClient();if(!client)return null;try{return client.getIntegration(integration)}catch(_oO){return logger$1.warn("Cannot retrieve integration "+integration.id+" from the current Hub"),null}},Hub.prototype.startSpan=function(context){return this._callExtensionMethod("startSpan",context)},Hub.prototype.startTransaction=function(context,customSamplingContext){return this._callExtensionMethod("startTransaction",context,customSamplingContext)},Hub.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},Hub.prototype.captureSession=function(endSession){if(void 0===endSession&&(endSession=!1),endSession)return this.endSession();this._sendSessionUpdate()},Hub.prototype.endSession=function(){var _a,_b,_c,_d,_e;null===(_c=null===(_b=null===(_a=this.getStackTop())||void 0===_a?void 0:_a.scope)||void 0===_b?void 0:_b.getSession())||void 0===_c||_c.close(),this._sendSessionUpdate(),null===(_e=null===(_d=this.getStackTop())||void 0===_d?void 0:_d.scope)||void 0===_e||_e.setSession()},Hub.prototype.startSession=function(context){var _a=this.getStackTop(),scope=_a.scope,client=_a.client,_b=client&&client.getOptions()||{},release=_b.release,environment=_b.environment,userAgent=(getGlobalObject().navigator||{}).userAgent,session=new Session(__assign$3(__assign$3(__assign$3({release:release,environment:environment},scope&&{user:scope.getUser()}),userAgent&&{userAgent:userAgent}),context));if(scope){var currentSession=scope.getSession&&scope.getSession();currentSession&&currentSession.status===SessionStatus.Ok&&currentSession.update({status:SessionStatus.Exited}),this.endSession(),scope.setSession(session)}return session},Hub.prototype._sendSessionUpdate=function(){var _a=this.getStackTop(),scope=_a.scope,client=_a.client;if(scope){var session=scope.getSession&&scope.getSession();session&&client&&client.captureSession&&client.captureSession(session)}},Hub.prototype._invokeClient=function(method){for(var _a,args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];var _b=this.getStackTop(),scope=_b.scope,client=_b.client;client&&client[method]&&(_a=client)[method].apply(_a,__spread$2(args,[scope]))},Hub.prototype._callExtensionMethod=function(method){for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];var carrier=getMainCarrier(),sentry=carrier.__SENTRY__;if(sentry&&sentry.extensions&&"function"==typeof sentry.extensions[method])return sentry.extensions[method].apply(this,args);logger$1.warn("Extension method "+method+" couldn't be found, doing nothing.")},Hub}();function getMainCarrier(){var carrier=getGlobalObject();return carrier.__SENTRY__=carrier.__SENTRY__||{extensions:{},hub:void 0},carrier}function makeMain(hub){var registry=getMainCarrier(),oldHub=getHubFromCarrier(registry);return setHubOnCarrier(registry,hub),oldHub}function getCurrentHub(){var registry=getMainCarrier();return hasHubOnCarrier(registry)&&!getHubFromCarrier(registry).isOlderThan(4)||setHubOnCarrier(registry,new Hub),isNodeEnv()?function(registry){var _a,_b,_c;try{var activeDomain=null===(_c=null===(_b=null===(_a=getMainCarrier().__SENTRY__)||void 0===_a?void 0:_a.extensions)||void 0===_b?void 0:_b.domain)||void 0===_c?void 0:_c.active;if(!activeDomain)return getHubFromCarrier(registry);if(!hasHubOnCarrier(activeDomain)||getHubFromCarrier(activeDomain).isOlderThan(4)){var registryHubTopStack=getHubFromCarrier(registry).getStackTop();setHubOnCarrier(activeDomain,new Hub(registryHubTopStack.client,Scope.clone(registryHubTopStack.scope)))}return getHubFromCarrier(activeDomain)}catch(_Oo){return getHubFromCarrier(registry)}}(registry):getHubFromCarrier(registry)}function hasHubOnCarrier(carrier){return!!(carrier&&carrier.__SENTRY__&&carrier.__SENTRY__.hub)}function getHubFromCarrier(carrier){return carrier&&carrier.__SENTRY__&&carrier.__SENTRY__.hub||(carrier.__SENTRY__=carrier.__SENTRY__||{},carrier.__SENTRY__.hub=new Hub),carrier.__SENTRY__.hub}function setHubOnCarrier(carrier,hub){return!!carrier&&(carrier.__SENTRY__=carrier.__SENTRY__||{},carrier.__SENTRY__.hub=hub,!0)}function callOnHub(method){for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];var hub=getCurrentHub();if(hub&&hub[method])return hub[method].apply(hub,__spread$3(args));throw new Error("No hub defined or "+method+" was not found on the hub, please open a bug report.")}function captureException(exception,captureContext){var syntheticException;try{throw new Error("Sentry syntheticException")}catch(exception){syntheticException=exception}return callOnHub("captureException",exception,{captureContext:captureContext,originalException:exception,syntheticException:syntheticException})}function withScope(callback){callOnHub("withScope",callback)}var API=function(){function API(dsn,metadata,tunnel){void 0===metadata&&(metadata={}
892),this.dsn=dsn,this._dsnObject=new Dsn(dsn),this.metadata=metadata,this._tunnel=tunnel}return API.prototype.getDsn=function(){return this._dsnObject},API.prototype.forceEnvelope=function(){return!!this._tunnel},API.prototype.getBaseApiEndpoint=function(){var dsn=this.getDsn(),protocol=dsn.protocol?dsn.protocol+":":"",port=dsn.port?":"+dsn.port:"";return protocol+"//"+dsn.host+port+(dsn.path?"/"+dsn.path:"")+"/api/"},API.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},API.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},API.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this._tunnel:this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},API.prototype.getStoreEndpointPath=function(){var dsn=this.getDsn();return(dsn.path?"/"+dsn.path:"")+"/api/"+dsn.projectId+"/store/"},API.prototype.getRequestHeaders=function(clientName,clientVersion){var dsn=this.getDsn(),header=["Sentry sentry_version=7"];return header.push("sentry_client="+clientName+"/"+clientVersion),header.push("sentry_key="+dsn.publicKey),dsn.pass&&header.push("sentry_secret="+dsn.pass),{"Content-Type":"application/json","X-Sentry-Auth":header.join(", ")}},API.prototype.getReportDialogEndpoint=function(dialogOptions){void 0===dialogOptions&&(dialogOptions={});var dsn=this.getDsn(),endpoint=this.getBaseApiEndpoint()+"embed/error-page/",encodedOptions=[];for(var key in encodedOptions.push("dsn="+dsn.toString()),dialogOptions)if("dsn"!==key)if("user"===key){if(!dialogOptions.user)continue;dialogOptions.user.name&&encodedOptions.push("name="+encodeURIComponent(dialogOptions.user.name)),dialogOptions.user.email&&encodedOptions.push("email="+encodeURIComponent(dialogOptions.user.email))}else encodedOptions.push(encodeURIComponent(key)+"="+encodeURIComponent(dialogOptions[key]));return encodedOptions.length?endpoint+"?"+encodedOptions.join("&"):endpoint},API.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},API.prototype._getIngestEndpoint=function(target){return this._tunnel?this._tunnel:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+target+"/"},API.prototype._encodedAuth=function(){return function(object){return Object.keys(object).map((function(key){return encodeURIComponent(key)+"="+encodeURIComponent(object[key])})).join("&")}({sentry_key:this.getDsn().publicKey,sentry_version:"7"})},API}(),__assign$1=function(){return __assign$1=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign$1.apply(this,arguments)};function __read$1(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread$1(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read$1(arguments[i]));return ar}var installedIntegrations=[];function filterDuplicates(integrations){return integrations.reduce((function(acc,integrations){return acc.every((function(accIntegration){return integrations.name!==accIntegration.name}))&&acc.push(integrations),acc}),[])}function setupIntegrations(options){var integrations={};return function(options){var defaultIntegrations=options.defaultIntegrations&&__spread$1(options.defaultIntegrations)||[],userIntegrations=options.integrations,integrations=__spread$1(filterDuplicates(defaultIntegrations));Array.isArray(userIntegrations)?integrations=__spread$1(integrations.filter((function(integrations){return userIntegrations.every((function(userIntegration){return userIntegration.name!==integrations.name}))})),filterDuplicates(userIntegrations)):"function"==typeof userIntegrations&&(integrations=userIntegrations(integrations),integrations=Array.isArray(integrations)?integrations:[integrations]);var integrationsNames=integrations.map((function(i){return i.name}));return-1!==integrationsNames.indexOf("Debug")&&integrations.push.apply(integrations,__spread$1(integrations.splice(integrationsNames.indexOf("Debug"),1))),integrations}
892(options).forEach((function(integration){integrations[integration.name]=integration,function(integration){-1===installedIntegrations.indexOf(integration.name)&&(integration.setupOnce(addGlobalEventProcessor,getCurrentHub),installedIntegrations.push(integration.name),logger$1.log("Integration installed: "+integration.name))}(integration)})),Object.defineProperty(integrations,"initialized",{value:!0}),integrations}var ALREADY_SEEN_ERROR="Not capturing exception because it's already been captured.",BaseClient=function(){function BaseClient(backendClass,options){this._integrations={},this._numProcessing=0,this._backend=new backendClass(options),this._options=options,options.dsn&&(this._dsn=new Dsn(options.dsn))}return BaseClient.prototype.captureException=function(exception,hint,scope){var _this=this;if(!checkOrSetAlreadyCaught(exception)){var eventId=hint&&hint.event_id;return this._process(this._getBackend().eventFromException(exception,hint).then((function(event){return _this._captureEvent(event,hint,scope)})).then((function(result){eventId=result}))),eventId}logger$1.log(ALREADY_SEEN_ERROR)},BaseClient.prototype.captureMessage=function(message,level,hint,scope){var _this=this,eventId=hint&&hint.event_id,promisedEvent=isPrimitive(message)?this._getBackend().eventFromMessage(String(message),level,hint):this._getBackend().eventFromException(message,hint);return this._process(promisedEvent.then((function(event){return _this._captureEvent(event,hint,scope)})).then((function(result){eventId=result}))),eventId},BaseClient.prototype.captureEvent=function(event,hint,scope){var _a;if(!(null===(_a=hint)||void 0===_a?void 0:_a.originalException)||!checkOrSetAlreadyCaught(hint.originalException)){var eventId=hint&&hint.event_id;return this._process(this._captureEvent(event,hint,scope).then((function(result){eventId=result}))),eventId}logger$1.log(ALREADY_SEEN_ERROR)},BaseClient.prototype.captureSession=function(session){this._isEnabled()?"string"!=typeof session.release?logger$1.warn("Discarded session because of missing or non-string release"):(this._sendSession(session),session.update({init:!1})):logger$1.warn("SDK not enabled, will not capture session.")},BaseClient.prototype.getDsn=function(){return this._dsn},BaseClient.prototype.getOptions=function(){return this._options},BaseClient.prototype.getTransport=function(){return this._getBackend().getTransport()},BaseClient.prototype.flush=function(timeout){var _this=this;return this._isClientDoneProcessing(timeout).then((function(clientFinished){return _this.getTransport().close(timeout).then((function(transportFlushed){return clientFinished&&transportFlushed}))}))},BaseClient.prototype.close=function(timeout){var _this=this;return this.flush(timeout).then((function(result){return _this.getOptions().enabled=!1,result}))},BaseClient.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=setupIntegrations(this._options))},BaseClient.prototype.getIntegration=function(integration){try{return this._integrations[integration.id]||null}catch(_oO){return logger$1.warn("Cannot retrieve integration "+integration.id+" from the current Client"),null}},BaseClient.prototype._updateSessionFromEvent=function(session,event){var e_1,_a,crashed=!1,errored=!1,exceptions=event.exception&&event.exception.values;if(exceptions){errored=!0;try{for(var exceptions_1=function(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}(exceptions),exceptions_1_1=exceptions_1.next();!exceptions_1_1.done;exceptions_1_1=exceptions_1.next()){var mechanism=exceptions_1_1.value.mechanism;if(mechanism&&!1===mechanism.handled){crashed=!0;break}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{exceptions_1_1&&!exceptions_1_1.done&&(_a=exceptions_1.return)&&_a.call(exceptions_1)}finally{if(e_1)throw e_1.error}}}var sessionNonTerminal=session.status===SessionStatus.Ok;(sessionNonTerminal&&0===session.errors||sessionNonTerminal&&crashed)&&(session.update(__assign$1(__assign$1({},crashed&&{status:SessionStatus.Crashed}),{errors:session.errors||Number(errored||crashed)})),this.captureSession(session))},BaseClient.prototype._sendSession=function(session){this._getBackend().sendSession(session)},BaseClient.prototype._isClientDoneProcessing=function(timeout){var _this=this;return new SyncPromise((function(resolve){var ticked=0,interval=setInterval((function(){0==_this._numProcessing?(clearInterval(interval),resolve(!0)):(ticked+=1,timeout&&ticked>=timeout&&(clearInterval(interval),resolve(!1)))}),1)}))},BaseClient.prototype._getBackend=function(){return this._backend},BaseClient.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},BaseClient.prototype._prepareEvent=function(event,scope,hint){var _this=this,_a=this.getOptions().normalizeDepth,normalizeDepth=void 0===_a?3:_a,prepared=__assign$1(__assign$1({}
892,event),{event_id:event.event_id||(hint&&hint.event_id?hint.event_id:uuid4()),timestamp:event.timestamp||dateTimestampInSeconds()});this._applyClientOptions(prepared),this._applyIntegrationsMetadata(prepared);var finalScope=scope;hint&&hint.captureContext&&(finalScope=Scope.clone(finalScope).update(hint.captureContext));var result=SyncPromise.resolve(prepared);return finalScope&&(result=finalScope.applyToEvent(prepared,hint)),result.then((function(evt){return"number"==typeof normalizeDepth&&normalizeDepth>0?_this._normalizeEvent(evt,normalizeDepth):evt}))},BaseClient.prototype._normalizeEvent=function(event,depth){if(!event)return null;var normalized=__assign$1(__assign$1(__assign$1(__assign$1(__assign$1({},event),event.breadcrumbs&&{breadcrumbs:event.breadcrumbs.map((function(b){return __assign$1(__assign$1({},b),b.data&&{data:normalize(b.data,depth)})}))}),event.user&&{user:normalize(event.user,depth)}),event.contexts&&{contexts:normalize(event.contexts,depth)}),event.extra&&{extra:normalize(event.extra,depth)});event.contexts&&event.contexts.trace&&(normalized.contexts.trace=event.contexts.trace);var _a=this.getOptions()._experiments;return(void 0===_a?{}:_a).ensureNoCircularStructures?normalize(normalized):normalized},BaseClient.prototype._applyClientOptions=function(event){var options=this.getOptions(),environment=options.environment,release=options.release,dist=options.dist,_a=options.maxValueLength,maxValueLength=void 0===_a?250:_a;"environment"in event||(event.environment="environment"in options?environment:"production"),void 0===event.release&&void 0!==release&&(event.release=release),void 0===event.dist&&void 0!==dist&&(event.dist=dist),event.message&&(event.message=truncate(event.message,maxValueLength));var exception=event.exception&&event.exception.values&&event.exception.values[0];exception&&exception.value&&(exception.value=truncate(exception.value,maxValueLength));var request=event.request;request&&request.url&&(request.url=truncate(request.url,maxValueLength))},BaseClient.prototype._applyIntegrationsMetadata=function(event){var integrationsArray=Object.keys(this._integrations);integrationsArray.length>0&&(event.sdk=event.sdk||{},event.sdk.integrations=__spread$1(event.sdk.integrations||[],integrationsArray))},BaseClient.prototype._sendEvent=function(event){this._getBackend().sendEvent(event)},BaseClient.prototype._captureEvent=function(event,hint,scope){return this._processEvent(event,hint,scope).then((function(finalEvent){return finalEvent.event_id}),(function(reason){logger$1.error(reason)}))},BaseClient.prototype._processEvent=function(event,hint,scope){var _a,_b,_this=this,_c=this.getOptions(),beforeSend=_c.beforeSend,sampleRate=_c.sampleRate,transport=this.getTransport();if(!this._isEnabled())return SyncPromise.reject(new SentryError("SDK not enabled, will not capture event."));var isTransaction="transaction"===event.type;return!isTransaction&&"number"==typeof sampleRate&&Math.random()>sampleRate?(null===(_b=(_a=transport).recordLostEvent)||void 0===_b||_b.call(_a,Outcome.SampleRate,"event"),SyncPromise.reject(new SentryError("Discarding event because it's not included in the random sample (sampling rate = "+sampleRate+")"))):this._prepareEvent(event,scope,hint).then((function(prepared){var _a,_b;if(null===prepared)throw null===(_b=(_a=transport).recordLostEvent)||void 0===_b||_b.call(_a,Outcome.EventProcessor,event.type||"event"),new SentryError("An event processor returned null, will not send event.");if(hint&&hint.data&&!0===hint.data.__sentry__||isTransaction||!beforeSend)return prepared;var beforeSendResult=beforeSend(prepared,hint);return _this._ensureBeforeSendRv(beforeSendResult)})).then((function(processedEvent){var _a,_b;if(null===processedEvent)throw null===(_b=(_a=transport).recordLostEvent)||void 0===_b||_b.call(_a,Outcome.BeforeSend,event.type||"event"),new SentryError("`beforeSend` returned `null`, will not send event.");var session=scope&&scope.getSession&&scope.getSession();return!isTransaction&&session&&_this._updateSessionFromEvent(session,processedEvent),_this._sendEvent(processedEvent),processedEvent})).then(null,(function(reason){if(reason instanceof SentryError)throw reason;throw _this.captureException(reason,{data:{__sentry__:!0},originalException:reason}),new SentryError("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+reason)}))},BaseClient.prototype._process=function(promise){var _this=this;this._numProcessing+=1,promise.then((function(value){return _this._numProcessing-=1,value}),(function(reason){return _this._numProcessing-=1,reason}))},BaseClient.prototype._ensureBeforeSendRv=function(rv){var nullErr="`beforeSend` method has to return `null` or a valid event.";if(isThenable(rv))return rv.then((function(event){if(!isPlainObject(event)&&null!==event)throw new SentryError(nullErr);return event}),(function(e){throw new SentryError("beforeSend rejected with "+e)}));if(!isPlainObject(rv)&&null!==rv)throw new SentryError(nullErr);return rv},BaseClient}(),NoopTransport=function(){function NoopTransport(){}return NoopTransport.prototype.sendEvent=function(_){return SyncPromise.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:Status.Skipped})},NoopTransport.prototype.close=function(_){return SyncPromise.resolve(!0)}
892,NoopTransport}(),BaseBackend=function(){function BaseBackend(options){this._options=options,this._options.dsn||logger$1.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return BaseBackend.prototype.eventFromException=function(_exception,_hint){throw new SentryError("Backend has to implement `eventFromException` method")},BaseBackend.prototype.eventFromMessage=function(_message,_level,_hint){throw new SentryError("Backend has to implement `eventFromMessage` method")},BaseBackend.prototype.sendEvent=function(event){this._transport.sendEvent(event).then(null,(function(reason){logger$1.error("Error while sending event: "+reason)}))},BaseBackend.prototype.sendSession=function(session){this._transport.sendSession?this._transport.sendSession(session).then(null,(function(reason){logger$1.error("Error while sending session: "+reason)})):logger$1.warn("Dropping session because custom transport doesn't implement sendSession")},BaseBackend.prototype.getTransport=function(){return this._transport},BaseBackend.prototype._setupTransport=function(){return new NoopTransport},BaseBackend}();function getSdkMetadataForEnvelopeHeader(api){if(api.metadata&&api.metadata.sdk){var _a=api.metadata.sdk;return{name:_a.name,version:_a.version}}}function enhanceEventWithSdkInfo(event,sdkInfo){return sdkInfo?(event.sdk=event.sdk||{},event.sdk.name=event.sdk.name||sdkInfo.name,event.sdk.version=event.sdk.version||sdkInfo.version,event.sdk.integrations=__spread$1(event.sdk.integrations||[],sdkInfo.integrations||[]),event.sdk.packages=__spread$1(event.sdk.packages||[],sdkInfo.packages||[]),event):event}function sessionToSentryRequest(session,api){var sdkInfo=getSdkMetadataForEnvelopeHeader(api),type="aggregates"in session?"sessions":"session";return{body:JSON.stringify(__assign$1(__assign$1({sent_at:(new Date).toISOString()},sdkInfo&&{sdk:sdkInfo}),api.forceEnvelope()&&{dsn:api.getDsn().toString()}))+"\n"+JSON.stringify({type:type})+"\n"+JSON.stringify(session),type:type,url:api.getEnvelopeEndpointWithUrlEncodedAuth()}}function eventToSentryRequest(event,api){var sdkInfo=getSdkMetadataForEnvelopeHeader(api),eventType=event.type||"event",useEnvelope="transaction"===eventType||api.forceEnvelope(),_a=event.debug_meta||{},transactionSampling=_a.transactionSampling,metadata=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}(_a,["transactionSampling"]),_b=transactionSampling||{},samplingMethod=_b.method,sampleRate=_b.rate;0===Object.keys(metadata).length?delete event.debug_meta:event.debug_meta=metadata;var req={body:JSON.stringify(sdkInfo?enhanceEventWithSdkInfo(event,api.metadata.sdk):event),type:eventType,url:useEnvelope?api.getEnvelopeEndpointWithUrlEncodedAuth():api.getStoreEndpointWithUrlEncodedAuth()};if(useEnvelope){var envelope=JSON.stringify(__assign$1(__assign$1({event_id:event.event_id,sent_at:(new Date).toISOString()},sdkInfo&&{sdk:sdkInfo}),api.forceEnvelope()&&{dsn:api.getDsn().toString()}))+"\n"+JSON.stringify({type:eventType,sample_rates:[{id:samplingMethod,rate:sampleRate}]})+"\n"+req.body;req.body=envelope}return req}var originalFunctionToString,FunctionToString=function(){function FunctionToString(){this.name=FunctionToString.id}return FunctionToString.prototype.setupOnce=function(){originalFunctionToString=Function.prototype.toString,Function.prototype.toString=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var context=this.__sentry_original__||this;return originalFunctionToString.apply(context,args)}},FunctionToString.id="FunctionToString",FunctionToString}(),DEFAULT_IGNORE_ERRORS=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],InboundFilters=function(){function InboundFilters(_options){void 0===_options&&(_options={}),this._options=_options,this.name=InboundFilters.id}return InboundFilters.prototype.setupOnce=function(){addGlobalEventProcessor((function(event){var hub=getCurrentHub();if(!hub)return event;var self=hub.getIntegration(InboundFilters);if(self){var client=hub.getClient(),clientOptions=client?client.getOptions():{},options="function"==typeof self._mergeOptions?self._mergeOptions(clientOptions):{};return"function"!=typeof self._shouldDropEvent?event:self._shouldDropEvent(event,options)?null:event}return event}))},InboundFilters.prototype._shouldDropEvent=function(event,options){return this._isSentryError(event,options)?(logger$1.warn("Event dropped due to being internal Sentry Error.\nEvent: "+getEventDescription(event)),!0):this._isIgnoredError(event,options)?(logger$1.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+getEventDescription(event)),!0):this._isDeniedUrl(event,options)?(logger$1.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+getEventDescription(event)+".\nUrl: "+this._getEventFilterUrl(event)),!0):!this._isAllowedUrl(event,options)&&(logger$1.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+getEventDescription(event)+".\nUrl: "+this._getEventFilterUrl(event)),!0)},InboundFilters.prototype._isSentryError=function(event,options){if(!options.ignoreInternal)return!1;try{return event&&event.exception&&event.exception.values&&event.exception.values[0]&&"SentryError"===event.exception.values[0].type||!1}catch(_oO){return!1}},InboundFilters.prototype._isIgnoredError=function(event,options){return!(!options.ignoreErrors||!options.ignoreErrors.length)&&this._getPossibleEventMessages(event).some((function(message){return options.ignoreErrors.some((function(pattern){return isMatchingPattern(message,pattern)}))}))},InboundFilters.prototype._isDeniedUrl=function(event,options){if(!options.denyUrls||!options.denyUrls.length)return!1;var url=this._getEventFilterUrl(event);return!!url&&options.denyUrls.some((function(pattern){return isMatchingPattern(url,pattern)}))},InboundFilters.prototype._isAllowedUrl=function(event,options){if(!options.allowUrls||!options.allowUrls.length)return!0;var url=this._getEventFilterUrl(event);return!url||options.allowUrls.some((function(pattern){return isMatchingPattern(url,pattern)}))},InboundFilters.prototype._mergeOptions=function(clientOptions){return void 0===clientOptions&&(clientOptions={}),{allowUrls:__spread$1(this._options.whitelistUrls||[],this._options.allowUrls||[],clientOptions.whitelistUrls||[],clientOptions.allowUrls||[]),denyUrls:__spread$1(this._options.blackl
892istUrls||[],this._options.denyUrls||[],clientOptions.blacklistUrls||[],clientOptions.denyUrls||[]),ignoreErrors:__spread$1(this._options.ignoreErrors||[],clientOptions.ignoreErrors||[],DEFAULT_IGNORE_ERRORS),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},InboundFilters.prototype._getPossibleEventMessages=function(event){if(event.message)return[event.message];if(event.exception)try{var _a=event.exception.values&&event.exception.values[0]||{},_b=_a.type,type=void 0===_b?"":_b,_c=_a.value,value=void 0===_c?"":_c;return[""+value,type+": "+value]}catch(oO){return logger$1.error("Cannot extract message for event "+getEventDescription(event)),[]}return[]},InboundFilters.prototype._getLastValidUrl=function(frames){var _a,_b;void 0===frames&&(frames=[]);for(var i=frames.length-1;i>=0;i--){var frame=frames[i];if("<anonymous>"!==(null===(_a=frame)||void 0===_a?void 0:_a.filename)&&"[native code]"!==(null===(_b=frame)||void 0===_b?void 0:_b.filename))return frame.filename||null}return null},InboundFilters.prototype._getEventFilterUrl=function(event){try{if(event.stacktrace){var frames_1=event.stacktrace.frames;return this._getLastValidUrl(frames_1)}if(event.exception){var frames_2=event.exception.values&&event.exception.values[0].stacktrace&&event.exception.values[0].stacktrace.frames;return this._getLastValidUrl(frames_2)}return null}catch(oO){return logger$1.error("Cannot extract url for event "+getEventDescription(event)),null}},InboundFilters.id="InboundFilters",InboundFilters}(),chrome=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gecko=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,winjs=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,geckoEval=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,chromeEval=/\((\S*)(?::(\d+))(?::(\d+))\)/,reactMinifiedRegexp=/Minified React error #\d+;/i;function computeStackTrace(ex){var stack=null,popSize=0;ex&&("number"==typeof ex.framesToPop?popSize=ex.framesToPop:reactMinifiedRegexp.test(ex.message)&&(popSize=1));try{if(stack=function(ex){if(!ex||!ex.stacktrace)return null;for(var parts,stacktrace=ex.stacktrace,opera10Regex=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,opera11Regex=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,lines=stacktrace.split("\n"),stack=[],line=0;line<lines.length;line+=2){var element=null;(parts=opera10Regex.exec(lines[line]))?element={url:parts[2],func:parts[3],args:[],line:+parts[1],column:null}:(parts=opera11Regex.exec(lines[line]))&&(element={url:parts[6],func:parts[3]||parts[4],args:parts[5]?parts[5].split(","):[],line:+parts[1],column:+parts[2]}),element&&(!element.func&&element.line&&(element.func="?"),stack.push(element))}if(!stack.length)return null;return{message:extractMessage(ex),name:ex.name,stack:stack}}(ex),stack)return popFrames(stack,popSize)}catch(e){}try{if(stack=function(ex){var _a,_b;if(!ex||!ex.stack)return null;for(var submatch,parts,element,stack=[],lines=ex.stack.split("\n"),i=0;i<lines.length;++i){if(parts=chrome.exec(lines[i])){var isNative=parts[2]&&0===parts[2].indexOf("native");parts[2]&&0===parts[2].indexOf("eval")&&(submatch=chromeEval.exec(parts[2]))&&(parts[2]=submatch[1],parts[3]=submatch[2],parts[4]=submatch[3]);var url=parts[2]&&0===parts[2].indexOf("address at ")?parts[2].substr("address at ".length):parts[2],func=parts[1]||"?";func=(_a=__read$5(extractSafariExtensionDetails(func,url),2))[0],element={url:url=_a[1],func:func,args:isNative?[parts[2]]:[],line:parts[3]?+parts[3]:null,column:parts[4]?+parts[4]:null}}else if(parts=winjs.exec(lines[i]))element={url:parts[2],func:parts[1]||"?",args:[],line:+parts[3],column:parts[4]?+parts[4]:null};else{if(!(parts=gecko.exec(lines[i])))continue;parts[3]&&parts[3].indexOf(" > eval")>
892-1&&(submatch=geckoEval.exec(parts[3]))?(parts[1]=parts[1]||"eval",parts[3]=submatch[1],parts[4]=submatch[2],parts[5]=""):0!==i||parts[5]||void 0===ex.columnNumber||(stack[0].column=ex.columnNumber+1);url=parts[3],func=parts[1]||"?";func=(_b=__read$5(extractSafariExtensionDetails(func,url),2))[0],element={url:url=_b[1],func:func,args:parts[2]?parts[2].split(","):[],line:parts[4]?+parts[4]:null,column:parts[5]?+parts[5]:null}}!element.func&&element.line&&(element.func="?"),stack.push(element)}if(!stack.length)return null;return{message:extractMessage(ex),name:ex.name,stack:stack}}(ex),stack)return popFrames(stack,popSize)}catch(e){}return{message:extractMessage(ex),name:ex&&ex.name,stack:[],failed:!0}}var extractSafariExtensionDetails=function(func,url){var isSafariExtension=-1!==func.indexOf("safari-extension"),isSafariWebExtension=-1!==func.indexOf("safari-web-extension");return isSafariExtension||isSafariWebExtension?[-1!==func.indexOf("@")?func.split("@")[0]:"?",isSafariExtension?"safari-extension:"+url:"safari-web-extension:"+url]:[func,url]};function popFrames(stacktrace,popSize){try{return __assign$4(__assign$4({},stacktrace),{stack:stacktrace.stack.slice(popSize)})}catch(e){return stacktrace}}function extractMessage(ex){var message=ex&&ex.message;return message?message.error&&"string"==typeof message.error.message?message.error.message:message:"No error message"}function exceptionFromStacktrace(stacktrace){var frames=prepareFramesForEvent(stacktrace.stack),exception={type:stacktrace.name,value:stacktrace.message};return frames&&frames.length&&(exception.stacktrace={frames:frames}),void 0===exception.type&&""===exception.value&&(exception.value="Unrecoverable error caught"),exception}function eventFromStacktrace(stacktrace){return{exception:{values:[exceptionFromStacktrace(stacktrace)]}}}function prepareFramesForEvent(stack){if(!stack||!stack.length)return[];var localStack=stack,firstFrameFunction=localStack[0].func||"",lastFrameFunction=localStack[localStack.length-1].func||"";return-1===firstFrameFunction.indexOf("captureMessage")&&-1===firstFrameFunction.indexOf("captureException")||(localStack=localStack.slice(1)),-1!==lastFrameFunction.indexOf("sentryWrapped")&&(localStack=localStack.slice(0,-1)),localStack.slice(0,50).map((function(frame){return{colno:null===frame.column?void 0:frame.column,filename:frame.url||localStack[0].url,function:frame.func||"?",in_app:!0,lineno:null===frame.line?void 0:frame.line}})).reverse()}function eventFromUnknownInput(exception,syntheticException,options){var event,wat;if(void 0===options&&(options={}),isErrorEvent(exception)&&exception.error)return event=eventFromStacktrace(computeStackTrace(exception=exception.error));if(isDOMError(exception)||(wat=exception,"[object DOMException]"===Object.prototype.toString.call(wat))){var domException=exception;if("stack"in exception)event=eventFromStacktrace(computeStackTrace(exception));else{var name_1=domException.name||(isDOMError(domException)?"DOMError":"DOMException"),message=domException.message?name_1+": "+domException.message:name_1;addExceptionTypeValue(event=eventFromString(message,syntheticException,options),message)}return"code"in domException&&(event.tags=__assign$4(__assign$4({},event.tags),{"DOMException.code":""+domException.code})),event}return isError(exception)?event=eventFromStacktrace(computeStackTrace(exception)):isPlainObject(exception)||isEvent(exception)?(event=function(exception,syntheticException,rejection){var event={exception:{values:[{type:isEvent(exception)?exception.constructor.name:rejection?"UnhandledRejection":"Error",value:"Non-Error "+(rejection?"promise rejection":"exception")+" captured with keys: "+extractExceptionKeysForMessage(exception)}]},extra:{__serialized__:normalizeToSize(exception)}};if(syntheticException){var frames_1=prepareFramesForEvent(computeStackTrace(syntheticException).stack);event.stacktrace={frames:frames_1}}return event}(exception,syntheticException,options.rejection),addExceptionMechanism(event,{synthetic:!0}),event):(addExceptionTypeValue(event=eventFromString(exception,syntheticException,options),""+exception,void 0),addExceptionMechanism(event,{synthetic:!0}),event)}function eventFromString(input,syntheticException,options){void 0===options&&(options={});var event={message:input};if(options.attachStacktrace&&syntheticException){var frames_1=prepareFramesForEvent(computeStackTrace(syntheticException).stack);event.stacktrace={frames:frames_1}}return event}var cachedFetchImpl,global$7=getGlobalObject();function getNativeFetchImplementation(){var _a,_b;if(cachedFetchImpl)return cachedFetchImpl;if(isNativeFetch(global$7.fetch))return cachedFetchImpl=global$7.fetch.bind(global$7);var document=global$7.document,fetchImpl=global$7.fetch;if("function"==typeof(null===(_a=document)||void 0===_a?void 0:_a.createElement))try{var sandbox=document.createElement("iframe");sandbox.hidden=!0,document.head.appendChild(sandbox),(null===(_b=sandbox.contentWindow)||void 0===_b?void 0:_b.fetch)&&(fetchImpl=sandbox.contentWindow.fetch),document.head.removeChild(sandbox)}catch(e){logger$1.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}
892return cachedFetchImpl=fetchImpl.bind(global$7)}function sendReport(url,body){if("[object Navigator]"===Object.prototype.toString.call(global$7&&global$7.navigator)&&"function"==typeof global$7.navigator.sendBeacon)return global$7.navigator.sendBeacon.bind(global$7.navigator)(url,body);if(supportsFetch()){var fetch_1=getNativeFetchImplementation();fetch_1(url,{body:body,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}var CATEGORY_MAPPING={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},global$6=getGlobalObject(),BaseTransport=function(){function BaseTransport(options){var _this=this;this.options=options,this._buffer=new PromiseBuffer(30),this._rateLimits={},this._outcomes={},this._api=new API(options.dsn,options._metadata,options.tunnel),this.url=this._api.getStoreEndpointWithUrlEncodedAuth(),this.options.sendClientReports&&global$6.document&&global$6.document.addEventListener("visibilitychange",(function(){"hidden"===global$6.document.visibilityState&&_this._flushOutcomes()}))}return BaseTransport.prototype.sendEvent=function(_){throw new SentryError("Transport Class has to implement `sendEvent` method")},BaseTransport.prototype.close=function(timeout){return this._buffer.drain(timeout)},BaseTransport.prototype.recordLostEvent=function(reason,category){var _a;if(this.options.sendClientReports){var key=CATEGORY_MAPPING[category]+":"+reason;logger$1.log("Adding outcome: "+key),this._outcomes[key]=(null!=(_a=this._outcomes[key])?_a:0)+1}},BaseTransport.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var outcomes=this._outcomes;if(this._outcomes={},Object.keys(outcomes).length){logger$1.log("Flushing outcomes:\n"+JSON.stringify(outcomes,null,2));var url=this._api.getEnvelopeEndpointWithUrlEncodedAuth(),envelopeHeader=JSON.stringify(__assign$4({},this.options.tunnel&&{dsn:this._api.getDsn().toString()})),itemHeaders=JSON.stringify({type:"client_report"}),item=JSON.stringify({timestamp:dateTimestampInSeconds(),discarded_events:Object.keys(outcomes).map((function(key){var _a=__read$5(key.split(":"),2),category=_a[0];return{reason:_a[1],category:category,quantity:outcomes[key]}}))}),envelope=envelopeHeader+"\n"+itemHeaders+"\n"+item;try{sendReport(url,envelope)}catch(e){logger$1.error(e)}}else logger$1.log("No outcomes to flush")}},BaseTransport.prototype._handleResponse=function(_a){var requestType=_a.requestType,response=_a.response,headers=_a.headers,resolve=_a.resolve,reject=_a.reject,status=Status.fromHttpCode(response.status);this._handleRateLimit(headers)&&logger$1.warn("Too many "+requestType+" requests, backing off until: "+this._disabledUntil(requestType)),status!==Status.Success?reject(response):resolve({status:status})},BaseTransport.prototype._disabledUntil=function(requestType){var category=CATEGORY_MAPPING[requestType];return this._rateLimits[category]||this._rateLimits.all},BaseTransport.prototype._isRateLimited=function(requestType){return this._disabledUntil(requestType)>new Date(Date.now())},BaseTransport.prototype._handleRateLimit=function(headers){var e_1,_a,e_2,_b,now=Date.now(),rlHeader=headers["x-sentry-rate-limits"],raHeader=headers["retry-after"];if(rlHeader){try{for(var _c=__values$3(rlHeader.trim().split(",")),_d=_c.next();!_d.done;_d=_c.next()){var parameters=_d.value.split(":",2),headerDelay=parseInt(parameters[0],10),delay=1e3*(isNaN(headerDelay)?60:headerDelay);try{for(var _e=(e_2=void 0,__values$3(parameters[1].split(";"))),_f=_e.next();!_f.done;_f=_e.next()){var category=_f.value;this._rateLimits[category||"all"]=new Date(now+delay)}}catch(e_2_1){e_2={error:e_2_1}}finally{try{_f&&!_f.done&&(_b=_e.return)&&_b.call(_e)}finally{if(e_2)throw e_2.error}}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{_d&&!_d.done&&(_a=_c.return)&&_a.call(_c)}finally{if(e_1)throw e_1.error}}return!0}return!!raHeader&&(this._rateLimits.all=new Date(now+function(now,header){if(!header)return 6e4;var headerDelay=parseInt(""+header,10);if(!isNaN(headerDelay))return 1e3*headerDelay;var headerDate=Date.parse(""+header);return isNaN(headerDate)?6e4:headerDate-now}(now,raHeader)),!0)},BaseTransport}(),FetchTransport=function(_super){function FetchTransport(options,fetchImpl){void 0===fetchImpl&&(fetch
892Impl=getNativeFetchImplementation());var _this=_super.call(this,options)||this;return _this._fetch=fetchImpl,_this}return __extends$2(FetchTransport,_super),FetchTransport.prototype.sendEvent=function(event){return this._sendRequest(eventToSentryRequest(event,this._api),event)},FetchTransport.prototype.sendSession=function(session){return this._sendRequest(sessionToSentryRequest(session,this._api),session)},FetchTransport.prototype._sendRequest=function(sentryRequest,originalPayload){var _this=this;if(this._isRateLimited(sentryRequest.type))return this.recordLostEvent(Outcome.RateLimitBackoff,sentryRequest.type),Promise.reject({event:originalPayload,type:sentryRequest.type,reason:"Transport for "+sentryRequest.type+" requests locked till "+this._disabledUntil(sentryRequest.type)+" due to too many requests.",status:429});var options={body:sentryRequest.body,method:"POST",referrerPolicy:supportsReferrerPolicy()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(options,this.options.fetchParameters),void 0!==this.options.headers&&(options.headers=this.options.headers),this._buffer.add((function(){return new SyncPromise((function(resolve,reject){_this._fetch(sentryRequest.url,options).then((function(response){var headers={"x-sentry-rate-limits":response.headers.get("X-Sentry-Rate-Limits"),"retry-after":response.headers.get("Retry-After")};_this._handleResponse({requestType:sentryRequest.type,response:response,headers:headers,resolve:resolve,reject:reject})})).catch(reject)}))})).then(void 0,(function(reason){throw reason instanceof SentryError?_this.recordLostEvent(Outcome.QueueOverflow,sentryRequest.type):_this.recordLostEvent(Outcome.NetworkError,sentryRequest.type),reason}))},FetchTransport}(BaseTransport),XHRTransport=function(_super){function XHRTransport(){return null!==_super&&_super.apply(this,arguments)||this}return __extends$2(XHRTransport,_super),XHRTransport.prototype.sendEvent=function(event){return this._sendRequest(eventToSentryRequest(event,this._api),event)},XHRTransport.prototype.sendSession=function(session){return this._sendRequest(sessionToSentryRequest(session,this._api),session)},XHRTransport.prototype._sendRequest=function(sentryRequest,originalPayload){var _this=this;return this._isRateLimited(sentryRequest.type)?(this.recordLostEvent(Outcome.RateLimitBackoff,sentryRequest.type),Promise.reject({event:originalPayload,type:sentryRequest.type,reason:"Transport for "+sentryRequest.type+" requests locked till "+this._disabledUntil(sentryRequest.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new SyncPromise((function(resolve,reject){var request=new XMLHttpRequest;for(var header in request.onreadystatechange=function(){if(4===request.readyState){var headers={"x-sentry-rate-limits":request.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":request.getResponseHeader("Retry-After")};_this._handleResponse({requestType:sentryRequest.type,response:request,headers:headers,resolve:resolve,reject:reject})}},request.open("POST",sentryRequest.url),_this.options.headers)Object.prototype.hasOwnProperty.call(_this.options.headers,header)&&request.setRequestHeader(header,_this.options.headers[header]);request.send(sentryRequest.body)}))})).then(void 0,(function(reason){throw reason instanceof SentryError?_this.recordLostEvent(Outcome.QueueOverflow,sentryRequest.type):_this.recordLostEvent(Outcome.NetworkError,sentryRequest.type),reason}))},XHRTransport}(BaseTransport),BrowserBackend=function(_super){function BrowserBackend(){return null!==_super&&_super.apply(this,arguments)||this}return __extends$2(BrowserBackend,_super),BrowserBackend.prototype.eventFromException=function(exception,hint){return function(options,exception,hint){var event=eventFromUnknownInput(exception,hint&&hint.syntheticException||void 0,{attachStacktrace:options.attachStacktrace});return addExceptionMechanism(event),event.level=Severity.Error,hint&&hint.event_id&&(event.event_id=hint.event_id),SyncPromise.resolve(event)}(this._options,exception,hint)},BrowserBackend.prototype.eventFromMessage=function(message,level,hint){return void 0===level&&(level=Severity.Info),function(options,message,level,hint){void 0===level&&(level=Severity.Info);var event=eventFromString(message,hint&&hint.syntheticException||void 0,{attachStacktrace:options.attachStacktrace});return event.level=level,hint&&hint.event_id&&(event.event_id=hint.event_id),SyncPromise.resolve(event)}(this._options,message,level,hint)},BrowserBackend.prototype._setupTransport=function(){if(!this._options.dsn)return _super.prototype._setupTransport.call(this);var transportOptions=__assign$4(__assign$4({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(transportOptions):supportsFetch()?new FetchTransport(transportOptions):new XHRTransport(transportOptions)},BrowserBackend}(BaseBackend),global$5=getGlobalObject(),ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError+=1,setTimeout((function(){ignoreOnError-=1}))}function wrap(fn,options,before){if(void 0===options&&(options={}),"function"!=typeof fn)return fn;try{if(fn.__sentry__)return fn;if(fn.__sentry_wrapped__)return fn.__sentry_wrapped__}catch(e){return fn}var sentryWrapped=function(){var args=Array.prototype.slice.call(arguments);try{before&&"function"==typeof before&&before.apply(this,arguments);var wrappedArguments=args.map((function(arg){return wrap(arg,options)}));return fn.handleEvent?fn.handleEvent.apply(this,wrappedArguments):fn.apply(this,wrappedArguments)}catch(ex){throw ignoreNextOnError(),withScope((function(scope){scope.addEventProcessor((function(event){var processedEvent=__assign$4({},event);return options.mechanism&&(addExceptionTypeValue(processedEvent,void 0,void 0),addExceptionMechanism(processedEvent,o
892ptions.mechanism)),processedEvent.extra=__assign$4(__assign$4({},processedEvent.extra),{arguments:args}),processedEvent})),captureException(ex)})),ex}};try{for(var property in fn)Object.prototype.hasOwnProperty.call(fn,property)&&(sentryWrapped[property]=fn[property])}catch(_oO){}fn.prototype=fn.prototype||{},sentryWrapped.prototype=fn.prototype,Object.defineProperty(fn,"__sentry_wrapped__",{enumerable:!1,value:sentryWrapped}),Object.defineProperties(sentryWrapped,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:fn}});try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:function(){return fn.name}})}catch(_oO){}return sentryWrapped}var GlobalHandlers=function(){function GlobalHandlers(options){this.name=GlobalHandlers.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=__assign$4({onerror:!0,onunhandledrejection:!0},options)}return GlobalHandlers.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(logger$1.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(logger$1.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},GlobalHandlers.prototype._installGlobalOnErrorHandler=function(){var _this=this;
892this._onErrorHandlerInstalled||(addInstrumentationHandler({callback:function(data){var error=data.error,currentHub=getCurrentHub(),hasIntegration=currentHub.getIntegration(GlobalHandlers),isFailedOwnDelivery=error&&!0===error.__sentry_own_request__;if(hasIntegration&&!shouldIgnoreOnError()&&!isFailedOwnDelivery){var client=currentHub.getClient(),event=void 0===error&&isString(data.msg)?_this._eventFromIncompleteOnError(data.msg,data.url,data.line,data.column):_this._enhanceEventWithInitialFrame(eventFromUnknownInput(error||data.msg,void 0,{attachStacktrace:client&&client.getOptions().attachStacktrace,rejection:!1}),data.url,data.line,data.column);addExceptionMechanism(event,{handled:!1,type:"onerror"}),currentHub.captureEvent(event,{originalException:error})}},type:"error"}),this._onErrorHandlerInstalled=!0)},GlobalHandlers.prototype._installGlobalOnUnhandledRejectionHandler=function(){var _this=this;this._onUnhandledRejectionHandlerInstalled||(addInstrumentationHandler({callback:function(e){var error=e;try{"reason"in e?error=e.reason:"detail"in e&&"reason"in e.detail&&(error=e.detail.reason)}catch(_oO){}var currentHub=getCurrentHub(),hasIntegration=currentHub.getIntegration(GlobalHandlers),isFailedOwnDelivery=error&&!0===error.__sentry_own_request__;if(!hasIntegration||shouldIgnoreOnError()||isFailedOwnDelivery)return!0;var client=currentHub.getClient(),event=isPrimitive(error)?_this._eventFromRejectionWithPrimitive(error):eventFromUnknownInput(error,void 0,{attachStacktrace:client&&client.getOptions().attachStacktrace,rejection:!0});event.level=Severity.Error,addExceptionMechanism(event,{handled:!1,type:"onunhandledrejection"}),currentHub.captureEvent(event,{originalException:error})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},GlobalHandlers.prototype._eventFromIncompleteOnError=function(msg,url,line,column){var name,message=isErrorEvent(msg)?msg.message:msg,groups=message.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);groups&&(name=groups[1],message=groups[2]);var event={exception:{values:[{type:name||"Error",value:message}]}};return this._enhanceEventWithInitialFrame(event,url,line,column)},GlobalHandlers.prototype._eventFromRejectionWithPrimitive=function(reason){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(reason)}]}}},GlobalHandlers.prototype._enhanceEventWithInitialFrame=function(event,url,line,column){event.exception=event.exception||{},event.exception.values=event.exception.values||[],event.exception.values[0]=event.exception.values[0]||{},event.exception.values[0].stacktrace=event.exception.values[0].stacktrace||{},event.exception.values[0].stacktrace.frames=event.exception.values[0].stacktrace.frames||[];var colno=isNaN(parseInt(column,10))?void 0:column,lineno=isNaN(parseInt(line,10))?void 0:line,filename=isString(url)&&url.length>0?url:function(){var global=getGlobalObject();try{return global.document.location.href}catch(oO){return""}}();return 0===event.exception.values[0].stacktrace.frames.length&&event.exception.values[0].stacktrace.frames.push({colno:colno,filename:filename,function:"?",in_app:!0,lineno:lineno}),event},GlobalHandlers.id="GlobalHandlers",GlobalHandlers}(),DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],TryCatch=function(){function TryCatch(options){this.name=TryCatch.id,this._options=__assign$4({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},options)}return TryCatch.prototype.setupOnce=function(){var global=getGlobalObject();(this._options.setTimeout&&fill(global,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&fill(global,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&fill(global,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in global&&fill(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:DEFAULT_EVENT_TARGET).forEach(this._wrapEventTarget.bind(this))},TryCatch.prototype._wrapTimeFunction=function(original){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var originalCallback=args[0];return args[0]=wrap(originalCallback,{mechanism:{data:{function:getFunctionName(original)},handled:!0,type:"instrument"}}),original.apply(this,args)}},TryCatch.prototype._wrapRAF=function(original){return function(callback){return original.call(this,wrap(callback,{mechanism:{data:{function:"requestAnimationFrame",handler:getFunctionName(original)},handled:!0,type:"instrument"}}))}},TryCatch.prototype._wrapEventTarget=function(target){var global=getGlobalObject(),proto=global[target]&&global[target].prototype;proto&&proto.hasOwnProperty&&proto.hasOwnProperty("addEventListener")&&(fill(proto,"addEventListener",(function(original){return function(eventName,fn,options){try{"function"==typeof fn.handleEvent&&(fn.handleEvent=wrap(fn.handleEvent.bind(fn),{mechanism:{data:{function:"handleEvent",handler:getFunctionName(fn),target:target},handled:!0,type:"instrument"}}))}catch(err){}return original.call(this,eventName,wrap(fn,{mechanism:{data:{function:"addEventListener",handler:getFunctionName(fn),target:target},handled:!0,type:"instrument"}}),options)}})),fill(proto,"removeEventListener",(function(originalRemoveEventListener){return function(eventName,fn,options){var _a,wrappedEventHandler=fn;try{var originalEventHandler=null===(_a=wrappedEventHandler)||void 0===_a?void 0:_a.__sentry_wrapped__;originalEventHandler&&originalRemoveEventListener.call(this,eventName,originalEventHandler,options)}catch(e){}return originalRemoveEventListener.call(this,eventName,wrappedEventHandler,options)}})))},TryCatch.prototype._wrapXHR=function(originalSend){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var xhr=this,xmlHttpRequestProps=["onload","onerror","onprogress","onreadystatechange"];return xmlHttpRequestProps.forEach((function(prop){prop in xhr&&"function"==typeof xhr[prop]&&fill(xhr,prop,(function(original){var wrapOptions={mechanism:{data:{function:prop,handler:getFunctionName(original)},handled:!0,type:"instrument"}};return original.__sentry_original__&&(wrapOptions.mechanism.data.handler=getFunctionName(original.__sentry_original__)),wrap(original,wrapOptions)}))})),originalSend.apply(this,args)}},TryCatch.id="TryCatch",TryCatch}(),Breadcrumbs=function(){function Breadcrumbs(options){this.name=Breadcrumbs.id,this._options=__assign$4({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},options)}return Breadcrumbs.prototype.addSentryBreadcrumb=function(event){this._options.sentry&&getCurrentHub().addBreadcrumb({category:"sentry."+("transaction"===event.type?"transaction":"event"),event_id:event.event_id,level:event.level,message:getEventDescription(event)},{event:event})},Breadcrumbs.prototype.setupOnce=function(){var _this=this;this._options.console&&addInstrumentationHandler({callback:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];_this._consoleBreadcrumb.apply(_this,__spread$4(args))},type:"console"}),this._options.dom&&addInstrumentationHandler({callback:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];_this._domBreadcrumb.apply(_this,__spread$4(args))},type:"dom"}),this._options.xhr&&addInstrumentationHandler({callback:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];_this._xhrBreadcrumb.apply(_this,__spread$4(args))},type:"xhr"}),this._options.fetch&&addInstrumentationHandler({callback:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];_this._fetchBreadcrumb.apply(_this,__spread$4(args))},type:"fetch"}),this._options.history&&addInstrumentationHandler({callback:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];_this._historyBreadcrumb.apply(_this,__spread$4(args))},type:"history"})},Breadcrumbs.prototype._consoleBreadcrumb=function(handlerData){var breadcrumb={category:"console",data:{arguments:handlerData.args,logger:"console"},level:Severity.fromString(handlerData.level),message:safeJoin(handlerData.args," ")};if("assert"===handlerData.level){if(!1!==handlerData.args[0])return;breadcrumb.message="Assertion failed: "+(safeJoin(handlerData.args.slice(1)," ")||"console.assert"),breadcrumb.data.arguments=handlerData.args.slice(1)}
892getCurrentHub().addBreadcrumb(breadcrumb,{input:handlerData.args,level:handlerData.level})},Breadcrumbs.prototype._domBreadcrumb=function(handlerData){var target,keyAttrs="object"==typeof this._options.dom?this._options.dom.serializeAttribute:void 0;"string"==typeof keyAttrs&&(keyAttrs=[keyAttrs]);try{target=handlerData.event.target?htmlTreeAsString(handlerData.event.target,keyAttrs):htmlTreeAsString(handlerData.event,keyAttrs)}catch(e){target="<unknown>"}0!==target.length&&getCurrentHub().addBreadcrumb({category:"ui."+handlerData.name,message:target},{event:handlerData.event,name:handlerData.name,global:handlerData.global})},Breadcrumbs.prototype._xhrBreadcrumb=function(handlerData){if(handlerData.endTimestamp){if(handlerData.xhr.__sentry_own_request__)return;var _a=handlerData.xhr.__sentry_xhr__||{},method=_a.method,url=_a.url,status_code=_a.status_code,body=_a.body;getCurrentHub().addBreadcrumb({category:"xhr",data:{method:method,url:url,status_code:status_code},type:"http"},{xhr:handlerData.xhr,input:body})}else;},Breadcrumbs.prototype._fetchBreadcrumb=function(handlerData){handlerData.endTimestamp&&(handlerData.fetchData.url.match(/sentry_key/)&&"POST"===handlerData.fetchData.method||(handlerData.error?getCurrentHub().addBreadcrumb({category:"fetch",data:handlerData.fetchData,level:Severity.Error,type:"http"},{data:handlerData.error,input:handlerData.args}):getCurrentHub().addBreadcrumb({category:"fetch",data:__assign$4(__assign$4({},handlerData.fetchData),{status_code:handlerData.response.status}),type:"http"},{input:handlerData.args,response:handlerData.response})))},Breadcrumbs.prototype._historyBreadcrumb=function(handlerData){var global=getGlobalObject(),from=handlerData.from,to=handlerData.to,parsedLoc=parseUrl(global.location.href),parsedFrom=parseUrl(from),parsedTo=parseUrl(to);parsedFrom.path||(parsedFrom=parsedLoc),parsedLoc.protocol===parsedTo.protocol&&parsedLoc.host===parsedTo.host&&(to=parsedTo.relative),parsedLoc.protocol===parsedFrom.protocol&&parsedLoc.host===parsedFrom.host&&(from=parsedFrom.relative),getCurrentHub().addBreadcrumb({category:"navigation",data:{from:from,to:to}})},Breadcrumbs.id="Breadcrumbs",Breadcrumbs}(),LinkedErrors=function(){function LinkedErrors(options){void 0===options&&(options={}),this.name=LinkedErrors.id,this._key=options.key||"cause",this._limit=options.limit||5}return LinkedErrors.prototype.setupOnce=function(){addGlobalEventProcessor((function(event,hint){var self=getCurrentHub().getIntegration(LinkedErrors);if(self){var handler=self._handler&&self._handler.bind(self);return"function"==typeof handler?handler(event,hint):event}return event}))},LinkedErrors.prototype._handler=function(event,hint){if(!(event.exception&&event.exception.values&&hint&&isInstanceOf(hint.originalException,Error)))return event;var linkedErrors=this._walkErrorTree(hint.originalException,this._key);return event.exception.values=__spread$4(linkedErrors,event.exception.values),event},LinkedErrors.prototype._walkErrorTree=function(error,key,stack){if(void 0===stack&&(stack=[]),!isInstanceOf(error[key],Error)||stack.length+1>=this._limit)return stack;var exception=exceptionFromStacktrace(computeStackTrace(error[key]));return this._walkErrorTree(error[key],key,__spread$4([exception],stack))},LinkedErrors.id="LinkedErrors",LinkedErrors}(),global$4=getGlobalObject(),UserAgent=function(){function UserAgent(){this.name=UserAgent.id}return UserAgent.prototype.setupOnce=function(){addGlobalEventProcessor((function(event){var _a,_b,_c;if(getCurrentHub().getIntegration(UserAgent)){if(!global$4.navigator&&!global$4.location&&!global$4.document)return event;var url=(null===(_a=event.request)||void 0===_a?void 0:_a.url)||(null===(_b=global$4.location)||void 0===_b?void 0:_b.href),referrer=(global$4.document||{}).referrer,userAgent=(global$4.navigator||{}).userAgent,headers=__assign$4(__assign$4(__assign$4({},null===(_c=event.request)||void 0===_c?void 0:_c.headers),referrer&&{Referer:referrer}),userAgent&&{"User-Agent":userAgent}),request=__assign$4(__assign$4({},url&&{url:url}),{headers:headers});return __assign$4(__assign$4({},event),{request:request})}return event}))},UserAgent.id="UserAgent",UserAgent}(),Dedupe=function(){function Dedupe(){this.name=Dedupe.id}return Dedupe.prototype.setupOnce=function(addGlobalEventProcessor,getCurrentHub){addGlobalEventProcessor((function(currentEvent){var self=getCurrentHub().getIntegration(Dedupe);if(self){try{if(self._shouldDropEvent(currentEvent,self._previousEvent))return logger$1.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(_oO){return self._previousEvent=currentEvent}return self._previousEvent=currentEvent}return currentEvent}))},Dedupe.prototype._shouldDropEvent=function(currentEvent,previousEvent){return!!previousEvent&&(!!this._isSameMessageEvent(currentEvent,previousEvent)||!!this._isSameExceptionEvent(currentEvent,previousEvent))},Dedupe.prototype._isSameMessageEvent=function(currentEvent,previousEvent){var currentMessage=currentEvent.message,previousMessage=previousEvent.message;return!(!currentMessage&&!previousMessage)&&(!(currentMessage&&!previousMessage||!currentMessage&&previousMessage)&&(currentMessage===previousMessage&&(!!this._isSameFingerprint(currentEvent,previousEvent)&&!!this._isSameStacktrace(currentEvent,previousEvent))))},Dedupe.prototype._getFramesFromEvent=function(event){var exception=event.exception;if(exception)try{return exception.values[0].stacktrace.frames}catch(_oO){return}else if(event.stacktrace)return event.stacktrace.frames},Dedupe.prototype._isSameStacktrace=function(currentEvent,previousEvent){var currentFrames=this._getFramesFromEvent(currentEvent),previousFrames=this._getFramesFromEvent(previousEvent);if(!currentFrames&&!previousFrames)return!0;
892if(currentFrames&&!previousFrames||!currentFrames&&previousFrames)return!1;if(currentFrames=currentFrames,(previousFrames=previousFrames).length!==currentFrames.length)return!1;for(var i=0;i<previousFrames.length;i++){var frameA=previousFrames[i],frameB=currentFrames[i];if(frameA.filename!==frameB.filename||frameA.lineno!==frameB.lineno||frameA.colno!==frameB.colno||frameA.function!==frameB.function)return!1}return!0},Dedupe.prototype._getExceptionFromEvent=function(event){return event.exception&&event.exception.values&&event.exception.values[0]},Dedupe.prototype._isSameExceptionEvent=function(currentEvent,previousEvent){var previousException=this._getExceptionFromEvent(previousEvent),currentException=this._getExceptionFromEvent(currentEvent);return!(!previousException||!currentException)&&(previousException.type===currentException.type&&previousException.value===currentException.value&&(!!this._isSameFingerprint(currentEvent,previousEvent)&&!!this._isSameStacktrace(currentEvent,previousEvent)))},Dedupe.prototype._isSameFingerprint=function(currentEvent,previousEvent){var currentFingerprint=currentEvent.fingerprint,previousFingerprint=previousEvent.fingerprint;if(!currentFingerprint&&!previousFingerprint)return!0;if(currentFingerprint&&!previousFingerprint||!currentFingerprint&&previousFingerprint)return!1;currentFingerprint=currentFingerprint,previousFingerprint=previousFingerprint;try{return!(currentFingerprint.join("")!==previousFingerprint.join(""))}catch(_oO){return!1}},Dedupe.id="Dedupe",Dedupe}(),BrowserClient=function(_super){function BrowserClient(options){void 0===options&&(options={});return options._metadata=options._metadata||{},options._metadata.sdk=options._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"6.16.1"}],version:"6.16.1"},_super.call(this,BrowserBackend,options)||this}return __extends$2(BrowserClient,_super),BrowserClient.prototype.showReportDialog=function(options){void 0===options&&(options={}),getGlobalObject().document&&(this._isEnabled()?function(options){if(void 0===options&&(options={}),global$5.document)if(options.eventId)if(options.dsn){var script=global$5.document.createElement("script");script.async=!0,script.src=new API(options.dsn).getReportDialogEndpoint(options),options.onLoad&&(script.onload=options.onLoad);var injectionPoint=global$5.document.head||global$5.document.body;injectionPoint&&injectionPoint.appendChild(script)}else logger$1.error("Missing dsn option in showReportDialog call");else logger$1.error("Missing eventId option in showReportDialog call")}(__assign$4(__assign$4({},options),{dsn:options.dsn||this.getDsn()})):logger$1.error("Trying to call showReportDialog with Sentry Client disabled"))},BrowserClient.prototype._prepareEvent=function(event,scope,hint){return event.platform=event.platform||"javascript",_super.prototype._prepareEvent.call(this,event,scope,hint)},BrowserClient.prototype._sendEvent=function(event){var integration=this.getIntegration(Breadcrumbs);integration&&integration.addSentryBreadcrumb(event),_super.prototype._sendEvent.call(this,event)},BrowserClient}(BaseClient),defaultIntegrations=[new InboundFilters,new FunctionToString,new TryCatch,new Breadcrumbs,new GlobalHandlers,new LinkedErrors,new Dedupe,new UserAgent];
893/*! *****************************************************************************
894	Copyright (c) Microsoft Corporation.
895
896	Permission to use, copy, modify, and/or distribute this software for any
897	purpose with or without fee is hereby granted.
898
899	THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
900	REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
901	AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
902	INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
903	LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
904	OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
905	PERFORMANCE OF THIS SOFTWARE.
906	***************************************************************************** */
907var extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var SpanStatus,__assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)};function __read(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read(arguments[i]));return ar}!function(SpanStatus){SpanStatus.Ok="ok",SpanStatus.DeadlineExceeded="deadline_exceeded",SpanStatus.Unauthenticated="unauthenticated",SpanStatus.PermissionDenied="permission_denied",SpanStatus.NotFound="not_found",SpanStatus.ResourceExhausted="resource_exhausted",SpanStatus.InvalidArgument="invalid_argument",SpanStatus.Unimplemented="unimplemented",SpanStatus.Unavailable="unavailable",SpanStatus.InternalError="internal_error",SpanStatus.UnknownError="unknown_error",SpanStatus.Cancelled="cancelled",SpanStatus.AlreadyExists="already_exists",SpanStatus.FailedPrecondition="failed_precondition",SpanStatus.Aborted="aborted",SpanStatus.OutOfRange="out_of_range",SpanStatus.DataLoss="data_loss"}(SpanStatus||(SpanStatus={})),function(SpanStatus){SpanStatus.fromHttpCode=function(httpStatus){if(httpStatus<400&&httpStatus>=100)return SpanStatus.Ok;if(httpStatus>=400&&httpStatus<500)switch(httpStatus){case 401:return SpanStatus.Unauthenticated;case 403:return SpanStatus.PermissionDenied;case 404:return SpanStatus.NotFound;case 409:return SpanStatus.AlreadyExists;case 413:return SpanStatus.FailedPrecondition;case 429:return SpanStatus.ResourceExhausted;default:return SpanStatus.InvalidArgument}if(httpStatus>=500&&httpStatus<600)switch(httpStatus){case 501:return SpanStatus.Unimplemented;case 503:return SpanStatus.Unavailable;case 504:return SpanStatus.DeadlineExceeded;default:return SpanStatus.InternalError}return SpanStatus.UnknownError}}(SpanStatus||(SpanStatus={}));var TRACEPARENT_REGEXP=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function hasTracingEnabled(options){var _a;return void 0===options&&(options=null===(_a=getCurrentHub().getClient())||void 0===_a?void 0:_a.getOptions()),!!options&&("tracesSampleRate"in options||"tracesSampler"in options)}function getActiveTransaction(hub){var _a,_b;return void 0===hub&&(hub=getCurrentHub()),null===(_b=null===(_a=hub)||void 0===_a?void 0:_a.getScope())||void 0===_b?void 0:_b.getTransaction()}function msToSec(time){return time/1e3}function errorCallback(){var activeTransaction=getActiveTransaction();activeTransaction&&(logger$1.log("[Tracing] Transaction: "+SpanStatus.InternalError+" -> Global error occured"),activeTransaction.setStatus(SpanStatus.InternalError))}var IDLE_TRANSACTION_FINISH_REASONS=["heartbeatFailed","idleTimeout","documentHidden"],SpanRecorder=function(){function SpanRecorder(maxlen){void 0===maxlen&&(maxlen=1e3),this.spans=[],this._maxlen=maxlen}return SpanRecorder.prototype.add=function(span){this.spans.length>this._maxlen?span.spanRecorder=void 0:this.spans.push(span)},SpanRecorder}(),Span=function(){function Span(spanContext){if(this.traceId=uuid4(),this.spanId=uuid4().substring(16),this.startTimestamp=timestampWithMs(),this.tags={},this.data={},!spanContext)return this;spanContext.traceId&&(this.traceId=spanContext.traceId),spanContext.spanId&&(this.spanId=spanContext.spanId),spanContext.parentSpanId&&(this.parentSpanId=spanContext.parentSpanId),"sampled"in spanContext&&(this.sampled=spanContext.sampled),spanContext.op&&(this.op=spanContext.op),spanContext.description&&(this.description=spanContext.description),spanContext.data&&(this.data=spanContext.data),spanContext.tags&&(this.tags=spanContext.tags),spanContext.status&&(this.status=spanContext.status),spanContext.startTimestamp&&(this.startTimestamp=spanContext.startTimestamp),spanContext.endTimestamp&&(this.endTimestamp=spanContext.endTimestamp)}return Span.prototype.child=function(spanContext){return this.startChild(spanContext)},Span.prototype.startChild=function(spanContext){var childSpan=new Span(__assign(__assign({},spanContext),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));return childSpan.spanRecorder=this.spanRecorder,childSpan.spanRecorder&&childSpan.spanRecorder.add(childSpan),childSpan.transaction=this.transaction,childSpan},Span.prototype.setTag=function(key,value){var _a;return this.tags=__assign(__assign({},this.tags),((_a={})[key]=value,_a)),this},Span.prototype.setData=function(key,value){var _a;return this.data=__assign(__assign({},this.data),((_a={})[key]=value,_a)),this},Span.prototype.setStatus=function(value){return this.status=value,this},Span.prototype.setHttpStatus=function(httpStatus){this.setTag("http.status_code",String(httpStatus));var spanStatus=SpanStatus.fromHttpCode(httpStatus);return spanStatus!==SpanStatus.UnknownError&&this.setStatus(spanStatus),this},Span.prototype.isSuccess=function(){return this.status===SpanStatus.Ok}
907,Span.prototype.finish=function(endTimestamp){this.endTimestamp="number"==typeof endTimestamp?endTimestamp:timestampWithMs()},Span.prototype.toTraceparent=function(){var sampledString="";return void 0!==this.sampled&&(sampledString=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+sampledString},Span.prototype.toContext=function(){return dropUndefinedKeys({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},Span.prototype.updateWithContext=function(spanContext){var _a,_b,_c,_d,_e;return this.data=null!=(_a=spanContext.data)?_a:{},this.description=spanContext.description,this.endTimestamp=spanContext.endTimestamp,this.op=spanContext.op,this.parentSpanId=spanContext.parentSpanId,this.sampled=spanContext.sampled,this.spanId=null!=(_b=spanContext.spanId)?_b:this.spanId,this.startTimestamp=null!=(_c=spanContext.startTimestamp)?_c:this.startTimestamp,this.status=spanContext.status,this.tags=null!=(_d=spanContext.tags)?_d:{},this.traceId=null!=(_e=spanContext.traceId)?_e:this.traceId,this},Span.prototype.getTraceContext=function(){return dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},Span.prototype.toJSON=function(){return dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},Span}(),Transaction=function(_super){function Transaction(transactionContext,hub){var _this=_super.call(this,transactionContext)||this;return _this._measurements={},_this._hub=getCurrentHub(),isInstanceOf(hub,Hub)&&(_this._hub=hub),_this.name=transactionContext.name||"",_this.metadata=transactionContext.metadata||{},_this._trimEnd=transactionContext.trimEnd,_this.transaction=_this,_this}return __extends(Transaction,_super),Transaction.prototype.setName=function(name){this.name=name},Transaction.prototype.initSpanRecorder=function(maxlen){void 0===maxlen&&(maxlen=1e3),this.spanRecorder||(this.spanRecorder=new SpanRecorder(maxlen)),this.spanRecorder.add(this)},Transaction.prototype.setMeasurements=function(measurements){this._measurements=__assign({},measurements)},Transaction.prototype.setMetadata=function(newMetadata){this.metadata=__assign(__assign({},this.metadata),newMetadata)},Transaction.prototype.finish=function(endTimestamp){var _a,_b,_c,_d,_e,_this=this;if(void 0===this.endTimestamp){if(this.name||(logger$1.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),_super.prototype.finish.call(this,endTimestamp),!0!==this.sampled)return logger$1.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(null===(_e=null===(_c=null===(_a=this._hub.getClient())||void 0===_a?void 0:(_b=_a).getTransport)||void 0===_c?void 0:(_d=_c.call(_b)).recordLostEvent)||void 0===_e||_e.call(_d,Outcome.SampleRate,"transaction"));var finishedSpans=this.spanRecorder?this.spanRecorder.spans.filter((function(s){return s!==_this&&s.endTimestamp})):[];this._trimEnd&&finishedSpans.length>0&&(this.endTimestamp=finishedSpans.reduce((function(prev,current){return prev.endTimestamp&&current.endTimestamp?prev.endTimestamp>current.endTimestamp?prev:current:prev})).endTimestamp);var transaction={contexts:{trace:this.getTraceContext()},spans:finishedSpans,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata};return Object.keys(this._measurements).length>0&&(logger$1.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),transaction.measurements=this._measurements),logger$1.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(transaction)}},Transaction.prototype.toContext=function(){var spanContext=_super.prototype.toContext.call(this);return dropUndefinedKeys(__assign(__assign({},spanContext),{name:this.name,trimEnd:this._trimEnd}))},Transaction.prototype.updateWithContext=function(transactionContext){var _a;return _super.prototype.updateWithContext.call(this,transactionContext),this.name=null!=(_a=transactionContext.name)?_a:"",this._trimEnd=transactionContext.trimEnd,this},Transaction}(Span),IdleTransactionSpanRecorder=function(_super){function IdleTransactionSpanRecorder(_pushActivity,_popActivity,transactionSpanId,maxlen){void 0===transactionSpanId&&(transactionSpanId="");
907var _this=_super.call(this,maxlen)||this;return _this._pushActivity=_pushActivity,_this._popActivity=_popActivity,_this.transactionSpanId=transactionSpanId,_this}return __extends(IdleTransactionSpanRecorder,_super),IdleTransactionSpanRecorder.prototype.add=function(span){var _this=this;span.spanId!==this.transactionSpanId&&(span.finish=function(endTimestamp){span.endTimestamp="number"==typeof endTimestamp?endTimestamp:timestampWithMs(),_this._popActivity(span.spanId)},void 0===span.endTimestamp&&this._pushActivity(span.spanId)),_super.prototype.add.call(this,span)},IdleTransactionSpanRecorder}(SpanRecorder),IdleTransaction=function(_super){function IdleTransaction(transactionContext,_idleHub,_idleTimeout,_onScope){void 0===_idleTimeout&&(_idleTimeout=1e3),void 0===_onScope&&(_onScope=!1);var _this=_super.call(this,transactionContext,_idleHub)||this;return _this._idleHub=_idleHub,_this._idleTimeout=_idleTimeout,_this._onScope=_onScope,_this.activities={},_this._heartbeatCounter=0,_this._finished=!1,_this._beforeFinishCallbacks=[],_idleHub&&_onScope&&(clearActiveTransaction(_idleHub),logger$1.log("Setting idle transaction on scope. Span ID: "+_this.spanId),_idleHub.configureScope((function(scope){return scope.setSpan(_this)}))),_this._initTimeout=setTimeout((function(){_this._finished||_this.finish()}),_this._idleTimeout),_this}return __extends(IdleTransaction,_super),IdleTransaction.prototype.finish=function(endTimestamp){var e_1,_a,_this=this;if(void 0===endTimestamp&&(endTimestamp=timestampWithMs()),this._finished=!0,this.activities={},this.spanRecorder){logger$1.log("[Tracing] finishing IdleTransaction",new Date(1e3*endTimestamp).toISOString(),this.op);try{for(var _b=function(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._beforeFinishCallbacks),_c=_b.next();!_c.done;_c=_b.next()){(0,_c.value)(this,endTimestamp)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_1)throw e_1.error}}this.spanRecorder.spans=this.spanRecorder.spans.filter((function(span){if(span.spanId===_this.spanId)return!0;span.endTimestamp||(span.endTimestamp=endTimestamp,span.setStatus(SpanStatus.Cancelled),logger$1.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(span,void 0,2)));var keepSpan=span.startTimestamp<endTimestamp;return keepSpan||logger$1.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(span,void 0,2)),keepSpan})),logger$1.log("[Tracing] flushing IdleTransaction")}else logger$1.log("[Tracing] No active IdleTransaction");return this._onScope&&clearActiveTransaction(this._idleHub),_super.prototype.finish.call(this,endTimestamp)},IdleTransaction.prototype.registerBeforeFinishCallback=function(callback){this._beforeFinishCallbacks.push(callback)},IdleTransaction.prototype.initSpanRecorder=function(maxlen){var _this=this;if(!this.spanRecorder){this.spanRecorder=new IdleTransactionSpanRecorder((function(id){_this._finished||_this._pushActivity(id)}),(function(id){_this._finished||_this._popActivity(id)}),this.spanId,maxlen),logger$1.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)},IdleTransaction.prototype._pushActivity=function(spanId){this._initTimeout&&(clearTimeout(this._initTimeout),this._initTimeout=void 0),logger$1.log("[Tracing] pushActivity: "+spanId),this.activities[spanId]=!0,logger$1.log("[Tracing] new activities count",Object.keys(this.activities).length)},IdleTransaction.prototype._popActivity=function(spanId){var _this=this;if(this.activities[spanId]&&(logger$1.log("[Tracing] popActivity "+spanId),delete this.activities[spanId],logger$1.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){var timeout=this._idleTimeout,end_1=timestampWithMs()+timeout/1e3;setTimeout((function(){_this._finished||(_this.setTag("finishReason",IDLE_TRANSACTION_FINISH_REASONS[1]),_this.finish(end_1))}),timeout)}},IdleTransaction.prototype._beat=function(){if(!this._finished){var heartbeatString=Object.keys(this.activities).join("");heartbeatString===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=heartbeatString,this._heartbeatCounter>=3?(logger$1.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(SpanStatus.DeadlineExceeded),this.setTag("finishReason",IDLE_TRANSACTION_FINISH_REASONS[0]),this.finish()):this._pingHeartbeat()}},IdleTransaction.prototype._pingHeartbeat=function(){var _this=this;logger$1.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),setTimeout((function(){_this._beat()}),5e3)},IdleTransaction}(Transaction);function clearActiveTransaction(hub){if(hub){var scope=hub.getScope();if(scope)scope.getTransaction()&&scope.setSpan(void 0)}}function traceHeaders(){var scope=this.getScope();if(scope){var span=scope.getSpan();if(span)return{"sentry-trace":span.toTraceparent()}}return{}}function sample(transaction,options,samplingContext){return hasTracingEnabled(options)?void 0!==transaction.sampled?(transaction.setMetadata({transactionSampling:{method:TransactionSamplingMethod.Explicit}}),transaction):("function"==typeof options.tracesSampler?(sampleRate=options.tracesSampler(samplingContext),transaction.setMetadata({transactionSampling:{method:TransactionSamplingMethod.Sampler,rate:Number(sampleRate)}})):void 0!==samplingContext.parentSampled?(sampleRate=samplingContext.parentSampled,transaction.setMetadata({transactionSampling:{method:TransactionSamplingMethod.Inheritance}})):(sampleRate=options.tracesSampleRate,transaction.setMetadata({transactionSampling:{method:TransactionSamplingMethod.Rate,rate:Number(sampleRate)}})),function(rate){if(isNaN(rate)||"number"!=typeof rate&&"boolean"!=typeof rate)return logger$1.warn("[Tracing] Given sample rate is invali
907d. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(rate)+" of type "+JSON.stringify(typeof rate)+"."),!1;if(rate<0||rate>1)return logger$1.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+rate+"."),!1;return!0}(sampleRate)?sampleRate?(transaction.sampled=Math.random()<sampleRate,transaction.sampled?(logger$1.log("[Tracing] starting "+transaction.op+" transaction - "+transaction.name),transaction):(logger$1.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(sampleRate)+")"),transaction)):(logger$1.log("[Tracing] Discarding transaction because "+("function"==typeof options.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),transaction.sampled=!1,transaction):(logger$1.warn("[Tracing] Discarding transaction because of invalid sample rate."),transaction.sampled=!1,transaction)):(transaction.sampled=!1,transaction);var sampleRate}function _startTransaction(transactionContext,customSamplingContext){var _a,_b,options=(null===(_a=this.getClient())||void 0===_a?void 0:_a.getOptions())||{},transaction=new Transaction(transactionContext,this);return(transaction=sample(transaction,options,__assign({parentSampled:transactionContext.parentSampled,transactionContext:transactionContext},customSamplingContext))).sampled&&transaction.initSpanRecorder(null===(_b=options._experiments)||void 0===_b?void 0:_b.maxSpans),transaction}function _autoloadDatabaseIntegrations(){var carrier=getMainCarrier();if(carrier.__SENTRY__){var packageToIntegrationMapping={mongodb:function(){return new(dynamicRequire(module,"./integrations/node/mongo").Mongo)},mongoose:function(){return new(dynamicRequire(module,"./integrations/node/mongo").Mongo)({mongoose:!0})},mysql:function(){return new(dynamicRequire(module,"./integrations/node/mysql").Mysql)},pg:function(){return new(dynamicRequire(module,"./integrations/node/postgres").Postgres)}},mappedPackages=Object.keys(packageToIntegrationMapping).filter((function(moduleName){return!!function(moduleName){var mod;try{mod=dynamicRequire(module,moduleName)}catch(e){}try{var cwd=dynamicRequire(module,"process").cwd;mod=dynamicRequire(module,cwd()+"/node_modules/"+moduleName)}catch(e){}return mod}(moduleName)})).map((function(pkg){try{return packageToIntegrationMapping[pkg]()}catch(e){return}})).filter((function(p){return p}));mappedPackages.length>0&&(carrier.__SENTRY__.integrations=__spread(carrier.__SENTRY__.integrations||[],mappedPackages))}}var global$3=getGlobalObject();var bindReporter=function(callback,metric,reportAllChanges){var prevValue;return function(forceReport){metric.value>=0&&(forceReport||reportAllChanges)&&(metric.delta=metric.value-(prevValue||0),(metric.delta||void 0===prevValue)&&(prevValue=metric.value,callback(metric)))}},initMetric=function(name,value){return{name:name,value:null!=value?value:-1,delta:0,entries:[],id:"v2-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12)}},observe=function(type,callback){try{if(PerformanceObserver.supportedEntryTypes.includes(type)){if("first-input"===type&&!("PerformanceEventTiming"in self))return;var po=new PerformanceObserver((function(l){return l.getEntries().map(callback)}));return po.observe({type:type,buffered:!0}),po}}catch(e){}},onHidden=function(cb,once){var onHiddenOrPageHide=function(event){"pagehide"!==event.type&&"hidden"!==getGlobalObject().document.visibilityState||(cb(event),once&&(removeEventListener("visibilitychange",onHiddenOrPageHide,!0),removeEventListener("pagehide",onHiddenOrPageHide,!0)))};addEventListener("visibilitychange",onHiddenOrPageHide,!0),addEventListener("pagehide",onHiddenOrPageHide,!0)},firstHiddenTime=-1,getVisibilityWatcher=function(){return firstHiddenTime<0&&(firstHiddenTime="hidden"===getGlobalObject().document.visibilityState?0:1/0,onHidden((function(_a){var timeStamp=_a.timeStamp;firstHiddenTime=timeStamp}),!0)),{get firstHiddenTime(){return firstHiddenTime}}},reportedMetricIDs={},global$2=getGlobalObject(),MetricsInstrumentation=function(){function MetricsInstrumentation(_reportAllChanges){var _a,_b;void 0===_reportAllChanges&&(_reportAllChanges=!1),this._reportAllChanges=_reportAllChanges,this._measurements={},this._performanceCursor=0,!isNodeEnv()&&(null===(_a=global$2)||void 0===_a?void 0:_a.performance)&&(null===(_b=global$2)||void 0===_b?void 0:_b.document)&&(global$2.performance.mark&&global$2.performance.mark("sentry-tracing-init"),this._trackCLS(),this._trackLCP(),this._trackFID())}return MetricsInstrumentation.prototype.addPerformanceEntries=function(transaction){var _this=this;if(global$2&&global$2.performance&&global$2.performance.getEntries&&browserPerformanceTimeOrigin){logger$1.log("[Tracing] Adding & adjusting spans using Performance API");var entryScriptSrc,entryScriptStartTimestamp,tracingInitMarkStartTime,responseStartTimestamp,requestStartTimestamp,timeOrigin=msToSec(browserPerformanceTimeOrigin);if(global$2.document&&global$2.document.scripts)for(var i=0;i<global$2.document.scripts.length;i++)if("true"===global$2.document.scripts[i].dataset.entry){entryScriptSrc=global$2.document.scripts[i].src;break}if(global$2.performance.getEntries().slice(this._performanceCursor).forEach((function(entry){var startTime=msToSec(entry.startTime),duration=msToSec(entry.duration);if(!("navigation"===transaction.op&&timeOrigin+startTime<transaction.startTimestamp))switch(entry.entryType){case"navigation":!function(transaction,entry,timeOrigin){addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"unloadEvent",timeOrigin:timeOrigin}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"redirect",timeOrigin:timeOrigin}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"domContentLoadedEvent",timeOrigin:timeOrigin}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"loadEvent",timeOrigin:timeOrigin}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"connect",timeOrigin:timeOrigin}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"secureConnection",timeOrigin:timeOrigin,eventEnd:"connectEnd",description:"TLS/SSL"}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"fetch",timeOrigin:timeOrigin,eventEnd:"domainLookupStart",description:"cache"}),addPerformanceNavigationTiming({transaction:transaction,entry:entry,event:"domainLookup",timeOrigin:timeOrigin,description:"DNS"}),function(transaction,entry,timeOrigin){_startChild(transaction,{op:"browser",description:"request",startTimestamp:timeOrigin+msToSec(entry.requestStart),endTimestamp:timeOrigin+msToSec(entry.responseEnd)}),_startChild(transaction,{op:"browser",description:"response",startTimestamp:timeOrigin+msToSec(entry.responseStart),endTimestamp:timeOrigin+msToSec(entry.responseEnd)})}(transaction,entry,timeOrigin)}(transaction,entry,timeOrigin),responseStartTimestamp=timeOrigin+msToSec(entry.responseStart),requestStartTimestamp=timeOrigin+msToSec(entry.requestStart);break;case"mark":case"paint":case"measure":var startTimestamp=function(transaction,entry,startTime,duration,timeOrigin){var measureStartTimestamp=timeOrigin+startTime,measureEndTimestamp=measureStartTimestamp+duration;return _startChild(transaction,{description:entry.name,endTimestamp:measureEndTimestamp,op:entry.entryType,startTimestamp:measureStartTimestamp}),measureStartTimestamp}(transaction,entry,startTime,duration,timeOrigin);void 0===tracingInitMarkStartTime&&"sentry-tracing-init"===entry.name&&(tracingInitMarkStartTime=startTimestamp);var firstHidden=getVisibilityWatcher(),shouldRecord=entry.startTime<firstHidden.firstHiddenTime;"first-paint"===entry.name&&shouldRecord&&(logger$1.log("[Measurements] Adding FP"),_this._measurements.fp={value:entry.startTime},_this._measurements["mark.fp"]={value:startTimestamp}),"first-contentful-paint"===entry.name&&shouldRecord&&(logger$1.log("[Measurements] Adding FCP"),_this._measurements.fcp={value:entry.startTime},_this._measurements["mark.fcp"]={value:startTimestamp});break;case"resource":var resourceName=entry.name.replace(global$2.location.origin,""),endTimestamp=function(transaction,entry,resourceName,startTime,duration,timeOrigin){if("xmlhttprequest"===entry.initiatorType||"fetch"===entry.initiatorType)return;var data={};"transferSize"in entry&&(data["Transfer Size"]=entry.transferSize);"encodedBodySize"in entry&&(data["Encoded Body Size"]=entry.encodedBodySize);"decodedBodySize"in entry&&(data["Decoded Body Size"]=entry.decodedBodySize);var startTimestamp=timeOrigin+startTime,endTimestamp=startTimestamp+duration;return _startChild(transaction,{description:resourceName,endTimestamp:endTimestamp,op:entry.initiatorType?"resource."+entry.initiatorType:"resource",startTimestamp:startTimestamp,data:data}),endTimestamp}(transaction,entry,resourceName,startTime,duration,timeOrigin);void 0===entryScriptStartTimestamp&&(entryScriptSrc||"").indexOf(resourceName)>-1&&(entryScriptStartTimestamp=endTimestamp)}})),void 0!==entryScriptStartTimestamp&&void 0!==tracingInitMarkStartTime&&_startChild(transaction,{description:"evaluation",endTimestamp:tracingInitMarkStartTime,op:"script",startTimestamp:entryScriptStartTimestamp}),this._performanceCursor=Math.max(performance.getEntries().length-1,0),this._trackNavigator(transaction),"pageload"===transaction.op){var timeOrigin_1=msToSec(browserPerformanceTimeOrigin);"number"==typeof responseStartTimestamp&&(logger$1.log("[Measurements] Adding TTFB"),this._measurements.ttfb={value:1e3*(responseStartTimestamp-transaction.startTimestamp)},"number"==typeof requestStartTimestamp&&requestStartTimestamp<=responseStartTimestamp&&(this._measurements["ttfb.requestTime"]={value:1e3*(responseStartTimestamp-requestStartTimestamp)})),["fcp","fp","lcp"].forEach((function(name){if(_this._measurements[name]&&!(timeOrigin_1>=transaction.startTimestamp)){var oldValue=_this._measurements[name].value,measurementTimestamp=timeOrigin_1+msToSec(oldValue),normalizedValue=Math.abs(1e3*(measurementTimestamp-transaction.startTimestamp)),delta=normalizedValue-oldValue;logger$1.log("[Measurements] Normalized "+name+" from "+oldValue+" to "+normalizedValue+" ("+delta+")"),_this._measurements[name].value=normalizedValue}})),this._measurements["mark.fid"]&&this._measurements.fid&&_startChild(transaction,{description:"first input delay",endTimestamp:this._measurements["mark.fid"].value+msToSec(this._measurements.fid.value),op:"web.vitals",startTimestamp:this._measurements["mark.fid"].value}),"fcp"in this._measurements||delete this._measurements.cls,transaction.setMeasurements(this._measurements),this._tagMetricInfo(transaction),transaction.setTag("sentry_reportAllChanges",this._reportAllChanges)}}},MetricsInstrumentation.prototype._tagMetricInfo=function(transaction){this._lcpEntry&&(logger$1.log("[Measurements] Adding LCP Data"),this._lcpEntry.element&&transaction.setTag("lcp.element",htmlTreeAsString(this._lcpEntry.element)),this._lcpEntry.id&&transaction.setTag("lcp.id",this._lcpEntry.id),this._lcpEntry.url&&transaction.setTag("lcp.url",this._lcpEntry.url.trim().slice(0,200)),transaction.setTag("lcp.size",this._lcpEntry.size)),this._clsEntry&&this._clsEntry.sources&&(logger$1.log("[Measurements] Adding CLS Data"),this._clsEntry.sources.forEac
907h((function(source,index){return transaction.setTag("cls.source."+(index+1),htmlTreeAsString(source.node))})))},MetricsInstrumentation.prototype._trackCLS=function(){var onReport,reportAllChanges,report,metric,sessionValue,sessionEntries,entryHandler,po,_this=this;onReport=function(metric){var entry=metric.entries.pop();entry&&(logger$1.log("[Measurements] Adding CLS"),_this._measurements.cls={value:metric.value},_this._clsEntry=entry)},metric=initMetric("CLS",0),sessionValue=0,sessionEntries=[],(po=observe("layout-shift",entryHandler=function(entry){if(entry&&!entry.hadRecentInput){var firstSessionEntry=sessionEntries[0],lastSessionEntry=sessionEntries[sessionEntries.length-1];sessionValue&&0!==sessionEntries.length&&entry.startTime-lastSessionEntry.startTime<1e3&&entry.startTime-firstSessionEntry.startTime<5e3?(sessionValue+=entry.value,sessionEntries.push(entry)):(sessionValue=entry.value,sessionEntries=[entry]),sessionValue>metric.value&&(metric.value=sessionValue,metric.entries=sessionEntries,report&&report())}}))&&(report=bindReporter(onReport,metric,reportAllChanges),onHidden((function(){po.takeRecords().map(entryHandler),report(!0)})))},MetricsInstrumentation.prototype._trackNavigator=function(transaction){var navigator=global$2.navigator;if(navigator){var connection=navigator.connection;connection&&(connection.effectiveType&&transaction.setTag("effectiveConnectionType",connection.effectiveType),connection.type&&transaction.setTag("connectionType",connection.type),isMeasurementValue(connection.rtt)&&(this._measurements["connection.rtt"]={value:connection.rtt}),isMeasurementValue(connection.downlink)&&(this._measurements["connection.downlink"]={value:connection.downlink})),isMeasurementValue(navigator.deviceMemory)&&transaction.setTag("deviceMemory",String(navigator.deviceMemory)),isMeasurementValue(navigator.hardwareConcurrency)&&transaction.setTag("hardwareConcurrency",String(navigator.hardwareConcurrency))}},MetricsInstrumentation.prototype._trackLCP=function(){var _this=this;!function(onReport,reportAllChanges){var report,visibilityWatcher=getVisibilityWatcher(),metric=initMetric("LCP"),entryHandler=function(entry){var value=entry.startTime;value<visibilityWatcher.firstHiddenTime&&(metric.value=value,metric.entries.push(entry)),report&&report()},po=observe("largest-contentful-paint",entryHandler);if(po){report=bindReporter(onReport,metric,reportAllChanges);var stopListening_1=function(){reportedMetricIDs[metric.id]||(po.takeRecords().map(entryHandler),po.disconnect(),reportedMetricIDs[metric.id]=!0,report(!0))};["keydown","click"].forEach((function(type){addEventListener(type,stopListening_1,{once:!0,capture:!0})})),onHidden(stopListening_1,!0)}}((function(metric){var entry=metric.entries.pop();if(entry){var timeOrigin=msToSec(browserPerformanceTimeOrigin),startTime=msToSec(entry.startTime);logger$1.log("[Measurements] Adding LCP"),_this._measurements.lcp={value:metric.value},_this._measurements["mark.lcp"]={value:timeOrigin+startTime},_this._lcpEntry=entry}}),this._reportAllChanges)},MetricsInstrumentation.prototype._trackFID=function(){var onReport,reportAllChanges,report,visibilityWatcher,metric,entryHandler,po,_this=this;onReport=function(metric){var entry=metric.entries.pop();if(entry){var timeOrigin=msToSec(browserPerformanceTimeOrigin),startTime=msToSec(entry.startTime);logger$1.log("[Measurements] Adding FID"),_this._measurements.fid={value:metric.value},_this._measurements["mark.fid"]={value:timeOrigin+startTime}}},visibilityWatcher=getVisibilityWatcher(),metric=initMetric("FID"),(po=observe("first-input",entryHandler=function(entry){report&&entry.startTime<visibilityWatcher.firstHiddenTime&&(metric.value=entry.processingStart-entry.startTime,metric.entries.push(entry),report(!0))}))&&(report=bindReporter(onReport,metric,reportAllChanges),onHidden((function(){po.takeRecords().map(entryHandler),po.disconnect()}),!0))},MetricsInstrumentation}();function addPerformanceNavigationTiming(props){var transaction=props.transaction,entry=props.entry,event=props.event,timeOrigin=props.timeOrigin,eventEnd=props.eventEnd,description=props.description,end=eventEnd?entry[eventEnd]:entry[event+"End"],start=entry[event+"Start"];start&&end&&_startChild(transaction,{op:"browser",description:null!=description?description:event,startTimestamp:timeOrigin+msToSec(start),endTimestamp:timeOrigin+msToSec(end)})}function _startChild(transaction,_a){var startTimestamp=_a.startTimestamp,ctx=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}(_a,["startTimestamp"]);return startTimestamp&&transaction.startTimestamp>startTimestamp&&(transaction.startTimestamp=startTimestamp),transaction.startChild(__assign({startTimestamp:startTimestamp},ctx))}function isMeasurementValue(value){return"number"==typeof value&&isFinite(value)}var defaultRequestInstrumentationOptions={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]};function instrumentOutgoingRequests(_options){var _a=__assign(__assign({},defaultRequestInstrumentationOptions),_options),traceFetch=_a.traceFetch,traceXHR=_a.traceXHR,tracingOrigins=_a.tracingOrigins,shouldCreateSpanForRequest=_a.shouldCreateSpanForRequest,urlMap={},defaultShouldCreateSpan=function(url){if(urlMap[url])return urlMap[url];var origins=tracingOrigins;return urlMap[url]=origins.some((function(origin){return isMatchingPattern(url,origin)}))&&!isMatchingPattern(url,"sentry_key"),urlMap[url]},shouldCreateSpan=defaultShouldCreateSpan;"function"==typeof shouldCreateSpanForRequest&&(shouldCreateSpan=function(url){return defaultShouldCreateSpan(url)&&shouldCreateSpanForRequest(url)}
907);var spans={};traceFetch&&addInstrumentationHandler({callback:function(handlerData){!function(handlerData,shouldCreateSpan,spans){if(!hasTracingEnabled()||!handlerData.fetchData||!shouldCreateSpan(handlerData.fetchData.url))return;if(handlerData.endTimestamp&&handlerData.fetchData.__span){return void((span=spans[handlerData.fetchData.__span])&&(handlerData.response?span.setHttpStatus(handlerData.response.status):handlerData.error&&span.setStatus(SpanStatus.InternalError),span.finish(),delete spans[handlerData.fetchData.__span]))}var activeTransaction=getActiveTransaction();if(activeTransaction){var span=activeTransaction.startChild({data:__assign(__assign({},handlerData.fetchData),{type:"fetch"}),description:handlerData.fetchData.method+" "+handlerData.fetchData.url,op:"http.client"});handlerData.fetchData.__span=span.spanId,spans[span.spanId]=span;var request=handlerData.args[0]=handlerData.args[0],options=handlerData.args[1]=handlerData.args[1]||{},headers=options.headers;isInstanceOf(request,Request)&&(headers=request.headers),headers?"function"==typeof headers.append?headers.append("sentry-trace",span.toTraceparent()):headers=Array.isArray(headers)?__spread(headers,[["sentry-trace",span.toTraceparent()]]):__assign(__assign({},headers),{"sentry-trace":span.toTraceparent()}):headers={"sentry-trace":span.toTraceparent()},options.headers=headers}}(handlerData,shouldCreateSpan,spans)},type:"fetch"}),traceXHR&&addInstrumentationHandler({callback:function(handlerData){!function(handlerData,shouldCreateSpan,spans){var _a,_b;if(!hasTracingEnabled()||(null===(_a=handlerData.xhr)||void 0===_a?void 0:_a.__sentry_own_request__)||!(null===(_b=handlerData.xhr)||void 0===_b?void 0:_b.__sentry_xhr__)||!shouldCreateSpan(handlerData.xhr.__sentry_xhr__.url))return;var xhr=handlerData.xhr.__sentry_xhr__;if(handlerData.endTimestamp&&handlerData.xhr.__sentry_xhr_span_id__){return void((span=spans[handlerData.xhr.__sentry_xhr_span_id__])&&(span.setHttpStatus(xhr.status_code),span.finish(),delete spans[handlerData.xhr.__sentry_xhr_span_id__]))}var activeTransaction=getActiveTransaction();if(activeTransaction){var span=activeTransaction.startChild({data:__assign(__assign({}
907,xhr.data),{type:"xhr",method:xhr.method,url:xhr.url}),description:xhr.method+" "+xhr.url,op:"http.client"});if(handlerData.xhr.__sentry_xhr_span_id__=span.spanId,spans[handlerData.xhr.__sentry_xhr_span_id__]=span,handlerData.xhr.setRequestHeader)try{handlerData.xhr.setRequestHeader("sentry-trace",span.toTraceparent())}catch(_){}}}(handlerData,shouldCreateSpan,spans)},type:"xhr"})}var global$1=getGlobalObject();var carrier,LevelState,PlayerState,TutorialState,EndCutsceneState$3,DEFAULT_BROWSER_TRACING_OPTIONS=__assign({idleTimeout:1e3,markBackgroundTransactions:!0,maxTransactionDuration:600,routingInstrumentation:function(customStartTransaction,startTransactionOnPageLoad,startTransactionOnLocationChange){if(void 0===startTransactionOnPageLoad&&(startTransactionOnPageLoad=!0),void 0===startTransactionOnLocationChange&&(startTransactionOnLocationChange=!0),global$1&&global$1.location){var activeTransaction,startingUrl=global$1.location.href;startTransactionOnPageLoad&&(activeTransaction=customStartTransaction({name:global$1.location.pathname,op:"pageload"})),startTransactionOnLocationChange&&addInstrumentationHandler({callback:function(_a){var to=_a.to,from=_a.from;void 0===from&&startingUrl&&-1!==startingUrl.indexOf(to)?startingUrl=void 0:from!==to&&(startingUrl=void 0,activeTransaction&&(logger$1.log("[Tracing] Finishing current transaction with op: "+activeTransaction.op),activeTransaction.finish()),activeTransaction=customStartTransaction({name:global$1.location.pathname,op:"navigation"}))},type:"history"})}else logger$1.warn("Could not initialize routing instrumentation due to invalid location")},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},defaultRequestInstrumentationOptions),BrowserTracing=function(){function BrowserTracing(_options){this.name=BrowserTracing.id,this._emitOptionsWarning=!1,this._configuredIdleTimeout=void 0;var tracingOrigins=defaultRequestInstrumentationOptions.tracingOrigins;_options&&(this._configuredIdleTimeout=_options.idleTimeout,_options.tracingOrigins&&Array.isArray(_options.tracingOrigins)&&0!==_options.tracingOrigins.length?tracingOrigins=_options.tracingOrigins:this._emitOptionsWarning=!0),this.options=__assign(__assign(__assign({},DEFAULT_BROWSER_TRACING_OPTIONS),_options),{tracingOrigins:tracingOrigins});var _metricOptions=this.options._metricOptions;this._metrics=new MetricsInstrumentation(_metricOptions&&_metricOptions._reportAllChanges)}return BrowserTracing.prototype.setupOnce=function(_,getCurrentHub){var _this=this;this._getCurrentHub=getCurrentHub,this._emitOptionsWarning&&(logger$1.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),logger$1.warn("[Tracing] We added a reasonable default for you: "+defaultRequestInstrumentationOptions.tracingOrigins));var _a=this.options,instrumentRouting=_a.routingInstrumentation,startTransactionOnLocationChange=_a.startTransactionOnLocationChange,startTransactionOnPageLoad=_a.startTransactionOnPageLoad,markBackgroundTransactions=_a.markBackgroundTransactions,traceFetch=_a.traceFetch,traceXHR=_a.traceXHR,tracingOrigins=_a.tracingOrigins,shouldCreateSpanForRequest=_a.shouldCreateSpanForRequest;instrumentRouting((function(context){return _this._createRouteTransaction(context)}),startTransactionOnPageLoad,startTransactionOnLocationChange),markBackgroundTransactions&&(global$3&&global$3.document?global$3.document.addEventListener("visibilitychange",(function(){var activeTransaction=getActiveTransaction();global$3.document.hidden&&activeTransaction&&(logger$1.log("[Tracing] Transaction: "+SpanStatus.Cancelled+" -> since tab moved to the background, op: "+activeTransaction.op),activeTransaction.status||activeTransaction.setStatus(SpanStatus.Cancelled),activeTransaction.setTag("visibilitychange","document.hidden"),activeTransaction.setTag("finishReason",IDLE_TRANSACTION_FINISH_REASONS[2]),activeTransaction.finish())})):logger$1.warn("[Tracing] Could not set up background tab detection due to lack of global document")),instrumentOutgoingRequests({traceFetch:traceFetch,traceXHR:traceXHR,tracingOrigins:tracingOrigins,shouldCreateSpanForRequest:shouldCreateSpanForRequest})},BrowserTracing.prototype._createRouteTransaction=function(context){var _this=this;if(this._getCurrentHub){var _a=this.options,beforeNavigate=_a.beforeNavigate,idleTimeout=_a.idleTimeout,maxTransactionDuration=_a.maxTransactionDuration,parentContextFromHeader="pageload"===context.op?function(){var header=(metaName="sentry-trace",el=getGlobalObject().document.querySelector("meta[name="+metaName+"]"),el?el.getAttribute("content"):null);var metaName,el;if(header)return function(traceparent){var matches=traceparent.match(TRACEPARENT_REGEXP);if(matches){var parentSampled=void 0;return"1"===matches[3]?parentSampled=!0:"0"===matches[3]&&(parentSampled=!1),{traceId:matches[1],parentSampled:parentSampled,parentSpanId:matches[2]}}}(header);return}():void 0,expandedContext=__assign(__assign(__assign({},context),parentContextFromHeader),{trimEnd:!0}),modifiedContext="function"==typeof beforeNavigate?beforeNavigate(expandedContext):expandedContext,finalContext=void 0===modifiedContext?__assign(__assign({},expandedContext),{sampled:!1}):modifiedContext;!1===finalContext.sampled&&logger$1.log("[Tracing] Will not send "+finalContext.op+" transaction because of beforeNavigate."),logger$1.log("[Tracing] Starting "+finalContext.op+" transaction on scope");var idleTransaction=function(hub,transactionContext,idleTimeout,onScope,customSamplingContext){var _a,_b,options=(null===(_a=hub.getClient())||void 0===_a?void 0:_a.getOptions())||{},transaction=new IdleTransaction(transactionContext,hub,idleTimeout,onScope);return(transaction=sample(transaction,options,__assign({parentSampled:transactionContext.parentSampled,transactionContext:transactionContext},customSamplingContext))).sampled&&transaction.initSpanRecorder(null===(_b=options._experiments)||void 0===_b?void 0:_b.maxSpans),transaction}(this._getCurrentHub(),finalContext,idleTimeout,!0,{location:getGlobalObject().location});return idleTransaction.registerBeforeFinishCallback((function(transaction,endTimestamp){_this._metrics.addPerformanceEntries(transaction),function(maxDuration,transaction,endTimestamp){var diff=endTimestamp-transaction.startTimestamp;endTimestamp&&(diff>maxDuration||diff<0)&&(transaction.setStatus(SpanStatus.DeadlineExceeded),transaction.setTag("maxTransactionDurationExceeded","true"))}(function(time){return 1e3*time}(maxTransactionDuration),transaction,endTimestamp)})),idleTransaction.setTag("idleTimeout",this._configuredIdleTimeout),idleTransaction}logger$1.warn("[Tracing] Did not create "+context.op+" transaction because _getCurrentHub is invali
907d.")},BrowserTracing.id="BrowserTracing",BrowserTracing}();(carrier=getMainCarrier()).__SENTRY__&&(carrier.__SENTRY__.extensions=carrier.__SENTRY__.extensions||{},carrier.__SENTRY__.extensions.startTransaction||(carrier.__SENTRY__.extensions.startTransaction=_startTransaction),carrier.__SENTRY__.extensions.traceHeaders||(carrier.__SENTRY__.extensions.traceHeaders=traceHeaders)),isNodeEnv()&&_autoloadDatabaseIntegrations(),addInstrumentationHandler({callback:errorCallback,type:"error"}),addInstrumentationHandler({callback:errorCallback,type:"unhandledrejection"}),function(options){if(void 0===options&&(options={}),void 0===options.defaultIntegrations&&(options.defaultIntegrations=defaultIntegrations),void 0===options.release){var window_1=getGlobalObject();window_1.SENTRY_RELEASE&&window_1.SENTRY_RELEASE.id&&(options.release=window_1.SENTRY_RELEASE.id)}void 0===options.autoSessionTracking&&(options.autoSessionTracking=!0),void 0===options.sendClientReports&&(options.sendClientReports=!0),function(clientClass,options){var _a;!0===options.debug&&logger$1.enable();var hub=getCurrentHub();null===(_a=hub.getScope())||void 0===_a||_a.update(options.initialScope);var client=new clientClass(options);hub.bindClient(client)}(BrowserClient,options),options.autoSessionTracking&&function(){if(void 0===getGlobalObject().document)return void logger$1.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");var hub=getCurrentHub();if("function"!=typeof hub.startSession||"function"!=typeof hub.captureSession)return;hub.startSession({ignoreDuration:!0}),hub.captureSession(),addInstrumentationHandler({callback:function(_a){var from=_a.from,to=_a.to;void 0!==from&&from!==to&&(hub.startSession({ignoreDuration:!0}),hub.captureSession())},type:"history"})}()}({dsn:"https://[email protected]/6139754",integrations:[new BrowserTracing],release:"[email protected]",tracesSampleRate:1});class UserComponent{constructor(gameObject){this.scene=gameObject.scene;const listenAwake=this.awake!==UserComponent.prototype.awake,listenStart=this.start!==UserComponent.prototype.start,listenUpdate=this.update!==UserComponent.prototype.update,listenDestroy=this.destroy!==UserComponent.prototype.destroy;listenAwake&&this.scene.events.once("scene-awake",this.awake,this),listenStart&&this.scene.events.once(Phaser.Scenes.Events.UPDATE,this.start,this),listenUpdate&&this.scene.events.on(Phaser.Scenes.Events.UPDATE,this.update,this),(listenStart||listenUpdate||listenDestroy)&&gameObject.on(Phaser.GameObjects.Events.DESTROY,(()=>{this.scene.events.off(Phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.off(Phaser.Scenes.Events.UPDATE,this.update,this),listenDestroy&&this.destroy()}))}scene;awake(){}start(){}update(timestamp,elapsed){}destroy(){}}class ProgressBar extends UserComponent{constructor(gameObject){super(gameObject),this.gameObject=gameObject,gameObject.__ProgressBar=this,this.scene.load.on(phaser.Loader.Events.PROGRESS,(p=>{this.gameObject.width=Math.floor(100*p)}))}static getComponent(gameObject){return gameObject.__ProgressBar}gameObject}class Preload extends phaser.Scene{constructor(){super("Preload")}editorPreload(){this.load.pack("asset-pack","assets/asset-pack.json")}editorCreate(){const rectangle=this.add.rectangle(0,360,640,360);rectangle.setOrigin(0,1),rectangle.isFilled=!0,rectangle.fillColor=0;this.add.image(270,211,"panda_logo").setOrigin(0,1);const progressbar=this.add.rectangle(270,235,0,12);progressbar.setOrigin(0,1),progressbar.isFilled=!0,progressbar.fillColor=13708079;const rectangle_1=this.add.rectangle(270,235,100,12);rectangle_1.setOrigin(0,1),rectangle_1.fillColor=0,rectangle_1.isStroked=!0,new ProgressBar(progressbar),this.progressbar=progressbar,this.events.emit("scene-awake")}progressbar;preload(){this.scale.setGameSize(640,360),this.editorCreate(),this.editorPreload(),this.load.audio("music_level1",["assets/music/Music_Level1.mp3"]),this.load.audio("music_level2",["assets/music/Music_Level2.mp3"]),this.load.audio("music_level3",["assets/music/Music_Level3.mp3"]),this.load.audio("music_level4",["assets/music/Music_Level4.mp3"]),this.load.audio("player_jump_1",["assets/sfx/Jump.mp3"]),this.load.audio("player_jump_2",["assets/sfx/Jump.mp3"]),this.load.audio("player_jump_3",["assets/sfx/Jump.mp3"]),this.load.audio("player_jump_4",["assets/sfx/Jump.mp3"]),this.load.audio("player_jump_flip",["assets/sfx/Panda_Jump_Flip.mp3"]),this.load.audio("collect_powerup",["assets/sfx/Panda_Powerup1.mp3"]),this.load.audio("obstacle",["assets/sfx/obstacle.mp3"]),this.load.audio("obstacle_fall",["assets/sfx/Panda_Impact_SewerDrop.mp3"]),this.load.audio("obstacle_bat",["assets/sfx/Panda_Impact_Bat.mp3"]),this.load.audio("obstacle_chicken",["assets/sfx/Panda_Impact_Chicken.mp3"]),this.load.audio("obstacle_hydrant",["assets/sfx/Panda_Impact_Hydrant.mp3"]),this.load.audio("obstacle_ox",["assets/sfx/Panda_Impact_Ox.mp3"]),this.load.audio("obstacle_scooter",["assets/sfx/Panda_Impact_Scooter.mp3"]),this.load.audio("obstacle_wok",["assets/sfx/Panda_Impact_Wok.mp3"]),this.load.audio("buttonselect",["assets/sfx/buttonselect.mp3"]),this.load.audio("fortunecard",["assets/sfx/Panda_FortuneCard.mp3"]),this.load.audio("intro",["assets/sfx/Panda_Intro_Rev3.mp3"]),this.load.audio("panda-die",["assets/sfx/Panda_Die.mp3"]),this.load.audio("ending",["assets/sfx/Panda_Ending.mp3"]),this.load.audio("startbtn",["assets/sfx/Panda_StartBtn.mp3"]),this.load.audio("powerup_crunch",["assets/sfx/Panda_PowerUp_Crunch.mp3"]),this.load.audio("powerup_slerp",["assets/sfx/Panda_PowerUp_Slerp.mp3"]),this.load.audio("powerup_fortune",["assets/sfx/Panda_PowerUp_Fortune_Cookie.mp3"]),this.load.audio("finalconfrontation",["assets/sfx/Panda_FinalConfrontation.mp3"]),this.load.on(phaser.Loader.Events.COMPLETE,(()=>this.scene.start("Start")))}}class AnimateUpandDown extends UserComponent{constructor(gameObject){super(gameObject),this.gameObject=gameObject,gameObject.__AnimateUpandDown=this}static getComponent(gameObject){return gameObject.__AnimateUpandDown}gameObject;Amplitude=1;Speed=500;Propertytochange="y";start(){this.gameObject.scene.tweens.add({targets:this.gameObject,[this.Propertytochange]:"+="+String(this.Amplitude),duration:this.Speed,ease:"Sine.easeInOut",yoyo:!0,repeat:-1})}}class StartAnimation extends UserComponent{constructor(gameObject){super(gameObject),this.gameObject=gameObject,gameObject.__StartAnimation=this}static getComponent(gameObject){return gameObject.__StartAnimation}gameObject;AnimationName="";start(){this.gameObject.play(this.AnimationName)}}class CallbackClickableButton extends phaser.GameObjects.Container{c
907onstructor(scene,x,y){super(scene,x??0,y??0);const button_bg=scene.add.image(0,0,"ui","button_bg");button_bg.scaleX=1.2,button_bg.scaleY=1.2,this.add(button_bg);const button_bg_hover=scene.add.image(0,0,"ui","button_bg_hover");button_bg_hover.scaleX=1.2,button_bg_hover.scaleY=1.2,this.add(button_bg_hover);const text=scene.add.bitmapText(0,-7,"pixel_operator_mono_hb_8_regular_15","New text");text.text="New text",text.fontSize=15,this.add(text),this.button_bg=button_bg,this.button_bg_hover=button_bg_hover,this.text=text,this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this),this.setSize(96,24),this.button_bg_hover.visible=!1}button_bg;button_bg_hover;text;textString="START";clickSound="buttonselect";isPressed=!1;callback;start(){this.text.text=this.textString,this.text.x-=Math.floor(this.text.width/2),this.setInteractive().on("pointerdown",(()=>{this.isPressed=!0,this.button_bg_hover.visible=!0,this.button_bg.visible=!1,this.scene.sound.add(this.clickSound,{volume:.3}).play()})).once("pointerup",(()=>{this.isPressed=!1,this.button_bg_hover.visible=!0,this.button_bg.visible=!1,this.callback&&this.callback()})),this.scene.input.on("pointerup",(()=>{this.isPressed=!1,this.button_bg_hover.visible=!1,this.button_bg.visible=!0})),this.scene.input.on("pointerout",(()=>{this.isPressed=!1,this.button_bg_hover.visible=!1,this.button_bg.visible=!0}))}setButtonScale(x,y){this.button_bg.setScale(x,y),this.button_bg_hover.setScale(x,y)}setCallback(callback){this.callback=callback}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}}class DOM extends phaser.GameObjects.Image{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"environments",frame??"ENVIRONMENT/LEVEL1/pandalogo"),this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}element;domElement;start(){let imageData=this.scene.textures.getBase64(this.texture.key,this.frame.name);this.element=document.createElement("img"),this.element.style.width=String(this.width*this.scaleX)+"px",this.element.style.height=String(this.height*this.scaleY)+"px",this.visible||(this.element.style.visibility="hidden"),this.element.src=imageData,this.domElement=new phaser.GameObjects.DOMElement(this.scene,this.x,this.y,this.element),this.scene.add.existing(this.domElement),this.visible=!1}setVisibility(isVisible){this.element.style.visibility=isVisible?"visible":"hidden"}setDomScale(scaleX,scaleY){this.domElement.setScale(scaleX,scaleY)}setDomOpacity(opacity){this.domElement.setAlpha(opacity)}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}}class Start extends phaser.Scene{constructor(){super("Start")}editorCreate(){const eNVIRONMENT_LEVEL1_l1_bg_0_sky=this.add.tileSprite(0,360,320,180,"environments","ENVIRONMENT/LEVEL1/l1_bg_0_sky");eNVIRONMENT_LEVEL1_l1_bg_0_sky.scaleX=2,eNVIRONMENT_LEVEL1_l1_bg_0_sky.scaleY=2,eNVIRONMENT_LEVEL1_l1_bg_0_sky.setOrigin(0,1);const eNVIRONMENT_LEVEL1_l1_bg_0_sun=this.add.image(320,33,"environments","ENVIRONMENT/LEVEL1/l1_bg_0_sun");eNVIRONMENT_LEVEL1_l1_bg_0_sun.scaleX=2,eNVIRONMENT_LEVEL1_l1_bg_0_sun.scaleY=2,eNVIRONMENT_LEVEL1_l1_bg_0_sun.setOrigin(0,1);const eNVIRONMENT_LEVEL1_l1_bg_1_buildings=this.add.tileSprite(95,154,320,64,"environments","ENVIRONMENT/LEVEL1/l1_bg_1_buildings");eNVIRONMENT_LEVEL1_l1_bg_1_buildings.scaleX=2,eNVIRONMENT_LEVEL1_l1_bg_1_buildings.scaleY=2,eNVIRONMENT_LEVEL1_l1_bg_1_buildings.setOrigin(0,1);const eNVIRONMENT_LEVEL1_l1_buildings_62=this.add.image(378,276,"environments","ENVIRONMENT/LEVEL1/l1_buildings_62");eNVIRONMENT_LEVEL1_l1_buildings_62.scaleX=2,eNVIRONMENT_LEVEL1_l1_buildings_62.scaleY=2,eNVIRONMENT_LEVEL1_l1_buildings_62.setOrigin(0,1);const tilesprite=this.add.tileSprite(0,361,320,45,"environments","ENVIRONMENT/LEVEL1/l1_ground");tilesprite.scaleX=2,tilesprite.scaleY=2,tilesprite.setOrigin(0,1);const eNVIRONMENT_LEVEL1_l1_buildings_px=this.add.image(14,272,"environments","ENVIRONMENT/LEVEL1/l1_buildings_px");eNVIRONMENT_LEVEL1_l1_buildings_px.scaleX=2,eNVIRONMENT_LEVEL1_l1_buildings_px.scaleY=2,eNVIRONMENT_LEVEL1_l1_buildings_px.setOrigin(0,1);const eNVIRONMENT_LEVEL1_l1_decor_bush_1=this.add.image(128,277,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1.scaleX=2,eNVIRONMENT_LEVEL1_l1_decor_bush_1.scaleY=2,eNVIRONMENT_LEVEL1_l1_decor_bush_1.setOrigin(0,1);const eNVIRONMENT_LEVEL1_pandalogo=this.add.image(163,134,"environments","ENVIRONMENT/LEVEL1/pandalogo");eNVIRONMENT_LEVEL1_pandalogo.scaleX=.75,eNVIRONMENT_LEVEL1_pandalogo.scaleY=.75,eNVIRONMENT_LEVEL1_pandalogo.setOrigin(0,1);const rectangle=this.add.rectangle(0,360,320,180);rectangle.scaleX=2,rectangle.scaleY=2,rectangle.setOrigin(0,1),rectangle.isFilled=!0,rectangle.fillColor=667534,rectangle.fillAlpha=.8;const eNVIRONMENT_LEVEL4_l4_bg_0_sky=this.add.tileSprite(543,360,400,180,"environments","ENVIRONMENT/LEVEL4/l4_bg_0_sky");eNVIRONMENT_LEVEL4_l4_bg_0_sky.scaleX=2,eNVIRONMENT_LEVEL4_l4_bg_0_sky.scaleY=2,eNVIRONMENT_LEVEL4_l4_bg_0_sky.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_bg_2_lava=this.add.tileSprite(551,306,400,83,"environments","ENVIRONMENT/LEVEL4/l4_bg_2_lava");eNVIRONMENT_LEVEL4_l4_bg_2_lava.scaleX=2,eNVIRONMENT_LEVEL4_l4_bg_2_lava.scaleY=2,eNVIRONMENT_LEVEL4_l4_bg_2_lava.setOrigin(0,1);
907this.add.image(164,327,"characters","PANDA/pandashadow").setOrigin(0,1);const pANDA_pandashadow_1=this.add.image(450,287,"characters","PANDA/pandashadow");pANDA_pandashadow_1.scaleX=1.7;const sprite=this.add.sprite(35,401,"characters","PANDA/WAVE/panda_wave_0000");sprite.scaleX=2.5,sprite.scaleY=2.5,sprite.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_house_16=this.add.image(-247,298,"environments","ENVIRONMENT/LEVEL3/l3_house_16");eNVIRONMENT_LEVEL3_l3_house_16.scaleX=2,eNVIRONMENT_LEVEL3_l3_house_16.scaleY=2,eNVIRONMENT_LEVEL3_l3_house_16.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_house_roof_04=this.add.image(-246,276,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_04");eNVIRONMENT_LEVEL3_l3_house_roof_04.scaleX=2,eNVIRONMENT_LEVEL3_l3_house_roof_04.scaleY=2,eNVIRONMENT_LEVEL3_l3_house_roof_04.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_ground=this.add.tileSprite(-307,364,200,35,"environments","ENVIRONMENT/LEVEL3/l3_ground");eNVIRONMENT_LEVEL3_l3_ground.scaleX=2,eNVIRONMENT_LEVEL3_l3_ground.scaleY=2,eNVIRONMENT_LEVEL3_l3_ground.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_box_1=this.add.image(-8,335,"environments","ENVIRONMENT/LEVEL3/l3_box_4");eNVIRONMENT_LEVEL3_l3_box_1.scaleX=2,eNVIRONMENT_LEVEL3_l3_box_1.scaleY=2,eNVIRONMENT_LEVEL3_l3_box_1.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_intro_grass_1=this.add.sprite(-267,385,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass_1.scaleX=2,eNVIRONMENT_LEVEL3_l3_intro_grass_1.scaleY=2,eNVIRONMENT_LEVEL3_l3_intro_grass_1.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_ground=this.add.tileSprite(544,360,100,45,"environments","ENVIRONMENT/LEVEL4/l4_ground");eNVIRONMENT_LEVEL4_l4_ground.scaleX=2,eNVIRONMENT_LEVEL4_l4_ground.scaleY=2,eNVIRONMENT_LEVEL4_l4_ground.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large=this.add.image(564,360,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large");eNVIRONMENT_LEVEL4_l4_ground_lava_large.scaleX=2,eNVIRONMENT_LEVEL4_l4_ground_lava_large.scaleY=2,eNVIRONMENT_LEVEL4_l4_ground_lava_large.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling=this.add.tileSprite(543,290,400,145,"environments","ENVIRONMENT/LEVEL4/l4_bg_4_floor_ceiling");eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling.scaleX=2,eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling.scaleY=2,eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_statue=this.add.image(548,284,"environments","ENVIRONMENT/LEVEL4/l4_statue");eNVIRONMENT_LEVEL4_l4_statue.scaleX=2,eNVIRONMENT_LEVEL4_l4_statue.scaleY=2,eNVIRONMENT_LEVEL4_l4_statue.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_closeup_column_2_1=this.add.image(591,360,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2_1.scaleX=2,eNVIRONMENT_LEVEL4_l4_closeup_column_2_1.scaleY=2,eNVIRONMENT_LEVEL4_l4_closeup_column_2_1.setOrigin(0,1);const eNVIRONMENT_LEVEL4_l4_closeup_cobweb=this.add.image(545,57,"environments","ENVIRONMENT/LEVEL4/l4_closeup_cobweb");eNVIRONMENT_LEVEL4_l4_closeup_cobweb.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_cobweb.flipX=!0,eNVIRONMENT_LEVEL4_l4_closeup_cobweb.tintTopLeft=12105165,eNVIRONMENT_LEVEL4_l4_closeup_cobweb.tintTopRight=10260706,eNVIRONMENT_LEVEL4_l4_closeup_cobweb.tintBottomLeft=10260706,eNVIRONMENT_LEVEL4_l4_closeup_cobweb.tintBottomRight=4462241;const clickableButton=new CallbackClickableButton(this,320,178);this.add.existing(clickableButton);const cUTSCENES_LANDINGPAGE_LandingPageLogo=this.add.sprite(170,149,"intro","CUTSCENES/LANDINGPAGE/LandingPageLogo_00000");cUTSCENES_LANDINGPAGE_LandingPageLogo.setOrigin(0,1);const rectangle_1=this.add.rectangle(-550,360,320,180);rectangle_1.scaleX=2,rectangle_1.scaleY=2,rectangle_1.setOrigin(0,1),rectangle_1.isFilled=!0,rectangle_1.fillColor=0,rectangle_1.fillAlpha=.6;const rectangle_1_1=this.add.rectangle(547,360,320,180);rectangle_1_1.scaleX=2,rectangle_1_1.scaleY=2,rectangle_1_1.setOrigin(0,1),rectangle_1_1.isFilled=!0,rectangle_1_1.fillColor=0,rectangle_1_1.fillAlpha=.6;const container_1=this.add.container(63.10000000000002,58);container_1.scaleX=2,container_1.scaleY=2;const eNVIRONMENT_LEVEL3_Lantern_1_2_1_1=this.add.image(0,154,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_2_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_1_2_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_1_2_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_1_2_1_1);const eNVIRONMENT_LEVEL3_Lantern_3_1_1=this.add.image(0,128,"environments","ENVIRONMENT/LEVEL3/Lantern_3");eNVIRONMENT_LEVEL3_Lantern_3_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_3_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_3_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_3_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1=this.add.image(0,76,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_2_1_1=this.add.image(0,48,"environments","ENVIRONMENT/LEVEL3/Lantern_2");eNVIRONMENT_LEVEL3_Lantern_2_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_2_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_2_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_2_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_2=this.add.image(0,1,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_2.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_2.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_2.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_2);const eNVIRONMENT_LEVEL3_Lantern_2_1_1_1=this.add.image(229,47,"environments","ENVIRONMENT/LEVEL3/Lantern_2");eNVIRONMENT_LEVEL3_Lantern_2_1_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_2_1_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_2_1_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_2_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_2_1=this.add.image(229,0,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_2_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_2_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_2_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_2_1);const eNVIRONMENT_LEVEL3_Lantern_1_2_1_1_1=this.add.image(229,153,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_2_1_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_1_2_1_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_1_2_1_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_1_2_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_3_1_1_1=this.add.image(229,127,"environments","ENVIRONMENT/LEVEL3/Lantern_3");eNVIRONMENT_LEVEL3_Lantern_3_1_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_3_1_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_3_1_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_3_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1=this.add.image(229,75,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1.scaleX=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1.scaleY=.9,eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1.setOrigin(0,1),container_1.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1);this.add.image(217,360,"ui","LANDINGPAGE/pail").setOrigin(0,1);const nian=this.add.container(374,250),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1=this.add.image(32,0,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1.setOrigin(0,1),nian.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1);const sprite_1=this.add.sprite(0,64,"characters","NIAN/IDLE2/nian_idle2_1");sprite_1.scaleX=2,sprite_1.scaleY=2,sprite_1.setOrigin(0,1),nian.add(sprite_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2=this.add.image(21,5,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_2");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2.setOrigin(0,1),nian.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2);const panda_logo=new DOM(this,320,47);this.add.existing(panda_logo),panda_logo.scaleX=.45,panda_logo.scaleY=.45,panda_logo.setOrigin(.5,.5);const pANDA_pandashadow_1AnimateUpandDown=new AnimateUpandDown(pANDA_pandashadow_1);pANDA_pandashadow_1AnimateUpandDown.Amplitude=.2,pANDA_pandashadow_1AnimateUpandDown.Speed=1e3,pANDA_pandashadow_1AnimateUpandDown.Propertytochange="scale";new StartAnimation(sprite).AnimationName="wavePANDA/WAVE/panda_wave",clickableButton.clickSound="buttonselect";new StartAnimation(cUTSCENES_LANDINGPAGE_LandingPageLogo).AnimationName="CUTSCENES/LANDINGPAGE/LandingPageLogo";const nianAnimateUpandDown=new AnimateUpandDown(nian);nianAnimateUpandDown.Amplitude=12,nianAnimateUpandDown.Speed=1e3;new StartAnimation(sprite_1).AnimationName="nian_idle2NIAN/IDLE2/nian_idle",this.clickableButton=clickableButton,this.events.emit("scene-awake")}clickableButton;create(){window.gtag("event","Start"),this.scale.setGameSize(640,360),this.editorCreate(),this.clickableButton.setButtonScale(1.2,1.2),this.clickableButton.setCallback((()=>{this.sound.stopAll(),this.sound.add("intro").play(),this.scene.stop(),this.scene.start("Intro")}))}}
907class ClickableButton extends phaser.GameObjects.Container{constructor(scene,x,y){super(scene,x??0,y??1);const button_bg=scene.add.image(0,0,"ui","button_bg");button_bg.scaleX=1.3,button_bg.scaleY=1.3,this.add(button_bg);const button_bg_hover=scene.add.image(0,0,"ui","button_bg_hover");button_bg_hover.scaleX=1.3,button_bg_hover.scaleY=1.3,this.add(button_bg_hover);const text=scene.add.bitmapText(0,-7,"pixel_operator_mono_hb_8_regular_14","START");text.text="START",text.fontSize=14,this.add(text),this.button_bg=button_bg,this.button_bg_hover=button_bg_hover,this.text=text,this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this),this.setSize(96,24),this.button_bg_hover.visible=!1}button_bg;button_bg_hover;text;textString="START";nextSceneKey="Level1";clickSound="buttonselect";isPressed=!1;start(){this.text.text=this.textString,this.text.x-=Math.floor(this.text.width/2),this.setInteractive().on("pointerdown",(()=>{this.isPressed=!0,this.button_bg_hover.visible=!0,this.button_bg.visible=!1,this.scene.sound.add(this.clickSound,{volume:.3}).play()})).once("pointerup",(()=>{this.isPressed=!1,this.button_bg_hover.visible=!0,this.button_bg.visible=!1,setTimeout((()=>{this.scene.sound.stopAll(),this.scene.scene.stop(),this.scene.scene.start(this.nextSceneKey)}),300)})),this.scene.input.on("pointerup",(()=>{this.isPressed=!1,this.button_bg_hover.visible=!1,this.button_bg.visible=!0})),this.scene.input.on("pointerout",(()=>{this.isPressed=!1,this.button_bg_hover.visible=!1,this.button_bg.visible=!0}))}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}}class TextBox extends phaser.GameObjects.Image{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"ui",frame??"ui_box_large"),this.scaleX=.5,this.scaleY=.5,this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}textString="";element;image;text;start(){this.visible=!1;let imageData=this.scene.textures.getBase64(this.texture.key,this.frame.name);this.element=document.createElement("div"),this.element.id="dialogContainer",this.element.style.position="absolute",this.element.style.visibility="hidden",this.image=document.createElement("img"),this.image.id="dialogBackground",this.image.src=imageData,this.image.style.width="100%",this.image.style.height="100%",this.element.appendChild(this.image),this.text=document.createElement("div"),this.text.id="dialogText",this.text.style.overflowWrap="break-word",this.text.style.position="absolute",this.text.style.top="0px",this.text.style.marginLeft="38%",this.text.style.marginRight="3%",this.text.style.marginTop="5%",this.text.style.color="white",this.text.style.fontFamily="PixelOperator",window.facebookCheck()&&window.mobileAndTabletCheck()?(this.text.style.width="236%",this.text.style.transform="scale(0.25)",this.text.style.transformOrigin="0 0"):this.text.style.width="59%",this.element.appendChild(this.text),this.applyTransform(),window.document.body.appendChild(this.element),window.addEventListener("resize",(event=>{setTimeout((()=>{this.applyTransform()}),10)}),!0)}reset(){this.element.style.visibility="hidden",this.text.innerHTML=""}typeText(textString,callback){let textHTML="";for(let i=0;i<textString.length;i++)textHTML+='<span style="visibility: hidden;">'+textString[i]+"</span>";this.text.innerHTML=textHTML,this.element.style.visibility="visible",typeWriter(this.text,25,callback)}setXY(x,y){this.x=x,this.y=y,this.applyTransform()}applyTransform(){const canvas=document.getElementsByTagName("canvas")[0];let rect=canvas.getBoundingClientRect();this.element.style.width=String(Math.floor(this.width*this.scaleX*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.height=String(Math.floor(this.height*this.scaleY*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.element.style.left=String(rect.left+Math.floor((this.x-this.width*this.scaleX*this.originX)*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.top=String(rect.top+Math.floor((this.y-this.height*this.scaleY*this.originY)*parseInt(canvas.style.height,10)/this.scene.scale.height)),window.facebookCheck()&&window.mobileAndTabletCheck()?(this.text.style.fontSize=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX*11/this.scene.scale.width*4))+"px",this.text.style.lineHeight=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX*15/this.scene.scale.width*4))+"px"):(this.text.style.fontSize=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX*11/this.scene.scale.width))+"px",this.text.style.lineHeight=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX*15/this.scene.scale.width))+"px")}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this),this.element&&this.element.remove()}}function typeWriter(element,msPerLetter,callback,i=0){i<element.children.length?(element.children[i].style.visibility="visible",i++,setTimeout(typeWriter.bind(null,element,msPerLetter,callback,i),msPerLetter)):callback&&callback()}class Intro extends phaser.Scene{constructor(){super("Intro")}editorCreate(){const cUTSCENES_INTRO_introanimation_00000=this.add.sprite(0,360,"intro","CUTSCENES/INTRO/introanimation_00000");cUTSCENES_INTRO_introanimation_00000.setOrigin(0,1);const clickableButton=new ClickableButton(this,569,24);this.add.existing(clickableButton),clickableButton.scaleX=1,clickableButton.scaleY=1;const textBox=new TextBox(this,510,314);this.add.existing(textBox),textBox.scaleX=.6,textBox.scaleY=.6,clickableButton.textString="SKIP",clickableButton.nextSceneKey="Level1",this.cUTSCENES_INTRO_introanimation_00000=cUTSCENES_INTRO_introanimation_00000,this.textBox=textBox,this.events.emit("scene-awake")}cUTSCENES_INTRO_introanimation_00000;textBox;create(){window.gtag("event","Intro"),this.scale.setGameSize(640,360),this.editorCreate(),this.cUTSCENES_INTRO_introanimation_00000.play("cutscene_CUTSCENES/INTRO/introanimation",!0),setTimeout((()=>{this.textBox.typeText("Happy Lunar New Year!")}),1e3),setTimeout((()=>{this.textBox.reset()}),5e3),setTimeout((()=>{this.textBox.typeText("Oh no, it's Nian! He stole your Family Meal!")}),10500),this.cUTSCENES_INTRO_introanimation_00000.once("animationcomplete",(()=>{setTimeout((()=>{this.sound.stopAll(),this.scene.stop(),this.scene.start("Level1")}),500)}))}}!function(LevelState){LevelState[LevelState.START=1]="START",LevelState[LevelState.GAME=2]="GAME",LevelState[LevelState.INTERRUPTED=3]="INTERRUPTED",LevelState[LevelState.DEATH=4]="DEATH",LevelState[LevelState.END=5]="END"}(LevelState||(LevelState={}));class PandaScene extends Phaser.Scene{constructor(key){super(key)}state;accumulator=0;fps=60;physicsTimestep;create(){this.state=LevelState.START,this.physicsTimestep=1e3/this.fps,this.levelCreate()}updatePlayer(elapsed,scene,player,startZone,endZone,checkpoints,nextLevel,obstacles,holes,startCallback,endCallback){for(this.accumulator+=elapsed;this.accumulator>=this.physicsTimestep;)switch(this.accumulator-=this.physicsTimestep,this.state){case LevelState.START:if(startZone.isTouching()){this.state=LevelState.GAME,player.setRunning();break}startCallback(scene);break;case LevelState.GAME:if(player.incrementX(1.5),player.y>Number(this.game.config.height)+100){this.state=LevelState.INTERRUPTED,player.death(this.getCheckpoints(),(()=>{this.state=LevelState.DEATH})),this.registry.inc("score",-25),this.sound.add("obstacle_fall",{volume:.4}).play();break}if(endZone.isTouching()){this.state=LevelState.END;break}break;case LevelState.INTERRUPTED:break;case LevelState.DEATH:if(null!=obstacles)for(let i=0;i<obstacles.length;i++)obstacles[i].reset();if(null!=holes)for(let i=0;i<holes.length;i++)holes[i].reset();this.state=LevelState.GAME,player.setRunning();break;case LevelState.END:endCallback(scene)}}collectPowerUp(player,powerup){powerup.collect()}
907hitObstacle(player,obstacle){obstacle.hit(),this.state=LevelState.INTERRUPTED;let callback=()=>{player.death(this.getCheckpoints(),(()=>{this.state=LevelState.DEATH}))};switch(obstacle.fallType){default:player.setFallForward(callback);break;case"BACKWARD":player.setFallBackward(callback);break;case"DOWN":player.setFallDown(callback)}}hitHole(player,hole){hole.hit(),this.state=LevelState.INTERRUPTED,player.setFallDown((()=>{player.death(this.getCheckpoints(),(()=>{this.state=LevelState.DEATH}))}))}}class Obstacle extends phaser.GameObjects.Sprite{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"obstacles",frame??"HYDRANT/01_city_hydrant_0"),this.setOrigin(0,0),this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this),this.originalTexture=texture||"obstacles",this.originalFrame=frame??"HYDRANT/01_city_hydrant_0"}hitAnimation="obstaclesHYDRANT/01_city_hydrant";idleAnimation="";hitboxWidth=12;hitboxHeight=26;hitboxOffsetX=17;hitboxOffsetY=41;hitSound="obstacle";fallType="FORWARD";score=25;originalTexture;originalFrame;start(){const arcade=this.scene.physics;this.scene.physics.world.enable(this),arcade.add.existing(this);const body=this.body;body.setAllowGravity(!1),body.setSize(this.hitboxWidth,this.hitboxHeight),body.setOffset(this.hitboxOffsetX,this.hitboxOffsetY),""!=this.idleAnimation&&this.play({key:this.idleAnimation},!0)}hit(){this.body.enable=!1,""!=this.hitAnimation&&this.play({key:this.hitAnimation},!0),this.scene.sound.add(this.hitSound,{volume:.4}).play(),this.scene.registry.inc("score",-25)}reset(){this.body.enable=!0,this.setTexture(this.originalTexture,this.originalFrame),""!=this.idleAnimation&&this.play({key:this.idleAnimation},!0)}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}}class Hole extends Obstacle{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"obstacles",frame??"MANHOLE/manhole"),this.setOrigin(0,0),this.scene.events.once(Phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(Phaser.Scenes.Events.DESTROY,this.destroy,this)}start(){const arcade=this.scene.physics;this.scene.physics.world.enable(this),arcade.add.existing(this);const body=this.body;body.setAllowGravity(!1),body.setSize(2,20),body.setOffset(15,-5)}hit(){this.body.enable=!1,this.scene.sound.add("obstacle_fall",{volume:.4}).play(),this.scene.registry.inc("score",-25)}reset(){this.body.enable=!0}destroy(){this.scene.events.off(Phaser.Scenes.Events.UPDATE,this.start,this)}}class PowerUp extends phaser.GameObjects.Sprite{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"powerups",frame??"CHOWMEIN/chowmein_0001"),this.setOrigin(0,0),this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}collectAnimation="powerups_REDPAIL_ORANGECHICKEN/redpail_orangechicken";collectSound="collect_powerup";hitboxOffsetX=0;hitboxOffsetY=0;score=25;collected=!1;start(){const arcade=this.scene.physics;this.scene.physics.world.enable(this),arcade.add.existing(this);const body=this.body;body.setAllowGravity(!1),this.scene.tweens.add({targets:this,y:"+=2",duration:500,ease:"Sine.easeInOut",yoyo:!0,repeat:-1}),body.setOffset(this.hitboxOffsetX,this.hitboxOffsetY)}collect(){this.collected||(this.collected=!0,this.scene.sound.add(this.collectSound,{volume:.5}).play(),this.scene.registry.inc("score",this.score),this.scene.registry.inc("numPowerups",1),this.play({key:this.collectAnimation,hideOnComplete:!0},!0))}getScore(){return this.score}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}}!function(PlayerState){PlayerState[PlayerState.IDLE=1]="IDLE",PlayerState[PlayerState.RUNNING=2]="RUNNING",PlayerState[PlayerState.INTERRUPTED=3]="INTERRUPTED"}(PlayerState||(PlayerState={}));class Player extends phaser.GameObjects.Sprite{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"characters",frame??"PANDA/IDLE_SIDE/panda_side_idle_1"),this.setOrigin(0,0),this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.on(phaser.Scenes.Events.UPDATE,this.updatePlayer,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}platforms=[];idleSideAnim="side_idlePANDA/IDLE_SIDE/panda_side_idle";idleFrontAnim="front_idlePANDA/IDLE/panda_idle";waveAnim="wavePANDA/WAVE/panda_wave";runAnim="runPANDA/RUN/panda_run";jump1Anim="jump1PANDA/JUMP1/panda_jump";jump2Anim="jump2PANDA/JUMP2/panda_jump";jump3Anim="jump3PANDA/JUMP3/panda_jump";fallBackAnim="FallbackPANDA/FALLBACK/panda_fall_back";fallDownAnim="FalldownPANDA/FALLDOWN/panda_fall_down";fallForwardAnim="FallforwardPANDA/FALLFORWARD/panda_fall_forward";playerState=PlayerState.IDLE;spaceKey;internalX;start(){const arcade=this.scene.physics;arcade.add.existing(this),arcade.add.collider(this,this.platforms),this.setRunning(),this.spaceKey=this.scene.input.ke
907yboard.addKey(phaser.Input.Keyboard.KeyCodes.SPACE);const body=this.body;body.setSize(20,37,!1),body.setOffset(53,50),this.internalX=this.x}updatePlayer(timestamp,elapsed){const body=this.body;this.playerState==PlayerState.RUNNING&&(this.checkJump()?this.jump():body.touching.down&&0==body.velocity.y&&this.run())}checkJump(){const body=this.body;return(this.isKeyDown(this.spaceKey)||this.scene.input.activePointer.isDown)&&body.touching.down&&0==body.velocity.y}jump(){this.body.setVelocityY(-500);const jumpRnd=Math.floor(3*Math.random());switch(jumpRnd){default:this.play(this.jump1Anim);break;case 1:this.play(this.jump2Anim),this.scene.sound.add("player_jump_flip",{volume:.6}).play();break;case 2:this.play(this.jump3Anim)}const jumpSoundRnd=Math.floor(3*Math.random());if(1!==jumpRnd)switch(jumpSoundRnd){default:this.scene.sound.add("player_jump_1",{volume:.4}).play();break;case 1:this.scene.sound.add("player_jump_2",{volume:.4}).play();break;case 2:this.scene.sound.add("player_jump_3",{volume:.4}).play();break;case 3:this.scene.sound.add("player_jump_4",{volume:.4}).play()}}run(){this.play(this.runAnim,!0)}setRunning(){this.playerState=PlayerState.RUNNING}setIdleSide(){this.playerState=PlayerState.IDLE,this.play(this.idleSideAnim,!0)}setIdleFront(){this.playerState=PlayerState.IDLE,this.play(this.idleFrontAnim,!0)}setWaving(){this.playerState=PlayerState.IDLE,this.play(this.waveAnim,!0)}setFallForward(callback){this.playerState=PlayerState.INTERRUPTED,this.play(this.fallForwardAnim,!0),this.once("animationcomplete",(()=>{null!=callback&&callback()}))}setFallBackward(callback){this.playerState=PlayerState.INTERRUPTED,this.play(this.fallBackAnim,!0),this.once("animationcomplete",(()=>{null!=callback&&callback()}))}setFallDown(callback){this.playerState=PlayerState.INTERRUPTED,this.play(this.fallDownAnim,!0),this.once("animationcomplete",(()=>{null!=callback&&callback()}))}incrementX(amount){this.internalX+=amount,this.x=Math.floor(this.internalX)}setInternalX(x){this.internalX=x,this.x=Math.floor(this.internalX)}resetPosition(x,y){this.setInternalX(x),this.y=y,this.body.setVelocity(0,0)}isKeyDown(key){return!!key&&key.isDown}death(checkpoints,callback){setTimeout((()=>{this.scene.sound.add("panda-die",{volume:1}).play()}),200),setTimeout((()=>{let x=120,y=155;for(let i=0;i<checkpoints.length;i++)checkpoints[i].x<this.x&&checkpoints[i].x>x&&(x=checkpoints[i].x,y=checkpoints[i].y);this.resetPosition(x,y),this.setIdleSide(),this.visible=!0,this.scene.tweens.addCounter({from:255,to:0,duration:500,yoyo:!0,repeat:1,onUpdate:tween=>{const value=Math.floor(tween.getValue());this.setTint(phaser.Display.Color.GetColor(value,value,value))},onComplete:()=>{callback()}})}),1e3)}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.off(phaser.Scenes.Events.UPDATE,this.updatePlayer,this)}}class PlatformPhysics extends UserComponent{constructor(gameObject){super(gameObject),this.gameObject=gameObject,gameObject.__PlatformPhysics=this,this.gameObject.scene.physics.add.existing(this.gameObject,!0);this.gameObject.body.checkCollision.down=!1}static getComponent(gameObject){return gameObject.__PlatformPhysics}gameObject}class Checkpoint extends phaser.GameObjects.Rectangle{constructor(scene,x,y,width,height){super(scene,x??64,y??64,width??128,height??128),this.visible=!1,this.isFilled=!0}}class TransitionZone extends phaser.GameObjects.Rectangle{constructor(scene,x,y,width,height){super(scene,x??60,y??90,width??100,height??180),this.isFilled=!0,this.fillAlpha=0,this.strokeAlpha=0,this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}player;zone;start(){this.zone=this.scene.add.zone(this.x,90,100,180),this.scene.physics.world.enable(this.zone);const zoneBody=this.zone.body;this.zone.scrollFactorX=1,zoneBody.setAllowGravity(!1),zoneBody.moves=!1,this.scene.add.existing(this.zone),zoneBody.debugBodyColor=65535,this.scene.physics.add.overlap(this.player,this.zone)}isTouching(){return!this.zone.body.touching.none}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}}
907class Score extends phaser.GameObjects.Container{constructor(scene,x,y){super(scene,x??0,y??0);const scoreText=scene.add.bitmapText(160,16,"pixel_operator_mono_hb_8_regular_16","0");scoreText.setOrigin(.5,.5),scoreText.text="0",scoreText.fontSize=16,scoreText.align=NaN,this.add(scoreText);const cHOWMEIN_chowmein_0001=scene.add.image(24,16,"powerups","CHOWMEIN/chowmein_0001");this.add(cHOWMEIN_chowmein_0001);const numPowerupsText=scene.add.bitmapText(40,16,"pixel_operator_mono_hb_8_regular_16","x0");numPowerupsText.setOrigin(0,.5),numPowerupsText.text="x0",numPowerupsText.fontSize=16,this.add(numPowerupsText);const mini_fortunecard_none=scene.add.image(256,16,"ui","mini_fortunecard_none");mini_fortunecard_none.scaleX=.2,mini_fortunecard_none.scaleY=.2,this.add(mini_fortunecard_none);const mini_fortunecard_none_1=scene.add.image(272,16,"ui","mini_fortunecard_none");mini_fortunecard_none_1.scaleX=.2,mini_fortunecard_none_1.scaleY=.2,this.add(mini_fortunecard_none_1);const mini_fortunecard_none_2=scene.add.image(288,16,"ui","mini_fortunecard_none");mini_fortunecard_none_2.scaleX=.2,mini_fortunecard_none_2.scaleY=.2,this.add(mini_fortunecard_none_2);const mini_fortunecard_none_3=scene.add.image(304,16,"ui","mini_fortunecard_none");mini_fortunecard_none_3.scaleX=.2,mini_fortunecard_none_3.scaleY=.2,this.add(mini_fortunecard_none_3);const mini_fortunecard_1=scene.add.image(256,16,"ui","mini_fortunecard_1");mini_fortunecard_1.scaleX=.2,mini_fortunecard_1.scaleY=.2,mini_fortunecard_1.visible=!1,this.add(mini_fortunecard_1);const mini_fortunecard_2=scene.add.image(272,16,"ui","mini_fortunecard_2");mini_fortunecard_2.scaleX=.2,mini_fortunecard_2.scaleY=.2,mini_fortunecard_2.visible=!1,this.add(mini_fortunecard_2);const mini_fortunecard_3=scene.add.image(288,16,"ui","mini_fortunecard_3");mini_fortunecard_3.scaleX=.2,mini_fortunecard_3.scaleY=.2,mini_fortunecard_3.visible=!1,this.add(mini_fortunecard_3);const mini_fortunecard_4=scene.add.image(304,16,"ui","mini_fortunecard_4");mini_fortunecard_4.scaleX=.2,mini_fortunecard_4.scaleY=.2,mini_fortunecard_4.visible=!1,this.add(mini_fortunecard_4),this.scoreText=scoreText,this.numPowerupsText=numPowerupsText,this.mini_fortunecard_1=mini_fortunecard_1,this.mini_fortunecard_2=mini_fortunecard_2,this.mini_fortunecard_3=mini_fortunecard_3,this.mini_fortunecard_4=mini_fortunecard_4,this.setScrollFactor(0,0),this.scoreText.text=this.scene.registry.get("score"),this.numPowerupsText.text="x"+String(this.scene.registry.get("numPowerups")),this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}scoreText;numPowerupsText;mini_fortunecard_1;mini_fortunecard_2;mini_fortunecard_3;mini_fortunecard_4;cards=0;score=0;start(){this.scene.registry.events.on("changedata",this.updateScore,this),this.cards>=1&&(this.mini_fortunecard_1.visible=!0),this.cards>=2&&(this.mini_fortunecard_2.visible=!0),this.cards>=3&&(this.mini_fortunecard_3.visible=!0),this.cards>=4&&(this.mini_fortunecard_4.visible=!0)}destroy(){this.scene.registry.events.off("changedata",this.updateScore,this),this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this)}updateScore(parent,key,data){"score"==key&&(this.scoreText.text=String(data)),"numPowerups"==key&&(this.numPowerupsText.text="x"+String(data))}}!function(TutorialState){TutorialState[TutorialState.START=1]="START",TutorialState[TutorialState.POSTSTART=2]="POSTSTART",TutorialState[TutorialState.PREPOWERUP=3]="PREPOWERUP",TutorialState[TutorialState.PREPOWERUPWAIT=4]="PREPOWERUPWAIT",TutorialState[TutorialState.PREPOWERUPJUMP=5]="PREPOWERUPJUMP",TutorialState[TutorialState.POWERUP=6]="POWERUP",TutorialState[TutorialState.POSTPOWERUP=7]="POSTPOWERUP",TutorialState[TutorialState.PREOBSTACLE=8]="PREOBSTACLE",TutorialState[TutorialState.OBSTACLEJUMP=9]="OBSTACLEJUMP",TutorialState[TutorialState.OBSTACLE=10]="OBSTACLE",TutorialState[TutorialState.POSTOBSTACLE=11]="POSTOBSTACLE",TutorialState[TutorialState.PRECARD=12]="PRECARD",TutorialState[TutorialState.PRECARDWAIT=13]="PRECARDWAIT",TutorialState[TutorialState.CARD=14]="CARD",TutorialState[TutorialState.POSTCARD=15]="POSTCARD",TutorialState[TutorialState.END=16]="END"}(TutorialState||(TutorialState={})),function(EndCutsceneState){EndCutsceneState[EndCutsceneState.START=1]="START",EndCutsceneState[EndCutsceneState.PRENIAN=2]="PRENIAN",EndCutsceneState[EndCutsceneState.NIAN=3]="NIAN",EndCutsceneState[EndCutsceneState.POSTNIAN=4]="POSTNIAN",EndCutsceneState[EndCutsceneState.FADEOUT=5]="FADEOUT",EndCutsceneState[EndCutsceneState.END=6]="END"}(EndCutsceneState$3||(EndCutsceneState$3={}));class Level1 extends PandaScene{constructor(){super("Level1")}editorCreate(){this.add.tileSprite(2500,90,5e3,180,"environments","ENVIRONMENT/LEVEL1/l1_bg_0_sky");const bG_far=this.add.container(0,16),eNVIRONMENT_LEVEL1_l1_bg_0_sun=this.add.image(125,-6,"environments","ENVIRONMENT/LEVEL1/l1_bg_0_sun");bG_far.add(eNVIRONMENT_LEVEL1_l1_bg_0_sun);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1=this.add.image(130,4,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_3=this.add.image(244,-2,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_3");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_3.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_3);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5=this.add.image(803,-2,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_5");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7=this.add.image(30,-1,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_7");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1=this.add.image(395,9,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_4=this.add.image(1147,-13,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_4");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_4.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_4);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7_1=this.add.image(1605,-5,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_7");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2=this.add.image(1710,1,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2=this.add.image(1898,-5,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_2");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_6=this.add.image(2100,-1,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_6");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_6.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_6);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1=this.add.image(900,-1,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1_1=this.add.image(1225,14,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5_1=this.add.image(2495,14,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_5");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5_1);const bG_Mid=this.add.container(0,58),eNVIRONMENT_LEVEL2_l2_bg_3_1_light=this.add.image(2245,-33,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light);const eNVIRONMENT_LEVEL1_l1_bg_1_buildings=this.add.tileSprite(0,22,5e3,64,"environments","ENVIRONMENT/LEVEL1/l1_bg_1_buildings");eNVIRONMENT_LEVEL1_l1_bg_1_buildings.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL1_l1_bg_1_buildings);const bG_Close=this.add.container(0,70),eNVIRONMENT_LEVEL1_l1_bg_2_buildings=this.add.tileSprite(0,25,5e3,60,"environments","ENVIRONMENT/LEVEL1/l1_bg_2_buildings");eNVIRONMENT_LEVEL1_l1_bg_2_buildings.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_bg_2_buildings);const mG_Group=this.add.container(0,30),eNVIRONMENT_LEVEL2_l2_bg_grass_0_2=this.add.image(2718,78,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0_2);const eNVIRONMENT_LEVEL1_l1_buildings_21_1=this.add.image(2956,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_21");eNVIRONMENT_LEVEL1_l1_buildings_21_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_21_1);const eNVIRONMENT_LEVEL1_l1_buildings_36=this.add.image(2784,106,"environments","ENVIRONMENT/LEVEL1/l1_buildings_36");eNVIRONMENT_LEVEL1_l1_buildings_36.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_36);const eNVIRONMENT_LEVEL2_l2_bg_grass_0_1=this.add.image(2840,120,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_0=this.add.image(2780,120,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0);const eNVIRONMENT_LEVEL3_l3_stall_2=this.add.image(2720,106,"environments","ENVIRONMENT/LEVEL3/l3_stall_2");eNVIRONMENT_LEVEL3_l3_stall_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_stall_2);const eNVIRONMENT_LEVEL1_l1_buildings_46=this.add.image(2384,84,"environments","ENVIRONMENT/LEVEL1/l1_buildings_46");eNVIRONMENT_LEVEL1_l1_buildings_46.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_46);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile=this.add.image(415,85,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile.scaleX=1.2,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile.scaleY=1.2,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile.flipY=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile);const eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled=this.add.image(360,160,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled);const eNVIRONMENT_LEVEL1_l1_decor_lamp_2_1=this.add.image(590,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_lamp");eNVIRONMENT_LEVEL1_l1_decor_lamp_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_lamp_2_1);const eNVIRONMENT_LEVEL1_l1_decor_lamp_2=this.add.image(605,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_lamp");eNVIRONMENT_LEVEL1_l1_decor_lamp_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_lamp_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_2=this.add.image(570,125,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_1=this.add.image(535,125,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_1);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_2=this.add.image(505,60,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_3=this.add.image(610,125,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_2_3);const eNVIRONMENT_LEVEL2_l2_bg_mountain_4=this.add.image(2290,110,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_4");eNVIRONMENT_LEVEL2_l2_bg_mountain_4.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_4);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_1=this.add.image(1165,20,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_1);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2=this.add.image(1200,20,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2);const eNVIRONMENT_LEVEL1_l1_buildings_00=this.add.image(660,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_00");eNVIRONMENT_LEVEL1_l1_buildings_00.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_00);const eNVIRONMENT_LEVEL1_l1_buildings_21=this.add.image(990,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_21");eNVIRONMENT_LEVEL1_l1_buildings_21.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_21);const eNVIRONMENT_LEVEL1_l1_signage_hotel=this.add.sprite(640,55,"environments","ENVIRONMENT/LEVEL1/l1_signage_hotel");eNVIRONMENT_LEVEL1_l1_signage_hotel.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_signage_hotel);const eNVIRONMENT_LEVEL1_l1_buildings_54=this.add.image(350,106,"environments","ENVIRONMENT/LEVEL1/l1_buildings_54");
907eNVIRONMENT_LEVEL1_l1_buildings_54.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_54);const eNVIRONMENT_LEVEL1_l1_buildings_62=this.add.image(180,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_62");eNVIRONMENT_LEVEL1_l1_buildings_62.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_62);const eNVIRONMENT_LEVEL1_l1_buildings_px=this.add.image(0,106,"environments","ENVIRONMENT/LEVEL1/l1_buildings_px");eNVIRONMENT_LEVEL1_l1_buildings_px.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_px);const eNVIRONMENT_LEVEL1_l1_buildings_23=this.add.image(1885,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_23");eNVIRONMENT_LEVEL1_l1_buildings_23.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_23);const eNVIRONMENT_LEVEL1_l1_decor_bench2_2=this.add.image(1990,106,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench2");eNVIRONMENT_LEVEL1_l1_decor_bench2_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bench2_2);const eNVIRONMENT_LEVEL1_l1_buildings_31=this.add.image(1375,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_31");eNVIRONMENT_LEVEL1_l1_buildings_31.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_31);const eNVIRONMENT_LEVEL1_l1_buildings_01=this.add.image(1715,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_01");eNVIRONMENT_LEVEL1_l1_buildings_01.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_01);const eNVIRONMENT_LEVEL1_l1_buildings_26=this.add.image(1160,105,"environments","ENVIRONMENT/LEVEL1/l1_buildings_26");eNVIRONMENT_LEVEL1_l1_buildings_26.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_26);const eNVIRONMENT_LEVEL1_l1_buildings_61=this.add.image(1330,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_61");eNVIRONMENT_LEVEL1_l1_buildings_61.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_buildings_61.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_61);const eNVIRONMENT_LEVEL1_l1_buildings_63=this.add.image(1545,108,"environments","ENVIRONMENT/LEVEL1/l1_buildings_63");eNVIRONMENT_LEVEL1_l1_buildings_63.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_63);const tilesprite=this.add.tileSprite(0,150,5e3,45,"environments","ENVIRONMENT/LEVEL1/l1_ground");tilesprite.setOrigin(0,1),mG_Group.add(tilesprite);const eNVIRONMENT_LEVEL1_l1_decor_bush_1=this.add.image(5,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1);const eNVIRONMENT_LEVEL1_l1_decor_bench2_1=this.add.image(545,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench2");eNVIRONMENT_LEVEL1_l1_decor_bench2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bench2_1);const eNVIRONMENT_LEVEL1_l1_decor_bench1=this.add.image(590,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench1");eNVIRONMENT_LEVEL1_l1_decor_bench1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bench1);const eNVIRONMENT_LEVEL1_l1_decor_bench2=this.add.image(155,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench2");eNVIRONMENT_LEVEL1_l1_decor_bench2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bench2);const eNVIRONMENT_LEVEL1_l1_decor_lamp=this.add.image(345,115,"environments","ENVIRONMENT/LEVEL1/l1_decor_lamp");eNVIRONMENT_LEVEL1_l1_decor_lamp.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_lamp);const eNVIRONMENT_LEVEL1_l1_cars_van_1=this.add.image(220,125,"environments","ENVIRONMENT/LEVEL1/l1_cars_van_1");eNVIRONMENT_LEVEL1_l1_cars_van_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_van_1);const eNVIRONMENT_LEVEL1_l1_decor_tree=this.add.image(455,115,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_tree);const eNVIRONMENT_LEVEL1_l1_decor_chinesesign=this.add.image(305,75,"environments","ENVIRONMENT/LEVEL1/l1_decor_chinesesign");eNVIRONMENT_LEVEL1_l1_decor_chinesesign.scaleX=.7241783326940561,eNVIRONMENT_LEVEL1_l1_decor_chinesesign.scaleY=.7241783326940561,eNVIRONMENT_LEVEL1_l1_decor_chinesesign.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_chinesesign);const eNVIRONMENT_LEVEL1_pandalogo=this.add.image(72,40,"environments","ENVIRONMENT/LEVEL1/pandalogo");eNVIRONMENT_LEVEL1_pandalogo.scaleX=.4,eNVIRONMENT_LEVEL1_pandalogo.scaleY=.4,eNVIRONMENT_LEVEL1_pandalogo.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_pandalogo);const eNVIRONMENT_LEVEL1_l1_decor_manhole_cover=this.add.image(125,140,"environments","ENVIRONMENT/LEVEL1/l1_decor_manhole-cover");eNVIRONMENT_LEVEL1_l1_decor_manhole_cover.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_manhole_cover);const eNVIRONMENT_LEVEL1_l1_decor_bush_2=this.add.image(390,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2);const eNVIRONMENT_LEVEL1_l1_cars_small_2=this.add.image(725,125,"environments","ENVIRONMENT/LEVEL1/l1_cars_small_2");eNVIRONMENT_LEVEL1_l1_cars_small_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_small_2);const eNVIRONMENT_LEVEL1_l1_crossing2=this.add.image(820,147,"environments","ENVIRONMENT/LEVEL1/l1_crossing2");eNVIRONMENT_LEVEL1_l1_crossing2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_crossing2);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_1=this.add.image(1120,105,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_1);const eNVIRONMENT_LEVEL1_l1_bg_2_buildings_1=this.add.image(835,80,"environments","ENVIRONMENT/LEVEL1/l1_bg_2_buildings");eNVIRONMENT_LEVEL1_l1_bg_2_buildings_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_bg_2_buildings_1);const eNVIRONMENT_LEVEL1_l1_cars_suv_3=this.add.image(1035,125,"environments","ENVIRONMENT/LEVEL1/l1_cars_suv_3");eNVIRONMENT_LEVEL1_l1_cars_suv_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_suv_3);const eNVIRONMENT_LEVEL1_l1_signage_food=this.add.sprite(1330,60,"environments","ENVIRONMENT/LEVEL1/l1_signage_food");eNVIRONMENT_LEVEL1_l1_signage_food.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_signage_food);const eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1=this.add.image(1218,86,"environments","ENVIRONMENT/LEVEL1/l1_decor_chinesesign");eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1);const eNVIRONMENT_LEVEL1_l1_decor_lamp_1=this.add.image(1160,115,"environments","ENVIRONMENT/LEVEL1/l1_decor_lamp");eNVIRONMENT_LEVEL1_l1_decor_lamp_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_lamp_1);const eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_1=this.add.image(860,90,"environments","ENVIRONMENT/LEVEL1/l1_decor_manhole-cover");eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_1);const eNVIRONMENT_LEVEL1_l1_signage_billboard=this.add.image(1165,0,"environments","ENVIRONMENT/LEVEL1/l1_signage_billboard");eNVIRONMENT_LEVEL1_l1_signage_billboard.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_signage_billboard);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_1=this.add.image(960,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_1);const eNVIRONMENT_LEVEL1_l1_decor_tigersign=this.add.image(1525,115,"environments","ENVIRONMENT/LEVEL1/l1_decor_tigersign");eNVIRONMENT_LEVEL1_l1_decor_tigersign.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_tigersign);const eNVIRONMENT_LEVEL1_l1_decor_tree_1=this.add.image(1365,115,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_tree_1);const eNVIRONMENT_LEVEL1_l1_decor_bench1_1_1=this.add.image(1695,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench1");eNVIRONMENT_LEVEL1_l1_decor_bench1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bench1_1_1);const eNVIRONMENT_LEVEL1_l1_cars_van_3=this.add.image(1620,130,"environments","ENVIRONMENT/LEVEL1/l1_cars_van_3");eNVIRONMENT_LEVEL1_l1_cars_van_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_van_3);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2_1=this.add.image(1250,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2_1);const eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2_1_1=this.add.image(1285,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_2");eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_2_1_2_1_1);const eNVIRONMENT_LEVEL1_l1_crossing1=this.add.image(2050,147,"environments","ENVIRONMENT/LEVEL1/l1_crossing1");eNVIRONMENT_LEVEL1_l1_crossing1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_crossing1);const eNVIRONMENT_LEVEL1_l1_cars_suv_4=this.add.image(595,125,"environments","ENVIRONMENT/LEVEL1/l1_cars_suv_4");eNVIRONMENT_LEVEL1_l1_cars_suv_4.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_suv_4);const eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_2=this.add.image(490,140,"environments","ENVIRONMENT/LEVEL1/l1_decor_manhole-cover");eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_2);const eNVIRONMENT_LEVEL1_l1_buildings_46_1=this.add.image(2216,84,"environments","ENVIRONMENT/LEVEL1/l1_buildings_46");eNVIRONMENT_LEVEL1_l1_buildings_46_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_46_1);const eNVIRONMENT_LEVEL1_l1_buildings_55=this.add.image(2215,105,"environments","ENVIRONMENT/LEVEL1/l1_buildings_55");eNVIRONMENT_LEVEL1_l1_buildings_55.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_55);const eNVIRONMENT_LEVEL1_l1_signage_billboard_1=this.add.image(2305,5,"environments","ENVIRONMENT/LEVEL1/l1_signage_billboard");eNVIRONMENT_LEVEL1_l1_signage_billboard_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_signage_billboard_1);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_2=this.add.image(2375,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1=this.add.image(2256,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1);const sprite=this.add.sprite(455,25,"environments","ENVIRONMENT/LEVEL1/l1_b
907irds_0");sprite.setOrigin(0,1),mG_Group.add(sprite);const sprite_1=this.add.sprite(1365,35,"environments","ENVIRONMENT/LEVEL1/l1_birds_0");sprite_1.setOrigin(0,1),sprite_1.flipX=!0,mG_Group.add(sprite_1);const eNVIRONMENT_LEVEL1_l1_buildings_62_1=this.add.image(2550,110,"environments","ENVIRONMENT/LEVEL1/l1_buildings_62");eNVIRONMENT_LEVEL1_l1_buildings_62_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_buildings_62_1);const eNVIRONMENT_LEVEL1_l1_cars_small_3=this.add.image(2325,130,"environments","ENVIRONMENT/LEVEL1/l1_cars_small_3");eNVIRONMENT_LEVEL1_l1_cars_small_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_small_3);const eNVIRONMENT_LEVEL1_l1_decor_tree_2=this.add.image(2400,115,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_tree_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1_1=this.add.image(2620,114,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1_1);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1_2=this.add.image(2668,114,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_2_1_2);const eNVIRONMENT_LEVEL1_l1_cars_van_2=this.add.image(2485,130,"environments","ENVIRONMENT/LEVEL1/l1_cars_van_2");eNVIRONMENT_LEVEL1_l1_cars_van_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_cars_van_2);const eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_3=this.add.image(2120,140,"environments","ENVIRONMENT/LEVEL1/l1_decor_manhole-cover");eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_manhole_cover_3);const eNVIRONMENT_LEVEL3_l3_market_items_6=this.add.image(2725,95,"environments","ENVIRONMENT/LEVEL3/l3_market_items_6");eNVIRONMENT_LEVEL3_l3_market_items_6.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_6);const eNVIRONMENT_LEVEL3_l3_market_items_5=this.add.image(2725,95,"environments","ENVIRONMENT/LEVEL3/l3_market_items_5");eNVIRONMENT_LEVEL3_l3_market_items_5.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_5);const eNVIRONMENT_LEVEL3_l3_market_items_5_1=this.add.image(2715,95,"environments","ENVIRONMENT/LEVEL3/l3_market_items_5");eNVIRONMENT_LEVEL3_l3_market_items_5_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_5_1);const eNVIRONMENT_LEVEL1_l1_decor_chinesesign_2=this.add.image(2650,54,"environments","ENVIRONMENT/LEVEL1/l1_decor_chinesesign");eNVIRONMENT_LEVEL1_l1_decor_chinesesign_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_chinesesign_2);const hole_2=new Hole(this,1780,159);this.add.existing(hole_2);const hole_1=new Hole(this,735,159);this.add.existing(hole_1);const hydrant_3=new Obstacle(this,1940,94);this.add.existing(hydrant_3);const hydrant_2=new Obstacle(this,1250,94);this.add.existing(hydrant_2);const hydrant_1=new Obstacle(this,320,94);this.add.existing(hydrant_1);const scooter_3=new Obstacle(this,2285,120,"obstacles","SCOOTER/01_city_scooter_fall_0");this.add.existing(scooter_3);const scooter_2=new Obstacle(this,1436,120,"obstacles","SCOOTER/01_city_scooter_fall_0");this.add.existing(scooter_2);const scooter_1=new Obstacle(this,1025,120,"obstacles","SCOOTER/01_city_scooter_fall_0");this.add.existing(scooter_1);const eggrollpowerup_9=new PowerUp(this,2604,70,"powerups","REDPAIL_EGGROLL/redpail_eggroll_0001");this.add.existing(eggrollpowerup_9),eggrollpowerup_9.angle=0;const eggrollpowerup_8=new PowerUp(this,2445,115,"powerups","EGGROLL/eggroll_0001");this.add.existing(eggrollpowerup_8),eggrollpowerup_8.angle=25;const eggrollpowerup_7=new PowerUp(this,2100,70,"powerups","REDPAIL_EGGROLL/redpail_eggroll_0001");this.add.existing(eggrollpowerup_7),eggrollpowerup_7.angle=0;const eggrollpowerup_6=new PowerUp(this,1790,50,"powerups","EGGROLL/eggroll_0001");this.add.existing(eggrollpowerup_6),eggrollpowerup_6.angle=25;const eggrollpowerup_5=new PowerUp(this,1545,24,"powerups","EGGROLL/eggroll_0001");this.add.existing(eggrollpowerup_5),eggrollpowerup_5.angle=25;
907const powerUp_4=new PowerUp(this,1255,50,"powerups","REDPAIL_EGGROLL/redpail_eggroll_0001");this.add.existing(powerUp_4);const powerUp_3=new PowerUp(this,1030,50,"powerups","REDPAIL_EGGROLL/redpail_eggroll_0001");this.add.existing(powerUp_3);const eggrollpowerup_2=new PowerUp(this,746,50,"powerups","EGGROLL/eggroll_0001");this.add.existing(eggrollpowerup_2),eggrollpowerup_2.angle=25;const eggrollpowerup_1=new PowerUp(this,596,114,"powerups","EGGROLL/eggroll_0001");this.add.existing(eggrollpowerup_1),eggrollpowerup_1.angle=25;const tutorial_powerUp_2=new PowerUp(this,325,50,"powerups","REDPAIL_EGGROLL/redpail_eggroll_0001");this.add.existing(tutorial_powerUp_2);const tutorial_powerUp_1=new PowerUp(this,120,50,"powerups","EGGROLL/eggroll_0001");this.add.existing(tutorial_powerUp_1),tutorial_powerUp_1.angle=0;const nian=this.add.sprite(2845,200,"characters","NIAN/IDLE2/nian_idle2_1");nian.setOrigin(0,1);const player=new Player(this,140,155);this.add.existing(player),player.setOrigin(.5,.75);const fG_Group=this.add.container(0,0),eNVIRONMENT_LEVEL1_l1_upclose_streetsign=this.add.image(844,180,"environments","ENVIRONMENT/LEVEL1/l1_upclose_streetsign");eNVIRONMENT_LEVEL1_l1_upclose_streetsign.setOrigin(0,1),fG_Group.add(eNVIRONMENT_LEVEL1_l1_upclose_streetsign);const eNVIRONMENT_LEVEL1_l1_upclose_streetsign_1=this.add.image(2072,180,"environments","ENVIRONMENT/LEVEL1/l1_upclose_streetsign");eNVIRONMENT_LEVEL1_l1_upclose_streetsign_1.setOrigin(0,1),fG_Group.add(eNVIRONMENT_LEVEL1_l1_upclose_streetsign_1);const ground=this.add.rectangle(0,156,5e3,10);ground.setOrigin(0,0),ground.isFilled=!0,ground.fillAlpha=0;const checkpoint=new Checkpoint(this,1550,154);this.add.existing(checkpoint);const checkpoint_1=new Checkpoint(this,550,154);this.add.existing(checkpoint_1);const endZone=new TransitionZone(this,2868,86);this.add.existing(endZone);const startZone=new TransitionZone(this,530,90);this.add.existing(startZone);const score=new Score(this,0,0);this.add.existing(score);const fortune_card=new DOM(this,470,76,"ui","FortuneCard_Eggroll_front");this.add.existing(fortune_card),fortune_card.scaleX=.12,fortune_card.scaleY=.12,fortune_card.setOrigin(.5,.5),fortune_card.visible=!1;const panda_logo=new DOM(this,92,50);this.add.existing(panda_logo),panda_logo.scaleX=.4,panda_logo.scaleY=.4;const textBox=new TextBox(this,232,140);this.add.existing(textBox),textBox.scaleX=.3,textBox.scaleY=.3;const fullTint=this.add.rectangle(0,0,320,180);fullTint.setOrigin(0,0),fullTint.isFilled=!0,fullTint.fillColor=0,fullTint.fillAlpha=0;const platforms=[ground],powerups=[powerUp_3,tutorial_powerUp_1,eggrollpowerup_2,eggrollpowerup_1,tutorial_powerUp_2,powerUp_4,eggrollpowerup_5,eggrollpowerup_9,eggrollpowerup_8,eggrollpowerup_7,eggrollpowerup_6],obstacles=[hydrant_3,hydrant_1,hydrant_2,scooter_1,scooter_3,scooter_2],holes=[hole_2,hole_1],checkpoints=[checkpoint,checkpoint_1];new StartAnimation(eNVIRONMENT_LEVEL1_l1_signage_hotel).AnimationName="animation_neonsign2";new StartAnimation(eNVIRONMENT_LEVEL1_l1_signage_food).AnimationName="animation_neonsign1";new StartAnimation(sprite).AnimationName="animation_ENVIRONMENT/LEVEL1/l1_birds";new StartAnimation(sprite_1).AnimationName="animation_ENVIRONMENT/LEVEL1/l1_birds",hydrant_3.hitSound="obstacle_hydrant",hydrant_3.fallType="BACKWARD",hydrant_2.hitSound="obstacle_hydrant",hydrant_1.hitSound="obstacle_hydrant",hydrant_1.fallType="BACKWARD",scooter_3.hitAnimation="obstaclesSCOOTER/01_city_scooter_fall",scooter_3.hitboxWidth=25,scooter_3.hitboxHeight=25,scooter_3.hitboxOffsetX=5,scooter_3.hitboxOffsetY=10,scooter_3.hitSound="obstacle_scooter",scooter_3.fallType="FORWARD",scooter_2.hitAnimation="obstaclesSCOOTER/01_city_scooter_fall",scooter_2.hitboxWidth=25,scooter_2.hitboxHeight=25,scooter_2.hitboxOffsetX=5,scooter_2.hitboxOffsetY=10,scooter_2.hitSound="obstacle_scooter",scooter_2.fallType="FORWARD",scooter_1.hitAnimation="obstaclesSCOOTER/01_city_scooter_fall",scooter_1.hitboxWidth=25,scooter_1.hitboxHeight=25,scooter_1.hitboxOffsetX=5,scooter_1.hitboxOffsetY=10,scooter_1.hitSound="obstacle_scooter",scooter_1.fallType="FORWARD",eggrollpowerup_9.collectAnimation="powerups_REDPAIL_EGGROLL/redpail_eggroll",eggrollpowerup_9.collectSound="powerup_crunch",eggrollpowerup_8.collectAnimation="powerups_EGGROLL/eggroll",eggrollpowerup_8.collectSound="powerup_crunch",eggrollpowerup_8.hitboxOffsetX=-8,eggrollpowerup_8.hitboxOffsetY=5,eggrollpowerup_7.collectAnimation="powerups_REDPAIL_EGGROLL/redpail_eggroll",eggrollpowerup_7.collectSound="powerup_crunch",eggrollpowerup_6.collectAnimation="powerups_EGGROLL/eggroll",eggrollpowerup_6.collectSound="powerup_crunch",eggrollpowerup_6.hitboxOffsetX=-8,eggrollpowerup_6.hitboxOffsetY=5,eggrollpowerup_5.collectAnimation="powerups_EGGROLL/eggroll",eggrollpowerup_5.collectSound="powerup_crunch",eggrollpowerup_5.hitboxOffsetX=-8,eggrollpowerup_5.hitboxOffsetY=5,power
907Up_4.collectAnimation="powerups_REDPAIL_EGGROLL/redpail_eggroll",powerUp_4.collectSound="powerup_crunch",powerUp_3.collectAnimation="powerups_REDPAIL_EGGROLL/redpail_eggroll",powerUp_3.collectSound="powerup_crunch",eggrollpowerup_2.collectAnimation="powerups_EGGROLL/eggroll",eggrollpowerup_2.collectSound="powerup_crunch",eggrollpowerup_2.hitboxOffsetX=-8,eggrollpowerup_2.hitboxOffsetY=5,eggrollpowerup_1.collectAnimation="powerups_EGGROLL/eggroll",eggrollpowerup_1.collectSound="powerup_crunch",eggrollpowerup_1.hitboxOffsetX=-8,eggrollpowerup_1.hitboxOffsetY=5,tutorial_powerUp_2.collectAnimation="powerups_REDPAIL_EGGROLL/redpail_eggroll",tutorial_powerUp_2.collectSound="powerup_crunch",tutorial_powerUp_1.collectAnimation="powerups_EGGROLL/eggroll",tutorial_powerUp_1.collectSound="powerup_crunch";new StartAnimation(nian).AnimationName="nian_idle2NIAN/IDLE2/nian_idle",player.platforms=platforms,new PlatformPhysics(ground),endZone.player=player,startZone.player=player,this.nian=nian,this.player=player,this.endZone=endZone,this.startZone=startZone,this.score=score,this.fortune_card=fortune_card,this.textBox=textBox,this.fullTint=fullTint,this.platforms=platforms,this.powerups=powerups,this.obstacles=obstacles,this.holes=holes,this.checkpoints=checkpoints,this.events.emit("scene-awake")}nian;player;endZone;startZone;score;fortune_card;textBox;fullTint;platforms;powerups;obstacles;holes;checkpoints;tutorialState;endCutsceneState;levelCreate(){window.gtag("event","Level1"),this.scale.setGameSize(320,180),this.editorCreate(),this.sound.add("music_level1",{loop:!0}).play(),this.cameras.main.startFollow(this.player),this.cameras.main.setLerp(1,0),this.cameras.main.followOffset.set(-40,75),this.cameras.main.scrollY=0,this.fullTint.setScrollFactor(0,0);const arcade=this.physics;arcade.add.overlap(this.player,this.powerups,super.collectPowerUp,void 0,this),arcade.add.overlap(this.player,this.obstacles,super.hitObstacle,void 0,this),arcade.add.overlap(this.player,this.holes,super.hitHole,void 0,this),this.tutorialState=TutorialState.START,this.endCutsceneState=EndCutsceneState$3.START}update(timestamp,elapsed){super.updatePlayer(elapsed,this,this.player,this.startZone,this.endZone,this.checkpoints,"Level1Fortune",this.obstacles,this.holes,this.updateTutorialCutscene,this.updateEndCutscene)}updateTutorialCutscene(scene){switch(scene.tutorialState){case TutorialState.START:scene.player.setIdleSide(),scene.tutorialState=TutorialState.POSTSTART,setTimeout((()=>{scene.tutorialState=TutorialState.PREPOWERUP}),500);break;case TutorialState.POSTSTART:break;case TutorialState.PREPOWERUP:scene.tutorialState=TutorialState.PREPOWERUPWAIT,scene.textBox.typeText("Follow Nian and collect your lucky foods!",(()=>{setTimeout((()=>{scene.textBox.typeText("Use the space bar to JUMP!",(()=>{setTimeout((()=>{setTimeout((()=>{scene.tutorialState=TutorialState.PREPOWERUPJUMP}),500),scene.textBox.typeText("If you're playing on mobile, tap the screen.",(()=>{setTimeout((()=>{scene.textBox.reset()}),1500)}))}),1500)}))}),1500)}));break;case TutorialState.PREPOWERUPWAIT:break;case TutorialState.PREPOWERUPJUMP:scene.player.checkJump()&&(scene.player.jump(),scene.tutorialState=TutorialState.POWERUP);break;case TutorialState.POWERUP:0==scene.player.body.velocity.y&&scene.player.body.touching.down&&(scene.tutorialState=TutorialState.POSTPOWERUP,scene.player.run());break;case TutorialState.POSTPOWERUP:scene.player.x<305?scene.player.incrementX(1.5):scene.tutorialState=TutorialState.PREOBSTACLE;break;case TutorialState.PREOBSTACLE:scene.player.setIdleSide(),scene.textBox.typeText("Avoid obstacles by jumping!",(()=>{setTimeout((()=>{scene.textBox.reset()}),1e3)})),scene.tutorialState=TutorialState.OBSTACLEJUMP;break;case TutorialState.OBSTACLEJUMP:scene.player.checkJump()&&(scene.player.jump(),scene.tutorialState=TutorialState.OBSTACLE);break;case TutorialState.OBSTACLE:scene.player.incrementX(1.5),0==scene.player.body.velocity.y&&scene.player.body.touching.down&&(scene.tutorialState=TutorialState.POSTOBSTACLE,scene.player.run());break;case TutorialState.POSTOBSTACLE:scene.player.x<430?scene.player.incrementX(1.5):scene.tutorialState=TutorialState.PRECARD;break;case TutorialState.PRECARD:scene.tweens.add({targets:scene.fullTint,fillAlpha:.6,duration:500,ease:"Sine.easeIn",repeat:0}),scene.player.setIdleSide(),scene.fortune_card.setVisibility(!0),scene.textBox.typeText("Once you complete each level, you'll unlock a Fortune Card!",(()=>{setTimeout((()=>{scene.textBox.typeText("Fortune Cards contain special promo codes you can use...",(()=>{setTimeout((()=>{scene.textBox.typeText("...to redeem online only on your Panda Express orders for a limited time!",(()=>{scene.tutorialState=TutorialState.CARD,setTimeout((()=>{scene.textBox.typeText("Ready to play? Go!",(()=>{setTimeout((()=>{scene.textBox.reset()}),1e3)}))}),1500)}))}),1500)}))}),1500)})),scene.tutorialState=TutorialState.PRECARDWAIT;break;case TutorialState.PRECARDWAIT:break;case TutorialState.CARD:scene.player.checkJump()&&(scene.tutorialState=TutorialState.POSTCARD);break;case TutorialState.POSTCARD:scene.tweens.add({targets:scene.fullTint,fillAlpha:0,duration:500,ease:"Sine.easeIn",repeat:0}),scene.fortune_card.setVisibility(!1),scene.player.run(),scene.tutorialState=TutorialState.END;break;case TutorialState.END:scene.player.incrementX(1.5)}}updateEndCutscene(scene){switch(scene.endCutsceneState){case EndCutsceneState$3.START:scene.player.setIdleSide(),scene.endCutsceneState=EndCutsceneState$3.PRENIAN,scene.textBox.setXY(170,90),scene.textBox.typeText("Nice work! You're gaining on him!"),setTimeout((()=>{scene.endCutsceneState=EndCutsceneState$3.NIAN}),1500);break;case EndCutsceneState$3.PRENIAN:break;case EndCutsceneState$3.NIAN:scene.nian.play("nian_smokeNIAN/SMOKE/smoke",!0),scene.nian.once("animationcomplete",(()=>{scene.endCutsceneState=EndCutsceneState$3.POSTNIAN,scene.cameras.main.stopFollow(),scene.textBox.reset()}));break;case EndCutsceneState$3.POSTNIAN:scene.cameras.main.fadeOut(2e3,0,0,0),scene.endCutsceneState=EndCutsceneState$3.FADEOUT,setTimeout((()=>{scene.endCutsceneState=EndCutsceneState$3.END}),2e3);break;case EndCutsceneState$3.FADEOUT:scene.player.setRunning(),scene.player.incrementX(1.5);break;case EndCutsceneState$3.END:scene.sound.stopAll(),scene.scene.stop(),scene.scene.start("Level1Fortune")}}getCheckpoints(){return this.checkpoints}}
908/**
909	 * @license
910	 * Copyright 2017 Google LLC
911	 *
912	 * Licensed under the Apache License, Version 2.0 (the "License");
913	 * you may not use this file except in compliance with the License.
914	 * You may obtain a copy of the License at
915	 *
916	 *   http://www.apache.org/licenses/LICENSE-2.0
917	 *
918	 * Unless required by applicable law or agreed to in writing, software
919	 * distributed under the License is distributed on an "AS IS" BASIS,
920	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
921	 * See the License for the specific language governing permissions and
922	 * limitations under the License.
923	 */
924/**
925	 * @license
926	 * Copyright 2017 Google LLC
927	 *
928	 * Licensed under the Apache License, Version 2.0 (the "License");
929	 * you may not use this file except in compliance with the License.
930	 * You may obtain a copy of the License at
931	 *
932	 *   http://www.apache.org/licenses/LICENSE-2.0
933	 *
934	 * Unless required by applicable law or agreed to in writing, software
935	 * distributed under the License is distributed on an "AS IS" BASIS,
936	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
937	 * See the License for the specific language governing permissions and
938	 * limitations under the License.
939	 */class Deferred{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((resolve,reject)=>{this.resolve=resolve,this.reject=reject}))}wrapCallback(callback){return(error,value)=>{error?this.reject(error):this.resolve(value),"function"==typeof callback&&(this.promise.catch((()=>{})),1===callback.length?callback(error):callback(error,value))}}}
940/**
941	 * @license
942	 * Copyright 2017 Google LLC
943	 *
944	 * Licensed under the Apache License, Version 2.0 (the "License");
945	 * you may not use this file except in compliance with the License.
946	 * You may obtain a copy of the License at
947	 *
948	 *   http://www.apache.org/licenses/LICENSE-2.0
949	 *
950	 * Unless required by applicable law or agreed to in writing, software
951	 * distributed under the License is distributed on an "AS IS" BASIS,
952	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
953	 * See the License for the specific language governing permissions and
954	 * limitations under the License.
955	 */class FirebaseError extends Error{constructor(code,message,customData){super(message),this.code=code,this.customData=customData,this.name="FirebaseError",Object.setPrototypeOf(this,FirebaseError.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ErrorFactory.prototype.create)}}class ErrorFactory{constructor(service,serviceName,errors){this.service=service,this.serviceName=serviceName,this.errors=errors}create(code,...data){const customData=data[0]||{},fullCode=`${this.service}/${code}`,template=this.errors[code],message=template?function(template,data){return template.replace(PATTERN,((_,key)=>{const value=data[key];return null!=value?String(value):`<${key}?>`}))}(template,customData):"Error",fullMessage=`${this.serviceName}: ${message} (${fullCode}).`;return new FirebaseError(fullCode,fullMessage,customData)}}const PATTERN=/\{\$([^}]+)}/g;function deepEqual(a,b){if(a===b)return!0;const aKeys=Object.keys(a),bKeys=Object.keys(b);for(const k of aKeys){if(!bKeys.includes(k))return!1;const aProp=a[k],bProp=b[k];if(isObject(aProp)&&isObject(bProp)){if(!deepEqual(aProp,bProp))return!1}else if(aProp!==bProp)return!1}for(const k of bKeys)if(!aKeys.includes(k))return!1;return!0}function isObject(thing){return null!==thing&&"object"==typeof thing}
956/**
957	 * @license
958	 * Copyright 2021 Google LLC
959	 *
960	 * Licensed under the Apache License, Version 2.0 (the "License");
961	 * you may not use this file except in compliance with the License.
962	 * You may obtain a copy of the License at
963	 *
964	 *   http://www.apache.org/licenses/LICENSE-2.0
965	 *
966	 * Unless required by applicable law or agreed to in writing, software
967	 * distributed under the License is distributed on an "AS IS" BASIS,
968	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
969	 * See the License for the specific language governing permissions and
970	 * limitations under the License.
971	 */function getModularInstance(service){return service&&service._delegate?service._delegate:service}class Component{constructor(name,instanceFactory,type){this.name=name,this.instanceFactory=instanceFactory,this.type=type,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(mode){return this.instantiationMode=mode,this}setMultipleInstances(multipleInstances){return this.multipleInstances=multipleInstances,this}setServiceProps(props){return this.serviceProps=props,this}setInstanceCreatedCallback(callback){return this.onInstanceCreated=callback,this}}
972/**
973	 * @license
974	 * Copyright 2019 Google LLC
975	 *
976	 * Licensed under the Apache License, Version 2.0 (the "License");
977	 * you may not use this file except in compliance with the License.
978	 * You may obtain a copy of the License at
979	 *
980	 *   http://www.apache.org/licenses/LICENSE-2.0
981	 *
982	 * Unless required by applicable law or agreed to in writing, software
983	 * distributed under the License is distributed on an "AS IS" BASIS,
984	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
985	 * See the License for the specific language governing permissions and
986	 * limitations under the License.
987	 */
988/**
989	 * @license
990	 * Copyright 2019 Google LLC
991	 *
992	 * Licensed under the Apache License, Version 2.0 (the "License");
993	 * you may not use this file except in compliance with the License.
994	 * You may obtain a copy of the License at
995	 *
996	 *   http://www.apache.org/licenses/LICENSE-2.0
997	 *
998	 * Unless required by applicable law or agreed to in writing, software
999	 * distributed under the License is distributed on an "AS IS" BASIS,
1000	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1001	 * See the License for the specific language governing permissions and
1002	 * limitations under the License.
1003	 */
1004class Provider{constructor(name,container){this.name=name,this.container=container,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(identifier){const normalizedIdentifier=this.normalizeInstanceIdentifier(identifier);if(!this.instancesDeferred.has(normalizedIdentifier)){const deferred=new Deferred;if(this.instancesDeferred.set(normalizedIdentifier,deferred),this.isInitialized(normalizedIdentifier)||this.shouldAutoInitialize())try{const instance=this.getOrInitializeService({instanceIdentifier:normalizedIdentifier});instance&&deferred.resolve(instance)}catch(e){}}return this.instancesDeferred.get(normalizedIdentifier).promise}getImmediate(options){var _a;const normalizedIdentifier=this.normalizeInstanceIdentifier(null==options?void 0:options.identifier),optional=null!==(_a=null==options?void 0:options.optional)&&void 0!==_a&&_a;if(!this.isInitialized(normalizedIdentifier)&&!this.shouldAutoInitialize()){if(optional)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:normalizedIdentifier})}catch(e){if(optional)return null;throw e}}getComponent(){return this.component}setComponent(component){if(component.name!==this.name)throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=component,this.shouldAutoInitialize()){if(function(component){return"EAGER"===component.instantiationMode}
1005/**
1006	 * @license
1007	 * Copyright 2019 Google LLC
1008	 *
1009	 * Licensed under the Apache License, Version 2.0 (the "License");
1010	 * you may not use this file except in compliance with the License.
1011	 * You may obtain a copy of the License at
1012	 *
1013	 *   http://www.apache.org/licenses/LICENSE-2.0
1014	 *
1015	 * Unless required by applicable law or agreed to in writing, software
1016	 * distributed under the License is distributed on an "AS IS" BASIS,
1017	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1018	 * See the License for the specific language governing permissions and
1019	 * limitations under the License.
1020	 */(component))try{this.getOrInitializeService({instanceIdentifier:"[DEFAULT]"})}catch(e){}for(const[instanceIdentifier,instanceDeferred]of this.instancesDeferred.entries()){const normalizedIdentifier=this.normalizeInstanceIdentifier(instanceIdentifier);try{const instance=this.getOrInitializeService({instanceIdentifier:normalizedIdentifier});instanceDeferred.resolve(instance)}catch(e){}}}}clearInstance(identifier="[DEFAULT]"){this.instancesDeferred.delete(identifier),this.instancesOptions.delete(identifier),this.instances.delete(identifier)}async delete(){const services=Array.from(this.instances.values());await Promise.all([...services.filter((service=>"INTERNAL"in service)).map((service=>service.INTERNAL.delete())),...services.filter((service=>"_delete"in service)).map((service=>service._delete()))])}isComponentSet(){return null!=this.component}isInitialized(identifier="[DEFAULT]"){return this.instances.has(identifier)}getOptions(identifier="[DEFAULT]"){return this.instancesOptions.get(identifier)||{}}initialize(opts={}){const{options:options={}}=opts,normalizedIdentifier=this.normalizeInstanceIdentifier(opts.instanceIdentifier);if(this.isInitialized(normalizedIdentifier))throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const instance=this.getOrInitializeService({instanceIdentifier:normalizedIdentifier,options:options});for(const[instanceIdentifier,instanceDeferred]of this.instancesDeferred.entries()){normalizedIdentifier===this.normalizeInstanceIdentifier(instanceIdentifier)&&instanceDeferred.resolve(instance)}return instance}onInit(callback,identifier){var _a;const normalizedIdentifier=this.normalizeInstanceIdentifier(identifier),existingCallbacks=null!==(_a=this.onInitCallbacks.get(normalizedIdentifier))&&void 0!==_a?_a:new Set;existingCallbacks.add(callback),this.onInitCallbacks.set(normalizedIdentifier,existingCallbacks);const existingInstance=this.instances.get(normalizedIdentifier);return existingInstance&&callback(existingInstance,normalizedIdentifier),()=>{existingCallbacks.delete(callback)}}invokeOnInitCallbacks(instance,identifier){const callbacks=this.onInitCallbacks.get(identifier);if(callbacks)for(const callback of callbacks)try{callback(instance,identifier)}catch(_a){}}getOrInitializeService({instanceIdentifier:instanceIdentifier,options:options={}}){let instance=this.instances.get(instanceIdentifier);if(!instance&&this.component&&(instance=this.component.instanceFactory(this.container,{instanceIdentifier:(identifier=instanceIdentifier,"[DEFAULT]"===identifier?void 0:identifier),options:options}),this.instances.set(instanceIdentifier,instance),this.instancesOptions.set(instanceIdentifier,options),this.invokeOnInitCallbacks(instance,instanceIdentifier),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,instanceIdentifier,instance)}catch(_a){}var identifier;return instance||null}normalizeInstanceIdentifier(identifier="[DEFAULT]"){return this.component?this.component.multipleInstances?identifier:"[DEFAULT]":identifier}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}
vendor: 5,782 bytes, lines 1020-1053
1020class ComponentContainer{constructor(name){this.name=name,this.providers=new Map}addComponent(component){const provider=this.getProvider(component.name);if(provider.isComponentSet())throw new Error(`Component ${component.name} has already been registered with ${this.name}`);provider.setComponent(component)}addOrOverwriteComponent(component){this.getProvider(component.name).isComponentSet()&&this.providers.delete(component.name),this.addComponent(component)}getProvider(name){if(this.providers.has(name))return this.providers.get(name);const provider=new Provider(name,this);return this.providers.set(name,provider),provider}getProviders(){return Array.from(this.providers.values())}}
1021/**
1022	 * @license
1023	 * Copyright 2017 Google LLC
1024	 *
1025	 * Licensed under the Apache License, Version 2.0 (the "License");
1026	 * you may not use this file except in compliance with the License.
1027	 * You may obtain a copy of the License at
1028	 *
1029	 *   http://www.apache.org/licenses/LICENSE-2.0
1030	 *
1031	 * Unless required by applicable law or agreed to in writing, software
1032	 * distributed under the License is distributed on an "AS IS" BASIS,
1033	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034	 * See the License for the specific language governing permissions and
1035	 * limitations under the License.
1036	 */var LogLevel;!function(LogLevel){LogLevel[LogLevel.DEBUG=0]="DEBUG",LogLevel[LogLevel.VERBOSE=1]="VERBOSE",LogLevel[LogLevel.INFO=2]="INFO",LogLevel[LogLevel.WARN=3]="WARN",LogLevel[LogLevel.ERROR=4]="ERROR",LogLevel[LogLevel.SILENT=5]="SILENT"}(LogLevel||(LogLevel={}));const levelStringToEnum={debug:LogLevel.DEBUG,verbose:LogLevel.VERBOSE,info:LogLevel.INFO,warn:LogLevel.WARN,error:LogLevel.ERROR,silent:LogLevel.SILENT},defaultLogLevel=LogLevel.INFO,ConsoleMethod={[LogLevel.DEBUG]:"log",[LogLevel.VERBOSE]:"log",[LogLevel.INFO]:"info",[LogLevel.WARN]:"warn",[LogLevel.ERROR]:"error"},defaultLogHandler=(instance,logType,...args)=>{if(logType<instance.logLevel)return;const now=(new Date).toISOString(),method=ConsoleMethod[logType];if(!method)throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);console[method](`[${now}]  ${instance.name}:`,...args)};
1037/**
1038	 * @license
1039	 * Copyright 2019 Google LLC
1040	 *
1041	 * Licensed under the Apache License, Version 2.0 (the "License");
1042	 * you may not use this file except in compliance with the License.
1043	 * You may obtain a copy of the License at
1044	 *
1045	 *   http://www.apache.org/licenses/LICENSE-2.0
1046	 *
1047	 * Unless required by applicable law or agreed to in writing, software
1048	 * distributed under the License is distributed on an "AS IS" BASIS,
1049	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1050	 * See the License for the specific language governing permissions and
1051	 * limitations under the License.
1052	 */
1053class PlatformLoggerServiceImpl{constructor(container){this.container=container}getPlatformInfoString(){return this.container.getProviders().map((provider=>{if(function(provider){const component=provider.getComponent();return"VERSION"===(null==component?void 0:component.type)}(provider)){const service=provider.getImmediate();return`${service.library}/${service.version}`}return null})).filter((logString=>logString)).join(" ")}}const name$o="@firebase/app",logger=new class{constructor(name){this.name=name,this._logLevel=defaultLogLevel,this._logHandler=defaultLogHandler,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(val){if(!(val in LogLevel))throw new TypeError(`Invalid value "${val}" assigned to \`logLevel\``);this._logLevel=val}setLogLevel(val){this._logLevel="string"==typeof val?levelStringToEnum[val]:val}get logHandler(){return this._logHandler}set logHandler(val){if("function"!=typeof val)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=val}get userLogHandler(){return this._userLogHandler}set userLogHandler(val){this._userLogHandler=val}debug(...args){this._userLogHandler&&this._userLogHandler(this,LogLevel.DEBUG,...args),this._logHandler(this,LogLevel.DEBUG,...args)}log(...args){this._userLogHandler&&this._userLogHandler(this,LogLevel.VERBOSE,...args),this._logHandler(this,LogLevel.VERBOSE,...args)}info(...args){this._userLogHandler&&this._userLogHandler(this,LogLevel.INFO,...args),this._logHandler(this,LogLevel.INFO,...args)}warn(...args){this._userLogHandler&&this._userLogHandler(this,LogLevel.WARN,...args),this._logHandler(this,LogLevel.WARN,...args)}error(...args){this._userLogHandler&&this._userLogHandler(this,LogLevel.ERROR,...args),this._logHandler(this,LogLevel.ERROR,...args)}}("@firebase/app"),PLATFORM_LOG_STRING={[name$o]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},_apps=new Map,_components=new Map;function _addComponent(app,component){try{app.container.addComponent(component)}
1053catch(e){logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`,e)}}function _registerComponent(component){const componentName=component.name;if(_components.has(componentName))return logger.debug(`There were multiple attempts to register component ${componentName}.`),!1;_components.set(componentName,component);for(const app of _apps.values())_addComponent(app,component);return!0}
1054/**
1055	 * @license
1056	 * Copyright 2019 Google LLC
1057	 *
1058	 * Licensed under the Apache License, Version 2.0 (the "License");
1059	 * you may not use this file except in compliance with the License.
1060	 * You may obtain a copy of the License at
1061	 *
1062	 *   http://www.apache.org/licenses/LICENSE-2.0
1063	 *
1064	 * Unless required by applicable law or agreed to in writing, software
1065	 * distributed under the License is distributed on an "AS IS" BASIS,
1066	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1067	 * See the License for the specific language governing permissions and
1068	 * limitations under the License.
1069	 */
1070const ERROR_FACTORY=new ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
1070d-log-argument":"First argument to `onLog` must be null or a function."});
1071/**
1072	 * @license
1073	 * Copyright 2019 Google LLC
1074	 *
1075	 * Licensed under the Apache License, Version 2.0 (the "License");
1076	 * you may not use this file except in compliance with the License.
1077	 * You may obtain a copy of the License at
1078	 *
1079	 *   http://www.apache.org/licenses/LICENSE-2.0
1080	 *
1081	 * Unless required by applicable law or agreed to in writing, software
1082	 * distributed under the License is distributed on an "AS IS" BASIS,
1083	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1084	 * See the License for the specific language governing permissions and
1085	 * limitations under the License.
1086	 */
1087class FirebaseAppImpl{constructor(options,config,container){this._isDeleted=!1,this._options=Object.assign({},options),this._config=Object.assign({},config),this._name=config.name,this._automaticDataCollectionEnabled=config.automaticDataCollectionEnabled,this._container=container,this.container.addComponent(new Component("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(val){this.checkDestroyed(),this._automaticDataCollectionEnabled=val}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(val){this._isDeleted=val}checkDestroyed(){if(this.isDeleted)throw ERROR_FACTORY.create("app-deleted",{appName:this._name})}}function getApp(name="[DEFAULT]"){const app=_apps.get(name);if(!app)throw ERROR_FACTORY.create("no-app",{appName:name});return app}function registerVersion(libraryKeyOrName,version,variant){var _a;let library=null!==(_a=PLATFORM_LOG_STRING[libraryKeyOrName])&&void 0!==_a?_a:libraryKeyOrName;variant&&(library+=`-${variant}`);const libraryMismatch=library.match(/\s|\//),versionMismatch=version.match(/\s|\//);if(libraryMismatch||versionMismatch){const warning=[`Unable to register library "${library}" with version "${version}":`];return libraryMismatch&&warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`),libraryMismatch&&versionMismatch&&warning.push("and"),versionMismatch&&warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`),void logger.warn(warning.join(" "))}_registerComponent(new Component(`${library}-version`,(()=>({library:library,version:version})),"VERSION"))}
1088/**
1089	 * @license
1090	 * Copyright 2019 Google LLC
1091	 *
1092	 * Licensed under the Apache License, Version 2.0 (the "License");
1093	 * you may not use this file except in compliance with the License.
1094	 * You may obtain a copy of the License at
1095	 *
1096	 *   http://www.apache.org/licenses/LICENSE-2.0
1097	 *
1098	 * Unless required by applicable law or agreed to in writing, software
1099	 * distributed under the License is distributed on an "AS IS" BASIS,
1100	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1101	 * See the License for the specific language governing permissions and
1102	 * limitations under the License.
1103	 */var variant;variant="",_registerComponent(new Component("platform-logger",(container=>new PlatformLoggerServiceImpl(container)),"PRIVATE")),registerVersion(name$o,"0.7.10",variant),registerVersion(name$o,"0.7.10","esm2017"),registerVersion("fire-js","");
1104/**
1105	 * @license
1106	 * Copyright 2020 Google LLC
1107	 *
1108	 * Licensed under the Apache License, Version 2.0 (the "License");
1109	 * you may not use this file except in compliance with the License.
1110	 * You may obtain a copy of the License at
1111	 *
1112	 *   http://www.apache.org/licenses/LICENSE-2.0
1113	 *
1114	 * Unless required by applicable law or agreed to in writing, software
1115	 * distributed under the License is distributed on an "AS IS" BASIS,
1116	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1117	 * See the License for the specific language governing permissions and
1118	 * limitations under the License.
1119	 */
1120registerVersion("firebase","9.6.0","app");function mapValues(o,f){const result={};for(const key in o)o.hasOwnProperty(key)&&(result[key]=f(o[key]));return result}
vendor: 4,151 bytes, lines 1120-1169
1120function encode(data){if(null==data)return null;if(data instanceof Number&&(data=data.valueOf()),"number"==typeof data&&isFinite(data))return data;if(!0===data||!1===data)return data;if("[object String]"===Object.prototype.toString.call(data))return data;if(data instanceof Date)return data.toISOString();if(Array.isArray(data))return data.map((x=>encode(x)));if("function"==typeof data||"object"==typeof data)return mapValues(data,(x=>encode(x)));throw new Error("Data cannot be encoded in JSON: "+data)}function decode(json){if(null==json)return json;if(json["@type"])switch(json["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{const value=Number(json.value);if(isNaN(value))throw new Error("Data cannot be decoded from JSON: "+json);return value}default:throw new Error("Data cannot be decoded from JSON: "+json)}return Array.isArray(json)?json.map((x=>decode(x))):"function"==typeof json||"object"==typeof json?mapValues(json,(x=>decode(x))):json}
1121/**
1122	 * @license
1123	 * Copyright 2020 Google LLC
1124	 *
1125	 * Licensed under the Apache License, Version 2.0 (the "License");
1126	 * you may not use this file except in compliance with the License.
1127	 * You may obtain a copy of the License at
1128	 *
1129	 *   http://www.apache.org/licenses/LICENSE-2.0
1130	 *
1131	 * Unless required by applicable law or agreed to in writing, software
1132	 * distributed under the License is distributed on an "AS IS" BASIS,
1133	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1134	 * See the License for the specific language governing permissions and
1135	 * limitations under the License.
1136	 */const errorCodeMap={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};
1137/**
1138	 * @license
1139	 * Copyright 2017 Google LLC
1140	 *
1141	 * Licensed under the Apache License, Version 2.0 (the "License");
1142	 * you may not use this file except in compliance with the License.
1143	 * You may obtain a copy of the License at
1144	 *
1145	 *   http://www.apache.org/licenses/LICENSE-2.0
1146	 *
1147	 * Unless required by applicable law or agreed to in writing, software
1148	 * distributed under the License is distributed on an "AS IS" BASIS,
1149	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1150	 * See the License for the specific language governing permissions and
1151	 * limitations under the License.
1152	 */class FunctionsError extends FirebaseError{constructor(code,message,details){super(`functions/${code}`,message||""),this.details=details}}
1153/**
1154	 * @license
1155	 * Copyright 2017 Google LLC
1156	 *
1157	 * Licensed under the Apache License, Version 2.0 (the "License");
1158	 * you may not use this file except in compliance with the License.
1159	 * You may obtain a copy of the License at
1160	 *
1161	 *   http://www.apache.org/licenses/LICENSE-2.0
1162	 *
1163	 * Unless required by applicable law or agreed to in writing, software
1164	 * distributed under the License is distributed on an "AS IS" BASIS,
1165	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1166	 * See the License for the specific language governing permissions and
1167	 * limitations under the License.
1168	 */
1169class ContextProvider{constructor(authProvider,messagingProvider,appCheckProvider){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=authProvider.getImmediate({optional:!0}),this.messaging=messagingProvider.getImmediate({optional:!0}),this.auth||authProvider.get().then((auth=>this.auth=auth),(()=>{})),this.messaging||messagingProvider.get().then((messaging=>this.messaging=messaging),(()=>{})),this.appCheck||appCheckProvider.get().then((appCheck=>this.appCheck=appCheck),(()=>{}))}async getAuthToken(){if(this.auth)try{const token=await this.auth.getToken();return null==token?void 0:token.accessToken}catch(e){return}}
1169async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(e){return}}async getAppCheckToken(){if(this.appCheck){const result=await this.appCheck.getToken();return result.error?null:result.token}return null}async getContext(){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken()}}}
1170/**
1171	 * @license
1172	 * Copyright 2017 Google LLC
1173	 *
1174	 * Licensed under the Apache License, Version 2.0 (the "License");
1175	 * you may not use this file except in compliance with the License.
1176	 * You may obtain a copy of the License at
1177	 *
1178	 *   http://www.apache.org/licenses/LICENSE-2.0
1179	 *
1180	 * Unless required by applicable law or agreed to in writing, software
1181	 * distributed under the License is distributed on an "AS IS" BASIS,
1182	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1183	 * See the License for the specific language governing permissions and
1184	 * limitations under the License.
1185	 */class FunctionsService{constructor(app,authProvider,messagingProvider,appCheckProvider,regionOrCustomDomain="us-central1",fetchImpl){this.app=app,this.fetchImpl=fetchImpl,this.emulatorOrigin=null,this.contextProvider=new ContextProvider(authProvider,messagingProvider,appCheckProvider),this.cancelAllRequests=new Promise((resolve=>{this.deleteService=()=>Promise.resolve(resolve())}));try{const url=new URL(regionOrCustomDomain);this.customDomain=url.origin,this.region="us-central1"}catch(e){this.customDomain=null,this.region=regionOrCustomDomain}}_delete(){return this.deleteService()}_url(name){const projectId=this.app.options.projectId;if(null!==this.emulatorOrigin){return`${this.emulatorOrigin}/${projectId}/${this.region}/${name}`}return null!==this.customDomain?`${this.customDomain}/${name}`:`https://${this.region}-${projectId}.cloudfunctions.net/${name}`}}function httpsCallable$1(functionsInstance,name,options){return data=>async function(functionsInstance,name,data,options){const url=functionsInstance._url(name),body={data:data=encode(data)},headers={},context=await functionsInstance.contextProvider.getContext();context.authToken&&(headers.Authorization="Bearer "+context.authToken);context.messagingToken&&(headers["Firebase-Instance-ID-Token"]=context.messagingToken);null!==context.appCheckToken&&(headers["X-Firebase-AppCheck"]=context.appCheckToken);const failAfterHandle=function(millis){let timer=null;return{promise:new Promise(((_,reject)=>{timer=setTimeout((()=>{reject(new FunctionsError("deadline-exceeded","deadline-exceeded"))}),millis)})),cancel:()=>{timer&&clearTimeout(timer)}}}(options.timeout||7e4),response=await Promise.race([postJSON(url,body,headers,functionsInstance.fetchImpl),failAfterHandle.promise,functionsInstance.cancelAllRequests]);if(failAfterHandle.cancel(),!response)throw new FunctionsError("cancelled","Firebase Functions instance was deleted.");const error=function(status,bodyJSON){let details,code=function(status){if(status>=200&&status<300)return"ok";switch(status){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(status),description=code;try{const errorJSON=bodyJSON&&bodyJSON.error;if(errorJSON){const status=errorJSON.status;if("string"==typeof status){if(!errorCodeMap[status])return new FunctionsError("internal","internal");code=errorCodeMap[status],description=status}const message=errorJSON.message;"string"==typeof message&&(description=message),details=errorJSON.details,void 0!==detail
1185s&&(details=decode(details))}}catch(e){}return"ok"===code?null:new FunctionsError(code,description,details)}(response.status,response.json);if(error)throw error;if(!response.json)throw new FunctionsError("internal","Response is not valid JSON object.");let responseData=response.json.data;void 0===responseData&&(responseData=response.json.result);if(void 0===responseData)throw new FunctionsError("internal","Response is missing data field.");return{data:decode(responseData)}}(functionsInstance,name,data,options||{})}async function postJSON(url,body,headers,fetchImpl){let response;headers["Content-Type"]="application/json";try{response=await fetchImpl(url,{method:"POST",body:JSON.stringify(body),headers:headers})}catch(e){return{status:0,json:null}}let json=null;try{json=await response.json()}catch(e){}return{status:response.status,json:json}}const name="@firebase/functions";function httpsCallable(functionsInstance,name,options){return httpsCallable$1(getModularInstance(functionsInstance),name,options)}!function(fetchImpl,variant){_registerComponent(new Component("functions",((container,{instanceIdentifier:regionOrCustomDomain})=>{const app=container.getProvider("app").getImmediate(),authProvider=container.getProvider("auth-internal"),messagingProvider=container.getProvider("messaging-internal"),appCheckProvider=container.getProvider("app-check-internal");return new FunctionsService(app,authProvider,messagingProvider,appCheckProvider,regionOrCustomDomain,fetchImpl)}),"PUBLIC").setMultipleInstances(!0)),registerVersion(name,"0.7.6",variant),registerVersion(name,"0.7.6","esm2017")}
1186/**
1187	 * @license
1188	 * Copyright 2020 Google LLC
1189	 *
1190	 * Licensed under the Apache License, Version 2.0 (the "License");
1191	 * you may not use this file except in compliance with the License.
1192	 * You may obtain a copy of the License at
1193	 *
1194	 *   http://www.apache.org/licenses/LICENSE-2.0
1195	 *
1196	 * Unless required by applicable law or agreed to in writing, software
1197	 * distributed under the License is distributed on an "AS IS" BASIS,
1198	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1199	 * See the License for the specific language governing permissions and
1200	 * limitations under the License.
1201	 */(fetch.bind(self));const firebaseConfig={apiKey:"AIzaSyBSSiPnSUFiavNv6rlWyAnWN-qA1UhIgQQ",authDomain:"panda-express-game.firebaseapp.com",projectId:"panda-express-game",storageBucket:"panda-express-game.appspot.com",messagingSenderId:"775410639237",appId:"1:775410639237:web:3394ef7a1cb6f6a61864ec",measurementId:"G-6CCK6BL32P"};let firebaseApp;try{firebaseApp=getApp()}catch(e){firebaseApp=function(options,rawConfig={}){"object"!=typeof rawConfig&&(rawConfig={name:rawConfig});const config=Object.assign({name:"[DEFAULT]",automaticDataCollectionEnabled:!1},rawConfig),name=config.name;if("string"!=typeof name||!name)throw ERROR_FACTORY.create("bad-app-name",{appName:String(name)});const existingApp=_apps.get(name);if(existingApp){if(deepEqual(options,existingApp.options)&&deepEqual(config,existingApp.config))return existingApp;throw ERROR_FACTORY.create("duplicate-app",{appName:name})}const container=new ComponentContainer(name);for(const component of _components.values())container.addComponent(component);const newApp=new FirebaseAppImpl(options,config,container);return _apps.set(name,newApp),newApp}(firebaseConfig)}const functions=function(app=getApp(),regionOrCustomDomain="us-central1"){const functionsProvider=function(app,name){return app.container.getProvider(name)}(getModularInstance(app),"functions");return functionsProvider.getImmediate({identifier:regionOrCustomDomain})}(firebaseApp);var host,port,FortuneState$3,StartCutsceneState$2,EndCutsceneState$2,FortuneState$2,StartCutsceneState$1,EndCutsceneState$1,FortuneState$1,StartCutsceneState,EndCutsceneState,FortuneState,EndState;"undefined"!=typeof window&&"localhost"!==window.location.hostname||!process.env.VUE_APP_FIREBASE_EMULATOR?console.log("Using Firebase cloud."):(console.log("Using Firebase emulator."),host="localhost",port=5001,function(functionsInstance,host,port){functionsInstance.emulatorOrigin=`http://${host}:${port}`}(getModularInstance(functions),host,port));class RotateForever extends UserComponent{constructor(gameObject){super(gameObject),this.gameObject=gameObject,gameObject.__RotateForever=this}static getComponent(gameObject){return gameObject.__RotateForever}gameObject;Rotationspeed=1;accumulator=0;fps=60;physicsTimestep;start(){this.physicsTimestep=1e3/this.fps}update(timestamp,elapsed){for(this.accumulator+=elapsed;this.accumulator>=this.physicsTimestep;)this.accumulator-=this.physicsTimestep,this.gameObject.angle+=this.Rotationspeed}}class RightCard extends phaser.GameObjects.Image{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"ui",frame??"level1_FortuneCard_Redeem"),this.scaleX=.3,this.scaleY=.3,this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}redeemDownloadImageTexture={key:"ui",frame:"save_level1"};element;redeemcodeElement;redeembtn;savebtn;code="Fetch code failed";start(){const imageData=this.scene.textures.getBase64(this.texture.key,this.frame.name);this.element=document.createElement("div"),this.element.style.position="absolute",this.visible||(this.element.style.visibility="hidden");
1201let redeemcardContainer=document.createElement("div");redeemcardContainer.className="redeemcard-container",redeemcardContainer.setAttribute("style","width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center"),this.element.appendChild(redeemcardContainer);let bg=document.createElement("img");bg.src=imageData,bg.id="bg",bg.setAttribute("style","width: 100%; height: 100%; position: absolute;"),redeemcardContainer.appendChild(bg);let insideContainer=document.createElement("div");insideContainer.setAttribute("style","width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; position: relative; margin-top: 30%; text-align: center"),redeemcardContainer.appendChild(insideContainer),this.redeemcodeElement=document.createElement("p"),this.redeemcodeElement.className="redeemcode",this.redeemcodeElement.textContent=this.code,this.redeemcodeElement.setAttribute("style","color: white;text-transform: uppercase;font-size: 10px;transform: scale(0.5);margin-top: 33%;"),insideContainer.appendChild(this.redeemcodeElement),this.redeembtn=document.createElement("a"),this.redeembtn.className="btn",this.redeembtn.href="#",this.redeembtn.textContent="Redeem Now",this.redeembtn.onclick=async()=>{try{window.gtag("event","Redeem_Code"),window.fbq("track","Lead")}catch(e){console.log(e)}try{if(window.facebookCheck())return function(text){var textArea=document.createElement("textarea");textArea.value=text,textArea.style.top="0",textArea.style.left="0",textArea.style.position="fixed",document.body.appendChild(textArea),textArea.focus(),textArea.select();try{var msg=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+msg)}catch(err){console.error("Fallback: Oops, unable to copy",err)}document.body.removeChild(textArea)}(this.code),void alert("Copied to clipboard! Visit order.pandaexpress.com to redeem coupon code.");if(navigator.clipboard){await navigator.clipboard.writeText(this.code),alert("Copied to clipboard!");const url="https://order.pandaexpress.com";window.mobileCheck(),openNewTab(url)}else alert("Copy to clipboard not supported by browser. Please write down coupon code and redeem at order.pandaexpress.com")}catch(e){alert("Copy to clipboard not supported by browser. Please write down coupon code and redeem at order.pandaexpress.com"),console.log(e)}},insideContainer.appendChild(this.redeembtn),this.savebtn=document.createElement("a"),this.savebtn.className="btn",this.savebtn.href="#",this.savebtn.textContent="Save for Later";const rightCard=this;this.savebtn.onclick=async()=>{window.gtag("event","Save_Code"),window.fbq("track","Lead");try{if(window.facebookCheck())return void alert("Please open game outside of Facebook browser to save coupon code!");var canvas=document.createElement("canvas");canvas.width=1144,canvas.height=900,canvas.style.position="absolute",canvas.style.left="-5000px",document.body.appendChild(canvas);const imageData=rightCard.scene.textures.getBase64(rightCard.redeemDownloadImageTexture.key,rightCard.redeemDownloadImageTexture.frame);var image=new Image;image.onload=()=>{var ctx=canvas.getContext("2d");
1201ctx.drawImage(image,0,0),ctx.font="16px PixelOperator",ctx.fillStyle="#ffce1c",ctx.textAlign="center",ctx.fillText(rightCard.code,860,375),window.iphoneCheck()?alert("Please take a screenshot to save redeem code."):navigator.share&&window.mobileAndTabletCheck()?canvas.toBlob((async blob=>{const file=new File([blob],"panda-express-coupon.png",{type:"image/png"});await navigator.share({files:[file]})}),"image/png"):function(uri,name){var link=document.createElement("a");link.download=name,link.href=uri,document.body.appendChild(link),link.click(),document.body.removeChild(link),link.remove()}(canvas.toDataURL(),"panda-express-coupon.png")},image.src=imageData}catch(e){alert("Please take a screenshot to save redeem code."),console.log(e)}},insideContainer.appendChild(this.savebtn),this.applyTransform(),window.document.body.appendChild(this.element),window.addEventListener("resize",(event=>{setTimeout((()=>{this.applyTransform()}),10)}),!0),this.visible=!1}applyTransform(){const canvas=document.getElementsByTagName("canvas")[0];let rect=canvas.getBoundingClientRect();this.element.style.width=String(Math.floor(this.width*this.scaleX*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.height=String(Math.floor(this.height*this.scaleY*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.element.style.left=String(rect.left+Math.floor((this.x-this.width*this.scaleX*this.originX)*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.top=String(rect.top+Math.floor((this.y-this.height*this.scaleY*this.originY)*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.redeemcodeElement.style.fontSize=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*33))+"px",this.redeembtn.style.width=String(Math.floor(680*this.scaleX*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.redeembtn.style.height=String(Math.floor(167*this.scaleY*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.redeembtn.style.fontSize=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*40))+"px",this.redeembtn.style.lineHeight=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*167))+"px",this.redeembtn.style.marginBottom=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*-53))+"px",this.savebtn.style.width=String(Math.floor(680*this.scaleX*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.savebtn.style.height=String(Math.floor(167*this.scaleY*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.savebtn.style.fontSize=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*40))+"px",this.savebtn.style.lineHeight=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*167))+"px",this.savebtn.style.marginBottom=String(Math.round(parseInt(canvas.style.width,10)*this.scaleX/this.scene.scale.width*-53))+"px"}setVisibility(isVisible){this.element.style.visibility=isVisible?"visible":"hidden"}setDomScale(scaleX,scaleY){this.scaleX=scaleX,this.scaleY=scaleY,this.applyTransform()}setCode(code){this.code=code,this.redeemcodeElement.textContent=this.code}nudge(amount){this.x+=amount,this.applyTransform()}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this),this.element&&this.element.remove()}}function openNewTab(url){setTimeout((()=>{window.open(url,"about:blank")}),0)}class Card extends phaser.GameObjects.Image{constructor(scene,x,y,texture,frame){super(scene,x??0,y??0,texture||"ui",frame??"FortuneCard_Chowmein_front"),this.scaleX=.3,this.scaleY=.3,this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}backTexture={key:"ui",frame:"FortuneCard_Chowmeinl_back"};element;inner;frontImage;backImage;start(){let frontImageData=this.scene.textures.getBase64(this.texture.key,this.frame.name),backImageData=this.scene.textures.getBase64(this.backTexture.key,this.backTexture.frame);this.element=document.createElement("div"),this.element.style.position="absolute",this.element.style.zIndex="10",this.element.style.perspective="1000px",this.visible||(this.element.style.visibility="hidden"),this.inner=document.createElement("div"),this.inner.style.position="relative",this.inner.style.width="100%",this.inner.style.height="100%",this.inner.style.textAlign="center",this.inner.style.transition="transform 0.8s",this.inner.style.transformStyle="preserve-3d",this.element.appendChild(this.inner);let frontContainer=document.createElement("div");frontContainer.style.position="absolute",frontContainer.style.width="100%",frontContainer.style.height="100%",this.inner.appendChild(frontContainer);let backContainer=document.createElement("div");backContainer.style.position="absolute",backContainer.style.width="100%",backContainer.style.height="100%",backContainer.style.transform="rotateY(180deg) translateZ(1px)",this.inner.appendChild(backContainer),this.frontImage=document.createElement("img"),this.frontImage.style.width="100%",this.frontImage.style.height="100%",this.frontImage.src=frontImageData,frontContainer.appendChild(this.frontImage),this.backImage=document.createElement("img"),this.backImage.style.width="100%",this.backImage.style.height="100%",this.backImage.src=backImageData,backContainer.appendChild(this.backImage),this.applyTransform(),window.document.body.appendChild(this.element),window.addEventListener("resize",(event=>{setTimeout((()=>{this.applyTransform()}),10)}),!0),this.visible=!1}applyTransform(){const canvas=document.getElementsByTagName("canvas")[0];let rect=canvas.getBoundingClientRect();this.element.style.width=String(Math.floor(this.width*this.scaleX*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.height=String(Math.floor(this.height*this.scaleY*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.element.style.left=String(rect.left+Math.floor((this.x-this.width*this.scaleX*this.originX)
1201*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.top=String(rect.top+Math.floor((this.y-this.height*this.scaleY*this.originY)*parseInt(canvas.style.height,10)/this.scene.scale.height))}setVisibility(isVisible){this.element.style.visibility=isVisible?"visible":"hidden"}setDomScale(scaleX,scaleY){this.scaleX=scaleX,this.scaleY=scaleY,this.applyTransform()}flip(){this.inner.style.transform="rotateY(-180deg)"}nudge(amount){this.x+=amount,this.applyTransform()}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this),this.element&&this.element.remove()}}class Disclaimer extends phaser.GameObjects.Text{constructor(scene,x,y){super(scene,x??0,y??0,"",{}),this.scene.events.once(phaser.Scenes.Events.UPDATE,this.start,this),this.scene.events.once(phaser.Scenes.Events.DESTROY,this.destroy,this)}element;textElement;link;start(){this.element=document.createElement("div"),this.element.style.width="320px",this.element.style.height="50px",this.element.style.position="absolute",this.visible||(this.element.style.visibility="hidden"),this.textElement=document.createElement("div"),this.textElement.setAttribute("style","margin-top: 10px;font-size: 7px;font-family: Arial, Helvetica, sans-serif;color: #000000;font-style: italic;text-align: center;"),this.link=document.createElement("a"),this.link.setAttribute("href","https://pandaex.press/lny"),this.link.setAttribute("target","_blank"),this.link.textContent="https://pandaex.press/lny",this.link.setAttribute("style","font-size: 7px;font-family: Arial, Helvetica, sans-serif;color: #000000;font-style: italic;"),this.textElement.textContent=this.text+" Visit ";let extratext=document.createElement("span");extratext.textContent=" for more details",this.textElement.appendChild(this.link),this.textElement.appendChild(extratext),this.element.appendChild(this.textElement),this.visible=!1,this.applyTransform(),window.document.body.appendChild(this.element),window.addEventListener("resize",(event=>{setTimeout((()=>{this.applyTransform()}),10)}),!0)}applyTransform(){const canvas=document.getElementsByTagName("canvas")[0];let rect=canvas.getBoundingClientRect();this.element.style.width=String(Math.floor(320*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.height=String(Math.floor(50*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.element.style.left=String(rect.left+Math.floor((this.x-320*this.originX)*parseInt(canvas.style.width,10)/this.scene.scale.width)),this.element.style.top=String(rect.top+Math.floor((this.y-50*this.originY)*parseInt(canvas.style.height,10)/this.scene.scale.height)),this.textElement.style.fontSize=String(Math.round(7*parseInt(canvas.style.width,10)/this.scene.scale.width))+"px",this.textElement.style.marginTop=String(Math.round(10*parseInt(canvas.style.width,10)/this.scene.scale.width))+"px",this.link.style.fontSize=String(Math.round(7*parseInt(canvas.style.width,10)/this.scene.scale.width))+"px"}setVisibility(isVisible){this.element.style.visibility=isVisible?"visible":"hidden"}destroy(){this.scene.events.off(phaser.Scenes.Events.UPDATE,this.start,this),this.element&&this.element.remove()}}!function(FortuneState){FortuneState[FortuneState.START=1]="START",FortuneState[FortuneState.BANNERWAIT=2]="BANNERWAIT",FortuneState[FortuneState.CARDEXPAND=3]="CARDEXPAND",FortuneState[FortuneState.CARDLEFTWAIT=4]="CARDLEFTWAIT",FortuneState[FortuneState.CARDFLIP=5]="CARDFLIP",FortuneState[FortuneState.BOTHCARDSMOVE=6]="BOTHCARDSMOVE",FortuneState[FortuneState.BOTHCARDSWAIT=7]="BOTHCARDSWAIT",FortuneState[FortuneState.END=8]="END"}(FortuneState$3||(FortuneState$3={}));class Level1Fortune extends phaser.Scene{constructor(){super("Level1Fortune")}editorCreate(){const rectangle=this.add.rectangle(0,0,640,360);rectangle.setOrigin(0,0),rectangle.isFilled=!0,rectangle.fillColor=1919412;const starburst=this.add.sprite(320,180,"cutscenes","MISC/STARBURST/starburst00000");starburst.scaleX=4,starburst.scaleY=4,starburst.alpha=.06,starburst.alphaTopLeft=.06,starburst.alphaTopRight=.06,starburst.alphaBottomLeft=.06,starburst.alphaBottomRight=.06;const clickableButton=new ClickableButton(this,568,330);this.add.existing(clickableButton),clickableButton.visible=!1;const eNVIRONMENT_LEVEL3_l3_firework_b_0=this.add.sprite(52,158,"environments","ENVIRONMENT/LEVEL3/l3_firework_b_0");eNVIRONMENT_LEVEL3_l3_firework_b_0.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1=this.add.sprite(560,97,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1=this.add.sprite(149,305,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1.setOrigin(0,1);const good_fortune_unlocked=this.add.sprite(106,224,"cutscenes","MISC/ENDLEVEL/endlevel_00000");good_fortune_unlocked.setOrigin(0,1);const card_right=new RightCard(this,320,180,"ui","level1_FortuneCard_Redeem");this.add.existing(card_right),card_right.scaleX=.3,card_right.scaleY=.3,card_right.visible=!1;const card_left=new Card(this,320,180,"ui","FortuneCard_Eggroll_front");this.add.existing(card_left),card_left.scaleX=.3,card_left.scaleY=.3,card_left.visible=!1;const disclaimer=new Disclaimer(this,320,330);this.add.existing(disclaimer),disclaimer.setOrigin(.5,.5),disclaimer.visible=!1,disclaimer.text="$3 off Family Meal purchase. Tax, delivery, service, and premium entrée fee extra. One coupon per person per order. Valid online only. Expires 2/28/22.";const textBox=new TextBox(this,510,314);this.add.existing(textBox),textBox.scaleX=.6,textBox.scaleY=.6;new StartAnimation(starburst).AnimationName="MISC/STARBURST/starburst";new RotateForever(starburst).Rotationspeed=.2,clickableButton.textString="CONTINUE",clickableButton.nextSceneKey="Level2";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_b";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(good_fortune_unlocked).AnimationName="MISC/ENDLEVEL/endlevel",card_left.backTexture={key:"ui",frame:"FortuneCard_Eggroll_back"},this.clickableButton=clickableButton,this.good_fortune_unlocked=good_fortune_unlocked,this.card_right=card_right,this.card_left=card_left,this.disclaimer=disclaimer,this.textBox=textBox,this.events.emit("scene-awake")}clickableButton;good_fortune_unlocked;card_right;card_left;disclaimer;textBox;fortuneState;accumulator=0;fps=60;physicsTimestep;domScaleX=0;domScaleY=0;cardPixelCounter=0;code;create(){window.gtag("event","Level1Redeem"),this.editorCreate(),this.scale.setGameSize(640,360),this.fortuneState=FortuneState$3.START,this.sound.add("fortunecard").play(),this.physicsTimestep=1e3/this.fps}update(timestamp,elapsed){for(this.accumulator+=elapsed;this.accumulator>=this.physicsTimestep;)switch(this.accumulator-=this.physicsTimestep,this.fortuneState){case FortuneState$3.START:httpsCallable(functions,"getCode")({type:"level1"}).then((result=>{result.data&&result.data.codes&&result.data.codes.length>
12010&&result.data.codes[0].code&&(this.code=result.data.codes[0].code,this.card_right.setCode(this.code))})).catch((error=>{console.log(error)})),this.fortuneState=FortuneState$3.BANNERWAIT,this.domScaleX=0,this.domScaleY=0,this.card_left.setDomScale(this.domScaleX,this.domScaleY),setTimeout((()=>{this.textBox.typeText("Egg-cellent! You've unlocked the Egg Roll Wealth Card!",(()=>{setTimeout((()=>{this.textBox.typeText("Redeem your code now, or save for later and keep playing!",(()=>{setTimeout((()=>{this.textBox.reset(),this.fortuneState=FortuneState$3.CARDEXPAND,this.good_fortune_unlocked.visible=!1,this.card_left.setVisibility(!0),setTimeout((()=>{this.clickableButton.visible=!0}),3500)}),2e3)}))}),1500)}))}),500);break;case FortuneState$3.BANNERWAIT:break;case FortuneState$3.CARDEXPAND:this.domScaleX+=.0066,this.domScaleY+=.0066,this.card_left.setDomScale(this.domScaleX,this.domScaleY),this.domScaleX>=.3&&(this.fortuneState=FortuneState$3.CARDLEFTWAIT,setTimeout((()=>{this.fortuneState=FortuneState$3.CARDFLIP}),1e3));break;case FortuneState$3.CARDLEFTWAIT:break;case FortuneState$3.CARDFLIP:this.card_left.flip(),this.card_right.setVisibility(!0),this.fortuneState=FortuneState$3.BOTHCARDSMOVE;break;case FortuneState$3.BOTHCARDSMOVE:this.cardPixelCounter++,this.card_left.nudge(-2),this.card_right.nudge(2),this.cardPixelCounter>45&&(this.fortuneState=FortuneState$3.BOTHCARDSWAIT,this.disclaimer.setVisibility(!0),setTimeout((()=>{this.fortuneState=FortuneState$3.END}),4e3));case FortuneState$3.BOTHCARDSWAIT:case FortuneState$3.END:}}}class ScrollFactor extends UserComponent{constructor(gameObject){super(gameObject),this.gameObject=gameObject,gameObject.__ScrollFactor=this}static getComponent(gameObject){return gameObject.__ScrollFactor}gameObject;x=0;y=0;start(){this.gameObject.setScrollFactor(this.x,this.y)}}!function(StartCutsceneState){StartCutsceneState[StartCutsceneState.START=1]="START",StartCutsceneState[StartCutsceneState.IDLE=2]="IDLE",StartCutsceneState[StartCutsceneState.TEXT=3]="TEXT",StartCutsceneState[StartCutsceneState.READY=4]="READY",StartCutsceneState[StartCutsceneState.GO=5]="GO"}(StartCutsceneState$2||(StartCutsceneState$2={})),function(EndCutsceneState){EndCutsceneState[EndCutsceneState.START=1]="START",EndCutsceneState[EndCutsceneState.PRENIAN=2]="PRENIAN",EndCutsceneState[EndCutsceneState.NIAN=3]="NIAN",EndCutsceneState[EndCutsceneState.POSTNIAN=4]="POSTNIAN",EndCutsceneState[EndCutsceneState.FADEOUT=5]="FADEOUT",EndCutsceneState[EndCutsceneState.END=6]="END"}(EndCutsceneState$2||(EndCutsceneState$2={}));class Level2 extends PandaScene{constructor(){super("Level2")}editorCreate(){this.add.tileSprite(0,180,3900,180,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_sky").setOrigin(0,1);const bG_far=this.add.container(0,0),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_4=this.add.image(1025,75,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_4");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_4.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_4);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7_1=this.add.image(1780,45,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_7");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_7_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2=this.add.image(1970,60,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_2);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2=this.add.image(2300,60,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_2");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_2);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_6=this.add.image(2210,30,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_6");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_6.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_6);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1=this.add.image(1445,50,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1.flipX=!0,bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1_1=this.add.image(1194,44,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_1");eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_1_skyline_tile=this.add.tileSprite(0,140,4e3,72,"environments","ENVIRONMENT/LEVEL2/l2_bg_1_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_1_skyline_tile.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_1_skyline_tile);const eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile=this.add.image(0,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_2_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile);const eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile_1=this.add.image(320,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_2_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile_1);const eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile_1_1=this.add.image(640,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_2_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile_1_1.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_2_skyline_tile_1_1);const eNVIRONMENT_LEVEL1_l1_bg_0_sun=this.add.image(490,75,"environments","ENVIRONMENT/LEVEL1/l1_bg_0_sun");eNVIRONMENT_LEVEL1_l1_bg_0_sun.scaleX=2,eNVIRONMENT_LEVEL1_l1_bg_0_sun.scaleY=2,eNVIRONMENT_LEVEL1_l1_bg_0_sun.setOrigin(0,1),bG_far.add(eNVIRONMENT_LEVEL1_l1_bg_0_sun);const eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5=this.add.image(1766,55,"environments","ENVIRONMENT/LEVEL2/l2_bg_0_clouds_5");bG_far.add(eNVIRONMENT_LEVEL2_l2_bg_0_clouds_5);const bG_Mid=this.add.container(0,0),eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1=this.add.image(1552,178,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1.alpha=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1.alphaTopLeft=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1.alphaTopRight=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1.alphaBottomLeft=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1.alphaBottomRight=.6,bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2_1);const eNVIRONMENT_LEVEL2_l2_bg_3_1_light=this.add.image(0,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");eNVIRONMENT_LEVEL2_l2_bg_3_1_light.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light);const eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1=this.add.image(1105,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_2-1_light");eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1);const eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left=this.add.image(0,180,"environments","ENVIRONMENT/LEVEL2/l2_bg_1_skyline_left");eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left);const eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile=this.add.image(0,164,"environments","ENVIRONMENT/LEVEL2/l2_bg_3_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile);const eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile_1=this.add.image(320,164,"environments","ENVIRONMENT/LEVEL2/l2_bg_3_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile_1);const eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile_1_1=this.add.image(640,164,"environments","ENVIRONMENT/LEVEL2/l2_bg_3_skyline_tile");eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile_1_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_skyline_tile_1_1);const eNVIRONMENT_LEVEL2_l2_bg_2_1_light=this.add.image(140,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_2-1_light");eNVIRONMENT_LEVEL2_l2_bg_2_1_light.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_2_1_light);const eNVIRONMENT_LEVEL2_l2_bg_3_skyline_right=this.add.image(1030,80,"environments","ENVIRONMENT/LEVEL2/l2_bg_3_skyline_right");bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_skyline_right);const eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1=this.add.image(560,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1);const eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1_1=this.add.image(675,155,"environments","ENVIRONMENT/LEVEL2/l2_bg_2-1_light");eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1_1);const eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled=this.add.image(1220,192,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.alpha=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.alphaTopLeft=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.alphaTopRight=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.alphaBottomLeft=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled.alphaBottomRight=.6,bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled);const eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_1=this.add.image(1910,205,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_1.flipX=!0,bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_1);const eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2=this.add.image(1765,185,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2.alpha=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2.alphaTopLeft=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2.alphaTopRight=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2.alphaBottomLeft=.6,eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2.alphaBottomRight=.6,bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_2);const eNVIRONMENT_LEVEL2_l2_bg_mountain_houses=this.add.image(1764,186,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_houses");eNVIRONMENT_LEVEL2_l2_bg_mountain_houses.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_houses);const eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_3=this.add.image(2160,
1201190,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_3.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_3);const eNVIRONMENT_LEVEL2_l2_bg_3_1_light_2=this.add.image(1016,168,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");eNVIRONMENT_LEVEL2_l2_bg_3_1_light_2.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light_2);const eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1_2=this.add.image(1756,128,"environments","ENVIRONMENT/LEVEL2/l2_bg_2-1_light");eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1_2.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1_2);const eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_4=this.add.image(2704,172,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_assembled");eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_4.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_assembled_4);const eNVIRONMENT_LEVEL2_l2_bg_3_1_light_2_1=this.add.image(2490,150,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");eNVIRONMENT_LEVEL2_l2_bg_3_1_light_2_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light_2_1);const eNVIRONMENT_LEVEL2_l2_bg_mountain_1=this.add.image(3206,156,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_1");eNVIRONMENT_LEVEL2_l2_bg_mountain_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_1);const eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_2=this.add.image(1574,164,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_houses");eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_2.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_2);const eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_2_1=this.add.image(1042,184,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_houses");eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_2_1.setOrigin(0,1),bG_Mid.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_2_1);const bG_Close=this.add.container(0,0),eNVIRONMENT_LEVEL2_l2_bg_4_trunks=this.add.tileSprite(95,180,1480,180,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_trunks");eNVIRONMENT_LEVEL2_l2_bg_4_trunks.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_trunks);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left=this.add.image(0,0,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_left");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left.setOrigin(0,0),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile=this.add.image(104,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1=this.add.image(424,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1_1=this.add.image(744,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1_1);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right=this.add.image(1064,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_right");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1_1_1=this.add.tileSprite(1158,58,400,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right_1=this.add.image(1546,58,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_right");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right_1);const eNVIRONMENT_LEVEL2_l2_bg_4_trunks_1=this.add.tileSprite(2764,180,1480,180,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_trunks");eNVIRONMENT_LEVEL2_l2_bg_4_trunks_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_trunks_1);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2=this.add.tileSprite(2852,58,1e3,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2.tintTopLeft=7535973,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2.tintTopRight=7535973,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2.tintBottomLeft=7535973,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2.tintBottomRight=7535973,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile_2);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1=this.add.image(2748,58,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_left");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1.tintTopLeft=7535973,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1.tintTopRight=7535973,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1.tintBottomLeft=7535973,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1.tintBottomRight=7535973,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1);const eNVIRONMENT_LEVEL2_l2_gate_rear=this.add.image(2524,180,"environments","ENVIRONMENT/LEVEL2/l2_gate_rear");eNVIRONMENT_LEVEL2_l2_gate_rear.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL2_l2_gate_rear);const eNVIRONMENT_LEVEL2_l2_gate_rear_1=this.add.image(2758,180,"environments","ENVIRONMENT/LEVEL2/l2_gate_rear");eNVIRONMENT_LEVEL2_l2_gate_rear_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_gate_rear_1.flipX=!0,bG_Close.add(eNVIRONMENT_LEVEL2_l2_gate_rear_1);const mG_Group=this.add.container(0,0),eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_1=this.add.image(2480,44,"environments","ENVIRONMENT/LEVEL2/l2_bg_mountain_houses");eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_1.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_mountain_houses_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_0_1=this.add.tileSprite(1998,162,800,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_0=this.add.tileSprite(2722,162,800,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1_1=this.add.tileSprite(1448,164,400,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1=this.add.image(1818,162,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1=this.add.image(1666,160,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1=this.add.image(1848,132,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1=this.add.image(1390,122,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1=this.add.image(1142,120,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1=this.add.image(1278,118,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_2=this.add.tileSprite(0,160,1192,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_2");eNVIRONMENT_LEVEL2_l2_bg_grass_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_2);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1=this.add.image(1720,158,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_1=this.add.tileSprite(1442,180,420,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_1);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile=this.add.tileSprite(1200,180,85,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_2=this.add.tileSprite(950,180,200,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_2);const eNVIRONMENT_LEVEL2_l2_ground_1=this.add.tileSprite(1904,180,2e3,36,"environments","ENVIRONMENT/LEVEL2/l2_ground");eNVIRONMENT_LEVEL2_l2_ground_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_ground_1);const eNVIRONMENT_LEVEL2_l2_ground=this.add.tileSprite(0,180,950,36,"environments","ENVIRONMENT/LEVEL2/l2_ground");eNVIRONMENT_LEVEL2_l2_ground.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_ground);
1201const eNVIRONMENT_LEVEL2_l2_rocks_small_2_1=this.add.image(1986,180,"environments","ENVIRONMENT/LEVEL2/l2_rocks_small_2");eNVIRONMENT_LEVEL2_l2_rocks_small_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_small_2_1);const eNVIRONMENT_LEVEL2_l2_rocks_small_2=this.add.image(1910,180,"environments","ENVIRONMENT/LEVEL2/l2_rocks_small_2");eNVIRONMENT_LEVEL2_l2_rocks_small_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_small_2);const eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_2=this.add.sprite(1910,180,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_waterfall_0");eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_2);const eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_1=this.add.sprite(1314,226,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_waterfall_0");eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_1);const eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0=this.add.sprite(1314,170,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_waterfall_0");eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0);const eNVIRONMENT_LEVEL2_l2_island_1=this.add.image(2456,106,"environments","ENVIRONMENT/LEVEL2/l2_island_1");eNVIRONMENT_LEVEL2_l2_island_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_1);const eNVIRONMENT_LEVEL2_l2_island_2_1=this.add.image(2078,94,"environments","ENVIRONMENT/LEVEL2/l2_island_2");eNVIRONMENT_LEVEL2_l2_island_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_2_1);const eNVIRONMENT_LEVEL2_l2_island_1_1=this.add.image(1672,178,"environments","ENVIRONMENT/LEVEL2/l2_island_1");eNVIRONMENT_LEVEL2_l2_island_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_1_1);const eNVIRONMENT_LEVEL2_l2_island_3=this.add.image(1596,136,"environments","ENVIRONMENT/LEVEL2/l2_island_3");eNVIRONMENT_LEVEL2_l2_island_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_3);const eNVIRONMENT_LEVEL2_l2_island_2=this.add.image(1482,94,"environments","ENVIRONMENT/LEVEL2/l2_island_3");eNVIRONMENT_LEVEL2_l2_island_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_2);const eNVIRONMENT_LEVEL2_l2_island_3_1=this.add.image(558,114,"environments","ENVIRONMENT/LEVEL2/l2_island_3");eNVIRONMENT_LEVEL2_l2_island_3_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_3_1);const eNVIRONMENT_LEVEL2_l2_rocks_medium_1_2_1_1=this.add.sprite(1846,196,"environments","ENVIRONMENT/LEVEL2/l2_rocks_medium_1");eNVIRONMENT_LEVEL2_l2_rocks_medium_1_2_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_medium_1_2_1_1);const eNVIRONMENT_LEVEL2_l2_rocks_medium_1_2_1=this.add.sprite(1730,226,"environments","ENVIRONMENT/LEVEL2/l2_rocks_medium_1");eNVIRONMENT_LEVEL2_l2_rocks_medium_1_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_medium_1_2_1);const eNVIRONMENT_LEVEL2_l2_rocks_medium_2=this.add.image(1392,102,"environments","ENVIRONMENT/LEVEL2/l2_rocks_medium_2");eNVIRONMENT_LEVEL2_l2_rocks_medium_2.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_medium_2);const eNVIRONMENT_LEVEL2_l2_rocks_medium_1_1=this.add.image(1278,180,"environments","ENVIRONMENT/LEVEL2/l2_rocks_medium_1");eNVIRONMENT_LEVEL2_l2_rocks_medium_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_rocks_medium_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_medium_1_1);const eNVIRONMENT_LEVEL2_l2_bridge_left_1=this.add.image(1255,100,"environments","ENVIRONMENT/LEVEL2/l2_bridge_right");eNVIRONMENT_LEVEL2_l2_bridge_left_1.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_left_1);const eNVIRONMENT_LEVEL2_l2_bridge_tile=this.add.image(1225,99,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile);const eNVIRONMENT_LEVEL2_l2_bridge_left=this.add.image(1203,100,"environments","ENVIRONMENT/LEVEL2/l2_bridge_left");eNVIRONMENT_LEVEL2_l2_bridge_left.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_left);const eNVIRONMENT_LEVEL2_l2_rocks_medium_1=this.add.image(1140,180,"environments","ENVIRONMENT/LEVEL2/l2_rocks_medium_1");eNVIRONMENT_LEVEL2_l2_rocks_medium_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_medium_1);const eNVIRONMENT_LEVEL2_l2_rocks_small_1=this.add.image(1048,180,"environments","ENVIRONMENT/LEVEL2/l2_rocks_small_1");eNVIRONMENT_LEVEL2_l2_rocks_small_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_small_1);const eNVIRONMENT_LEVEL2_l2_rocks_small_1_1=this.add.image(1016,180,"environments","ENVIRONMENT/LEVEL2/l2_rocks_small_1");eNVIRONMENT_LEVEL2_l2_rocks_small_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_rocks_small_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_small_1_1);const eNVIRONMENT_LEVEL2_l2_rocks_small_1_2=this.add.image(940,168,"environments","ENVIRONMENT/LEVEL2/l2_rocks_small_1");eNVIRONMENT_LEVEL2_l2_rocks_small_1_2.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_rocks_small_1_2);const eNVIRONMENT_LEVEL2_l2_bg_grass_0_1_1=this.add.tileSprite(2016,202,290,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0_1_1);const eNVIRONMENT_LEVEL2_l2_bg_grass_1=this.add.tileSprite(0,195,975,35,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_3=this.add.tileSprite(2304,180,50,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_3);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_left=this.add.image(2302,180,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_left");eNVIRONMENT_LEVEL2_l2_obstacles_pit_left.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_left);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_right=this.add.image(2350,180,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_right");eNVIRONMENT_LEVEL2_l2_obstacles_pit_right.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_right);const eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_2=this.add.tileSprite(1392,204,520,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_1");eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_2.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_1_1_1_1_1_1_1_2);const eNVIRONMENT_LEVEL2_l2_bg_grass_0_1_1_1=this.add.tileSprite(2354,202,1500,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_0");eNVIRONMENT_LEVEL2_l2_bg_grass_0_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_0_1_1_1);const eNVIRONMENT_LEVEL2_l2_island_3_2=this.add.image(3026,120,"environments","ENVIRONMENT/LEVEL2/l2_island_3");eNVIRONMENT_LEVEL2_l2_island_3_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_island_3_2);const obstacle_3=new Obstacle(this,774,98,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_ox_00");this.add.existing(obstacle_3);const obstacle_2=new Obstacle(this,2022,96,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_ox_00");this.add.existing(obstacle_2),obstacle_2.flipX=!0,obstacle_2.flipY=!1;const obstacle_1=new Obstacle(this,1658,94,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_ox_00");this.add.existing(obstacle_1);
1201const powerUp_10_2=new PowerUp(this,2958,116,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_10_2);const powerUp_11=new PowerUp(this,2470,32,"powerups","REDPAIL_SHRIMP/redpail_shrimp_0001");this.add.existing(powerUp_11);const powerUp_10=new PowerUp(this,2314,74,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_10);const powerUp_9=new PowerUp(this,2092,20,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_9);const powerUp_8=new PowerUp(this,1946,38,"powerups","REDPAIL_EGGROLL/redpail_eggroll_0001");this.add.existing(powerUp_8);const powerUp_7=new PowerUp(this,1352,34,"powerups","REDPAIL_SHRIMP/redpail_shrimp_0001");this.add.existing(powerUp_7);const powerUp_6=new PowerUp(this,1610,62,"powerups","REDPAIL_SHRIMP/redpail_shrimp_0001");this.add.existing(powerUp_6);const powerUp_5=new PowerUp(this,1496,20,"powerups","EGGROLL/eggroll_0001");this.add.existing(powerUp_5);const powerUp_4=new PowerUp(this,1032,96,"powerups","REDPAIL_SHRIMP/redpail_shrimp_0001");this.add.existing(powerUp_4);const powerUp_3=new PowerUp(this,1246,2,"powerups","EGGROLL/eggroll_0001");this.add.existing(powerUp_3),powerUp_3.angle=90;const powerUp_2=new PowerUp(this,572,40,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_2);const powerUp_1=new PowerUp(this,326,114,"powerups","REDPAIL_SHRIMP/redpail_shrimp_0001");this.add.existing(powerUp_1);const powerUp_12=new PowerUp(this,2606,114,"powerups","REDPAIL_SHRIMP/redpail_shrimp_0001");this.add.existing(powerUp_12);const powerUp_10_1=new PowerUp(this,2712,84,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_10_1);const powerUp_10_2_1=new PowerUp(this,2878,88,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_10_2_1);const powerUp_10_2_1_1=new PowerUp(this,3042,56,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_10_2_1_1);const nian=this.add.sprite(3194,200,"characters","NIAN/IDLE2/nian_idle2_1");nian.setOrigin(0,1);const player=new Player(this,120,155);this.add.existing(player),player.setOrigin(.5,.75);this.add.image(2524,180,"environments","ENVIRONMENT/LEVEL2/l2_gate_front").setOrigin(0,1);const eNVIRONMENT_LEVEL2_l2_gate_front_1=this.add.image(2760,180,"environments","ENVIRONMENT/LEVEL2/l2_gate_front");eNVIRONMENT_LEVEL2_l2_gate_front_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_gate_front_1.flipX=!0;const fG_Group=this.add.container(0,0),ground_6_1=this.add.rectangle(2356,156,2e3,10);ground_6_1.setOrigin(0,0),ground_6_1.visible=!1,ground_6_1.isFilled=!0;const ground_6=this.add.rectangle(2016,156,290,10);ground_6.setOrigin(0,0),ground_6.visible=!1,ground_6.isFilled=!0;const ground_5=this.add.rectangle(1990,124,30,10);ground_5.setOrigin(0,1),ground_5.visible=!1,ground_5.isFilled=!0;const ground_4=this.add.rectangle(1844,126,95,10);ground_4.setOrigin(0,1),ground_4.visible=!1,ground_4.isFilled=!0;const ground_4_123=this.add.rectangle(1674,150,122,10);ground_4_123.setOrigin(0,0),ground_4_123.visible=!1,ground_4_123.isFilled=!0;const ground_3=this.add.rectangle(1390,114,64,10);ground_3.setOrigin(0,1),ground_3.visible=!1,ground_3.isFilled=!0;const ground_2=this.add.rectangle(1138,112,206,10);ground_2.setOrigin(0,1),ground_2.visible=!1,ground_2.isFilled=!0;const ground_2_1=this.add.rectangle(1014,136,67,10);ground_2_1.setOrigin(0,0),ground_2_1.visible=!1,ground_2_1.isFilled=!0;const ground_1=this.add.rectangle(0,156,957,10);ground_1.setOrigin(0,0),ground_1.visible=!1,ground_1.isFilled=!0;const checkpoint_1=new Checkpoint(this,1878,112);this.add.existing(checkpoint_1);const checkpoint=new Checkpoint(this,1238,100);this.add.existing(checkpoint);const endZone=new TransitionZone(this,3184,90);this.add.existing(endZone);const startZone=new TransitionZone(this,215,90);this.add.existing(startZone);const textBox=new TextBox(this,212,140);this.add.existing(textBox),textBox.scaleX=.3,textBox.scaleY=.3,textBox.visible=!0;this.add.tileSprite(20,180,1200,180,"environments","ENVIRONMENT/LEVEL2/l2_closeup_trunks").setOrigin(0,1);const score=new Score(this,0,0);this.add.existing(score);const platforms=[eNVIRONMENT_LEVEL2_l2_island_2,eNVIRONMENT_LEVEL2_l2_island_3,eNVIRONMENT_LEVEL2_l2_island_1,eNVIRONMENT_LEVEL2_l2_island_2_1,eNVIRONMENT_LEVEL2_l2_island_3_1,eNVIRONMENT_LEVEL2_l2_island_1_1,ground_1,ground_6,ground_2,ground_5,ground_4,ground_3,ground_4_123,ground_2_1,ground_6_1,eNVIRONMENT_LEVEL2_l2_island_3_2],powerups=[powerUp_3,powerUp_1,power
1201Up_8,powerUp_9,powerUp_10,powerUp_5,powerUp_11,powerUp_6,powerUp_7,powerUp_4,powerUp_2,powerUp_12,powerUp_10_2,powerUp_10_1,powerUp_10_2_1,powerUp_10_2_1_1],obstacles=[obstacle_1,obstacle_2,obstacle_3],checkpoints=[checkpoint,checkpoint_1];new StartAnimation(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_2).AnimationName="animation_ENVIRONMENT/LEVEL2/l2_obstacles_waterfall",new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_2);new StartAnimation(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_1).AnimationName="animation_ENVIRONMENT/LEVEL2/l2_obstacles_waterfall",new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0_1);new StartAnimation(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0).AnimationName="animation_ENVIRONMENT/LEVEL2/l2_obstacles_waterfall",new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_obstacles_waterfall_0),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_2_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_3),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_2),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_3_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_rocks_medium_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_island_3_2),obstacle_3.hitAnimation="obstaclesENVIRONMENT/LEVEL2/l2_obstacles_ox",obstacle_3.idleAnimation="obstaclesENVIRONMENT/LEVEL2/l2_obstacles_ox",obstacle_3.hitboxWidth=20,obstacle_3.hitboxOffsetX=30,obstacle_3.hitSound="obstacle_ox",obstacle_3.fallType="BACKWARD",obstacle_2.hitAnimation="obstaclesENVIRONMENT/LEVEL2/l2_obstacles_ox",obstacle_2.idleAnimation="obstaclesENVIRONMENT/LEVEL2/l2_obstacles_ox",obstacle_2.hitboxWidth=20,obstacle_2.hitboxOffsetX=40,obstacle_2.hitSound="obstacle_ox",obstacle_2.fallType="BACKWARD",obstacle_1.hitAnimation="obstaclesENVIRONMENT/LEVEL2/l2_obstacles_ox",obstacle_1.idleAnimation="obstaclesENVIRONMENT/LEVEL2/l2_obstacles_ox",obstacle_1.hitboxWidth=20,obstacle_1.hitboxOffsetX=30,obstacle_1.hitSound="obstacle_ox",obstacle_1.fallType="BACKWARD",powerUp_10_2.collectAnimation="powerups_SHRIMP/shrimp",powerUp_10_2.collectSound="powerup_slerp",powerUp_11.collectAnimation="powerups_REDPAIL_SHRIMP/redpail_shrimp",powerUp_11.collectSound="powerup_slerp",powerUp_10.collectAnimation="powerups_SHRIMP/shrimp",powerUp_10.collectSound="powerup_slerp",powerUp_9.collectAnimation="powerups_SHRIMP/shrimp",powerUp_9.collectSound="powerup_slerp",powerUp_8.collectAnimation="powerups_REDPAIL_EGGROLL/redpail_eggroll",powerUp_8.collectSound="powerup_slerp",powerUp_7.collectAnimation="powerups_REDPAIL_SHRIMP/redpail_shrimp",powerUp_7.collectSound="powerup_slerp",powerUp_6.collectAnimation="powerups_REDPAIL_SHRIMP/redpail_shrimp",powerUp_6.collectSound="powerup_slerp",powerUp_5.collectAnimation="powerups_EGGROLL/eggroll",powerUp_5.collectSound="powerup_crunch",powerUp_4.collectAnimation="powerups_REDPAIL_SHRIMP/redpail_shrimp",powerUp_4.collectSound="powerup_slerp",powerUp_3.collectAnimation="powerups_EGGROLL/eggroll",powerUp_3.collectSound="powerup_crunch",powerUp_3.hitboxOffsetX=-32,powerUp_2.collectAnimation="powerups_SHRIMP/shrimp",powerUp_2.collectSound="powerup_slerp",powerUp_1.collectAnimation="powerups_REDPAIL_SHRIMP/redpail_shrimp",powerUp_1.collectSound="powerup_slerp",powerUp_12.collectAnimation="powerups_REDPAIL_SHRIMP/redpail_shrimp",powerUp_12.collectSound="powerup_slerp",powerUp_10_1.collectAnimation="powerups_SHRIMP/shrimp",powerUp_10_1.collectSound="powerup_slerp",powerUp_10_2_1.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_10_2_1.collectSound="powerup_fortune",powerUp_10_2_1_1.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_10_2_1_1.collectSound="powerup_fortune";new StartAnimation(nian).AnimationName="nian_idle2NIAN/IDLE2/nian_idle",player.platforms=platforms;new ScrollFactor(fG_Group).x=1.5,new PlatformPhysics(ground_6_1),new PlatformPhysics(ground_6),new PlatformPhysics(ground_5),new PlatformPhysics(ground_4),new PlatformPhysics(ground_4_123),new PlatformPhysics(ground_3),new PlatformPhysics(ground_2),new PlatformPhysics(ground_2_1),new PlatformPhysics(ground_1),endZone.player=player,startZone.player=player,score.cards=1,this.nian=nian,this.player=player,this.endZone=endZone,this.startZone=startZone,this.textBox=textBox,this.score=score,this.platforms=platforms,this.powerups=powerups,this.obstacles=obstacles,this.holes=[],this.checkpoints=checkpoints,this.events.emit("scene-awake")}nian;player;endZone;startZone;textBox;score;platforms;powerups;obstacles;holes;checkpoints;startCutsceneState;endCutsceneState;levelCreate(){window.gtag("event","Level2"),this.scale.setGameSize(320,180),this.editorCreate(),this.sound.add("music_level2",{loop:!0}).play(),this.cameras.main.startFollow(this.player),this.cameras.main.setLerp(1,0),this.cameras.main.followOffset.set(-40,75),this.cameras.main.scrollY=0;const arcade=this.physics;arcade.add.overlap(this.player,this.powerups,super.collectPowerUp,void 0,this),arcade.add.overlap(this.player,this.obstacles,super.hitObstacle,void 0,this),arcade.add.overlap(this.player,this.holes,super.hitHole,void 0,this),this.startCutsceneState=StartCutsceneState$2.START,this.endCutsceneState=EndCutsceneState$2.START}update(timestamp,elapsed){super.updatePlayer(elapsed,this,this.player,this.startZone,this.endZone,this.checkpoints,"Level2Fortune",this.obstacles,this.holes,this.updateStartCutscene,this.updateEndCutscene)}updateStartCutscene(scene){switch(scene.startCutsceneState){case StartCutsceneState$2.START:scene.player.setIdleSide(),scene.startCutsceneState=StartCutsceneState$2.IDLE,setTimeout((()=>{scene.textBox.typeText("Keep collecting lucky foods!"),scene.startCutsceneState=StartCutsceneState$2.TEXT}),500);break;case StartCutsceneState$2.IDLE:break;case StartCutsceneState$2.TEXT:scene.startCutsceneState=StartCutsceneState$2.READY,setTimeout((()=>{scene.textBox.reset(),scene.player.setRunning(),scene.startCutsceneState=StartCutsceneState$2.GO}),2e3);break;case StartCutsceneState$2.READY:break;case StartCutsceneState$2.GO:scene.player.incrementX(1.5)}}updateEndCutscene(scene){switch(scene.endCutsceneState){case EndCutsceneState$2.START:scene.player.setIdleSide(),scene.endCutsceneState=EndCutsceneState$2.PRENIAN,scene.textBox.setXY(170,90),scene.textBox.typeText("You're getting closer!"),setTimeout((()=>{scene.endCutsceneState=EndCutsceneState$2.NIAN}),1500);break;case EndCutsceneState$2.PRENIAN:break;case EndCutsceneState$2.NIAN:scene.nian.play("nian_smokeNIAN/SMOKE/smoke",!0),scene.nian.once("animationcomplete",(()=>{scene.endCutsceneState=EndCutsceneState$2.POSTNIAN,scene.cameras.main.stopFollow(),scene.textBox.reset()}));break;case EndCutsceneState$2.POSTNIAN:scene.cameras.main.fadeOut(2e3,0,0,0),scene.endCutsceneState=EndCutsceneState$2.FADEOUT,setTimeout((()=>{scene.endCutsceneState=EndCutsceneState$2.END}),2e3);break;case EndCutsceneState$2.FADEOUT:scene.player.setRunning(),scene.player.incrementX(1.5);break;case EndCutsceneState$2.END:scene.sound.stopAll(),scene.scene.stop(),scene.scene.start("Level2Fortune")}}getCheckpoints(){return this.checkpoints}}!function(FortuneState){FortuneState[FortuneState.START=1]="START",FortuneState[FortuneState.BANNERWAIT=2]="BANNERWAIT",FortuneState[FortuneState.CARDEXPAND=3]="CARDEXPAND",FortuneState[FortuneState.CARDLEFTWAIT=4]="CARDLEFTWAIT",FortuneState[FortuneState.CARDFLIP=5]="CARDFLIP",FortuneState[FortuneState.BOTHCARDSMOVE=6]="BOTHCARDSMOVE",FortuneState[FortuneState.BOTHCARDSWAIT=7]="BOTHCARDSWAIT",FortuneState[FortuneState.END=8]="END"}(FortuneState$2||(FortuneState$2={}));class Level2Fortune extends phaser.Scene{constructor(){super("Level2Fortune")}editorCreate(){const rectangle=this.add.rectangle(0,0,640,360);rectangle.setOrigin(0,0),rectangle.isFilled=!0,rectangle.fillColor=2794338;
1201const starburst=this.add.sprite(320,180,"cutscenes","MISC/STARBURST/starburst00000");starburst.scaleX=4,starburst.scaleY=4,starburst.alpha=.06,starburst.alphaTopLeft=.06,starburst.alphaTopRight=.06,starburst.alphaBottomLeft=.06,starburst.alphaBottomRight=.06;const clickableButton=new ClickableButton(this,568,330);this.add.existing(clickableButton),clickableButton.visible=!1;const eNVIRONMENT_LEVEL3_l3_firework_b_0=this.add.sprite(52,158,"environments","ENVIRONMENT/LEVEL3/l3_firework_b_0");eNVIRONMENT_LEVEL3_l3_firework_b_0.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1=this.add.sprite(149,305,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1=this.add.sprite(560,97,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1.setOrigin(0,1);const good_fortune_unlocked=this.add.sprite(106,224,"cutscenes","MISC/ENDLEVEL/endlevel_00000");good_fortune_unlocked.setOrigin(0,1);const card_right=new RightCard(this,320,180,"ui","level2_FortuneCard_Redeem");this.add.existing(card_right),card_right.scaleX=.3,card_right.scaleY=.3,card_right.visible=!1;const card_left=new Card(this,320,180,"ui","FortuneCard_Shrimp_front");this.add.existing(card_left),card_left.scaleX=.3,card_left.scaleY=.3,card_left.visible=!1;const disclaimer=new Disclaimer(this,320,330);this.add.existing(disclaimer),disclaimer.setOrigin(.5,.5),disclaimer.visible=!1,disclaimer.text="Free* Premium Upgrade with the purchase of Bowl, Plate, or Bigger Plate. Tax, delivery, service, and premium entrée fee extra. Tax included for one (1) Premium Upgrade per order. One coupon per person per order. Valid online only. Expires 2/28/22.";const textBox=new TextBox(this,510,314);this.add.existing(textBox),textBox.scaleX=.6,textBox.scaleY=.6;new StartAnimation(starburst).AnimationName="MISC/STARBURST/starburst";new RotateForever(starburst).Rotationspeed=.2,clickableButton.textString="CONTINUE",clickableButton.nextSceneKey="Level3";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_b";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(good_fortune_unlocked).AnimationName="MISC/ENDLEVEL/endlevel",card_right.redeemDownloadImageTexture={key:"ui",frame:"save_level2"},card_left.backTexture={key:"ui",frame:"FortuneCard_Shrimp_back"},this.clickableButton=clickableButton,this.good_fortune_unlocked=good_fortune_unlocked,this.card_right=card_right,this.card_left=card_left,this.disclaimer=disclaimer,this.textBox=textBox,this.events.emit("scene-awake")}clickableButton;good_fortune_unlocked;card_right;card_left;disclaimer;textBox;fortuneState;accumulator=0;fps=60;physicsTimestep;domScaleX=0;domScaleY=0;cardPixelCounter=0;code;create(){window.gtag("event","Level2Redeem"),this.editorCreate(),this.scale.setGameSize(640,360),this.fortuneState=FortuneState$2.START,this.sound.add("fortunecard").play(),this.physicsTimestep=1e3/this.fps}update(timestamp,elapsed){for(this.accumulator+=elapsed;this.accumulator>=this.physicsTimestep;)switch(this.accumulator-=this.physicsTimestep,this.fortuneState){case FortuneState$2.START:httpsCallable(functions,"getCode")({type:"level2"}).then((result=>{result.data&&result.data.codes&&result.data.codes.length>0&&result.data.codes[0].code&&(this.code=result.data.codes[0].code,this.card_right.setCode(this.code))})).catch((error=>{console.log(error)})),this.fortuneState=FortuneState$2.BANNERWAIT,this.domScaleX=0,this.domScaleY=0,this.card_left.setDomScale(this.domScaleX,this.domScaleY),setTimeout((()=>{this.textBox.typeText("Congratulations! You've unlocked the Honey Walnut Shrimp Happiness Card!",(()=>{setTimeout((()=>{this.textBox.typeText("Redeem your code now, or save for later and keep playing!",(()=>{setTimeout((()=>{this.textBox.reset(),this.fortuneState=FortuneState$2.CARDEXPAND,this.good_fortune_unlocked.visible=!1,this.card_left.setVisibility(!0),setTimeout((()=>{this.clickableButton.visible=!0}),3500)}),2e3)}))}),1500)}))}),500);break;case FortuneState$2.BANNERWAIT:break;case FortuneState$2.CARDEXPAND:this.domScaleX+=.0066,this.domScaleY+=.0066,this.card_left.setDomScale(this.domScaleX,this.domScaleY),this.domScaleX>=.3&&(this.fortuneState=FortuneState$2.CARDLEFTWAIT,setTimeout((()=>{this.fortuneState=FortuneState$2.CARDFLIP}),1e3));break;case FortuneState$2.CARDLEFTWAIT:break;case FortuneState$2.CARDFLIP:this.card_left.flip(),this.card_right.setVisibility(!0),this.fortuneState=FortuneState$2.BOTHCARDSMOVE;break;case FortuneState$2.BOTHCARDSMOVE:this.cardPixelCounter++,this.card_left.nudge(-2),this.card_right.nudge(2),this.cardPixelCounter>45&&(this.fortuneState=FortuneState$2.BOTHCARDSWAIT,this.disclaimer.setVisibility(!0),setTimeout((()=>{this.fortuneState=FortuneState$2.END}),4e3));case FortuneState$2.BOTHCARDSWAIT:case FortuneState$2.END:}}}!function(StartCutsceneState){StartCutsceneState[StartCutsceneState.START=1]="START",StartCutsceneState[StartCutsceneState.IDLE=2]="IDLE",StartCutsceneState[StartCutsceneState.TEXT=3]="TEXT",StartCutsceneState[StartCutsceneState.READY=4]="READY",StartCutsceneState[StartCutsceneState.GO=5]="GO"}(StartCutsceneState$1||(StartCutsceneState$1={})),function(EndCutsceneState){EndCutsceneState[EndCutsceneState.START=1]="START",EndCutsceneState[EndCutsceneState.PRENIAN=2]="PRENIAN",EndCutsceneState[EndCutsceneState.NIAN=3]="NIAN",EndCutsceneState[EndCutsceneState.POSTNIAN=4]="POSTNIAN",EndCutsceneState[EndCutsceneState.FADEOUT=5]="FADEOUT",EndCutsceneState[EndCutsceneState.END=6]="END"}(EndCutsceneState$1||(EndCutsceneState$1={}));class Level3 extends PandaScene{constructor(){super("Level3")}editorCreate(){const bG_Far=this.add.container(0,180),eNVIRONMENT_LEVEL3_l3_bg_0_sky=this.add.tileSprite(0,0,3500,180,"environments","ENVIRONMENT/LEVEL3/l3_bg_0_sky");eNVIRONMENT_LEVEL3_l3_bg_0_sky.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_0_sky);const eNVIRONMENT_LEVEL3_l3_intro_mountains=this.add.tileSprite(0,0,1720,103,"environments","ENVIRONMENT/LEVEL3/l3_intro_mountains");eNVIRONMENT_LEVEL3_l3_intro_mountains.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_intro_mountains);const eNVIRONMENT_LEVEL3_l3_intro_mountains_1=this.add.image(602,-108,"environments","ENVIRONMENT/LEVEL3/l3_intro_mountains");bG_Far.add(eNVIRONMENT_LEVEL3_l3_intro_mountains_1);const eNVIRONMENT_LEVEL4_l4a_bg_0_moon=this.add.image(810,-166,"environments","ENVIRONMENT/LEVEL4/l4a_bg_0_moon");bG_Far.add(eNVIRONMENT_LEVEL4_l4a_bg_0_moon);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline_2=this.add.image(1594,-62,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline_2);const eNVIRONMENT_LEVEL3_l3_bg_2_skyline_1=this.add.image(1626,-54,"environments","ENVIRONMENT/LEVEL3/l3_bg_2_skyline");eNVIRONMENT_LEVEL3_l3_bg_2_skyline_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_2_skyline_1);const eNVIRONMENT_LEVEL3_l3_ground_crossing_1=this.add.image(1678,-56,"environments","ENVIRONMENT/LEVEL3/l3_ground_crossing");bG_Far.add(eNVIRONMENT_LEVEL3_l3_ground_crossing_1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1=this.add.sprite(1660,-130,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_2=this.add.sprite(1628,-152,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_2);const eNVIRONMENT_LEVEL3_l3_firework_c_0=this.add.sprite(2432,-142,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_c_0.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_c_0);const eNVIRONMENT_LEVEL3_l3_firework_b_0=this.add.sprite(192,-126,"environments","ENVIRONMENT/LEVEL3/l3_firework_b_0");eNVIRONMENT_LEVEL3_l3_firework_b_0.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1_1=this.add.sprite(2018,-134,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1_1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_2=this.add.sprite(830,-146,"environments","ENVIRONMENT/LEVEL3/l3_firework_b_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0_2);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1=this.add.sprite(284,-144,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0_1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1=this.add.sprite(746,-146,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1);const eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2=this.add.image(1990,-12,"environments","ENVIRONMENT/LEVEL3/l3_bg_2_skyline");eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3=this.add.image(2120,-24,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_1=this.add.image(2176,-20,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_1);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_2=this.add.image(2370,-60,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_2);const eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2_1=this.add.image(2362,-18,"environments","ENVIRONMENT/LEVEL3/l3_bg_2_skyline");eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2_1);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_2_1=this.add.image(2558,-18,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_2_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline_3_2_1);const eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2_1_1=this.add.image(2484,-16,"environments","ENVIRONMENT/LEVEL3/l3_bg_2_skyline");eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_bg_2_skyline_2_1_1);const eNVIRONMENT_LEVEL3_l3_house_22_1_1=this.add.image(2636,-38,"environments","ENVIRONMENT/LEVEL3/l3_house_22");eNVIRONMENT_LEVEL3_l3_house_22_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_house_22_1_1);const eNVIRONMENT_LEVEL3_l3_house_roof_04_1_1_1=this.add.image(2636,-38,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_04");eNVIRONMENT_LEVEL3_l3_house_roof_04_1_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL3_l3_house_roof_04_1_1_1);const bG_Close=this.add.container(0,0),eNVIRONMENT_LEVEL4_l4_bg_0_stars=this.add.tileSprite(0,42,3500,42,"environments","ENVIRONMENT/LEVEL4/l4_bg_0_stars");eNVIRONMENT_LEVEL4_l4_bg_0_stars.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_bg_0_stars);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline_1=this.add.image(818,108,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline_1.setOrigin(0,1),eNVIRONMENT_LEVEL3_l3_bg_1_skyline_1.flipX=!0,bG_Close.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline_1);const eNVIRONMENT_LEVEL3_l3_bg_1_skyline=this.add.image(718,110,"environments","ENVIRONMENT/LEVEL3/l3_bg_1_skyline");eNVIRONMENT_LEVEL3_l3_bg_1_skyline.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_bg_1_skyline);const eNVIRONMENT_LEVEL3_l3_bg_2_skyline=this.add.image(746,126,"environments","ENVIRONMENT/LEVEL3/l3_bg_2_skyline");eNVIRONMENT_LEVEL3_l3_bg_2_skyline.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_bg_2_skyline);const eNVIRONMENT_LEVEL3_l3_house_24=this.add.image(1756,138,"environments","ENVIRONMENT/LEVEL3/l3_house_24");eNVIRONMENT_LEVEL3_l3_house_24.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_24);const eNVIRONMENT_LEVEL3_l3_house_roof_06_2=this.add.image(1756,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_06");eNVIRONMENT_LEVEL3_l3_house_roof_06_2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_roof_06_2);const eNVIRONMENT_LEVEL1_l1_decor_tree=this.add.image(1692,144,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_tree.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree.tintBottomLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree.tintBottomRight=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_tree);const eNVIRONMENT_LEVEL1_l1_decor_tree_1=this.add.image(2070,142,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree_1.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_tree_1.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1.tintBottomLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1.tintBottomRight=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_tree_1);const eNVIRONMENT_LEVEL1_l1_decor_tree_1_1=this.add.image(280,150,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_tree_1_1.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_1.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_1.tintBottomLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_1.tintBottomRight=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_tree_1_1);const eNVIRONMENT_LEVEL3_l3_stall_2_1=this.add.image(2390,140,"environments","ENVIRONMENT/LEVEL3/l3_stall_2");eNVIRONMENT_LEVEL3_l3_stall_2_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_stall_2_1);const eNVIRONMENT_LEVEL3_l3_stall_2=this.add.image(1930,138,"environments","ENVIRONMENT/LEVEL3/l3_stall_2");eNVIRONMENT_LEVEL3_l3_stall_2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_stall_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_1=this.add.image(2242,126,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_bush_1.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_bush_1.tintBottomLeft=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1);const eNVIRONMENT_LEVEL3_l3_ground_sidewalk_1=this.add.tileSprite(884,148,748,12,"environments","ENVIRONMENT/LEVEL3/l3_ground_sidewalk");eNVIRONMENT_LEVEL3_l3_ground_sidewalk_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_ground_sidewalk_1);const eNVIRONMENT_LEVEL1_l1_decor_bench1_1=this.add.image(1282,134,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench1");bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bench1_1);const eNVIRONMENT_LEVEL1_l1_decor_bench2_1=this.add.image(1570,134,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench2");bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bench2_1);const eNVIRONMENT_LEVEL3_l3_house_22=this.add.image(1224,138,"environments","ENVIRONMENT/LEVEL3/l3_house_22");eNVIRONMENT_LEVEL3_l3_house_22.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_22);const eNVIRONMENT_LEVEL3_l3_house_22_1=this.add.image(1426,138,"environments","ENVIRONMENT/LEVEL3/l3_house_22");eNVIRONMENT_LEVEL3_l3_house_22_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_22_1);const eNVIRONMENT_LEVEL3_l3_intro_grass_2_1=this.add.image(1756,146,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass_2_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_intro_grass_2_1);const eNVIRONMENT_LEVEL3_l3_house_11_1=this.add.image(1054,138,"environments","ENVIRONMENT/LEVEL3/l3_house_11");eNVIRONMENT_LEVEL3_l3_house_11_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_11_1);const eNVIRONMENT_LEVEL3_l3_house_11=this.add.image(884,138,"environments","ENVIRONMENT/LEVEL3/l3_house_11");eNVIRONMENT_LEVEL3_l3_house_11.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_11);const eNVIRONMENT_LEVEL3_l3_house_07=this.add.image(638,70,"environments","ENVIRONMENT/LEVEL3/l3_house_07");bG_Cl
1201ose.add(eNVIRONMENT_LEVEL3_l3_house_07);const eNVIRONMENT_LEVEL3_l3_house_16=this.add.image(384,138,"environments","ENVIRONMENT/LEVEL3/l3_house_16");eNVIRONMENT_LEVEL3_l3_house_16.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_16);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_1_1=this.add.image(1044,144,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_bush_1_1_1.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_bush_1_1_1.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_bush_1_1_1.tintBottomLeft=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_1_1);const eNVIRONMENT_LEVEL3_l3_house_13=this.add.image(2200,146,"environments","ENVIRONMENT/LEVEL3/l3_house_13");eNVIRONMENT_LEVEL3_l3_house_13.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_13);const eNVIRONMENT_LEVEL3_l3_house_roof_09=this.add.image(2200,2,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_09");eNVIRONMENT_LEVEL3_l3_house_roof_09.setOrigin(0,0),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_roof_09);const eNVIRONMENT_LEVEL3_l3_stall_2_2=this.add.image(1996,138,"environments","ENVIRONMENT/LEVEL3/l3_stall_2");eNVIRONMENT_LEVEL3_l3_stall_2_2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_stall_2_2);const eNVIRONMENT_LEVEL3_l3_stall_3=this.add.image(2084,100,"environments","ENVIRONMENT/LEVEL3/l3_stall_3");bG_Close.add(eNVIRONMENT_LEVEL3_l3_stall_3);const eNVIRONMENT_LEVEL3_l3_intro_grass_1_1_1=this.add.tileSprite(1928,148,1255,33,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass_1_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_intro_grass_1_1_1);const eNVIRONMENT_LEVEL3_l3_ground_sidewalk_1_1=this.add.tileSprite(1724,148,1450,12,"environments","ENVIRONMENT/LEVEL3/l3_ground_sidewalk");eNVIRONMENT_LEVEL3_l3_ground_sidewalk_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_ground_sidewalk_1_1);const eNVIRONMENT_LEVEL1_l1_decor_bench1=this.add.image(2214,142,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench1");eNVIRONMENT_LEVEL1_l1_decor_bench1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bench1);const eNVIRONMENT_LEVEL1_l1_decor_bench2=this.add.image(2364,142,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench2");eNVIRONMENT_LEVEL1_l1_decor_bench2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bench2);const eNVIRONMENT_LEVEL1_l1_signage_food=this.add.sprite(1388,126,"environments","ENVIRONMENT/LEVEL1/l1_signage_food");eNVIRONMENT_LEVEL1_l1_signage_food.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_signage_food);const eNVIRONMENT_LEVEL1_l1_decor_chinesesign=this.add.image(1811,110,"environments","ENVIRONMENT/LEVEL1/l1_decor_chinesesign");eNVIRONMENT_LEVEL1_l1_decor_chinesesign.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_chinesesign);const eNVIRONMENT_LEVEL1_l1_decor_bench1_2=this.add.image(1772,144,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench1");eNVIRONMENT_LEVEL1_l1_decor_bench1_2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bench1_2);const eNVIRONMENT_LEVEL3_l3_ground_sidewalk=this.add.tileSprite(384,148,374,12,"environments","ENVIRONMENT/LEVEL3/l3_ground_sidewalk");eNVIRONMENT_LEVEL3_l3_ground_sidewalk.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_ground_sidewalk);const eNVIRONMENT_LEVEL1_l1_decor_bench2_2=this.add.image(640,144,"environments","ENVIRONMENT/LEVEL1/l1_decor_bench2");eNVIRONMENT_LEVEL1_l1_decor_bench2_2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bench2_2);const eNVIRONMENT_LEVEL3_l3_streetlight_0_2=this.add.image(2466,140,"environments","ENVIRONMENT/LEVEL3/l3_streetlight_0");eNVIRONMENT_LEVEL3_l3_streetlight_0_2.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_streetlight_0_2);const eNVIRONMENT_LEVEL1_l1_signage_food_1=this.add.sprite(2366,66,"environments","ENVIRONMENT/LEVEL1/l1_signage_food");eNVIRONMENT_LEVEL1_l1_signage_food_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_signage_food_1);const eNVIRONMENT_LEVEL1_l1_decor_tree_1_2=this.add.image(2560,144,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_tree_1_2.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_2.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_2.tintBottomLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_2.tintBottomRight=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_tree_1_2);const eNVIRONMENT_LEVEL1_l1_decor_bush_1_1=this.add.image(1886,142,"environments","ENVIRONMENT/LEVEL1/l1_decor_bush_1");eNVIRONMENT_LEVEL1_l1_decor_bush_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_bush_1_1.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_bush_1_1.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_bush_1_1.tintBottomLeft=10457313,bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_bush_1_1);const eNVIRONMENT_LEVEL3_l3_obstacle_wok_0=this.add.sprite(2072,118,"environments","ENVIRONMENT/LEVEL3/l3_obstacle_wok_0");eNVIRONMENT_LEVEL3_l3_obstacle_wok_0.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_obstacle_wok_0);const eNVIRONMENT_LEVEL3_l3_market_items_4=this.add.image(2010,106,"environments","ENVIRONMENT/LEVEL3/l3_market_items_4");bG_Close.add(eNVIRONMENT_LEVEL3_l3_market_items_4);const eNVIRONMENT_LEVEL3_l3_market_items_7=this.add.image(2036,104,"environments","ENVIRONMENT/LEVEL3/l3_market_items_7");bG_Close.add(eNVIRONMENT_LEVEL3_l3_market_items_7);const eNVIRONMENT_LEVEL3_l3_house_roof_04_1=this.add.image(1224,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_04");eNVIRONMENT_LEVEL3_l3_house_roof_04_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_roof_04_1);const eNVIRONMENT_LEVEL3_l3_house_roof_04_1_1=this.add.image(1426,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_04");eNVIRONMENT_LEVEL3_l3_house_roof_04_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_house_roof_04_1_1);const eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1=this.add.image(2690,114,"environments","ENVIRONMENT/LEVEL1/l1_decor_chinesesign");eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1);const eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1_1=this.add.image(2776,114,"environments","ENVIRONMENT/LEVEL1/l1_decor_chinesesign");eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_chinesesign_1_1);const eNVIRONMENT_LEVEL1_l1_decor_tigersign=this.add.image(1098,65,"environments","ENVIRONMENT/LEVEL1/l1_decor_tigersign");eNVIRONMENT_LEVEL1_l1_decor_tigersign.setOrigin(0,0),bG_Close.add(eNVIRONMENT_LEVEL1_l1_decor_tigersign);const eNVIRONMENT_LEVEL3_l3_streetlight_0=this.add.sprite(130,148,"environments","ENVIRONMENT/LEVEL3/l3_streetlight_0");eNVIRONMENT_LEVEL3_l3_streetlight_0.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL3_l3_streetlight_0);
1201const powerUp_3_2_2=new PowerUp(this,1014,72,"powerups","REDPAIL_ORANGECHICKEN/redpail_orangechicken_0001");this.add.existing(powerUp_3_2_2);const mG_Group=this.add.container(0,0),eNVIRONMENT_LEVEL3_l3_intro_grass_2=this.add.image(190,160,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass_2);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1_1_1=this.add.image(1354,96,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1_1=this.add.image(1296,96,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1=this.add.image(1232,96,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL3_l3_ground_crossing=this.add.image(724,164,"environments","ENVIRONMENT/LEVEL3/l3_ground_crossing");eNVIRONMENT_LEVEL3_l3_ground_crossing.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_ground_crossing);const eNVIRONMENT_LEVEL3_l3_intro_bamboo=this.add.image(58,90,"environments","ENVIRONMENT/LEVEL3/l3_intro_bamboo");mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_bamboo);const lanternAnimated_1=this.add.container(952,106);mG_Group.add(lanternAnimated_1);const lanternglowing2=this.add.sprite(3,0,"environments","ENVIRONMENT/LEVEL3/l3_obstacle_lantern_1");lanternglowing2.setOrigin(0,1),lanternAnimated_1.add(lanternglowing2);const lanternglow2=this.add.image(0,8,"environments","ENVIRONMENT/LEVEL3/l3_obstacle_lantern_glow");lanternglow2.setOrigin(0,1),lanternAnimated_1.add(lanternglow2);const eNVIRONMENT_LEVEL3_l3_house_roof_06=this.add.image(884,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_07");eNVIRONMENT_LEVEL3_l3_house_roof_06.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_house_roof_06);const eNVIRONMENT_LEVEL3_l3_intro_grass=this.add.image(6,156,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass);const eNVIRONMENT_LEVEL3_l3_ground=this.add.tileSprite(0,180,3200,35,"environments","ENVIRONMENT/LEVEL3/l3_ground");eNVIRONMENT_LEVEL3_l3_ground.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_ground);const eNVIRONMENT_LEVEL3_l3_intro_grass_small=this.add.image(112,156,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass_small");eNVIRONMENT_LEVEL3_l3_intro_grass_small.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass_small);const eNVIRONMENT_LEVEL3_Lantern_1=this.add.image(390,100,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1);const eNVIRONMENT_LEVEL3_Lantern_1_1=this.add.image(430,100,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1=this.add.image(470,100,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1=this.add.image(514,100,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1=this.add.image(892,100,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1=this.add.image(1016,102,"environments","ENVIRONMENT/LEVEL3/Lantern_1");eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_1_1_1_1_1_1);const eNVIRONMENT_LEVEL3_l3_house_roof_04=this.add.image(384,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_04");eNVIRONMENT_LEVEL3_l3_house_roof_04.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_house_roof_04);const eNVIRONMENT_LEVEL3_l3_intro_grass_small_1=this.add.image(80,156,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass_small");eNVIRONMENT_LEVEL3_l3_intro_grass_small_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass_small_1);const eNVIRONMENT_LEVEL3_l3_intro_grass_small_1_1=this.add.image(42,156,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass_small");eNVIRONMENT_LEVEL3_l3_intro_grass_small_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass_small_1_1);const eNVIRONMENT_LEVEL3_l3_intro_grass_small_1_1_1=this.add.image(-14,156,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass_small");eNVIRONMENT_LEVEL3_l3_intro_grass_small_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass_small_1_1_1);const eNVIRONMENT_LEVEL3_l3_house_roof_18=this.add.image(552,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_18");eNVIRONMENT_LEVEL3_l3_house_roof_18.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_house_roof_18);const eNVIRONMENT_LEVEL3_Lantern_2=this.add.image(642,54,"environments","ENVIRONMENT/LEVEL3/Lantern_2");eNVIRONMENT_LEVEL3_Lantern_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_2);const eNVIRONMENT_LEVEL3_Lantern_2_1=this.add.image(682,52,"environments","ENVIRONMENT/LEVEL3/Lantern_2");eNVIRONMENT_LEVEL3_Lantern_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_2_1);const eNVIRONMENT_LEVEL3_l3_box_5=this.add.image(724,142,"environments","ENVIRONMENT/LEVEL3/l3_box_5");eNVIRONMENT_LEVEL3_l3_box_5.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_5);const eNVIRONMENT_LEVEL3_l3_box_2_1_1=this.add.image(724,124,"environments","ENVIRONMENT/LEVEL3/l3_box_2");eNVIRONMENT_LEVEL3_l3_box_2_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_2_1_1);const eNVIRONMENT_LEVEL3_l3_box_5_1=this.add.image(404,168,"environments","ENVIRONMENT/LEVEL3/l3_box_5");eNVIRONMENT_LEVEL3_l3_box_5_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_5_1);const eNVIRONMENT_LEVEL3_l3_box_1=this.add.image(584,160,"environments","ENVIRONMENT/LEVEL3/l3_box_1");eNVIRONMENT_LEVEL3_l3_box_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_1);const eNVIRONMENT_LEVEL3_l3_house_roof_06_1=this.add.image(1054,138,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_07");eNVIRONMENT_LEVEL3_l3_house_roof_06_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_house_roof_06_1);const eNVIRONMENT_LEVEL3_l3_box_4_1=this.add.image(1100,166,"environments","ENVIRONMENT/LEVEL3/l3_box_2");eNVIRONMENT_LEVEL3_l3_box_4_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_4_1);const eNVIRONMENT_LEVEL3_l3_box_5_2=this.add.image(1178,166,"environments","ENVIRONMENT/LEVEL3/l3_box_5");eNVIRONMENT_LEVEL3_l3_box_5_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_5_2);const eNVIRONMENT_LEVEL3_Lantern_2_2=this.add.image(1530,120,"environments","ENVIRONMENT/LEVEL3/Lantern_2");eNVIRONMENT_LEVEL3_Lantern_2_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_2_2);const eNVIRONMENT_LEVEL3_Lantern_3_1_1=this.add.image(1396,62,"environments","ENVIRONMENT/LEVEL3/Lantern_3");eNVIRONMENT_LEVEL3_Lantern_3_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_3_1_1);const lanternAnimated=this.add.container(1468,104);mG_Group.add(lanternAnimated);const lanternGlowing=this.add.sprite(3,0,"environments","ENVIRONMENT/LEVEL3/l3_obstacle_lantern_1");lanternGlowing.setOrigin(0,1),lanternAnimated.add(lanternGlowing);const lanternglow1=this.add.image(0,8,"environments","ENVIRONMENT/LEVEL3/l3_obstacle_lantern_glow");lanternglow1.setOrigin(0,1),lanternAnimated.add(lanternglow1);const eNVIRONMENT_LEVEL3_l3_box_5_3=this.add.image(1650,166,"environments","ENVIRONMENT/LEVEL3/l3_box_5");eNVIRONMENT_LEVEL3_l3_box_5_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_5_3);const eNVIRONMENT_LEVEL3_l3_box_6_1=this.add.image(1684,166,"environments","ENVIRONMENT/LEVEL3/l3_box_6");eNVIRONMENT_LEVEL3_l3_box_6_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_6_1);const eNVIRONMENT_LEVEL3_l3_box_2_1_1_1=this.add.image(1718,166,"environments","ENVIRONMENT/LEVEL3/l3_box_2");eNVIRONMENT_LEVEL3_l3_box_2_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_2_1_1_1);const eNVIRONMENT_LEVEL3_l3_box_2_2=this.add.image(1670,148,"environments","ENVIRONMENT/LEVEL3/l3_box_2");eNVIRONMENT_LEVEL3_l3_box_2_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_2_2);const eNVIRONMENT_LEVEL3_l3_streetlight_0_1=this.add.sprite(518,146,"environments","ENVIRONMENT/LEVEL3/l3_streetlight_0");eNVIRONMENT_LEVEL3_l3_streetlight_0_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_streetlight_0_1);const eNVIRONMENT_LEVEL3_l3_market_items_6=this.add.image(1936,126,"environments","ENVIRONMENT/LEVEL3/l3_market_items_6");eNVIRONMENT_LEVEL3_l3_market_items_6.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_6);const eNVIRONMENT_LEVEL3_l3_market_items_5=this.add.image(1936,126,"environments","ENVIRONMENT/LEVEL3/l3_market_items_5");eNVIRONMENT_LEVEL3_l3_market_items_5.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_5);const eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1=this.add.sprite(1574,144,"environments","ENVIRONMENT/LEVEL3/l3_streetlight_0");eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1);const eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1_1=this.add.sprite(1956,142,"environments","ENVIRONMENT/LEVEL3/l3_streetlight_0");eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1_1);const eNVIRONMENT_LEVEL3_l3_market_items_6_1=this.add.image(2396,128,"environments","ENVIRONMENT/LEVEL3/l3_market_items_6");eNVIRONMENT_LEVEL3_l3_market_items_6_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_6_1);const eNVIRONMENT_LEVEL3_l3_market_items_5_1=this.add.image(2396,128,"environments","ENVIRONMENT/LEVEL3/l3_market_items_5");eNVIRONMENT_LEVEL3_l3_market_items_5_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_market_items_5_1);const eNVIRONMENT_LEVEL3_l3_box_6=this.add.image(982,166,"environments","ENVIRONMENT/LEVEL3/l3_box_6");eNVIRONMENT_LEVEL3_l3_box_6.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_6);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile=this.add.tileSprite(1256,180,350,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_1=this.add.tileSprite(2398,180,400,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_1);const eNVIRONMENT_LEVEL2_l2_bridge_right=this.add.image(2786,176,"environments","ENVIRONMENT/LEVEL2/l2_bridge_right");mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_right);const eNVIRONMENT_LEVEL2_l2_bridge_tile_1_1=this.add.tileSprite(2716,198,25,42,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile_1_1);const eNVIRONMENT_LEVEL2_l2_bridge_tile_1=this.add.tileSprite(2634,196,50,42,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile_1);const eNVIRONMENT_LEVEL2_l2_bridge_tile_3=this.add.tileSprite(2542,196,50,42,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile_3);const eNVIRONMENT_LEVEL2_l2_bridge_tile=this.add.tileSprite(2450,196,50,42,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile);const eNVIRONMENT_LEVEL2_l2_bridge_left=this.add.image(2398,196,"environments","ENVIRONMENT/LEVEL2/l2_bridge_left");eNVIRONMENT_LEVEL2_l2_bridge_left.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_left);const eNVIRONMENT_LEVEL1_l1_decor_tree_1_1_1=this.add.image(888,146,"environments","ENVIRONMENT/LEVEL1/l1_decor_tree");eNVIRONMENT_LEVEL1_l1_decor_tree_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL1_l1_decor_tree_1_1_1.tintTopLeft=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_1_1.tintTopRight=10457313,eNVIRONMENT_LEVEL1_l1_decor_tree_1_1_1.tintBottomLeft=10457313,mG_Group.add(eNVIRONMENT_LEVEL1_l1_decor_tree_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_3_1_1_1=this.add.image(2272,64,"environments","ENVIRONMENT/LEVEL3/Lantern_3");eNVIRONMENT_LEVEL3_Lantern_3_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_3_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_3_1_1_1_1=this.add.image(2336,62,"environments","ENVIRONMENT/LEVEL3/Lantern_3");eNVIRONMENT_LEVEL3_Lantern_3_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_3_1_1_1_1);const eNVIRONMENT_LEVEL3_Lantern_3_1_1_1_1_1=this.add.image(2210,64,"environments","ENVIRONMENT/LEVEL3/Lantern_3");eNVIRONMENT_LEVEL3_Lantern_3_1_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_Lantern_3_1_1_1_1_1);const eNVIRONMENT_LEVEL1_l1_birds_0=this.add.sprite(1696,72,"environments","ENVIRONMENT/LEVEL1/l1_b
1201irds_0");eNVIRONMENT_LEVEL1_l1_birds_0.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL1_l1_birds_0);const eNVIRONMENT_LEVEL2_l2_bridge_right_1_1=this.add.image(1560,174,"environments","ENVIRONMENT/LEVEL2/l2_bridge_right");eNVIRONMENT_LEVEL2_l2_bridge_right_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_right_1_1);const eNVIRONMENT_LEVEL2_l2_bridge_tile_2_1=this.add.tileSprite(1476,162,85,30,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile_2_1);const eNVIRONMENT_LEVEL2_l2_bridge_left_1_1=this.add.image(1452,174,"environments","ENVIRONMENT/LEVEL2/l2_bridge_left");eNVIRONMENT_LEVEL2_l2_bridge_left_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_left_1_1);const eNVIRONMENT_LEVEL2_l2_bridge_right_1=this.add.image(1386,174,"environments","ENVIRONMENT/LEVEL2/l2_bridge_right");eNVIRONMENT_LEVEL2_l2_bridge_right_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_right_1);const eNVIRONMENT_LEVEL2_l2_bridge_tile_2=this.add.tileSprite(1302,162,85,30,"environments","ENVIRONMENT/LEVEL2/l2_bridge_tile");eNVIRONMENT_LEVEL2_l2_bridge_tile_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_tile_2);const eNVIRONMENT_LEVEL2_l2_bridge_left_1=this.add.image(1278,174,"environments","ENVIRONMENT/LEVEL2/l2_bridge_left");eNVIRONMENT_LEVEL2_l2_bridge_left_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bridge_left_1);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_left=this.add.image(1250,180,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_left");eNVIRONMENT_LEVEL2_l2_obstacles_pit_left.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_left);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_right=this.add.image(1606,180,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_right");eNVIRONMENT_LEVEL2_l2_obstacles_pit_right.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_right);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left=this.add.image(1224,-16,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_left");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1=this.add.image(1492,-18,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_left");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_left_1);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile=this.add.image(1408,-8,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_tile");mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_tile);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_2=this.add.tileSprite(1854,180,90,28,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_tile");eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_tile_2);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_right_1=this.add.image(1944,182,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_right");eNVIRONMENT_LEVEL2_l2_obstacles_pit_right_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_right_1);const eNVIRONMENT_LEVEL2_l2_obstacles_pit_left_1=this.add.image(1850,180,"environments","ENVIRONMENT/LEVEL2/l2_obstacles_pit_left");eNVIRONMENT_LEVEL2_l2_obstacles_pit_left_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL2_l2_obstacles_pit_left_1);const eNVIRONMENT_LEVEL3_l3_box_2_1_2=this.add.image(1884,194,"environments","ENVIRONMENT/LEVEL3/l3_box_2");eNVIRONMENT_LEVEL3_l3_box_2_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_2_1_2);const eNVIRONMENT_LEVEL3_l3_box_5_1_1=this.add.image(492,170,"environments","ENVIRONMENT/LEVEL3/l3_box_5");eNVIRONMENT_LEVEL3_l3_box_5_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_5_1_1);const eNVIRONMENT_LEVEL3_l3_box_2_1_1_1_1=this.add.image(1950,164,"environments","ENVIRONMENT/LEVEL3/l3_box_4");eNVIRONMENT_LEVEL3_l3_box_2_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_box_2_1_1_1_1);const hole_1=new Hole(this,760,160);this.add.existing(hole_1);const hole=new Hole(this,268,159);this.add.existing(hole);const wok1_1_1_1=new Obstacle(this,2330,102,"environments","ENVIRONMENT/LEVEL3/l3__obstacle_wok");this.add.existing(wok1_1_1_1);const wok1_1=new Obstacle(this,2148,100,"environments","ENVIRONMENT/LEVEL3/l3__obstacle_wok");this.add.existing(wok1_1);const wok2=new Obstacle(this,1148,96,"environments","ENVIRONMENT/LEVEL3/l3__obstacle_wok");this.add.existing(wok2);const wok1=new Obstacle(this,732,102,"environments","ENVIRONMENT/LEVEL3/l3__obstacle_wok");this.add.existing(wok1);const obstacle_1=new Obstacle(this,1976,114,"environments","ENVIRONMENT/LEVEL3/l3_chicken");this.add.existing(obstacle_1);const obstacle=new Obstacle(this,846,114,"environments","ENVIRONMENT/LEVEL3/l3_chicken");this.add.existing(obstacle);const eNVIRONMENT_LEVEL3_l3_chicken=new Obstacle(this,442,114,"environments","ENVIRONMENT/LEVEL3/l3_chicken");this.add.existing(eNVIRONMENT_LEVEL3_l3_chicken);
1201const powerUp_2_1=new PowerUp(this,2658,66,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_2_1);const powerUp_2=new PowerUp(this,2506,80,"powerups","REDPAIL_ORANGECHICKEN/redpail_orangechicken_0001");this.add.existing(powerUp_2);const powerUp_1_1_1=new PowerUp(this,2382,68,"powerups","EGGROLL/eggroll_0001");this.add.existing(powerUp_1_1_1);const powerUp_4_1=new PowerUp(this,2142,44,"powerups","ORANGECHICKEN/orangechicken_0001");this.add.existing(powerUp_4_1);const powerUp_4=new PowerUp(this,1730,2,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_4);const powerUp_1_1=new PowerUp(this,1412,42,"powerups","EGGROLL/eggroll_0001");this.add.existing(powerUp_1_1);const powerUp_3_1=new PowerUp(this,1142,44,"powerups","ORANGECHICKEN/orangechicken_0001");this.add.existing(powerUp_3_1);const powerUp_3_2=new PowerUp(this,804,106,"powerups","REDPAIL_ORANGECHICKEN/redpail_orangechicken_0001");this.add.existing(powerUp_3_2);const powerUp_3=new PowerUp(this,450,38,"powerups","REDPAIL_ORANGECHICKEN/redpail_orangechicken_0001");this.add.existing(powerUp_3);const powerUp_1=new PowerUp(this,266,46,"powerups","ORANGE/orange_0001");this.add.existing(powerUp_1);const powerUp_4_2=new PowerUp(this,1584,66,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_4_2);const powerUp_4_2_1=new PowerUp(this,1318,36,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_4_2_1);const powerUp_4_3=new PowerUp(this,628,44,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_4_3);const nian=this.add.sprite(2880,200,"characters","NIAN/IDLE2/nian_idle2_1");nian.setOrigin(0,1);const firecracker=this.add.sprite(2854,158,"characters","PANDA/TORCH/l4_firecracker_0");firecracker.setOrigin(0,1);const player=new Player(this,120,155);this.add.existing(player),player.setOrigin(.5,.75);const fG_close=this.add.container(0,172),eNVIRONMENT_LEVEL3_l3_intro_grass_1=this.add.tileSprite(0,24,1255,33,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL3_l3_intro_grass_1);const eNVIRONMENT_LEVEL3_l3_intro_grass_1_1=this.add.tileSprite(1606,26,1550,33,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass");eNVIRONMENT_LEVEL3_l3_intro_grass_1_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL3_l3_intro_grass_1_1);const eNVIRONMENT_LEVEL3_l3_house_roof_18_1_1_1=this.add.image(2196,126,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_18");eNVIRONMENT_LEVEL3_l3_house_roof_18_1_1_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL3_l3_house_roof_18_1_1_1);const eNVIRONMENT_LEVEL3_l3_house_roof_18_1_1=this.add.image(1948,126,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_18");eNVIRONMENT_LEVEL3_l3_house_roof_18_1_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL3_l3_house_roof_18_1_1);const eNVIRONMENT_LEVEL3_l3_house_roof_18_1=this.add.image(1680,126,"environments","ENVIRONMENT/LEVEL3/l3_house_roof_18");eNVIRONMENT_LEVEL3_l3_house_roof_18_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL3_l3_house_roof_18_1);const ground_1_1=this.add.rectangle(2798,156,600,10);ground_1_1.setOrigin(0,0),ground_1_1.isFilled=!0,ground_1_1.fillAlpha=0;const ground_1=this.add.rectangle(1455,156,125,10);ground_1.setOrigin(0,0),ground_1.isFilled=!0,ground_1.fillAlpha=0;const ground_1_2_1=this.add.rectangle(1946,156,452,10);ground_1_2_1.setOrigin(0,0),ground_1_2_1.isFilled=!0,ground_1_2_1.fillAlpha=0;const ground_1_2=this.add.rectangle(1610,156,240,10);ground_1_2.setOrigin(0,0),ground_1_2.isFilled=!0,ground_1_2.fillAlpha=0;const ground=this.add.rectangle(0,156,1255,10);ground.setOrigin(0,0),ground.isFilled=!0,ground.fillAlpha=0;const checkpoint=new Checkpoint(this,2030,154);this.add.existing(checkpoint);const checkpoint_1=new Checkpoint(this,998,132);this.add.existing(checkpoint_1);const endZone=new TransitionZone(this,2904,90);this.add.existing(endZone);const startZone=new TransitionZone(this,215,90);this.add.existing(startZone);const score=new Score(this,0,0);this.add.existing(score);const textBox=new TextBox(this,212,140);this.add.existing(textBox),textBox.scaleX=.3,textBox.scaleY=.3;const platforms=[ground,eNVIRONMENT_LEVEL3_l3_box_6,eNVIRONMENT_LEVEL3_l3_box_4_1,eNVIRONMENT_LEVEL3_l3_box_5_2,eNVIRONMENT_LEVEL3_l3_box_5_1,eNVIRONMENT_LEVEL3_l3_box_1,eNVIRONMENT_LEVEL3_l3_box_2_2,eNVIRONMENT_LEVEL3_l3_box_5_3,eNVIRONMENT_LEVEL3_l3_box_6_1,eNVIRONMENT_LEVEL3_l3_box_2_1_1_1,eNVIRONMENT_LEVEL3_l3_box_2_1_2,eNVIRONMENT_LEVEL2_l2_bridge_left_1,eNVIRONMENT_LEVEL2_l2_bridge_tile_2,eNVIRONMENT_LEVEL2_l2_bridge_right_1,eNVIRONMENT_LEVEL2_l2_bridge_left_1_1,eNVIRONMENT_LEVEL2_l2_bridge_tile_2_1,eNVIRONMENT_LEVEL2_l2_bridge_right_1_1,ground_1,ground_1_1,eNVIRONMENT_LEVEL2_l2_bridge_left,eNVIRONMENT_LEVEL2_l2_bridge_tile,eNVIRONMENT_LEVEL2_l2_bridge_tile_1,eNVIRONMENT_LEVEL2_l2_bridge_right,eNVIRONMENT_LEVEL2_l2_bridge_tile_3,eNVIRONMENT_LEVEL2_l2_bridge_tile_1_1,ground_1_2,ground_1_2_1,eNVIRONMENT_LEVEL3_l3_box_5_1_1,eNVIRONMENT_LEVEL3_l3_box_2_1_1_1_1],powerups=[powerUp_1,power
1201Up_1_1,powerUp_3,powerUp_4,powerUp_2,powerUp_3_1,powerUp_4_1,powerUp_1_1_1,powerUp_2_1,powerUp_3_2,powerUp_3_2_2,powerUp_4_2,powerUp_4_2_1,powerUp_4_3],obstacles=[obstacle,wok1,eNVIRONMENT_LEVEL3_l3_chicken,wok2,wok1_1,wok1_1_1_1,obstacle_1],holes=[hole,hole_1],checkpoints=[checkpoint,checkpoint_1];new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_2).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_c_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_b";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_2).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_b";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(eNVIRONMENT_LEVEL1_l1_signage_food).AnimationName="animation_neonsign1";new StartAnimation(eNVIRONMENT_LEVEL1_l1_signage_food_1).AnimationName="animation_neonsign1";new StartAnimation(eNVIRONMENT_LEVEL3_l3_obstacle_wok_0).AnimationName="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok";new StartAnimation(eNVIRONMENT_LEVEL3_l3_streetlight_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_streetlight",powerUp_3_2_2.collectAnimation="powerups_REDPAIL_ORANGECHICKEN/redpail_orangechicken",powerUp_3_2_2.collectSound="powerup_crunch";new StartAnimation(lanternglowing2).AnimationName="animationENVIRONMENT/LEVEL3/l3_obstacle_lantern",new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_5),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_2_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_5_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_4_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_5_2);new StartAnimation(lanternGlowing).AnimationName="animationENVIRONMENT/LEVEL3/l3_obstacle_lantern",new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_5_3),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_6_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_2_1_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_2_2);new StartAnimation(eNVIRONMENT_LEVEL3_l3_streetlight_0_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_streetlight";new StartAnimation(eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_streetlight";new StartAnimation(eNVIRONMENT_LEVEL3_l3_streetlight_0_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_streetlight",new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_6),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_right),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_tile_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_tile_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_tile_3),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_tile),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_left);new StartAnimation(eNVIRONMENT_LEVEL1_l1_birds_0).AnimationName="animation_ENVIRONMENT/LEVEL1/l1_birds",new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_right_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_tile_2_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_left_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_right_1),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_tile_2),new PlatformPhysics(eNVIRONMENT_LEVEL2_l2_bridge_left_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_2_1_2),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_5_1_1),new PlatformPhysics(eNVIRONMENT_LEVEL3_l3_box_2_1_1_1_1),wok1_1_1_1.hitAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1_1_1_1.idleAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1_1_1_1.hitboxOffsetX=7,wok1_1_1_1.hitSound="obstacle_wok";new StartAnimation(wok1_1_1_1).AnimationName="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1_1.hitAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1_1.idleAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1_1.hitboxOffsetX=7,wok1_1.hitSound="obstacle_wok";new StartAnimation(wok1_1).AnimationName="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok2.hitAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok2.idleAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok2.hitboxOffsetX=7,wok2.hitSound="obstacle_wok",wok2.fallType="BACKWARD",wok1.hitAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1.idleAnimation="obstaclesENVIRONMENT/LEVEL3/l3_obstacle_wok",wok1.hitboxOffsetX=7,wok1.hitSound="obstacle_wok",obstacle_1.hitAnimation="obstacles_chickenENVIRONMENT/LEVEL3/l3_chicken",obstacle_1.idleAnimation="obstacles_chickenENVIRONMENT/LEVEL3/l3_chicken",obstacle_1.hitboxOffsetY=21,obstacle_1.hitSound="obstacle_chicken",obstacle_1.fallType="BACKWARD",obstacle.hitAnimation="obstacles_chickenENVIRONMENT/LEVEL3/l3_chicken",obstacle.idleAnimation="obstacles_chickenENVIRONMENT/LEVEL3/l3_chicken",obstacle.hitboxOffsetY=21,obstacle.hitSound="obstacle_chicken",obstacle.fallType="BACKWARD",eNVIRONMENT_LEVEL3_l3_chicken.hitAnimation="obstacles_chickenENVIRONMENT/LEVEL3/l3_chicken",eNVIRONMENT_LEVEL3_l3_chicken.idleAnimation="obstacles_chickenENVIRONMENT/LEVEL3/l3_chicken",eNVIRONMENT_LEVEL3_l3_chicken.hitboxOffsetY=21,eNVIRONMENT_LEVEL3_l3_chicken.hitSound="obstacle_chicken",eNVIRONMENT_LEVEL3_l3_chicken.fallType="BACKWARD",powerUp_2_1.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_2_1.collectSound="powerup_fortune",powerUp_2.collectAnimation="powerups_REDPAIL_ORANGECHICKEN/redpail_orangechicken",powerUp_2.collectSound="powerup_crunch",powerUp_1_1_1.collectAnimation="powerups_EGGROLL/eggroll",powerUp_1_1_1.collectSound="powerup_crunch",powerUp_4_1.collectAnimation="powerups_ORANGECHICKEN/orangechicken",powerUp_4_1.collectSound="powerup_crunch",powerUp_4.collectAnimation="powerups_SHRIMP/shrimp",powerUp_4.collectSound="powerup_slerp",powerUp_1_1.collectAnimation="powerups_EGGROLL/eggroll",powerUp_1_1.collectSound="powerup_crunch",powerUp_3_1.collectAnimation="powerups_ORANGECHICKEN/orangechicken",powerUp_3_1.collectSound="powerup_crunch",powerUp_3_2.collectAnimation="powerups_REDPAIL_ORANGECHICKEN/redpail_orangechicken",powerUp_3_2.collectSound="powerup_crunch",powerUp_3.collectAnimation="powerups_REDPAIL_ORANGECHICKEN/redpail_orangechicken",powerUp_3.collectSound="powerup_crunch",powerUp_1.collectAnimation="powerups_ORANGE/orange",powerUp_1.collectSound="powerup_fortune",powerUp_4_2.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_4_2.collectSound="powerup_fortune",powerUp_4_2_1.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_4_2_1.collectSound="powerup_fortune",powerUp_4_3.collectAnimation="powerups_SHRIMP/shrimp",powerUp_4_3.collectSound="powerup_slerp";new StartAnimation(nian).AnimationName="nian_idle2NIAN/IDLE2/nian_idle",new StartAnimation(firecracker),player.platforms=platforms,new PlatformPhysics(ground_1_1),new PlatformPhysics(ground_1),new PlatformPhysics(ground_1_2_1),new PlatformPhysics(ground_1_2),new PlatformPhysics(ground),endZone.player=player,startZone.player=player,score.cards=2,this.nian=nian,this.firecracker=firecracker,this.player=player,this.endZone=endZone,this.startZone=startZone,this.score=score,this.textBox=textBox,this.platforms=platforms,this.powerups=powerups,this.obstacles=obstacles,this.holes=holes,this.checkpoints=checkpoints,this.events.emit("scene-awake")}nian;firecracker;player;endZone;startZone;score;textBox;platforms;powerups;obstacles;holes;checkpoints;startCutsceneState;endCutsceneState;levelCreate(){window.gtag("event","Level3"),this.scale.setGameSize(320,180),this.editorCreate(),this.sound.add("music_level3",{loop:!0}).play(),this.cameras.main.startFollow(this.player),this.cameras.main.setLerp(1,0),this.cameras.main.followOffset.set(-40,75),this.cameras.main.scrollY=0;const arcade=this.physics;arcade.add.overlap(this.player,this.powerups,super.collectPowerUp,void 0,this),arcade.add.overlap(this.player,this.obstacles,super.hitObstacle,void 0,this),arcade.add.overlap(this.player,this.holes,super.hitHole,void 0,this),this.startCutsceneState=StartCutsceneState$1.START,this.endCutsceneState=EndCutsceneState$1.START}update(timestamp,elapsed){super.updatePlayer(elapsed,this,this.player,this.startZone,this.endZone,this.checkpoints,"Level3Fortune",this.obstacles,this.holes,this.updateStartCutscene,this.updateEndCutscene)}updateStartCutscene(scene){switch(scene.startCutsceneState){case StartCutsceneState$1.START:scene.player.setIdleSide(),scene.startCutsceneState=StartCutsceneState$1.IDLE,setTimeout((()=>{scene.textBox.typeText("Keep going! You've almost got him!"),scene.startCutsceneState=StartCutsceneState$1.TEXT}),500);break;case StartCutsceneState$1.IDLE:break;case StartCutsceneState$1.TEXT:scene.startCutsceneState=StartCutsceneState$1.READY,setTimeout((()=>{scene.textBox.reset(),scene.player.setRunning(),scene.startCutsceneState=StartCutsceneState$1.GO}),2e3);break;case StartCutsceneState$1.READY:break;case StartCutsceneState$1.GO:scene.player.incrementX(1.5)}}updateEndCutscene(scene){switch(scene.endCutsceneState){case EndCutsceneState$1.START:scene.player.setIdleSide(),scene.endCutsceneState=EndCutsceneState$1.PRENIAN,scene.textBox.setXY(170,75),scene.textBox.typeText("Hmm.. a firecracker.",(()=>{setTimeout((()=>{scene.textBox.typeText("This might be useful;
1201 Nian is scared of loud noises...",(()=>{setTimeout((()=>{scene.endCutsceneState=EndCutsceneState$1.NIAN}),700)}))}),700)}));break;case EndCutsceneState$1.PRENIAN:break;case EndCutsceneState$1.NIAN:scene.nian.play("nian_smokeNIAN/SMOKE/smoke",!0),scene.nian.once("animationcomplete",(()=>{scene.endCutsceneState=EndCutsceneState$1.POSTNIAN,scene.cameras.main.stopFollow(),scene.textBox.reset()}));break;case EndCutsceneState$1.POSTNIAN:scene.cameras.main.fadeOut(2e3,0,0,0),scene.endCutsceneState=EndCutsceneState$1.FADEOUT,scene.firecracker.visible=!1,setTimeout((()=>{scene.endCutsceneState=EndCutsceneState$1.END}),2e3);break;case EndCutsceneState$1.FADEOUT:scene.player.setRunning(),scene.player.incrementX(1.5);break;case EndCutsceneState$1.END:scene.sound.stopAll(),scene.scene.stop(),scene.scene.start("Level3Fortune")}}getCheckpoints(){return this.checkpoints}}!function(FortuneState){FortuneState[FortuneState.START=1]="START",FortuneState[FortuneState.BANNERWAIT=2]="BANNERWAIT",FortuneState[FortuneState.CARDEXPAND=3]="CARDEXPAND",FortuneState[FortuneState.CARDLEFTWAIT=4]="CARDLEFTWAIT",FortuneState[FortuneState.CARDFLIP=5]="CARDFLIP",FortuneState[FortuneState.BOTHCARDSMOVE=6]="BOTHCARDSMOVE",FortuneState[FortuneState.BOTHCARDSWAIT=7]="BOTHCARDSWAIT",FortuneState[FortuneState.END=8]="END"}(FortuneState$1||(FortuneState$1={}));class Level3Fortune extends phaser.Scene{constructor(){super("Level3Fortune")}editorCreate(){const rectangle=this.add.rectangle(0,0,640,360);rectangle.setOrigin(0,0),rectangle.isFilled=!0,rectangle.fillColor=15818530;const starburst=this.add.sprite(320,180,"cutscenes","MISC/STARBURST/starburst00000");starburst.scaleX=4,starburst.scaleY=4,starburst.alpha=.06,starburst.alphaTopLeft=.06,starburst.alphaTopRight=.06,starburst.alphaBottomLeft=.06,starburst.alphaBottomRight=.06;const clickableButton=new ClickableButton(this,568,330);this.add.existing(clickableButton),clickableButton.visible=!1;const eNVIRONMENT_LEVEL3_l3_firework_b_0=this.add.sprite(52,158,"environments","ENVIRONMENT/LEVEL3/l3_firework_b_0");eNVIRONMENT_LEVEL3_l3_firework_b_0.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1=this.add.sprite(560,97,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1=this.add.sprite(149,305,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1.setOrigin(0,1);const good_fortune_unlocked=this.add.sprite(106,224,"cutscenes","MISC/ENDLEVEL/endlevel_00000");good_fortune_unlocked.setOrigin(0,1);const card_right=new RightCard(this,320,180,"ui","level3_FortuneCard_Redeem");this.add.existing(card_right),card_right.scaleX=.3,card_right.scaleY=.3,card_right.visible=!1;const card_left=new Card(this,320,180,"ui","FortuneCard_OrangeChicken_front");this.add.existing(card_left),card_left.scaleX=.3,card_left.scaleY=.3,card_left.visible=!1;const disclaimer=new Disclaimer(this,320,330);this.add.existing(disclaimer),disclaimer.setOrigin(.5,.5),disclaimer.visible=!1,disclaimer.text="Free* 3rd entrée with the purchase of a Bigger Plate. Tax, delivery, service, and premium entrée fee extra. Tax included for the 3rd entree. One coupon per person per order. Valid online only. Expires 2/28/22.";const textBox=new TextBox(this,510,314);this.add.existing(textBox),textBox.scaleX=.6,textBox.scaleY=.6;new StartAnimation(starburst).AnimationName="MISC/STARBURST/starburst";new RotateForever(starburst).Rotationspeed=.2,clickableButton.textString="CONTINUE",clickableButton.nextSceneKey="Level4";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_b";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(good_fortune_unlocked).AnimationName="MISC/ENDLEVEL/endlevel",card_right.redeemDownloadImageTexture={key:"ui",frame:"save_level3"},card_left.backTexture={key:"ui",frame:"FortuneCard_OrangeChicken_back"},this.clickableButton=clickableButton,this.good_fortune_unlocked=good_fortune_unlocked,this.card_right=card_right,this.card_left=card_left,this.disclaimer=disclaimer,this.textBox=textBox,this.events.emit("scene-awake")}clickableButton;good_fortune_unlocked;card_right;card_left;disclaimer;textBox;fortuneState;accumulator=0;fps=60;physicsTimestep;domScaleX=0;domScaleY=0;cardPixelCounter=0;code;create(){window.gtag("event","Level3Redeem"),this.editorCreate(),this.scale.setGameSize(640,360),this.fortuneState=FortuneState$1.START,this.sound.add("fortunecard").play(),this.physicsTimestep=1e3/this.fps}update(timestamp,elapsed){for(this.accumulator+=elapsed;this.accumulator>=this.physicsTimestep;)switch(this.accumulator-=this.physicsTimestep,this.fortuneState){case FortuneState$1.START:httpsCallable(functions,"getCode")({type:"level3"}).then((result=>{result.data&&result.data.codes&&result.data.codes.length>
12010&&result.data.codes[0].code&&(this.code=result.data.codes[0].code,this.card_right.setCode(this.code))})).catch((error=>{console.log(error)})),this.fortuneState=FortuneState$1.BANNERWAIT,this.domScaleX=0,this.domScaleY=0,this.card_left.setDomScale(this.domScaleX,this.domScaleY),setTimeout((()=>{this.textBox.typeText("Great work! You've unlocked the Orange Chicken Prosperity Card!",(()=>{setTimeout((()=>{this.textBox.typeText("Redeem your code now, or save for later and keep playing!",(()=>{setTimeout((()=>{this.textBox.reset(),this.fortuneState=FortuneState$1.CARDEXPAND,this.good_fortune_unlocked.visible=!1,this.card_left.setVisibility(!0),setTimeout((()=>{this.clickableButton.visible=!0}),3500)}),2e3)}))}),1500)}))}),500);break;case FortuneState$1.BANNERWAIT:break;case FortuneState$1.CARDEXPAND:this.domScaleX+=.0066,this.domScaleY+=.0066,this.card_left.setDomScale(this.domScaleX,this.domScaleY),this.domScaleX>=.3&&(this.fortuneState=FortuneState$1.CARDLEFTWAIT,setTimeout((()=>{this.fortuneState=FortuneState$1.CARDFLIP}),1e3));break;case FortuneState$1.CARDLEFTWAIT:break;case FortuneState$1.CARDFLIP:this.card_left.flip(),this.card_right.setVisibility(!0),this.fortuneState=FortuneState$1.BOTHCARDSMOVE;break;case FortuneState$1.BOTHCARDSMOVE:this.cardPixelCounter++,this.card_left.nudge(-2),this.card_right.nudge(2),this.cardPixelCounter>45&&(this.fortuneState=FortuneState$1.BOTHCARDSWAIT,this.disclaimer.setVisibility(!0),setTimeout((()=>{this.fortuneState=FortuneState$1.END}),4e3));case FortuneState$1.BOTHCARDSWAIT:case FortuneState$1.END:}}}!function(StartCutsceneState){StartCutsceneState[StartCutsceneState.START=1]="START",StartCutsceneState[StartCutsceneState.IDLE=2]="IDLE",StartCutsceneState[StartCutsceneState.TEXT=3]="TEXT",StartCutsceneState[StartCutsceneState.READY=4]="READY",StartCutsceneState[StartCutsceneState.GO=5]="GO"}(StartCutsceneState||(StartCutsceneState={})),function(EndCutsceneState){EndCutsceneState[EndCutsceneState.START=1]="START",EndCutsceneState[EndCutsceneState.PRENIAN=2]="PRENIAN",EndCutsceneState[EndCutsceneState.PRESCAREDNIAN=3]="PRESCAREDNIAN",EndCutsceneState[EndCutsceneState.WAITNIAN=4]="WAITNIAN",EndCutsceneState[EndCutsceneState.RUNNINGNIAN=5]="RUNNINGNIAN",EndCutsceneState[EndCutsceneState.END=6]="END"}(EndCutsceneState||(EndCutsceneState={}));class Level4 extends PandaScene{constructor(){super("Level4")}editorCreate(){const bG_Far=this.add.container(0,-1),eNVIRONMENT_LEVEL4_l4_bg_0_sky=this.add.tileSprite(413,180,4500,180,"environments","ENVIRONMENT/LEVEL4/l4_bg_0_sky");eNVIRONMENT_LEVEL4_l4_bg_0_sky.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_bg_0_sky);const eNVIRONMENT_LEVEL4_l4a_bg_0_sky=this.add.image(500,90,"environments","ENVIRONMENT/LEVEL4/l4a_bg_0_sky");bG_Far.add(eNVIRONMENT_LEVEL4_l4a_bg_0_sky);const eNVIRONMENT_LEVEL4_l4_bg_0_stars=this.add.image(-2,147,"environments","ENVIRONMENT/LEVEL4/l4_bg_0_stars");eNVIRONMENT_LEVEL4_l4_bg_0_stars.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_bg_0_stars);const eNVIRONMENT_LEVEL4_l4a_bg_0_moon=this.add.image(106,30,"environments","ENVIRONMENT/LEVEL4/l4a_bg_0_moon");eNVIRONMENT_LEVEL4_l4a_bg_0_moon.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4a_bg_0_moon);const eNVIRONMENT_LEVEL4_l4a_bg_1_mountain_1=this.add.image(-181,122,"environments","ENVIRONMENT/LEVEL4/l4a_bg_1_mountain");eNVIRONMENT_LEVEL4_l4a_bg_1_mountain_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_bg_1_mountain_1.flipX=!0,bG_Far.add(eNVIRONMENT_LEVEL4_l4a_bg_1_mountain_1);const eNVIRONMENT_LEVEL4_l4a_bg_1_mountain=this.add.image(0,124,"environments","ENVIRONMENT/LEVEL4/l4a_bg_1_mountain");eNVIRONMENT_LEVEL4_l4a_bg_1_mountain.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4a_bg_1_mountain);const eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left=this.add.image(2,136,"environments","ENVIRONMENT/LEVEL2/l2_bg_1_skyline_left");eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.tintFill=!0,eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.tintTopLeft=3608437,eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.tintTopRight=3608437,eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.tintBottomLeft=3608437,eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left.tintBottomRight=3608437,bG_Far.add(eNVIRONMENT_LEVEL2_l2_bg_1_skyline_left);const eNVIRONMENT_LEVEL4_l4_bg_2_lava=this.add.tileSprite(762,157,3800,83,"environments","ENVIRONMENT/LEVEL4/l4_bg_2_lava");eNVIRONMENT_LEVEL4_l4_bg_2_lava.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_bg_2_lava);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_1=this.add.image(1206,108,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_1);const eNVIRONMENT_LEVEL4_l4a_cave_rear_1=this.add.image(1636,181,"environments","ENVIRONMENT/LEVEL4/l4a_cave_rear");eNVIRONMENT_LEVEL4_l4a_cave_rear_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_cave_rear_1.tintTopLeft=3420465,bG_Far.add(eNVIRONMENT_LEVEL4_l4a_cave_rear_1);const eNVIRONMENT_LEVEL4_l4a_cave_front_1=this.add.image(1518,182,"environments","ENVIRONMENT/LEVEL4/l4a_cave_front");eNVIRONMENT_LEVEL4_l4a_cave_front_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_cave_front_1.tintTopLeft=3420465,bG_Far.add(eNVIRONMENT_LEVEL4_l4a_cave_front_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3=this.add.image(2490,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3.scaleX=4,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3.scaleY=4,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3.tintTopLeft=3420465,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3.tintTopRight=3420465,bG_Far.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3);const eNVIRONMENT_LEVEL4_l4a_cave_rear_1_1=this.add.image(3529,181,"environments","ENVIRONMENT/LEVEL4/l4a_cave_rear");eNVIRONMENT_LEVEL4_l4a_cave_rear_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_cave_rear_1_1.tintTopLeft=3420465,bG_Far.add(eNVIRONMENT_LEVEL4_l4a_cave_rear_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1=this.add.image(3040,145,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1.scaleX=4,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1.scaleY=4,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1.flipX=!0,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1.tintTopLeft=3420465,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1.tintTopRight=3420465,bG_Far.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_3_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_2=this.add.image(2438,121,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_2.scaleX=.5,eNVIRONMENT_LEVEL4_l4_closeup_column_1_2.scaleY=.5,eNVIRONMENT_LEVEL4_l4_closeup_column_1_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_2);const eNVIRONMENT_LEVEL4_l4_light_2=this.add.image(3638,91,"environments","ENVIRONMENT/LEVEL4/l4_light_2");bG_Far.add(eNVIRONMENT_LEVEL4_l4_light_2);const eNVIRONMENT_LEVEL4_l4_light_1=this.add.image(3574,90,"environments","ENVIRONMENT/LEVEL4/l4_light_1");bG_Far.add(eNVIRONMENT_LEVEL4_l4_light_1);const eNVIRONMENT_LEVEL4_l4a_cave_front_1_1=this.add.image(4228,180,"environments","ENVIRONMENT/LEVEL4/l4a_cave_front");eNVIRONMENT_LEVEL4_l4a_cave_front_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_cave_front_1_1.flipX=!0,eNVIRONMENT_LEVEL4_l4a_cave_front_1_1.tintTopLeft=3420465,bG_Far.add(eNVIRONMENT_LEVEL4_l4a_cave_front_1_1);const eNVIRONMENT_LEVEL4_l4_bg_3_cave_1=this.add.tileSprite(4356,178,1e3,180,"environments","ENVIRONMENT/LEVEL4/l4_bg_3_cave");eNVIRONMENT_LEVEL4_l4_bg_3_cave_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_bg_3_cave_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2=this.add.image(3444,109,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2.scaleX=.5,eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2.scaleY=.5,eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2);const eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_1=this.add.image(4069,183,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_1.flipX=!0,bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2_1=this.add.image(4762,134,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2_1.scaleX=.5,eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2_1.scaleY=.75,eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_2_1);const eNVIRONMENT_LEVEL4_l4_foodpile_2_1_1_1_1=this.add.image(4327,116,"environments","ENVIRONMENT/LEVEL4/l4_foodpile");eNVIRONMENT_LEVEL4_l4_foodpile_2_1_1_1_1.scaleX=.5,eNVIRONMENT_LEVEL4_l4_foodpile_2_1_1_1_1.scaleY=.5,eNVIRONMENT_LEVEL4_l4_foodpile_2_1_1_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_foodpile_2_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_light_1_1=this.add.image(4383,91,"environments","ENVIRONMENT/LEVEL4/l4_light_1");bG_Far.add(eNVIRONMENT_LEVEL4_l4_light_1_1);const eNVIRONMENT_LEVEL4_l4_light_1_1_1=this.add.image(4350,90,"environments","ENVIRONMENT/LEVEL4/l4_light_1");bG_Far.add(eNVIRONMENT_LEVEL4_l4_light_1_1_1);const eNVIRONMENT_LEVEL4_l4_light_1_1_1_1=this.add.image(4319,93,"environments","ENVIRONMENT/LEVEL4/l4_light_1");bG_Far.add(eNVIRONMENT_LEVEL4_l4_light_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_light_2_1=this.add.image(4976,90,"environments","ENVIRONMENT/LEVEL4/l4_light_2");bG_Far.add(eNVIRONMENT_LEVEL4_l4_light_2_1);const eNVIRONMENT_LEVEL4_l4_closeup_cobweb=this.add.image(1065,46,"environments","ENVIRONMENT/LEVEL4/l4_closeup_cobweb");eNVIRONMENT_LEVEL4_l4_closeup_cobweb.setOrigin(0,0),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_cobweb);const eNVIRONMENT_LEVEL4_l4_rocks_2=this.add.image(3743,143,"environments","ENVIRONMENT/LEVEL4/l4_rocks_2");eNVIRONMENT_LEVEL4_l4_rocks_2.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_rocks_2);const eNVIRONMENT_LEVEL4_l4_rocks_2_1=this.add.image(3706,141,"environments","ENVIRONMENT/LEVEL4/l4_rocks_2");eNVIRONMENT_LEVEL4_l4_rocks_2_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_rocks_2_1);const eNVIRONMENT_LEVEL4_l4_rocks_2_1_1=this.add.image(3783,143,"environments","ENVIRONMENT/LEVEL4/l4_rocks_2");eNVIRONMENT_LEVEL4_l4_rocks_2_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_rocks_2_1_1);const eNVIRONMENT_LEVEL4_l4_rocks_2_1_1_1=this.add.image(3666,146,"environments","ENVIRONMENT/LEVEL4/l4_rocks_2");eNVIRONMENT_LEVEL4_l4_rocks_2_1_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_rocks_2_1_1_1);const eNVIRONMENT_LEVEL4_l4_rocks_1_1=this.add.image(3716,123,"environments","ENVIRONMENT/LEVEL4/l4_rocks_1");eNVIRONMENT_LEVEL4_l4_rocks_1_1.setOrigin(0,1),bG_Far.add(eNVIRONMENT_LEVEL4_l4_rocks_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2=this.add.image(2454,48,"environments","ENVIRONMENT/LEVEL4/l4_closeup_cobweb");eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2.setOrigin(0,0),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2);const eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2_1=this.add.image(2807,90,"environments","ENVIRONMENT/LEVEL4/l4_closeup_cobweb");eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2_1.angle=-180,eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2_1.setOrigin(0,0),bG_Far.add(eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_2_1);const bG_Close=this.add.container(0,-1),eNVIRONMENT_LEVEL4_l4_bg_3_cave=this.add.tileSprite(741,180,3500,180,"environments","ENVIRONMENT/LEVEL4/l4_bg_3_cave");eNVIRONMENT_LEVEL4_l4_bg_3_cave.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_bg_3_cave);const eNVIRONMENT_LEVEL2_l2_bg_3_1_light=this.add.image(870,154,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");eNVIRONMENT_LEVEL2_l2_bg_3_1_light.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_3_1_light.tintTopLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_3_1_light.tintTopRight=12549167,eNVIRONMENT_LEVEL2_l2_bg_3_1_light.tintBottomLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_3_1_light.tintBottomRight=12549167,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light);const eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1=this.add.image(1606,154,"environments","ENVIRONMENT/LEVEL2/l2_bg_3-1_light");eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1.tintTopLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1.tintTopRight=12549167,eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1.tintBottomLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1.tintBottomRight=12549167,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_3_1_light_1);const eNVIRONMENT_LEVEL2_l2_bg_2_1_light=this.add.image(1091,154,"environments","ENVIRONMENT/LEVEL2/l2_bg_2-1_light");eNVIRONMENT_LEVEL2_l2_bg_2_1_light.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_2_1_light.tintTopLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_2_1_light.tintTopRight=12549167,eNVIRONMENT_LEVEL2_l2_bg_2_1_light.tintBottomLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_2_1_light.tintBottomRight=12549167,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_2_1_light);const eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1=this.add.image(1326,151,"environments","ENVIRONMENT/LEVEL2/l2_bg_2-1_light");eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1.tintTopLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1.tintTopRight=12549167,eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1.tintBottomLeft=12549167,eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1.tintBottomRight=12549167,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_2_1_light_1);const eNVIRONMENT_LEVEL4_l4_fog=this.add.tileSprite(725,180,4500,180,"environments","ENVIRONMENT/LEVEL4/l4_fog");eNVIRONMENT_LEVEL4_l4_fog.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_fog);const eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling=this.add.tileSprite(413,145,5140,145,"environments","ENVIRONMENT/LEVEL4/l4_bg_4_floor_ceiling");eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_bg_4_floor_ceiling);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1=this.add.image(3364,151,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1);const eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right=this.add.image(-64,59,"environments","ENVIRONMENT/LEVEL2/l2_bg_4_foliage_right");eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right.setOrigin(0,1),eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right.tintTopLeft=6105273,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right.tintTopRight=6105273,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right.tintBottomLeft=6105273,eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right.tintBottomRight=6105273,bG_Close.add(eNVIRONMENT_LEVEL2_l2_bg_4_foliage_right);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1=this.add.image(1653,145,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1.scaleX=2,eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1.scaleY=2,eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1);const eNVIRONMENT_LEVEL4_l4_statue_1_1_1=this.add.image(2448,154,"environments","ENVIRONMENT/LEVEL4/l4_statue");eNVIRONMENT_LEVEL4_l4_statue_1_1_1.angle=-90,eNVIRONMENT_LEVEL4_l4_statue_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_statue_1_1_1.flipY=!0,bG_Close.add(eNVIRONMENT_LEVEL4_l4_statue_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1=this.add.image(2304,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1=this.add.image(2320,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1=this.add.image(2336,127,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1=this.add.image(2352,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1=this.add.image(2528,143,"environ
1201ments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1=this.add.image(2576,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1.flipX=!0,bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1=this.add.image(2560,127,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1.flipX=!0,bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_1=this.add.image(937,179,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_4=this.add.image(4248,144,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_4.scaleX=2,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_4.scaleY=2,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_4.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_4);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1=this.add.image(4242,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1.flipX=!0,bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1_1=this.add.image(4282,106,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1_1.flipX=!0,bG_Close.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2_1_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_3=this.add.image(2818,142,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_3.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_3);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1_1=this.add.image(4429,137,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1_1.scaleX=.75,eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1_1.scaleY=.75,eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_3_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_1=this.add.tileSprite(2173,181,50,31,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_tile");eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_1=this.add.image(2223,181,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_right");eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_1);const eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_1=this.add.image(3417,147,"environments","ENVIRONMENT/LEVEL4/l4_closeup_cobweb");eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_1.angle=-92,eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_1.setOrigin(0,0),bG_Close.add(eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1_1);const eNVIRONMENT_LEVEL4_l4_rocks_1=this.add.image(4363,168,"environments","ENVIRONMENT/LEVEL4/l4_rocks_1");eNVIRONMENT_LEVEL4_l4_rocks_1.setOrigin(0,1),bG_Close.add(eNVIRONMENT_LEVEL4_l4_rocks_1);const mG_Group=this.add.container(0,0),eNVIRONMENT_LEVEL2_l2_bg_grass_2=this.add.tileSprite(-17,125,256,40,"environments","ENVIRONMENT/LEVEL2/l2_bg_grass_2");eNVIRONMENT_LEVEL2_l2_bg_grass_2.tintTopLeft=8349646,eNVIRONMENT_LEVEL2_l2_bg_grass_2.tintTopRight=4273606,eNVIRONMENT_LEVEL2_l2_bg_grass_2.tintBottomLeft=8349646,eNVIRONMENT_LEVEL2_l2_bg_grass_2.tintBottomRight=4273606,mG_Group.add(eNVIRONMENT_LEVEL2_l2_bg_grass_2);const eNVIRONMENT_LEVEL4_l4_statue_1_1=this.add.image(2008,209,"environments","ENVIRONMENT/LEVEL4/l4_statue");eNVIRONMENT_LEVEL4_l4_statue_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_statue_1_1.flipY=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue_1_1);const eNVIRONMENT_LEVEL4_l4_statue_1_3=this.add.image(3076,158,"environments","ENVIRONMENT/LEVEL4/l4_statue");eNVIRONMENT_LEVEL4_l4_statue_1_3.angle=-90,eNVIRONMENT_LEVEL4_l4_statue_1_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue_1_3);const eNVIRONMENT_LEVEL4_l4_ground=this.add.tileSprite(0,180,4800,45,"environments","ENVIRONMENT/LEVEL4/l4_ground");eNVIRONMENT_LEVEL4_l4_ground.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground);const eNVIRONMENT_LEVEL4_l4a_ground_1=this.add.image(-143,179,"environments","ENVIRONMENT/LEVEL4/l4a_ground");eNVIRONMENT_LEVEL4_l4a_ground_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_ground_1);const eNVIRONMENT_LEVEL4_l4a_ground=this.add.image(0,179,"environments","ENVIRONMENT/LEVEL4/l4a_ground");eNVIRONMENT_LEVEL4_l4a_ground.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_ground);const eNVIRONMENT_LEVEL4_l4_statue=this.add.image(1155,147,"environments","ENVIRONMENT/LEVEL4/l4_statue");eNVIRONMENT_LEVEL4_l4_statue.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue);const eNVIRONMENT_LEVEL4_l4_ground_lava_large=this.add.image(950,179,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large");eNVIRONMENT_LEVEL4_l4_ground_lava_large.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large);const eNVIRONMENT_LEVEL4_l4_ground_lava_small=this.add.image(1064,158,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_small");eNVIRONMENT_LEVEL4_l4_ground_lava_small.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_small);const eNVIRONMENT_LEVEL4_l4a_cave_rear=this.add.image(0,178,"environments","ENVIRONMENT/LEVEL4/l4a_cave_rear");eNVIRONMENT_LEVEL4_l4a_cave_rear.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_cave_rear);const eNVIRONMENT_LEVEL4_l4a_torch_0=this.add.sprite(292,132,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0);const eNVIRONMENT_LEVEL4_l4_statue_1=this.add.image(1696,146,"environments","ENVIRONMENT/LEVEL4/l4_statue_panda");eNVIRONMENT_LEVEL4_l4_statue_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_1=this.add.image(1423,179,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large");eNVIRONMENT_LEVEL4_l4_ground_lava_large_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_ground_lava_large_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1_1=this.add.image(928,143,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1_1.scaleX=.5,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1_1.scaleY=.5,eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1=this.add.image(944,144,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_2=this.add.image(976,137,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_2");eNVIRONMENT_LEVEL4_l4_obstacle_rock_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_2);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1=this.add.image(960,127,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1);const eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_2=this.add.image(912,150,"environments","ENVIRONMENT/LEVEL4/l4_obstacle_rock_1");eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacle_rock_1_2);const eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1_1_1=this.add.image(4401,163,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_small");eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1_1=this.add.image(4449,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large");eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1=this.add.sprite(1079,157,"environments","ENVIRONMENT/LEVEL4/l4_embers_large_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1);
1201const eNVIRONMENT_LEVEL4_l4_statue_1_2=this.add.image(3074,144,"environments","ENVIRONMENT/LEVEL4/l4_statue_panda");eNVIRONMENT_LEVEL4_l4_statue_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue_1_2);const eNVIRONMENT_LEVEL4_l4_platform_2=this.add.image(1875,129,"environments","ENVIRONMENT/LEVEL4/l4_platform_2");eNVIRONMENT_LEVEL4_l4_platform_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_platform_2);const eNVIRONMENT_LEVEL4_l4_platform_2_1=this.add.image(2878,99,"environments","ENVIRONMENT/LEVEL4/l4_platform_2");eNVIRONMENT_LEVEL4_l4_platform_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_platform_2_1);const eNVIRONMENT_LEVEL4_l4_platform_2_2=this.add.image(2198,120,"environments","ENVIRONMENT/LEVEL4/l4_platform_2");eNVIRONMENT_LEVEL4_l4_platform_2_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_platform_2_2);const eNVIRONMENT_LEVEL4_l4_ground_1=this.add.tileSprite(2012,180,150,45,"environments","ENVIRONMENT/LEVEL4/l4_ground");eNVIRONMENT_LEVEL4_l4_ground_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_left=this.add.image(1799,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_left");eNVIRONMENT_LEVEL4_l4_ground_lava_large_left.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_left);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_right=this.add.image(1981,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_right");eNVIRONMENT_LEVEL4_l4_ground_lava_large_right.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_right);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_left_1=this.add.image(2142,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_left");eNVIRONMENT_LEVEL4_l4_ground_lava_large_left_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_left_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1=this.add.image(2444,179,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large");eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1=this.add.image(2613,160,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_small");eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1_1=this.add.image(3068,162,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_small");eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_small_1_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1=this.add.image(3013,177,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large");eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1=this.add.sprite(3020,165,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile=this.add.tileSprite(3175,180,515,28,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_tile");eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_left=this.add.image(3684,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_left");eNVIRONMENT_LEVEL4_l4_obstacles_pit_left.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_left);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_right=this.add.image(3175,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_right");eNVIRONMENT_LEVEL4_l4_obstacles_pit_right.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_right);const eNVIRONMENT_LEVEL3_l3_intro_grass_small=this.add.image(3695,170,"environments","ENVIRONMENT/LEVEL3/l3_intro_grass_small");eNVIRONMENT_LEVEL3_l3_intro_grass_small.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL3_l3_intro_grass_small);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1=this.add.sprite(957,165,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1=this.add.sprite(1433,174,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1=this.add.sprite(1829,169,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_2=this.add.image(2273,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_right");eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_2);const eNVIRONMENT_LEVEL4_l4_rocks_4=this.add.image(3062,243,"environments","ENVIRONMENT/LEVEL4/l4_rocks_4");eNVIRONMENT_LEVEL4_l4_rocks_4.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_rocks_4);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2=this.add.sprite(1873,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1=this.add.sprite(1907.9974365234375,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1=this.add.sprite(1945,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1=this.add.sprite(2169,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1=this.add.sprite(2210,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1=this.add.sprite(2252,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1_1=this.add.sprite(2454,175,"environments","ENVIRONMENT/LEVEL4/l4_embers_small_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1=this.add.tileSprite(2668,180,50,28,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_tile");eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1=this.add.image(2668,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_right");eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1=this.add.image(2712,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_left");eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1_1=this.add.tileSprite(2297,180,50,28,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_tile");eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1_1=this.add.image(2297,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_right");eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1_1=this.add.image(2341,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_left");eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1_1);const eNVIRONMENT_LEVEL4_l4_platform_2_3=this.add.image(3482,114,"environments","ENVIRONMENT/LEVEL4/l4_platform_2");eNVIRONMENT_LEVEL4_l4_platform_2_3.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_platform_2_3);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_left_1_1=this.add.image(3913,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_left");eNVIRONMENT_LEVEL4_l4_ground_lava_large_left_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_left_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_2_1=this.add.tileSprite(3944,180,230,32,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_tile");eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_2_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_2_1=this.add.image(4170,180,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_right");eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_right_2_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1=this.add.sprite(2628,159,"environments","ENVIRONMENT/LEVEL4/l4_embers_large_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1=this.add.sprite(3083,161,"environments","ENVIRONMENT/LEVEL4/l4_embers_large_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_small_1=this.add.image(2049,160,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_small");eNVIRONMENT_LEVEL4_l4_ground_lava_small_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_small_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1=this.add.sprite(2064,159,"environments","ENVIRONMENT/LEVEL4/l4_embers_large_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_rocks_4_1=this.add.image(3405,240,"environments","ENVIRONMENT/LEVEL4/l4_rocks_4");eNVIRONMENT_LEVEL4_l4_rocks_4_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_rocks_4_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1_1=this.add.sprite(4416,161,"environments","ENVIRONMENT/LEVEL4/l4_embers_large_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1_1.flipX=!0,mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1_1);const eNVIRONMENT_LEVEL4_l4_platform_2_3_1=this.add.image(3989,160,"environments","ENVIRONMENT/LEVEL4/l4_platform_2");eNVIRONMENT_LEVEL4_l4_platform_2_3_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_platform_2_3_1);const eNVIRONMENT_LEVEL4_l4_platform_2_3_1_1=this.add.image(4100,12
12010,"environments","ENVIRONMENT/LEVEL4/l4_platform_2");eNVIRONMENT_LEVEL4_l4_platform_2_3_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_platform_2_3_1_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1_2=this.add.tileSprite(1149,180,250,28,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_tile");eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_tile_1_2);const eNVIRONMENT_LEVEL4_l4_statue_1_4=this.add.image(1202,254,"environments","ENVIRONMENT/LEVEL4/l4_statue_panda");eNVIRONMENT_LEVEL4_l4_statue_1_4.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue_1_4);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1_2=this.add.image(1149,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_right");eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_right_1_2);const eNVIRONMENT_LEVEL4_l4_statue_1_4_1=this.add.image(1298,266,"environments","ENVIRONMENT/LEVEL4/l4_statue_panda");eNVIRONMENT_LEVEL4_l4_statue_1_4_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_statue_1_4_1);const eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1_4=this.add.image(1394,180,"environments","ENVIRONMENT/LEVEL4/l4_obstacles_pit_left");eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1_4.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_obstacles_pit_left_1_4);const eNVIRONMENT_LEVEL4_l4_rocks_5=this.add.image(3183,275,"environments","ENVIRONMENT/LEVEL4/l4_rocks_5");eNVIRONMENT_LEVEL4_l4_rocks_5.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_rocks_5);const eNVIRONMENT_LEVEL4_l4_junk_2_1_1=this.add.image(4320,170,"environments","ENVIRONMENT/LEVEL4/l4_junk_2");eNVIRONMENT_LEVEL4_l4_junk_2_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_junk_2_1_1);const eNVIRONMENT_LEVEL4_l4_junk_1_1=this.add.image(4273,173,"environments","ENVIRONMENT/LEVEL4/l4_junk_1");eNVIRONMENT_LEVEL4_l4_junk_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_junk_1_1);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile=this.add.tileSprite(1830,180,160,32,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_tile");eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile);const eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_2=this.add.tileSprite(2173,180,100,32,"environments","ENVIRONMENT/LEVEL4/l4_ground_lava_large_tile");eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_ground_lava_large_tile_2);const eNVIRONMENT_LEVEL4_l4a_torch_0_2=this.add.sprite(2778,94,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_2.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_2);const eNVIRONMENT_LEVEL4_l4a_torch_0_2_1=this.add.sprite(4384,72,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_2_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4a_torch_0_2_1);const eNVIRONMENT_LEVEL4_l4_junk_2_2_1=this.add.image(4406,130,"environments","ENVIRONMENT/LEVEL4/l4_junk_2");eNVIRONMENT_LEVEL4_l4_junk_2_2_1.setOrigin(0,0),mG_Group.add(eNVIRONMENT_LEVEL4_l4_junk_2_2_1);const eNVIRONMENT_LEVEL4_l4_junk_1_1_1=this.add.image(4384,178,"environments","ENVIRONMENT/LEVEL4/l4_junk_1");eNVIRONMENT_LEVEL4_l4_junk_1_1_1.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_junk_1_1_1);const eNVIRONMENT_LEVEL4_l4_geyser_0=this.add.sprite(4510,176,"environments","ENVIRONMENT/LEVEL4/l4_geyser_0");eNVIRONMENT_LEVEL4_l4_geyser_0.setOrigin(0,1),mG_Group.add(eNVIRONMENT_LEVEL4_l4_geyser_0);const firecrackerEnd=this.add.sprite(4300,128,"characters","PANDA/TORCH/l4_firecracker_0");firecrackerEnd.visible=!1;const obstacle_1_1_1_1=new Obstacle(this,3426,102,"environments","ENVIRONMENT/LEVEL4/l4_bat_0");this.add.existing(obstacle_1_1_1_1);const obstacle_1_1_1=new Obstacle(this,2452,80,"environments","ENVIRONMENT/LEVEL4/l4_bat_0");this.add.existing(obstacle_1_1_1);const obstacle_1_1=new Obstacle(this,2292,116,"environments","ENVIRONMENT/LEVEL4/l4_bat_0");this.add.existing(obstacle_1_1);const obstacle_1=new Obstacle(this,1450,98,"environments","ENVIRONMENT/LEVEL4/l4_bat_0");this.add.existing(obstacle_1);const obstacle=new Obstacle(this,996,98,"environments","ENVIRONMENT/LEVEL4/l4_bat_0");this.add.existing(obstacle);
1201const powerUp_1_1_1_1_1_1=new PowerUp(this,4114,46,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp_1_1_1_1_1_1);const powerUp_1_1_1_1_1=new PowerUp(this,4003,86,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp_1_1_1_1_1);const powerUp_2_1=new PowerUp(this,3496,40,"powerups","ORANGECHICKEN/orangechicken_0001");this.add.existing(powerUp_2_1);const powerUp_2=new PowerUp(this,3258,98,"powerups","REDPAIL_ORANGECHICKEN/redpail_orangechicken_0001");this.add.existing(powerUp_2);const powerUp_1_1=new PowerUp(this,2891,32,"powerups","EGGROLL/eggroll_0001");this.add.existing(powerUp_1_1);const powerUp_1_1_1_1=new PowerUp(this,2680,58,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp_1_1_1_1);const powerUp_1_1_1=new PowerUp(this,2212,46,"powerups","SHRIMP/shrimp_0001");this.add.existing(powerUp_1_1_1);const powerUp_1=new PowerUp(this,1889,56,"powerups","ORANGECHICKEN/orangechicken_0001");this.add.existing(powerUp_1);const powerUp_3=new PowerUp(this,1592,82,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp_3);const powerUp=new PowerUp(this,886,82,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp);const powerUp_4_1=new PowerUp(this,668,40,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp_4_1);const powerUp_4=new PowerUp(this,568,38,"powerups","CHOWMEIN/chowmein_0001");this.add.existing(powerUp_4);const powerUp_1_2=new PowerUp(this,2470,76,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_1_2);const powerUp_1_2_1=new PowerUp(this,3772,84,"powerups","FORTUNECOOKIE/fortunecookie_0001");this.add.existing(powerUp_1_2_1);const powerUp_1_1_2=new PowerUp(this,1270,78,"powerups","EGGROLL/eggroll_0001");this.add.existing(powerUp_1_1_2);const nian=this.add.sprite(4336,168,"characters","NIAN/SCARED/l4_nian_eat_0");nian.setOrigin(0,1);const player=new Player(this,120,155);this.add.existing(player),player.setOrigin(.5,.75);const fG_close=this.add.container(0,0),eNVIRONMENT_LEVEL4_l4_closeup_stalactite=this.add.image(413,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite);const eNVIRONMENT_LEVEL4_l4_closeup_column_2=this.add.image(1489,180,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_2);const eNVIRONMENT_LEVEL4_l4a_closeup_rocks_1=this.add.image(-579,180,"environments","ENVIRONMENT/LEVEL4/l4a_closeup_rocks");eNVIRONMENT_LEVEL4_l4a_closeup_rocks_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4a_closeup_rocks_1.flipX=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4a_closeup_rocks_1);const eNVIRONMENT_LEVEL4_l4a_closeup_rocks=this.add.image(0,180,"environments","ENVIRONMENT/LEVEL4/l4a_closeup_rocks");eNVIRONMENT_LEVEL4_l4a_closeup_rocks.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_closeup_rocks);const eNVIRONMENT_LEVEL4_l4a_cave_front=this.add.image(0,180,"environments","ENVIRONMENT/LEVEL4/l4a_cave_front");eNVIRONMENT_LEVEL4_l4a_cave_front.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_cave_front);const eNVIRONMENT_LEVEL4_l4a_torch_0_1=this.add.sprite(417,138,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1);const eNVIRONMENT_LEVEL4_l4_closeup_stalagmite=this.add.image(-139,180,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalagmite");eNVIRONMENT_LEVEL4_l4_closeup_stalagmite.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalagmite);const eNVIRONMENT_LEVEL4_l4_closeup_column_1_1=this.add.image(2082,180,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_1");eNVIRONMENT_LEVEL4_l4_closeup_column_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_column_1_1.flipX=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2=this.add.tileSprite(1408,0,1250,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2.setOrigin(0,0),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1=this.add.tileSprite(1441,180,450,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1.flipX=!0,eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1.flipY=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1=this.add.tileSprite(2286,184,350,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1.flipY=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_2=this.add.tileSprite(2406,0,2500,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_2.setOrigin(0,0),eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_2.flipX=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_2);const eNVIRONMENT_LEVEL4_l4_closeup_column_2_1=this.add.image(1027,180,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_2_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1=this.add.image(2936,179,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1=this.add.image(3801,179,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1.flipX=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_2=this.add.image(4567,180,"environments","ENVIRONMENT/LEVEL4/l4_closeup_column_2");eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_2.flipX=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_column_2_1_1_1_2);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_2=this.add.tileSprite(2083,180,150,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_2.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_2.flipX=!0,eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_2.flipY=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_2);const eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1=this.add.image(1490,124,"environments","ENVIRONMENT/LEVEL4/l4_closeup_cobweb");eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1.setOrigin(0,0),fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_cobweb_1);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1=this.add.tileSprite(2716,180,450,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1.flipY=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1);const eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1_1=this.add.tileSprite(3368,200,450,70,"environments","ENVIRONMENT/LEVEL4/l4_closeup_stalactite");eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1_1.setOrigin(0,1),eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1_1.flipY=!0,fG_close.add(eNVIRONMENT_LEVEL4_l4_closeup_stalactite_2_1_1_1_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_2=this.add.sprite(2894,100,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_2.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_1=this.add.sprite(2036,102,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_1.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_1);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_2=this.add.sprite(4514,82,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_2.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_2);const eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_3=this.add.sprite(3758,8
12016,"environments","ENVIRONMENT/LEVEL4/l4a_torch_0");eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_3.setOrigin(0,1),fG_close.add(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_3);const ground_1_1_2_1_1=this.add.rectangle(4174,156,500,10);ground_1_1_2_1_1.setOrigin(0,0),ground_1_1_2_1_1.isFilled=!0,ground_1_1_2_1_1.fillAlpha=0;const ground_1_1_2_1=this.add.rectangle(3686,156,250,10);ground_1_1_2_1.setOrigin(0,0),ground_1_1_2_1.isFilled=!0,ground_1_1_2_1.fillAlpha=0;const ground_1_1_1_2=this.add.rectangle(3586,144,69,10);ground_1_1_1_2.setOrigin(0,0),ground_1_1_1_2.isFilled=!0,ground_1_1_1_2.fillAlpha=0;const ground_1_1_1_1=this.add.rectangle(3380,150,40,10);ground_1_1_1_1.setOrigin(0,0),ground_1_1_1_1.isFilled=!0,ground_1_1_1_1.fillAlpha=0;const ground_1_1_1=this.add.rectangle(3240,148,73,10);ground_1_1_1.setOrigin(0,0),ground_1_1_1.isFilled=!0,ground_1_1_1.fillAlpha=0;const ground_1_1_2=this.add.rectangle(2720,156,457,10);ground_1_1_2.setOrigin(0,0),ground_1_1_2.isFilled=!0,ground_1_1_2.fillAlpha=0;const ground_1_1=this.add.rectangle(2344,156,326,10);ground_1_1.setOrigin(0,0),ground_1_1.isFilled=!0,ground_1_1.fillAlpha=0;const ground_1=this.add.rectangle(1990,156,173,10);ground_1.setOrigin(0,0),ground_1.isFilled=!0,ground_1.fillAlpha=0;const ground_1_2=this.add.rectangle(1400,156,420,10);ground_1_2.setOrigin(0,0),ground_1_2.isFilled=!0,ground_1_2.fillAlpha=0;const ground_1_1_1_3_1=this.add.rectangle(1314,166,34,10);ground_1_1_1_3_1.setOrigin(0,0),ground_1_1_1_3_1.isFilled=!0,ground_1_1_1_3_1.fillAlpha=0;const ground_1_1_1_3=this.add.rectangle(1218,154,34,10);ground_1_1_1_3.setOrigin(0,0),ground_1_1_1_3.isFilled=!0,ground_1_1_1_3.fillAlpha=0;const ground=this.add.rectangle(0,156,1150,10);ground.setOrigin(0,0),ground.isFilled=!0,ground.fillAlpha=0;const checkpoint_3=new Checkpoint(this,3098,154);this.add.existing(checkpoint_3);const checkpoint=new Checkpoint(this,2409,155);this.add.existing(checkpoint);const checkpoint_2=new Checkpoint(this,1710,154);this.add.existing(checkpoint_2);const checkpoint_1=new Checkpoint(this,898,154);this.add.existing(checkpoint_1);const endZone=new TransitionZone(this,4334,90);this.add.existing(endZone);const startZone=new TransitionZone(this,215,90);this.add.existing(startZone);const score=new Score(this,0,0);this.add.existing(score);const textBox=new TextBox(this,212,140);this.add.existing(textBox),textBox.scaleX=.3,textBox.scaleY=.3;const eNVIRONMENT_LEVEL4_l4_closeup_food=this.add.image(4082,180,"environments","ENVIRONMENT/LEVEL4/l4_closeup_food");eNVIRONMENT_LEVEL4_l4_closeup_food.scaleX=.5,eNVIRONMENT_LEVEL4_l4_closeup_food.scaleY=.5,eNVIRONMENT_LEVEL4_l4_closeup_food.setOrigin(0,1);const endfireworksburst1=this.add.sprite(3792,744,"intro","CUTSCENES/ENDING/l5_fireworks_02");endfireworksburst1.scaleX=2,endfireworksburst1.scaleY=2,endfireworksburst1.setOrigin(0,1),endfireworksburst1.visible=!1;const endfireworksburst2=this.add.sprite(3868,688,"intro","CUTSCENES/ENDING/l5_fireworks_02");endfireworksburst2.scaleX=2,endfireworksburst2.scaleY=2,endfireworksburst2.setOrigin(0,1),endfireworksburst2.visible=!1,endfireworksburst2.tintTopLeft=7396093,endfireworksburst2.tintTopRight=7396093,endfireworksburst2.tintBottomLeft=7396093,endfireworksburst2.tintBottomRight=7396093;const endfireworksburst3=this.add.sprite(4122,246,"intro","CUTSCENES/ENDING/l5_fireworks_02");endfireworksburst3.setOrigin(0,1),endfireworksburst3.flipX=!0,endfireworksburst3.flipY=!0,endfireworksburst3.visible=!1;const platforms=[ground,eNVIRONMENT_LEVEL4_l4_platform_2,eNVIRONMENT_LEVEL4_l4_platform_2_1,eNVIRONMENT_LEVEL4_l4_platform_2_2,ground_1,ground_1_1,ground_1_1_1,ground_1_1_2,ground_1_1_2_1,ground_1_1_1_1,eNVIRONMENT_LEVEL4_l4_platform_2_3,ground_1_1_1_2,eNVIRONMENT_LEVEL4_l4_platform_2_3_1,ground_1_1_1_3_1,ground_1_1_1_3,ground_1_1_2_1_1,ground_1_2,eNVIRONMENT_LEVEL4_l4_platform_2_3_1_1],powerups=[powerUp,powerUp_1,powerUp_1_1,powerUp_1_1_1,powerUp_1_1_1_1,powerUp_2,powerUp_3,powerUp_2_1,powerUp_1_1_1_1_1,powerUp_1_1_1_1_1_1,powerUp_4,powerUp_4_1,powerUp_1_2,powerUp_1_2_1,powerUp_1_1_2],obstacles=[obstacle,obstacle_1_1,obstacle_1,obstacle_1_1_1_1,obstacle_1_1_1],checkpoints=[checkpoint,checkpoint_2,checkpoint_1,checkpoint_3];new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_large",new PlatformPhysics(eNVIRONMENT_LEVEL4_l4_platform_2),new PlatformPhysics(eNVIRONMENT_LEVEL4_l4_platform_2_1),new PlatformPhysics(eNVIRONMENT_LEVEL4_l4_platform_2_2);new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_2_1_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_small",new PlatformPhysics(eNVIRONMENT_LEVEL4_l4_platform_2_3);new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_large";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_large";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_large";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_1_1_1_1_1_1_1_1_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4_embers_large",new PlatformPhysics(eNVIRONMENT_LEVEL4_l4_platform_2_3_1),new PlatformPhysics(eNVIRONMENT_LEVEL4_l4_platform_2_3_1_1);new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_2).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_2_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4_geyser_0).AnimationName="animation_fireVentENVIRONMENT/LEVEL4/l4_geyser",obstacle_1_1_1_1.hitAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1_1_1_1.idleAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1_1_1_1.hitboxWidth=15,obstacle_1_1_1_1.hitboxHeight=15,obstacle_1_1_1_1.hitboxOffsetX=18,obstacle_1_1_1_1.hitboxOffsetY=20,obstacle_1_1_1_1.hitSound="obstacle_bat",obstacle_1_1_1_1.score=-25;const obstacle_1_1_1_1AnimateUpandDown=new AnimateUpandDown(obstacle_1_1_1_1);obstacle_1_1_1_1AnimateUpandDown.Amplitude=50,obstacle_1_1_1_1AnimateUpandDown.Speed=1e3,obstacle_1_1_1.hitAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1_1_1.idleAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1_1_1.hitboxWidth=15,obstacle_1_1_1.hitboxHeight=15,obstacle_1_1_1.hitboxOffsetX=18,obstacle_1_1_1.hitboxOffsetY=20,obstacle_1_1_1.hitSound="obstacle_bat",obstacle_1_1_1.score=-25;const obstacle_1_1_1AnimateUpandDown=new AnimateUpandDown(obstacle_1_1_1);obstacle_1_1_1AnimateUpandDown.Amplitude=35,obstacle_1_1_1AnimateUpandDown.Speed=1e3,obstacle_1_1.hitAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1_1.idleAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1_1.hitboxWidth=15,obstacle_1_1.hitboxHeight=15,obstacle_1_1.hitboxOffsetX=18,obstacle_1_1.hitboxOffsetY=20,obstacle_1_1.hitSound="obstacle_bat",obstacle_1_1.score=-25;const obstacle_1_1AnimateUpandDown=new AnimateUpandDown(obstacle_1_1);obstacle_1_1AnimateUpandDown.Amplitude=35,obstacle_1_1AnimateUpandDown.Speed=1e3,obstacle_1.hitAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1.idleAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle_1.hitboxWidth=15,obstacle_1.hitboxHeight=15,obstacle_1.hitboxOffsetX=18,obstacle_1.hitboxOffsetY=20,obstacle_1.hitSound="obstacle_bat",obstacle_1.score=-25;const obstacle_1AnimateUpandDown=new AnimateUpandDown(obstacle_1);obstacle_1AnimateUpandDown.Amplitude=35,obstacle_1AnimateUpandDown.Speed=1e3,obstacle.hitAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle.idleAnimation="obstacles_ENVIRONMENT/LEVEL4/l4_bat",obstacle.hitboxWidth=15,obstacle.hitboxHeight=15,obstacle.hitboxOffsetX=18,obstacle.hitboxOffsetY=20,obstacle.hitSound="obstacle_bat",obstacle.fallType="FORWARD",obstacle.score=-25;const obstacleAnimateUpandDown=new AnimateUpandDown(obstacle);obstacleAnimateUpandDown.Amplitude=35,obstacleAnimateUpandDown.Speed=1e3,powerUp_1_1_1_1_1_1.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp_1_1_1_1_1_1.collectSound="powerup_slerp",powerUp_1_1_1_1_1.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp_1_1_1_1_1.collectSound="powerup_slerp",powerUp_2_1.collectAnimation="powerups_ORANGECHICKEN/orangechicken",powerUp_2_1.collectSound="powerup_crunch",powerUp_2.collectSound="powerup_crunch",powerUp_1_1.collectAnimation="powerups_EGGROLL/eggroll",powerUp_1_1.collectSound="powerup_crunch",powerUp_1_1_1_1.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp_1_1_1_1.collectSound="powerup_slerp",powerUp_1_1_1.collectAnimation="powerups_SHRIMP/shrimp",powerUp_1_1_1.collectSound="powerup_slerp",powerUp_1.collectAnimation="powerups_ORANGECHICKEN/orangechicken",powerUp_1.collectSound="powerup_crunch",powerUp_3.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp_3.collectSound="powerup_slerp",powerUp.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp.collectSound="powerup_slerp",powerUp_4_1.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp_4_1.collectSound="powerup_slerp",powerUp_4.collectAnimation="powerups_CHOWMEIN/chowmein",powerUp_4.collectSound="powerup_slerp",powerUp_1_2.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_1_2.collectSound="powerup_fortune",powerUp_1_2_1.collectAnimation="powerups_FORTUNECOOKIE/fortunecookie",powerUp_1_2_1.collectSound="powerup_fortune",powerUp_1_1_2.collectAnimation="powerups_EGGROLL/eggroll",powerUp_1_1_2.collectSound="powerup_crunch";new StartAnimation(nian).AnimationName="nianeatingNIAN/SCARED/l4_nian_eat",player.platforms=platforms,player.idleSideAnim="PANDA/TORCH/IDLE_SIDE/torch_panda_side_idle",player.idleFrontAnim="front_idlePANDA/IDLE/panda_idle",player.waveAnim="wavePANDA/WAVE/panda_wave",player.runAnim="PANDA/TORCH/RUN/torch_panda_run",player.jump1Anim="PANDA/TORCH/JUMP1/torch_panda_jump",player.jump2Anim="PANDA/TORCH/JUMP2/tor
1201ch_panda_jump",player.jump3Anim="PANDA/TORCH/JUMP3/torch_panda_jump",player.fallBackAnim="PANDA/TORCH/FALLBACK/torch_panda_fall_back",player.fallDownAnim="PANDA/TORCH/FALLDOWN/torch_panda_fall_down",player.fallForwardAnim="PANDA/TORCH/FALLFORWARD/torch_panda_fall_forward";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_1).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_2).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch";new StartAnimation(eNVIRONMENT_LEVEL4_l4a_torch_0_1_2_3).AnimationName="animation_ENVIRONMENT/LEVEL4/l4a_torch",new PlatformPhysics(ground_1_1_2_1_1),new PlatformPhysics(ground_1_1_2_1),new PlatformPhysics(ground_1_1_1_2),new PlatformPhysics(ground_1_1_1_1),new PlatformPhysics(ground_1_1_1),new PlatformPhysics(ground_1_1_2),new PlatformPhysics(ground_1_1),new PlatformPhysics(ground_1),new PlatformPhysics(ground_1_2),new PlatformPhysics(ground_1_1_1_3_1),new PlatformPhysics(ground_1_1_1_3),new PlatformPhysics(ground),endZone.player=player,startZone.player=player,score.cards=3,this.firecrackerEnd=firecrackerEnd,this.nian=nian,this.player=player,this.endZone=endZone,this.startZone=startZone,this.score=score,this.textBox=textBox,this.endfireworksburst1=endfireworksburst1,this.endfireworksburst2=endfireworksburst2,this.endfireworksburst3=endfireworksburst3,this.platforms=platforms,this.powerups=powerups,this.obstacles=obstacles,this.holes=[],this.checkpoints=checkpoints,this.events.emit("scene-awake")}firecrackerEnd;nian;player;endZone;startZone;score;textBox;endfireworksburst1;endfireworksburst2;endfireworksburst3;platforms;powerups;obstacles;holes;checkpoints;startCutsceneState;endCutsceneState;levelCreate(){window.gtag("event","Level4"),this.scale.setGameSize(320,180),this.editorCreate(),this.sound.add("music_level4",{loop:!0}).play(),this.cameras.main.startFollow(this.player),this.cameras.main.setLerp(1,0),this.cameras.main.followOffset.set(-40,75),this.cameras.main.scrollY=0;const arcade=this.physics;arcade.add.overlap(this.player,this.powerups,super.collectPowerUp,void 0,this),arcade.add.overlap(this.player,this.obstacles,super.hitObstacle,void 0,this),arcade.add.overlap(this.player,this.holes,super.hitHole,void 0,this),this.startCutsceneState=StartCutsceneState.START,this.endCutsceneState=EndCutsceneState.START}update(timestamp,elapsed){super.updatePlayer(elapsed,this,this.player,this.startZone,this.endZone,this.checkpoints,"Level4Fortune",this.obstacles,this.holes,this.updateStartCutscene,this.updateEndCutscene)}updateStartCutscene(scene){switch(scene.startCutsceneState){case StartCutsceneState.START:scene.player.setIdleSide(),scene.startCutsceneState=StartCutsceneState.IDLE,scene.textBox.typeText("This must be Nian's lair..."),setTimeout((()=>{scene.startCutsceneState=StartCutsceneState.TEXT}),500);break;case StartCutsceneState.IDLE:break;case StartCutsceneState.TEXT:scene.startCutsceneState=StartCutsceneState.READY,setTimeout((()=>{scene.textBox.reset(),scene.player.setRunning(),scene.startCutsceneState=StartCutsceneState.GO}),2e3);break;case StartCutsceneState.READY:break;case StartCutsceneState.GO:scene.player.incrementX(1.5)}}updateEndCutscene(scene){switch(scene.endCutsceneState){case EndCutsceneState.START:scene.endCutsceneState=EndCutsceneState.PRENIAN,scene.player.setIdleSide(),scene.textBox.setXY(170,90),scene.textBox.typeText("You've found Nian!",(()=>{setTimeout((()=>{scene.textBox.typeText("Surely this firecracker will scare him!",(()=>{setTimeout((()=>{scene.textBox.reset(),scene.firecrackerEnd.visible=!0,scene.endCutsceneState=EndCutsceneState.PRESCAREDNIAN}),1500)}))}),700)}));break;case EndCutsceneState.PRENIAN:break;case EndCutsceneState.PRESCAREDNIAN:scene.endCutsceneState=EndCutsceneState.WAITNIAN,setTimeout((()=>{scene.sound.stopAll(),scene.firecrackerEnd.play("Ending_firecrackerPANDA/TORCH/l4_firecracker"),scene.sound.add("finalconfrontation",{volume:1}).play(),scene.firecrackerEnd.once("animationcomplete",(()=>{setTimeout((()=>{scene.nian.play("nianscaredNIAN/SCARED/l4_nian_scared",!0),scene.endfireworksburst3.visible=!0,scene.endfireworksburst3.play("CUTSCENES/ENDING/l5_fireworks",!0),scene.endfireworksburst1.visible=!0,scene.endfireworksburst1.play("CUTSCENES/ENDING/l5_fireworks",!0),setTimeout((()=>{scene.endfireworksburst2.visible=!0,scene.endfireworksburst2.play("CUTSCENES/ENDING/l5_fireworks",!0),setTimeout((()=>{scene.endCutsceneState=EndCutsceneState.RUNNINGNIAN,scene.nian.flipX=!0,scene.nian.y+=15,setTimeout((()=>{scene.cameras.main.fadeOut(2e3,0,0,0),setTimeout((()=>{scene.endCutsceneState=EndCutsceneState.END}),2e3)}),500)}),900)}),150)}),300)}))}),300);break;case EndCutsceneState.WAITNIAN:break;case EndCutsceneState.RUNNINGNIAN:scene.nian.play("nian_runNIAN/RUN/nian_run",!0),scene.nian.x+=1;break;case EndCutsceneState.END:scene.sound.stopAll(),scene.scene.stop(),scene.scene.start("Level4Fortune")}}getCheckpoints(){return this.checkpoints}}!function(FortuneState){FortuneState[FortuneState.START=1]="START",FortuneState[FortuneState.BANNERWAIT=2]="BANNERWAIT",FortuneState[FortuneState.CARDEXPAND=3]="CARDEXPAND",FortuneState[FortuneState.CARDLEFTWAIT=4]="CARDLEFTWAIT",FortuneState[FortuneState.CARDFLIP=5]="CARDFLIP",FortuneState[FortuneState.BOTHCARDSMOVE=6]="BOTHCARDSMOVE",FortuneState[FortuneState.BOTHCARDSWAIT=7]="BOTHCARDSWAIT",FortuneState[FortuneState.END=8]="END"}(FortuneState||(FortuneState={}));class Level4Fortune extends phaser.Scene{constructor(){super("Level4Fortune")}editorCreate(){const rectangle=this.add.rectangle(0,0,640,360);rectangle.setOrigin(0,0),rectangle.isFilled=!0,rectangle.fillColor=13782428;
1201const starburst=this.add.sprite(320,180,"cutscenes","MISC/STARBURST/starburst00000");starburst.scaleX=4,starburst.scaleY=4,starburst.alpha=.06,starburst.alphaTopLeft=.06,starburst.alphaTopRight=.06,starburst.alphaBottomLeft=.06,starburst.alphaBottomRight=.06;const clickableButton=new ClickableButton(this,568,330);this.add.existing(clickableButton),clickableButton.visible=!1;const eNVIRONMENT_LEVEL3_l3_firework_b_0=this.add.sprite(52,158,"environments","ENVIRONMENT/LEVEL3/l3_firework_b_0");eNVIRONMENT_LEVEL3_l3_firework_b_0.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1=this.add.sprite(560,97,"environments","ENVIRONMENT/LEVEL3/l3_firework_d_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1.setOrigin(0,1);const eNVIRONMENT_LEVEL3_l3_firework_b_0_1=this.add.sprite(149,305,"environments","ENVIRONMENT/LEVEL3/l3_firework_c_0");eNVIRONMENT_LEVEL3_l3_firework_b_0_1.setOrigin(0,1);const good_fortune_unlocked=this.add.sprite(106,224,"cutscenes","MISC/ENDLEVEL/endlevel_00000");good_fortune_unlocked.setOrigin(0,1);const card_right=new RightCard(this,320,180,"ui","level4_FortuneCard_Redeem");this.add.existing(card_right),card_right.scaleX=.3,card_right.scaleY=.3,card_right.visible=!1;const card_left=new Card(this,320,180,"ui","FortuneCard_Chowmein_front");this.add.existing(card_left),card_left.scaleX=.3,card_left.scaleY=.3,card_left.visible=!1;const disclaimer=new Disclaimer(this,320,330);this.add.existing(disclaimer),disclaimer.setOrigin(.5,.5),disclaimer.visible=!1,disclaimer.text="Free* Additional Large Side with Family Meal Purchase. Tax, delivery, service, and premium entrée fee extra. Tax included for the Free Additional Large Side. One coupon per person per order.  Valid online only. Expires 2/28/22.";const textBox=new TextBox(this,510,314);this.add.existing(textBox),textBox.scaleX=.6,textBox.scaleY=.6;new StartAnimation(starburst).AnimationName="MISC/STARBURST/starburst";new RotateForever(starburst).Rotationspeed=.2,clickableButton.textString="CONTINUE",clickableButton.nextSceneKey="End";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_b";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_d";new StartAnimation(eNVIRONMENT_LEVEL3_l3_firework_b_0_1).AnimationName="animation_ENVIRONMENT/LEVEL3/l3_firework_c";new StartAnimation(good_fortune_unlocked).AnimationName="MISC/ENDLEVEL/endlevel",card_right.redeemDownloadImageTexture={key:"ui",frame:"save_level4"},card_left.backTexture={key:"ui",frame:"FortuneCard_Chowmeinl_back"},this.clickableButton=clickableButton,this.good_fortune_unlocked=good_fortune_unlocked,this.card_right=card_right,this.card_left=card_left,this.disclaimer=disclaimer,this.textBox=textBox,this.events.emit("scene-awake")}clickableButton;good_fortune_unlocked;card_right;card_left;disclaimer;textBox;fortuneState;accumulator=0;fps=60;physicsTimestep;domScaleX=0;domScaleY=0;cardPixelCounter=0;code;create(){window.gtag("event","Level4Redeem"),this.editorCreate(),this.scale.setGameSize(640,360),this.fortuneState=FortuneState.START,this.sound.add("fortunecard").play(),this.physicsTimestep=1e3/this.fps}update(timestamp,elapsed){for(this.accumulator+=elapsed;this.accumulator>=this.physicsTimestep;)switch(this.accumulator-=this.physicsTimestep,this.fortuneState){case FortuneState.START:httpsCallable(functions,"getCode")({type:"level4"}).then((result=>{result.data&&result.data.codes&&result.data.codes.length>0&&result.data.codes[0].code&&(this.code=result.data.codes[0].code,this.card_right.setCode(this.code))})).catch((error=>{console.log(error)})),this.fortuneState=FortuneState.BANNERWAIT,this.domScaleX=0,this.domScaleY=0,this.card_left.setDomScale(this.domScaleX,this.domScaleY),setTimeout((()=>{this.textBox.typeText("Congratulations! You have unlocked the final Fortune Card!",(()=>{setTimeout((()=>{this.textBox.typeText("You've unlocked the Chow Mein Longevity Card!",(()=>{setTimeout((()=>{this.textBox.typeText("Redeem all of the good fortune you've collected this Lunar New Year!",(()=>{setTimeout((()=>{this.textBox.reset(),this.fortuneState=FortuneState.CARDEXPAND,this.good_fortune_unlocked.visible=!1,this.card_left.setVisibility(!0),setTimeout((()=>{this.clickableButton.visible=!0}),3500)}),2e3)}))}),1500)}))}),1500)}))}),500);break;case FortuneState.BANNERWAIT:break;case FortuneState.CARDEXPAND:this.domScaleX+=.0066,this.domScaleY+=.0066,this.card_left.setDomScale(this.domScaleX,this.domScaleY),this.domScaleX>=.3&&(this.fortuneState=FortuneState.CARDLEFTWAIT,setTimeout((()=>{this.fortuneState=FortuneState.CARDFLIP}),1e3));break;case FortuneState.CARDLEFTWAIT:break;case FortuneState.CARDFLIP:this.card_left.flip(),this.card_right.setVisibility(!0),this.fortuneState=FortuneState.BOTHCARDSMOVE;break;case FortuneState.BOTHCARDSMOVE:this.cardPixelCounter++,this.card_left.nudge(-2),this.card_right.nudge(2),this.cardPixelCounter>45&&(this.fortuneState=FortuneState.BOTHCARDSWAIT,this.disclaimer.setVisibility(!0),setTimeout((()=>{this.fortuneState=FortuneState.END}),4e3));case FortuneState.BOTHCARDSWAIT:case FortuneState.END:}}}!function(EndState){EndState[EndState.START=1]="START",EndState[EndState.TEXTWAIT=2]="TEXTWAIT",EndState[EndState.REPLAYANDSHARE=3]="REPLAYANDSHARE",EndState[EndState.LOGOFADEIN=4]="LOGOFADEIN",EndState[EndState.END=5]="END"}(EndState||(EndState={}));class End extends phaser.Scene{constructor(){super("End")}editorCreate(){const cUTSCENES_ENDING_Ending_00000=this.add.sprite(0,360,"intro","CUTSCENES/ENDING/Ending_00000");cUTSCENES_ENDING_Ending_00000.setOrigin(0,1);const textBox=new TextBox(this,510,314);this.add.existing(textBox),textBox.scaleX=.6,textBox.scaleY=.6;const shareBtn=new CallbackClickableButton(this,394,265);this.add.existing(shareBtn),shareBtn.visible=!1;const replayBtn=new CallbackClickableButton(this,246,265);this.add.existing(replayBtn),replayBtn.visible=!1;const dOM=new DOM(this,320,52,"ui","logoclean");this.add.existing(dOM),dOM.scaleX=.3,dOM.scaleY=.3,dOM.visible=!1,dOM.alpha=1,shareBtn.textString="SHARE",replayBtn.textString="REPLAY",this.cUTSCENES_ENDING_Ending_00000=cUTSCENES_ENDING_Ending_00000,this.textBox=textBox,this.shareBtn=shareBtn,this.replayBtn=replayBtn,this.dOM=dOM,this.events.emit("scene-awake")}cUTSCENES_ENDING_Ending_00000;textBox;shareBtn;replayBtn;dOM;endState;domAlpha=0;create(){window.gtag("event","End"),this.scale.setGameSize(640,360),this.editorCreate(),this.sound.add("ending").play(),this.cUTSCENES_ENDING_Ending_00000.play("cutscene_CUTSCENES/ENDING/Ending",!0),this.cUTSCENES_ENDING_Ending_00000.once("animationcomplete",(()=>{this.cUTSCENES_ENDING_Ending_00000.play("cutscene_CUTSCENES/ENDING/EndingLoop",!0)})),this.shareBtn.setCallback((async()=>{window.gtag("event","End_Share");try{if(navigator.share&&window.mobileAndTabletCheck())navigator.share({text:location.href}).then((()=>{})).catch((async e=>{if(console.log(e),window.facebookCheck())return fallbackCopyTextToClipboard(location.href),void alert("Copied URL to clipboard!");navigator.clipboard?(await navigator.clipboard.writeText(location.href),alert("Copied URL to clipboard!")):(fallbackCopyTextToClipboard(location.href),alert("Copied URL to clipboard!"))}));else{if(window.facebookCheck())return fallbackCopyTextToClipboard(location.href),void alert("Copied URL to clipboard!");navigator.clipboard?(await navigator.clipboard.writeText(location.href),alert("Copied URL to clipboard!")):(fallbackCopyTextToClipboard(location.href),alert("Copied URL to clipboard!"))}}catch(e){alert("Share failed! Please copy URL to share."),console.log(e)}})),this.replayBtn.setCallback((()=>{window.gtag("event","End_Replay"),setTimeout((()=>{location.reload()}),0)})),this.endState=EndState.START}update(){switch(this.endState){case EndState.START:this.endState=EndState.TEXTWAIT,this.textBox.typeText("You did it! Now it's time to celebrate with loved one
1201s over a Panda Family Meal.",(()=>{setTimeout((()=>{this.textBox.typeText("Because good food, like good fortune, is better shared!",(()=>{setTimeout((()=>{this.textBox.typeText("Happy Lunar New Year from Panda Express!",(()=>{setTimeout((()=>{this.endState=EndState.REPLAYANDSHARE,this.textBox.reset()}),1500)}))}),1500)}))}),1500)}));break;case EndState.TEXTWAIT:break;case EndState.REPLAYANDSHARE:this.endState=EndState.LOGOFADEIN,this.shareBtn.visible=!0,this.replayBtn.visible=!0,this.dOM.setDomOpacity(0),this.dOM.setVisibility(!0);break;case EndState.LOGOFADEIN:this.domAlpha+=.01,this.dOM.setDomOpacity(this.domAlpha),this.domAlpha>=1&&(this.endState=EndState.END);case EndState.END:}}}function fallbackCopyTextToClipboard(text){var textArea=document.createElement("textarea");textArea.value=text,textArea.style.top="0",textArea.style.left="0",textArea.style.position="fixed",document.body.appendChild(textArea),textArea.focus(),textArea.select();try{var msg=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+msg)}catch(err){console.error("Fallback: Oops, unable to copy",err)}document.body.removeChild(textArea)}window.addEventListener("load",(function(){const game=new Phaser.Game({width:320,height:180,type:window&&"function"==typeof window.webkitConvertPointFromNodeToPage?Phaser.CANVAS:Phaser.AUTO,backgroundColor:"#242424",antialias:!1,antialiasGL:!1,parent:document.getElementById("game"),dom:{createContainer:!0},physics:{default:"arcade",arcade:{gravity:{y:1200},debug:!1}},scale:{mode:Phaser.Scale.FIT,autoCenter:Phaser.Scale.CENTER_BOTH}});game.scene.add("Preload",Preload),game.scene.add("Start",Start),game.scene.add("Intro",Intro),game.scene.add("Level1",Level1),game.scene.add("Level1Fortune",Level1Fortune),game.scene.add("Level2",Level2),game.scene.add("Level2Fortune",Level2Fortune),game.scene.add("Level3",Level3),game.scene.add("Level3Fortune",Level3Fortune),game.scene.add("Level4",Level4),game.scene.add("Level4Fortune",Level4Fortune),game.scene.add("End",End),game.scene.add("Boot",Boot,!0)}));class Boot extends Phaser.Scene{preload(){this.load.pack("preload-asset-pack","assets/preload-asset-pack.json")}create(){this.registry.set("score",0),this.registry.set("numPowerups",0),this.scene.start("Preload")}}window.facebookCheck=function(){var ua=navigator.userAgent||navigator.vendor||window.opera;return ua.indexOf("FBAN")>-1||ua.indexOf("FBAV")>-1},window.iphoneCheck=function(){return["iPhone Simulator","iPod Simulator","iPhone","iPod"].includes(navigator.platform)},window.iosCheck=function(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},window.mobileCheck=function(){let check=!1;var a;return a=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1201sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&(check=!0),check},window.mobileAndTabletCheck=function(){let check=!1;var a;return a=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&(check=!0),check}}();
1202//# sourceMappingURL=game.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.