zimporter-phaser 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +255 -0
- package/dist/SceneData.d.ts +218 -0
- package/dist/SceneData.d.ts.map +1 -0
- package/dist/SceneData.js +21 -0
- package/dist/SceneData.js.map +1 -0
- package/dist/ZBitmapTextField.d.ts +7 -0
- package/dist/ZBitmapTextField.d.ts.map +1 -0
- package/dist/ZBitmapTextField.js +18 -0
- package/dist/ZBitmapTextField.js.map +1 -0
- package/dist/ZButton.d.ts +45 -0
- package/dist/ZButton.d.ts.map +1 -0
- package/dist/ZButton.js +338 -0
- package/dist/ZButton.js.map +1 -0
- package/dist/ZContainer.d.ts +59 -0
- package/dist/ZContainer.d.ts.map +1 -0
- package/dist/ZContainer.js +404 -0
- package/dist/ZContainer.js.map +1 -0
- package/dist/ZCuePointsManager.d.ts +7 -0
- package/dist/ZCuePointsManager.d.ts.map +1 -0
- package/dist/ZCuePointsManager.js +32 -0
- package/dist/ZCuePointsManager.js.map +1 -0
- package/dist/ZNineSlice.d.ts +12 -0
- package/dist/ZNineSlice.d.ts.map +1 -0
- package/dist/ZNineSlice.js +26 -0
- package/dist/ZNineSlice.js.map +1 -0
- package/dist/ZPool.d.ts +11 -0
- package/dist/ZPool.d.ts.map +1 -0
- package/dist/ZPool.js +64 -0
- package/dist/ZPool.js.map +1 -0
- package/dist/ZResizeables.d.ts +7 -0
- package/dist/ZResizeables.d.ts.map +1 -0
- package/dist/ZResizeables.js +15 -0
- package/dist/ZResizeables.js.map +1 -0
- package/dist/ZScene.d.ts +82 -0
- package/dist/ZScene.d.ts.map +1 -0
- package/dist/ZScene.js +653 -0
- package/dist/ZScene.js.map +1 -0
- package/dist/ZSceneStack.d.ts +27 -0
- package/dist/ZSceneStack.d.ts.map +1 -0
- package/dist/ZSceneStack.js +62 -0
- package/dist/ZSceneStack.js.map +1 -0
- package/dist/ZScroll.d.ts +34 -0
- package/dist/ZScroll.d.ts.map +1 -0
- package/dist/ZScroll.js +176 -0
- package/dist/ZScroll.js.map +1 -0
- package/dist/ZSlider.d.ts +20 -0
- package/dist/ZSlider.d.ts.map +1 -0
- package/dist/ZSlider.js +88 -0
- package/dist/ZSlider.js.map +1 -0
- package/dist/ZSpine.d.ts +42 -0
- package/dist/ZSpine.d.ts.map +1 -0
- package/dist/ZSpine.js +221 -0
- package/dist/ZSpine.js.map +1 -0
- package/dist/ZState.d.ts +18 -0
- package/dist/ZState.d.ts.map +1 -0
- package/dist/ZState.js +64 -0
- package/dist/ZState.js.map +1 -0
- package/dist/ZTextInput.d.ts +33 -0
- package/dist/ZTextInput.d.ts.map +1 -0
- package/dist/ZTextInput.js +124 -0
- package/dist/ZTextInput.js.map +1 -0
- package/dist/ZTimeline.d.ts +42 -0
- package/dist/ZTimeline.d.ts.map +1 -0
- package/dist/ZTimeline.js +164 -0
- package/dist/ZTimeline.js.map +1 -0
- package/dist/ZToggle.d.ts +17 -0
- package/dist/ZToggle.d.ts.map +1 -0
- package/dist/ZToggle.js +68 -0
- package/dist/ZToggle.js.map +1 -0
- package/dist/ZUpdatables.d.ts +13 -0
- package/dist/ZUpdatables.d.ts.map +1 -0
- package/dist/ZUpdatables.js +30 -0
- package/dist/ZUpdatables.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/text-input.d.ts +98 -0
- package/dist/text-input.d.ts.map +1 -0
- package/dist/text-input.js +622 -0
- package/dist/text-input.js.map +1 -0
- package/dist/zimporter-phaser.min.js +3 -0
- package/dist/zimporter-phaser.min.js.LICENSE.txt +168 -0
- package/dist/zimporter-phaser.min.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see zimporter-phaser.min.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.zimporter=e():t.zimporter=e()}(this,(()=>(()=>{var t={421:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AlphaTimeline:()=>s._Y,Animation:()=>s.X5,AnimationState:()=>s.oA,AnimationStateAdapter:()=>s.b5,AnimationStateData:()=>s.Qq,AssetManager:()=>r,AssetManagerBase:()=>s.f,AtlasAttachmentLoader:()=>s.qd,Attachment:()=>s.o3,AttachmentTimeline:()=>s.zK,BinaryInput:()=>s.aG,BlendMode:()=>s.Nx,Bone:()=>s.$K,BoneData:()=>s.h9,BoundingBoxAttachment:()=>s.bw,CURRENT:()=>s.eN,CanvasTexture:()=>n,ClippingAttachment:()=>s.K$,Color:()=>s.Q1,ConstraintData:()=>s.qD,CurveTimeline:()=>s.Rh,CurveTimeline1:()=>s.Mq,CurveTimeline2:()=>s.H6,DebugUtils:()=>s.lw,DeformTimeline:()=>s.jQ,Downloader:()=>s._7,DrawOrderTimeline:()=>s.Kn,Event:()=>s.Jh,EventData:()=>s.RV,EventQueue:()=>s.Cb,EventTimeline:()=>s.qs,EventType:()=>s.Bx,FIRST:()=>s.RK,FakeTexture:()=>s.pT,HOLD_FIRST:()=>s.FM,HOLD_MIX:()=>s.dG,HOLD_SUBSEQUENT:()=>s.gB,IkConstraint:()=>s.cw,IkConstraintData:()=>s.Qs,IkConstraintTimeline:()=>s.pA,IntSet:()=>s.ON,Interpolation:()=>s.lc,MathUtils:()=>s.cj,MeshAttachment:()=>s.fj,MixBlend:()=>s.qU,MixDirection:()=>s.mj,PathAttachment:()=>s.He,PathConstraint:()=>s.OI,PathConstraintData:()=>s.rX,PathConstraintMixTimeline:()=>s.I6,PathConstraintPositionTimeline:()=>s.vz,PathConstraintSpacingTimeline:()=>s.vl,PointAttachment:()=>s.YV,Pool:()=>s.bC,PositionMode:()=>s.pw,Pow:()=>s.py,PowOut:()=>s.Ff,RGB2Timeline:()=>s.fT,RGBA2Timeline:()=>s.Ev,RGBATimeline:()=>s.EP,RGBTimeline:()=>s.Di,RegionAttachment:()=>s.Qb,RotateMode:()=>s.Dr,RotateTimeline:()=>s.NQ,SETUP:()=>s.K1,SUBSEQUENT:()=>s.y,ScaleTimeline:()=>s.i9,ScaleXTimeline:()=>s.So,ScaleYTimeline:()=>s.pR,SequenceTimeline:()=>s.lP,ShearTimeline:()=>s.$l,ShearXTimeline:()=>s.jx,ShearYTimeline:()=>s.eP,Skeleton:()=>s.EA,SkeletonBinary:()=>s.t7,SkeletonBounds:()=>s.VT,SkeletonClipping:()=>s.qy,SkeletonData:()=>s.Ym,SkeletonJson:()=>s.mI,SkeletonRenderer:()=>o,Skin:()=>s.MR,SkinEntry:()=>s.Su,Slot:()=>s.DX,SlotData:()=>s.PN,SpacingMode:()=>s.r9,StringSet:()=>s.eE,Texture:()=>s.gP,TextureAtlas:()=>s.Lw,TextureAtlasPage:()=>s.Pd,TextureAtlasRegion:()=>s.TE,TextureFilter:()=>s.O$,TextureRegion:()=>s.QL,TextureWrap:()=>s.w3,TimeKeeper:()=>s.oM,Timeline:()=>s.Kf,TrackEntry:()=>s.IT,TransformConstraint:()=>s.UF,TransformConstraintData:()=>s._6,TransformConstraintTimeline:()=>s.To,TransformMode:()=>s._C,TranslateTimeline:()=>s.Sr,TranslateXTimeline:()=>s.GU,TranslateYTimeline:()=>s.nS,Triangulator:()=>s.Rb,Utils:()=>s.Aq,Vector2:()=>s.I9,VertexAttachment:()=>s.eJ,WindowedMean:()=>s.p0});var s=i(673);class n extends s.gP{constructor(t){super(t)}setFilters(t,e){}setWraps(t,e){}dispose(){}}class r extends s.f{constructor(t="",e=new s._7){super((t=>new n(t)),t,e)}}const a=s.Aq.newFloatArray(8);class o{static QUAD_TRIANGLES=[0,1,2,2,3,0];static VERTEX_SIZE=8;ctx;triangleRendering=!1;debugRendering=!1;vertices=s.Aq.newFloatArray(8192);tempColor=new s.Q1;constructor(t){this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,i=this.tempColor,n=t.color,r=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let t=0,o=r.length;t<o;t++){let o=r[t],h=o.bone;if(!h.active)continue;let l=o.getAttachment();if(!(l instanceof s.Qb))continue;l.computeWorldVertices(o,a,0,2);let u=l.region,c=u.texture.getImage(),d=o.color,f=l.color;i.set(n.r*d.r*f.r,n.g*d.g*f.g,n.b*d.b*f.b,n.a*d.a*f.a),e.save(),e.transform(h.a,h.c,h.b,h.d,h.worldX,h.worldY),e.translate(l.offset[0],l.offset[1]),e.rotate(l.rotation*Math.PI/180);let p=l.width/u.originalWidth;e.scale(p*l.scaleX,p*l.scaleY);let g=u.width,m=u.height;if(e.translate(g/2,m/2),90==l.region.degrees){let t=g;g=m,m=t,e.rotate(-Math.PI/2)}e.scale(1,-1),e.translate(-g/2,-m/2),e.globalAlpha=i.a,e.drawImage(c,c.width*u.u,c.height*u.v,g,m,0,0,g,m),this.debugRendering&&e.strokeRect(0,0,g,m),e.restore()}}drawTriangles(t){let e=this.ctx,i=this.tempColor,n=t.color,r=t.drawOrder,a=null,h=this.vertices,l=null;for(let t=0,c=r.length;t<c;t++){let c,d=r[t],f=d.getAttachment();if(f instanceof s.Qb){let t=f;h=this.computeRegionVertices(d,t,!1),l=o.QUAD_TRIANGLES,c=t.region.texture.getImage()}else{if(!(f instanceof s.fj))continue;{let t=f;h=this.computeMeshVertices(d,t,!1),l=t.triangles,c=t.region.texture.getImage()}}if(c){d.data.blendMode!=a&&(a=d.data.blendMode);let t=d.color,s=f.color;i.set(n.r*t.r*s.r,n.g*t.g*s.g,n.b*t.b*s.b,n.a*t.a*s.a),e.globalAlpha=i.a;for(var u=0;u<l.length;u+=3){let t=8*l[u],i=8*l[u+1],s=8*l[u+2],n=h[t],r=h[t+1],a=h[t+6],o=h[t+7],d=h[i],f=h[i+1],p=h[i+6],g=h[i+7],m=h[s],v=h[s+1],y=h[s+6],x=h[s+7];this.drawTriangle(c,n,r,a,o,d,f,p,g,m,v,y,x),this.debugRendering&&(e.strokeStyle="green",e.beginPath(),e.moveTo(n,r),e.lineTo(d,f),e.lineTo(m,v),e.lineTo(n,r),e.stroke())}}}this.ctx.globalAlpha=1}drawTriangle(t,e,i,s,n,r,a,o,h,l,u,c,d){let f=this.ctx;s*=t.width,n*=t.height,o*=t.width,h*=t.height,c*=t.width,d*=t.height,f.beginPath(),f.moveTo(e,i),f.lineTo(r,a),f.lineTo(l,u),f.closePath();var p=1/((o-=s)*(d-=n)-(c-=s)*(h-=n)),g=(d*(r-=e)-h*(l-=e))*p,m=(d*(a-=i)-h*(u-=i))*p,v=(o*l-c*r)*p,y=(o*u-c*a)*p,x=e-g*s-v*n,w=i-m*s-y*n;f.save(),f.transform(g,m,v,y,x,w),f.clip(),f.drawImage(t,0,0),f.restore()}computeRegionVertices(t,e,i){let n=t.bone.skeleton.color,r=t.color,a=e.color,h=n.a*r.a*a.a,l=i?h:1,u=this.tempColor;u.set(n.r*r.r*a.r*l,n.g*r.g*a.g*l,n.b*r.b*a.b*l,h),e.computeWorldVertices(t,this.vertices,0,o.VERTEX_SIZE);let c=this.vertices,d=e.uvs;return c[s.Qb.C1R]=u.r,c[s.Qb.C1G]=u.g,c[s.Qb.C1B]=u.b,c[s.Qb.C1A]=u.a,c[s.Qb.U1]=d[0],c[s.Qb.V1]=d[1],c[s.Qb.C2R]=u.r,c[s.Qb.C2G]=u.g,c[s.Qb.C2B]=u.b,c[s.Qb.C2A]=u.a,c[s.Qb.U2]=d[2],c[s.Qb.V2]=d[3],c[s.Qb.C3R]=u.r,c[s.Qb.C3G]=u.g,c[s.Qb.C3B]=u.b,c[s.Qb.C3A]=u.a,c[s.Qb.U3]=d[4],c[s.Qb.V3]=d[5],c[s.Qb.C4R]=u.r,c[s.Qb.C4G]=u.g,c[s.Qb.C4B]=u.b,c[s.Qb.C4A]=u.a,c[s.Qb.U4]=d[6],c[s.Qb.V4]=d[7],c}computeMeshVertices(t,e,i){let n=t.bone.skeleton.color,r=t.color,a=e.color,h=n.a*r.a*a.a,l=i?h:1,u=this.tempColor;u.set(n.r*r.r*a.r*l,n.g*r.g*a.g*l,n.b*r.b*a.b*l,h);let c=e.worldVerticesLength/2,d=this.vertices;d.length<e.worldVerticesLength&&(this.vertices=d=s.Aq.newFloatArray(e.worldVerticesLength)),e.computeWorldVertices(t,0,e.worldVerticesLength,d,0,o.VERTEX_SIZE);let f=e.uvs;for(let t=0,e=0,i=2;t<c;t++)d[i++]=u.r,d[i++]=u.g,d[i++]=u.b,d[i++]=u.a,d[i++]=f[e++],d[i++]=f[e++],i+=2;return d}}},440:function(t){var e;e=()=>(()=>{var t={50792:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n<r;n++)a[n]=s[n].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},o.prototype.emit=function(t,e,s,n,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,u=this._events[o],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,s),!0;case 4:return u.fn.call(u.context,e,s,n),!0;case 5:return u.fn.call(u.context,e,s,n,r),!0;case 6:return u.fn.call(u.context,e,s,n,r,a),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,s);break;case 4:u[l].fn.call(u[l].context,e,s,n);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,s,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||n&&!o.once||s&&o.context!==s||a(this,r);else{for(var h=0,l=[],u=o.length;h<u;h++)(o[h].fn!==e||n&&!o[h].once||s&&o[h].context!==s)&&l.push(o[h]);l.length?this._events[r]=1===l.length?l[0]:l:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o},11517:(t,e,i)=>{var s=i(38829);t.exports=function(t,e,i,n){for(var r=t[0],a=1;a<t.length;a++){var o=t[a];s(o,r,e,i,n),r=o}return t}},80318:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},60757:t=>{t.exports=function(t,e,i){for(var s=0;s<t.length;s++){var n=t[s];e.call(i,n)}return t}},69927:t=>{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s<t.length;s++){var n=t[s],r=!0;for(var a in e)n[a]!==e[a]&&(r=!1);if(r)return n}return null}},32265:t=>{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=t.length-1;s>=i;s--){var n=t[s],r=!0;for(var a in e)n[a]!==e[a]&&(r=!1);if(r)return n}return null}},94420:(t,e,i)=>{var s=i(11879),n=i(60461),r=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),f=r(e,"x",0),p=r(e,"y",0),g=0,m=0,v=h*u,y=l*c;o.setPosition(f,p),o.setSize(u,c);for(var x=0;x<t.length;x++)if(s(t[x],o,d),i&&-1===h)o.x+=u;else if(a&&-1===l)o.y+=c;else if(a&&!i){if(m+=c,o.y+=c,m===y&&(m=0,g+=u,o.y=p,o.x+=u,g===v))break}else if(g+=u,o.x+=u,g===v&&(g=0,m+=c,o.x=f,o.y+=c,m===y))break;return t}},41721:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},67285:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},9074:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"x",e,n,a,o),s(t,"y",i,r,a,o)}},75222:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},22983:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,a=e.x,o=e.y,h=e.radius,l=0;l<t.length;l++)t[l].x=a+h*Math.cos(n),t[l].y=o+h*Math.sin(n),n+=r;return t}},95253:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,a=e.width/2,o=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+a*Math.cos(n),t[h].y=e.y+o*Math.sin(n),n+=r;return t}},88505:(t,e,i)=>{var s=i(15258),n=i(26708);t.exports=function(t,e,i){var r;r=i?n(e,i,t.length):s(e,t.length);for(var a=0;a<t.length;a++){var o=t[a],h=r[a];o.x=h.x,o.y=h.y}return t}},41346:(t,e,i)=>{var s=i(14649),n=i(86003),r=i(49498);t.exports=function(t,e,i){void 0===i&&(i=0);var a=s(e,!1,t.length);i>0?n(a,i):i<0&&r(a,Math.abs(i));for(var o=0;o<t.length;o++)t[o].x=a[o].x,t[o].y=a[o].y;return t}},11575:(t,e,i)=>{var s=i(84993);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),a=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),a.pop();for(var o=(n=n.concat(r,a)).length/t.length,h=0,l=0;l<t.length;l++){var u=t[l],c=n[Math.floor(h)];u.x=c.x,u.y=c.y,h+=o}return t}},29953:t=>{t.exports=function(t,e,i){for(var s=0;s<t.length;s++){var n=t[s];n.anims&&n.anims.play(e,i)}return t}},66979:t=>{t.exports=function(t,e,i,s,n,r){var a;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var o=0,h=t.length;if(1===r)for(a=n;a<h;a++)t[a][e]+=i+o*s,o++;else for(a=n;a>=0;a--)t[a][e]+=i+o*s,o++;return t}},43967:t=>{t.exports=function(t,e,i,s,n,r){var a;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var o=0,h=t.length;if(1===r)for(a=n;a<h;a++)t[a][e]=i+o*s,o++;else for(a=n;a>=0;a--)t[a][e]=i+o*s,o++;return t}},88926:(t,e,i)=>{var s=i(28176);t.exports=function(t,e){for(var i=0;i<t.length;i++)s(e,t[i]);return t}},33286:(t,e,i)=>{var s=i(24820);t.exports=function(t,e){for(var i=0;i<t.length;i++)s(e,t[i]);return t}},96e3:(t,e,i)=>{var s=i(65822);t.exports=function(t,e){for(var i=0;i<t.length;i++)s(e,t[i]);return t}},28789:(t,e,i)=>{var s=i(26597);t.exports=function(t,e){for(var i=0;i<t.length;i++)s(e,t[i]);return t}},97154:(t,e,i)=>{var s=i(90260);t.exports=function(t,e){for(var i=0;i<t.length;i++)s(e,t[i]);return t}},20510:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},91051:(t,e,i)=>{var s=i(1163),n=i(20339);t.exports=function(t,e,i){for(var r=e.x,a=e.y,o=0;o<t.length;o++){var h=t[o];s(h,r,a,i,Math.max(1,n(h.x,h.y,r,a)))}return t}},76332:(t,e,i)=>{var s=i(1163);t.exports=function(t,e,i,n){var r=e.x,a=e.y;if(0===n)return t;for(var o=0;o<t.length;o++)s(t[o],r,a,i,n);return t}},61619:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},94868:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"scaleX",e,n,a,o),s(t,"scaleY",i,r,a,o)}},95532:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},8689:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},2645:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},32372:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},85373:t=>{t.exports=function(t,e,i){for(var s=0;s<t.length;s++)t[s].setInteractive(e,i);return t}},81583:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"originX",e,n,a,o),s(t,"originY",i,r,a,o),t.forEach((function(t){t.updateDisplayOrigin()})),t}},79939:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},2699:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"scaleX",e,n,a,o),s(t,"scaleY",i,r,a,o)}},98739:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},98476:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},6207:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"scrollFactorX",e,n,a,o),s(t,"scrollFactorY",i,r,a,o)}},6607:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},72248:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},14036:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r<t.length;r++)t[r].setTint(e,i,s,n);return t}},50159:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},77597:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},83194:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,a,o){return null==i&&(i=e),s(t,"x",e,n,a,o),s(t,"y",i,r,a,o)}},67678:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},35850:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){var a,o;void 0===n&&(n=0),void 0===r&&(r=new s);var h=t.length;if(1===h)a=t[0].x,o=t[0].y,t[0].x=e,t[0].y=i;else{var l=1,u=0;0===n&&(u=h-1,l=h-2),a=t[u].x,o=t[u].y,t[u].x=e,t[u].y=i;for(var c=0;c<h;c++)if(!(l>=h||-1===l)){var d=t[l],f=d.x,p=d.y;d.x=a,d.y=o,a=f,o=p,0===n?l--:l++}}return r.x=a,r.y=o,r}},8628:(t,e,i)=>{var s=i(33680);t.exports=function(t){return s(t)}},21837:(t,e,i)=>{var s=i(7602);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var a,o=Math.abs(n-i)/t.length;if(r)for(a=0;a<t.length;a++)t[a][e]+=s(a*o,i,n);else for(a=0;a<t.length;a++)t[a][e]=s(a*o,i,n);return t}},21910:(t,e,i)=>{var s=i(54261);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var a,o=Math.abs(n-i)/t.length;if(r)for(a=0;a<t.length;a++)t[a][e]+=s(a*o,i,n);else for(a=0;a<t.length;a++)t[a][e]=s(a*o,i,n);return t}},62054:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=!1),0===t.length)return t;if(1===t.length)return n?t[0][e]+=(s+i)/2:t[0][e]=(s+i)/2,t;var r,a=Math.abs(s-i)/(t.length-1);if(n)for(r=0;r<t.length;r++)t[r][e]+=r*a+i;else for(r=0;r<t.length;r++)t[r][e]=r*a+i;return t}},79815:t=>{t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},39665:(t,e,i)=>{var s=i(15994);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n<t.length;n++){var r=t[n];r.x=s(r.x,e.left-i,e.right+i),r.y=s(r.y,e.top-i,e.bottom+i)}return t}},61061:(t,e,i)=>{t.exports={AlignTo:i(11517),Angle:i(80318),Call:i(60757),GetFirst:i(69927),GetLast:i(32265),GridAlign:i(94420),IncAlpha:i(41721),IncX:i(67285),IncXY:i(9074),IncY:i(75222),PlaceOnCircle:i(22983),PlaceOnEllipse:i(95253),PlaceOnLine:i(88505),PlaceOnRectangle:i(41346),PlaceOnTriangle:i(11575),PlayAnimation:i(29953),PropertyValueInc:i(66979),PropertyValueSet:i(43967),RandomCircle:i(88926),RandomEllipse:i(33286),RandomLine:i(96e3),RandomRectangle:i(28789),RandomTriangle:i(97154),Rotate:i(20510),RotateAround:i(91051),RotateAroundDistance:i(76332),ScaleX:i(61619),ScaleXY:i(94868),ScaleY:i(95532),SetAlpha:i(8689),SetBlendMode:i(2645),SetDepth:i(32372),SetHitArea:i(85373),SetOrigin:i(81583),SetRotation:i(79939),SetScale:i(2699),SetScaleX:i(98739),SetScaleY:i(98476),SetScrollFactor:i(6207),SetScrollFactorX:i(6607),SetScrollFactorY:i(72248),SetTint:i(14036),SetVisible:i(50159),SetX:i(77597),SetXY:i(83194),SetY:i(67678),ShiftPosition:i(35850),Shuffle:i(8628),SmootherStep:i(21910),SmoothStep:i(21837),Spread:i(62054),ToggleVisible:i(79815),WrapInRectangle:i(39665)}},42099:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(74943),a=i(81957),o=i(41138),h=i(35154),l=i(90126),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showBeforeDelay=h(i,"showBeforeDelay",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.randomFrame=h(i,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t<this.frames.length},getFirstTick:function(t){t.accumulator=0,t.nextTick=t.frameRate===t.currentAnim.frameRate&&t.currentFrame.duration||t.msPerFrame},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i,s){void 0===s&&(s=!0);var n,r,a,u,c=[],d=1;if("string"==typeof e){if(u=e,!t.exists(u))return console.warn('Texture "%s" not found',u),c;var f=t.get(u).getFrameNames();s&&l(f),e=[],f.forEach((function(t){e.push({key:u,frame:t})}))}if(!Array.isArray(e)||0===e.length)return c;for(a=0;a<e.length;a++){var p=e[a],g=h(p,"key",i);if(g){var m=h(p,"frame",0),v=t.getFrame(g,m);v?((r=new o(g,m,d,v)).duration=h(p,"duration",0),r.isFirst=!n,n&&(n.nextFrame=r,r.prevFrame=n),c.push(r),n=r,d++):console.warn('Texture "%s" not found',g)}}if(c.length>0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(a=0;a<c.length;a++)c[a].progress=a*y}return c},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.frameRate===t.currentAnim.frameRate&&t.currentFrame.duration||t.msPerFrame},getFrameByProgress:function(t){return t=s(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t.yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={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,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s<e;s++)(t=this.frames[s]).index=s+1,t.isFirst=!1,t.isLast=!1,t.progress=s*i,0===s?(t.isFirst=!0,1===e?(t.isLast=!0,t.nextFrame=t,t.prevFrame=t):(t.isLast=!1,t.prevFrame=this.frames[e-1],t.nextFrame=this.frames[s+1])):s===e-1&&e>1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+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(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=u},41138:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},60848:(t,e,i)=>{var s=i(42099),n=i(83419),r=i(90330),a=i(50792),o=i(74943),h=i(8443),l=i(95540),u=i(35154),c=i(36383),d=i(20283),f=i(41836),p=new n({Extends:a,initialize:function(t){a.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;if(s.has(r)&&s.has(a)){var o=n.get(r);o||(o={}),o[a]=i,n.set(r,o)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(o.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var s=[],n=this.game.cache.json.get(t);if(!n)return console.warn("No Aseprite data found for: "+t),s;var r=this,a=u(n,"meta",null),o=u(n,"frames",null);return a&&o&&u(a,"frameTags",[]).forEach((function(n){var a=[],h=l(n,"name",null),u=l(n,"from",0),d=l(n,"to",0),f=l(n,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,g=u;g<=d;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",c.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,w={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(w)):x=r.create(w),x&&s.push(x)}})),s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new s(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;s<t.anims.length;s++)i.push(this.create(t.anims[s]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i=u(e,"prefix",""),s=u(e,"start",0),n=u(e,"end",0),r=u(e,"suffix",""),a=u(e,"zeroPad",0),o=u(e,"outputArray",[]),h=u(e,"frames",!1);if(!this.textureManager.exists(t))return console.warn('Texture "%s" not found',t),o;var l,c=this.textureManager.get(t);if(!c)return o;if(e)for(h||(h=d(s,n)),l=0;l<h.length;l++){var p=i+f(h[l],a,"0",1)+r;c.has(p)?o.push({key:t,frame:p}):console.warn('Frame "%s" not found in texture "%s"',p,t)}else for(h=c.getFrameNames(),l=0;l<h.length;l++)o.push({key:t,frame:h[l]});return o},generateFrameNumbers:function(t,e){var i=u(e,"start",0),s=u(e,"end",-1),n=u(e,"first",!1),r=u(e,"outputArray",[]),a=u(e,"frames",!1);if(!this.textureManager.exists(t))return console.warn('Texture "%s" not found',t),r;var o=this.textureManager.get(t);if(!o)return r;n&&o.has(n)&&r.push({key:t,frame:n}),a||(-1===s&&(s=o.frameTotal-2),a=d(i,s));for(var h=0;h<a.length;h++){var l=a[h];o.has(l)?r.push({key:t,frame:l}):console.warn('Frame "%s" not found in texture "%s"',l,t)}return r},get:function(t){return this.anims.get(t)},getAnimsFromTexture:function(t){for(var e=this.textureManager.get(t).key,i=this.anims.getArray(),s=[],n=0;n<i.length;n++)for(var r=i[n],a=r.frames,o=0;o<a.length;o++)if(a[o].textureKey===e){s.push(r.key);break}return s},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(o.PAUSE_ALL)),this},play:function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)e[i].anims.play(t);return this},staggerPlay:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=!0),Array.isArray(e)||(e=[e]);var n=e.length;s||n--;for(var r=0;r<e.length;r++){var a=i<0?Math.abs(i)*(n-r):i*r;e[r].anims.playAfterDelay(t,a)}return this},remove:function(t){var e=this.get(t);return e&&(this.emit(o.REMOVE_ANIMATION,t,e),this.anims.delete(t),this.removeMix(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(o.RESUME_ALL)),this},toJSON:function(t){var e={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==t&&""!==t?e.anims.push(this.anims.get(t).toJSON()):this.anims.each((function(t,i){e.anims.push(i.toJSON())})),e},destroy:function(){this.anims.clear(),this.mixes.clear(),this.textureManager=null,this.game=null}});t.exports=p},9674:(t,e,i)=>{var s=i(42099),n=i(30976),r=i(83419),a=i(90330),o=i(74943),h=i(95540),l=new r({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.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.randomFrame=!1,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showBeforeDelay=!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(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i];this.nextAnim?this.nextAnimsQueue.push(s):this.nextAnim=s}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(t){this.isPlaying&&this.stop();var e=this.animationManager,i="string"==typeof t?t:h(t,"key",null),s=this.exists(i)?this.get(i):e.get(i);if(s){this.currentAnim=s;var r=s.getTotalFrames(),a=h(t,"frameRate",s.frameRate),o=h(t,"duration",s.duration);s.calculateDuration(this,r,o,a),this.delay=h(t,"delay",s.delay),this.repeat=h(t,"repeat",s.repeat),this.repeatDelay=h(t,"repeatDelay",s.repeatDelay),this.yoyo=h(t,"yoyo",s.yoyo),this.showBeforeDelay=h(t,"showBeforeDelay",s.showBeforeDelay),this.showOnStart=h(t,"showOnStart",s.showOnStart),this.hideOnComplete=h(t,"hideOnComplete",s.hideOnComplete),this.skipMissedFrames=h(t,"skipMissedFrames",s.skipMissedFrames),this.randomFrame=h(t,"randomFrame",s.randomFrame),this.timeScale=h(t,"timeScale",this.timeScale);var l=h(t,"startFrame",0);l>r&&(l=0),this.randomFrame&&(l=n(0,r-1));var u=s.frames[l];0!==l||this.forward||(u=s.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.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():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new s(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.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}}});t.exports=l},57090:t=>{t.exports="add"},25312:t=>{t.exports="animationcomplete"},89580:t=>{t.exports="animationcomplete-"},52860:t=>{t.exports="animationrepeat"},63850:t=>{t.exports="animationrestart"},99085:t=>{t.exports="animationstart"},28087:t=>{t.exports="animationstop"},1794:t=>{t.exports="animationupdate"},52562:t=>{t.exports="pauseall"},57953:t=>{t.exports="remove"},68339:t=>{t.exports="resumeall"},74943:(t,e,i)=>{t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421:(t,e,i)=>{t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161:(t,e,i)=>{var s=i(83419),n=i(90330),r=i(50792),a=i(24736),o=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047:(t,e,i)=>{var s=i(2161),n=i(83419),r=i(8443),a=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=a},51464:t=>{t.exports="add"},59261:t=>{t.exports="remove"},24736:(t,e,i)=>{t.exports={ADD:i(51464),REMOVE:i(59261)}},83388:(t,e,i)=>{t.exports={BaseCache:i(2161),CacheManager:i(24047),Events:i(24736)}},71911:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(39506),a=i(50792),o=i(19715),h=i(87841),l=i(61340),u=i(80333),c=i(26099),d=new s({Extends:a,Mixins:[n.AlphaSingle,n.Visible],initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),a.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0,this.renderRoundPixels=!0},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(!a)return t;var o=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.y,p=f+d,g=this.x,m=g+c,v=this.culledObjects,y=t.length;a=1/a,v.length=0;for(var x=0;x<y;++x){var w=t[x];if(w.hasOwnProperty("width")&&!w.parentContainer){var b=w.width,T=w.height,S=w.x-l*w.scrollFactorX-b*w.originX,E=w.y-u*w.scrollFactorY-T*w.originY;(S+b)*i+(E+T)*n+o>g&&S*i+E*n+o<m&&(S+b)*s+(E+T)*r+h>f&&S*s+E*r+h<p&&v.push(w)}else v.push(w)}return v},getWorldPoint:function(t,e,i){void 0===i&&(i=new c);var s=this.matrix.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],l=s[5],u=n*o-r*a;if(!u)return i.x=t,i.y=e,i;var d=o*(u=1/u),f=-r*u,p=-a*u,g=n*u,m=(a*l-o*h)*u,v=(r*h-n*l)*u,y=Math.cos(this.rotation),x=Math.sin(this.rotation),w=this.zoomX,b=this.zoomY,T=this.scrollX,S=this.scrollY,E=t+(T*y-S*x)*w,A=e+(T*x+S*y)*b;return i.x=E*d+A*p+m,i.y=E*f+A*g+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i];Array.isArray(s)?this.ignore(s):s.isParent?this.ignore(s.getChildren()):s.cameraFilter|=e}return this},clampX:function(t){var e=this._bounds,i=this.displayWidth,s=e.x+(i-this.width)/2,n=Math.max(s,s+e.width-i);return t<s?t=s:t>n&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return t<s?t=s:t>n&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={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&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(o.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(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,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}}});t.exports=d},38058:(t,e,i)=>{var s=i(71911),n=i(67502),r=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),c=i(87841),d=i(26099),f=new a({Extends:s,Mixins:[o.PostPipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(r,a),this.scrollX=r-i,this.scrollY=a-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,a){return this.fadeEffect.start(!1,t,e,i,s,n,r,a)},fade:function(t,e,i,s,n,r,a){return this.fadeEffect.start(!0,t,e,i,s,n,r,a)},flash:function(t,e,i,s,n,r,a){return this.flashEffect.start(t,e,i,s,n,r,a)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,a){return this.panEffect.start(t,e,i,s,n,r,a)},rotateTo:function(t,e,i,s,n,r,a){return this.rotateToEffect.start(t,e,i,s,n,r,a)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoomX,a=this.zoomY,o=this.matrix;this.renderRoundPixels=this.roundPixels&&Number.isInteger(r)&&Number.isInteger(a);var h=t*this.originX,c=e*this.originY,d=this._follow,f=this.deadzone,p=this.scrollX,g=this.scrollY;f&&n(f,this.midPoint.x,this.midPoint.y);var m=!1;if(d&&!this.panEffect.isRunning){var v=this.lerp,y=d.x-this.followOffset.x,x=d.y-this.followOffset.y;f?(y<f.x?p=u(p,p-(f.x-y),v.x):y>f.right&&(p=u(p,p+(y-f.right),v.x)),x<f.y?g=u(g,g-(f.y-x),v.y):x>f.bottom&&(g=u(g,g+(x-f.bottom),v.y))):(p=u(p,y-h,v.x),g=u(g,x-c,v.y)),m=!0}this.roundPixels&&(p=Math.floor(p),g=Math.floor(g)),this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.scrollX=p,this.scrollY=g;var w=p+i,b=g+s;this.midPoint.set(w,b);var T=Math.floor(t/r+.5),S=Math.floor(e/a+.5),E=Math.floor(w-T/2+.5),A=Math.floor(b-S/2+.5);this.worldView.setTo(E,A,T,S),o.applyITRS(Math.floor(this.x+h+.5),Math.floor(this.y+c+.5),this.rotation,r,a),o.translate(-h,-c),this.shakeEffect.preRender(),m&&this.emit(l.FOLLOW_UPDATE,this,d)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===a&&(a=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,a);var o=this.width/2,h=this.height/2,l=t.x-n,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,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(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743:(t,e,i)=>{var s=i(38058),n=i(83419),r=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===a&&(a="");var o=new s(t,e,i,n);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),r&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n<t.length;n++){var r=t[n];r&&r.id===e&&(s=!0)}if(!s)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,s=0;s<i.length;s++){var n=i[s];(!t||t&&n.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.scale.width,i=this.scene.sys.scale.height,s=0;s<t.length;s++){var n=t[s],a=r(n,"x",0),o=r(n,"y",0),h=r(n,"width",e),l=r(n,"height",i),u=this.add(a,o,h,l);u.name=r(n,"name",""),u.zoom=r(n,"zoom",1),u.rotation=r(n,"rotation",0),u.scrollX=r(n,"scrollX",0),u.scrollY=r(n,"scrollY",0),u.roundPixels=r(n,"roundPixels",!1),u.visible=r(n,"visible",!0);var c=r(n,"backgroundColor",!1);c&&u.setBackgroundColor(c);var d=r(n,"bounds",null);if(d){var f=r(d,"x",0),p=r(d,"y",0),g=r(d,"width",e),m=r(d,"height",i);u.setBounds(f,p,g,m)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,s=t.y,n=[],r=0;r<e.length;r++){var a=e[r];a.visible&&a.inputEnabled&&o(a,i,s)&&n.unshift(a)}return n},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,s=this.cameras,n=0;n<t.length;n++){var r=s.indexOf(t[n]);-1!==r&&(e?s[r].destroy():s[r].renderList=[],s.splice(r,1),i++)}return!this.main&&s[0]&&(this.main=s[0]),i},render:function(t,e){for(var i=this.scene,s=this.cameras,n=0;n<s.length;n++){var r=s[n];if(r.visible&&r.alpha>0){r.preRender();var a=this.getVisibleChildren(e.getChildren(),r);t.render(i,a,r)}}},getVisibleChildren:function(t,e){return t.filter((function(t){return t.willRender(e)}))},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},onResize:function(t,e,i,s,n){for(var r=0;r<this.cameras.length;r++){var a=this.cameras[r];0===a._x&&0===a._y&&a._width===s&&a._height===n&&a.setSize(e.width,e.height)}},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off(l.UPDATE,this.update,this),e.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.systems.events.off(l.START,this.start,this),this.systems.events.off(l.DESTROY,this.destroy,this),this.systems.game.scale.off(h.RESIZE,this.onResize,this),this.scene=null,this.systems=null}});a.register("CameraManager",u,"cameras"),t.exports=u},5020:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(19715),a=new n({initialize:function(t){this.camera=t,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(t,e,i,s,n,a,o,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===a&&(a=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),!a&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(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(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,s=this.red/255,n=this.green/255,r=this.blue/255;return t.drawFillRect(i.x,i.y,i.width,i.height,e(r,n,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?r.FADE_OUT_COMPLETE:r.FADE_IN_COMPLETE;this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},10662:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(19715),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===o&&(o=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=o,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this._alpha*(1-this.progress):this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,s=this.red/255,n=this.green/255,r=this.blue/255;return t.drawFillRect(i.x,i.y,i.width,i.height,e(r,n,s,1),this.alpha),!0},effectComplete:function(){this.alpha=this._alpha,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},20359:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(62640),a=i(19715),o=i(26099),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new o,this.current=new o,this.destination=new o,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.camera.emit(a.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed<this.duration){var r=this.ease(i);n.getScroll(this.destination.x,this.destination.y,this.current);var a=this.source.x+(this.current.x-this.source.x)*r,o=this.source.y+(this.current.y-this.source.y)*r;n.setScroll(a,o),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,a,o)}else n.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,n.scrollX,n.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.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}});t.exports=h},34208:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(19715),a=i(62640),o=new n({initialize:function(t){this.camera=t,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(t,e,i,s,n,o,h){void 0===i&&(i=1e3),void 0===s&&(s=a.Linear),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&a.hasOwnProperty(s)?this.ease=a[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.shortestPath){var d,f;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(f=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>f&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed<this.duration){var r=this.ease(i);this.current=n.rotation;var a,o=360*Math.PI/180,h=this.destination,l=this.current;!1===this.clockwise&&(h=this.current,l=this.destination),a=h>=l?Math.abs(h-l):Math.abs(h+o)-l;var u;u=this.clockwise?n.rotation+a*r:n.rotation-a*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.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}});t.exports=o},30330:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(19715),a=i(26099),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,n=this.camera.width,r=this.camera.height,a=this.camera.zoom;this._offsetX=(Math.random()*i.x*n*2-i.x*n)*a,this._offsetY=(Math.random()*i.y*r*2-i.y*r)*a,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(r.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}});t.exports=o},45641:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(62640),a=i(19715),o=new n({initialize:function(t){this.camera=t,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(t,e,i,s,n,o){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===o&&(o=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=o,this.camera.emit(a.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(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(a.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},20052:(t,e,i)=>{t.exports={Fade:i(5020),Flash:i(10662),Pan:i(20359),Shake:i(30330),RotateTo:i(34208),Zoom:i(45641)}},16438:t=>{t.exports="cameradestroy"},32726:t=>{t.exports="camerafadeincomplete"},87807:t=>{t.exports="camerafadeinstart"},45917:t=>{t.exports="camerafadeoutcomplete"},95666:t=>{t.exports="camerafadeoutstart"},47056:t=>{t.exports="cameraflashcomplete"},91261:t=>{t.exports="cameraflashstart"},45047:t=>{t.exports="followupdate"},81927:t=>{t.exports="camerapancomplete"},74264:t=>{t.exports="camerapanstart"},54419:t=>{t.exports="postrender"},79330:t=>{t.exports="prerender"},93183:t=>{t.exports="camerarotatecomplete"},80112:t=>{t.exports="camerarotatestart"},62252:t=>{t.exports="camerashakecomplete"},86017:t=>{t.exports="camerashakestart"},539:t=>{t.exports="camerazoomcomplete"},51892:t=>{t.exports="camerazoomstart"},19715:(t,e,i)=>{t.exports={DESTROY:i(16438),FADE_IN_COMPLETE:i(32726),FADE_IN_START:i(87807),FADE_OUT_COMPLETE:i(45917),FADE_OUT_START:i(95666),FLASH_COMPLETE:i(47056),FLASH_START:i(91261),FOLLOW_UPDATE:i(45047),PAN_COMPLETE:i(81927),PAN_START:i(74264),POST_RENDER:i(54419),PRE_RENDER:i(79330),ROTATE_COMPLETE:i(93183),ROTATE_START:i(80112),SHAKE_COMPLETE:i(62252),SHAKE_START:i(86017),ZOOM_COMPLETE:i(539),ZOOM_START:i(51892)}},87969:(t,e,i)=>{t.exports={Camera:i(38058),BaseCamera:i(71911),CameraManager:i(32743),Effects:i(20052),Events:i(19715)}},63091:(t,e,i)=>{var s=i(83419),n=i(35154),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"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(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<this.minZoom&&(e.zoom=this.minZoom)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed,e.zoom>this.maxZoom&&(e.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}});t.exports=r},58818:(t,e,i)=>{var s=i(83419),n=i(35154),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"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(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,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&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<this.minZoom?e.zoom=this.minZoom:e.zoom>this.maxZoom&&(e.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}});t.exports=r},38865:(t,e,i)=>{t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638:(t,e,i)=>{t.exports={Controls:i(38865),Scene2D:i(87969)}},8054:(t,e,i)=>{var s={VERSION:"3.90.0",LOG_VERSION:"v390",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},69547:(t,e,i)=>{var s=i(83419),n=i(8054),r=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),c=i(75508),d=i(36060),f=i(80333),p=new s({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",n.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),c.RND=new c.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+n.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null),this.disablePreFX=h(t,"disablePreFX",!1),this.disablePostFX=h(t,"disablePostFX",!1);var i=h(t,"render",null);this.pipeline=h(i,"pipeline",null,t),this.autoMobilePipeline=h(i,"autoMobilePipeline",!0,t),this.defaultPipeline=h(i,"defaultPipeline",d.MULTI_PIPELINE,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.pixelArt=h(i,"pixelArt",1!==this.zoom,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",4096,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t);var s=h(t,"backgroundColor",0);this.backgroundColor=f(s),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=h(t,"fx.glow.quality",.1),this.glowFXDistance=h(t,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=h(t,"plugins",null),g=r.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:l(p)&&(this.installGlobalPlugins=o(p,"global",[]),this.installScenePlugins=o(p,"scene",[]),Array.isArray(p.default)?g=p.default:Array.isArray(p.defaultMerge)&&(g=g.concat(p.defaultMerge)))),this.defaultPlugins=g;var m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",m+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",m+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},86054:(t,e,i)=>{var s=i(20623),n=i(27919),r=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=a.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(o=i(68627),h=i(74797),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391:(t,e,i)=>{var s=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,a=t.device.audio;if(n=a.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var o,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),o=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+o):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},50127:(t,e,i)=>{var s=i(40366),n=i(60848),r=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),c=i(45893),d=i(96391),f=i(82264),p=i(57264),g=i(50792),m=i(8443),v=i(7003),y=i(37277),x=i(77332),w=i(76531),b=i(60903),T=i(69442),S=i(17130),E=i(65898),A=i(51085),C=i(14747),M=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new n(this),this.textures=new S(this),this.cache=new r(this),this.registry=new c(this,new g),this.input=new v(this,this.config),this.scene=new b(this,this.config.sceneConfig),this.device=f,this.scale=new w(this,this.config),this.sound=null,this.sound=C.create(this),this.loop=new E(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(T.READY,this.texturesReady,this),this.events.emit(m.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(m.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)),A(this);var t=this.events;t.on(m.HIDDEN,this.onHidden,this),t.on(m.VISIBLE,this.onVisible,this),t.on(m.BLUR,this.onBlur,this),t.on(m.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(m.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(m.POST_RENDER,s,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(m.PRE_RENDER,null,t,e),i.emit(m.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(m.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(m.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(m.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(m.RESUME,0)},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(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(m.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=M},65898:(t,e,i)=>{var s=i(83419),n=i(35154),r=i(29747),a=i(43092),o=new s({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this.fpsLimit=n(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"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.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t;var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target)},smoothDelta:function(t){var e=this.deltaIndex,i=this.deltaHistory,s=this.deltaSmoothingMax;(this._coolDown>0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var n=0,r=0;r<s;r++)n+=i[r];return n/s},updateFPS:function(t){this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0},stepLimitFPS:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta+=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta=0),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},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.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085:(t,e,i)=>{var s=i(8443);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})),e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217:t=>{t.exports="blur"},47548:t=>{t.exports="boot"},19814:t=>{t.exports="contextlost"},68446:t=>{t.exports="destroy"},41700:t=>{t.exports="focus"},25432:t=>{t.exports="hidden"},65942:t=>{t.exports="pause"},59211:t=>{t.exports="postrender"},47789:t=>{t.exports="poststep"},39066:t=>{t.exports="prerender"},460:t=>{t.exports="prestep"},16175:t=>{t.exports="ready"},42331:t=>{t.exports="resume"},11966:t=>{t.exports="step"},32969:t=>{t.exports="systemready"},94830:t=>{t.exports="visible"},8443:(t,e,i)=>{t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857:(t,e,i)=>{t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},99584:(t,e,i)=>{var s=i(5290),n=i(27919),r=i(35154);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),a=r(t,"palette",s),o=r(t,"pixelWidth",1),h=r(t,"pixelHeight",o),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*o)),p=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d",{willReadFrequently:!0});u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var m=0;m<e.length;m++)for(var v=e[m],y=0;y<v.length;y++){var x=v[y];"."!==x&&" "!==x&&(g.fillStyle=a[x],g.fillRect(y*o,m*h,o,h))}return d&&d(i,g),i}},15822:(t,e,i)=>{t.exports={GenerateTexture:i(99584),Palettes:i(57763)}},5290:t=>{t.exports={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"}},23816:t=>{t.exports={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"}},9866:t=>{t.exports={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"}},77552:t=>{t.exports={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"}},92259:t=>{t.exports={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"}},57763:(t,e,i)=>{t.exports={ARNE16:i(5290),C64:i(23816),CGA:i(9866),JMP:i(77552),MSX:i(92259)}},46728:(t,e,i)=>{var s=i(83419),n=i(36316),r=i(80021),a=i(26099),o=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,r=this.p2,o=this.p3;return e.set(n(t,i.x,s.x,r.x,o.x),n(t,i.y,s.y,r.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s<i.length;s++)t.lineTo(i[s].x,i[s].y);return t.strokePath(),t},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]}}});o.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]),n=new a(e[4],e[5]),r=new a(e[6],e[7]);return new o(i,s,n,r)},t.exports=o},80021:(t,e,i)=>{var s=i(83419),n=i(19217),r=i(87841),a=i(26099),o=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,a=n.length;s=e?Math.min(e,n[a-1]):t*n[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(a-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825:(t,e,i)=>{var s=i(83419),n=i(80021),r=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new s({Extends:n,initialize:function(t,e,i,s,o,l,u,c){if("object"==typeof t){var d=t;t=a(d,"x",0),e=a(d,"y",0),i=a(d,"xRadius",0),s=a(d,"yRadius",i),o=a(d,"startAngle",0),l=a(d,"endAngle",360),u=a(d,"clockwise",!1),c=a(d,"rotation",0)}else void 0===s&&(s=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(o),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)<Number.EPSILON;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(s=n?0:i),this._clockwise&&!n&&(s===i?s=-i:s-=i);var r=this._startAngle+t*s,a=this.p0.x+this._xRadius*Math.cos(r),o=this.p0.y+this._yRadius*Math.sin(r);if(0!==this._rotation){var l=Math.cos(this._rotation),u=Math.sin(this._rotation),c=a-this.p0.x,d=o-this.p0.y;a=c*l-d*u+this.p0.x,o=c*u+d*l+this.p0.y}return e.set(a,o)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=t/2,this},setHeight:function(t){return this.yRadius=t/2,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return o(this._startAngle)},set:function(t){this._startAngle=r(t)}},endAngle:{get:function(){return o(this._endAngle)},set:function(t){this._endAngle=r(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},angle:{get:function(){return o(this._rotation)},set:function(t){this._rotation=r(t)}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:o(this._startAngle),endAngle:o(this._endAngle),clockwise:this._clockwise,rotation:o(this._rotation)}}});l.fromJSON=function(t){return new l(t)},t.exports=l},33951:(t,e,i)=>{var s=i(83419),n=i(80021),r=i(19217),a=i(87841),o=i(26099),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new a),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new o),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new o),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),s=new o(e[2],e[3]);return new h(i,s)},t.exports=h},14744:(t,e,i)=>{var s=i(83419),n=i(80021),r=i(32112),a=i(26099),o=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s<i.length;s++)t.lineTo(i[s].x,i[s].y);return t.strokePath(),t},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]}}});o.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]),n=new a(e[4],e[5]);return new o(i,s,n)},t.exports=o},42534:(t,e,i)=>{var s=i(87842),n=i(83419),r=i(80021),a=i(26099),o=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;e<t.length;e++){var i=new a;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new a(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.points,n=(i.length-1)*t,r=Math.floor(n),o=n-r,h=i[0===r?r:r-1],l=i[r],u=i[r>i.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(o,h.x,l.x,u.x,c.x),s(o,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});o.fromJSON=function(t){return new o(t.points)},t.exports=o},25410:(t,e,i)=>{t.exports={Path:i(46669),MoveTo:i(68618),CubicBezier:i(46728),Curve:i(80021),Ellipse:i(73825),Line:i(33951),QuadraticBezier:i(14744),Spline:i(42534)}},68618:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},46669:(t,e,i)=>{var s=i(83419),n=i(46728),r=i(73825),a=i(39429),o=i(33951),h=i(68618),l=i(14744),u=i(87841),c=i(42534),d=i(26099),f=i(36383),p=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new o(e,t)),this},cubicBezierTo:function(t,e,i,s,r,a){var o,h,l,u=this.getEndPoint();return t instanceof d?(o=t,h=e,l=i):(o=new d(i,s),h=new d(r,a),l=new d(t,e)),this.add(new n(u,o,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,a=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(a,n,r))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var s=this.curves[i];s.active&&s.draw(t,e)}return t},ellipseTo:function(t,e,i,s,n,a){var o=new r(0,0,t,e,i,s,n,a),h=this.getEndPoint(this._tmpVec2A),l=o.getStartPoint(this._tmpVec2B);return h.subtract(l),o.x=h.x,o.y=h.y,this.add(o)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(o.fromJSON(i));break;case"EllipseCurve":this.add(r.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(n.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new u),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new u,s=f.MIN_SAFE_INTEGER,n=f.MIN_SAFE_INTEGER,r=0;r<this.curves.length;r++){var a=this.curves[r];a.active&&(a.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),s=Math.max(s,i.right),n=Math.max(n,i.bottom))}return t.right=s,t.bottom=n,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getCurveAt:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),s=0;s<i.length;){if(i[s]>=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n<s.length;){if(s[n]>=i){var r=s[n]-i,a=this.curves[n],o=a.getLength(),h=0===o?0:1-r/o;return a.getPointAt(h,e)}n++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,s=[],n=0;n<this.curves.length;n++){var r=this.curves[n];if(r.active)for(var a=r.getResolution(t),o=r.getPoints(a,e),h=0;h<o.length;h++){var l=o[h];i&&i.equals(l)||(s.push(l),i=l)}}return this.autoClose&&s.length>1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n<s.length;){if(s[n]>=i){var r=s[n]-i,a=this.curves[n],o=a.getLength(),h=0===o?0:1-r/o;return a.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});a.register("path",(function(t,e){return new p(t,e)})),t.exports=p},45893:(t,e,i)=>{var s=i(83419),n=i(24882),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++)i.push(e[t[s]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,s=this.list,r=this.events,a=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return s[t]},set:function(e){if(!i._frozen){var o=s[t];s[t]=e,r.emit(n.CHANGE_DATA,a,t,e,o),r.emit(n.CHANGE_DATA_KEY+t,a,e,o)}}}),s[t]=e,r.emit(n.SET_DATA,a,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],s=1;s<arguments.length;s++)i.push(arguments[s]);for(var n in this.list)i[1]=n,i[2]=this.list[n],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(n.CHANGE_DATA),this.events.off(n.SET_DATA),this.events.off(n.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=r},63646:(t,e,i)=>{var s=i(83419),n=i(45893),r=i(37277),a=i(44594),o=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},10700:t=>{t.exports="changedata"},93608:t=>{t.exports="changedata-"},60883:t=>{t.exports="destroy"},69780:t=>{t.exports="removedata"},22166:t=>{t.exports="setdata"},24882:(t,e,i)=>{t.exports={CHANGE_DATA:i(10700),CHANGE_DATA_KEY:i(93608),DESTROY:i(60883),REMOVE_DATA:i(69780),SET_DATA:i(22166)}},44965:(t,e,i)=>{t.exports={DataManager:i(45893),DataManagerPlugin:i(63646),Events:i(24882)}},7098:(t,e,i)=>{var s=i(84148),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===r&&a>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},84148:(t,e,i)=>{var s,n=i(25892),r={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,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(r.edge=!0,r.es2019=!0):/OPR/.test(s)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(s)&&n.iOS?(r.mobileSafari=!0,r.es2019=!0):/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(s)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},89289:(t,e,i)=>{var s,n,r,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},89357:(t,e,i)=>{var s=i(25892),n=i(84148),r=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.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,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t<n.length;t++)if(document.documentElement[n[t]]){e.available=!0,e.request=n[t];break}var r=["cancel"+s,"exit"+i,"webkitCancel"+s,"webkitExit"+i,"msCancel"+s,"msExit"+i,"mozCancel"+s,"mozExit"+i];if(e.available)for(t=0;t<r.length;t++)if(document[r[t]]){e.cancel=r[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(e.keyboard=!0),Object.defineProperty(e,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),e}()},31784:(t,e,i)=>{var s=i(84148),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},25892:t=>{var e={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};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267:(t,e,i)=>{var s=i(95540),n={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return n;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(n.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(n.h264=!0,n.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(n.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(n.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(n.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(n.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),n.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i,r=s(t[e],"url",t[e]);if(0===r.indexOf("blob:"))return{url:r,type:""};if(i=0===r.indexOf("data:")?r.split(",")[0].match(/\/(.*?);/):r.match(/\.([a-zA-Z0-9]+)($|\?)/),i=s(t[e],"type",i?i[1]:"").toLowerCase(),n[i])return{url:r,type:i}}return null},n}()},82264:(t,e,i)=>{t.exports={os:i(25892),browser:i(84148),features:i(89357),input:i(31784),audio:i(7098),video:i(43267),fullscreen:i(91639),canvasFeatures:i(89289)}},89422:(t,e,i)=>{var s=i(83419),n=new Float32Array(20),r=new s({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,a=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,a+i*-a+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,a+i*-a+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,a+.928*i+s*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(r.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(r.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(r.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(r.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(r.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(r.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(r.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(r.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(r.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(r.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(r.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,s=n;return s.set(i),i.set([s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19]]),this._dirty=!0,this}});r.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],r.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],r.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],r.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],r.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],r.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],r.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],r.KODACHROME=[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],r.TECHNICOLOR=[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],r.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],r.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=r},51767:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},60461:t=>{t.exports={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}},54312:(t,e,i)=>{var s=i(62235),n=i(35893),r=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},46768:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},35827:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},46871:(t,e,i)=>{var s=i(66786),n=i(35893),r=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i,r(e)+a),t}},5198:(t,e,i)=>{var s=i(7702),n=i(26541),r=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},11879:(t,e,i)=>{var s=i(60461),n=[];n[s.BOTTOM_CENTER]=i(54312),n[s.BOTTOM_LEFT]=i(46768),n[s.BOTTOM_RIGHT]=i(35827),n[s.CENTER]=i(46871),n[s.LEFT_CENTER]=i(5198),n[s.RIGHT_CENTER]=i(80503),n[s.TOP_CENTER]=i(89698),n[s.TOP_LEFT]=i(922),n[s.TOP_RIGHT]=i(21373),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT],t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},80503:(t,e,i)=>{var s=i(7702),n=i(54380),r=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},89698:(t,e,i)=>{var s=i(35893),n=i(17717),r=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)+i),a(t,n(e)-o),t}},922:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)-i),a(t,n(e)-o),t}},21373:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)+i),a(t,n(e)-o),t}},91660:(t,e,i)=>{t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926:(t,e,i)=>{var s=i(60461),n=i(79291),r={In:i(91660),To:i(16694)};r=n(!1,r,s),t.exports=r},21578:(t,e,i)=>{var s=i(62235),n=i(35893),r=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,n(e)+i),a(t,s(e)+o),t}},10210:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,n(e)-i),a(t,s(e)+o),t}},82341:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,n(e)+i),a(t,s(e)+o),t}},87958:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},40080:(t,e,i)=>{var s=i(7702),n=i(26541),r=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)-i),r(t,s(e)+o),t}},88466:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)-i),a(t,n(e)-o),t}},38829:(t,e,i)=>{var s=i(60461),n=[];n[s.BOTTOM_CENTER]=i(21578),n[s.BOTTOM_LEFT]=i(10210),n[s.BOTTOM_RIGHT]=i(82341),n[s.LEFT_BOTTOM]=i(87958),n[s.LEFT_CENTER]=i(40080),n[s.LEFT_TOP]=i(88466),n[s.RIGHT_BOTTOM]=i(19211),n[s.RIGHT_CENTER]=i(34609),n[s.RIGHT_TOP]=i(48741),n[s.TOP_CENTER]=i(49440),n[s.TOP_LEFT]=i(81288),n[s.TOP_RIGHT]=i(61323),t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},19211:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},34609:(t,e,i)=>{var s=i(7702),n=i(54380),r=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,n(e)+i),r(t,s(e)+o),t}},48741:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),r(t,s(e)+i),a(t,n(e)-o),t}},49440:(t,e,i)=>{var s=i(35893),n=i(17717),r=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),r(t,n(e)-o),t}},81288:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),r(t,n(e)-o),t}},61323:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),r(t,n(e)-o),t}},16694:(t,e,i)=>{t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786:(t,e,i)=>{var s=i(88417),n=i(20786);t.exports=function(t,e,i){return s(t,e),n(t,i)}},62235:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=n(t),h=a(t);return e.x=i,e.y=h,e.width=r(t)-i,e.height=s(t)-h,e}},35893:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541:t=>{t.exports=function(t){return t.x-t.width*t.originX}},87431:t=>{t.exports=function(t){return t.width*t.originX}},46928:t=>{t.exports=function(t){return t.height*t.originY}},54380:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717:t=>{t.exports=function(t){return t.y-t.height*t.originY}},86327:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724:(t,e,i)=>{t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919:(t,e,i)=>{var s,n,r,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-r()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:r})},68703:t=>{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},isEnabled:function(t){return null!==i?t[i]:null}}},65208:t=>{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},91610:t=>{t.exports=function(t,e){return void 0===e&&(e="none"),["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},26253:(t,e,i)=>{t.exports={CanvasInterpolation:i(20623),CanvasPool:i(27919),Smoothing:i(68703),TouchAction:i(65208),UserSelect:i(91610)}},40987:(t,e,i)=>{var s=i(83419),n=i(37589),r=i(1e3),a=i(7537),o=i(87837),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=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(t,e,i,s)},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(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return a(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,a=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,a),this._rgba="rgba("+e+","+i+","+s+","+a/255+")",t&&o(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return o(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},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(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,a(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,a(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,a(this._h,this._s,t,this)}}});t.exports=h},92728:(t,e,i)=>{var s=i(37589);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,a=0,o=0;for(e=0;e<=n;e++)i.push({r,g:e,b:o,color:s(r,e,o)});for(a=255,e=n;e>=0;e--)i.push({r:e,g:a,b:o,color:s(e,a,o)});for(r=0,e=0;e<=n;e++,a--)i.push({r,g:a,b:e,color:s(r,a,e)});for(a=0,o=255,e=0;e<=n;e++,o--,r++)i.push({r,g:a,b:o,color:s(r,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e<t;e++)h.push(i[Math.floor(l)]),l+=u;return h}},91588:t=>{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},62183:(t,e,i)=>{var s=i(40987),n=i(89528);t.exports=function(t,e,i){var r=i,a=i,o=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),a=n(l,h,t),o=n(l,h,t-1/3)}return(new s).setGLTo(r,a,o,1)}},27939:(t,e,i)=>{var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},7537:(t,e,i)=>{var s=i(37589);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var a=n(5,t,e,i),o=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(a,o,h,r.alpha,!0):(r.r=a,r.g=o,r.b=h,r.color=s(a,o,h),r):{r:a,g:o,b:h,color:s(a,o,h)}}},70238:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(n,r,a)}return e}},89528:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100:(t,e,i)=>{var s=i(40987),n=i(90664);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},90664:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699:(t,e,i)=>{var s=i(28915),n=i(37589),r=function(t,e,i,r,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,c=s(t,r,u),d=s(e,a,u),f=s(i,o,u);return{r:c,g:d,b:f,a:255,color:n(c,d,f)}};t.exports={RGBWithRGB:r,ColorWithRGB:function(t,e,i,s,n,a){return void 0===n&&(n=100),void 0===a&&(a=0),r(t.r,t.g,t.b,e,i,s,n,a)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),r(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},68957:(t,e,i)=>{var s=i(40987);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},87388:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),a=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,a,255*o)}return e}},87837:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),a=r-n,o=0,h=0===r?0:a/r,l=r;return r!==n&&(r===t?o=(e-i)/a+(e<i?6:0):r===e?o=(i-t)/a+2:r===i&&(o=(t-e)/a+4),o/=6),s.hasOwnProperty("_h")?(s._h=o,s._s=h,s._v=l):(s.h=o,s.s=h,s.v=l),s}},75723:(t,e,i)=>{var s=i(62957);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},85386:(t,e,i)=>{var s=i(30976),n=i(40987);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},80333:(t,e,i)=>{var s=i(70238),n=i(30100),r=i(68957),a=i(87388);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?a(t):s(t);case"number":return n(t);case"object":return r(t)}}},3956:(t,e,i)=>{var s=i(40987);s.ColorSpectrum=i(92728),s.ColorToRGBA=i(91588),s.ComponentToHex=i(62957),s.GetColor=i(37589),s.GetColor32=i(1e3),s.HexStringToColor=i(70238),s.HSLToColor=i(62183),s.HSVColorWheel=i(27939),s.HSVToRGB=i(7537),s.HueToComponent=i(89528),s.IntegerToColor=i(30100),s.IntegerToRGB=i(90664),s.Interpolate=i(13699),s.ObjectToColor=i(68957),s.RandomRGB=i(85386),s.RGBStringToColor=i(87388),s.RGBToHSV=i(87837),s.RGBToString=i(75723),s.ValueToColor=i(80333),t.exports=s},27460:(t,e,i)=>{t.exports={Align:i(71926),BaseShader:i(73894),Bounds:i(58724),Canvas:i(26253),Color:i(3956),ColorMatrix:i(89422),Masks:i(69781),RGB:i(51767)}},6858:(t,e,i)=>{var s=i(83419),n=i(39429),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},80661:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount,a=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,a),s.stencilOp(s.KEEP,s.KEEP,s.INCR),r++):(s.stencilFunc(s.EQUAL,r+1,a),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=r,n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,a):s.stencilFunc(s.EQUAL,r,a)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},69781:(t,e,i)=>{t.exports={BitmapMask:i(6858),GeometryMask:i(80661)}},73894:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){e&&""!==e||(e=["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")),i&&""!==i||(i=["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===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},40366:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},83719:(t,e,i)=>{var s=i(40366);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},57264:(t,e,i)=>{var s=i(25892);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},57811:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},45818:(t,e,i)=>{var s=i(13560);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836:t=>{t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?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=n}});t.exports=r},84902:(t,e,i)=>{var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(37277),a=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",a,"events"),t.exports=a},93055:(t,e,i)=>{t.exports={EventEmitter:i(47565)}},20122:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e){void 0===e&&(e=1),n.call(this,r.BARREL,t),this.amount=e}});t.exports=a},32251:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a,o,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=4),n.call(this,r.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=a,this.strength=o,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},9047:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===a&&(a=1),void 0===h&&(h=4),n.call(this,r.BLUR,t),this.quality=e,this.x=i,this.y=s,this.steps=h,this.strength=a,this.glcolor=[1,1,1],null!=o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},27885:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===a&&(a=!1),void 0===o&&(o=1),void 0===h&&(h=1),void 0===l&&(l=1),n.call(this,r.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=a,this.strength=l,this.blurX=o,this.blurY=h}});t.exports=a},12578:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a,o){void 0===e&&(e=8),void 0===a&&(a=1),void 0===o&&(o=.005),n.call(this,r.CIRCLE,t),this.scale=a,this.feather=o,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(t){this.glcolor2[3]=t}}});t.exports=a},15802:(t,e,i)=>{var s=i(83419),n=i(89422),r=i(14811),a=new s({Extends:n,initialize:function(t){n.call(this),this.type=r.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=a},72898:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},44553:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),n.call(this,r.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=a},68531:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a){void 0===i&&(i=4),void 0===s&&(s=0),void 0===a&&(a=!1),n.call(this,r.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=a,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},37102:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a,o,h,l,u){void 0===s&&(s=.2),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),n.call(this,r.GRADIENT,t),this.alpha=s,this.size=u,this.fromX=a,this.fromY=o,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=a},86886:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e){void 0===e&&(e=1),n.call(this,r.PIXELATE,t),this.amount=e}});t.exports=a},92322:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===a&&(a=1),void 0===h&&(h=6),void 0===l&&(l=1),n.call(this,r.SHADOW,t),this.x=e,this.y=i,this.decay=s,this.power=a,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==o&&(this.color=o)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=a},39563:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=3),void 0===a&&(a=!1),n.call(this,r.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=s,this.reveal=a}});t.exports=a},56448:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===a&&(a=.5),n.call(this,r.VIGNETTE,t),this.x=e,this.y=i,this.radius=s,this.strength=a}});t.exports=a},38433:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),a=new s({Extends:n,initialize:function(t,e,i,s,a){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=!1),n.call(this,r.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=s,this.reveal=a}});t.exports=a},14811:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},66064:(t,e,i)=>{var s=i(79291),n=i(14811),r={Barrel:i(20122),Controller:i(72898),Bloom:i(32251),Blur:i(9047),Bokeh:i(27885),Circle:i(12578),ColorMatrix:i(15802),Displacement:i(44553),Glow:i(68531),Gradient:i(37102),Pixelate:i(86886),Shadow:i(92322),Shine:i(39563),Vignette:i(56448),Wipe:i(38433)};r=s(!1,r,n),t.exports=r},25305:(t,e,i)=>{var s=i(10312),n=i(23568);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var a=n(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=n(a,"x",1),e.scrollFactorY=n(a,"y",1)),e.rotation=n(i,"rotation",0);var o=n(i,"angle",null);null!==o&&(e.angle=o),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059:(t,e,i)=>{var s=i(23568);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var a=s(i,"startFrame",void 0),o=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),f={key:r,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};c?n.play(f):d>0?n.playAfterDelay(f,d):n.load(f)}}return t}},8050:(t,e,i)=>{var s=i(83419),n=i(73162),r=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},95643:(t,e,i)=>{var s=i(83419),n=i(53774),r=i(45893),a=i(50792),o=i(51708),h=i(44594),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,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(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(this.displayList&&this.displayList.active&&!this.displayList.willRender(t)||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),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.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},44603:(t,e,i)=>{var s=i(83419),n=i(37277),r=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectCreator",a,"make"),t.exports=a},39429:(t,e,i)=>{var s=i(83419),n=i(37277),r=i(44594),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectFactory",a,"add"),t.exports=a},91296:(t,e,i)=>{var s=i(61340),n=new s,r=new s,a=new s,o={camera:n,sprite:r,calc:a};t.exports=function(t,e,i){var s=n,h=r,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},45027:(t,e,i)=>{var s=i(83419),n=i(25774),r=i(37277),a=i(44594),o=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n<s;n++){var r=i[n];r.active&&r.preUpdate.call(r,t,e)}},shutdown:function(){for(var t=this._active.length;t--;)this._active[t].destroy(!0);for(t=this._pending.length;t--;)this._pending[t].destroy(!0);for(t=this._destroy.length;t--;)this._destroy[t].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var e=this.systems.events;e.off(a.PRE_UPDATE,this.update,this),e.off(a.UPDATE,this.sceneUpdate,this),e.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});r.register("UpdateList",o,"updateList"),t.exports=o},3217:t=>{t.exports=function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p){var g=i.x-e.displayOriginX+n,m=i.y-e.displayOriginY+r,v=g+i.w,y=m+i.h,x=a.a,w=a.b,b=a.c,T=a.d,S=a.e,E=a.f,A=g*x+m*b+S,C=g*w+m*T+E,M=g*x+y*b+S,_=g*w+y*T+E,R=v*x+y*b+S,P=v*w+y*T+E,L=v*x+m*b+S,F=v*w+m*T+E;o&&(A=Math.round(A),C=Math.round(C),M=Math.round(M),_=Math.round(_),R=Math.round(R),P=Math.round(P),L=Math.round(L),F=Math.round(F)),t.batchQuad(e,A,C,M,_,R,P,L,F,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,f,p)}},53048:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return{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 n,r,a,o=t.text,h=o.length,l=t.maxWidth,u=t.wordWrapCharCode,c=Number.MAX_VALUE,d=Number.MAX_VALUE,f=0,p=0,g=t.fontData.chars,m=t.fontData.lineHeight,v=t.letterSpacing,y=t.lineSpacing,x=0,w=0,b=0,T=null,S=t._align,E=0,A=0,C=t.fontSize/t.fontData.size,M=C*t.scaleX,_=C*t.scaleY,R=null,P=0,L=[],F=Number.MAX_VALUE,O=0,D=0,k=0,I=[],B=[],N=null,Y=function(t,e){for(var i=0,s=0;s<t.length;s++){var n=t.charCodeAt(s),r=e.chars[n];r&&(i+=r.xAdvance)}return i*M};if(l>0){a=o.split("\n");var X=[];for(n=0;n<a.length;n++){var U=a[n],z="",G="",V="",W="";for(r=0;r<U.length;r++)b=U.charCodeAt(r),z+=U[r],(b===u||r===U.length-1)&&(Y(W=V+z,t.fontData)<=l?V=W:(G=G.slice(0,-1),G+=(G?"\n":"")+V,V=z),z="");G=G.slice(0,-1),G+=(G?"\n":"")+V,X.push(G)}o=X.join("\n"),s.wrappedText=o,h=o.length}var H=0;for(n=0;n<h;n++)if(10!==(b=o.charCodeAt(n))){if(T=g[b]){if(E=x,A=w,null!==R){var j=T.kerning[P];E+=void 0!==j?j:0}c>E&&(c=E),d>A&&(d=A);var q=E+T.xAdvance,K=A+m;f<q&&(f=q),p<K&&(p=K);var Z=T.xOffset+T.xAdvance+(void 0!==j?j:0);b===u?null!==N&&(I.push({word:N.word,i:N.i,x:N.x*M,y:N.y*_,w:N.w*M,h:N.h*_}),N=null):(null===N&&(N={word:"",i:H,x,y:w,w:0,h:m}),N.word=N.word.concat(o[n]),N.w+=Z),B.push({i:H,idx:n,char:o[n],code:b,x:(T.xOffset+E)*C,y:(T.yOffset+w)*C,w:T.width*C,h:T.height*C,t:w*C,r:q*C,b:m*C,line:D,glyph:T}),x+=T.xAdvance+v+(void 0!==j?j:0),R=T,P=b,k=q*C,H++}}else null!==N&&(I.push({word:N.word,i:N.i,x:N.x*M,y:N.y*_,w:N.w*M,h:N.h*_}),N=null),R=null,L[D]=k,k>O&&(O=k),k<F&&(F=k),k=0,x=0,w=(m+y)*++D;if(null!==N&&I.push({word:N.word,i:N.i,x:N.x*M,y:N.y*_,w:N.w*M,h:N.h*_}),L[D]=k,k>O&&(O=k),k<F&&(F=k),S>0)for(var Q=0;Q<B.length;Q++){var J=B[Q];if(1===S){var $=(O-L[J.line])/2;J.x+=$,J.r+=$}else if(2===S){var tt=O-L[J.line];J.x+=tt,J.r+=tt}}var et=s.local,it=s.global;return a=s.lines,et.x=c*C,et.y=d*C,et.width=f*C,et.height=p*C,it.x=t.x-t._displayOriginX+c*M,it.y=t.y-t._displayOriginY+d*_,it.width=f*M,it.height=p*_,a.shortest=F,a.longest=O,a.lengths=L,e&&(et.x=Math.ceil(et.x),et.y=Math.ceil(et.y),et.width=Math.ceil(et.width),et.height=Math.ceil(et.height),it.x=Math.ceil(it.x),it.y=Math.ceil(it.y),it.width=Math.ceil(it.width),it.height=Math.ceil(it.height),a.shortest=Math.ceil(F),a.longest=Math.ceil(O)),i&&(t._displayOriginX=t.originX*et.width,t._displayOriginY=t.originY*et.height,it.x=t.x-t._displayOriginX*t.scaleX,it.y=t.y-t._displayOriginY*t.scaleY,e&&(it.x=Math.ceil(it.x),it.y=Math.ceil(it.y))),s.words=I,s.characters=B,s.lines.height=m,s.scale=C,s.scaleX=t.scaleX,s.scaleY=t.scaleY,s}},61327:(t,e,i)=>{var s=i(21859);t.exports=function(t,e,i,n,r,a,o){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,a,o,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},6925:(t,e,i)=>{var s=i(35154);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),a=Math.floor(n/2),o=s(e,"chars","");if(""!==o){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,f=l.source.height,p=s(e,"offset.x",0),g=s(e,"offset.y",0),m=s(e,"spacing.x",0),v=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>o.length&&(x=o.length);for(var w=p,b=g,T={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},S=0,E=0;E<o.length;E++){var A=o.charCodeAt(E),C=(u+w)/d,M=(c+b)/f,_=(u+w+i)/d,R=(c+b+n)/f;T.chars[A]={x:w,y:b,width:i,height:n,centerX:r,centerY:a,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{},u0:C,v0:M,u1:_,v1:R},++S===x?(S=0,w=p,b+=n+v):w+=i+m}return{data:T,frame:null,texture:h}}}},21859:t=>{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var a=i.cutX,o=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],f=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(f,"lineHeight")+n,c.chars={};var p=t.getElementsByTagName("char"),g=void 0!==i&&i.trimmed;if(g)var m=i.height,v=i.width;for(var y=0;y<p.length;y++){var x=p[y],w=e(x,"id"),b=String.fromCharCode(w),T=e(x,"x"),S=e(x,"y"),E=e(x,"width"),A=e(x,"height");g&&(T<v&&(v=T),S<m&&(m=S)),g&&0!==m&&0!==v&&(T-=i.x,S-=i.y);var C=(a+T)/h,M=(o+S)/l,_=(a+T+E)/h,R=(o+S+A)/l;if(c.chars[w]={x:T,y:S,width:E,height:A,centerX:Math.floor(E/2),centerY:Math.floor(A/2),xOffset:e(x,"xoffset"),yOffset:e(x,"yoffset"),xAdvance:e(x,"xadvance")+s,data:{},kerning:{},u0:C,v0:M,u1:_,v1:R},r&&0!==E&&0!==A){var P=r.add(b,u,T,S,E,A);P&&P.setUVs(E,A,C,M,_,R)}}var L=t.getElementsByTagName("kerning");for(y=0;y<L.length;y++){var F=L[y],O=e(F,"first"),D=e(F,"second"),k=e(F,"amount");c.chars[D].kerning[O]=k}return c}},196:(t,e,i)=>{var s=i(87662),n=i(79291),r={Parse:i(6925)};r=n(!1,r,s),t.exports=r},87662:t=>{t.exports={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"}},2638:(t,e,i)=>{var s=i(22186),n=i(83419),r=i(12310),a=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,a,o){s.call(this,t,e,i,n,r,a,o),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(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741:(t,e,i)=>{var s=i(20926);t.exports=function(t,e,i,n){var r=e._text,a=r.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,f=e._letterSpacing,p=0,g=0,m=0,v=null,y=0,x=0,w=0,b=0,T=0,S=0,E=null,A=0,C=e.frame.source.image,M=h.cutX,_=h.cutY,R=0,P=0,L=e._fontSize/e.fontData.size,F=e._align,O=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===F?D=(k.longest-k.lengths[0])/2:2===F&&(D=k.longest-k.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B<a;B++)if(P=L,R=0,10!==(m=r.charCodeAt(B))){if(v=c[m]){if(y=M+v.x,x=_+v.y,w=v.width,b=v.height,T=v.xOffset+p-e.scrollX,S=v.yOffset+g-e.scrollY,null!==E){var N=v.kerning[A];T+=void 0!==N?N:0}if(l){u.index=B,u.charCode=m,u.x=T,u.y=S,u.scale=P,u.rotation=R,u.data=v.data;var Y=l(u);T=Y.x,S=Y.y,P=Y.scale,R=Y.rotation}T*=P,S*=P,T+=D,p+=v.xAdvance+f+(void 0!==N?N:0),E=v,A=m,0!==w&&0!==b&&32!==m&&(I&&(T=Math.round(T),S=Math.round(S)),o.save(),o.translate(T,S),o.rotate(R),o.scale(P,P),o.drawImage(C,y,x,w,b,0,0,w,b),o.restore())}}else O++,1===F?D=(k.longest-k.lengths[O])/2:2===F&&(D=k.longest-k.lengths[O]),p=0,g+=d,E=null;o.restore()}}},11164:(t,e,i)=>{var s=i(2638),n=i(25305),r=i(44603),a=i(23568);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=a(t,"text",""),o=a(t,"size",!1),h=new s(this.scene,0,0,i,r,o);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},72566:(t,e,i)=>{var s=i(2638);i(39429).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},12310:(t,e,i)=>{var s,n,r=i(29747);s=i(73482),n=i(86741),t.exports={renderWebGL:s,renderCanvas:n}},73482:(t,e,i)=>{var s=i(91296),n=i(61340),r=i(70554),a=new n;t.exports=function(t,e,i,n){var o=e.text,h=o.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n);t.pipelines.preBatch(e);var c=u.sprite,d=u.calc,f=a,p=e.cropWidth>0||e.cropHeight>0;p&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var g,m,v=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),w=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),b=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),T=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),S=l.setGameObject(e),E=0,A=0,C=0,M=0,_=e.letterSpacing,R=0,P=0,L=e.scrollX,F=e.scrollY,O=e.fontData,D=O.chars,k=O.lineHeight,I=e.fontSize/O.size,B=0,N=e._align,Y=0,X=0,U=e.getTextBounds(!1);e.maxWidth>0&&(h=(o=U.wrappedText).length);var z=e._bounds.lines;1===N?X=(z.longest-z.lengths[0])/2:2===N&&(X=z.longest-z.lengths[0]);for(var G=i.roundPixels,V=e.displayCallback,W=e.callbackData,H=0;H<h;H++)if(10!==(C=o.charCodeAt(H))){if(g=D[C]){R=g.width,P=g.height;var j=g.xOffset+E-L,q=g.yOffset+A-F;if(null!==m){var K=g.kerning[M]||0;j+=K,E+=K}if(E+=g.xAdvance+_,m=g,M=C,0!==R&&0!==P&&32!==C){if(I=e.fontSize/e.fontData.size,B=0,V){W.color=0,W.tint.topLeft=x,W.tint.topRight=w,W.tint.bottomLeft=b,W.tint.bottomRight=T,W.index=H,W.charCode=C,W.x=j,W.y=q,W.scale=I,W.rotation=B,W.data=g.data;var Z=V(W);j=Z.x,q=Z.y,I=Z.scale,B=Z.rotation,Z.color?(x=Z.color,w=Z.color,b=Z.color,T=Z.color):(x=Z.tint.topLeft,w=Z.tint.topRight,b=Z.tint.bottomLeft,T=Z.tint.bottomRight),x=r.getTintAppendFloatAlpha(x,i.alpha*e._alphaTL),w=r.getTintAppendFloatAlpha(w,i.alpha*e._alphaTR),b=r.getTintAppendFloatAlpha(b,i.alpha*e._alphaBL),T=r.getTintAppendFloatAlpha(T,i.alpha*e._alphaBR)}j*=I,q*=I,j-=e.displayOriginX,q-=e.displayOriginY,j+=X,f.applyITRS(j,q,B,I,I),d.multiply(f,c);var Q=g.u0,J=g.v0,$=g.u1,tt=g.v1,et=R,it=P,st=c.e,nt=c.f,rt=it*c.c+c.e,at=it*c.d+c.f,ot=et*c.a+it*c.c+c.e,ht=et*c.b+it*c.d+c.f,lt=et*c.a+c.e,ut=et*c.b+c.f;G&&(st=Math.round(st),nt=Math.round(nt),rt=Math.round(rt),at=Math.round(at),ot=Math.round(ot),ht=Math.round(ht),lt=Math.round(lt),ut=Math.round(ut)),l.shouldFlush(6)&&(l.flush(),S=l.setGameObject(e)),l.batchQuad(e,st,nt,rt,at,ot,ht,lt,ut,Q,J,$,tt,x,w,b,T,y,v,S)}}}else Y++,1===N?X=(z.longest-z.lengths[Y])/2:2===N&&(X=z.longest-z.lengths[Y]),E=0,A+=k,m=null;p&&(l.flush(),t.popScissor()),t.pipelines.postBatch(e)}}},22186:(t,e,i)=>{var s=i(83419),n=i(45319),r=i(31401),a=i(95643),o=i(53048),h=i(61327),l=i(21859),u=i(87841),c=i(18658),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),a.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);if(!l)throw new Error("Invalid BitmapText key: "+s);this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=h,this._bounds=o(),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=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setLineSpacing:function(t){return void 0===t&&(t=0),this.lineSpacing=t,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,a,o){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,a=s,o=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c<l;c++){var d=u[c];if(-1===s)u[c]=null;else{var f=i?1:0;d?(d.tintEffect=f,d.tintTL=s,d.tintTR=r,d.tintBL=a,d.tintBR=o):u[c]={tintEffect:f,tintTL:s,tintTR:r,tintBL:a,tintBR:o}}}return this},setWordTint:function(t,e,i,s,n,r,a){void 0===e&&(e=1);for(var o=this.getTextBounds().words,h="number"==typeof t,l=0,u=0;u<o.length;u++){var c=o[u];if((h&&u===t||!h&&c.word===t)&&(this.setCharacterTint(c.i,c.word.length,i,s,n,r,a),++l===e))return this}return this},getTextBounds:function(t){var e=this._bounds;return(this._dirty||t||this.scaleX!==e.scaleX||this.scaleY!==e.scaleY)&&(o(this,t,!0,e),this._dirty=!1),e},getCharacterAt:function(t,e,i){for(var s=this.getLocalPoint(t,e,null,i),n=this.getTextBounds().characters,r=new u,a=0;a<n.length;a++){var o=n[a];if(r.setTo(o.x,o.t,o.r-o.x,o.b),r.contains(s.x,s.y))return o}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(t,e,i){void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align);var s=this.scene.sys.cache.bitmapFont.get(t);return s&&(this.font=t,this.fontData=s.data,this._fontSize=e,this._align=i,this.fromAtlas=!0===s.fromAtlas,this.setTexture(s.texture,s.frame),o(this,!1,!0,this._bounds)),this},setMaxWidth:function(t,e){return this._maxWidth=t,this._dirty=!0,void 0!==e&&(this.wordWrapCharCode=e),this},setDisplaySize:function(t,e){this.setScale(1,1),this.getTextBounds(!1);var i=t/this.width,s=e/this.height;return this.setScale(i,s),this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},lineSpacing:{set:function(t){this._lineSpacing=t,this._dirty=!0},get:function(){return this._lineSpacing}},maxWidth:{set:function(t){this._maxWidth=t,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}},displayWidth:{set:function(t){this.setScaleX(1),this.getTextBounds(!1);var e=t/this.width;this.setScaleX(e)},get:function(){return this.width}},displayHeight:{set:function(t){this.setScaleY(1),this.getTextBounds(!1);var e=t/this.height;this.setScaleY(e)},get:function(){return this.height}},toJSON:function(){var t=r.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineSpacing:this.lineSpacing,align:this.align};return t.data=e,t},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});d.ALIGN_LEFT=0,d.ALIGN_CENTER=1,d.ALIGN_RIGHT=2,d.ParseFromAtlas=h,d.ParseXMLBitmapFont=l,t.exports=d},37289:(t,e,i)=>{var s=i(20926);t.exports=function(t,e,i,n){var r=e._text,a=r.length,o=t.currentContext;if(0!==a&&s(t,o,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=e._lineSpacing,f=0,p=0,g=0,m=null,v=0,y=0,x=0,w=0,b=0,T=0,S=null,E=0,A=h.source.image,C=h.cutX,M=h.cutY,_=e._fontSize/e.fontData.size,R=e._align,P=0,L=0,F=e.getTextBounds(!1);e.maxWidth>0&&(a=(r=F.wrappedText).length);var O=e._bounds.lines;1===R?L=(O.longest-O.lengths[0])/2:2===R&&(L=O.longest-O.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,k=0;k<a;k++)if(10!==(g=r.charCodeAt(k))){if(m=l[g]){if(v=C+m.x,y=M+m.y,x=m.width,w=m.height,b=m.xOffset+f,T=m.yOffset+p,null!==S){var I=m.kerning[E];b+=void 0!==I?I:0}b*=_,T*=_,b+=L,f+=m.xAdvance+c+(void 0!==I?I:0),S=m,E=g,0!==x&&0!==w&&32!==g&&(D&&(b=Math.round(b),T=Math.round(T)),o.save(),o.translate(b,T),o.scale(_,_),o.drawImage(A,v,y,x,w,0,0,x,w),o.restore())}}else P++,1===R?L=(O.longest-O.lengths[P])/2:2===R&&(L=O.longest-O.lengths[P]),f=0,p+=u+d,S=null;o.restore()}}},57336:(t,e,i)=>{var s=i(22186),n=i(25305),r=i(44603),a=i(23568),o=i(35154);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=a(t,"text",""),h=a(t,"size",!1),l=o(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},34914:(t,e,i)=>{var s=i(22186);i(39429).register("bitmapText",(function(t,e,i,n,r,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,a))}))},18658:(t,e,i)=>{var s,n,r=i(29747);s=i(33590),n=i(37289),t.exports={renderWebGL:s,renderCanvas:n}},33590:(t,e,i)=>{var s=i(3217),n=i(91296),r=i(70554);t.exports=function(t,e,i,a){if(0!==e._text.length){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),h=n(e,i,a).calc;t.pipelines.preBatch(e);var l,u,c,d=i.roundPixels,f=i.alpha,p=e.charColors,g=e.tintFill,m=r.getTintAppendFloatAlpha,v=m(e.tintTopLeft,f*e._alphaTL),y=m(e.tintTopRight,f*e._alphaTR),x=m(e.tintBottomLeft,f*e._alphaBL),w=m(e.tintBottomRight,f*e._alphaBR),b=e.frame.glTexture,T=o.setGameObject(e),S=e.getTextBounds(!1).characters,E=e.dropShadowX,A=e.dropShadowY;if(0!==E||0!==A){var C=e.dropShadowColor,M=e.dropShadowAlpha,_=m(C,f*M*e._alphaTL),R=m(C,f*M*e._alphaTR),P=m(C,f*M*e._alphaBL),L=m(C,f*M*e._alphaBR);for(l=0;l<S.length;l++)c=(u=S[l]).glyph,32!==u.code&&0!==c.width&&0!==c.height&&s(o,e,u,c,E,A,h,d,_,R,P,L,1,b,T)}for(l=0;l<S.length;l++)if(c=(u=S[l]).glyph,32!==u.code&&0!==c.width&&0!==c.height)if(o.shouldFlush(6)&&(o.flush(),T=o.setGameObject(e)),p[u.i]){var F=p[u.i],O=F.tintEffect,D=m(F.tintTL,f*e._alphaTL),k=m(F.tintTR,f*e._alphaTR),I=m(F.tintBL,f*e._alphaBL),B=m(F.tintBR,f*e._alphaBR);s(o,e,u,c,0,0,h,d,D,k,I,B,O,b,T)}else s(o,e,u,c,0,0,h,d,v,y,x,w,g,b,T);t.pipelines.postBatch(e)}}},6107:(t,e,i)=>{var s=i(48011),n=i(46590),r=i(83419),a=i(31401),o=i(4327),h=i(95643),l=i(73162),u=new r({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Size,a.Texture,a.Transform,a.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof o||(i=this.texture.get(i));var a=new n(this,t,e,i,s);return this.children.addAt(a,r,!1),this.dirty=!0,a},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r<n.length;r++){var a=n[r];t.call(this,a,r)}return n},createMultiple:function(t,e,i){void 0===e&&(e=this.frame.name),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);var s=[],n=this;return e.forEach((function(e){for(var r=0;r<t;r++)s.push(n.create(0,0,e,i))})),s},childCanRender:function(t){return t.visible&&t.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=[]}});t.exports=u},72396:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u<n.length;u++){var c=n[u],d=c.flipX||c.flipY,f=c.frame,p=f.canvasData,g=f.x,m=f.y,v=1,y=1,x=c.alpha*a;0!==x&&(r.globalAlpha=x,d?(c.flipX&&(v=-1,g-=p.width),c.flipY&&(y=-1,m-=p.height),p.width>0&&p.height>0&&(r.save(),r.translate(c.x+o,c.y+h),r.scale(v,y),r.drawImage(f.source.image,p.x,p.y,p.width,p.height,g,m,p.width,p.height),r.restore())):(l&&(g=Math.round(g),m=Math.round(m)),p.width>0&&p.height>0&&r.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+c.x+o,m+c.y+h,p.width,p.height)))}r.restore()}}}},9403:(t,e,i)=>{var s=i(6107),n=i(25305),r=i(44603),a=i(23568);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),r=a(t,"frame",null),o=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,o,t),o}))},12709:(t,e,i)=>{var s=i(6107);i(39429).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},48011:(t,e,i)=>{var s,n,r=i(29747);s=i(99485),n=i(72396),t.exports={renderWebGL:s,renderCanvas:n}},99485:(t,e,i)=>{var s=i(61340),n=i(70554),r=new s;t.exports=function(t,e,i,s){var a=e.getRenderList(),o=i.alpha*e.alpha;if(0!==a.length&&0!==o){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,f=e.y-u,p=-1,g=i.roundPixels;t.pipelines.preBatch(e);for(var m=0;m<a.length;m++){var v=a[m],y=v.frame,x=v.alpha*o;if(0!==x){var w=y.width,b=y.height,T=d+v.x+y.x,S=f+v.y+y.y;v.flipX&&(w*=-1,T+=y.width),v.flipY&&(b*=-1,S+=y.height);var E=c.setQuad(T,S,T+w,S+b,g),A=n.getTintAppendFloatAlpha(v.tint,x);if(y.sourceIndex!==p){var C=h.setGameObject(e,y);p=y.sourceIndex}h.batchQuad(e,E[0],E[1],E[2],E[3],E[4],E[5],E[6],E[7],y.u0,y.v0,y.u1,y.v1,A,A,A,A,!1,y.glTexture,C)&&(p=-1)}}t.pipelines.postBatch(e)}}},46590:(t,e,i)=>{var s=i(83419),n=i(4327),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,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(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},16005:(t,e,i)=>{var s=i(45319),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},88509:(t,e,i)=>{var s=i(45319),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},90065:(t,e,i)=>{var s=i(10312),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},94215:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683:t=>{t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.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,ch:0}}}},89272:(t,e,i)=>{var s=i(37105),n={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){var t=this.getDisplayList();return t&&s.BringToTop(t,this),this},setToBack:function(){var t=this.getDisplayList();return t&&s.SendToBack(t,this),this},setAbove:function(t){var e=this.getDisplayList();return e&&t&&s.MoveAbove(e,this,t),this},setBelow:function(t){var e=this.getDisplayList();return e&&t&&s.MoveBelow(e,this,t),this}};t.exports=n},47059:(t,e,i)=>{var s=i(83419),n=i(66064),r=i(19133),a=new s({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e<t.length;e++)t[e].destroy();this.list=[]}return this.enabled=!1,this.gameObject},remove:function(t){var e;if(this.isPost){var i=this.gameObject.getPostPipeline(String(t.type));for(Array.isArray(i)||(i=[i]),e=0;e<i.length;e++){var s=i[e];if(s.controller===t){this.gameObject.removePostPipeline(s),t.destroy();break}}}else{var n=this.list;for(e=0;e<n.length;e++)n[e]===t&&(r(n,e),t.destroy())}return this.gameObject},disable:function(t){return void 0===t&&(t=!1),this.isPost||this.gameObject.resetPipeline(),this.enabled=!1,t&&this.clear(),this.gameObject},add:function(t,e){if(!this.isPost)return this.enabled||this.enable(),this.list.push(t),t;var i=String(t.type);this.gameObject.setPostPipeline(i,e);var s=this.gameObject.getPostPipeline(i);return s?(Array.isArray(s)&&(s=s.pop()),s&&(s.controller=t),t):void 0},addGlow:function(t,e,i,s,r,a){return this.add(new n.Glow(this.gameObject,t,e,i,s),{quality:r,distance:a})},addShadow:function(t,e,i,s,r,a,o){return this.add(new n.Shadow(this.gameObject,t,e,i,s,r,a,o))},addPixelate:function(t){return this.add(new n.Pixelate(this.gameObject,t))},addVignette:function(t,e,i,s){return this.add(new n.Vignette(this.gameObject,t,e,i,s))},addShine:function(t,e,i,s){return this.add(new n.Shine(this.gameObject,t,e,i,s))},addBlur:function(t,e,i,s,r,a){return this.add(new n.Blur(this.gameObject,t,e,i,s,r,a))},addGradient:function(t,e,i,s,r,a,o,h){return this.add(new n.Gradient(this.gameObject,t,e,i,s,r,a,o,h))},addBloom:function(t,e,i,s,r,a){return this.add(new n.Bloom(this.gameObject,t,e,i,s,r,a))},addColorMatrix:function(){return this.add(new n.ColorMatrix(this.gameObject))},addCircle:function(t,e,i,s,r){return this.add(new n.Circle(this.gameObject,t,e,i,s,r))},addBarrel:function(t){return this.add(new n.Barrel(this.gameObject,t))},addDisplacement:function(t,e,i){return this.add(new n.Displacement(this.gameObject,t,e,i))},addWipe:function(t,e,i){return this.add(new n.Wipe(this.gameObject,t,e,i))},addReveal:function(t,e,i){return this.add(new n.Wipe(this.gameObject,t,e,i,!0))},addBokeh:function(t,e,i){return this.add(new n.Bokeh(this.gameObject,t,e,i))},addTiltShift:function(t,e,i,s,r,a){return this.add(new n.Bokeh(this.gameObject,t,e,i,!0,s,r,a))},destroy:function(){this.clear(),this.gameObject=null}});t.exports=a},54434:t=>{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},8004:(t,e,i)=>{var s=i(87841),n=i(11520),r=i(26099),a={prepareBoundsOutput:function(t,e){return void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t,e){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,a,h),t.y=Math.min(i,r,o,l),t.width=Math.max(e,n,a,h)-t.x,t.height=Math.max(i,r,o,l)-t.y,t}};t.exports=a},8573:(t,e,i)=>{var s=i(6858),n=i(80661),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t,e,i,n,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,n,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new n(this.scene,t)}};t.exports=r},27387:t=>{t.exports={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,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(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}}},37640:(t,e,i)=>{var s=i(39506),n=i(57355),r=i(35154),a=i(86353),o=i(26099),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(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=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t&&t.data){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},72699:(t,e,i)=>{var s=i(62644),n={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var a=r.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return null===this.pipeline?null:this.pipeline.name}};t.exports=n},17581:(t,e,i)=>{var s=i(62644),n=i(47059),r=i(19133),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new n(this,!0),t&&(this.preFX=new n(this,!1))},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var a=0;a<t.length;a++){var o=r.getPostPipeline(t[a],this,e);o&&this.postPipelines.push(o)}e&&(this.postPipelineData=i?s(e):e)}return this.hasPostPipeline=this.postPipelines.length>0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],n=0;n<i.length;n++){var r=i[n];(e&&r.name===t||!e&&r instanceof t)&&s.push(r)}return 1===s.length?s[0]:s},resetPostPipeline:function(t){void 0===t&&(t=!1);for(var e=this.postPipelines,i=0;i<e.length;i++)e[i].destroy();this.postPipelines=[],this.hasPostPipeline=!1,t&&(this.postPipelineData={})},removePostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=i.length-1;s>=0;s--){var n=i[s];(e&&n.name===t||!e&&n===t)&&(n.destroy(),r(i,s))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=a},80227:t=>{t.exports={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}}},16736:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},37726:(t,e,i)=>{var s=i(4327),n={texture:null,frame:null,isCropped:!1,setTexture:function(t,e,i,s){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e,i,s)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=n},79812:(t,e,i)=>{var s=i(4327),n={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(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,ch:0}}};t.exports=n},27472:t=>{t.exports={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}}},53774:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},16901:(t,e,i)=>{var s=i(36383),n=i(61340),r=i(85955),a=i(86554),o=i(30954),h=i(26099),l={hasTransformComponent:!0,_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(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);var s=!1;for(e||(e=new n,s=!0),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return s&&e.destroy(),t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,a=s.scrollY,o=t+n*this.scrollFactorX-n,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):r(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getWorldPoint:function(t,e,i){if(void 0===t&&(t=new h),!this.parentContainer)return t.x=this.x,t.y=this.y,t;var s=this.getWorldTransformMatrix(e,i);return t.x=s.tx,t.y=s.ty,t},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},61340:(t,e,i)=>{var s=i(83419),n=i(36383),r=i(26099),a=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/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 t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3];return s[0]=n*i+a*e,s[1]=r*i+o*e,s[2]=n*-e+a*i,s[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5],m=void 0===e?i:e.matrix;return m[0]=u*n+c*a,m[1]=u*r+c*o,m[2]=d*n+f*a,m[3]=d*r+f*o,m[4]=p*n+g*a+h,m[5]=p*r+g*o+l,m},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=e*r+i*o+s[4],u=e*a+i*h+s[5],c=n[0],d=n[1],f=n[2],p=n[3],g=n[4],m=n[5];return s[0]=c*r+d*o,s[1]=c*a+d*h,s[2]=f*r+p*o,s[3]=f*a+p*h,s[4]=g*r+m*o+l,s[5]=g*a+m*h+u,this},transform:function(t,e,i,s,n,r){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+s*l,a[3]=i*h+s*u,a[4]=n*o+r*l+c,a[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*n+e*a+h,i.y=t*r+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=e*n-i*s;return t[0]=n/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-n*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*s,r[1]=a*s,r[2]=-a*n,r[3]=o*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+o*-a);return i.x=h*c*t+-o*c*e+(u*o-l*h)*c,i.y=n*c*e+-a*c*t+(-u*n+l*a)*c,i},setQuad:function(t,e,i,s,n,r){void 0===n&&(n=!1),void 0===r&&(r=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],d=a[5],f=t*o+e*l+c,p=t*h+e*u+d,g=t*o+s*l+c,m=t*h+s*u+d,v=i*o+s*l+c,y=i*h+s*u+d,x=i*o+e*l+c,w=i*h+e*u+d;if(n){var b=Math.floor(f+.5),T=Math.floor(p+.5),S=b-f,E=T-p;r[0]=b,r[1]=T,r[2]=g+S,r[3]=m+E,r[4]=v+S,r[5]=y+E,r[6]=x+S,r[7]=w+E}else r[0]=f,r[1]=p,r[2]=g,r[3]=m,r[4]=v,r[5]=y,r[6]=x,r[7]=w;return r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.floor(s+.5)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.floor(s+.5)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715:t=>{t.exports={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}}},31401:(t,e,i)=>{t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),Flip:i(54434),FX:i(47059),GetBounds:i(8004),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),Pipeline:i(72699),PostPipeline:i(17581),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559:(t,e,i)=>{var s=i(37105),n=i(10312),r=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),c=i(36899),d=i(26099),f=new a.TransformMatrix,p=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},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(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r<i.length;r++){var a=i[r];a.getBounds&&(a.getBounds(s),n?c(s,t,t):(t.setTo(s.x,s.y,s.width,s.height),n=!0))}}return t},addHandler:function(t){t.once(o.DESTROY,this.onChildDestroyed,this),this.exclusive&&(t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this,t.removeFromDisplayList(),t.addedToScene())},removeHandler:function(t){t.off(o.DESTROY,this.remove,this),this.exclusive&&(t.parentContainer=null,t.removedFromScene(),t.addToDisplayList())},pointToContainer:function(t,e){void 0===e&&(e=new d),this.parentContainer?this.parentContainer.pointToContainer(t,e):(e.x=t.x,e.y=t.y);var i=f;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(f,this.localTransform)},add:function(t){return s.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return s.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),s.StableSort(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e,i,n){return s.CountAllMatching(this.list,t,e,i,n)},swap:function(t,e){return s.Swap(this.list,t,e),this},moveTo:function(t,e){return s.MoveTo(this.list,t,e),this},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e),this},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e),this},remove:function(t,e){var i=s.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var n=0;n<i.length;n++)i[n].destroy()}return this},removeAt:function(t,e){var i=s.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var n=s.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var r=0;r<n.length;r++)n[r].destroy();return this},removeAll:function(t){var e=this.list;if(t){for(var i=0;i<e.length;i++)e[i]&&e[i].scene&&(e[i].off(o.DESTROY,this.onChildDestroyed,this),e[i].destroy());this.list=[]}else s.RemoveBetween(e,0,e.length,this.removeHandler,this);return this},bringToTop:function(t){return s.BringToTop(this.list,t),this},sendToBack:function(t){return s.SendToBack(this.list,t),this},moveUp:function(t){return s.MoveUp(this.list,t),this},moveDown:function(t){return s.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e,i){return s.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i<arguments.length;i++)s.push(arguments[i]);for(i=0;i<r;i++)s[0]=n[i],t.apply(e,s);return this},iterate:function(t,e){var i,s=[null];for(i=2;i<arguments.length;i++)s.push(arguments[i]);for(i=0;i<this.list.length;i++)s[0]=this.list[i],t.apply(e,s);return this},setScrollFactor:function(t,e,i){return void 0===e&&(e=t),void 0===i&&(i=!1),this.scrollFactorX=t,this.scrollFactorY=e,i&&(s.SetAll(this.list,"scrollFactorX",t),s.SetAll(this.list,"scrollFactorY",e)),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.list=[]},onChildDestroyed:function(t){s.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=p},53584:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u<n.length;u++){var c=n[u];if(c.willRender(i)){var d=c.alpha,f=c.scrollFactorX,p=c.scrollFactorY;a||c.blendMode===t.currentBlendMode||t.setBlendMode(c.blendMode),c.setScrollFactor(f*h,p*l),c.setAlpha(d*o),c.renderCanvas(t,c,i,r),c.setAlpha(d),c.setScrollFactor(f,p)}}e.mask&&e.mask.postRenderCanvas(t)}}},77143:(t,e,i)=>{var s=i(25305),n=i(31559),r=i(44603),a=i(23568),o=i(95540);r.register("container",(function(t,e){void 0===t&&(t={});var i=a(t,"x",0),r=a(t,"y",0),h=o(t,"children",null),l=new n(this.scene,i,r,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},24961:(t,e,i)=>{var s=i(31559);i(39429).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},29959:(t,e,i)=>{var s,n,r=i(29747);s=i(72249),n=i(53584),t.exports={renderWebGL:s,renderCanvas:n}},72249:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c<r;c++){var d=n[c];if(d.willRender(i)){var f,p,g,m;if(void 0!==d.alphaTopLeft)f=d.alphaTopLeft,p=d.alphaTopRight,g=d.alphaBottomLeft,m=d.alphaBottomRight;else{var v=d.alpha;f=v,p=v,g=v,m=v}var y=d.scrollFactorX,x=d.scrollFactorY;o||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode);var w=d.mask;w&&w.preRenderWebGL(t,d,i);var b=d.type;b!==t.currentType&&(t.newType=!0,t.currentType=b),t.nextTypeMatch=c<r-1&&n[c+1].type===t.currentType,d.setScrollFactor(y*l,x*u),d.setAlpha(f*h,p*h,g*h,m*h),d.renderWebGL(t,d,i,a,e),d.setAlpha(f,p,g,m),d.setScrollFactor(y,x),w&&w.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},47407:t=>{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(441),a=i(95643),o=i(41212),h=i(35846),l=i(44594),u=i(61369),c=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){if(a.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,!this.parent)throw new Error("No DOM Container set in game config");this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,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(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.addEventListener(t[e],this.handler,!1)}return this},removeListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.removeEventListener(t[e],this.handler)}return this},dispatchNativeEvent:function(t){this.emit(t.type,t)},createElement:function(t,e,i){return this.setElement(document.createElement(t),e,i)},setElement:function(t,e,i){var s;if(this.removeElement(),"string"==typeof t?("#"===t[0]&&(t=t.substr(1)),s=document.getElementById(t)):"object"==typeof t&&1===t.nodeType&&(s=t),!s)return this;if(this.node=s,e&&o(e))for(var n in e)s.style[n]=e[n];else"string"==typeof e&&(s.style=e);return s.style.zIndex="0",s.style.display="inline",s.style.position="absolute",s.phaser=this,this.parent.appendChild(s),i&&(s.innerText=i),this.updateSize()},createFromCache:function(t,e){var i=this.cache.get(t);return i&&this.createFromHTML(i,e),this},createFromHTML:function(t,e){void 0===e&&(e="div"),this.removeElement();var i=document.createElement(e);return this.node=i,i.style.zIndex="0",i.style.display="inline",i.style.position="absolute",i.phaser=this,this.parent.appendChild(i),i.innerHTML=t,this.updateSize()},removeElement:function(){return this.node&&(h(this.node),this.node=null),this},updateSize:function(){var t=this.node;return this.width=t.clientWidth,this.height=t.clientHeight,this.displayWidth=this.width*this.scaleX,this.displayHeight=this.height*this.scaleY,this},getChildByProperty:function(t,e){if(this.node)for(var i=this.node.querySelectorAll("*"),s=0;s<i.length;s++)if(i[s][t]===e)return i[s];return null},getChildByID:function(t){return this.getChildByProperty("id",t)},getChildByName:function(t){return this.getChildByProperty("name",t)},setClassName:function(t){return this.node&&(this.node.className=t,this.updateSize()),this},setText:function(t){return this.node&&(this.node.innerText=t,this.updateSize()),this},setHTML:function(t){return this.node&&(this.node.innerHTML=t,this.updateSize()),this},preRender:function(){var t=this.parentContainer,e=this.node;e&&t&&!t.willRender()&&(e.style.display="none")},willRender:function(){return!0},preDestroy:function(){this.removeElement(),this.scene.sys.events.off(l.SLEEP,this.handleSceneEvent,this),this.scene.sys.events.off(l.WAKE,this.handleSceneEvent,this),this.scene.sys.events.off(l.PRE_RENDER,this.preRender,this)}});t.exports=c},49381:(t,e,i)=>{var s=i(47407),n=i(95643),r=i(61340),a=new r,o=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var f=a,p=o,g=h,m=0,v=0,y="0%",x="0%";r?(m=e.width*e.scaleX*e.originX,v=e.height*e.scaleY*e.originY,p.applyITRS(e.x-m,e.y-v,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),p.e=e.x-m,p.f=e.y-v,f.multiply(p,g)):(m=e.width*e.originX,v=e.height*e.originY,p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",p.e-=i.scrollX*e.scrollFactorX,p.f-=i.scrollY*e.scrollFactorY,f.multiply(p,g),g.e-=m,g.f-=v),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=g.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},2611:(t,e,i)=>{var s=i(3069);i(39429).register("dom",(function(t,e,i,n,r){var a=new s(this.scene,t,e,i,n,r);return this.displayList.add(a),a}))},441:(t,e,i)=>{var s,n,r=i(29747);s=i(49381),n=i(49381),t.exports={renderWebGL:s,renderCanvas:n}},62980:t=>{t.exports="addedtoscene"},41337:t=>{t.exports="destroy"},44947:t=>{t.exports="removedfromscene"},49358:t=>{t.exports="complete"},35163:t=>{t.exports="created"},97249:t=>{t.exports="error"},19483:t=>{t.exports="locked"},56059:t=>{t.exports="loop"},26772:t=>{t.exports="metadata"},64437:t=>{t.exports="playing"},83411:t=>{t.exports="play"},75780:t=>{t.exports="seeked"},67799:t=>{t.exports="seeking"},63500:t=>{t.exports="stalled"},55541:t=>{t.exports="stop"},53208:t=>{t.exports="textureready"},4992:t=>{t.exports="unlocked"},12:t=>{t.exports="unsupported"},51708:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(62980),DESTROY:i(41337),REMOVED_FROM_SCENE:i(44947),VIDEO_COMPLETE:i(49358),VIDEO_CREATED:i(35163),VIDEO_ERROR:i(97249),VIDEO_LOCKED:i(19483),VIDEO_LOOP:i(56059),VIDEO_METADATA:i(26772),VIDEO_PLAY:i(83411),VIDEO_PLAYING:i(64437),VIDEO_SEEKED:i(75780),VIDEO_SEEKING:i(67799),VIDEO_STALLED:i(63500),VIDEO_STOP:i(55541),VIDEO_TEXTURE:i(53208),VIDEO_UNLOCKED:i(4992),VIDEO_UNSUPPORTED:i(12)}},42421:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),a=i(64993),o=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,a],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=o},70217:()=>{},56315:(t,e,i)=>{var s=i(42421);i(39429).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},64993:(t,e,i)=>{var s,n,r=i(29747);s=i(80287),n=i(70217),t.exports={renderWebGL:s,renderCanvas:n}},80287:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},85592:t=>{t.exports={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}},43831:(t,e,i)=>{var s=i(71911),n=i(83419),r=i(85592),a=i(31401),o=i(8497),h=i(95643),l=i(95540),u=i(35154),c=i(36383),d=i(84503),f=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,d],initialize:function(t,e){var i=u(e,"x",0),s=u(e,"y",0);h.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.initPostPipeline(),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.lineStyle(1,0,0),this.fillStyle(0,0),this.setDefaultStyles(e)},setDefaultStyles:function(t){return u(t,"lineStyle",null)&&(this.defaultStrokeWidth=u(t,"lineStyle.width",1),this.defaultStrokeColor=u(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=u(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),u(t,"fillStyle",null)&&(this.defaultFillColor=u(t,"fillStyle.color",16777215),this.defaultFillAlpha=u(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,a,o,h){return void 0===n&&(n=1),void 0===a&&(a=n),void 0===o&&(o=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,a,o,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,a){return void 0===a&&(a=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,a,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,a=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(a+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(a+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,a=n,o=n,h=n;"number"!=typeof n&&(r=l(n,"tl",20),a=l(n,"tr",20),o=l(n,"bl",20),h=l(n,"br",20));var u=r>=0,d=a>=0,f=o>=0,p=h>=0;return r=Math.abs(r),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.TAU,0):this.arc(t+i,e,a,Math.PI,c.TAU,!0),this.lineTo(t+i,e+s-h),p?this.arc(t+i-h,e+s-h,h,0,c.TAU):this.arc(t+i,e+s,h,-c.TAU,Math.PI,!0),this.lineTo(t+o,e+s),f?this.arc(t+o,e+s-o,o,c.TAU,Math.PI):this.arc(t,e+s,o,0,-c.TAU,!0),this.lineTo(t,e+r),u?this.arc(t+r,e+r,r,-Math.PI,-c.TAU):this.arc(t,e,r,c.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,a=n,o=n,h=n,u=Math.min(i,s)/2;"number"!=typeof n&&(r=l(n,"tl",20),a=l(n,"tr",20),o=l(n,"bl",20),h=l(n,"br",20));var d=r>=0,f=a>=0,p=o>=0,g=h>=0;return r=Math.min(Math.abs(r),u),a=Math.min(Math.abs(a),u),o=Math.min(Math.abs(o),u),h=Math.min(Math.abs(h),u),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.TAU,0):this.arc(t+i,e,a,Math.PI,c.TAU,!0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),g?this.arc(t+i-h,e+s-h,h,0,c.TAU):this.arc(t+i,e+s,h,-c.TAU,Math.PI,!0),this.lineTo(t+o,e+s),this.moveTo(t+o,e+s),p?this.arc(t+o,e+s-o,o,c.TAU,Math.PI):this.arc(t,e+s,o,0,-c.TAU,!0),this.lineTo(t,e+r),this.moveTo(t,e+r),d?this.arc(t+r,e+r,r,-Math.PI,-c.TAU):this.arc(t,e,r,c.TAU,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,a){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,a),this},strokeTriangle:function(t,e,i,s,n,a){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n<s;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.strokePath(),this},fillPoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n<s;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,s,n){void 0===n&&(n=32);var r=new o(t,e,i,s).getPoints(n);return this.strokePoints(r,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,s,n){void 0===n&&(n=32);var r=new o(t,e,i,s).getPoints(n);return this.fillPoints(r,!0)},arc:function(t,e,i,s,n,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(r.ARC,t,e,i,s,n,a,o),this},slice:function(t,e,i,s,n,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(r.BEGIN_PATH),this.commandBuffer.push(r.MOVE_TO,t,e),this.commandBuffer.push(r.ARC,t,e,i,s,n,a,o),this.commandBuffer.push(r.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(r.SAVE),this},restore:function(){return this.commandBuffer.push(r.RESTORE),this},translateCanvas:function(t,e){return this.commandBuffer.push(r.TRANSLATE,t,e),this},scaleCanvas:function(t,e){return this.commandBuffer.push(r.SCALE,t,e),this},rotateCanvas:function(t){return this.commandBuffer.push(r.ROTATE,t),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(t,e,i){var s,n,r=this.scene.sys,a=r.game.renderer;void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),f.TargetCamera.setScene(this.scene),f.TargetCamera.setViewport(0,0,e,i),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(r.textures.exists(t)){var h=(s=r.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(n=h.getContext("2d",o))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(n=t.getContext("2d",o));return n&&(this.renderCanvas(a,this,f.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new s,t.exports=f},32768:(t,e,i)=>{var s=i(85592),n=i(20926);t.exports=function(t,e,i,r,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,f=0,p=0,g=1,m=0,v=0,y=0;u.beginPath();for(var x=0;x<l;++x)switch(h[x]){case s.ARC:u.arc(h[x+1],h[x+2],h[x+3],h[x+4],h[x+5],h[x+6]),x+=7;break;case s.LINE_STYLE:g=h[x+1],f=h[x+2],c=h[x+3],m=(16711680&f)>>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+m+","+v+","+y+","+c+")",u.lineWidth=g,x+=3;break;case s.FILL_STYLE:p=h[x+1],d=h[x+2],m=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+m+","+v+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:o||u.fill();break;case s.STROKE_PATH:o||u.stroke();break;case s.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}u.restore()}}},87079:(t,e,i)=>{var s=i(44603),n=i(43831);s.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},1201:(t,e,i)=>{var s=i(43831);i(39429).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},84503:(t,e,i)=>{var s,n,r=i(29747);s=i(77545),i(32768),n=i(32768),t.exports={renderWebGL:s,renderCanvas:n}},77545:(t,e,i)=>{var s=i(85592),n=i(91296),r=i(61340),a=i(70554),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new o(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,f=u.loadIdentity(),p=e.commandBuffer,g=i.alpha*e.alpha,m=1,v=c.fillTint,y=c.strokeTint,x=0,w=0,b=0,T=2*Math.PI,S=[],E=0,A=!0,C=null,M=a.getTintAppendFloatAlpha,_=0;_<p.length;_++)switch(p[_]){case s.BEGIN_PATH:S.length=0,C=null,A=!0;break;case s.CLOSE_PATH:A=!1,C&&C.points.length&&C.points.push(C.points[0]);break;case s.FILL_PATH:for(E=0;E<S.length;E++)c.batchFillPath(S[E].points,f,d);break;case s.STROKE_PATH:for(E=0;E<S.length;E++)c.batchStrokePath(S[E].points,m,A,f,d);break;case s.LINE_STYLE:m=p[++_];var R=M(p[++_],p[++_]*g);y.TL=R,y.TR=R,y.BL=R,y.BR=R;break;case s.FILL_STYLE:var P=M(p[++_],p[++_]*g);v.TL=P,v.TR=P,v.BL=P,v.BR=P;break;case s.GRADIENT_FILL_STYLE:var L=p[++_]*g,F=p[++_]*g,O=p[++_]*g,D=p[++_]*g;v.TL=M(p[++_],L),v.TR=M(p[++_],F),v.BL=M(p[++_],O),v.BR=M(p[++_],D);break;case s.GRADIENT_LINE_STYLE:m=p[++_];var k=p[++_]*g;y.TL=M(p[++_],k),y.TR=M(p[++_],k),y.BL=M(p[++_],k),y.BR=M(p[++_],k);break;case s.ARC:var I=0,B=p[++_],N=p[++_],Y=p[++_],X=p[++_],U=p[++_],z=p[++_],G=p[++_];for(U-=X,z?U<-T?U=-T:U>0&&(U=U%T-T):U>T?U=T:U<0&&(U=T+U%T),null===C&&(C=new h(B+Math.cos(X)*Y,N+Math.sin(X)*Y,m),S.push(C),I+=.01);I<1+G;)b=U*I+X,x=B+Math.cos(b)*Y,w=N+Math.sin(b)*Y,C.points.push(new o(x,w,m)),I+=.01;b=U+X,x=B+Math.cos(b)*Y,w=N+Math.sin(b)*Y,C.points.push(new o(x,w,m));break;case s.FILL_RECT:c.batchFillRect(p[++_],p[++_],p[++_],p[++_],f,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(p[++_],p[++_],p[++_],p[++_],p[++_],p[++_],f,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(p[++_],p[++_],p[++_],p[++_],p[++_],p[++_],m,f,d);break;case s.LINE_TO:null!==C?C.points.push(new o(p[++_],p[++_],m)):(C=new h(p[++_],p[++_],m),S.push(C));break;case s.MOVE_TO:C=new h(p[++_],p[++_],m),S.push(C);break;case s.SAVE:l.push(f.copyToArray());break;case s.RESTORE:f.copyFromArray(l.pop());break;case s.TRANSLATE:B=p[++_],N=p[++_],f.translate(B,N);break;case s.SCALE:B=p[++_],N=p[++_],f.scale(B,N);break;case s.ROTATE:f.rotate(p[++_])}t.pipelines.postBatch(e)}}},26479:(t,e,i)=>{var s=i(61061),n=i(83419),r=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),c=i(41212),d=i(88492),f=i(35072),p=i(68287),g=new n({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?c(e[0])&&(i=e,e=null):c(e)&&(i=e,e=null),this.scene=t,this.children=new f,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,s);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=n,a.setActive(r),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i<t.length;i++){var s=this.createFromConfig(t[i]);e=e.concat(s)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=h(t,"classType",this.classType);var e=h(t,"key",void 0),i=h(t,"frame",null),n=h(t,"visible",!0),r=h(t,"active",!0),a=[];if(void 0===e)return a;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var o=h(t,"repeat",0),c=h(t,"randomKey",!1),f=h(t,"randomFrame",!1),p=h(t,"yoyo",!1),g=h(t,"quantity",!1),m=h(t,"frameQuantity",1),v=h(t,"max",0),y=d(e,i,{max:v,qty:g||m,random:c,randomB:f,repeat:o,yoyo:p});t.createCallback&&(this.createCallback=t.createCallback),t.removeCallback&&(this.removeCallback=t.removeCallback),t.internalCreateCallback&&(this.internalCreateCallback=t.internalCreateCallback),t.internalRemoveCallback&&(this.internalRemoveCallback=t.internalRemoveCallback);for(var x=0;x<y.length;x++){var w=this.create(0,0,y[x].a,y[x].b,n,r);if(!w)break;a.push(w)}if(u(t,"setXY")){var b=l(t,"setXY.x",0),T=l(t,"setXY.y",0),S=l(t,"setXY.stepX",0),E=l(t,"setXY.stepY",0);s.SetXY(a,b,T,S,E)}if(u(t,"setRotation")){var A=l(t,"setRotation.value",0),C=l(t,"setRotation.step",0);s.SetRotation(a,A,C)}if(u(t,"setScale")){var M=l(t,"setScale.x",1),_=l(t,"setScale.y",M),R=l(t,"setScale.stepX",0),P=l(t,"setScale.stepY",0);s.SetScale(a,M,_,R,P)}if(u(t,"setOrigin")){var L=l(t,"setOrigin.x",.5),F=l(t,"setOrigin.y",L),O=l(t,"setOrigin.stepX",0),D=l(t,"setOrigin.stepY",0);s.SetOrigin(a,L,F,O,D)}if(u(t,"setAlpha")){var k=l(t,"setAlpha.value",1),I=l(t,"setAlpha.step",0);s.SetAlpha(a,k,I)}if(u(t,"setDepth")){var B=l(t,"setDepth.value",0),N=l(t,"setDepth.step",0);s.SetDepth(a,B,N)}if(u(t,"setScrollFactor")){var Y=l(t,"setScrollFactor.x",1),X=l(t,"setScrollFactor.y",Y),U=l(t,"setScrollFactor.stepX",0),z=l(t,"setScrollFactor.stepY",0);s.SetScrollFactor(a,Y,X,U,z)}var G=h(t,"hitArea",null),V=h(t,"hitAreaCallback",null);G&&s.SetHitArea(a,G,V);var W=h(t,"gridAlign",!1);return W&&s.GridAlign(a,W),this.createMultipleCallback&&this.createMultipleCallback.call(this,a),a},preUpdate:function(t,e){if(this.runChildUpdate&&0!==this.children.size)for(var i=this.children.entries.slice(),s=0;s<i.length;s++){var n=i[s];n.active&&n.update(t,e)}},add:function(t,e){return void 0===e&&(e=!1),this.isFull()||(this.children.set(t),this.internalCreateCallback&&this.internalCreateCallback.call(this,t),this.createCallback&&this.createCallback.call(this,t),e&&(t.addToDisplayList(this.scene.sys.displayList),t.addToUpdateList()),t.on(r.DESTROY,this.remove,this)),this},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.contains(t)?(this.children.delete(t),this.internalRemoveCallback&&this.internalRemoveCallback.call(this,t),this.removeCallback&&this.removeCallback.call(this,t),t.off(r.DESTROY,this.remove,this),i?t.destroy():e&&(t.removeFromDisplayList(),t.removeFromUpdateList()),this):this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.children,s=0;s<i.size;s++){var n=i.entries[s];n.off(r.DESTROY,this.remove,this),e?n.destroy():t&&(n.removeFromDisplayList(),n.removeFromUpdateList())}return this.children.clear(),this},contains:function(t){return this.children.contains(t)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getMatching:function(t,e,i,s){return o(this.children.entries,t,e,i,s)},getFirst:function(t,e,i,s,n,r,a){return this.getHandler(!0,1,t,e,i,s,n,r,a)},getFirstNth:function(t,e,i,s,n,r,a,o){return this.getHandler(!0,t,e,i,s,n,r,a,o)},getLast:function(t,e,i,s,n,r,a){return this.getHandler(!1,1,t,e,i,s,n,r,a)},getLastNth:function(t,e,i,s,n,r,a,o){return this.getHandler(!1,t,e,i,s,n,r,a,o)},getHandler:function(t,e,i,s,n,r,a,o,h){var l,u;void 0===i&&(i=!1),void 0===s&&(s=!1);var c=0,d=this.children.entries;if(t)for(u=0;u<d.length;u++)if((l=d[u]).active===i){if(++c===e)break}else l=null;else for(u=d.length-1;u>=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,a,o,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i<this.children.size;i++)this.children.entries[i].active===t&&e++;return e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,n,r){return s.PropertyValueSet(this.children.entries,t,e,i,n,r),this},propertyValueInc:function(t,e,i,n,r){return s.PropertyValueInc(this.children.entries,t,e,i,n,r),this},setX:function(t,e){return s.SetX(this.children.entries,t,e),this},setY:function(t,e){return s.SetY(this.children.entries,t,e),this},setXY:function(t,e,i,n){return s.SetXY(this.children.entries,t,e,i,n),this},incX:function(t,e){return s.IncX(this.children.entries,t,e),this},incY:function(t,e){return s.IncY(this.children.entries,t,e),this},incXY:function(t,e,i,n){return s.IncXY(this.children.entries,t,e,i,n),this},shiftPosition:function(t,e,i){return s.ShiftPosition(this.children.entries,t,e,i),this},angle:function(t,e){return s.Angle(this.children.entries,t,e),this},rotate:function(t,e){return s.Rotate(this.children.entries,t,e),this},rotateAround:function(t,e){return s.RotateAround(this.children.entries,t,e),this},rotateAroundDistance:function(t,e,i){return s.RotateAroundDistance(this.children.entries,t,e,i),this},setAlpha:function(t,e){return s.SetAlpha(this.children.entries,t,e),this},setTint:function(t,e,i,n){return s.SetTint(this.children.entries,t,e,i,n),this},setOrigin:function(t,e,i,n){return s.SetOrigin(this.children.entries,t,e,i,n),this},scaleX:function(t,e){return s.ScaleX(this.children.entries,t,e),this},scaleY:function(t,e){return s.ScaleY(this.children.entries,t,e),this},scaleXY:function(t,e,i,n){return s.ScaleXY(this.children.entries,t,e,i,n),this},setDepth:function(t,e){return s.SetDepth(this.children.entries,t,e),this},setBlendMode:function(t){return s.SetBlendMode(this.children.entries,t),this},setHitArea:function(t,e){return s.SetHitArea(this.children.entries,t,e),this},shuffle:function(){return s.Shuffle(this.children.entries),this},kill:function(t){this.children.contains(t)&&t.setActive(!1)},killAndHide:function(t){this.children.contains(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return s.SetVisible(this.children.entries,t,e,i),this},toggleVisible:function(){return s.ToggleVisible(this.children.entries),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(r.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=g},94975:(t,e,i)=>{var s=i(44603),n=i(26479);s.register("group",(function(t){return new n(this.scene,null,t)}))},3385:(t,e,i)=>{var s=i(26479);i(39429).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},88571:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),a=i(59819),o=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,a],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=o},40652:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},82459:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(88571);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),o=new a(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,o,t),o}))},2117:(t,e,i)=>{var s=i(88571);i(39429).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},59819:(t,e,i)=>{var s,n,r=i(29747);s=i(99517),n=i(40652),t.exports={renderWebGL:s,renderCanvas:n}},99517:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},77856:(t,e,i)=>{var s={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};s.Shader=i(20071),s.Mesh=i(4703),s.NineSlice=i(28103),s.PointLight=i(80321),s.Plane=i(33663),s.Factories.Shader=i(74177),s.Factories.Mesh=i(9225),s.Factories.NineSlice=i(47521),s.Factories.PointLight=i(71255),s.Factories.Plane=i(30985),s.Creators.Shader=i(54935),s.Creators.Mesh=i(20527),s.Creators.NineSlice=i(28279),s.Creators.PointLight=i(39829),s.Creators.Plane=i(56015),s.Light=i(41432),s.LightsManager=i(61356),s.LightsPlugin=i(88992),t.exports=s},93595:(t,e,i)=>{var s=i(10312),n=i(83419),r=i(31401),a=i(53774),o=i(45893),h=i(50792),l=i(51708),u=i(73162),c=i(33963),d=i(44594),f=i(19186),p=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.PostPipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,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=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new o(this)),this},setData:function(t,e){return this.data||(this.data=new o(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new o(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new o(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new o(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return a(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(f(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var e=this.list;e.length;)e[0].destroy(t);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0,!1),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}}});t.exports=p},2956:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;a<s.length;a++){var o=s[a];if(o.willRender(i)){var h=o.alpha;n||o.blendMode===t.currentBlendMode||t.setBlendMode(o.blendMode),o.setAlpha(h*r),o.renderCanvas(t,o,i),o.setAlpha(h)}}e.mask&&e.mask.postRenderCanvas(t)}}},25179:(t,e,i)=>{var s=i(25305),n=i(93595),r=i(44603),a=i(23568);r.register("layer",(function(t,e){void 0===t&&(t={});var i=a(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},20005:(t,e,i)=>{var s=i(93595);i(39429).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},33963:(t,e,i)=>{var s,n,r=i(29747);s=i(15869),n=i(2956),t.exports={renderWebGL:s,renderCanvas:n}},15869:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var a=e.alpha,o=0;o<n;o++){var h=s[o];if(h.willRender(i)){var l,u,c,d;if(void 0!==h.alphaTopLeft)l=h.alphaTopLeft,u=h.alphaTopRight,c=h.alphaBottomLeft,d=h.alphaBottomRight;else{var f=h.alpha;l=f,u=f,c=f,d=f}r||h.blendMode===t.currentBlendMode||t.setBlendMode(h.blendMode);var p=h.mask;p&&p.preRenderWebGL(t,h,i);var g=h.type;g!==t.currentType&&(t.newType=!0,t.currentType=g),t.nextTypeMatch=o<n-1&&s[o+1].type===t.currentType,h.setAlpha(l*a,u*a,c*a,d*a),h.renderWebGL(t,h,i),h.setAlpha(l,u,c,d),p&&p.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},41432:(t,e,i)=>{var s=i(96503),n=i(83419),r=i(31401),a=i(51767),o=i(70554),h=new n({Extends:s,Mixins:[r.Origin,r.ScrollFactor,r.Visible],initialize:function(t,e,i,n,r,o,h){s.call(this,t,e,i),this.color=new a(n,r,o),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=o.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},61356:(t,e,i)=>{var s=i(81491),n=i(83419),r=i(20339),a=i(41432),o=i(80321),h=i(51767),l=i(19133),u=i(19186),c=i(70554),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new o(this.scene,t,e,i,s,n,r))},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(t){for(var e=this.lights,i=t.worldView,n=[],a=0;a<e.length;a++){var o=e[a];o.willRender(t)&&s(o,i)&&n.push({light:o,distance:r(o.x,o.y,i.centerX,i.centerY)})}return n.length>this.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),o=new a(t,e,i,r[0],r[1],r[2],n);return this.lights.push(o),o},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},88992:(t,e,i)=>{var s=i(83419),n=i(61356),r=i(37277),a=i(44594),o=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},4703:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(39506),a=i(83997),o=i(95643),h=i(34684),l=i(92515),u=i(91296),c=i(37867),d=i(29807),f=i(43396),p=i(19186),g=i(25836),m=i(39318),v=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Size,n.Texture,n.Transform,n.Visible,d],initialize:function(t,e,i,s,n,r,a,h,l,u,d,f){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),o.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new g,this.modelScale=new g(1,1,1),this.modelRotation=new g,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new g,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var p=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(p.width,p.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(p.width,p.height),r&&this.addVertices(r,a,h,l,u,d,f)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(g.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=g.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.fov=i,this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.fov=0,this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,a,o,l){var u,c=this.scene.sys.cache.obj.get(t);return c&&(u=h(c,this,e,i,s,n,r,a,o,l)),u&&0!==u.verts.length||console.warn("Mesh.addVerticesFromObj data empty:",t),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,a){var o=new m(t,e,i,s,n,r,a);return this.vertices.push(o),o},addFace:function(t,e,i){var s=new a(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,a){var o=l(t,e,i,s,n,r,a);return o?(this.faces=this.faces.concat(o.faces),this.vertices=this.vertices.concat(o.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},hasFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=0;r<n.length;r++)if(n[r].contains(t,e,s))return!0;return!1},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=[],a=0;a<n.length;a++){var o=n[a];o.contains(t,e,s)&&r.push(o)}return p(r,this.sortByDepth)},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebug:null,this},isDirty:function(){var t=this.modelPosition,e=this.modelRotation,i=this.modelScale,s=this.dirtyCache,n=t.x,r=t.y,a=t.z,o=e.x,h=e.y,l=e.z,u=i.x,c=i.y,d=i.z,f=this.getFaceCount(),p=s[0],g=s[1],m=s[2],v=s[3],y=s[4],x=s[5],w=s[6],b=s[7],T=s[8],S=s[9];return s[0]=n,s[1]=r,s[2]=a,s[3]=o,s[4]=h,s[5]=l,s[6]=u,s[7]=c,s[8]=d,s[9]=f,p!==n||g!==r||m!==a||v!==o||y!==h||x!==l||w!==u||b!==c||T!==d||S!==f},preUpdate:function(){this.totalRendered=this.totalFrame,this.totalFrame=0;var t=this.dirtyCache;if(this.ignoreDirtyCache||t[10]||this.isDirty()){var e=this.width,i=this.height,s=this.viewMatrix,n=this.viewPosition;t[10]&&(s.identity(),s.translate(n),s.invert(),t[10]=0);var r=this.transformMatrix;r.setWorldMatrix(this.modelRotation,this.modelPosition,this.modelScale,this.viewMatrix,this.projectionMatrix);for(var a=n.z,o=this.faces,h=0;h<o.length;h++)o[h].transformCoordinatesLocal(r,e,i,a);this.depthSort()}},renderDebug:function(t,e){for(var i=t.debugGraphic,s=0;s<e.length;s++){var n=e[s],r=n.vertex1.tx,a=n.vertex1.ty,o=n.vertex2.tx,h=n.vertex2.ty,l=n.vertex3.tx,u=n.vertex3.ty;i.strokeTriangle(r,a,o,h,l,u)}},preDestroy:function(){this.clear(),this.debugCallback=null,this.debugGraphic=null},clearTint:function(){return this.setTint()},setInteractive:function(t){void 0===t&&(t={});var e=function(t,e,i){for(var s=this.faces,n=0;n<s.length;n++)if(s[n].contains(e,i))return!0;return!1}.bind(this);return this.scene.sys.input.enable(this,t,e),this},setTint:function(t){void 0===t&&(t=16777215);for(var e=this.vertices,i=0;i<e.length;i++)e[i].color=t;return this},uvScroll:function(t,e){for(var i=this.faces,s=0;s<i.length;s++)i[s].scrollUV(t,e);return this},uvScale:function(t,e){for(var i=this.faces,s=0;s<i.length;s++)i[s].scaleUV(t,e);return this},tint:{set:function(t){this.setTint(t)}},rotateX:{get:function(){return f(this.modelRotation.x)},set:function(t){this.modelRotation.x=r(t)}},rotateY:{get:function(){return f(this.modelRotation.y)},set:function(t){this.modelRotation.y=r(t)}},rotateZ:{get:function(){return f(this.modelRotation.z)},set:function(t){this.modelRotation.z=r(t)}}});t.exports=v},36488:t=>{t.exports=function(){}},20527:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(35154),o=i(4703);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=a(t,"vertices",[]),l=a(t,"uvs",[]),u=a(t,"indicies",[]),c=a(t,"containsZ",!1),d=a(t,"normals",[]),f=a(t,"colors",16777215),p=a(t,"alphas",1),g=new o(this.scene,0,0,i,n,h,l,u,c,d,f,p);return void 0!==e&&(t.add=e),s(this.scene,g,t),g}))},9225:(t,e,i)=>{var s=i(4703);i(39429).register("mesh",(function(t,e,i,n,r,a,o,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h,l,u,c))}))},29807:(t,e,i)=>{var s,n,r=i(29747);s=i(48833),n=i(36488),t.exports={renderWebGL:s,renderCanvas:n}},48833:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){var r=e.faces,a=r.length;if(0!==a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc;t.pipelines.preBatch(e);for(var l=o.setGameObject(e),u=o.vertexViewF32,c=o.vertexViewU32,d=o.vertexCount*o.currentShader.vertexComponentCount-1,f=e.tintFill,p=[],g=e.debugCallback,m=h.a,v=h.b,y=h.c,x=h.d,w=h.e,b=h.f,T=e.viewPosition.z,S=e.hideCCW,E=i.roundPixels,A=i.alpha*e.alpha,C=0,M=0;M<a;M++){var _=r[M];_.isInView(i,S,T,A,m,v,y,x,w,b,E)&&(o.shouldFlush(3)&&(o.flush(),l=o.setGameObject(e),d=o.vertexCount*o.currentShader.vertexComponentCount-1),d=_.load(u,c,d,l,f),C++,o.vertexCount+=3,o.currentBatch.count=o.vertexCount-o.currentBatch.start,g&&p.push(_))}e.totalFrame+=C,g&&g.call(e,e,p),t.pipelines.postBatch(e)}}},28103:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),a=i(78023),o=i(39318),h=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Texture,n.Transform,n.Visible,a],initialize:function(t,e,i,s,n,a,h,l,u,c,d){r.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tint=16777215,this.tintFill=!1;var f=t.textures.getFrame(s,n);this.is3Slice=!c&&!d,f&&f.scale9&&(this.is3Slice=f.is3Slice);for(var p=this.is3Slice?18:54,g=0;g<p;g++)this.vertices.push(new o);this.setPosition(e,i),this.setTexture(s,n),this.setSlices(a,h,l,u,c,d,!1),this.updateDisplayOrigin(),this.initPipeline(),this.initPostPipeline()},setSlices:function(t,e,i,s,n,r,a){void 0===i&&(i=10),void 0===s&&(s=10),void 0===n&&(n=0),void 0===r&&(r=0),void 0===a&&(a=!1);var o=this.frame,h=!1;if(this.is3Slice&&a&&0!==n&&0!==r&&(h=!0),h)console.warn("Cannot change 9 slice to 3 slice");else{if(o&&o.scale9&&!a){var l=o.data.scale9Borders,u=l.x,c=l.y;i=u,s=o.width-l.w-u,n=c,r=o.height-l.h-c,void 0===t&&(t=o.width),void 0===e&&(e=o.height)}else void 0===t&&(t=256),void 0===e&&(e=256);this._width=t,this._height=e,this.leftWidth=i,this.rightWidth=s,this.topHeight=n,this.bottomHeight=r,this.is3Slice&&(e=o.height,this._height=e,this.topHeight=e,this.bottomHeight=0),this.updateVertices(),this.updateUVs()}return this},updateUVs:function(){var t=this.leftWidth,e=this.rightWidth,i=this.topHeight,s=this.bottomHeight,n=this.frame.width,r=this.frame.height;this.updateQuadUVs(0,0,0,t/n,i/r),this.updateQuadUVs(6,t/n,0,1-e/n,i/r),this.updateQuadUVs(12,1-e/n,0,1,i/r),this.is3Slice||(this.updateQuadUVs(18,0,i/r,t/n,1-s/r),this.updateQuadUVs(24,t/n,i/r,1-e/n,1-s/r),this.updateQuadUVs(30,1-e/n,i/r,1,1-s/r),this.updateQuadUVs(36,0,1-s/r,t/n,1),this.updateQuadUVs(42,t/n,1-s/r,1-e/n,1),this.updateQuadUVs(48,1-e/n,1-s/r,1,1))},updateVertices:function(){var t=this.leftWidth,e=this.rightWidth,i=this.topHeight,s=this.bottomHeight,n=this.width,r=this.height;this.updateQuad(0,-.5,.5,t/n-.5,.5-i/r),this.updateQuad(6,t/n-.5,.5,.5-e/n,.5-i/r),this.updateQuad(12,.5-e/n,.5,.5,.5-i/r),this.is3Slice||(this.updateQuad(18,-.5,.5-i/r,t/n-.5,s/r-.5),this.updateQuad(24,t/n-.5,.5-i/r,.5-e/n,s/r-.5),this.updateQuad(30,.5-e/n,.5-i/r,.5,s/r-.5),this.updateQuad(36,-.5,s/r-.5,t/n-.5,-.5),this.updateQuad(42,t/n-.5,s/r-.5,.5-e/n,-.5),this.updateQuad(48,.5-e/n,s/r-.5,.5,-.5))},updateQuad:function(t,e,i,s,n){var r=this.width,a=this.height,o=this.originX,h=this.originY,l=this.vertices;l[t+0].resize(e,i,r,a,o,h),l[t+1].resize(e,n,r,a,o,h),l[t+2].resize(s,i,r,a,o,h),l[t+3].resize(e,n,r,a,o,h),l[t+4].resize(s,n,r,a,o,h),l[t+5].resize(s,i,r,a,o,h)},updateQuadUVs:function(t,e,i,s,n){var r=this.vertices,a=this.frame,o=a.u0,h=a.v0,l=a.u1,u=a.v1;if(0!==o||1!==l){var c=l-o;e=o+e*c,s=o+s*c}if(0!==h||1!==u){var d=u-h;i=h+i*d,n=h+n*d}r[t+0].setUVs(e,i),r[t+1].setUVs(e,n),r[t+2].setUVs(s,i),r[t+3].setUVs(e,n),r[t+4].setUVs(s,n),r[t+5].setUVs(s,i)},clearTint:function(){return this.setTint(16777215),this},setTint:function(t){return void 0===t&&(t=16777215),this.tint=t,this.tintFill=!1,this},setTintFill:function(t){return this.setTint(t),this.tintFill=!0,this},isTinted:{get:function(){return 16777215!==this.tint}},width:{get:function(){return this._width},set:function(t){this._width=Math.max(t,this.leftWidth+this.rightWidth),this.updateVertices()}},height:{get:function(){return this._height},set:function(t){this.is3Slice||(this._height=Math.max(t,this.topHeight+this.bottomHeight),this.updateVertices())}},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},originX:{get:function(){return this._originX},set:function(t){this._originX=t,this.updateVertices()}},originY:{get:function(){return this._originY},set:function(t){this._originY=t,this.updateVertices()}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this._originX=t,this._originY=e,this.updateVertices(),this.updateDisplayOrigin()},setSizeToFrame:function(){if(this.is3Slice){var t=this.frame.height;this._height=t,this.topHeight=t,this.bottomHeight=0}return this.updateUVs(),this},preDestroy:function(){this.vertices=[]}});t.exports=h},28279:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(35154),o=i(28103);n.register("nineslice",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=a(t,"width",256),l=a(t,"height",256),u=a(t,"leftWidth",10),c=a(t,"rightWidth",10),d=a(t,"topHeight",0),f=a(t,"bottomHeight",0),p=new o(this.scene,0,0,i,n,h,l,u,c,d,f);return void 0!==e&&(t.add=e),s(this.scene,p,t),p}))},47521:(t,e,i)=>{var s=i(28103);i(39429).register("nineslice",(function(t,e,i,n,r,a,o,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h,l,u))}))},78023:(t,e,i)=>{var s,n=i(29747),r=n;s=i(52230),t.exports={renderWebGL:s,renderCanvas:r}},52230:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){var a=e.vertices,o=a.length;if(0!==o){i.addToRenderList(e);var h=t.pipelines.set(e.pipeline,e),l=s(e,i,r,!1).calc;t.pipelines.preBatch(e);var u=h.setGameObject(e),c=h.vertexViewF32,d=h.vertexViewU32,f=h.vertexCount*h.currentShader.vertexComponentCount-1,p=i.roundPixels,g=e.tintFill,m=i.alpha*e.alpha,v=n.getTintAppendFloatAlpha(e.tint,m),y=h.vertexAvailable(),x=-1;y<o&&(x=y);for(var w=0;w<o;w++){var b=a[w];w===x&&(h.flush(),u=h.setGameObject(e),f=0),c[++f]=l.getXRound(b.vx,b.vy,p),c[++f]=l.getYRound(b.vx,b.vy,p),c[++f]=b.u,c[++f]=b.v,c[++f]=u,c[++f]=g,d[++f]=v,h.vertexCount++,h.currentBatch.count=h.vertexCount-h.currentBatch.start}t.pipelines.postBatch(e)}}},76472:(t,e,i)=>{var s=i(83419),n=i(44777),r=i(37589),a=i(6113),o=i(91389),h=i(90664),l=new s({Extends:n,initialize:function(t){n.call(this,t,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return null===this.propertyValue?0:9},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;if(9===this.method){this.start=t[0],this.ease=a("Linear"),this.interpolation=o("linear"),i=this.easedValueEmit,s=this.easeValueUpdate,e=t[0],this.active=!0,this.r.length=0,this.g.length=0,this.b.length=0;for(var n=0;n<t.length;n++){var r=h(t[n]);this.r.push(r.r),this.g.push(r.g),this.b.push(r.b)}}return this.onEmit=i,this.onUpdate=s,this.current=e,this},setEase:function(t){this.easeName=t,this.ease=a(t)},easedValueEmit:function(){return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s=this.ease(i),n=this.interpolation(this.r,s),a=this.interpolation(this.g,s),o=this.interpolation(this.b,s),h=r(n,a,o);return this.current=h,h}});t.exports=l},44777:(t,e,i)=>{var s=i(30976),n=i(45319),r=i(83419),a=i(99472),o=i(6113),h=i(95540),l=i(91389),u=i(77720),c=i(15994),d=new r({initialize:function(t,e,i){void 0===i&&(i=!1),this.propertyKey=t,this.propertyValue=e,this.defaultValue=e,this.steps=0,this.counter=0,this.yoyo=!1,this.direction=0,this.start=0,this.current=0,this.end=0,this.ease=null,this.interpolation=null,this.emitOnly=i,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=h(t,this.propertyKey,this.defaultValue),this.method=this.getMethod(),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return JSON.stringify(this.propertyValue)},onChange:function(t){var e;switch(this.method){case 1:case 3:case 8:e=t;break;case 2:this.propertyValue.indexOf(t)>=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=n(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var n=this.has(t,"ease")?t.ease:"Linear";this.ease=o(n,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,s=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var r=t.random;Array.isArray(r)&&(this.start=r[0],this.end=r[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,s=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,s=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=s,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,s){return s},proxyEmit:function(t,e,i){var s=this._onEmit(t,e,i);return this.current=s,s},proxyUpdate:function(t,e,i,s){var n=this._onUpdate(t,e,i,s);return this.current=n,n},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,s=(this.end-this.start)/this.steps;return this.yoyo?(0===this.direction?(i+=s)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=s)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=c(i+s,this.start,this.end),this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s,n=t.data[e],r=this.ease(i);return s=this.interpolation?this.interpolation(this.start,r):(n.max-n.min)*r+n.min,this.current=s,s},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=d},24502:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(20286),a=new s({Extends:r,initialize:function(t,e,i,s,a){if("object"==typeof t){var o=t;t=n(o,"x",0),e=n(o,"y",0),i=n(o,"power",0),s=n(o,"epsilon",100),a=n(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===a&&(a=50);r.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=s*s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n<this._epsilon&&(n=this._epsilon);var a=this._power*e/(n*r)*100;t.velocityX+=i*a,t.velocityY+=s*a}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=a},56480:(t,e,i)=>{var s=i(9674),n=i(45319),r=i(83419),a=i(39506),o=i(87841),h=i(11520),l=i(26099),u=new r({initialize:function(t){this.emitter=t,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new l,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.holdCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1},x:{min:0,max:0},y:{min:0,max:0},accelerationX:{min:0,max:0},accelerationY:{min:0,max:0},maxVelocityX:{min:0,max:0},maxVelocityY:{min:0,max:0},moveToX:{min:0,max:0},moveToY:{min:0,max:0},bounce:{min:0,max:0}},this.isCropped=!1,this.scene=t.scene,this.anims=null,this.emitter.anims.length>0&&(this.anims=new s(this)),this.bounds=new o},emit:function(t,e,i,s,n,r){return this.emitter.emit(t,e,i,s,n,r)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,s=i.ops,n=i.getAnim();if(n?this.anims.play(n):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=s.x.onEmit(this,"x"):s.x.steps>0?this.x+=t+s.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=s.y.onEmit(this,"y"):s.y.steps>0?this.y+=e+s.y.onEmit(this,"y"):this.y+=e,this.life=s.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=s.delay.onEmit(this,"delay"),this.holdCurrent=s.hold.onEmit(this,"hold"),this.scaleX=s.scaleX.onEmit(this,"scaleX"),this.scaleY=s.scaleY.active?s.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=s.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var r=s.speedX.onEmit(this,"speedX"),o=s.speedY.active?s.speedY.onEmit(this,"speedY"):r;if(i.radial){var h=a(s.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(r),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=s.moveToX.onEmit(this,"moveToX"),u=s.moveToY.onEmit(this,"moveToY"),c=this.life/1e3;this.velocityX=(l-this.x)/c,this.velocityY=(u-this.y)/c}else this.velocityX=r,this.velocityY=o;return i.acceleration&&(this.accelerationX=s.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=s.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=s.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=s.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=s.bounce.onEmit(this,"bounce"),this.alpha=s.alpha.onEmit(this,"alpha"),s.color.active?this.tint=s.color.onEmit(this,"tint"):this.tint=s.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var s=this.emitter,r=s.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=r.x.onUpdate(this,"x",o,this.x),this.y=r.y.onUpdate(this,"y",o,this.y),s.moveTo){var h=r.moveToX.onUpdate(this,"moveToX",o,s.moveToX),l=r.moveToY.onUpdate(this,"moveToY",o,s.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(s,t,e,i,o),this.scaleX=r.scaleX.onUpdate(this,"scaleX",o,this.scaleX),r.scaleY.active?this.scaleY=r.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=r.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),s.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=n(r.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),r.color.active?this.tint=r.color.onUpdate(this,"color",o,this.tint):this.tint=r.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,s,r){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",r,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",r,this.accelerationY),c=a.maxVelocityX.onUpdate(this,"maxVelocityX",r,this.maxVelocityX),d=a.maxVelocityY.onUpdate(this,"maxVelocityY",r,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",r,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=n(o,-c,c),h=n(h,-d,d),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;f<s.length;f++){var p=s[f];p.active&&p.update(this,e,i,r)}},setSizeToFrame:function(){},getBounds:function(t){void 0===t&&(t=this.emitter.getWorldTransformMatrix());var e=Math.abs(t.scaleX)*this.scaleX,i=Math.abs(t.scaleY)*this.scaleY,s=this.x,n=this.y,r=this.rotation,a=this.frame.width*e/2,o=this.frame.height*i/2,u=this.bounds,c=new l(s-a,n-o),d=new l(s+a,n-o),f=new l(s-a,n+o),p=new l(s+a,n+o);return 0!==r&&(h(c,s,n,r),h(d,s,n,r),h(f,s,n,r),h(p,s,n,r)),t.transformPoint(c.x,c.y,c),t.transformPoint(d.x,d.y,d),t.transformPoint(f.x,f.y,f),t.transformPoint(p.x,p.y,p),u.x=Math.min(c.x,d.x,f.x,p.x),u.y=Math.min(c.y,d.y,f.y,p.y),u.width=Math.max(c.x,d.x,f.x,p.x)-u.x,u.height=Math.max(c.y,d.y,f.y,p.y)-u.y,u},destroy:function(){this.anims&&this.anims.destroy(),this.anims=null,this.emitter=null,this.texture=null,this.frame=null,this.scene=null}});t.exports=u},69601:(t,e,i)=>{var s=i(83419),n=i(20286),r=i(87841),a=new s({Extends:n,initialize:function(t,e,i,s,a,o,h,l){void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),void 0===l&&(l=!0),n.call(this,t,e,!0),this.bounds=new r(t,e,i,s),this.collideLeft=a,this.collideRight=o,this.collideTop=h,this.collideBottom=l},update:function(t){var e=this.bounds,i=-t.bounce,s=t.worldPosition;s.x<e.x&&this.collideLeft?(t.x+=e.x-s.x,t.velocityX*=i):s.x>e.right&&this.collideRight&&(t.x-=s.x-e.right,t.velocityX*=i),s.y<e.y&&this.collideTop?(t.y+=e.y-s.y,t.velocityY*=i):s.y>e.bottom&&this.collideBottom&&(t.y-=s.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(53774),a=i(43459),o=i(26388),h=i(19909),l=i(76472),u=i(44777),c=i(20696),d=i(95643),f=i(95540),p=i(26546),g=i(24502),m=i(69036),v=i(1985),y=i(97022),x=i(86091),w=i(73162),b=i(20074),T=i(269),S=i(56480),E=i(69601),A=i(68875),C=i(87841),M=i(59996),_=i(72905),R=i(90668),P=i(19186),L=i(61340),F=i(26099),O=i(15994),D=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintFill","timeScale","trackVisible","visible"],k=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],I=new s({Extends:d,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Texture,n.Transform,n.Visible,R],initialize:function(t,e,i,s,n){d.call(this,t,"ParticleEmitter"),this.particleClass=S,this.config=null,this.ops={accelerationX:new u("accelerationX",0),accelerationY:new u("accelerationY",0),alpha:new u("alpha",1),angle:new u("angle",{min:0,max:360},!0),bounce:new u("bounce",0),color:new l("color"),delay:new u("delay",0,!0),hold:new u("hold",0,!0),lifespan:new u("lifespan",1e3,!0),maxVelocityX:new u("maxVelocityX",1e4),maxVelocityY:new u("maxVelocityY",1e4),moveToX:new u("moveToX",0),moveToY:new u("moveToY",0),quantity:new u("quantity",1,!0),rotate:new u("rotate",0),scaleX:new u("scaleX",1),scaleY:new u("scaleY",1),speedX:new u("speedX",0,!0),speedY:new u("speedY",0,!0),tint:new u("tint",16777215),x:new u("x",0),y:new u("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new F,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new L,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(e,i),this.setTexture(s),n&&this.setConfig(n)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",s=this.ops;for(e=0;e<k.length;e++)s[i=k[e]].loadConfig(t);for(e=0;e<D.length;e++)y(t,i=D[e])&&(this[i]=f(t,i));if(this.acceleration=0!==this.accelerationX||0!==this.accelerationY,this.moveTo=m(t,["moveToX","moveToY"]),y(t,"speed")&&(s.speedX.loadConfig(t,"speed"),s.speedY.active=!1),(v(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),y(t,"scale")&&(s.scaleX.loadConfig(t,"scale"),s.scaleY.active=!1),y(t,"callbackScope")){var n=f(t,"callbackScope",null);this.emitCallbackScope=n,this.deathCallbackScope=n}if(y(t,"emitZone")&&this.addEmitZone(t.emitZone),y(t,"deathZone")&&this.addDeathZone(t.deathZone),y(t,"bounds")){var r=this.addParticleBounds(t.bounds);r.collideLeft=f(t,"collideLeft",!0),r.collideRight=f(t,"collideRight",!0),r.collideTop=f(t,"collideTop",!0),r.collideBottom=f(t,"collideBottom",!0)}return y(t,"followOffset")&&this.followOffset.setFromObject(f(t,"followOffset",0)),y(t,"texture")&&this.setTexture(t.texture),y(t,"frame")?this.setEmitterFrame(t.frame):y(t,"anim")&&this.setAnim(t.anim),y(t,"reserve")&&this.reserve(t.reserve),y(t,"advance")&&this.fastForward(t.advance),this.resetCounters(this.frequency,this.emitting),this.emitting&&this.emit(c.START,this),this},updateConfig:function(t){return t&&(this.config?this.setConfig(T(this.config,t)):this.setConfig(t)),this},toJSON:function(){var t=r(this),e=0,i="";for(e=0;e<D.length;e++)t[i=D[e]]=this[i];var s=this.ops;for(e=0;e<k.length;e++)s[i=k[e]]&&(t[i]=s[i].toJSON());return s.speedY.active||(delete t.speedX,t.speed=s.speedX.toJSON()),this.scaleX===this.scaleY&&(delete t.scaleX,delete t.scaleY,t.scale=s.scaleX.toJSON()),t},resetCounters:function(t,e){var i=this.counters;i.fill(0),i[0]=t,e&&(i[5]=1)},startFollow:function(t,e,i,s){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=s,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){var t,e=this.frames,i=e.length;return 1===i?t=e[0]:this.randomFrame?t=p(e):(t=e[this.currentFrame],this.frameCounter++,this.frameCounter===this.frameQuantity&&(this.frameCounter=0,this.currentFrame++,this.currentFrame===i&&(this.currentFrame=0))),this.texture.get(t)},setEmitterFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0;var s=typeof t;if(this.frames.length=0,Array.isArray(t))this.frames=this.frames.concat(t);else if("string"===s||"number"===s)this.frames.push(t);else if("object"===s){var n=t;(t=f(n,"frames",null))&&(this.frames=this.frames.concat(t));var r=f(n,"cycle",!1);this.randomFrame=!r,this.frameQuantity=f(n,"quantity",i)}return 1===this.frames.length&&(this.frameQuantity=1,this.randomFrame=!1),this},getAnim:function(){var t=this.anims,e=t.length;if(0===e)return null;if(1===e)return t[0];if(this.randomAnim)return p(t);var i=t[this.currentAnim];return this.animCounter++,this.animCounter>=this.animQuantity&&(this.animCounter=0,this.currentAnim=O(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var s=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===s)this.anims.push(t);else if("object"===s){var n=t;(t=f(n,"anims",null))&&(this.anims=this.anims.concat(t));var r=f(n,"cycle",!1);this.randomAnim=!r,this.animQuantity=f(n,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,s,n,r,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=y(h,"w")?h.w:h.width,s=y(h,"h")?h.h:h.height}return this.addParticleProcessor(new E(t,e,i,s,n,r,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s<t.length;s++)if((e=t[s])instanceof o)i.push(e);else if("function"==typeof e.contains)e=new o(e,!0),i.push(e);else{var n=f(e,"type","onEnter"),r=f(e,"source",null);r&&"function"==typeof r.contains&&(e=new o(r,"onEnter"===n),i.push(e))}return this.deathZones=this.deathZones.concat(i),i},removeDeathZone:function(t){return _(this.deathZones,t),this},clearDeathZones:function(){return this.deathZones.length=0,this},addEmitZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s<t.length;s++)if((e=t[s])instanceof A||e instanceof h)i.push(e);else{var n=f(e,"source",null);if(n){var r=f(e,"type","random");if("random"===r&&"function"==typeof n.getRandomPoint)e=new A(n),i.push(e);else if("edge"===r&&"function"==typeof n.getPoints){var a=f(e,"quantity",1),o=f(e,"stepRate",0),l=f(e,"yoyo",!1),u=f(e,"seamless",!0),c=f(e,"total",-1);e=new h(n,a,o,l,u,c),i.push(e)}}}return this.emitZones=this.emitZones.concat(i),i},removeEmitZone:function(t){return _(this.emitZones,t),this.zoneIndex=0,this},clearEmitZones:function(){return this.emitZones.length=0,this.zoneIndex=0,this},getEmitZone:function(t){var e=this.emitZones,i=e.length;if(0!==i){var s=e[this.zoneIndex];s.getPoint(t),s.total>-1&&(this.zoneTotal++,this.zoneTotal===s.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i<e.length;i++){var s=e[i];if(s.willKill(t))return this.emit(c.DEATH_ZONE,this,t,s),!0}return!1},setEmitZone:function(t){var e;return(e=isFinite(t)?t:this.emitZones.indexOf(t))>=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new g(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var s=0;s<t;s++)e.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||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n<s;n++)t.call(e,i[n],this);return this},forEachDead:function(t,e){for(var i=this.dead,s=i.length,n=0;n<s;n++)t.call(e,i[n],this);return this},start:function(t,e){return void 0===t&&(t=0),this.emitting||(t>0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return P(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var s=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,s),s},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var s=this.dead,n=this.stopAfter,r=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o<t;o++){var h=s.pop();if(h||(h=new this.particleClass(this)),h.fire(r,a)?(this.particleBringToTop?this.alive.push(h):this.alive.unshift(h),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,h,this)):this.dead.push(h),n>0&&(this.stopCounter++,this.stopCounter>=n))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i<Math.abs(t);)this.preUpdate(0,e),i+=e;return this.skipping=!1,this},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible),this.getWorldTransformMatrix(this.worldMatrix);var s=this.getProcessors(),n=this.alive,r=this.dead,a=0,o=[],h=n.length;for(a=0;a<h;a++){var l=n[a];l.update(e,i,s)&&o.push({index:a,particle:l})}if((h=o.length)>0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];n.splice(f.index,1),r.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===n.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,s=i.length,n=[],r=0;r<s;r++){var a=i[r];M(t,a.getBounds(e))&&n.push(a)}return n},getBounds:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1e3/60),void 0===s&&(s=new C);var n,r,o=this.getWorldTransformMatrix(),h=this.alive,l=!1;if(s.setTo(0,0,0,0),e>0){var u=0;for(this.skipping=!0;u<Math.abs(e);){for(this.preUpdate(0,i),n=0;n<h.length;n++)r=h[n].getBounds(o),l?b(s,r):(l=!0,a(r,s));u+=i}this.skipping=!1}else for(n=0;n<h.length;n++)r=h[n].getBounds(o),l?b(s,r):(l=!0,a(r,s));return t>0&&x(s,t,t),s},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t<k.length;t++)e[k[t]].destroy();for(t=0;t<this.alive.length;t++)this.alive[t].destroy();for(t=0;t<this.dead.length;t++)this.dead[t].destroy();this.ops=null,this.alive=[],this.dead=[],this.worldMatrix.destroy()}});t.exports=I},9871:(t,e,i)=>{var s=i(59996),n=i(61340),r=new n,a=new n,o=new n,h=new n;t.exports=function(t,e,i,n){var l=r,u=a,c=o,d=h;n?(d.loadIdentity(),d.multiply(n),d.translate(e.x,e.y),d.rotate(e.rotation),d.scale(e.scaleX,e.scaleY)):d.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var f=t.currentContext,p=i.roundPixels,g=i.alpha,m=e.alpha,v=e.alive,y=v.length,x=e.viewBounds;if(e.visible&&0!==y&&(!x||s(x,i.worldView))){e.sortCallback&&e.depthSort(),i.addToRenderList(e);var w=e.scrollFactorX,b=e.scrollFactorY;f.save(),f.globalCompositeOperation=t.blendModes[e.blendMode];for(var T=0;T<y;T++){var S=v[T],E=S.alpha*m*g;if(!(E<=0||0===S.scaleX||0===S.scaleY)){c.applyITRS(S.x,S.y,S.rotation,S.scaleX,S.scaleY),l.copyFrom(i.matrix),l.multiplyWithOffset(d,-i.scrollX*w,-i.scrollY*b),c.e=S.x,c.f=S.y,l.multiply(c,u);var A=S.frame,C=A.canvasData;if(C.width>0&&C.height>0){var M=-A.halfWidth,_=-A.halfHeight;f.globalAlpha=E,f.save(),u.setToContext(f),p&&(M=Math.round(M),_=Math.round(_)),f.imageSmoothingEnabled=!A.source.scaleMode,f.drawImage(A.source.image,C.x,C.y,C.width,C.height,M,_,C.width,C.height),f.restore()}}}f.restore()}}},92730:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(95540),o=i(31600);n.register("particles",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,h,t),n&&h.setConfig(n),h}))},676:(t,e,i)=>{var s=i(39429),n=i(31600);s.register("particles",(function(t,e,i,s){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new n(this.scene,t,e,i,s))}))},90668:(t,e,i)=>{var s,n,r=i(29747);s=i(21188),n=i(9871),t.exports={renderWebGL:s,renderCanvas:n}},21188:(t,e,i)=>{var s=i(59996),n=i(61340),r=i(70554),a=new n,o=new n,h=new n,l=new n;t.exports=function(t,e,i,n){var u=t.pipelines.set(e.pipeline),c=a,d=o,f=h,p=l;n?(p.loadIdentity(),p.multiply(n),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=r.getTintAppendFloatAlpha,m=i.alpha,v=e.alpha;t.pipelines.preBatch(e);var y=e.alive,x=y.length,w=e.viewBounds;if(0!==x&&(!w||s(w,i.worldView))){e.sortCallback&&e.depthSort(),i.addToRenderList(e),c.copyFrom(i.matrix),c.multiplyWithOffset(p,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),t.setBlendMode(e.blendMode),e.mask&&(e.mask.preRenderWebGL(t,e,i),t.pipelines.set(e.pipeline));for(var b,T,S=e.tintFill,E=0;E<x;E++){var A=y[E],C=A.alpha*v*m;if(!(C<=0||0===A.scaleX||0===A.scaleY)){f.applyITRS(A.x,A.y,A.rotation,A.scaleX,A.scaleY),f.e=A.x,f.f=A.y,c.multiply(f,d);var M=A.frame;M.glTexture!==T&&(T=M.glTexture,b=u.setGameObject(e,M));var _=-M.halfWidth,R=-M.halfHeight,P=d.setQuad(_,R,_+M.width,R+M.height),L=g(A.tint,C);u.shouldFlush(6)&&(u.flush(),b=u.setGameObject(e,M)),u.batchQuad(e,P[0],P[1],P[2],P[3],P[4],P[5],P[6],P[7],M.u0,M.v0,M.u1,M.v1,L,L,L,L,S,T,b)}}e.mask&&e.mask.postRenderWebGL(t,i),t.pipelines.postBatch(e)}}},20286:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=!0),this.emitter,this.x=t,this.y=e,this.active=i},update:function(){},destroy:function(){this.emitter=null}});t.exports=s},9774:t=>{t.exports="complete"},812:t=>{t.exports="deathzone"},30522:t=>{t.exports="explode"},96695:t=>{t.exports="start"},18677:t=>{t.exports="stop"},20696:(t,e,i)=>{t.exports={COMPLETE:i(9774),DEATH_ZONE:i(812),EXPLODE:i(30522),START:i(96695),STOP:i(18677)}},18404:(t,e,i)=>{t.exports={EmitterColorOp:i(76472),EmitterOp:i(44777),Events:i(20696),GravityWell:i(24502),Particle:i(56480),ParticleBounds:i(69601),ParticleEmitter:i(31600),ParticleProcessor:i(20286),Zones:i(21024)}},26388:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=t.worldPosition,i=this.source.contains(e.x,e.y);return i&&this.killOnEnter||!i&&!this.killOnEnter}});t.exports=s},19909:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n,r){void 0===s&&(s=!1),void 0===n&&(n=!0),void 0===r&&(r=-1),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.total=r,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){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 e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68875:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(t){this.source=t,this._tempVec=new n,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},21024:(t,e,i)=>{t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(68287),a=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,a){r.call(this,t,i,s,n,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145:(t,e,i)=>{var s=i(39429),n=i(1159);s.register("follower",(function(t,e,i,s,r){var a=new n(this.scene,t,e,i,s,r);return this.displayList.add(a),this.updateList.add(a),a}))},33663:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(48803),a=i(90664),o=i(4703),h=i(45650),l=new n({Extends:o,initialize:function(t,e,i,n,r,a,h,l){n||(n="__DEFAULT"),o.call(this,t,e,i,n,r),this.type="Plane",this.anims=new s(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(a,h,l),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return.5}},originY:{get:function(){return.5}},setGridSize:function(t,e,i){void 0===t&&(t=8),void 0===e&&(e=8),void 0===i&&(i=!1);var s=!1;return i&&(s=!0),this.gridWidth=t,this.gridHeight=e,this.isTiled=i,this.clear(),r({mesh:this,widthSegments:t,heightSegments:e,isOrtho:!1,tile:i,flipY:s}),this},setSizeToFrame:function(t){void 0===t&&(t=!0);var e=this.frame;if(this.setPerspective(this.width/e.width,this.height/e.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!t)return this;var i,s,n=this.gridWidth,r=this.gridHeight,a=this.vertices,o=e.u0,h=e.u1,l=e.v0,u=e.v1,c=0;if(this.isTiled)for(l=e.v1,u=e.v0,s=0;s<r;s++)for(i=0;i<n;i++)a[c++].setUVs(o,u),a[c++].setUVs(o,l),a[c++].setUVs(h,u),a[c++].setUVs(o,l),a[c++].setUVs(h,l),a[c++].setUVs(h,u);else{var d=n+1,f=r+1,p=h-o,g=u-l,m=[];for(s=0;s<f;s++)for(i=0;i<d;i++){var v=o+p*(i/n),y=l+g*(s/r);m.push(v,y)}for(s=0;s<r;s++)for(i=0;i<n;i++){var x=2*(i+d*s),w=2*(i+d*(s+1)),b=2*(i+1+d*(s+1)),T=2*(i+1+d*s);a[c++].setUVs(m[x],m[x+1]),a[c++].setUVs(m[w],m[w+1]),a[c++].setUVs(m[T],m[T+1]),a[c++].setUVs(m[w],m[w+1]),a[c++].setUVs(m[b],m[b+1]),a[c++].setUVs(m[T],m[T+1])}}return this},setViewHeight:function(t){void 0===t&&(t=this.frame.height);var e=this.fov*(Math.PI/180);this.viewPosition.z=this.height/t/Math.tan(e/2),this.dirtyCache[10]=1},createCheckerboard:function(t,e,i,s,n){void 0===t&&(t=16777215),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=128);for(var r=a(t),o=a(e),l=[],u=0;u<16;u++)for(var c=0;c<16;c++)u<8&&c<8||u>7&&c>7?l.push(r.r,r.g,r.b,i):l.push(o.r,o.g,o.b,s);var d=this.scene.sys.textures.addUint8Array(h(),new Uint8Array(l),16,16);return this.removeCheckerboard(),this.setTexture(d),this.setSizeToFrame(),this.setViewHeight(n),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},preUpdate:function(t,e){o.prototype.preUpdate.call(this,t,e),this.anims.update(t,e)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});t.exports=l},56015:(t,e,i)=>{var s=i(25305),n=i(13059),r=i(44603),a=i(23568),o=i(35154),h=i(33663);r.register("plane",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),r=a(t,"frame",null),l=o(t,"width",8),u=o(t,"height",8),c=o(t,"tile",!1),d=new h(this.scene,0,0,i,r,l,u,c);void 0!==e&&(t.add=e);var f=o(t,"checkerboard",null);if(f){var p=o(f,"color1",16777215),g=o(f,"color2",255),m=o(f,"alpha1",255),v=o(f,"alpha2",255),y=o(f,"height",128);d.createCheckerboard(p,g,m,v,y)}return s(this.scene,d,t),n(d,t),d}))},30985:(t,e,i)=>{var s=i(33663);i(39429).register("plane",(function(t,e,i,n,r,a,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o))}))},80321:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),a=i(30100),o=i(36060),h=i(67277),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(o.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(e,i),this.color=a(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(80321);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),o=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new a(this.scene,0,0,i,n,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},71255:(t,e,i)=>{var s=i(39429),n=i(80321);s.register("pointlight",(function(t,e,i,s,r,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,a))}))},67277:(t,e,i)=>{var s,n=i(29747),r=n;s=i(57787),t.exports={renderWebGL:s,renderCanvas:r}},57787:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),a=s(e,i,n).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+o,d=u+h,f=a.getX(0,0),p=a.getY(0,0),g=a.getX(l,u),m=a.getY(l,u),v=a.getX(l,d),y=a.getY(l,d),x=a.getX(c,d),w=a.getY(c,d),b=a.getX(c,u),T=a.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,g,m,v,y,x,w,b,T,f,p),t.pipelines.postBatch(e)}},591:(t,e,i)=>{var s=i(83419),n=i(81320),r=i(88571),a=new s({Extends:r,initialize:function(t,e,i,s,a,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===a&&(a=32),void 0===o&&(o=!0);var h=new n(t.sys.textures,"",s,a,o);r.call(this,t,e,i,h),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture;return e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0),e},fill:function(t,e,i,s,n,r){return this.texture.fill(t,e,i,s,n,r),this},clear:function(){return this.texture.clear(),this},stamp:function(t,e,i,s,n){return this.texture.stamp(t,e,i,s,n),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,s,n){return this.texture.draw(t,e,i,s,n),this},drawFrame:function(t,e,i,s,n,r){return this.texture.drawFrame(t,e,i,s,n,r),this},repeat:function(t,e,i,s,n,r,a,o,h){return this.texture.repeat(t,e,i,s,n,r,a,o,h),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(t,e,i,s,n){return this.texture.batchDraw(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){return this.texture.batchDrawFrame(t,e,i,s,n,r),this},endDraw:function(t){return this.texture.endDraw(t),this},snapshotArea:function(t,e,i,s,n,r,a){return this.texture.snapshotArea(t,e,i,s,n,r,a),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=a},34495:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(591);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),o=r(t,"width",32),h=r(t,"height",32),l=new a(this.scene,i,n,o,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},60505:(t,e,i)=>{var s=i(39429),n=i(591);s.register("renderTexture",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},77757:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(31401),a=i(95643),o=i(36060),h=i(38745),l=i(26099),u=new n({Extends:a,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.PostPipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),a.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(o.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;s<i;s++)n[r=2*s]=t,n[r+1]=e;else if(t.length===i)for(s=0;s<i;s++)n[r=2*s]=t[s],n[r+1]=t[s];else{var a=t[0];for(s=0;s<i;s++)r=2*s,t.length>r&&(a=t[r]),n[r]=a,t.length>r+1&&(a=t[r+1]),n[r+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;i<e;i++)s[n=2*i]=t[i],s[n+1]=t[i];else{var r=t[0];for(i=0;i<e;i++)n=2*i,t.length>n&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(a-1),s=0;s<a;s++)t.push({x:r+s*n,y:0});else for(r=-this.frame.halfHeight,n=this.frame.height/(a-1),s=0;s<a;s++)t.push({x:0,y:r+s*n})}var o=t.length,h=this.points.length;return o<1?(console.warn("Rope: Not enough points given"),this):(1===o&&(t.unshift({x:0,y:0}),o++),h!==o&&this.resizeArrays(o),this.dirty=!0,this.points=t,this.updateUVs(),null!=e&&this.setColors(e),null!=i&&this.setAlphas(i),this)},updateUVs:function(){for(var t=this.uv,e=this.points.length,i=this.frame.u0,s=this.frame.v0,n=this.frame.u1,r=this.frame.v1,a=(n-i)/(e-1),o=(r-s)/(e-1),h=0;h<e;h++){var l,u,c,d,f=4*h;this.horizontal?(this._flipX?(l=n-h*a,c=n-h*a):(l=i+h*a,c=i+h*a),this._flipY?(u=r,d=s):(u=s,d=r)):(this._flipX?(l=i,c=n):(l=n,c=i),this._flipY?(u=r-h*o,d=r-h*o):(u=s+h*o,d=s+h*o)),t[f+0]=l,t[f+1]=u,t[f+2]=c,t[f+3]=d}return this},resizeArrays:function(t){var e=this.colors,i=this.alphas;this.vertices=new Float32Array(4*t),this.uv=new Float32Array(4*t),e=new Uint32Array(2*t),i=new Float32Array(2*t);for(var s=0;s<2*t;s++)e[s]=16777215,i[s]=1;return this.colors=e,this.alphas=i,this.dirty=!0,this},updateVertices:function(){var t=this._perp,e=this.points,i=this.vertices,s=e.length;if(this.dirty=!1,!(s<1)){for(var n,r=e[0],a=this.horizontal?this.frame.halfHeight:this.frame.halfWidth,o=0;o<s;o++){var h=e[o],l=4*o;n=o<s-1?e[o+1]:h,t.x=n.y-r.y,t.y=-(n.x-r.x);var u=t.length();t.x/=u,t.y/=u,t.x*=a,t.y*=a,i[l]=h.x+t.x,i[l+1]=h.y+t.y,i[l+2]=h.x-t.x,i[l+3]=h.y-t.y,r=h}return this}},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebugVerts:null,this},renderDebugVerts:function(t,e,i){var s=t.debugGraphic,n=i[0],r=i[1],a=i[2],o=i[3];s.lineBetween(n,r,a,o);for(var h=4;h<e;h+=4){var l=i[h+0],u=i[h+1],c=i[h+2],d=i[h+3];s.lineBetween(n,r,l,u),s.lineBetween(a,o,c,d),s.lineBetween(a,o,l,u),s.lineBetween(l,u,c,d),n=l,r=u,a=c,o=d}},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(t){return this._flipX=t,this.updateUVs()}},flipY:{get:function(){return this._flipY},set:function(t){return this._flipY=t,this.updateUVs()}}});t.exports=u},95262:t=>{t.exports=function(){}},26209:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(35154),o=i(77757);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=a(t,"points",void 0),u=a(t,"colors",void 0),c=a(t,"alphas",void 0),d=new o(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),d}))},96819:(t,e,i)=>{var s=i(77757);i(39429).register("rope",(function(t,e,i,n,r,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h))}))},38745:(t,e,i)=>{var s,n,r=i(29747);s=i(20439),n=i(95262),t.exports={renderWebGL:s,renderCanvas:n}},20439:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),o=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,f=n.getTintAppendFloatAlpha,p=i.roundPixels,g=h.length,m=Math.floor(.5*g);a.flush(),t.pipelines.preBatch(e);var v=a.setGameObject(e),y=a.vertexViewF32,x=a.vertexViewU32,w=a.vertexCount*a.currentShader.vertexComponentCount-1,b=0,T=e.tintFill;e.dirty&&e.updateVertices();for(var S=e.debugCallback,E=[],A=0;A<g;A+=2){var C=h[A+0],M=h[A+1],_=C*o.a+M*o.c+o.e,R=C*o.b+M*o.d+o.f;p&&(_=Math.round(_),R=Math.round(R)),y[++w]=_,y[++w]=R,y[++w]=l[A+0],y[++w]=l[A+1],y[++w]=v,y[++w]=T,x[++w]=f(u[b],i.alpha*(c[b]*d)),b++,S&&(E[A+0]=_,E[A+1]=R)}S&&S.call(e,e,g,E),a.vertexCount+=m,a.currentBatch.count=a.vertexCount-a.currentBatch.start,t.pipelines.postBatch(e)}},20071:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),a=i(95540),o=i(79291),h=i(61622),l=i(25479),u=i(61340),c=i(95428),d=i(92503),f=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,a,o,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===a&&(a=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this._deferSetShader=null,this._deferProjOrtho=null,this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,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=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,a),this.setOrigin(.5,.5),this.setShader(e,o,h),this.renderer.on(d.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(this.renderer.contextLost)return this._deferSetShader={key:t,textures:e,textureData:i},this;if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&r.deleteProgram(this.program);var a=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(a.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(a.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(a.webGLProgram,"uResolution"),this.width,this.height),this.program=a;var h=new Date,l={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:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.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=o(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){if(this.renderer.contextLost)this._deferProjOrtho={left:t,right:e,bottom:i,top:s};else{var n=1/(t-e),r=1/(i-s),a=this.projectionMatrix;a[0]=-2*n,a[5]=-2*r,a[10]=-.001,a[12]=(t+e)*n,a[13]=(s+i)*r,a[14]=-0;var o=this.program,h=this.gl;this.renderer.setProgram(o),h.uniformMatrix4fv(h.getUniformLocation(o.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i}},initUniforms:function(){var t=this.renderer.glFuncMap,e=this.program;for(var i in this._textureCount=0,this.uniforms){var s=this.uniforms[i],n=s.type,r=t[n];s.uniformLocation=this.renderer.createUniformLocation(e,i),"sampler2D"!==n&&(s.glMatrix=r.matrix,s.glValueLength=r.length,s.glFunc=r.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var a=this.uniforms[t];return a.value=e,r.width=i,r.height=s,a.textureData=r,this._textureCount=n,this.initSampler2D(a),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var a=this.uniforms[t],o=r.source;a.textureKey=e,a.source=o.image,a.value=r.glTexture,o.isGLTexture&&(s||(s={}),s.width=o.width,s.height=o.height),s&&(a.textureData=s),this._textureCount=i,this.initSampler2D(a)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return a(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=t.textureData;if(e&&!t.value.isRenderTexture){var i=this.gl,s=t.value,n=i[a(e,"magFilter","linear").toUpperCase()],r=i[a(e,"minFilter","linear").toUpperCase()],o=i[a(e,"wrapS","repeat").toUpperCase()],h=i[a(e,"wrapT","repeat").toUpperCase()],l=i[a(e,"format","rgba").toUpperCase()],u=a(e,"flipY",!1),c=a(e,"width",s.width),d=a(e,"height",s.height),f=a(e,"source",s.pixels);e.repeat&&(o=i.REPEAT,h=i.REPEAT),e.width&&(f=null),s.update(f,c,d,u,o,h,r,n,l)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,a=this.uniforms,o=0;for(var h in a)i=(t=a[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s.webGLUniformLocation,t.transpose,n):i.call(r,s.webGLUniformLocation,n):2===e?i.call(r,s.webGLUniformLocation,n.x,n.y):3===e?i.call(r,s.webGLUniformLocation,n.x,n.y,n.z):4===e?i.call(r,s.webGLUniformLocation,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+o),r.bindTexture(r.TEXTURE_2D,n.webGLTexture),r.uniform1i(s.webGLUniformLocation,o),o++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,a=this.viewMatrix;if(!this.renderToTexture){var o=-this._displayOriginX,h=-this._displayOriginY;a[0]=t[0],a[1]=t[1],a[4]=t[2],a[5]=t[3],a[8]=t[4],a[9]=t[5],a[12]=a[0]*o+a[4]*h,a[13]=a[1]*o+a[5]*h}e.useProgram(r.webGLProgram),e.uniformMatrix4fv(e.getUniformLocation(r.webGLProgram,"uViewMatrix"),!1,a),e.uniformMatrix4fv(e.getUniformLocation(r.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),e.uniform2f(e.getUniformLocation(r.webGLProgram,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,f=c.x/i,p=1-c.y/s;d.value.x=f.toFixed(2),d.value.y=p.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,a=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n.webGLBuffer);var o=s.getAttribLocation(i.webGLProgram,"inPosition");-1!==o&&(s.enableVertexAttribArray(o),s.vertexAttribPointer(o,2,s.FLOAT,!1,a,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t,s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*a)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(null!==this._deferSetShader){var t=this._deferSetShader.key,e=this._deferSetShader.textures,i=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(t,e,i)}if(null!==this._deferProjOrtho){var s=this._deferProjOrtho.left,n=this._deferProjOrtho.right,r=this._deferProjOrtho.bottom,a=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(s,n,r,a)}},preDestroy:function(){var t=this.renderer;t.off(d.RESTORE_WEBGL,this.onContextRestored,this),t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(t.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),c(this.uniforms,(function(e){t.deleteUniformLocation(e.uniformLocation),e.uniformLocation=null}))}});t.exports=f},80464:t=>{t.exports=function(){}},54935:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(20071);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),o=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new a(this.scene,i,n,o,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},74177:(t,e,i)=>{var s=i(20071);i(39429).register("shader",(function(t,e,i,n,r,a,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o))}))},25479:(t,e,i)=>{var s,n,r=i(29747);s=i(19257),n=i(80464),t.exports={renderWebGL:s,renderCanvas:n}},19257:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},10441:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n,r,a){for(var o=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u<l.length;u+=3){var c=2*l[u],d=2*l[u+1],f=2*l[u+2],p=h[c+0]-r,g=h[c+1]-a,m=h[d+0]-r,v=h[d+1]-a,y=h[f+0]-r,x=h[f+1]-a,w=e.getX(p,g),b=e.getY(p,g),T=e.getX(m,v),S=e.getY(m,v),E=e.getX(y,x),A=e.getY(y,x);t.batchTri(i,w,b,T,S,E,A,0,0,1,1,o,o,o,2)}}},65960:t=>{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,a=(16711680&n)>>>16,o=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+a+","+o+","+h+","+r+")"}},75177:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,a=(16711680&n)>>>16,o=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+a+","+o+","+h+","+r+")",t.lineWidth=e.lineWidth}},17803:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),a=i(23031),o=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,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 a,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=o},34682:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n,r){var a=t.strokeTint,o=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);a.TL=o,a.TR=o,a.BL=o,a.BR=o;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p<l;p+=2){var g=h[p]-n,m=h[p+1]-r;t.batchLine(d,f,g,m,c,c,u,p-2,!!e.closePath&&p===l-1),d=g,f=m}}},23629:(t,e,i)=>{var s=i(13609),n=i(83419),r=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),o=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[o+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(o+Math.cos(u)*i,l+Math.sin(u)*i),c.push(o+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=a(c),this.pathData=c,this}});t.exports=u},42542:(t,e,i)=>{var s=i(39506),n=i(65960),r=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},42563:(t,e,i)=>{var s=i(23629),n=i(39429);n.register("arc",(function(t,e,i,n,r,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},13609:(t,e,i)=>{var s,n,r=i(29747);s=i(41447),n=i(42542),t.exports={renderWebGL:s,renderCanvas:n}},41447:(t,e,i)=>{var s=i(91296),n=i(10441),r=i(34682);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},89:(t,e,i)=>{var s=i(83419),n=i(33141),r=i(94811),a=i(87841),o=i(17803),h=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n<s.length;n++)i.push(s[n].x,s[n].y);return i.push(s[0].x,s[0].y),this.pathIndexes=r(i),this.pathData=i,this}});t.exports=h},3170:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p<c;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}e.closePath&&o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(n(o,e),o.stroke()),o.restore()}}},40511:(t,e,i)=>{var s=i(39429),n=i(89);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},33141:(t,e,i)=>{var s,n,r=i(29747);s=i(53987),n=i(3170),t.exports={renderWebGL:s,renderCanvas:n}},53987:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},19921:(t,e,i)=>{var s=i(83419),n=i(94811),r=i(54205),a=i(8497),o=i(17803),h=new s({Extends:o,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),o.call(this,t,"Ellipse",new a(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateDisplayOrigin(),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=n(t),this.pathData=t,this}});t.exports=h},7930:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p<c;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(n(o,e),o.stroke()),o.restore()}}},1543:(t,e,i)=>{var s=i(19921);i(39429).register("ellipse",(function(t,e,i,n,r,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,a))}))},54205:(t,e,i)=>{var s,n,r=i(29747);s=i(19467),n=i(7930),t.exports={renderWebGL:s,renderCanvas:n}},19467:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},30479:(t,e,i)=>{var s=i(83419),n=i(17803),r=i(26015),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,a,o,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===a&&(a=32),void 0===o&&(o=32),n.call(this,t,"Grid",null),this.cellWidth=a,this.cellHeight=o,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=a},49912:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(c/f),m=Math.ceil(d/p),v=f,y=p,x=f-(g*f-c),w=p-(m*p-d),b=e.showCells,T=e.showAltCells,S=e.showOutline,E=0,A=0,C=0,M=0,_=0;if(S&&(v--,y--,x===f&&x--,w===p&&w--),b&&e.fillAlpha>0)for(s(o,e),A=0;A<m;A++)for(T&&(C=A%2),E=0;E<g;E++)T&&C?C=0:(C++,M=E<g-1?v:x,_=A<m-1?y:w,o.fillRect(h+E*f,l+A*p,M,_));if(T&&e.altFillAlpha>0)for(s(o,e,e.altFillColor,e.altFillAlpha*u),A=0;A<m;A++)for(T&&(C=A%2),E=0;E<g;E++)!T||C?(C=0,M=E<g-1?v:x,_=A<m-1?y:w,o.fillRect(h+E*f,l+A*p,M,_)):C=1;if(S&&e.outlineFillAlpha>0){for(n(o,e,e.outlineFillColor,e.outlineFillAlpha*u),E=1;E<g;E++){var R=E*f;o.beginPath(),o.moveTo(R+h,l),o.lineTo(R+h,d+l),o.stroke()}for(A=1;A<m;A++){var P=A*p;o.beginPath(),o.moveTo(h,P+l),o.lineTo(h+c,P+l),o.stroke()}}o.restore()}}},34137:(t,e,i)=>{var s=i(39429),n=i(30479);s.register("grid",(function(t,e,i,s,r,a,o,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h,l,u))}))},26015:(t,e,i)=>{var s,n,r=i(29747);s=i(46161),n=i(49912),t.exports={renderWebGL:s,renderCanvas:n}},46161:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,r);a.calcMatrix.copyFrom(o.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(c/f),m=Math.ceil(d/p),v=f,y=p,x=f-(g*f-c),w=p-(m*p-d),b=e.showCells,T=e.showAltCells,S=e.showOutline,E=0,A=0,C=0,M=0,_=0;if(S&&(v--,y--,x===f&&x--,w===p&&w--),t.pipelines.preBatch(e),b&&e.fillAlpha>0)for(h=a.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A<m;A++)for(T&&(C=A%2),E=0;E<g;E++)T&&C?C=0:(C++,M=E<g-1?v:x,_=A<m-1?y:w,a.batchFillRect(E*f,A*p,M,_));if(T&&e.altFillAlpha>0)for(h=a.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A<m;A++)for(T&&(C=A%2),E=0;E<g;E++)!T||C?(C=0,M=E<g-1?v:x,_=A<m-1?y:w,a.batchFillRect(E*f,A*p,M,_)):C=1;if(S&&e.outlineFillAlpha>0){var R=a.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(R.TL=P,R.TR=P,R.BL=P,R.BR=P,E=1;E<g;E++){var L=E*f;a.batchLine(L,0,L,d,e.lineWidth,e.lineWidth,1,0,!1)}for(A=1;A<m;A++){var F=A*p;a.batchLine(0,F,c,F,e.lineWidth,e.lineWidth,1,0,!1)}}t.pipelines.postBatch(e)}},61475:(t,e,i)=>{var s=i(99651),n=i(83419),r=i(17803),a=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508:(t,e,i)=>{var s=i(65960),n=i(20926);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.currentContext;if(n(t,a,e,i,r)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933:(t,e,i)=>{var s=i(39429),n=i(61475);s.register("isobox",(function(t,e,i,s,r,a,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o))}))},99651:(t,e,i)=>{var s,n,r=i(29747);s=i(68149),n=i(11508),t.exports={renderWebGL:s,renderCanvas:n}},68149:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var a,o,h,l,u,c,d,f,p,g=t.pipelines.set(e.pipeline),m=s(e,i,r),v=g.calcMatrix.copyFrom(m.calc),y=e.width,x=e.height,w=y/2,b=y/e.projection,T=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(a=n.getTintAppendFloatAlpha(e.fillTop,T),o=v.getX(-w,-x),h=v.getY(-w,-x),l=v.getX(0,-b-x),u=v.getY(0,-b-x),c=v.getX(w,-x),d=v.getY(w,-x),f=v.getX(0,b-x),p=v.getY(0,b-x),g.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),e.showLeft&&(a=n.getTintAppendFloatAlpha(e.fillLeft,T),o=v.getX(-w,0),h=v.getY(-w,0),l=v.getX(0,b),u=v.getY(0,b),c=v.getX(0,b-x),d=v.getY(0,b-x),f=v.getX(-w,-x),p=v.getY(-w,-x),g.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),e.showRight&&(a=n.getTintAppendFloatAlpha(e.fillRight,T),o=v.getX(w,0),h=v.getY(w,0),l=v.getX(0,b),u=v.getY(0,b),c=v.getX(0,b-x),d=v.getY(0,b-x),f=v.getX(w,-x),p=v.getY(w,-x),g.batchQuad(e,o,h,l,u,c,d,f,p,0,0,1,1,a,a,a,a,2)),t.pipelines.postBatch(e))}},16933:(t,e,i)=>{var s=i(83419),n=i(60561),r=i(17803),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590:(t,e,i)=>{var s=i(65960),n=i(20926);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.currentContext;if(n(t,a,e,i,r)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,c=e.isReversed;e.showTop&&c&&(s(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(s(a,e,e.fillLeft),a.beginPath(),c?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(s(a,e,e.fillRight),a.beginPath(),c?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803:(t,e,i)=>{var s=i(39429),n=i(16933);s.register("isotriangle",(function(t,e,i,s,r,a,o,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h))}))},60561:(t,e,i)=>{var s,n,r=i(29747);s=i(51503),n=i(79590),t.exports={renderWebGL:s,renderCanvas:n}},51503:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,r),h=a.calcMatrix.copyFrom(o.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,f=e.isReversed,p=i.alpha*e.alpha;if(e.isFilled){var g,m,v,y,x,w,b;if(t.pipelines.preBatch(e),e.showTop&&f){g=n.getTintAppendFloatAlpha(e.fillTop,p),m=h.getX(-c,-u),v=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),w=h.getX(c,-u),b=h.getY(c,-u);var T=h.getX(0,d-u),S=h.getY(0,d-u);a.batchQuad(e,m,v,y,x,w,b,T,S,0,0,1,1,g,g,g,g,2)}e.showLeft&&(g=n.getTintAppendFloatAlpha(e.fillLeft,p),f?(m=h.getX(-c,-u),v=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)):(m=h.getX(-c,0),v=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)),a.batchTri(e,m,v,y,x,w,b,0,0,1,1,g,g,g,2)),e.showRight&&(g=n.getTintAppendFloatAlpha(e.fillRight,p),f?(m=h.getX(c,-u),v=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)):(m=h.getX(c,0),v=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)),a.batchTri(e,m,v,y,x,w,b,0,0,1,1,g,g,g,2)),t.pipelines.postBatch(e)}}},57847:(t,e,i)=>{var s=i(83419),n=i(17803),r=i(23031),a=i(36823),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,a,o,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=o},17440:(t,e,i)=>{var s=i(75177),n=i(20926);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.currentContext;if(n(t,a,e,i,r)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481:(t,e,i)=>{var s=i(39429),n=i(57847);s.register("line",(function(t,e,i,s,r,a,o,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h))}))},36823:(t,e,i)=>{var s,n,r=i(29747);s=i(77385),n=i(17440),t.exports={renderWebGL:s,renderCanvas:n}},77385:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),o=s(e,i,r);a.calcMatrix.copyFrom(o.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=a.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d,a.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,e._startWidth/2,e._endWidth/2,1,0,!1,o.sprite,o.camera)}t.pipelines.postBatch(e)}},24949:(t,e,i)=>{var s=i(90273),n=i(83419),r=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(s));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e<t;e++)l(this.geom);return this.updateData()},setTo:function(t){this.geom.setTo(t);var e=a(this.geom);return this.setSize(e.width,e.height),this.updateDisplayOrigin(),this.updateData()},updateData:function(){for(var t=[],e=this.geom.points,i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=u},38710:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p<c;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}e.closePath&&o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(n(o,e),o.stroke()),o.restore()}}},64827:(t,e,i)=>{var s=i(39429),n=i(24949);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},90273:(t,e,i)=>{var s,n,r=i(29747);s=i(73695),n=i(38710),t.exports={renderWebGL:s,renderCanvas:n}},73695:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},74561:(t,e,i)=>{var s=i(83419),n=i(94811),r=i(87841),a=i(17803),o=i(95597),h=new s({Extends:a,Mixins:[o],initialize:function(t,e,i,s,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Rectangle",new r(0,0,s,n)),this.radius=20,this.isRounded=!1,this.setPosition(e,i),this.setSize(s,n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setRounded:function(t){return void 0===t&&(t=16),this.radius=t,this.isRounded=t>0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,s=Math.min(e,i),r=Math.min(this.radius,s),a=e,o=i,h=Math.max(1,Math.floor(r/5));return this.arcTo(t,a-e+r,o-i+r,r,Math.PI,1.5*Math.PI,h),t.push(a+e-r,o-i),this.arcTo(t,a+e-r,o-i+r,r,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-r),this.arcTo(t,a+e-r,o+i-r,r,0,.5*Math.PI,h),t.push(a-e+r,o+i),this.arcTo(t,a-e+r,o+i-r,r,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+r),this.pathIndexes=n(t),this.pathData=t,this},arcTo:function(t,e,i,s,n,r,a){for(var o=(r-n)/a,h=0;h<=a;h++){var l=n+o*h;t.push(e+Math.cos(l)*s,i+Math.sin(l)*s)}}});t.exports=h},48682:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926),a=function(t,e,i,s,n,r){var a=Math.min(s/2,n/2),o=Math.min(r,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+s-o,i),t.arcTo(e+s,i,e+s,i+o,o),t.lineTo(e+s,i+n-o),t.arcTo(e+s,i+n,e+s-o,i+n,o),t.lineTo(e+o,i+n),t.arcTo(e,i+n,e,i+n-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,s,n)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(r(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(s(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(n(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959:(t,e,i)=>{var s=i(39429),n=i(74561);s.register("rectangle",(function(t,e,i,s,r,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,a))}))},95597:(t,e,i)=>{var s,n,r=i(29747);s=i(52059),n=i(48682),t.exports={renderWebGL:s,renderCanvas:n}},52059:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682),a=i(70554);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.pipelines.set(e.pipeline),l=n(e,i,o);h.calcMatrix.copyFrom(l.calc);var u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isRounded&&e.isFilled)s(h,l.calc,e,d,u,c);else if(e.isFilled){var f=h.fillTint,p=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d);f.TL=p,f.TR=p,f.BL=p,f.BR=p,h.batchFillRect(-u,-c,e.width,e.height)}e.isStroked&&r(h,e,d,u,c),t.pipelines.postBatch(e)}},55911:(t,e,i)=>{var s=i(81991),n=i(83419),r=i(94811),a=i(17803),o=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),a.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,a=Math.PI/e,o=s,h=s;t.push(o,h+-s);for(var l=0;l<e;l++)t.push(o+Math.cos(n)*s,h+Math.sin(n)*s),n+=a,t.push(o+Math.cos(n)*i,h+Math.sin(n)*i),n+=a;return t.push(o,h+-s),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=o},64272:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p<c;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(n(o,e),o.stroke()),o.restore()}}},93697:(t,e,i)=>{var s=i(55911);i(39429).register("star",(function(t,e,i,n,r,a,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,a,o))}))},81991:(t,e,i)=>{var s,n,r=i(29747);s=i(57017),n=i(64272),t.exports={renderWebGL:s,renderCanvas:n}},57017:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=n(e,i,a),l=o.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(o,l,e,d,u,c),e.isStroked&&r(o,e,d,u,c),t.pipelines.postBatch(e)}},36931:(t,e,i)=>{var s=i(83419),n=i(17803),r=i(16483),a=i(96195),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,s,a,o,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===a&&(a=128),void 0===o&&(o=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,a,o,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=o},85172:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,f=e.geom.y2-l,p=e.geom.x3-h,g=e.geom.y3-l;o.beginPath(),o.moveTo(u,c),o.lineTo(d,f),o.lineTo(p,g),o.closePath(),e.isFilled&&(s(o,e),o.fill()),e.isStroked&&(n(o,e),o.stroke()),o.restore()}}},45245:(t,e,i)=>{var s=i(39429),n=i(36931);s.register("triangle",(function(t,e,i,s,r,a,o,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,a,o,h,l,u))}))},96195:(t,e,i)=>{var s,n,r=i(29747);s=i(83253),n=i(85172),t.exports={renderWebGL:s,renderCanvas:n}},83253:(t,e,i)=>{var s=i(91296),n=i(34682),r=i(70554);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),h=s(e,i,a);o.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=o.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e.geom.x1-l,g=e.geom.y1-u,m=e.geom.x2-l,v=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;o.batchFillTriangle(p,g,m,v,y,x,h.sprite,h.camera)}e.isStroked&&n(o,e,c,l,u),t.pipelines.postBatch(e)}},68287:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(31401),a=i(95643),o=i(92751),h=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,o],initialize:function(t,e,i,n,r){a.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},76552:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},15567:(t,e,i)=>{var s=i(25305),n=i(13059),r=i(44603),a=i(23568),o=i(68287);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=a(t,"key",null),r=a(t,"frame",null),h=new o(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},46409:(t,e,i)=>{var s=i(39429),n=i(68287);s.register("sprite",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},92751:(t,e,i)=>{var s,n,r=i(29747);s=i(9409),n=i(76552),t.exports={renderWebGL:s,renderCanvas:n}},9409:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},14220:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,a=[],o=0,h=i.length;r.maxLines>0&&r.maxLines<i.length&&(h=r.maxLines),r.syncFont(s,n);for(var l=t.letterSpacing,u=0;u<h;u++){var c=r.strokeThickness;if(0===l)c+=n.measureText(i[u]).width;else{for(var d=i[u],f=0;f<d.length;f++)c+=n.measureText(d[f]).width;d.length>1&&(c+=l*(d.length-1))}r.wordWrap&&(c-=n.measureText(" ").width),a[u]=Math.ceil(c),o=Math.max(o,a[u])}var p=e.fontSize+r.strokeThickness,g=p*h,m=t.lineSpacing;return h>1&&(g+=m*(h-1)),{width:o,height:g,lines:h,lineWidths:a,lineSpacing:m,lineHeight:p}}},79557:(t,e,i)=>{var s=i(27919);t.exports=function(t){var e=s.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,a=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:a,fontSize:r+a}}var o=Math.ceil(n.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,o,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,f,p=c.data,g=p.length,m=4*o,v=0,y=!1;for(d=0;d<h;d++){for(f=0;f<m;f+=4)if(255!==p[v+f]){y=!0;break}if(y)break;v+=m}for(u.ascent=h-d,v=g-m,y=!1,d=l;d>h;d--){for(f=0;f<m;f+=4)if(255!==p[v+f]){y=!0;break}if(y)break;v-=m}return u.descent=d-h,u.fontSize=u.ascent+u.descent,s.remove(e),u}},50171:(t,e,i)=>{var s=i(40366),n=i(27919),r=i(83419),a=i(31401),o=i(95643),h=i(14220),l=i(35154),u=i(35846),c=i(61771),d=i(35762),f=i(45650),p=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,c],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=n.create(this),this.context,this.style=new d(this,r),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.letterSpacing=0,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=t.sys.textures.addCanvas(this._textureKey,this.canvas),this.context=this.texture.context,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(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),r&&r.letterSpacing&&this.setLetterSpacing(r.letterSpacing)},initRTL:function(){if(!this.style.rtl)return this.canvas.dir="ltr",void(this.context.direction="ltr");this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,a=0;a<r;a++){var o=n[a],h="",l=(o=o.replace(/^ *|\s*$/gi,"")).length*this.letterSpacing;if(e.measureText(o).width+l<i)s+=o+"\n";else{for(var u=i,c=o.split(" "),d=0;d<c.length;d++){var f=c[d],p=f+" ",g=p.length*this.letterSpacing,m=e.measureText(p).width+g;if(m>u){if(0===d){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((m=e.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);c[d]=x,h+=v}var w=c[d].length?d:d+1,b=c.slice(w).join(" ").replace(/[ \n]*$/gi,"");n.splice(a+1,0,b),r=n.length;break}h+=p,u-=m}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,a=e.measureText(" ").width,o=0;o<=r;o++){for(var h=i,l=n[o].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],f=d.length*this.letterSpacing,p=e.measureText(d).width+f,g=p;c<u&&(g+=a),g>h&&c>0&&(s+="\n",h=i),s+=d,c<u?(s+=" ",h-=g):h-=p}o<r&&(s+="\n")}return s},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},appendText:function(t,e){void 0===e&&(e=!0),t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t=t.toString();var i=this._text.concat(e?"\n"+t:t);return i!==this._text&&(this._text=i,this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,s,n,r){return this.style.setShadow(t,e,i,s,n,r)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setLetterSpacing:function(t){return this.letterSpacing=t,this.updateText()},setPadding:function(t,e,i,s){if("object"==typeof t){var n=t,r=l(n,"x",null);null!==r?(t=r,i=r):(t=l(n,"left",0),i=l(n,"right",t));var a=l(n,"y",null);null!==a?(e=a,s=a):(e=l(n,"top",0),s=l(n,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=s,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},setRTL:function(t){void 0===t&&(t=!0);var e=this.style;return e.rtl===t||(e.rtl=t,t?(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas)):(this.canvas.dir="ltr",this.context.direction="ltr"),"left"===e.align?e.align="right":"right"===e.align&&(e.align="left")),this},updateText:function(){var t=this.canvas,e=this.context,i=this.style,s=i.resolution,n=i.metrics;i.syncFont(t,e);var r=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(r=this.runWordWrap(this._text));var a,o=r.split(this.splitRegExp),l=h(this,n,o),u=this.padding;0===i.fixedWidth?(this.width=l.width+u.left+u.right,a=l.width):(this.width=i.fixedWidth,(a=this.width-u.left-u.right)<l.width&&(a=l.width)),0===i.fixedHeight?this.height=l.height+u.top+u.bottom:this.height=i.fixedHeight;var c,d,f=this.width,p=this.height;this.updateDisplayOrigin(),f*=s,p*=s,f=Math.max(f,1),p=Math.max(p,1),t.width!==f||t.height!==p?(t.width=f,t.height=p,this.frame.setSize(f,p),i.syncFont(t,e),i.rtl&&(e.direction="rtl")):e.clearRect(0,0,f,p),e.save(),e.scale(s,s),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,f,p)),i.syncStyle(t,e),e.translate(u.left,u.top);for(var g=0;g<l.lines;g++){if(c=i.strokeThickness/2,d=i.strokeThickness/2+g*l.lineHeight+n.ascent,g>0&&(d+=l.lineSpacing*g),i.rtl)c=f-c-u.left-u.right;else if("right"===i.align)c+=a-l.lineWidths[g];else if("center"===i.align)c+=(a-l.lineWidths[g])/2;else if("justify"===i.align&&l.lineWidths[g]/l.width>=.85){var m=l.width-l.lineWidths[g],v=e.measureText(" ").width,y=o[g].trim(),x=y.split(" ");m+=(o[g].length-y.length)*v;for(var w=Math.floor(m/v),b=0;w>0;)x[b]+=" ",b=(b+1)%(x.length-1||1),--w;o[g]=x.join(" ")}this.autoRound&&(c=Math.round(c),d=Math.round(d));var T=this.letterSpacing;if(i.strokeThickness&&0===T&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[g],c,d)),i.color)if(i.syncShadow(e,i.shadowFill),0!==T)for(var S=0,E=o[g].split(""),A=0;A<E.length;A++)i.strokeThickness&&(i.syncShadow(e,i.shadowStroke),e.strokeText(E[A],c+S,d),i.syncShadow(e,i.shadowFill)),e.fillText(E[A],c+S,d),S+=e.measureText(E[A]).width+T;else e.fillText(o[g],c,d)}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0));var C=this.input;return C&&!C.customHitArea&&(C.hitArea.width=this.width,C.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=a.ToJSON(this),e={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 t.data=e,t},preDestroy:function(){u(this.canvas),n.remove(this.canvas);var t=this.texture;t&&t.destroy()}});t.exports=p},79724:t=>{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},71259:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(50171);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),o=r(t,"padding",null);null!==o&&(n.padding=o);var h=new a(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},68005:(t,e,i)=>{var s=i(50171);i(39429).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},61771:(t,e,i)=>{var s,n,r=i(29747);s=i(34397),n=i(79724),t.exports={renderWebGL:s,renderCanvas:n}},35762:(t,e,i)=>{var s=i(83419),n=i(23568),r=i(35154),a=i(79557),o={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]},h=new s({initialize:function(t,e){this.parent=t,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(e,!1,!0)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),o){var h=i?o[s][1]:this[s];"wordWrapCallback"===s||"wordWrapCallbackScope"===s?this[s]=r(t,o[s][0],h):t&&"fontSize"===s&&"number"==typeof t.fontSize?this[s]=t.fontSize.toString()+"px":this[s]=n(t,o[s][0],h)}var l=r(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);null!==u&&(this.color=u);var c=r(t,"metrics",!1);return c?this.metrics={ascent:r(c,"ascent",0),descent:r(c,"descent",0),fontSize:r(c,"fontSize",0)}:!e&&this.metrics||(this.metrics=a(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var a=t.split(" "),o=0;n=a.length>2?a[o++]:"",s=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,a=r.width,o=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,a,o,e.x,e.y,a/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,o,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},20839:(t,e,i)=>{var s=i(27919),n=i(83419),r=i(31401),a=i(95643),o=i(98439),h=i(68703),l=i(56295),u=i(45650),c=i(26099),d=new n({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,l],initialize:function(t,e,i,n,r,h,l){var d=t.sys.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(h),p=f.get(l);p.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),p=(f=t.sys.textures.get("__MISSING")).get()),"DynamicTexture"===f.type&&(console.warn("TileSprite cannot use Dynamic Texture"),p=(f=t.sys.textures.get("__MISSING")).get()),n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=n||p.width,r=r||p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this._textureKey=u(),this.texture=t.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=o(p.width),this.potHeight=o(p.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(l),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=o(e.width),this.potHeight=o(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.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 e=this.context;this.scene.sys.game.config.antialias||h.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var t=this.texture;t&&t.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},46992:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},14167:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(20839);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),o=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new a(this.scene,i,n,o,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},91681:(t,e,i)=>{var s=i(20839);i(39429).register("tileSprite",(function(t,e,i,n,r,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,a))}))},56295:(t,e,i)=>{var s,n,r=i(29747);s=i(18553),n=i(46992),t.exports={renderWebGL:s,renderCanvas:n}},18553:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,a=e.height;if(0!==r&&0!==a){i.addToRenderList(e);var o=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,a,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*a,0,0,r,a,o(e.tintTopLeft,i.alpha*e._alphaTL),o(e.tintTopRight,i.alpha*e._alphaTR),o(e.tintBottomLeft,i.alpha*e._alphaBL),o(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},18471:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(31401),a=i(51708),o=i(8443),h=i(95643),l=i(36383),u=i(14463),c=i(45650),d=i(10247),f=new n({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){h.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var n=t.sys.game;this._device=n.device.video,this.setPosition(e,i),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),n.events.on(o.PAUSE,this.globalPause,this),n.events.on(o.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this),s&&this.load(s)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,s,n))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var s=this._device.getVideoURL(t);return s?(this.cacheKey="",this.loadHandler(s.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,s){e||(e=!1);var n=this.video;if(n?(this.removeLoadEventHandlers(),this.stop()):((n=document.createElement("video")).controls=!1,n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.setAttribute("disablePictureInPicture","true")),e?(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")):(n.muted=!1,n.defaultMuted=!1,n.removeAttribute("autoplay")),i?n.setAttribute("crossorigin",i):n.removeAttribute("crossorigin"),s)if("srcObject"in n)try{n.srcObject=s}catch(t){if("TypeError"!==t.name)throw t;n.src=URL.createObjectURL(s)}else n.src=URL.createObjectURL(s);else n.src=t;this.retry=0,this.video=n,this._playCalled=!1,n.load(),this.addLoadEventHandlers();var r=this.scene.sys.textures.get(this._key);return this.setTexture(r),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var s=e.width,n=e.height,r=this.videoTexture,o=this.videoTextureSource,h=!r||o.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,r?(o.source=i,o.width=s,o.height=n,r.get().setSize(s,n)):((r=this.scene.sys.textures.create(this._key,i,s,n)).add("__BASE",0,0,0,s,n),this.setTexture(r),this.videoTexture=r,this.videoTextureSource=r.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(a.VIDEO_TEXTURE,this,r)),this.setSizeToFrame(),this.updateDisplayOrigin()):o.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(a.VIDEO_CREATED,this,s,n),this.frameReady||(this.frameReady=!0,this.emit(a.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(a.VIDEO_LOOP,this)):(this.stop(!1),this.emit(a.VIDEO_COMPLETE,this))):l<this._lastUpdate&&this.emit(a.VIDEO_LOOP,this),this._lastUpdate=l,this._getFrame?(this.removeEventHandlers(),i.pause(),this._getFrame=!1):this._rfvCallbackId=this.video.requestVideoFrameCallback(this.requestVideoFrame.bind(this))}},play:function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=l.MAX_SAFE_INTEGER);var s=this.video;return!s||this.isPlaying()?(s||console.warn("Video not loaded"),this):(void 0===t&&(t=s.loop),s.loop=t,this._markerIn=e,this._markerOut=i,this._playingMarker=e>-1&&i>e&&i<l.MAX_SAFE_INTEGER,this._playCalled||(this._getFrame=!1,this._rfvCallbackId=s.requestVideoFrameCallback(this.requestVideoFrame.bind(this)),this._playCalled=!0,this.createPlayPromise()),this)},getFirstFrame:function(){var t=this.video;return!t||this.isPlaying()?(t||console.warn("Video not loaded"),this):(this._playCalled||(this._getFrame=!0,this._rfvCallbackId=t.requestVideoFrameCallback(this.requestVideoFrame.bind(this)),this.createPlayPromise()),this)},addLoadEventHandlers:function(){var t=this.video;t&&(t.addEventListener("error",this._loadCallbackHandler),t.addEventListener("abort",this._loadCallbackHandler),t.addEventListener("loadedmetadata",this._metadataCallbackHandler))},removeLoadEventHandlers:function(){var t=this.video;t&&(t.removeEventListener("error",this._loadCallbackHandler),t.removeEventListener("abort",this._loadCallbackHandler))},addEventHandlers:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.addEventListener(i,e[i])}},removeEventHandlers:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i])}},createPlayPromise:function(t){void 0===t&&(t=!0);var e=this.video,i=e.play();if(void 0!==i){var s=this.playSuccess.bind(this),n=this.playError.bind(this);if(!t){var r=this;n=function(){r.failedPlayAttempts++}}i.then(s).catch(n)}else e.addEventListener("playing",this._callbacks.legacy),t||this.failedPlayAttempts++},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=i),void 0===r&&(r=s);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(n,r),a&&o.context.drawImage(a,t,e,i,s,0,0,n,r)):(o=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,s,0,0,n,r)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(a.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(a.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(a.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(a.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(a.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(a.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(a.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(a.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(a.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(a.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(a.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.flipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(a.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(o.PAUSE,this.globalPause,this),t.off(o.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this)}});t.exports=f},58352:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},11511:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),a=i(18471);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},89025:(t,e,i)=>{var s=i(18471);i(39429).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},10247:(t,e,i)=>{var s,n,r=i(29747);s=i(29849),n=i(58352),t.exports={renderWebGL:s,renderCanvas:n}},29849:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},41481:(t,e,i)=>{var s=i(10312),n=i(96503),r=i(87902),a=i(83419),o=i(31401),h=i(95643),l=i(87841),u=i(37303),c=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},95261:(t,e,i)=>{var s=i(44603),n=i(23568),r=i(41481);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),a=n(t,"height",s);return new r(this.scene,e,i,s,a)}))},84175:(t,e,i)=>{var s=i(41481);i(39429).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95166:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503:(t,e,i)=>{var s=i(83419),n=i(87902),r=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562:t=>{t.exports=function(t){return Math.PI*t.radius*2}},92110:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250:(t,e,i)=>{var s=i(96503);t.exports=function(t){return new s(t.x,t.y,t.radius)}},87902:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698:(t,e,i)=>{var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)}},70588:(t,e,i)=>{var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},26394:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241:(t,e,i)=>{var s=i(92110),n=i(62945),r=i(36383),a=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=n(e,0,r.PI2);return s(t,o,i)}},79124:(t,e,i)=>{var s=i(71562),n=i(92110),r=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h<e;h++){var l=r(h/e,0,a.PI2);o.push(n(t,l))}return o}},50884:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},39212:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},28176:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,a=r*Math.cos(i),o=r*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911:(t,e,i)=>{var s=i(96503);s.Area=i(95166),s.Circumference=i(71562),s.CircumferencePoint=i(92110),s.Clone=i(42250),s.Contains=i(87902),s.ContainsPoint=i(5698),s.ContainsRect=i(70588),s.CopyFrom=i(26394),s.Equals=i(76278),s.GetBounds=i(2074),s.GetPoint=i(26241),s.GetPoints=i(79124),s.Offset=i(50884),s.OffsetPoint=i(39212),s.Random=i(28176),t.exports=s},23777:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},79522:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},58102:(t,e,i)=>{var s=i(8497);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},81154:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},46662:(t,e,i)=>{var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)}},1632:(t,e,i)=>{var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},65534:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497:(t,e,i)=>{var s=i(83419),n=i(81154),r=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,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(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549:(t,e,i)=>{var s=i(79522),n=i(62945),r=i(36383),a=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=n(e,0,r.PI2);return s(t,o,i)}},48320:(t,e,i)=>{var s=i(92990),n=i(79522),r=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h<e;h++){var l=r(h/e,0,a.PI2);o.push(n(t,l))}return o}},73424:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},44808:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},24820:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},49203:(t,e,i)=>{var s=i(8497);s.Area=i(78874),s.Circumference=i(92990),s.CircumferencePoint=i(79522),s.Clone=i(58102),s.Contains=i(81154),s.ContainsPoint=i(46662),s.ContainsRect=i(1632),s.CopyFrom=i(65534),s.Equals=i(36146),s.GetBounds=i(23694),s.GetPoint=i(90549),s.GetPoints=i(48320),s.Offset=i(73424),s.OffsetPoint=i(44808),s.Random=i(24820),t.exports=s},55738:(t,e,i)=>{var s=i(23777),n=i(79291),r={Circle:i(88911),Ellipse:i(49203),Intersects:i(91865),Line:i(2529),Mesh:i(73090),Point:i(43711),Polygon:i(58423),Rectangle:i(93232),Triangle:i(84435)};r=n(!1,r,s),t.exports=r},2044:(t,e,i)=>{var s=i(20339);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},81491:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),a=i+t.radius,o=s+t.radius;if(n>a||r>o)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},63376:(t,e,i)=>{var s=i(2141),n=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,a,o,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(o=(a=-2*f)*a-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new s(h,-a/(2*r))):o>0&&(i.push(new s(h,(-a+Math.sqrt(o))/(2*r))),i.push(new s(h,(-a-Math.sqrt(o))/(2*r))));else{var g=(l-d)/(u-f),m=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(o=(a=2*u*g-2*m*g-2*l)*a-4*(r=g*g+1)*(l*l+u*u+m*m-c*c-2*u*m))?(h=-a/(2*r),i.push(new s(h,m-h*g))):o>0&&(h=(-a+Math.sqrt(o))/(2*r),i.push(new s(h,m-h*g)),h=(-a-Math.sqrt(o))/(2*r),i.push(new s(h,m-h*g)))}}return i}},97439:(t,e,i)=>{var s=i(4042),n=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();s(r,t,i),s(a,t,i),s(o,t,i),s(h,t,i)}return i}},4042:(t,e,i)=>{var s=i(2141),n=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,f=e.radius,p=l-o,g=u-h,m=o-c,v=h-d,y=p*p+g*g,x=2*(p*m+g*v),w=x*x-4*y*(m*m+v*v-f*f);if(0===w){var b=-x/(2*y);r=o+b*p,a=h+b*g,b>=0&&b<=1&&i.push(new s(r,a))}else if(w>0){var T=(-x-Math.sqrt(w))/(2*y);r=o+T*p,a=h+T*g,T>=0&&T<=1&&i.push(new s(r,a));var S=(-x+Math.sqrt(w))/(2*y);r=o+S*p,a=h+S*g,S>=0&&S<=1&&i.push(new s(r,a))}}return i}},36100:(t,e,i)=>{var s=i(25836);t.exports=function(t,e,i,n){void 0===i&&(i=!1);var r,a,o,h=t.x1,l=t.y1,u=t.x2,c=t.y2,d=e.x1,f=e.y1,p=u-h,g=c-l,m=e.x2-d,v=e.y2-f,y=p*v-g*m;if(0===y)return null;if(i){if(r=(p*(f-l)+g*(h-d))/(m*g-v*p),0!==p)a=(d+m*r-h)/p;else{if(0===g)return null;a=(f+v*r-l)/g}if(a<0||r<0||r>1)return null;o=a}else{if(a=((l-f)*p-(h-d)*g)/y,(r=((d-h)*v-(f-l)*m)/y)<0||r>1||a<0||a>1)return null;o=r}return void 0===n&&(n=new s),n.set(h+p*o,l+g*o,o)}},3073:(t,e,i)=>{var s=i(36100),n=i(23031),r=i(25836),a=new n,o=new r;t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=new r);var h=!1;n.set(),o.set();for(var l=e[e.length-1],u=0;u<e.length;u++){var c=e[u];a.setTo(l.x,l.y,c.x,c.y),l=c,s(t,a,i,o)&&(!h||o.z<n.z)&&(n.copy(o),h=!0)}return h?n:null}},56362:(t,e,i)=>{var s=i(25836),n=i(61369),r=i(3073),a=new s;t.exports=function(t,e,i,s){void 0===s&&(s=new n),Array.isArray(e)||(e=[e]);var o=!1;s.set(),a.set();for(var h=0;h<e.length;h++)r(t,e[h].points,i,a)&&(!o||a.z<s.z)&&(s.set(a.x,a.y,a.z,h),o=!0);return o?s:null}},60646:(t,e,i)=>{var s=i(2141),n=i(76112),r=i(92773);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var a=e.getLineA(),o=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(a,t,u[0]),n(o,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},71147:(t,e,i)=>{var s=i(61369),n=i(56362),r=new(i(23031));function a(t,e,i,a,o){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,a,!0);u&&o.push(new s(u.x,u.y,t,u.w))}function o(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r<i.length;r++)for(var h=i[r].points,l=0;l<h.length;l++){var u=Math.atan2(h[l].y-e,h[l].x-t);-1===n.indexOf(u)&&(a(u,t,e,i,s),a(u-1e-5,t,e,i,s),a(u+1e-5,t,e,i,s),n.push(u))}return s.sort(o)}},68389:(t,e,i)=>{var s=i(87841),n=i(59996);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},52784:(t,e,i)=>{var s=i(60646),n=i(59996);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),a=t.getLineB(),o=t.getLineC(),h=t.getLineD();s(r,e,i),s(a,e,i),s(o,e,i),s(h,e,i)}return i}},26341:(t,e,i)=>{var s=i(89265),n=i(60646);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),a=e.getLineB(),o=e.getLineC();n(r,t,i),n(a,t,i),n(o,t,i)}return i}},38720:(t,e,i)=>{var s=i(4042),n=i(67636);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),a=t.getLineB(),o=t.getLineC();s(r,e,i),s(a,e,i),s(o,e,i)}return i}},13882:(t,e,i)=>{var s=i(2141),n=i(2822),r=i(76112);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(a,e,l[0]),r(o,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},75636:(t,e,i)=>{var s=i(82944),n=i(13882);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),a=e.getLineB(),o=e.getLineC();n(t,r,i),n(t,a,i),n(t,o,i)}return i}},80462:(t,e,i)=>{var s=i(87902),n=new(i(2141));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,a=t.y2-t.y1,o=e.x-t.x1,h=e.y-t.y1,l=r*r+a*a,u=r,c=a;if(l>0){var d=(o*r+h*a)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*a>=0&&s(e,i.x,i.y)}},76112:t=>{t.exports=function(t,e,i){var s=t.x1,n=t.y1,r=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(s===r&&n===a||o===l&&h===u)return!1;var c=(u-h)*(r-s)-(l-o)*(a-n);if(0===c)return!1;var d=((l-o)*(n-h)-(u-h)*(s-o))/c,f=((r-s)*(n-h)-(a-n)*(s-o))/c;return!(d<0||d>1||f<0||f>1||(i&&(i.x=s+d*(r-s),i.y=n+d*(a-n)),0))}},92773:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&s>=o&&s<=l||n>=a&&n<=h&&r>=o&&r<=l)return!0;if(i<a&&n>=a){if((u=s+(r-s)*(a-i)/(n-i))>o&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=o&&u<=l)return!0;if(s<o&&r>=o){if((u=i+(n-i)*(o-s)/(r-s))>=a&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=a&&u<=h)return!0;return!1}},16204:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,a=e.y2,o=t.x,h=t.y,l=(r-s)*(r-s)+(a-n)*(a-n);if(0===l)return!1;var u=((o-s)*(r-s)+(h-n)*(a-n))/l;if(u<0)return Math.sqrt((s-o)*(s-o)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-o)*(a-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-o)*(r-o)+(a-h)*(a-h))<=i}},14199:(t,e,i)=>{var s=i(16204);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=a}},59996:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},89265:(t,e,i)=>{var s=i(76112),n=i(37303),r=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),o=e.getLineB(),h=e.getLineC();if(n(t,i.x1,i.y1)||n(t,i.x2,i.y2))return!0;if(n(t,o.x1,o.y1)||n(t,o.x2,o.y2))return!0;if(n(t,h.x1,h.y1)||n(t,h.x2,h.y2))return!0;var l=t.getLineA(),u=t.getLineB(),c=t.getLineC(),d=t.getLineD();if(s(i,l)||s(i,u)||s(i,c)||s(i,d))return!0;if(s(o,l)||s(o,u)||s(o,c)||s(o,d))return!0;if(s(h,l)||s(h,u)||s(h,c)||s(h,d))return!0;var f=a(t);return r(e,f,!0).length>0}},84411:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||i<t.left-r||s>t.bottom+r||n<t.top-r)}},67636:(t,e,i)=>{var s=i(80462),n=i(10690);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top||!n(t,e.x,e.y)&&!s(t.getLineA(),e)&&!s(t.getLineB(),e)&&!s(t.getLineC(),e))}},2822:(t,e,i)=>{var s=i(76112);t.exports=function(t,e){return!!(t.contains(e.x1,e.y1)||t.contains(e.x2,e.y2)||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},82944:(t,e,i)=>{var s=i(48653),n=i(71694),r=i(76112);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),a=t.getLineB(),o=t.getLineC(),h=e.getLineA(),l=e.getLineB(),u=e.getLineC();if(r(i,h)||r(i,l)||r(i,u))return!0;if(r(a,h)||r(a,l)||r(a,u))return!0;if(r(o,h)||r(o,l)||r(o,u))return!0;var c=n(t),d=s(e,c,!0);return d.length>0||(c=n(e),(d=s(t,c,!0)).length>0)}},91865:(t,e,i)=>{t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(r-s),h=Math.abs(a-n),l=s<r?1:-1,u=n<a?1:-1,c=o-h;i.push({x:s,y:n});for(var d=1;s!==r||n!==a;){var f=c<<1;f>-h&&(c-=h,s+=l),f<o&&(c+=o,n+=u),d%e===0&&i.push({x:s,y:n}),d++}return i}},36469:t=>{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},31116:(t,e,i)=>{var s=i(23031);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},59944:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},59220:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},78177:(t,e,i)=>{var s=i(35001);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,a=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-a/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+a/n*i),t}},26708:(t,e,i)=>{var s=i(52816),n=i(6113),r=i(2141);t.exports=function(t,e,i,a,o){void 0===a&&(a=0),void 0===o&&(o=[]);var h,l,u=[],c=t.x1,d=t.y1,f=t.x2-c,p=t.y2-d,g=n(e,o),m=i-1;for(h=0;h<m;h++)l=g(h/m),u.push(new r(c+f*l,d+p*l));if(l=g(1),u.push(new r(c+f*l,d+p*l)),a>0){var v=u[0],y=[v];for(h=1;h<u.length-1;h++){var x=u[h];s(v,x)>=a&&(y.push(x),v=x)}var w=u[u.length-1];return s(v,w)<a&&y.pop(),y.push(w),y}return u}},32125:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},99569:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,a=t.x2,o=t.y2,h=(a-n)*(a-n)+(o-r)*(o-r);if(0===h)return i;var l=((e.x-n)*(a-n)+(e.y-r)*(o-r))/h;return i.x=n+l*(a-n),i.y=r+l*(o-r),i}},34638:(t,e,i)=>{var s=i(36383),n=i(91938),r=i(2141);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},13151:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},15258:(t,e,i)=>{var s=i(35001),n=i(2141);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u<e;u++){var c=u/e,d=a+(h-a)*c,f=o+(l-o)*c;r.push(new n(d,f))}return r}},26408:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,a=(n-i)*(n-i)+(r-s)*(r-s);if(0===a)return!1;var o=((s-e.y)*(n-i)-(i-e.x)*(r-s))/a;return Math.abs(o)*Math.sqrt(a)}},98770:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},35001:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},23031:(t,e,i)=>{var s=i(83419),n=i(13151),r=i(15258),a=i(23777),o=i(65822),h=i(26099),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},setFromObjects:function(t,e){return this.x1=t.x,this.y1=t.y,this.x2=e.x,this.y2=e.y,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795:(t,e,i)=>{var s=i(36383),n=i(15994),r=i(91938);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},52616:(t,e,i)=>{var s=i(36383),n=i(91938);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},87231:(t,e,i)=>{var s=i(36383),n=i(91938);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},89662:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777:(t,e,i)=>{var s=i(91938),n=i(64795);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},39706:(t,e,i)=>{var s=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},82585:(t,e,i)=>{var s=i(64400);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},64400:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*n-o*r+e,t.y1=a*r+o*n+i,a=t.x2-e,o=t.y2-i,t.x2=a*n-o*r+e,t.y2=a*r+o*n+i,t}},62377:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},71366:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529:(t,e,i)=>{var s=i(23031);s.Angle=i(91938),s.BresenhamPoints=i(84993),s.CenterOn=i(36469),s.Clone=i(31116),s.CopyFrom=i(59944),s.Equals=i(59220),s.Extend=i(78177),s.GetEasedPoints=i(26708),s.GetMidPoint=i(32125),s.GetNearestPoint=i(99569),s.GetNormal=i(34638),s.GetPoint=i(13151),s.GetPoints=i(15258),s.GetShortestDistance=i(26408),s.Height=i(98770),s.Length=i(35001),s.NormalAngle=i(64795),s.NormalX=i(52616),s.NormalY=i(87231),s.Offset=i(89662),s.PerpSlope=i(71165),s.Random=i(65822),s.ReflectAngle=i(69777),s.Rotate=i(39706),s.RotateAroundPoint=i(82585),s.RotateAroundXY=i(64400),s.SetToAngle=i(62377),s.Slope=i(71366),s.Width=i(10809),t.exports=s},83997:(t,e,i)=>{var s=i(83419),n=i(87841),r=i(26099);function a(t,e,i,s){var n=t-i,r=e-s,a=n*n+r*r;return Math.sqrt(a)}var o=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,o,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,o=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,o=u.vy);var c=a(r,o,s,n),d=a(e,i,r,o),f=a(s,n,e,i),p=c+d+f;return this._inCenter.set((e*c+s*d+r*f)/p,(i*c+n*d+o*f)/p)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,a=s.vx,o=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,f=i.b,p=i.c,g=i.d,m=i.e,v=i.f;a=s.vx*d+s.vy*p+m,o=s.vx*f+s.vy*g+v,h=n.vx*d+n.vy*p+m,l=n.vx*f+n.vy*g+v,u=r.vx*d+r.vy*p+m,c=r.vx*f+r.vy*g+v}var y=u-a,x=c-o,w=h-a,b=l-o,T=t-a,S=e-o,E=y*y+x*x,A=y*w+x*b,C=y*T+x*S,M=w*w+b*b,_=w*T+b*S,R=E*M-A*A,P=0===R?0:1/R,L=(M*C-A*_)*P,F=(E*_-A*C)*P;return L>=0&&F>=0&&L+F<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,a,o,h,l,u){this.update(s,n,r,a,o,h,l,u);var c=this.vertex1,d=this.vertex2,f=this.vertex3;if(c.ta<=0&&d.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var p=this.bounds;p.x=Math.min(c.tx,d.tx,f.tx),p.y=Math.min(c.ty,d.ty,f.ty),p.width=Math.max(c.tx,d.tx,f.tx)-p.x,p.height=Math.max(c.ty,d.ty,f.ty)-p.y;var g=t.x+t.width,m=t.y+t.height;return!(p.width<=0||p.height<=0||t.width<=0||t.height<=0||p.right<t.x||p.bottom<t.y||p.x>g||p.y>m)},scrollUV:function(t,e){return this.vertex1.scrollUV(t,e),this.vertex2.scrollUV(t,e),this.vertex3.scrollUV(t,e),this},scaleUV:function(t,e){return this.vertex1.scaleUV(t,e),this.vertex2.scaleUV(t,e),this.vertex3.scaleUV(t,e),this},setColor:function(t){return this.vertex1.color=t,this.vertex2.color=t,this.vertex3.color=t,this},update:function(t,e,i,s,n,r,a,o){return this.vertex1.update(e,i,s,n,r,a,o,t),this.vertex2.update(e,i,s,n,r,a,o,t),this.vertex3.update(e,i,s,n,r,a,o,t),this},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=o},48803:(t,e,i)=>{var s=i(83997),n=i(95540),r=i(37867),a=i(25836),o=i(39318),h=new a,l=new a,u=new r;t.exports=function(t){var e,i=n(t,"mesh"),r=n(t,"texture",null),a=n(t,"frame"),c=n(t,"width",1),d=n(t,"height",c),f=n(t,"widthSegments",1),p=n(t,"heightSegments",f),g=n(t,"x",0),m=n(t,"y",0),v=n(t,"z",0),y=n(t,"rotateX",0),x=n(t,"rotateY",0),w=n(t,"rotateZ",0),b=n(t,"zIsUp",!0),T=n(t,"isOrtho",!!i&&i.dirtyCache[11]),S=n(t,"colors",[16777215]),E=n(t,"alphas",[1]),A=n(t,"tile",!1),C=n(t,"flipY",!1),M=n(t,"width",null),_={faces:[],verts:[]};if(h.set(g,m,v),l.set(y,x,w),u.fromRotationXYTranslation(l,h,b),!r&&i)r=i.texture,a||(e=i.frame);else if(i&&"string"==typeof r)r=i.scene.sys.textures.get(r);else if(!r)return _;e||(e=r.get(a)),!M&&T&&r&&i&&(c=e.width/i.height,d=e.height/i.height);var R,P,L=c/2,F=d/2,O=Math.floor(f),D=Math.floor(p),k=O+1,I=D+1,B=c/O,N=d/D,Y=[],X=[],U=0,z=1,G=0,V=1;e&&(U=e.u0,z=e.u1,C?(G=e.v1,V=e.v0):(G=e.v0,V=e.v1));var W=z-U,H=V-G;for(P=0;P<I;P++){var j=P*N-F;for(R=0;R<k;R++){var q=R*B-L;X.push(q,-j);var K=U+W*(R/O),Z=G+H*(P/D);Y.push(K,Z)}}Array.isArray(S)||(S=[S]),Array.isArray(E)||(E=[E]);var Q=0,J=0;for(P=0;P<D;P++)for(R=0;R<O;R++){var $=2*(R+k*P),tt=2*(R+k*(P+1)),et=2*(R+1+k*(P+1)),it=2*(R+1+k*P),st=S[J],nt=E[Q],rt=new o(X[$],X[$+1],0,Y[$],Y[$+1],st,nt).transformMat4(u),at=new o(X[tt],X[tt+1],0,Y[tt],Y[tt+1],st,nt).transformMat4(u),ot=new o(X[it],X[it+1],0,Y[it],Y[it+1],st,nt).transformMat4(u),ht=new o(X[tt],X[tt+1],0,Y[tt],Y[tt+1],st,nt).transformMat4(u),lt=new o(X[et],X[et+1],0,Y[et],Y[et+1],st,nt).transformMat4(u),ut=new o(X[it],X[it+1],0,Y[it],Y[it+1],st,nt).transformMat4(u);A&&(rt.setUVs(U,V),at.setUVs(U,G),ot.setUVs(z,V),ht.setUVs(U,G),lt.setUVs(z,G),ut.setUVs(z,V)),++J===S.length&&(J=0),++Q===E.length&&(Q=0),_.verts.push(rt,at,ot,ht,lt,ut),_.faces.push(new s(rt,at,ot),new s(ht,lt,ut))}return i&&(i.faces=i.faces.concat(_.faces),i.vertices=i.vertices.concat(_.verts)),_}},34684:(t,e,i)=>{var s=i(83997),n=i(37867),r=i(25836),a=i(39318),o=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,f,p){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===f&&(f=0),void 0===p&&(p=!0);var g={faces:[],verts:[]},m=t.materials;o.set(n,r,u),h.set(c,d,f),l.fromRotationXYTranslation(h,o,p);for(var v=0;v<t.models.length;v++)for(var y=t.models[v],x=y.vertices,w=y.textureCoords,b=y.faces,T=0;T<b.length;T++){var S=b[T],E=S.vertices[0],A=S.vertices[1],C=S.vertices[2],M=x[E.vertexIndex],_=x[A.vertexIndex],R=x[C.vertexIndex],P=E.textureCoordsIndex,L=A.textureCoordsIndex,F=C.textureCoordsIndex,O=-1===P?{u:0,v:1}:w[P],D=-1===L?{u:0,v:0}:w[L],k=-1===F?{u:1,v:1}:w[F],I=16777215;""!==S.material&&m[S.material]&&(I=m[S.material]);var B=new a(M.x*i,M.y*i,M.z*i,O.u,O.v,I).transformMat4(l),N=new a(_.x*i,_.y*i,_.z*i,D.u,D.v,I).transformMat4(l),Y=new a(R.x*i,R.y*i,R.z*i,k.u,k.v,I).transformMat4(l);g.verts.push(B,N,Y),g.faces.push(new s(B,N,Y))}return e&&(e.faces=e.faces.concat(g.faces),e.vertices=e.vertices.concat(g.verts)),g}},92515:(t,e,i)=>{var s=i(83997),n=i(39318);t.exports=function(t,e,i,r,a,o,h,l){if(void 0===r&&(r=!1),void 0===o&&(o=16777215),void 0===h&&(h=1),void 0===l&&(l=!1),t.length===e.length||r){var u,c,d,f,p,g,m,v,y,x,w,b={faces:[],vertices:[]},T=r?3:2,S=Array.isArray(o),E=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(u=0;u<i.length;u++){var A=i[u],C=2*i[u],M=i[u]*T;c=t[M],d=t[M+1],f=r?t[M+2]:0,p=e[C],g=e[C+1],l&&(g=1-g),m=S?o[A]:o,v=E?h[A]:h,y=0,x=0,w=0,a&&(y=a[M],x=a[M+1],w=r?a[M+2]:0),b.vertices.push(new n(c,d,f,p,g,m,v,y,x,w))}else{var _=0,R=0;for(u=0;u<t.length;u+=T)c=t[u],d=t[u+1],f=r?t[u+2]:0,p=e[_],g=e[_+1],m=S?o[R]:o,v=E?h[R]:h,y=0,x=0,w=0,a&&(y=a[u],x=a[u+1],w=r?a[u+2]:0),b.vertices.push(new n(c,d,f,p,g,m,v,y,x,w)),_+=2,R++}for(u=0;u<b.vertices.length;u+=3){var P=b.vertices[u],L=b.vertices[u+1],F=b.vertices[u+2];b.faces.push(new s(P,L,F))}return b}console.warn("GenerateVerts: vertices and uvs count not equal")}},85048:t=>{var e=!0,i="untitled",s="",n="";function r(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function a(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function o(t){2===t.length&&(s=t[1])}function h(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,a=i>=4?parseFloat(t[3]):0;r(e).vertices.push({x:s,y:n,z:a})}function l(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,a=s>=3?parseFloat(t[2]):0,o=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(a)&&(a=0),isNaN(o)&&(o=0),e&&(a=1-a),r(i).textureCoords.push({u:n,v:a,w:o})}function u(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,a=i>=4?parseFloat(t[3]):0;r(e).vertexNormals.push({x:s,y:n,z:a})}function c(t,e){var i=t.length-1;if(!(i<3)){for(var a={group:s,material:n,vertices:[]},o=0;o<i;o++){var h=t[o+1].split("/"),l=h.length;if(!(l<1||l>3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=r(e).vertices.length+1+u),c-=1,u-=1,d-=1,a.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}r(e).faces.push(a)}}function d(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var r,p,g={materials:{},materialLibraries:[],models:[]};s="",n="";for(var m=t.split("\n"),v=0;v<m.length;v++){var y=(r=m[v],p=void 0,p=r.indexOf("#"),p>-1?r.substring(0,p):r).replace(/\s\s+/g," ").trim().split(" ");switch(y[0].toLowerCase()){case"o":a(y,g);break;case"g":o(y);break;case"v":h(y,g);break;case"vt":l(y,g);break;case"vn":u(y,g);break;case"f":c(y,g);break;case"mtllib":d(y,g);break;case"usemtl":f(y)}}return g}},61485:(t,e,i)=>{var s=i(37589);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r<i.length;r++){var a=i[r].trim();if(0!==a.indexOf("#")&&""!==a){var o=a.replace(/\s\s+/g," ").trim().split(" ");switch(o[0].toLowerCase()){case"newmtl":n=o[1];break;case"kd":var h=Math.floor(255*o[1]),l=o.length>=2?Math.floor(255*o[2]):h,u=o.length>=3?Math.floor(255*o[3]):h;e[n]=s(h,l,u)}}}return e}},92570:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var a=t.getInCenter();n=a.x,r=a.y}var o=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,f=l.y-r;l.set(d*o-f*h+n,d*h+f*o+r),d=u.x-n,f=u.y-r,u.set(d*o-f*h+n,d*h+f*o+r),d=c.x-n,f=c.y-r,c.set(d*o-f*h+n,d*h+f*o+r)}},39318:(t,e,i)=>{var s=i(83419),n=i(70554),r=i(25836),a=new s({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u){void 0===a&&(a=16777215),void 0===o&&(o=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=a,this.alpha=o,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=n},setUVs:function(t,e){return this.u=t,this.v=e,this.tu=t,this.tv=e,this},scrollUV:function(t,e){return this.tu+=t,this.tv+=e,this},scaleUV:function(t,e){return this.tu=this.u*t,this.tv=this.v*e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,a=this.z,o=t.val,h=n*o[0]+r*o[4]+a*o[8]+o[12],l=n*o[1]+r*o[5]+a*o[9]+o[13],u=n*o[2]+r*o[6]+a*o[10]+o[14],c=n*o[3]+r*o[7]+a*o[11]+o[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},resize:function(t,e,i,s,n,r){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*s,this.vz=0,n<.5?this.vx+=i*(.5-n):n>.5&&(this.vx-=i*(n-.5)),r<.5?this.vy+=s*(.5-r):r>.5&&(this.vy-=s*(r-.5)),this},update:function(t,e,i,s,n,r,a,o){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return a&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*o,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.tu,t[++i]=this.tv,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=a},73090:(t,e,i)=>{var s={Face:i(83997),GenerateGridVerts:i(48803),GenerateObjVerts:i(34684),GenerateVerts:i(92515),ParseObj:i(85048),ParseObjMaterial:i(61485),RotateFace:i(92570),Vertex:i(39318)};t.exports=s},96550:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},99706:(t,e,i)=>{var s=i(2141);t.exports=function(t){return new s(t.x,t.y)}},68010:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},27814:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},73565:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},87555:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n<i;n++)e.x+=t[n].x,e.y+=t[n].y;e.x/=i,e.y/=i}return e}},28793:t=>{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},44405:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20873:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=0;o<t.length;o++){var h=t[o];h.x>i&&(i=h.x),h.x<n&&(n=h.x),h.y>r&&(r=h.y),h.y<a&&(a=h.y)}return e.x=n,e.y=a,e.width=i-n,e.height=r-a,e}},26152:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},55767:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},79432:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},2141:(t,e,i)=>{var s=i(83419),n=i(23777),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},72930:(t,e,i)=>{var s=i(2141),n=i(44405);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},62880:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},15093:(t,e,i)=>{var s=i(28793);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},43711:(t,e,i)=>{var s=i(2141);s.Ceil=i(96550),s.Clone=i(99706),s.CopyFrom=i(68010),s.Equals=i(27814),s.Floor=i(73565),s.GetCentroid=i(87555),s.GetMagnitude=i(28793),s.GetMagnitudeSq=i(44405),s.GetRectangleFromPoints=i(20873),s.Interpolate=i(26152),s.Invert=i(55767),s.Negative=i(79432),s.Project=i(72930),s.ProjectUnit=i(62880),s.SetMagnitude=i(15093),t.exports=s},12306:(t,e,i)=>{var s=i(25717);t.exports=function(t){return new s(t.points)}},63814:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n<t.points.length;r=n){var a=t.points[n].x,o=t.points[n].y,h=t.points[r].x,l=t.points[r].y;(o<=i&&i<l||l<=i&&i<o)&&e<(h-a)*(i-o)/(l-o)+a&&(s=!s)}return s}},99338:(t,e,i)=>{var s=i(63814);t.exports=function(t,e){return s(t,e.x,e.y)}},94811:t=>{"use strict";function e(t,e,s){s=s||2;var r,a,o,h,c,d,p,g=e&&e.length,m=g?e[0]*s:t.length,v=i(t,0,m,s,!0),y=[];if(!v||v.next===v.prev)return y;if(g&&(v=function(t,e,s,n){var r,a,o,h=[];for(r=0,a=e.length;r<a;r++)(o=i(t,e[r]*n,r<a-1?e[r+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),h.push(f(o));for(h.sort(l),r=0;r<h.length;r++)s=u(h[r],s);return s}(t,e,v,s)),t.length>80*s){r=o=t[0],a=h=t[1];for(var x=s;x<m;x+=s)(c=t[x])<r&&(r=c),(d=t[x+1])<a&&(a=d),c>o&&(o=c),d>h&&(h=d);p=0!==(p=Math.max(o-r,h-a))?32767/p:0}return n(v,y,s,r,a,p,0),y}function i(t,e,i,s,n){var r,a;if(n===C(t,e,i,s)>0)for(r=e;r<i;r+=s)a=S(r,t[r],t[r+1],a);else for(r=i-s;r>=e;r-=s)a=S(r,t[r],t[r+1],a);return a&&v(a,a.next)&&(E(a),a=a.next),a}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!v(s,s.next)&&0!==m(s.prev,s,s.next))s=s.next;else{if(E(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var n=t;do{0===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,a,o,h,l=1;do{for(i=t,t=null,r=null,a=0;i;){for(a++,s=i,o=0,e=0;e<l&&(o++,s=s.nextZ);e++);for(h=l;o>0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,o--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(a>1)}(n)}(t,l,u,c);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?a(t,l,u,c):r(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),E(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?n(t=o(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var n=e.x,r=i.x,a=s.x,o=e.y,h=i.y,l=s.y,u=n<r?n<a?n:a:r<a?r:a,c=o<h?o<l?o:l:h<l?h:l,d=n>r?n>a?n:a:r>a?r:a,f=o>h?o>l?o:l:h>l?h:l,g=s.next;g!==e;){if(g.x>=u&&g.x<=d&&g.y>=c&&g.y<=f&&p(n,o,r,h,a,l,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(t,e,i,s){var n=t.prev,r=t,a=t.next;if(m(n,r,a)>=0)return!1;for(var o=n.x,h=r.x,l=a.x,u=n.y,c=r.y,f=a.y,g=o<h?o<l?o:l:h<l?h:l,v=u<c?u<f?u:f:c<f?c:f,y=o>h?o>l?o:l:h>l?h:l,x=u>c?u>f?u:f:c>f?c:f,w=d(g,v,e,i,s),b=d(y,x,e,i,s),T=t.prevZ,S=t.nextZ;T&&T.z>=w&&S&&S.z<=b;){if(T.x>=g&&T.x<=y&&T.y>=v&&T.y<=x&&T!==n&&T!==a&&p(o,u,h,c,l,f,T.x,T.y)&&m(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==n&&S!==a&&p(o,u,h,c,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;T&&T.z>=w;){if(T.x>=g&&T.x<=y&&T.y>=v&&T.y<=x&&T!==n&&T!==a&&p(o,u,h,c,l,f,T.x,T.y)&&m(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;S&&S.z<=b;){if(S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==n&&S!==a&&p(o,u,h,c,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function o(t,e,i){var n=t;do{var r=n.prev,a=n.next.next;!v(r,a)&&y(r,n,n.next,a)&&b(r,a)&&b(a,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(a.i/i|0),E(n),E(n.next),n=t=a),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=T(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,a,o,0),void n(u,e,i,r,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,n=t.x,r=t.y,a=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var o=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=n&&o>a&&(a=o,i=s.x<s.next.x?s:s.next,o===n))return i}s=s.next}while(s!==e);if(!i)return null;var h,l=i,u=i.x,d=i.y,f=1/0;s=i;do{n>=s.x&&s.x>=u&&n!==s.x&&p(r<d?n:a,r,u,d,r<d?a:n,r,s.x,s.y)&&(h=Math.abs(r-s.y)/(n-s.x),b(s,t)&&(h<f||h===f&&(s.x>i.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var n=T(i,t);return s(n,n.next),s(i,i.next)}function c(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function p(t,e,i,s,n,r,a,o){return(n-a)*(e-o)>=(t-a)*(r-o)&&(t-a)*(s-o)>=(i-a)*(e-o)&&(i-a)*(r-o)>=(n-a)*(s-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=w(m(t,e,i)),r=w(m(t,e,s)),a=w(m(i,s,t)),o=w(m(i,s,e));return n!==r&&a!==o||!(0!==n||!x(t,i,e))||!(0!==r||!x(t,s,e))||!(0!==a||!x(i,t,s))||!(0!==o||!x(i,e,s))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function w(t){return t>0?1:t<0?-1:0}function b(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function T(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function S(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(t,e,i,s){for(var n=0,r=e,a=i-s;r<i;r+=s)n+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return n}e.deviation=function(t,e,i,s){var n=e&&e.length,r=n?e[0]*i:t.length,a=Math.abs(C(t,0,r,i));if(n)for(var o=0,h=e.length;o<h;o++){var l=e[o]*i,u=o<h-1?e[o+1]*i:t.length;a-=Math.abs(C(t,l,u,i))}var c=0;for(o=0;o<s.length;o+=3){var d=s[o]*i,f=s[o+1]*i,p=s[o+2]*i;c+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},s=0,n=0;n<t.length;n++){for(var r=0;r<t[n].length;r++)for(var a=0;a<e;a++)i.vertices.push(t[n][r][a]);n>0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},13829:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,a=-n,o=-r,h=0;h<t.points.length;h++)i=t.points[h],n=Math.min(n,i.x),r=Math.min(r,i.y),a=Math.max(a,i.x),o=Math.max(o,i.y);return e.x=n,e.y=r,e.width=a-n,e.height=o-r,e}},26173:t=>{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},9564:(t,e,i)=>{var s=i(35001),n=i(23031),r=i(30052);t.exports=function(t,e,i,a){void 0===a&&(a=[]);var o=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;l<e;l++)for(var u=h*(l/e),c=0,d=0;d<o.length;d++){var f=o[d],p=o[(d+1)%o.length],g=new n(f.x,f.y,p.x,p.y),m=s(g);if(!(u<c||u>c+m)){var v=g.getPoint((u-c)/m);a.push(v);break}c+=m}return a}},30052:(t,e,i)=>{var s=i(35001),n=i(23031);t.exports=function(t){for(var e=t.points,i=0,r=0;r<e.length;r++){var a=e[r],o=e[(r+1)%e.length],h=new n(a.x,a.y,o.x,o.y);i+=s(h)}return i}},25717:(t,e,i)=>{var s=i(83419),n=i(63814),r=i(9564),a=i(23777),o=new s({initialize:function(t){this.type=a.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=0;i<t.length;i++)e={x:0,y:0},"number"==typeof t[i]||"string"==typeof t[i]?(e.x=parseFloat(t[i]),e.y=parseFloat(t[i+1]),i++):Array.isArray(t[i])?(e.x=t[i][0],e.y=t[i][1]):(e.x=t[i].x,e.y=t[i].y),this.points.push(e);return this.calculateArea(),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,s=0;s<this.points.length-1;s++)t=this.points[s],i+=((e=this.points[s+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area},getPoints:function(t,e,i){return r(this,t,e,i)}});t.exports=o},8133:t=>{t.exports=function(t){return t.points.reverse(),t}},29524:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,a=i.y-n;if(0!==r||0!==a){var o=((t.x-s)*r+(t.y-n)*a)/(r*r+a*a);o>1?(s=i.x,n=i.y):o>0&&(s+=r*o,n+=a*o)}return(r=t.x-s)*r+(a=t.y-n)*a}function i(t,s,n,r,a){for(var o,h=r,l=s+1;l<n;l++){var u=e(t[l],t[s],t[n]);u>h&&(o=l,h=u)}h>r&&(o-s>1&&i(t,s,o,r,a),a.push(t[o]),n-o>1&&i(t,o,n,r,a))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,a,o=t[0],h=[o],l=1,u=t.length;l<u;l++)n=o,void 0,void 0,(r=(s=i=t[l]).x-n.x)*r+(a=s.y-n.y)*a>e&&(h.push(i),o=i);return o!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},5469:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i<n.length;i++)s.push([n[i].x,n[i].y]);var r=[];for(s.length>0&&r.push(e([0,0],s[0])),i=0;i<s.length-1;i++){var a=s[i],o=s[i+1],h=a[0],l=a[1],u=o[0],c=o[1];r.push([.85*h+.15*u,.85*l+.15*c]),r.push([.15*h+.85*u,.15*l+.85*c])}return s.length>1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},24709:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n<s.length;n++)s[n].x+=e,s[n].y+=i;return t}},58423:(t,e,i)=>{var s=i(25717);s.Clone=i(12306),s.Contains=i(63814),s.ContainsPoint=i(99338),s.Earcut=i(94811),s.GetAABB=i(13829),s.GetNumberArray=i(26173),s.GetPoints=i(9564),s.Perimeter=i(30052),s.Reverse=i(8133),s.Simplify=i(29524),s.Smooth=i(5469),s.Translate=i(24709),t.exports=s},62224:t=>{t.exports=function(t){return t.width*t.height}},98615:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},31688:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},67502:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},65085:(t,e,i)=>{var s=i(87841);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},37303:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},96553:(t,e,i)=>{var s=i(37303);t.exports=function(t,e){return s(t,e.x,e.y)}},70273:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom}},43459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},77493:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},9219:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},53751:(t,e,i)=>{var s=i(8249);t.exports=function(t,e){var i=s(t);return i<s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},16088:(t,e,i)=>{var s=i(8249);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217:(t,e,i)=>{var s=i(87841),n=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c<t.length;c++)i=t[c],Array.isArray(i)?(r=i[0],a=i[1]):(r=i.x,a=i.y),o=Math.min(o,r),h=Math.min(h,a),l=Math.max(l,r),u=Math.max(u,a);return e.x=o,e.y=h,e.width=l-o,e.height=u-h,e}},9477:(t,e,i)=>{var s=i(87841);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},8249:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},27165:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},20812:(t,e,i)=>{var s=i(13019),n=i(2141);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},34819:(t,e,i)=>{var s=i(20812),n=i(13019);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var a=0;a<e;a++){var o=a/e;r.push(s(t,o))}return r}},51313:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},86091:(t,e,i)=>{var s=i(67502);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},53951:(t,e,i)=>{var s=i(87841),n=i(59996);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},14649:(t,e,i)=>{var s=i(13019),n=i(2141);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var a=t.x,o=t.y,h=0,l=0;l<i;l++)switch(r.push(new n(a,o)),h){case 0:(a+=e)>=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return r}},33595:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,a=0;a<e.length;a++)i=Math.min(i,e[a].x),s=Math.max(s,e[a].x),n=Math.min(n,e[a].y),r=Math.max(r,e[a].y);return t.x=i,t.y=n,t.width=s-i,t.height=r-n,t}},20074:t=>{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},92171:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),a=Math.max(t.bottom,i);return t.y=r,t.height=a-r,t}},42981:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},46907:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},60170:t=>{t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},13019:t=>{t.exports=function(t){return 2*(t.width+t.height)}},85133:(t,e,i)=>{var s=i(2141),n=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(o*r)<Math.abs(h*a)?h=o*r/a:o=h*a/r,i.x=o+t.centerX,i.y=h+t.centerY,i}},26597:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},86470:(t,e,i)=>{var s=i(30976),n=i(70273),r=i(2141);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},87841:(t,e,i)=>{var s=i(83419),n=i(37303),r=i(20812),a=i(34819),o=i(23777),h=i(23031),l=i(26597),u=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},94845:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},31730:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},36899:(t,e,i)=>{var s=i(87841);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,a,o)}},93232:(t,e,i)=>{var s=i(87841);s.Area=i(62224),s.Ceil=i(98615),s.CeilAll=i(31688),s.CenterOn=i(67502),s.Clone=i(65085),s.Contains=i(37303),s.ContainsPoint=i(96553),s.ContainsRect=i(70273),s.CopyFrom=i(43459),s.Decompose=i(77493),s.Equals=i(9219),s.FitInside=i(53751),s.FitOutside=i(16088),s.Floor=i(80774),s.FloorAll=i(83859),s.FromPoints=i(19217),s.FromXY=i(9477),s.GetAspectRatio=i(8249),s.GetCenter=i(27165),s.GetPoint=i(20812),s.GetPoints=i(34819),s.GetSize=i(51313),s.Inflate=i(86091),s.Intersection=i(53951),s.MarchingAnts=i(14649),s.MergePoints=i(33595),s.MergeRect=i(20074),s.MergeXY=i(92171),s.Offset=i(42981),s.OffsetPoint=i(46907),s.Overlaps=i(60170),s.Perimeter=i(13019),s.PerimeterPoint=i(85133),s.Random=i(26597),s.RandomOutside=i(86470),s.SameDimensions=i(94845),s.Scale=i(31730),s.Union=i(36899),t.exports=s},41658:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,a=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(a-i))/2)}},39208:(t,e,i)=>{var s=i(16483);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},39545:(t,e,i)=>{var s=i(94811),n=i(16483);t.exports=function(t,e,i,r,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===a&&(a=[]);for(var o,h,l,u,c,d,f,p,g,m=s(t,e),v=0;v<m.length;v+=3)o=m[v],h=m[v+1],l=m[v+2],u=t[2*o]*i,c=t[2*o+1]*r,d=t[2*h]*i,f=t[2*h+1]*r,p=t[2*l]*i,g=t[2*l+1]*r,a.push(new n(u,c,d,f,p,g));return a}},90301:(t,e,i)=>{var s=i(16483);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},23707:(t,e,i)=>{var s=i(97523),n=i(13584);t.exports=function(t,e,i,r){void 0===r&&(r=s);var a=r(t),o=e-a.x,h=i-a.y;return n(t,o,h)}},97523:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},24951:(t,e,i)=>{var s=i(26099);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,a=t.x1-i,o=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(a,o,h,l),c=n(o,a*a+o*o,l,h*h+l*l),d=n(a,a*a+o*o,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},85614:(t,e,i)=>{var s=i(96503);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,a=t.y1,o=t.x2,h=t.y2,l=t.x3,u=t.y3,c=o-r,d=h-a,f=l-r,p=u-a,g=c*(r+o)+d*(a+h),m=f*(r+l)+p*(a+u),v=2*(c*(u-h)-d*(l-o));if(Math.abs(v)<1e-6){var y=Math.min(r,o,l),x=Math.min(a,h,u);i=.5*(Math.max(r,o,l)-y),n=.5*(Math.max(a,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(p*g-d*m)/v,e.y=(c*m-f*g)/v,i=e.x-r,n=e.y-a,e.radius=Math.sqrt(i*i+n*n);return e}},74422:(t,e,i)=>{var s=i(16483);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},10690:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,a=t.y2-t.y1,o=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*a,c=s*o+n*h,d=r*r+a*a,f=r*o+a*h,p=l*d-u*u,g=0===p?0:1/p,m=(d*c-u*f)*g,v=(l*f-u*c)*g;return m>=0&&v>=0&&m+v<1}},48653:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,a,o,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,m=d*d+f*f,v=p*m-g*g,y=0===v?0:1/v,x=t.x1,w=t.y1,b=0;b<e.length&&(r=(p*(l=d*(a=e[b].x-x)+f*(o=e[b].y-w))-g*(h=u*a+c*o))*y,!((n=(m*h-g*l)*y)>=0&&r>=0&&n+r<1&&(s.push({x:e[b].x,y:e[b].y}),i)));b++);return s}},96006:(t,e,i)=>{var s=i(10690);t.exports=function(t,e){return s(t,e.x,e.y)}},71326:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437:(t,e,i)=>{var s=i(2141),n=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(a),u=n(o),c=(h+l+u)*e,d=0;return c<h?(d=c/h,i.x=r.x1+(r.x2-r.x1)*d,i.y=r.y1+(r.y2-r.y1)*d):c>h+l?(d=(c-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d):(d=(c-=h)/l,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d),i}},80672:(t,e,i)=>{var s=i(35001),n=i(2141);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=s(a),u=s(o),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var f=0;f<e;f++){var p=d*(f/e),g=0,m=new n;p<l?(g=p/l,m.x=a.x1+(a.x2-a.x1)*g,m.y=a.y1+(a.y2-a.y1)*g):p>l+u?(g=(p-=l+u)/c,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),r.push(m)}return r}},39757:(t,e,i)=>{var s=i(2141);function n(t,e,i,s){var n=t-i,r=e-s,a=n*n+r*r;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=n(h,l,a,o),c=n(i,r,h,l),d=n(a,o,i,r),f=u+c+d;return e.x=(i*u+a*c+h*d)/f,e.y=(r*u+o*c+l*d)/f,e}},13584:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376:(t,e,i)=>{var s=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},90260:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+r*h),e.y=t.y1+(n*o+a*h),e}},52172:(t,e,i)=>{var s=i(99614),n=i(39757);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},49907:(t,e,i)=>{var s=i(99614);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},99614:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x1-e,o=t.y1-i;return t.x1=a*n-o*r+e,t.y1=a*r+o*n+i,a=t.x2-e,o=t.y2-i,t.x2=a*n-o*r+e,t.y2=a*r+o*n+i,a=t.x3-e,o=t.y3-i,t.x3=a*n-o*r+e,t.y3=a*r+o*n+i,t}},16483:(t,e,i)=>{var s=i(83419),n=i(10690),r=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435:(t,e,i)=>{var s=i(16483);s.Area=i(41658),s.BuildEquilateral=i(39208),s.BuildFromPolygon=i(39545),s.BuildRight=i(90301),s.CenterOn=i(23707),s.Centroid=i(97523),s.CircumCenter=i(24951),s.CircumCircle=i(85614),s.Clone=i(74422),s.Contains=i(10690),s.ContainsArray=i(48653),s.ContainsPoint=i(96006),s.CopyFrom=i(71326),s.Decompose=i(71694),s.Equals=i(33522),s.GetPoint=i(20437),s.GetPoints=i(80672),s.InCenter=i(39757),s.Perimeter=i(1376),s.Offset=i(13584),s.Random=i(90260),s.Rotate=i(52172),s.RotateAroundPoint=i(49907),s.RotateAroundXY=i(99614),t.exports=s},74457:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409:t=>{t.exports=function(t,e){return function(i,s,n,r){var a=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return a&&a>=e}}},7003:(t,e,i)=>{var s=i(83419),n=i(93301),r=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),c=i(36210),d=i(61340),f=i(85955),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.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 d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var s=0;s<i.length;s++){var n=i[s];if(n.sys.input&&n.sys.input.updatePoll(t,e)&&this.globalTopOnly)return}},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this.canvas.style.cursor=t.cursor)},resetCursor:function(t,e){(e||t&&t.cursor)&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(t){void 0===t&&(t=1);var e=[];this.pointersTotal+t>10&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var s=this.pointers.length,n=new u(this,s);n.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(n),this.pointersTotal++,e.push(n)}return e},updateInputPlugins:function(t,e){var i=this.game.scene.getScenes(!1,!0);this._tempSkip=!1;for(var s=0;s<i.length;s++){var n=i[s];if(n.sys.input&&(n.sys.input.update(t,e)&&this.globalTopOnly||this._tempSkip))return}},onTouchStart:function(t){for(var e=this.pointers,i=[],s=0;s<t.changedTouches.length;s++)for(var r=t.changedTouches[s],a=1;a<e.length;a++){var o=e[a];if(!o.active){o.touchstart(r,t),this.activePointer=o,i.push(o);break}}this.updateInputPlugins(n.TOUCH_START,i)},onTouchMove:function(t){for(var e=this.pointers,i=[],s=0;s<t.changedTouches.length;s++)for(var r=t.changedTouches[s],a=1;a<e.length;a++){var o=e[a];if(o.active&&o.identifier===r.identifier){var h=document.elementFromPoint(r.clientX,r.clientY)===this.canvas;!this.isOver&&h?this.setCanvasOver(t):this.isOver&&!h&&this.setCanvasOut(t),this.isOver&&(o.touchmove(r,t),this.activePointer=o,i.push(o));break}}this.updateInputPlugins(n.TOUCH_MOVE,i)},onTouchEnd:function(t){for(var e=this.pointers,i=[],s=0;s<t.changedTouches.length;s++)for(var r=t.changedTouches[s],a=1;a<e.length;a++){var o=e[a];if(o.active&&o.identifier===r.identifier){o.touchend(r,t),i.push(o);break}}this.updateInputPlugins(n.TOUCH_END,i)},onTouchCancel:function(t){for(var e=this.pointers,i=[],s=0;s<t.changedTouches.length;s++)for(var r=t.changedTouches[s],a=1;a<e.length;a++){var o=e[a];if(o.active&&o.identifier===r.identifier){o.touchcancel(r,t),i.push(o);break}}this.updateInputPlugins(n.TOUCH_CANCEL,i)},onMouseDown:function(t){var e=this.mousePointer;e.down(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(n.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(t){var e=this.mousePointer;e.move(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(n.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(t){var e=this.mousePointer;e.up(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(n.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(t){var e=this.mousePointer;e.wheel(t),this.activePointer=e,this.updateInputPlugins(n.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(t){var e=this.mouse.locked;this.mousePointer.locked=e,this.events.emit(a.POINTERLOCK_CHANGE,t,e)},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var s=!0,n=t.parentContainer;if(n)do{if(!n.willRender(e)){s=!1;break}n=n.parentContainer}while(n);return s},hitTest:function(t,e,i,s){void 0===s&&(s=this._tempHitTest);var n=this._tempPoint,r=i.scrollX,a=i.scrollY;s.length=0;var o=t.x,h=t.y;i.getWorldPoint(o,h,n),t.worldX=n.x,t.worldY=n.y;for(var l={x:0,y:0},u=this._tempMatrix,c=this._tempMatrix2,d=0;d<e.length;d++){var p=e[d];if(this.inputCandidate(p,i)){var g=n.x+r*p.scrollFactorX-r,m=n.y+a*p.scrollFactorY-a;p.parentContainer?(p.getWorldTransformMatrix(u,c),u.applyInverse(g,m,l)):f(g,m,p.x,p.y,p.rotation,p.scaleX,p.scaleY,l),this.pointWithinHitArea(p,l.x,l.y)&&s.push(p)}}return s},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var s=t.input;return!(!s||!s.hitAreaCallback(s.hitArea,e,i,t)||(s.localX=e,s.localY=i,0))},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i,s){var n=t.position,r=t.prevPosition;r.x=n.x,r.y=n.y;var a=this.scaleManager.transformX(e),o=this.scaleManager.transformY(i),h=t.smoothFactor;s&&0!==h?(n.x=a*h+r.x*(1-h),n.y=o*h+r.y*(1-h)):(n.x=a,n.y=o)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(o.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=p},48205:(t,e,i)=>{var s=i(96503),n=i(87902),r=i(83419),a=i(93301),o=i(74457),h=i(84409),l=i(20339),u=i(8497),c=i(81154),d=i(8214),f=i(50792),p=i(95540),g=i(23777),m=i(89639),v=i(41212),y=i(37277),x=i(87841),w=i(37303),b=i(44594),T=i(16483),S=i(10690),E=new r({Extends:f,initialize:function(t){f.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,m.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,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,t.sys.events.once(b.BOOT,this.boot,this),t.sys.events.on(b.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(b.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(b.TRANSITION_START,this.transitionIn,this),t.on(b.TRANSITION_OUT,this.transitionOut,this),t.on(b.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(b.PRE_UPDATE,this.preUpdate,this),t.once(b.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r<i;r++){var a=t[r],o=n.indexOf(a);o>-1&&(n.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager.pointers;for(i=0;i<s.length;i++)s[i].updateMotion();if(0===this._list.length)return!1;var n=this.pollRate;if(-1===n)return!1;if(n>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var r=!1;for(i=0;i<s.length;i++){var a=0,o=s[i];this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp,o),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),a+=this.processOverOutEvents(o),2===this.getDragState(o)&&this.processDragThresholdEvent(o,t),a>0&&(r=!0)}return r},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,s=0;s<e.length;s++){var n=0,r=e[s];switch(this._tempZones=[],this._temp=this.hitTestPointer(r),this.sortGameObjects(this._temp,r),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),t){case a.MOUSE_DOWN:n+=this.processDragDownEvent(r),n+=this.processDownEvents(r),n+=this.processOverOutEvents(r);break;case a.MOUSE_UP:n+=this.processDragUpEvent(r),n+=this.processUpEvents(r),n+=this.processOverOutEvents(r);break;case a.TOUCH_START:n+=this.processDragDownEvent(r),n+=this.processDownEvents(r),n+=this.processOverEvents(r);break;case a.TOUCH_END:case a.TOUCH_CANCEL:n+=this.processDragUpEvent(r),n+=this.processUpEvents(r),n+=this.processOutEvents(r);break;case a.MOUSE_MOVE:case a.TOUCH_MOVE:n+=this.processDragMoveEvent(r),n+=this.processMoveEvents(r),n+=this.processOverOutEvents(r);break;case a.MOUSE_WHEEL:n+=this.processWheelEvent(r)}n>0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var s,n=this._drag,r=this._over,a=this.manager,o=0;o<a.pointers.length;o++)(s=n[o].indexOf(t))>-1&&n[o].splice(s,1),(s=r[o].indexOf(t))>-1&&r[o].splice(s,1);return e&&this.resetCursor(),this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var s=e[i],n=this.manager.hitTest(t,this._list,s),r=0;r<n.length;r++){var a=n[r];a.input.dropZone&&this._tempZones.push(a)}if(n.length>0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=0;r<i.length;r++){var a=i[r];if(a.input&&a.input.enabled){if(e++,a.emit(d.GAMEOBJECT_POINTER_DOWN,t,a.input.localX,a.input.localY,n),s.cancelled||!this.isActive())break;if(a.input&&a.input.enabled&&(this.emit(d.GAMEOBJECT_DOWN,t,a,n),s.cancelled||!this.isActive()))break}}return!s.cancelled&&this.isActive()&&(t.downElement===this.manager.game.canvas?this.emit(d.POINTER_DOWN,t,i):this.emit(d.POINTER_DOWN_OUTSIDE,t)),e},getDragState:function(t){return this._dragState[t.id]},setDragState:function(t,e){this._dragState[t.id]=e},processDragThresholdEvent:function(t,e){var i=!1,s=this.dragTimeThreshold,n=this.dragDistanceThreshold;if((n>0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i<e.length;i++){var s=e[i],n=s.input;n.dragState=2,n.dragStartX=s.x,n.dragStartY=s.y,n.dragStartXGlobal=t.worldX,n.dragStartYGlobal=t.worldY,n.dragStartCamera=t.camera,n.dragX=n.dragStartXGlobal-n.dragStartX,n.dragY=n.dragStartYGlobal-n.dragStartY,s.emit(d.GAMEOBJECT_DRAG_START,t,n.dragX,n.dragY),this.emit(d.DRAG_START,t,s)}return this.setDragState(t,4),e.length},processDragDownEvent:function(t){var e=this._temp;if(0===this._draggable.length||0===e.length||!t.primaryDown||0!==this.getDragState(t))return 0;this.setDragState(t,1);for(var i=[],s=0;s<e.length;s++){var n=e[s];n.input.draggable&&0===n.input.dragState&&i.push(n)}return 0===i.length?(this.setDragState(t,0),0):(i.length>1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var s=0;s<i.length;s++){var n,r,a=i[s],o=a.input,h=o.target;if(h){var l=e.indexOf(h);0===l?(a.emit(d.GAMEOBJECT_DRAG_OVER,t,h),this.emit(d.DRAG_OVER,t,a,h)):l>0?(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var c=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),g=c*Math.cos(p)+f*Math.sin(p),m=f*Math.cos(p)-c*Math.sin(p);g*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,n=g+o.dragStartX,r=m+o.dragStartY}else n=u.x-o.dragX,r=u.y-o.dragY;a.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,a,n,r)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i<e.length;i++){var s=e[i],n=s.input;if(n&&2===n.dragState){n.dragState=0,n.dragX=n.localX-s.displayOriginX,n.dragY=n.localY-s.displayOriginY,n.dragStartCamera=null;var r=!1,a=n.target;a&&(s.emit(d.GAMEOBJECT_DROP,t,a),this.emit(d.DROP,t,s,a),n.target=null,r=!0),s.input&&s.input.enabled&&(s.emit(d.GAMEOBJECT_DRAG_END,t,n.dragX,n.dragY,r),this.emit(d.DRAG_END,t,s,r))}}return this.setDragState(t,0),e.splice(0),0},processMoveEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=0;r<i.length;r++){var a=i[r];if(a.input&&a.input.enabled){if(e++,a.emit(d.GAMEOBJECT_POINTER_MOVE,t,a.input.localX,a.input.localY,n),s.cancelled||!this.isActive())break;if(a.input&&a.input.enabled){if(this.emit(d.GAMEOBJECT_MOVE,t,a,n),s.cancelled||!this.isActive())break;if(this.topOnly)break}}}return!s.cancelled&&this.isActive()&&this.emit(d.POINTER_MOVE,t,i),e},processWheelEvent:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=t.deltaX,a=t.deltaY,o=t.deltaZ,h=0;h<i.length;h++){var l=i[h];if(l.input&&l.input.enabled){if(e++,l.emit(d.GAMEOBJECT_POINTER_WHEEL,t,r,a,o,n),s.cancelled||!this.isActive())break;if(l.input&&l.input.enabled&&(this.emit(d.GAMEOBJECT_WHEEL,t,l,r,a,o,n),s.cancelled||!this.isActive()))break}}return!s.cancelled&&this.isActive()&&this.emit(d.POINTER_WHEEL,t,i,r,a,o),e},processOverEvents:function(t){var e=this._temp,i=0,s=e.length,n=[];if(s>0){var r=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h<s;h++){var l=e[h];if(l.input&&l.input.enabled){if(n.push(l),r.setCursor(l.input),l.emit(d.GAMEOBJECT_POINTER_OVER,t,l.input.localX,l.input.localY,o),i++,a.cancelled||!this.isActive())break;if(l.input&&l.input.enabled&&(this.emit(d.GAMEOBJECT_OVER,t,l,o),a.cancelled||!this.isActive()))break}}!a.cancelled&&this.isActive()&&this.emit(d.POINTER_OVER,t,n)}return this._over[t.id]=n,i},processOutEvents:function(t){var e=this._over[t.id],i=0,s=e.length;if(s>0){var n=this.manager,r=this._eventData,a=this._eventContainer;r.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o<s;o++){var h=e[o];if((h=e[o]).input&&h.input.enabled){if(n.resetCursor(h.input),h.emit(d.GAMEOBJECT_POINTER_OUT,t,a),i++,r.cancelled||!this.isActive())break;if(h.input&&h.input.enabled&&(this.emit(d.GAMEOBJECT_OUT,t,h,a),r.cancelled||!this.isActive()))break}}!r.cancelled&&this.isActive()&&this.emit(d.POINTER_OUT,t,e),this._over[t.id]=[]}return i},processOverOutEvents:function(t){var e,i,s=this._temp,n=[],r=[],a=[],o=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<o.length;e++)i=o[e],-1===s.indexOf(i)&&-1===h.indexOf(i)?n.push(i):a.push(i);for(e=0;e<s.length;e++)i=s[e],-1===o.indexOf(i)&&r.push(i);var u=n.length,c=0,f=this._eventData,p=this._eventContainer;if(f.cancelled=!1,u>0){for(this.sortGameObjects(n,t),e=0;e<u;e++)if((i=n[e]).input&&i.input.enabled){if(l.resetCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OUT,t,p),c++,f.cancelled||!this.isActive())break;if(i.input&&i.input.enabled&&(this.emit(d.GAMEOBJECT_OUT,t,i,p),f.cancelled||!this.isActive()))break}f.cancelled&&!this.isActive()||this.emit(d.POINTER_OUT,t,n)}if(u=r.length,f.cancelled=!1,u>0){for(this.sortGameObjects(r,t),e=0;e<u;e++)if((i=r[e]).input&&i.input.enabled){if(l.setCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OVER,t,i.input.localX,i.input.localY,p),c++,f.cancelled||!this.isActive())break;if(i.input&&i.input.enabled&&(this.emit(d.GAMEOBJECT_OVER,t,i,p),f.cancelled||!this.isActive()))break}!f.cancelled&&this.isActive()&&this.emit(d.POINTER_OVER,t,r)}return o=a.concat(r),this._over[t.id]=this.sortGameObjects(o,t),c},processUpEvents:function(t){var e=this._temp,i=this._eventData,s=this._eventContainer;i.cancelled=!1;for(var n=0;n<e.length;n++){var r=e[n];if(r.input&&r.input.enabled){if(r.emit(d.GAMEOBJECT_POINTER_UP,t,r.input.localX,r.input.localY,s),i.cancelled||!this.isActive())break;if(r.input&&r.input.enabled&&(this.emit(d.GAMEOBJECT_UP,t,r,s),i.cancelled||!this.isActive()))break}}return!i.cancelled&&this.isActive()&&(t.upElement===this.manager.game.canvas?this.emit(d.POINTER_UP,t,e):this.emit(d.POINTER_UP_OUTSIDE,t)),e.length},forceDownState:function(t,e){this.forceState(t,e,d.GAMEOBJECT_POINTER_DOWN,d.GAMEOBJECT_DOWN,!1)},forceUpState:function(t,e){this.forceState(t,e,d.GAMEOBJECT_POINTER_UP,d.GAMEOBJECT_UP,!1)},forceOverState:function(t,e){this.forceState(t,e,d.GAMEOBJECT_POINTER_OVER,d.GAMEOBJECT_OVER,!0)},forceOutState:function(t,e){this.forceState(t,e,d.GAMEOBJECT_POINTER_OUT,d.GAMEOBJECT_OUT,!1)},forceState:function(t,e,i,s,n){var r=this._eventData,a=this._eventContainer;r.cancelled=!1,e.input&&e.input.enabled&&(e.emit(i,t,e.input.localX,e.input.localY,a),n&&this.setCursor(e.input),!r.cancelled&&this.isActive()&&e.input&&e.input.enabled&&this.emit(s,t,e,a))},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i];s.input.draggable=e;var n=this._draggable.indexOf(s);e&&-1===n?this._draggable.push(s):!e&&n>-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e,c=t.some((function(t){return t.hasOwnProperty("faces")}));if(!c){e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d))}s=p(u,"draggable",!1),n=p(u,"dropZone",!1),r=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var f=0;f<t.length;f++){var g=t[f];if(h&&"Container"===g.type)console.warn("Cannot pixelPerfect test a Container. Use a custom callback.");else{var m=g.input?g.input:o(g,e,i);m.customHitArea=l,m.dropZone=n,m.cursor=a?"pointer":r,g.input=m,s&&this.setDraggable(g),this.queueForInsertion(g)}}return this},setHitAreaCircle:function(t,e,i,r,a){void 0===a&&(a=n);var o=new s(e,i,r);return this.setHitArea(t,o,a)},setHitAreaEllipse:function(t,e,i,s,n,r){void 0===r&&(r=c);var a=new u(e,i,s,n);return this.setHitArea(t,a,r)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=w),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i],n=s.frame,r=0,a=0;s.width?(r=s.width,a=s.height):n&&(r=n.realWidth,a=n.realHeight),"Container"!==s.type||0!==r&&0!==a?0!==r&&0!==a&&(s.input=o(s,new x(0,0,r,a),e),this.queueForInsertion(s)):console.warn("Container.setInteractive must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,s,n,r){void 0===r&&(r=w);var a=new x(e,i,s,n);return this.setHitArea(t,a,r)},setHitAreaTriangle:function(t,e,i,s,n,r,a,o){void 0===o&&(o=S);var h=new T(e,i,s,n,r,a);return this.setHitArea(t,h,o)},enableDebug:function(t,e){void 0===e&&(e=65280);var i=t.input;if(!i||!i.hitArea)return this;var s=i.hitArea,n=s.type,r=i.hitAreaDebug,a=this.systems.add,o=this.systems.updateList;r&&(o.remove(r),r.destroy(),r=null);var h=0,l=0;switch(n){case g.CIRCLE:r=a.arc(0,0,s.radius),h=s.x-s.radius,l=s.y-s.radius;break;case g.ELLIPSE:r=a.ellipse(0,0,s.width,s.height),h=s.x-s.width/2,l=s.y-s.height/2;break;case g.LINE:r=a.line(0,0,s.x1,s.y1,s.x2,s.y2);break;case g.POLYGON:r=a.polygon(0,0,s.points);break;case g.RECTANGLE:r=a.rectangle(0,0,s.width,s.height),h=s.x,l=s.y;break;case g.TRIANGLE:r=a.triangle(0,0,s.x1,s.y1,s.x2,s.y2,s.x3,s.y3)}return r&&(r.isFilled=!1,r.strokeColor=e,r.preUpdate=function(){r.setVisible(t.visible),r.setStrokeStyle(1/t.scale,r.strokeColor),r.setDisplayOrigin(t.displayOriginX,t.displayOriginY);var e=t.x,i=t.y,s=t.rotation,n=t.scaleX,a=t.scaleY;if(t.parentContainer){var o=t.getWorldTransformMatrix();e=o.tx,i=o.ty,s=o.rotation,n=o.scaleX,a=o.scaleY}r.setRotation(s),r.setScale(n,a),r.setPosition(e+h*n,i+l*a),r.setScrollFactor(t.scrollFactorX,t.scrollFactorY),r.setDepth(t.depth)},o.add(r),i.hitAreaDebug=r),this},removeDebug:function(t){var e=t.input;return e&&e.hitAreaDebug&&(e.hitAreaDebug.destroy(),e.hitAreaDebug=null),this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t,e){if(t.length<2||!e.camera)return t;var i=e.camera.renderList;return t.sort((function(t,e){var s=Math.max(i.indexOf(t),0);return Math.max(i.indexOf(e),0)-s}))},sortDropZones:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortDropZoneHandler.bind(this)))},sortDropZoneHandler:function(t,e){if(t.parentContainer||e.parentContainer){if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),s=e.getIndexList(),n=Math.min(i.length,s.length),r=0;r<n;r++){var a=i[r],o=s[r];if(a!==o)return o-a}return s.length-i.length}return this.displayList.getIndex(e)-this.displayList.getIndex(t)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),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(d.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 t=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.manager;e.canvas.style.cursor=e.defaultCursor;var i=this.systems.events;i.off(b.TRANSITION_START,this.transitionIn,this),i.off(b.TRANSITION_OUT,this.transitionOut,this),i.off(b.TRANSITION_COMPLETE,this.transitionComplete,this),i.off(b.PRE_UPDATE,this.preUpdate,this),e.events.off(d.GAME_OUT,this.onGameOut,this),e.events.off(d.GAME_OVER,this.onGameOver,this),i.off(b.SHUTDOWN,this.shutdown,this)},resetPointers:function(){for(var t=this.manager.pointers,e=0;e<t.length;e++)t[e].reset()},destroy:function(){this.shutdown(),this.pluginEvents.emit(d.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(b.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]}}});y.register("InputPlugin",E,"input"),t.exports=E},89639:(t,e,i)=>{var s=i(35154),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var a in n){var o=n[a].plugin,h=n[a].mapping,l=n[a].settingsKey,u=n[a].configKey;s(i,l,r[u])&&(t[h]=new o(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},42515:(t,e,i)=>{var s=i(31040),n=i(83419),r=i(20339),a=i(43855),o=i(47235),h=i(26099),l=i(25892),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,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===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=o(this.motionFactor,i,t),h=o(this.motionFactor,n,e);a(r,t,.1)&&(r=t),a(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.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.buttons?0===this.button&&!this.isDown:0===this.button},rightButtonReleased:function(){return 0===this.buttons?2===this.button&&!this.isDown:2===this.button},middleButtonReleased:function(){return 0===this.buttons?1===this.button&&!this.isDown:1===this.button},backButtonReleased:function(){return 0===this.buttons?3===this.button&&!this.isDown:3===this.button},forwardButtonReleased:function(){return 0===this.buttons?4===this.button&&!this.isDown:4===this.button},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(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?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,a=0;a<t;a++){var h=1/t*a;e[a]={x:o(h,i,n),y:o(h,s,r)}}return e},reset:function(){this.event=null,this.downElement=null,this.upElement=null,this.button=0,this.buttons=0,this.position.set(0,0),this.prevPosition.set(0,0),this.midPoint.set(-1,-1),this.velocity.set(0,0),this.angle=0,this.distance=0,this.worldX=0,this.worldY=0,this.downX=0,this.downY=0,this.upX=0,this.upY=0,this.moveTime=0,this.upTime=0,this.downTime=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.deltaX=0,this.deltaY=0,this.deltaZ=0,this.active=0===this.id},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},time:{get:function(){return this.event?this.event.timeStamp:0}}});t.exports=u},93301:t=>{t.exports={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}},7179:t=>{t.exports="boot"},85375:t=>{t.exports="destroy"},39843:t=>{t.exports="dragend"},23388:t=>{t.exports="dragenter"},16133:t=>{t.exports="drag"},27829:t=>{t.exports="dragleave"},53904:t=>{t.exports="dragover"},56058:t=>{t.exports="dragstart"},2642:t=>{t.exports="drop"},88171:t=>{t.exports="gameobjectdown"},36147:t=>{t.exports="dragend"},71692:t=>{t.exports="dragenter"},96149:t=>{t.exports="drag"},81285:t=>{t.exports="dragleave"},74048:t=>{t.exports="dragover"},21322:t=>{t.exports="dragstart"},49378:t=>{t.exports="drop"},86754:t=>{t.exports="gameobjectmove"},86433:t=>{t.exports="gameobjectout"},60709:t=>{t.exports="gameobjectover"},24081:t=>{t.exports="pointerdown"},11172:t=>{t.exports="pointermove"},18907:t=>{t.exports="pointerout"},95579:t=>{t.exports="pointerover"},35368:t=>{t.exports="pointerup"},26972:t=>{t.exports="wheel"},47078:t=>{t.exports="gameobjectup"},73802:t=>{t.exports="gameobjectwheel"},56718:t=>{t.exports="gameout"},25936:t=>{t.exports="gameover"},27503:t=>{t.exports="boot"},50852:t=>{t.exports="process"},96438:t=>{t.exports="update"},59152:t=>{t.exports="pointerlockchange"},47777:t=>{t.exports="pointerdown"},27957:t=>{t.exports="pointerdownoutside"},19444:t=>{t.exports="pointermove"},54251:t=>{t.exports="pointerout"},18667:t=>{t.exports="pointerover"},27192:t=>{t.exports="pointerup"},24652:t=>{t.exports="pointerupoutside"},45132:t=>{t.exports="wheel"},44512:t=>{t.exports="preupdate"},15757:t=>{t.exports="shutdown"},41637:t=>{t.exports="start"},93802:t=>{t.exports="update"},8214:(t,e,i)=>{t.exports={BOOT:i(7179),DESTROY:i(85375),DRAG_END:i(39843),DRAG_ENTER:i(23388),DRAG:i(16133),DRAG_LEAVE:i(27829),DRAG_OVER:i(53904),DRAG_START:i(56058),DROP:i(2642),GAME_OUT:i(56718),GAME_OVER:i(25936),GAMEOBJECT_DOWN:i(88171),GAMEOBJECT_DRAG_END:i(36147),GAMEOBJECT_DRAG_ENTER:i(71692),GAMEOBJECT_DRAG:i(96149),GAMEOBJECT_DRAG_LEAVE:i(81285),GAMEOBJECT_DRAG_OVER:i(74048),GAMEOBJECT_DRAG_START:i(21322),GAMEOBJECT_DROP:i(49378),GAMEOBJECT_MOVE:i(86754),GAMEOBJECT_OUT:i(86433),GAMEOBJECT_OVER:i(60709),GAMEOBJECT_POINTER_DOWN:i(24081),GAMEOBJECT_POINTER_MOVE:i(11172),GAMEOBJECT_POINTER_OUT:i(18907),GAMEOBJECT_POINTER_OVER:i(95579),GAMEOBJECT_POINTER_UP:i(35368),GAMEOBJECT_POINTER_WHEEL:i(26972),GAMEOBJECT_UP:i(47078),GAMEOBJECT_WHEEL:i(73802),MANAGER_BOOT:i(27503),MANAGER_PROCESS:i(50852),MANAGER_UPDATE:i(96438),POINTER_DOWN:i(47777),POINTER_DOWN_OUTSIDE:i(27957),POINTER_MOVE:i(19444),POINTER_OUT:i(54251),POINTER_OVER:i(18667),POINTER_UP:i(27192),POINTER_UP_OUTSIDE:i(24652),POINTER_WHEEL:i(45132),POINTERLOCK_CHANGE:i(59152),PRE_UPDATE:i(44512),SHUTDOWN:i(15757),START:i(41637),UPDATE:i(93802)}},97421:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=s},28884:(t,e,i)=>{var s=i(83419),n=i(92734),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},99125:(t,e,i)=>{var s=i(97421),n=i(28884),r=i(83419),a=i(50792),o=i(26099),h=new r({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r<e.buttons.length;r++)i.push(new n(this,r));this.buttons=i;var h=[];for(r=0;r<e.axes.length;r++)h.push(new s(this,r));this.axes=h,this.vibration=e.vibrationActuator;var l={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:l,this._LCRight=i[15]?i[15]:l,this._LCTop=i[12]?i[12]:l,this._LCBottom=i[13]?i[13]:l,this._RCLeft=i[2]?i[2]:l,this._RCRight=i[1]?i[1]:l,this._RCTop=i[3]?i[3]:l,this._RCBottom=i[0]?i[0]:l,this._FBLeftTop=i[4]?i[4]:l,this._FBLeftBottom=i[6]?i[6]:l,this._FBRightTop=i[5]?i[5]:l,this._FBRightBottom=i[7]?i[7]:l;var u={value:0};this._HAxisLeft=h[0]?h[0]:u,this._VAxisLeft=h[1]?h[1]:u,this._HAxisRight=h[2]?h[2]:u,this._VAxisRight=h[3]?h[3]:u,this.leftStick=new o,this.rightStick=new o,this._created=performance.now()},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){if(!(t.timestamp<this._created)){var e,i=this.buttons,s=t.buttons,n=i.length;for(e=0;e<n;e++)i[e].update(s[e].value);var r=this.axes,a=t.axes;for(n=r.length,e=0;e<n;e++)r[e].update(a[e]);n>=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].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}}});t.exports=h},56654:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(92734),a=i(99125),o=i(35154),h=i(89639),l=i(8214),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=o(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=o(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t<this.gamepads.length;t++)this.gamepads[t].removeAllListeners()},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads[t].pad.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var s=t[i];if(s){var n=s.id,r=s.index,o=e[r];if(o)o.id!==n?(o.destroy(),e[r]=new a(this,s)):o.update(s);else{var h=new a(this,s);e[r]=h,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=h):this._pad3=h:this._pad2=h:this._pad1=h}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var s=e[i],n=this.getPad(s.gamepad.index);"gamepadconnected"===s.type?this.emit(r.CONNECTED,n,s):"gamepaddisconnected"===s.type&&this.emit(r.DISCONNECTED,n,s)}}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].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}}});h.register("GamepadPlugin",u,"gamepad","gamepad","inputGamepad"),t.exports=u},89651:t=>{t.exports={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}},65294:t=>{t.exports={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}},90089:t=>{t.exports={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}},64894:(t,e,i)=>{t.exports={DUALSHOCK_4:i(65294),SNES_USB:i(89651),XBOX_360:i(90089)}},46008:t=>{t.exports="down"},7629:t=>{t.exports="up"},42206:t=>{t.exports="connected"},86544:t=>{t.exports="disconnected"},94784:t=>{t.exports="down"},14325:t=>{t.exports="up"},92734:(t,e,i)=>{t.exports={BUTTON_DOWN:i(46008),BUTTON_UP:i(7629),CONNECTED:i(42206),DISCONNECTED:i(86544),GAMEPAD_BUTTON_DOWN:i(94784),GAMEPAD_BUTTON_UP:i(14325)}},48646:(t,e,i)=>{t.exports={Axis:i(97421),Button:i(28884),Events:i(92734),Gamepad:i(99125),GamepadPlugin:i(56654),Configs:i(64894)}},14350:(t,e,i)=>{var s=i(93301),n=i(79291),r={CreatePixelPerfectHandler:i(84409),CreateInteractiveObject:i(74457),Events:i(8214),Gamepad:i(48646),InputManager:i(7003),InputPlugin:i(48205),InputPluginCache:i(89639),Keyboard:i(51442),Mouse:i(87078),Pointer:i(42515),Touch:i(95618)};r=n(!1,r,s),t.exports=r},78970:(t,e,i)=>{var s=i(72905),n=i(83419),r=i(8443),a=i(8214),o=i(46032),h=i(29747),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var s=t[i];"string"==typeof s&&(s=o[s.trim().toUpperCase()]),-1===e.indexOf(s)&&e.push(s)}this.preventDefault=e.length>0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var n=t[i];"string"==typeof n&&(n=o[n.toUpperCase()]),s(e,n)}this.preventDefault=e.length>0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),c=i(46032),d=i(87960),f=i(74600),p=i(44594),g=i(56583),m=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),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:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n<t.length;n++){var r=t[n].trim();r&&(s[r]=this.addKey(r,e,i))}}else for(var a in t)s[a]=this.addKey(t[a],e,i);return s},addKey:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s=this.keys;if(t instanceof u){var n=s.indexOf(t);return n>-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,n=this.keys;if(t instanceof u){var r=n.indexOf(t);r>-1&&(s=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(s=n[t],n[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;s<i.length;s++){var n=i[s];n&&(i[s]=void 0,e&&this.removeCapture(n.keyCode),t&&n.destroy())}return this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(void 0===e&&(e=0),this.enabled&&t.isDown){var i=g(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s<e;s++){var n=t[s],a=n.keyCode,o=i[a],h=!1;void 0===n.cancelled&&(n.cancelled=0,n.stopImmediatePropagation=function(){n.cancelled=1},n.stopPropagation=function(){n.cancelled=-1}),-1!==n.cancelled&&(a===this.prevCode&&n.timeStamp===this.prevTime&&n.type===this.prevType||(this.prevCode=a,this.prevTime=n.timeStamp,this.prevType=n.type,"keydown"===n.type?(o&&(h=o.isDown,o.onDown(n)),n.cancelled||o&&h||(f[a]&&this.emit(r.KEY_DOWN+f[a],n),n.cancelled||this.emit(r.ANY_KEY_DOWN,n))):(o&&o.onUp(n),n.cancelled||(f[a]&&this.emit(r.KEY_UP+f[a],n),n.cancelled||this.emit(r.ANY_KEY_UP,n))),1===n.cancelled&&(n.cancelled=0)))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.removeAllKeys(!0),this.removeAllListeners(),this.sceneInputPlugin.manager.events.off(h.MANAGER_PROCESS,this.update,this),this.game.events.off(a.BLUR,this.resetKeys),this.scene.sys.events.off(p.PAUSE,this.resetKeys,this),this.scene.sys.events.off(p.SLEEP,this.resetKeys,this),this.queue=[]},destroy:function(){this.shutdown();for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].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}}});l.register("KeyboardPlugin",m,"keyboard","keyboard","inputKeyboard"),t.exports=m},66970:t=>{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},87960:(t,e,i)=>{var s=i(83419),n=i(95922),r=i(95540),a=i(68769),o=i(92803),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s<e.length;s++){var h=e[s];"string"==typeof h?this.keyCodes.push(h.toUpperCase().charCodeAt(0)):"number"==typeof h?this.keyCodes.push(h):h.hasOwnProperty("keyCode")&&this.keyCodes.push(h.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=r(i,"resetOnWrongKey",!0),this.maxKeyDelay=r(i,"maxKeyDelay",0),this.resetOnMatch=r(i,"resetOnMatch",!1),this.deleteOnMatch=r(i,"deleteOnMatch",!1);var l=this;this.onKeyDown=function(t){!l.matched&&l.enabled&&a(t,l)&&(l.manager.emit(n.COMBO_MATCH,l,t),l.resetOnMatch?o(l):l.deleteOnMatch&&l.destroy())},this.manager.on(n.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(n.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}});t.exports=h},68769:(t,e,i)=>{var s=i(66970);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612:t=>{t.exports="keydown"},23345:t=>{t.exports="keyup"},21957:t=>{t.exports="keycombomatch"},44743:t=>{t.exports="down"},3771:t=>{t.exports="keydown-"},46358:t=>{t.exports="keyup-"},75674:t=>{t.exports="up"},95922:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442:(t,e,i)=>{t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i<e}},90229:t=>{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},38796:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},30472:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(95922),a=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,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(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return 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}});t.exports=a},46032:t=>{t.exports={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}},74600:(t,e,i)=>{var s=i(46032),n={};for(var r in s)n[s[r]]=r;t.exports=n},41170:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i<e}},85098:(t,e,i)=>{var s=i(83419),n=i(89357),r=i(8214),a=i(29747),o=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){t.sourceCapabilities&&t.sourceCapabilities.firesTouchEvents||!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){t.sourceCapabilities&&t.sourceCapabilities.firesTouchEvents||!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var a={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,a),t.addEventListener("mouseout",this.onMouseOut,a),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,a),window.top.addEventListener("mouseup",this.onMouseUpWindow,a)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,a),window.addEventListener("mouseup",this.onMouseUpWindow,a),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.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}});t.exports=o},87078:(t,e,i)=>{t.exports={MouseManager:i(85098)}},36210:(t,e,i)=>{var s=i(83419),n=i(8214),r=i(29747),a=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchEnd(t)},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var r=this.capture,a={passive:!0},o={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,r?o:a),t.addEventListener("touchmove",this.onTouchMove,r?o:a),t.addEventListener("touchend",this.onTouchEnd,r?o:a),t.addEventListener("touchcancel",this.onTouchCancel,r?o:a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,o),window.top.addEventListener("touchend",this.onTouchEndWindow,o),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,o)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,o),window.addEventListener("touchend",this.onTouchEndWindow,o),window.addEventListener("touchcancel",this.onTouchCancelWindow,o),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},95618:(t,e,i)=>{t.exports={TouchManager:i(36210)}},41299:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(54899),a=i(95540),o=i(98356),h=i(3374),l=i(84376),u=i(92638),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile,this.base64="string"==typeof s&&0===s.indexOf("data:"),this.retryAttempts=a(e,"maxRetries",t.maxRetries)},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){if(this.state===n.FILE_POPULATED)this.loader.nextFile(this,!0);else{if(this.state=n.FILE_LOADING,this.src=o(this,this.loader.baseURL),!this.src)throw new Error("URL Error in File: "+this.key+" from: "+this.url);0===this.src.indexOf("data:")&&(this.base64=!0),this.xhrLoader=l(this,this.loader.xhr)}},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onBase64Load:function(t){this.xhrLoader=t,this.state=n.FILE_LOADED,this.percentComplete=1,this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.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.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},74099:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(35072),a=i(50792),o=i(54899),h=i(74099),l=i(95540),u=i(35154),c=i(41212),d=i(37277),f=i(44594),p=i(92638),g=new s({Extends:a,initialize:function(t){a.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=p(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=l(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=l(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.pluginStart,this)},boot:function(){this.systems.events.once(f.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(f.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit(o.ADD,i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(t){var e=t.hasCacheConflict();return e||this.list.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),!e&&this.isLoading()&&(this.inflight.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),this.queue.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}))),e},addPack:function(t,e){if("string"==typeof e){var i=u(t,e);i&&(t={packKey:i})}var s=0,n=this.baseURL,r=this.path,a=this.prefix;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var h=t[o],c=l(h,"baseURL",n),d=l(h,"path",r),f=l(h,"prefix",a),p=l(h,"files",null),g=l(h,"defaultType","void");if(Array.isArray(p)){this.setBaseURL(c),this.setPath(d),this.setPrefix(f);for(var m=0;m<p.length;m++){var v=p[m],y=v.hasOwnProperty("type")?v.type:g;this[y]&&(this[y](v),s++)}}}return this.setBaseURL(n),this.setPath(r),this.setPrefix(a),s>0},removePack:function(t,e){var i,s=this.systems.anims,n=this.cacheManager,r=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(c(t))i=t;else if(!(i=n.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var h=i[o],u=l(h,"prefix",""),d=l(h,"files"),f=l(h,"defaultType");if(Array.isArray(d))for(var p=0;p<d.length;p++){var g=d[p],m=g.hasOwnProperty("type")?g.type:f;if(m){var v=u+g.key;if("animation"===m&&s.remove(v),"aseprite"!==m&&"atlas"!==m&&"atlasXML"!==m&&"htmlTexture"!==m&&"image"!==m&&"multiatlas"!==m&&"spritesheet"!==m&&"svg"!==m&&"texture"!==m&&"unityAtlas"!==m||(r.remove(v),a[m]))if("pack"!==m){if("spine"===m){var y=n.custom.spine.get(v);if(!y)continue;var x=void 0===y.prefix?"":y.prefix;n.custom.spine.remove(v);var w=n.custom.spineTextures.get(v);if(!w)continue;n.custom.spineTextures.remove(v);for(var b=0;b<w.pages.length;b++){var T=x+w.pages[b].name,S=v+":"+T;r.exists(S)?r.remove(S):r.remove(T)}}var E=a[m];null!==E&&(E?n[E].remove(v):console.warn("Unknown type:",m))}else this.removePack(v,g.dataKey)}else console.warn("No type:",g)}}},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(o.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(f.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(o.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each((function(t){if((t.state===n.FILE_POPULATED||t.state===n.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1}),this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit(o.FILE_LOAD,t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit(o.FILE_LOAD_ERROR,t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===n.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===n.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&(t.multiFile.addToCache(),t.multiFile.pendingDestroy()):(t.addToCache(),t.pendingDestroy())),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(o.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=n.LOADER_COMPLETE,this.systems.events.off(f.UPDATE,this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit(o.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var s=new Blob([t],{type:i}),n=URL.createObjectURL(s),r=document.createElement("a");return r.download=e,r.textContent="Download "+e,r.href=n,r.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(l(e,"baseURL",t.loaderBaseURL)),this.setPath(l(e,"path",t.loaderPath)),this.setPrefix(l(e,"prefix",t.loaderPrefix)),this.state=n.LOADER_IDLE},shutdown:function(){this.reset(),this.state=n.LOADER_SHUTDOWN,this.removeAllListeners(),this.systems.events.off(f.UPDATE,this.update,this),this.systems.events.off(f.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=n.LOADER_DESTROYED,this.systems.events.off(f.UPDATE,this.update,this),this.systems.events.off(f.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}});d.register("Loader",g,"load"),t.exports=g},3374:(t,e,i)=>{var s=i(79291),n=i(92638);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},26430:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(54899),a=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i;var a=this.key;t.prefix&&""!==t.prefix&&(this.key=t.prefix+a),this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var o=0;o<r.length;o++)r[o].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&(this.failed++,console.error('File failed: %s "%s" (via %s "%s")',this.type,this.key,t.type,t.key))},pendingDestroy:function(){if(this.state!==n.FILE_PENDING_DESTROY){var t=this.key,e=this.type;this.loader.emit(r.FILE_COMPLETE,t,e),this.loader.emit(r.FILE_KEY_COMPLETE+e+"-"+t,t,e),this.loader.flagForRemoval(this);for(var i=0;i<this.files.length;i++)this.files[i].pendingDestroy();this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.files=null,this.config=null}});t.exports=a},84376:(t,e,i)=>{var s=i(3374);t.exports=function(t,e){var i=s(e,t.xhrSettings);if(t.base64){var n,r=t.url.split(";base64,").pop()||t.url.split(",").pop();return n="arraybuffer"===t.xhrSettings.responseType?{response:Uint8Array.from(atob(r),(function(t){return t.charCodeAt(0)})).buffer}:{responseText:atob(r)},void t.onBase64Load(n)}var a=new XMLHttpRequest;if(a.open("GET",t.src,i.async,i.user,i.password),a.responseType=t.xhrSettings.responseType,a.timeout=i.timeout,i.headers)for(var o in i.headers)a.setRequestHeader(o,i.headers[o]);return i.header&&i.headerValue&&a.setRequestHeader(i.header,i.headerValue),i.requestedWith&&a.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&a.overrideMimeType(i.overrideMimeType),i.withCredentials&&(a.withCredentials=!0),a.onload=t.onLoad.bind(t,a),a.onerror=t.onError.bind(t,a),a.onprogress=t.onProgress.bind(t),a.ontimeout=t.onError.bind(t,a),a.send(),a}},92638:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},23906:t=>{t.exports={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,FILE_PENDING_DESTROY:20}},42155:t=>{t.exports="addfile"},38991:t=>{t.exports="complete"},27540:t=>{t.exports="filecomplete"},87464:t=>{t.exports="filecomplete-"},94486:t=>{t.exports="loaderror"},13035:t=>{t.exports="load"},38144:t=>{t.exports="fileprogress"},97520:t=>{t.exports="postprocess"},85595:t=>{t.exports="progress"},55680:t=>{t.exports="start"},54899:(t,e,i)=>{t.exports={ADD:i(42155),COMPLETE:i(38991),FILE_COMPLETE:i(27540),FILE_KEY_COMPLETE:i(87464),FILE_LOAD_ERROR:i(94486),FILE_LOAD:i(13035),FILE_PROGRESS:i(38144),POST_PROCESS:i(97520),PROGRESS:i(85595),START:i(55680)}},14135:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(518),a=i(54899),o=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,s,i));return this})),t.exports=o},76272:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(19550),o=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new u(this,t[a]),this.addFile(r.files);else r=new u(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=u},38734:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(19550),o=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new u(this,t[a]),this.addFile(r.files);else r=new u(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=u},74599:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(19550),o=i(41212),h=i(26430),l=i(57318),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","xml"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new u(this,t[a]),this.addFile(r.files);else r=new u(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=u},21097:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(89749),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var a=e;e=o(a,"key"),s=o(a,"xhrSettings"),n=o(a,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,a=r.config.audio,c=r.device.audio;l(e)&&(i=o(e,"url",[]),s=o(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!a.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):(console.warn('No audio URLs for "%s" can play on this device',e),null)},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var s=o(e[i],"url",e[i]);if(0===s.indexOf("blob:")||0===s.indexOf("data:"))return{url:s,type:""};var n=s.match(/\.([a-zA-Z0-9]+)($|\?)/);if(n=o(e[i],"type",n?n[1]:"").toLowerCase(),t.device.audio[n])return{url:s,type:n}}return null},a.register("audio",(function(t,e,i,s){var n,r=this.systems.game,a=r.config.audio,o=r.device.audio;if(a.noAudio||!o.webAudio&&!o.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(n=u.create(this,t[h]))&&this.addFile(n);else(n=u.create(this,t,e,i,s))&&this.addFile(n);return this})),t.exports=u},89524:(t,e,i)=>{var s=i(21097),n=i(83419),r=i(74099),a=i(95540),o=i(41212),h=i(518),l=i(26430),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(o(e)){var d=e;e=a(d,"key"),i=a(d,"jsonURL"),n=a(d,"audioURL"),r=a(d,"audioConfig"),u=a(d,"audioXhrSettings"),c=a(d,"jsonXhrSettings")}var f;if(n){var p=s.create(t,e,n,r,u);p&&(f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=a(this.config,"audioConfig"),n=a(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var a,o=this.systems.game,h=o.config.audio,l=o.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c<t.length;c++)(a=new u(this,t[c])).files&&this.addFile(a.files);else(a=new u(this,t,e,i,s,n,r)).files&&this.addFile(a.files);return this}))},85722:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n){var a="bin";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"xhrSettings"),a=o(l,"extension",a),n=o(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:a,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,s,i));return this})),t.exports=l},97025:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(19550),o=i(41212),h=i(26430),l=i(21859),u=i(57318),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new u(t,{key:e,url:r(f,"fontDataURL"),extension:r(f,"fontDataExtension","xml"),xhrSettings:r(f,"fontDataXhrSettings")})}else c=new a(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new c(this,t[a]),this.addFile(r.files);else r=new c(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=c},16024:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},69559:(t,e,i)=>{var s=i(38734),n=i(85722),r=i(83419),a=i(74099),o=i(95540),h=i(19550),l=i(41212),u=i(518),c=i(31403),d=i(46975),f=i(59327),p=i(26430),g=i(82038),m=i(55222),v=new r({Extends:p,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[r])}else{var a=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===a.toLowerCase()?"KTX":"PVR");var o=new n(t,{key:e,url:i.textureURL,extension:a,xhrSettings:s,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[o,h])}else p.call(this,t,"texture",e,[o])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,a=s.path,h=s.prefix,l=o(i,"multiBaseURL",this.baseURL),u=o(i,"multiPath",this.path),c=o(i,"prefix",this.prefix),d=o(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var f=0;f<e.length;f++){var p=e[f].image,g="CMA"+this.multiKeyIndex+"_"+p,m=new n(s,g,p,d);if(this.addToMultiFile(m),s.addFile(m),e[f].normalMap){var v=new n(s,g,e[f].normalMap,d);v.type="normalMap",m.setLink(v),this.addToMultiFile(v),s.addFile(v)}}s.setBaseURL(r),s.setPath(a),s.setPrefix(h)}}},addToCache:function(){function t(t){console.warn('Compressed Texture Invalid: "'+r.key+'". '+t)}if(this.isReadyToProcess()){var e=this.config;if(e.multiAtlasURL)this.addMultiToCache();else{var i,s=this.loader.systems.renderer,n=this.loader.textureManager,r=this.files[0],a=this.files[1];if("PVR"===e.type?i=g(r.data):"KTX"===e.type&&((i=c(r.data))||t("KTX file contains unsupported format.")),i&&!m(i)&&(t("Texture dimensions failed verification. Check the texture format specifications for "+e.format+" 0x"+i.internalFormat.toString(16)+"."),i=null),i&&!s.supportsCompressedTexture(e.format,i.internalFormat)&&(t("Texture format "+e.format+" with internal format "+i.internalFormat+" not supported by the GPU. Texture invalid. This is often due to the texture using sRGB instead of linear RGB."),i=null),i){i.format=s.getCompressedTextureName(e.format,i.internalFormat);var o=a&&a.data?a.data:null;n.addCompressedTexture(r.key,i,o)}}this.complete=!0}},addMultiToCache:function(){for(var t,e=this.config,i=this.files[0],s=[],n=[],r=[],a=this.loader.systems.renderer,o=this.loader.textureManager,h=1;h<this.files.length;h++){var l=this.files[h];if("normalMap"!==l.type)for(var u=l.key.indexOf("_"),d=l.key.substr(u+1),f=l.data,p=0;p<i.data.textures.length;p++){var m=i.data.textures[p];if(m.image===d){"PVR"===e.type?t=g(f):"KTX"===e.type&&(t=c(f)),t&&a.supportsCompressedTexture(e.format,t.internalFormat)&&(t.format=a.getCompressedTextureName(e.format,t.internalFormat),n.push(t),s.push(m),l.linkFile&&r.push(l.linkFile.data));break}}}0===r.length&&(r=void 0),o.addAtlasJSONArray(this.key,n,s,r),this.complete=!0}});a.register("texture",(function(t,e,i){var n=this.systems.renderer,r=function(t,e,i,r){var a={format:null,type:null,textureURL:void 0,atlasURL:void 0,multiAtlasURL:void 0,multiPath:void 0,multiBaseURL:void 0};if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),r=o(u,"xhrSettings")}var c=!1;for(var p in i)if(n.supportsCompressedTexture(p)){var g=i[p];"string"==typeof g?a.textureURL=g:a=d(g,a),a.format=p.toUpperCase(),c=!0;break}if(c)if("IMG"===a.format){var m;m=a.multiAtlasURL?new f(t,e,a.multiAtlasURL,a.multiPath,a.multiBaseURL,r).files:a.atlasURL?new s(t,e,a.textureURL,a.atlasURL,r).files:new h(t,e,a.textureURL,r),t.addFile(m)}else{var y=new v(t,e,a,r);t.addFile(y.files)}else console.warn("No supported compressed texture format or IMG fallback",e)};if(Array.isArray(t))for(var a=0;a<t.length;a++)r(this,t[a]);else r(this,t,e,i);return this})),t.exports=v},87674:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(98356),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s,a,h){var u="ttf";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"format","truetype"),a=o(c,"descriptors",null),h=o(c,"xhrSettings"),u=o(c,"extension",u)}else void 0===s&&(s="truetype");var d={type:"font",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:h};r.call(this,t,d),this.data={format:s,descriptors:a},this.state=n.FILE_POPULATED},onProcess:function(){var t;this.state=n.FILE_PROCESSING,this.src=h(this,this.loader.baseURL);var e=this.key,i="url("+this.src+') format("'+this.data.format+'")';t=this.data.descriptors?new FontFace(e,i,this.data.descriptors):new FontFace(e,i);var s=this;t.load().then((function(){document.fonts.add(t),document.body.classList.add("fonts-loaded"),s.onProcessComplete()})).catch((function(){console.warn("Font failed to load",i),s.onProcessComplete()}))}});a.register("font",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i,s,n));return this})),t.exports=u},47931:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(73894),u=new s({Extends:r,initialize:function(t,e,i,s,n){var a="glsl";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"shaderType","fragment"),n=o(l,"xhrSettings"),a=o(l,"extension",a)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:a,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var a=this.cache.get(i);"fragment"===s?a.fragmentSrc=r:a.vertexSrc=r,a.uniforms||(a.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data))},getShaderName:function(t){for(var e=0;e<t.length;e++){var i=t[e].trim();if("name:"===i.substring(0,5))return i.substring(5).trim()}return this.key},getShaderType:function(t){for(var e=0;e<t.length;e++){var i=t[e].trim();if("type:"===i.substring(0,5))return i.substring(5).trim()}return this.config.shaderType},getShaderUniforms:function(t){for(var e={},i=0;i<t.length;i++){var s=t[i].trim();if("uniform."===s.substring(0,8)){var n=s.indexOf(":");if(n){var r=s.substring(8,n);try{e[r]=JSON.parse(s.substring(n+1))}catch(t){console.warn("Invalid uniform JSON: "+r)}}}}return e},extractBlock:function(t,e){for(var i=-1,s=-1,n=-1,r=!1,a=!1,o=[],h=[],l=e;l<t.length;l++){var u=t[l].trim();if("---"===u)if(-1===i)i=l,r=!0;else{if(!r){a=!1;break}s=l,r=!1,a=!0}else r?o.push(u):a&&(h.push(u),n=l)}return r||-1===s?null:{header:o,shader:h.join("\n"),offset:n}}});a.register("glsl",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i,s));return this})),t.exports=u},89749:(t,e,i)=>{var s=i(83419),n=i(54899),r=i(41299),a=i(95540),o=i(98356),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=a(n,"key"),s=a(n,"config",s)}var o={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,o),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 t=0;t<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0,this.percentComplete=0;for(var e=0;e<t;e++){var i=new Audio;i.dataset||(i.dataset={}),i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=o(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=l},88470:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},14643:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n,a){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),a=o(u,"xhrSettings"),l=o(u,"extension",l),s=o(u,"width",s),n=o(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:a,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var s=[i.join("\n")],a=this;try{var o=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=n.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(a.data),a.onProcessError()},r.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,s,n));return this})),t.exports=l},19550:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(98356),u=new s({Extends:r,initialize:function t(e,i,s,n,a){var l,u="png";if(h(i)){var c=i;i=o(c,"key"),s=o(c,"url"),l=o(c,"normalMap"),n=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:a};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new u(this,t[s]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},518:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(35154),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:a};r.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,s,i));return this})),t.exports=u},59327:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(19550),o=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,a,u){if(o(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),a=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,a);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,o=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var f=0;f<e.length;f++){var p=e[f].image,g="MA"+this.multiKeyIndex+"_"+p,m=new a(s,g,p,d);if(this.addToMultiFile(m),s.addFile(m),e[f].normalMap){var v=new a(s,g,e[f].normalMap,d);v.type="normalMap",m.setLink(v),this.addToMultiFile(v),s.addFile(v)}}s.setBaseURL(n),s.setPath(o),s.setPrefix(h)}},addToCache:function(){if(this.isReadyToProcess()){for(var t=this.files[0],e=[],i=[],s=[],n=1;n<this.files.length;n++){var r=this.files[n];if("normalMap"!==r.type)for(var a=r.key.indexOf("_"),o=r.key.substr(a+1),h=r.data,l=0;l<t.data.textures.length;l++){var u=t.data.textures[l];if(u.image===o){i.push(h),e.push(u),r.linkFile&&s.push(r.linkFile.data);break}}}0===s.length&&(s=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,s),this.complete=!0}}});n.register("multiatlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new u(this,t[a]),this.addFile(r.files);else r=new u(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=u},99297:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(41212),o=i(26430),h=i(34328),l=new s({Extends:o,initialize:function(t,e,i,s){var n="js",l=[];if(a(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c<i.length;c++){var d=new h(t,{key:e+"_"+c.toString(),url:i[c],extension:n,xhrSettings:s});d.onProcess=function(){this.onProcessComplete()},l.push(d)}o.call(this,t,"scripts",e,l)},addToCache:function(){if(this.isReadyToProcess()){for(var t=0;t<this.files.length;t++){var e=this.files[t];e.data=document.createElement("script"),e.data.language="javascript",e.data.type="text/javascript",e.data.defer=!1,e.data.text=e.xhrLoader.responseText,document.head.appendChild(e.data)}this.complete=!0}}});n.register("scripts",(function(t,e,i){var s;if(Array.isArray(t))for(var n=0;n<t.length;n++)s=new l(this,t[n]),this.addFile(s.files);else s=new l(this,t,e,i),this.addFile(s.files);return this})),t.exports=l},41846:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(41212),o=i(26430),h=i(85048),l=i(61485),u=i(78776),c=new s({Extends:o,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(a(e)){var f=e;e=r(f,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(f,"url"),extension:r(f,"extension","obj"),xhrSettings:r(f,"xhrSettings"),config:{flipUV:r(f,"flipUV",n)}}),(s=r(f,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(f,"matExtension","mat"),xhrSettings:r(f,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));o.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new c(this,t[a]),this.addFile(r.files);else r=new c(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=c},58610:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(74099),a=i(518),o=new s({Extends:a,initialize:function(t,e,i,s,n){a.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){if(this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var t={};t[this.config]=this.data,this.data=t}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,s,i));return this})),t.exports=o},48988:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,a,l){var u="js";if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),l=o(c,"xhrSettings"),u=o(c,"extension",u),s=o(c,"start"),a=o(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:a}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=o(e,"start",!1),s=o(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.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 r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});a.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,s,n));return this})),t.exports=l},67397:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n){var a="svg";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"svgConfig",{}),n=o(l,"xhrSettings"),a=o(l,"extension",a)}var u={type:"svg",cache:t.textureManager,extension:a,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:o(s,"width"),height:o(s,"height"),scale:o(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,a=this.config.scale;t:if(i&&s||a){var o=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=o.hasAttribute("viewBox"),l=parseFloat(o.getAttribute("width")),u=parseFloat(o.getAttribute("height"));if(!h&&l&&u)o.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=o.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(a){if(!l||!u)break t;i=l*a,s=u*a}o.setAttribute("width",i.toString()+"px"),o.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(o)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||r.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,r.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i,s));return this})),t.exports=l},88423:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});a.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},56812:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,a,l){var u="js";if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),l=o(c,"xhrSettings"),u=o(c,"extension",u),s=o(c,"systemKey"),a=o(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:a}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=o(e,"systemKey",i),r=o(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.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),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,s,n));return this})),t.exports=l},34328:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n){var a="js";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),s=o(l,"type","script"),n=o(l,"xhrSettings"),a=o(l,"extension",a)}else void 0===s&&(s="script");var u={type:s,cache:!1,extension:a,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.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),this.onProcessComplete()}});a.register("script",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i,s));return this})),t.exports=l},85035:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(74099),a=i(19550),o=new s({Extends:a,initialize:function(t,e,i,s,n){a.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});r.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i,s));return this})),t.exports=o},78776:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),a=o(u,"extension",a),n=o(u,"type",n),l=o(u,"cache",l)}var c={type:n,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},49477:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(80341),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});a.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new u(this,t[s]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},40807:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(518),a=i(80341),o=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,i));return this})),t.exports=o},56775:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(518),a=i(80341),o=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,i));return this})),t.exports=o},25771:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(95540),a=i(19550),o=i(41212),h=i(26430),l=i(78776),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(o(e)){var f=e;e=r(f,"key"),c=new a(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","txt"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new a(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new u(this,t[a]),this.addFile(r.files);else r=new u(this,t,e,i,s,n),this.addFile(r.files);return this})),t.exports=u},33720:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(98356),h=i(95540),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s){if(void 0===s&&(s=!1),l(e)){var n=e;e=h(n,"key"),i=h(n,"url",[]),s=h(n,"noAudio",!1)}var a=t.systems.game.device.video.getVideoURL(i);a||console.warn("VideoFile: No supported format for "+e);var o={type:"video",cache:t.cacheManager.video,extension:a.type,key:e,url:a.url,config:{noAudio:s}};r.call(this,t,o)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=o(this,this.loader.baseURL),this.state=n.FILE_LOADED,this.loader.nextFile(this,!0)}});a.register("video",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new u(this,t[s]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},57318:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(56836),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new u(this,t[s]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},64589:(t,e,i)=>{t.exports={AnimationJSONFile:i(14135),AsepriteFile:i(76272),AtlasJSONFile:i(38734),AtlasXMLFile:i(74599),AudioFile:i(21097),AudioSpriteFile:i(89524),BinaryFile:i(85722),BitmapFontFile:i(97025),CompressedTextureFile:i(69559),CSSFile:i(16024),FontFile:i(87674),GLSLFile:i(47931),HTML5AudioFile:i(89749),HTMLFile:i(88470),HTMLTextureFile:i(14643),ImageFile:i(19550),JSONFile:i(518),MultiAtlasFile:i(59327),MultiScriptFile:i(99297),OBJFile:i(41846),PackFile:i(58610),PluginFile:i(48988),SceneFile:i(88423),ScenePluginFile:i(56812),ScriptFile:i(34328),SpriteSheetFile:i(85035),SVGFile:i(67397),TextFile:i(78776),TilemapCSVFile:i(49477),TilemapImpactFile:i(40807),TilemapJSONFile:i(56775),UnityAtlasFile:i(25771),VideoFile:i(33720),XMLFile:i(57318)}},57777:(t,e,i)=>{var s=i(23906),n=i(79291),r={Events:i(54899),FileTypes:i(64589),File:i(41299),FileTypesManager:i(74099),GetURL:i(98356),LoaderPlugin:i(74261),MergeXHRSettings:i(3374),MultiFile:i(26430),XHRLoader:i(84376),XHRSettings:i(92638)};r=n(!1,r,s),t.exports=r},53307:t=>{t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},85710:(t,e,i)=>{var s=i(6411);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},30976:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},87842:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),a=.5*(n-i),o=t*t;return(2*i-2*s+r+a)*(t*o)+(-3*i+3*s-2*r-a)*o+r*t+i}},26302:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},45319:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},39506:(t,e,i)=>{var s=i(36383);t.exports=function(t){return t*s.DEG_TO_RAD}},61241:t=>{t.exports=function(t,e){return Math.abs(t-e)}},38857:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(37867),a=i(29747),o=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],a=n[4],o=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],f=n[10],p=0,g=0,m=0,v=.99999;switch(e){case"XYZ":g=Math.asin(s(o,-1,1)),Math.abs(o)<v?(p=Math.atan2(-u,f),m=Math.atan2(-a,r)):p=Math.atan2(d,l);break;case"YXZ":p=Math.asin(-s(u,-1,1)),Math.abs(u)<v?(g=Math.atan2(o,f),m=Math.atan2(h,l)):g=Math.atan2(-c,r);break;case"ZXY":p=Math.asin(s(d,-1,1)),Math.abs(d)<v?(g=Math.atan2(-c,f),m=Math.atan2(-a,l)):m=Math.atan2(h,r);break;case"ZYX":g=Math.asin(-s(c,-1,1)),Math.abs(c)<v?(p=Math.atan2(d,f),m=Math.atan2(h,r)):m=Math.atan2(-a,l);break;case"YZX":m=Math.asin(s(h,-1,1)),Math.abs(h)<v?(p=Math.atan2(-u,l),g=Math.atan2(-c,r)):g=Math.atan2(o,f);break;case"XZY":m=Math.asin(-s(a,-1,1)),Math.abs(a)<v?(p=Math.atan2(d,l),g=Math.atan2(o,r)):p=Math.atan2(-u,f)}return this._x=p,this._y=g,this._z=m,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},6411:t=>{t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},99472:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},77623:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},62945:(t,e,i)=>{var s=i(45319);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},38265:t=>{t.exports=function(t,e){return t/e/1e3}},78702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},94908:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=-l*n+a*o,d=h*n-r*o,f=e*u+i*c+s*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*r)*f,t[3]=c*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=r*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*r,t[3]=a*o-n*l,t[4]=e*l-s*o,t[5]=s*n-e*a,t[6]=n*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*r-a*h)+i*(-l*n+a*o)+s*(h*n-r*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],m=c[4],v=c[5],y=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*a+p*l,e[2]=d*n+f*o+p*u,e[3]=g*i+m*r+v*h,e[4]=g*s+m*a+v*l,e[5]=g*n+m*o+v*u,e[6]=y*i+x*r+w*h,e[7]=y*s+x*a+w*l,e[8]=y*n+x*o+w*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*a,e[2]=l*n+h*o,e[3]=l*r-h*i,e[4]=l*a-h*s,e[5]=l*o-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,u=e*o,c=i*a,d=i*o,f=s*o,p=n*r,g=n*a,m=n*o,v=this.val;return v[0]=1-(c+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=d+p,v[2]=u+g,v[5]=d-p,v[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=s*h-n*o,w=s*l-r*o,b=s*u-a*o,T=n*l-r*h,S=n*u-a*h,E=r*u-a*l,A=c*m-d*g,C=c*v-f*g,M=c*y-p*g,_=d*v-f*m,R=d*y-p*m,P=f*y-p*v,L=x*P-w*R+b*_+T*M-S*C+E*A;return L?(L=1/L,i[0]=(h*P-l*R+u*_)*L,i[1]=(l*M-o*P-u*C)*L,i[2]=(o*R-h*M+u*A)*L,i[3]=(r*R-n*P-a*_)*L,i[4]=(s*P-r*M+a*C)*L,i[5]=(n*M-s*R-a*A)*L,i[6]=(m*E-v*S+y*T)*L,i[7]=(v*b-g*E-y*w)*L,i[8]=(g*S-m*b+y*x)*L,this):null}});t.exports=s},37867:(t,e,i)=>{var s=i(83419),n=i(25836),r=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=s,m[4]=n,m[5]=r,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=c,m[12]=d,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,n=e.x,r=e.y,a=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[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 t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*r,y=e*o-s*r,x=e*h-n*r,w=i*o-s*a,b=i*h-n*a,T=s*h-n*o,S=l*p-u*f,E=l*g-c*f,A=l*m-d*f,C=u*g-c*p,M=u*m-d*p,_=c*m-d*g,R=v*_-y*M+x*C+w*A-b*E+T*S;return R?(R=1/R,this.setValues((a*_-o*M+h*C)*R,(s*M-i*_-n*C)*R,(p*T-g*b+m*w)*R,(c*b-u*T-d*w)*R,(o*A-r*_-h*E)*R,(e*_-s*A+n*E)*R,(g*x-f*T-m*y)*R,(l*T-c*x+d*y)*R,(r*M-a*A+h*S)*R,(i*A-e*M-n*S)*R,(f*b-p*x+m*v)*R,(u*x-l*b-d*v)*R,(a*E-r*C-o*S)*R,(e*C-i*E+s*S)*R,(p*y-f*w-g*v)*R,(l*w-u*y+c*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(c*m-d*g)-u*(o*m-h*g)+p*(o*d-h*c),-(i*(c*m-d*g)-u*(s*m-n*g)+p*(s*d-n*c)),i*(o*m-h*g)-a*(s*m-n*g)+p*(s*h-n*o),-(i*(o*d-h*c)-a*(s*d-n*c)+u*(s*h-n*o)),-(r*(c*m-d*g)-l*(o*m-h*g)+f*(o*d-h*c)),e*(c*m-d*g)-l*(s*m-n*g)+f*(s*d-n*c),-(e*(o*m-h*g)-r*(s*m-n*g)+f*(s*h-n*o)),e*(o*d-h*c)-r*(s*d-n*c)+l*(s*h-n*o),r*(u*m-d*p)-l*(a*m-h*p)+f*(a*d-h*u),-(e*(u*m-d*p)-l*(i*m-n*p)+f*(i*d-n*u)),e*(a*m-h*p)-r*(i*m-n*p)+f*(i*h-n*a),-(e*(a*d-h*u)-r*(i*d-n*u)+l*(i*h-n*a)),-(r*(u*g-c*p)-l*(a*g-o*p)+f*(a*c-o*u)),e*(u*g-c*p)-l*(i*g-s*p)+f*(i*c-s*u),-(e*(a*g-o*p)-r*(i*g-s*p)+f*(i*o-s*a)),e*(a*c-o*u)-r*(i*c-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*r)*(c*m-d*g)-(e*o-s*r)*(u*m-d*p)+(e*h-n*r)*(u*g-c*p)+(i*o-s*a)*(l*m-d*f)-(i*h-n*a)*(l*g-c*f)+(s*h-n*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],w=y[1],b=y[2],T=y[3];return e[0]=x*i+w*a+b*u+T*p,e[1]=x*s+w*o+b*c+T*g,e[2]=x*n+w*h+b*d+T*m,e[3]=x*r+w*l+b*f+T*v,x=y[4],w=y[5],b=y[6],T=y[7],e[4]=x*i+w*a+b*u+T*p,e[5]=x*s+w*o+b*c+T*g,e[6]=x*n+w*h+b*d+T*m,e[7]=x*r+w*l+b*f+T*v,x=y[8],w=y[9],b=y[10],T=y[11],e[8]=x*i+w*a+b*u+T*p,e[9]=x*s+w*o+b*c+T*g,e[10]=x*n+w*h+b*d+T*m,e[11]=x*r+w*l+b*f+T*v,x=y[12],w=y[13],b=y[14],T=y[15],e[12]=x*i+w*a+b*u+T*p,e[13]=x*s+w*o+b*c+T*g,e[14]=x*n+w*h+b*d+T*m,e[15]=x*r+w*l+b*f+T*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],w=s[0],b=s[4],T=s[8],S=s[12],E=s[1],A=s[5],C=s[9],M=s[13],_=s[2],R=s[6],P=s[10],L=s[14],F=s[3],O=s[7],D=s[11],k=s[15];return this.setValues(n*w+r*E+a*_+o*F,h*w+l*E+u*_+c*F,d*w+f*E+p*_+g*F,m*w+v*E+y*_+x*F,n*b+r*A+a*R+o*O,h*b+l*A+u*R+c*O,d*b+f*A+p*R+g*O,m*b+v*A+y*R+x*O,n*T+r*C+a*P+o*D,h*T+l*C+u*P+c*D,d*T+f*C+p*P+g*D,m*T+v*C+y*P+x*D,n*S+r*M+a*L+o*k,h*S+l*M+u*L+c*k,d*S+f*M+p*L+g*k,m*S+v*M+y*L+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,a=t.y,o=t.z,h=n*r,l=n*a;return this.setValues(h*r+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*r,0,h*o-s*a,l*o+s*r,n*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,a=e.z,o=Math.sqrt(s*s+n*n+a*a);if(Math.abs(o)<r)return this;s*=o=1/o,n*=o,a*=o;var h=Math.sin(t),l=Math.cos(t),u=1-l,c=i[0],d=i[1],f=i[2],p=i[3],g=i[4],m=i[5],v=i[6],y=i[7],x=i[8],w=i[9],b=i[10],T=i[11],S=i[12],E=i[13],A=i[14],C=i[15],M=s*s*u+l,_=n*s*u+a*h,R=a*s*u-n*h,P=s*n*u-a*h,L=n*n*u+l,F=a*n*u+s*h,O=s*a*u+n*h,D=n*a*u-s*h,k=a*a*u+l;return this.setValues(c*M+g*_+x*R,d*M+m*_+w*R,f*M+v*_+b*R,p*M+y*_+T*R,c*P+g*L+x*F,d*P+m*L+w*F,f*P+v*L+b*F,p*P+y*L+T*F,c*O+g*D+x*k,d*O+m*D+w*k,f*O+v*D+b*k,p*O+y*D+T*k,S,E,A,C)},rotateX:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[4],r=e[5],a=e[6],o=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=n*s+h*i,e[5]=r*s+l*i,e[6]=a*s+u*i,e[7]=o*s+c*i,e[8]=h*s-n*i,e[9]=l*s-r*i,e[10]=u*s-a*i,e[11]=c*s-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=n*s-h*i,e[1]=r*s-l*i,e[2]=a*s-u*i,e[3]=o*s-c*i,e[8]=n*i+h*s,e[9]=r*i+l*s,e[10]=a*i+u*s,e[11]=o*i+c*s,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=n*s+h*i,e[1]=r*s+l*i,e[2]=a*s+u*i,e[3]=o*s+c*i,e[4]=h*s-n*i,e[5]=l*s-r*i,e[6]=u*s-a*i,e[7]=c*s-o*i,this},fromRotationTranslation:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=i+i,o=s+s,h=n+n,l=i*a,u=i*o,c=i*h,d=s*o,f=s*h,p=n*h,g=r*a,m=r*o,v=r*h;return this.setValues(1-(d+p),u+v,c-m,0,u-v,1-(l+p),f+g,0,c+m,f-g,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,u=e*o,c=i*a,d=i*o,f=s*o,p=n*r,g=n*a,m=n*o;return this.setValues(1-(c+f),l+m,u-g,0,l-m,1-(h+f),d+p,0,u+g,d-p,1-(h+c),0,0,0,0,1)},frustum:function(t,e,i,s,n,r){var a=1/(e-t),o=1/(s-i),h=1/(n-r);return this.setValues(2*n*a,0,0,0,0,2*n*o,0,0,(e+t)*a,(s+i)*o,(r+n)*h,-1,0,0,r*n*2*h,0)},perspective:function(t,e,i,s){var n=1/Math.tan(t/2),r=1/(i-s);return this.setValues(n/e,0,0,0,0,n,0,0,0,0,(s+i)*r,-1,0,0,2*s*i*r,0)},perspectiveLH:function(t,e,i,s){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-s/(i-s),1,0,0,i*s/(i-s),0)},ortho:function(t,e,i,s,n,r){var a=t-e,o=i-s,h=n-r;return a=0===a?a:1/a,o=0===o?o:1/o,h=0===h?h:1/h,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(s+i)*o,(r+n)*h,1)},lookAtRH:function(t,e,i){var s=this.val;return c.subVectors(t,e),0===c.lengthSq()&&(c.z=1),c.normalize(),l.crossVectors(i,c),0===l.lengthSq()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),l.crossVectors(i,c)),l.normalize(),u.crossVectors(c,l),s[0]=l.x,s[1]=l.y,s[2]=l.z,s[4]=u.x,s[5]=u.y,s[6]=u.z,s[8]=c.x,s[9]=c.y,s[10]=c.z,this},lookAt:function(t,e,i){var s=t.x,n=t.y,a=t.z,o=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<r&&Math.abs(n-c)<r&&Math.abs(a-d)<r)return this.identity();var f=s-u,p=n-c,g=a-d,m=1/Math.sqrt(f*f+p*p+g*g),v=h*(g*=m)-l*(p*=m),y=l*(f*=m)-o*g,x=o*p-h*f;(m=Math.sqrt(v*v+y*y+x*x))?(v*=m=1/m,y*=m,x*=m):(v=0,y=0,x=0);var w=p*x-g*y,b=g*v-f*x,T=f*y-p*v;return(m=Math.sqrt(w*w+b*b+T*T))?(w*=m=1/m,b*=m,T*=m):(w=0,b=0,T=0),this.setValues(v,w,f,0,y,b,p,0,x,T,g,0,-(v*s+y*n+x*a),-(w*s+b*n+T*a),-(f*s+p*n+g*a),1)},yawPitchRoll:function(t,e,i){this.zero(),o.zero(),h.zero();var s=this.val,n=o.val,r=h.val,a=Math.sin(i),l=Math.cos(i);return s[10]=1,s[15]=1,s[0]=l,s[1]=a,s[4]=-a,s[5]=l,a=Math.sin(e),l=Math.cos(e),n[0]=1,n[15]=1,n[5]=l,n[10]=l,n[9]=-a,n[6]=a,a=Math.sin(t),l=Math.cos(t),r[5]=1,r[15]=1,r[0]=l,r[2]=-a,r[8]=a,r[10]=l,this.multiplyLocal(o),this.multiplyLocal(h),this},setWorldMatrix:function(t,e,i,s,n){return this.yawPitchRoll(t.y,t.x,t.z),o.scaling(i.x,i.y,i.z),h.xyz(e.x,e.y,e.z),this.multiplyLocal(o),this.multiplyLocal(h),s&&this.multiplyLocal(s),n&&this.multiplyLocal(n),this},multiplyToMat4:function(t,e){var i=this.val,s=t.val,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=i[6],c=i[7],d=i[8],f=i[9],p=i[10],g=i[11],m=i[12],v=i[13],y=i[14],x=i[15],w=s[0],b=s[1],T=s[2],S=s[3],E=s[4],A=s[5],C=s[6],M=s[7],_=s[8],R=s[9],P=s[10],L=s[11],F=s[12],O=s[13],D=s[14],k=s[15];return e.setValues(w*n+b*h+T*d+S*m,b*r+b*l+T*f+S*v,T*a+b*u+T*p+S*y,S*o+b*c+T*g+S*x,E*n+A*h+C*d+M*m,E*r+A*l+C*f+M*v,E*a+A*u+C*p+M*y,E*o+A*c+C*g+M*x,_*n+R*h+P*d+L*m,_*r+R*l+P*f+L*v,_*a+R*u+P*p+L*y,_*o+R*c+P*g+L*x,F*n+O*h+D*d+k*m,F*r+O*l+D*f+k*v,F*a+O*u+D*p+k*y,F*o+O*c+D*g+k*x)},fromRotationXYTranslation:function(t,e,i){var s=e.x,n=e.y,r=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),u=s,c=n,d=r,f=-a,p=0-f*h,g=0-o*h,m=f*l,v=o*l;return i||(u=l*s+h*r,c=p*s+o*n+m*r,d=g*s+a*n+v*r),this.setValues(l,p,g,0,0,o,a,0,h,m,v,0,u,c,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}}),o=new a,h=new a,l=new n,u=new n,c=new n;t.exports=a},86883:t=>{t.exports=function(t,e,i){return Math.min(t+e,i)}},50040:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},37204:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},65201:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},15746:(t,e,i)=>{var s=i(83419),n=i(94434),r=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),c=new a(0,1,0),d=new a,f=new n,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length()<o&&d.copy(c).cross(t),d.normalize(),this.setAxisAngle(d,Math.PI)):i>.999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+n*r+i*o-s*a,i*h+n*a+s*r-e*o,s*h+n*o+e*a-i*r,n*h-e*r-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,a=t.x,h=t.y,l=t.z,u=t.w,c=i*a+s*h+n*l+r*u;c<0&&(c=-c,a=-a,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>o){var p=Math.acos(c),g=Math.sin(p);d=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(d*i+f*a,d*s+f*h,d*n+f*l,d*r+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+n*r,i*a+s*r,s*a-i*r,n*a-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*r,i*a+n*r,s*a+e*r,n*a-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*r,i*a-e*r,s*a+n*r,n*a-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),a=Math.cos(s),o=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*a*o+r*l*u,r*l*o-h*a*u,r*a*u+h*l*o,r*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+r*l*u,r*l*o-h*a*u,r*a*u-h*l*o,r*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-r*l*u,r*l*o+h*a*u,r*a*u+h*l*o,r*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-r*l*u,r*l*o+h*a*u,r*a*u-h*l*o,r*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+r*l*u,r*l*o+h*a*u,r*a*u-h*l*o,r*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-r*l*u,r*l*o-h*a*u,r*a*u+h*l*o,r*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+o+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(a-n)*e,.25/e)):s>o&&s>c?(e=2*Math.sqrt(1+s-o-c),this.set(.25*e,(n+a)/e,(r+l)/e,(u-h)/e)):o>c?(e=2*Math.sqrt(1+o-s-c),this.set((n+a)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-o),this.set((r+l)/e,(h+u)/e,.25*e,(a-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],a=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*a+a]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[a]=(i[3*a+n]+i[3*n+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+r]-i[3*r+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396:(t,e,i)=>{var s=i(36383);t.exports=function(t){return t*s.RAD_TO_DEG}},74362:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},67421:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},11520:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*n-o*r+e,t.y=a*r+o*n+i,t}},1163:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},70336:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},72678:(t,e,i)=>{var s=i(25836),n=i(37867),r=i(15746),a=new n,o=new r,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},16922:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],a=0;a<t;a++)e+=(i-=e*s)*s,n[a]=i,r[a]=e;return{sin:r,cos:n,length:t}}},7602:t=>{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,a=0;return t>0&&t<=e*i&&(r=t>e-1?t-(a=Math.floor(t/e))*e:t),n.set(r,a)}},85955:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,a,o,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*a,d=l*a,f=-l*o,p=u*o,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(n*f-i*p)*g,h.y=c*g*e+-d*g*t+(-n*c+i*d)*g,h}},26099:(t,e,i)=>{var s=i(83419),n=i(43855),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},25836:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,a=e.y,o=e.z;return this.x=s*o-n*a,this.y=n*r-i*o,this.z=i*a-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z;return this.x=i*a-s*r,this.y=s*n-e*a,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],a=e*n[1]+i*n[5]+s*n[9]+n[13],o=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,u=o*s+n*i-r*e,c=-n*e-r*i-a*s;return this.x=h*o+c*-n+l*-a-u*-r,this.y=l*o+c*-r+u*-n-h*-a,this.z=u*o+c*-a+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=n[8],p=n[9],g=n[10],m=n[11],v=n[12],y=n[13],x=n[14],w=1/(e*h+i*d+s*m+n[15]);return this.x=(e*r+i*l+s*f+v)*w,this.y=(e*a+i*u+s*p+y)*w,this.z=(e*o+i*c+s*g+x)*w,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=this.x-i,o=r-this.y-1-s,h=this.z;return this.x=2*a/n-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},61369:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,u=o*s+n*i-r*e,c=-n*e-r*i-a*s;return this.x=h*o+c*-n+l*-a-u*-r,this.y=l*o+c*-r+u*-n-h*-a,this.z=u*o+c*-a+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},60417:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},31040:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},55495:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},1432:(t,e,i)=>{var s=i(36383);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},49127:(t,e,i)=>{var s=i(12407);t.exports=function(t,e){return s(e-t)}},52285:(t,e,i)=>{var s=i(12407),n=2*Math.PI;t.exports=function(t,e){var i=s(e-t);return i>0&&(i-=n),i}},67317:(t,e,i)=>{var s=i(86554);t.exports=function(t,e){return s(e-t)}},12407:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993:(t,e,i)=>{var s=i(99472);t.exports=function(){return s(-Math.PI,Math.PI)}},86564:(t,e,i)=>{var s=i(99472);t.exports=function(){return s(-180,180)}},90154:(t,e,i)=>{var s=i(12407);t.exports=function(t){return s(t+Math.PI)}},48736:(t,e,i)=>{var s=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=s.PI2:e-=s.PI2),e>t?t+=i:e<t&&(t-=i))),t}},61430:t=>{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},86554:(t,e,i)=>{var s=i(15994);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},30954:(t,e,i)=>{var s=i(15994);t.exports=function(t){return s(t,-180,180)}},25588:(t,e,i)=>{t.exports={Between:i(31040),BetweenPoints:i(55495),BetweenPointsY:i(128),BetweenY:i(41273),CounterClockwise:i(1432),GetClockwiseDistance:i(49127),GetCounterClockwiseDistance:i(52285),GetShortestDistance:i(67317),Normalize:i(12407),Random:i(53993),RandomDegrees:i(86564),Reverse:i(90154),RotateTo:i(48736),ShortestBetween:i(61430),Wrap:i(86554),WrapDegrees:i(30954)}},36383:t=>{var e={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};t.exports=e},20339:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},52816:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},64559:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},82340:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},14390:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},2243:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},89774:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},50994:(t,e,i)=>{t.exports={Between:i(20339),BetweenPoints:i(52816),BetweenPointsSquared:i(64559),Chebyshev:i(82340),Power:i(14390),Snake:i(2243),Squared:i(89774)}},62640:(t,e,i)=>{var s=i(54178),n=i(41521),r=i(79980),a=i(85433),o=i(99140),h=i(48857),l=i(81596),u=i(59133),c=i(98516),d=i(35248),f=i(82500),p=i(49752);t.exports={Power0:l,Power1:u.Out,Power2:a.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:a.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:o.Out,Back:s.Out,Bounce:n.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":a.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":o.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":o.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},1639:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},50099:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},41286:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},54178:(t,e,i)=>{t.exports={In:i(1639),Out:i(41286),InOut:i(50099)}},59590:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},41788:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},69905:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},41521:(t,e,i)=>{t.exports={In:i(59590),Out:i(69905),InOut:i(41788)}},91861:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},4177:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},57512:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},79980:(t,e,i)=>{t.exports={In:i(91861),Out:i(57512),InOut:i(4177)}},51150:t=>{t.exports=function(t){return t*t*t}},82820:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},35033:t=>{t.exports=function(t){return--t*t*t+1}},85433:(t,e,i)=>{t.exports={In:i(51150),Out:i(35033),InOut:i(82820)}},69965:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50665:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},7744:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},99140:(t,e,i)=>{t.exports={In:i(69965),Out:i(7744),InOut:i(50665)}},24590:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},87844:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},89433:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},48857:(t,e,i)=>{t.exports={In:i(24590),Out:i(89433),InOut:i(87844)}},48820:(t,e,i)=>{t.exports={Back:i(54178),Bounce:i(41521),Circular:i(79980),Cubic:i(85433),Elastic:i(99140),Expo:i(48857),Linear:i(81596),Quadratic:i(59133),Quartic:i(98516),Quintic:i(35248),Sine:i(82500),Stepped:i(49752)}},7147:t=>{t.exports=function(t){return t}},81596:(t,e,i)=>{t.exports=i(7147)},34826:t=>{t.exports=function(t){return t*t}},20544:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},92029:t=>{t.exports=function(t){return t*(2-t)}},59133:(t,e,i)=>{t.exports={In:i(34826),Out:i(92029),InOut:i(20544)}},64413:t=>{t.exports=function(t){return t*t*t*t}},78137:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},45840:t=>{t.exports=function(t){return 1- --t*t*t*t}},98516:(t,e,i)=>{t.exports={In:i(64413),Out:i(45840),InOut:i(78137)}},87745:t=>{t.exports=function(t){return t*t*t*t*t}},16509:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},17868:t=>{t.exports=function(t){return--t*t*t*t*t+1}},35248:(t,e,i)=>{t.exports={In:i(87745),Out:i(17868),InOut:i(16509)}},80461:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},34025:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},52768:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},82500:(t,e,i)=>{t.exports={In:i(80461),Out:i(52768),InOut:i(34025)}},72251:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},49752:(t,e,i)=>{t.exports=i(72251)},75698:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},25777:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},5470:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},94977:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},48379:(t,e,i)=>{t.exports={Ceil:i(75698),Equal:i(43855),Floor:i(25777),GreaterThan:i(5470),LessThan:i(94977)}},75508:(t,e,i)=>{var s=i(36383),n=i(79291),r={Angle:i(25588),Distance:i(50994),Easing:i(48820),Fuzzy:i(48379),Interpolation:i(38289),Pow2:i(49001),Snap:i(73697),RandomDataGenerator:i(28453),Average:i(53307),Bernstein:i(85710),Between:i(30976),CatmullRom:i(87842),CeilTo:i(26302),Clamp:i(45319),DegToRad:i(39506),Difference:i(61241),Euler:i(38857),Factorial:i(6411),FloatBetween:i(99472),FloorTo:i(77623),FromPercent:i(62945),GetSpeed:i(38265),IsEven:i(78702),IsEvenStrict:i(94883),Linear:i(28915),LinearXY:i(94908),MaxAdd:i(86883),Median:i(50040),MinSub:i(37204),Percent:i(65201),RadToDeg:i(43396),RandomXY:i(74362),RandomXYZ:i(60706),RandomXYZW:i(67421),Rotate:i(36305),RotateAround:i(11520),RotateAroundDistance:i(1163),RotateTo:i(70336),RoundAwayFromZero:i(2284),RoundTo:i(41013),SinCosTableGenerator:i(16922),SmootherStep:i(54261),SmoothStep:i(7602),ToXY:i(44408),TransformXY:i(85955),Within:i(60417),Wrap:i(15994),Vector2:i(26099),Vector3:i(25836),Vector4:i(61369),Matrix3:i(94434),Matrix4:i(37867),Quaternion:i(15746),RotateVec3:i(72678)};r=n(!1,r,s),t.exports=r},89318:(t,e,i)=>{var s=i(85710);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},77259:(t,e,i)=>{var s=i(87842);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2])}},36316:t=>{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},28392:(t,e,i)=>{var s=i(28915);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},32112:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},47235:(t,e,i)=>{var s=i(7602);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},50178:(t,e,i)=>{var s=i(54261);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},38289:(t,e,i)=>{t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},50030:t=>{t.exports=function(t,e){return t>0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230:t=>{t.exports=function(t){return t>0&&!(t&t-1)}},49001:(t,e,i)=>{t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},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(t){var e,i=this.n;t=t.toString();for(var s=0;s<t.length;s++)e=.02519603282416938*(i+=t.charCodeAt(s)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),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(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-.5)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},63448:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},56583:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},77720:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},73697:(t,e,i)=>{t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},85454:(t,e,i)=>{i(63595);var s=i(8054),n=i(79291),r={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Create:i(15822),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),FX:i(66064),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:i(44563),Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),Tweens:i(43066),Utils:i(91799)};r.Sound=i(23717),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},71289:(t,e,i)=>{var s=i(83419),n=i(92209),r=i(88571),a=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Collision,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=a},86689:(t,e,i)=>{var s=i(83419),n=i(39506),r=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),c=i(47956),d=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),a},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,o=e.length,h=0;h<o;h++){var l=e[h],u=l.body||l;if(t!==l&&t!==u&&t!==u.gameObject&&t!==u.center){var c=a(n,r,u.center.x,u.center.y);c<i&&(s=l,i=c)}}return s},furthest:function(t,e){e||(e=this.world.bodies.entries);for(var i=-1,s=null,n=t.x,r=t.y,o=e.length,h=0;h<o;h++){var l=e[h],u=l.body||l;if(t!==l&&t!==u&&t!==u.gameObject&&t!==u.center){var c=a(n,r,u.center.x,u.center.y);c>i&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var a=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759:(t,e,i)=>{var s=i(83419),n=i(92209),r=i(68287),a=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Collision,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=a},37742:(t,e,i)=>{var s=i(83419),n=i(78389),r=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),c=i(26099),d=new s({Mixins:[n],initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new c,this.position=new c(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new c(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new c,this.newVelocity=new c,this.deltaMax=new c,this.acceleration=new c,this.allowDrag=!0,this.drag=new c,this.allowGravity=!0,this.gravity=new c,this.bounce=new c,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new c(1e4,1e4),this.maxSpeed=-1,this.friction=new c(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=r.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new c(1,1),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=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=r.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,s=!0)}s&&(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 t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var n=this.autoFrame;s.set((i.x-n.x)/t,(i.y-n.y)/t),this.world.updateMotion(this,t),this._dx=i.x-n.x,this._dy=i.y-n.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var r=s.x,o=s.y;if(this.updateCenter(),this.angle=Math.atan2(o,r),this.speed=Math.sqrt(r*r+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var n=this.deltaMax.x,a=this.deltaMax.y;0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=r.FACING_LEFT:e>0&&(this.facing=r.FACING_RIGHT),i<0?this.facing=r.FACING_UP:i>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,n=this.world.checkCollision,r=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.x<s.x&&n.left?(t.x=s.x,e.x*=r,i.left=!0,o=!0):this.right>s.right&&n.right&&(t.x=s.right-this.width,e.x*=r,i.right=!0,o=!0),t.y<s.y&&n.up?(t.y=s.y,e.y*=a,i.up=!0,o=!0):this.bottom>s.bottom&&n.down&&(t.y=s.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,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(),i&&s&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,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(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),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(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},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>0?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(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new c),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var n=this.blocked;i&&(n.left=!0,n.none=!1),s&&(n.right=!0,n.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var n=this.blocked;i&&(n.up=!0,n.none=!1),s&&(n.down=!0,n.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},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}}});t.exports=d},79342:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n,r,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=a},setName:function(t){return this.name=t,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}});t.exports=s},66022:(t,e,i)=>{var s=i(71289),n=i(13759),r=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),c=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,o.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var n=new r(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,o.DYNAMIC_BODY),n},staticBody:function(t,e,i,s){var n=new l(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,o.STATIC_BODY),n},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=c},79599:t=>{t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return e}},64897:(t,e,i)=>{var s=i(37747);t.exports=function(t,e,i,n){var r=0,a=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dx<e._dx&&(-(r=t.x-e.width-e.x)>a&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},45170:(t,e,i)=>{var s=i(37747);t.exports=function(t,e,i,n){var r=0,a=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dy<e._dy&&(-(r=t.y-e.bottom)>a&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},60758:(t,e,i)=>{var s=i(13759),n=i(83419),r=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n){if(i||n)if(l(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var r=this;i.forEach((function(t){t.internalCreateCallback=r.createCallbackHandler,t.internalRemoveCallback=r.removeCallbackHandler,t.classType=o(t,"classType",s)})),n=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n&&(n.classType=o(n,"classType",s)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setBoundsRectangle:o(n,"customBoundsRectangle",null),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setDamping:o(n,"useDamping",!1),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setEnable:o(n,"enable",!0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setMaxSpeed:o(n,"maxSpeed",-1),setMaxVelocityX:o(n,"maxVelocityX",1e4),setMaxVelocityY:o(n,"maxVelocityY",1e4),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},h.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,a.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n<s.length;n++)s[n].body.velocity.set(t+n*i,e+n*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),s=0;s<i.length;s++)i[s].body.velocity.x=t+s*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),s=0;s<i.length;s++)i[s].body.velocity.y=t+s*e;return this}});t.exports=u},3017:t=>{var e,i,s,n,r,a,o,h,l,u,c,d,f,p,g,m,v,y=function(){return u&&g&&i.blocked.right?(e.processX(-v,o,!1,!0),1):l&&m&&i.blocked.left?(e.processX(v,o,!0),1):f&&m&&e.blocked.right?(i.processX(-v,h,!1,!0),2):d&&g&&e.blocked.left?(i.processX(v,h,!0),2):0},x=function(t){if(s&&n)v*=.5,0===t||3===t?(e.processX(v,r),i.processX(-v,a)):(e.processX(-v,r),i.processX(v,a));else if(s&&!n)0===t||3===t?e.processX(v,o,!0):e.processX(-v,o,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-v,h,!1,!0):i.processX(v,h,!0);else{var g=.5*v;0===t?p?(e.processX(v,0,!0),i.processX(0,null,!1,!0)):f?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.x,!0),i.processX(-g,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(v,0,!0)):u?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,null,!1,!0),i.processX(g,e.velocity.x,!0)):2===t?p?(e.processX(-v,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,i.velocity.x,!1,!0),i.processX(g,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-v,0,!1,!0)):l?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.y,!0),i.processX(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+o);return o-=h,r=h+(n-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):d&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,r,a){i=r;var x=(e=t).velocity.x,w=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=w-x*e.bounce.x,n=i.pushable,d=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-w*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var s=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=s*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var s=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=s*i.friction.y,e._dy=e.y-e.prev.y}}}},47962:t=>{var e,i,s,n,r,a,o,h,l,u,c,d,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):d&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(s&&n)v*=.5,0===t||3===t?(e.processY(v,r),i.processY(-v,a)):(e.processY(-v,r),i.processY(v,a));else if(s&&!n)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+o);return o-=h,r=h+(n-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):d&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,r,a){i=r;var x=(e=t).velocity.y,w=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=w-x*e.bounce.y,n=i.pushable,d=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-w*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var s=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=s*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var s=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=s*i.friction.x,e._dx=e.x-e.prev.x}}}},14087:(t,e,i)=>{var s=i(64897),n=i(3017);t.exports=function(t,e,i,r,a){void 0===a&&(a=s(t,e,i,r));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=n.Set(t,e,a);return o||h?(o?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},89936:(t,e,i)=>{var s=i(45170),n=i(47962);t.exports=function(t,e,i,r,a){void 0===a&&(a=s(t,e,i,r));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=n.Set(t,e,a);return o||h?(o?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},95829:t=>{t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624:(t,e,i)=>{var s=i(87902),n=i(83419),r=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new n({Mixins:[r],initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.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=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var s=this.world;return this.gameObject&&this.gameObject.body&&(s.disable(this.gameObject),this.gameObject.body=null),t.body&&s.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.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(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-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(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),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(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},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(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,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}}});t.exports=u},71464:(t,e,i)=>{var s=i(13759),n=i(83419),r=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n){i||n?l(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=o(n,"classType",s)):Array.isArray(i)&&l(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,a.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e<t.length;e++)t[e].body.reset();return this}});t.exports=u},82248:(t,e,i)=>{var s=i(55495),n=i(37742),r=i(45319),a=i(83419),o=i(79342),h=i(37747),l=i(20339),u=i(52816),c=i(50792),d=i(63012),f=i(43855),p=i(5470),g=i(94977),m=i(64897),v=i(45170),y=i(96523),x=i(35154),w=i(36383),b=i(25774),T=i(96602),S=i(87841),E=i(59542),A=i(40012),C=i(14087),M=i(89936),_=i(35072),R=i(72624),P=i(2483),L=i(61340),F=i(26099),O=i(15994),D=new a({Extends:c,initialize:function(t,e){c.call(this),this.scene=t,this.bodies=new _,this.staticBodies=new _,this.pendingDestroy=new _,this.colliders=new b,this.gravity=new F(x(e,"gravity.x",0),x(e,"gravity.y",0)),this.bounds=new S(x(e,"x",0),x(e,"y",0),x(e,"width",t.sys.scale.width),x(e,"height",t.sys.scale.height)),this.checkCollision={up:x(e,"checkCollision.up",!0),down:x(e,"checkCollision.down",!0),left:x(e,"checkCollision.left",!0),right:x(e,"checkCollision.right",!0)},this.fps=x(e,"fps",60),this.fixedStep=x(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(e,"timeScale",1),this.OVERLAP_BIAS=x(e,"overlapBias",4),this.TILE_BIAS=x(e,"tileBias",16),this.forceX=x(e,"forceX",!1),this.isPaused=x(e,"isPaused",!1),this._total=0,this.drawDebug=x(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(e,"debugShowBody",!0),debugShowStaticBody:x(e,"debugShowStaticBody",!0),debugShowVelocity:x(e,"debugShowVelocity",!0),bodyDebugColor:x(e,"debugBodyColor",16711935),staticBodyDebugColor:x(e,"debugStaticBodyColor",255),velocityDebugColor:x(e,"debugVelocityColor",65280)},this.maxEntries=x(e,"maxEntries",16),this.useTree=x(e,"useTree",!0),this.tree=new E(this.maxEntries),this.staticTree=new E(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new L,this._tempMatrix2=new L,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i];if(s.isParent)for(var n=s.getChildren(),r=0;r<n.length;r++){var a=n[r];a.isParent?this.enable(a,e):this.enableBody(a,e)}else this.enableBody(s,e)}},enableBody:function(t,e){return void 0===e&&(e=h.DYNAMIC_BODY),t.hasTransformComponent&&(t.body||(e===h.DYNAMIC_BODY?t.body=new n(this,t):e===h.STATIC_BODY&&(t.body=new R(this,t))),this.add(t.body)),t},add:function(t){return t.physicsType===h.DYNAMIC_BODY?this.bodies.set(t):t.physicsType===h.STATIC_BODY&&(this.staticBodies.set(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var s=i.getChildren(),n=0;n<s.length;n++){var r=s[n];r.isParent?this.disable(r):this.disableBody(r.body)}else this.disableBody(i.body)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===h.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===h.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},setBounds:function(t,e,i,s,n,r,a,o){return this.bounds.setTo(t,e,i,s),void 0!==n&&this.setBoundsCollision(n,r,a,o),this},setBoundsCollision:function(t,e,i,s){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===s&&(s=!0),this.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=s,this},pause:function(){return this.isPaused=!0,this.emit(d.PAUSE),this},resume:function(){return this.isPaused=!1,this.emit(d.RESUME),this},addCollider:function(t,e,i,s,n){void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i);var r=new o(this,!1,t,e,i,s,n);return this.colliders.add(r),r},addOverlap:function(t,e,i,s,n){void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i);var r=new o(this,!0,t,e,i,s,n);return this.colliders.add(r),r},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i,s,n=this._frameTime,r=this._frameTimeMS*this.timeScale;this._elapsed+=e;var a=this.bodies.entries,o=this._elapsed>=r;for(this.fixedStep||(n=.001*e,o=!0,this._elapsed=0),i=0;i<a.length;i++)(s=a[i]).enable&&s.preUpdate(o,n);if(o){this._elapsed-=r,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(a));var h=this.colliders.update();for(i=0;i<h.length;i++){var l=h[i];l.active&&l.update()}this.emit(d.WORLD_STEP,n)}for(;this._elapsed>=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e<n;e++)(i=s[e]).enable&&i.update(t);this.useTree&&(this.tree.clear(),this.tree.load(s));var r=this.colliders.update();for(e=0;e<r.length;e++){var a=r[e];a.active&&a.update()}this.emit(d.WORLD_STEP,t),this.stepsLastFrame++},singleStep:function(){this.update(0,this._frameTimeMS),this.postUpdate()},postUpdate:function(){var t,e,i=this.bodies.entries,s=i.length,n=this.bodies,r=this.staticBodies;if(this.stepsLastFrame)for(this.stepsLastFrame=0,t=0;t<s;t++)(e=i[t]).enable&&e.postUpdate();if(this.drawDebug){var a=this.debugGraphic;for(a.clear(),t=0;t<s;t++)(e=i[t]).willDrawDebug()&&e.drawDebug(a);for(s=(i=r.entries).length,t=0;t<s;t++)(e=i[t]).willDrawDebug()&&e.drawDebug(a)}var o=this.pendingDestroy;if(o.size>0){var l=this.tree,u=this.staticTree;for(s=(i=o.entries).length,t=0;t<s;t++)(e=i[t]).physicsType===h.DYNAMIC_BODY?(l.remove(e),n.delete(e)):e.physicsType===h.STATIC_BODY&&(u.remove(e),r.delete(e)),e.world=void 0,e.gameObject=void 0;o.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,s=t.angularAcceleration,n=t.angularDrag,a=t.maxAngular;s?i+=s*e:t.allowDrag&&n&&(p(i-(n*=e),0,.1)?i-=n:g(i+n,0,.1)?i+=n:i=0);var o=(i=r(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,s=t.acceleration.x,n=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,c=t.speed,d=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),s?i+=s*e:m&&n&&(v?(i*=n=Math.pow(n,e),c=Math.sqrt(i*i+o*o),f(c,0,.001)&&(i=0)):p(i-(n*=e),0,.01)?i-=n:g(i+n,0,.01)?i+=n:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),c=Math.sqrt(i*i+o*o),f(c,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=r(i,-a,a),o=r(o,-u,u),t.velocity.set(i,o),d>-1&&t.velocity.length()>d&&(t.velocity.normalize().scale(d),c=d),t.speed=c},separate:function(t,e,i,s,n){var r,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(s,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,n);l.result?(o=!0,h=!1):(r=l.x,a=l.y,h=!0)}if(h){var u=!1,c=!1,f=this.OVERLAP_BIAS;n?(u=C(t,e,n,f,r),c=M(t,e,n,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(u=C(t,e,n,f,r),this.intersects(t,e)&&(c=M(t,e,n,f,a))):(c=M(t,e,n,f,a),this.intersects(t,e)&&(u=C(t,e,n,f,r))),o=u||c}return o&&(n?(t.onOverlap||e.onOverlap)&&this.emit(d.OVERLAP,t.gameObject,e.gameObject,t,e):(t.onCollide||e.onCollide)&&this.emit(d.COLLIDE,t.gameObject,e.gameObject,t,e)),o},separateCircle:function(t,e,i){m(t,e,!1,0),v(t,e,!1,0);var n=t.isCircle,r=e.isCircle,a=t.center,o=e.center,h=t.immovable,c=e.immovable,d=t.velocity,f=e.velocity,p=0,g=!0;if(n!==r){g=!1;var y=a.x,x=a.y,b=t.halfWidth,T=e.position.x,S=e.position.y,E=e.right,A=e.bottom;r&&(y=o.x,x=o.y,b=e.halfWidth,T=t.position.x,S=t.position.y,E=t.right,A=t.bottom),x<S?y<T?p=l(y,x,T,S)-b:y>E&&(p=l(y,x,E,S)-b):x>A&&(y<T?p=l(y,x,T,A)-b:y>E&&(p=l(y,x,E,A)-b)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var C=s(a,o),M=(p+w.EPSILON)*Math.cos(C),_=(p+w.EPSILON)*Math.sin(C),R={overlap:p,result:!1,x:M,y:_};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&c||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var L=a.x-o.x,F=a.y-o.y,O=Math.sqrt(Math.pow(L,2)+Math.pow(F,2)),D=(o.x-a.x)/O||0,k=(o.y-a.y)/O||0,I=2*(d.x*D+d.y*k-f.x*D-f.y*k)/(t.mass+e.mass);!h&&!c&&t.pushable&&e.pushable||(I*=2),!h&&t.pushable&&(d.x=d.x-I/t.mass*D,d.y=d.y-I/t.mass*k,d.multiply(t.bounce)),!c&&e.pushable&&(f.x=f.x+I/e.mass*D,f.y=f.y+I/e.mass*k,f.multiply(e.bounce)),h||c||(M*=.5,_*=.5),(!h||t.pushable||P)&&(t.x-=M,t.y-=_,t.updateCenter()),(!c||e.pushable||P)&&(e.x+=M,e.y+=_,e.updateCenter()),R.result=!0}else h||!t.pushable&&!P||(t.x-=M,t.y-=_,t.updateCenter()),c||!e.pushable&&!P||(e.x+=M,e.y+=_,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a<e.length;a++)this.collideHandler(t,e[a],i,s,n,r);else if(h&&!l)if(e)for(a=0;a<t.length;a++)this.collideHandler(t[a],e,i,s,n,r);else for(a=0;a<t.length;a++){var u=t[a];for(o=a+1;o<t.length;o++)a!==o&&this.collideHandler(u,t[o],i,s,n,r)}else for(a=0;a<t.length;a++)for(o=0;o<e.length;o++)this.collideHandler(t[a],e[o],i,s,n,r);else this.collideHandler(t,e,i,s,n,r);return this._total>0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,n,r){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(o=d.length,a=0;a<o;a++)u!==(l=d[a])&&l.enable&&!l.checkCollision.none&&e.contains(l.gameObject)&&this.separate(u,l,s,n,r)&&(i&&i.call(n,u.gameObject,l.gameObject),this._total++)}else{var f=e.getChildren(),p=e.children.entries.indexOf(t);for(o=f.length,a=0;a<o;a++)(l=f[a].body)&&a!==p&&l.enable&&this.separate(u,l,s,n,r)&&(i&&i.call(n,u.gameObject,l.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,s,n,r){if(!this.canCollide(t,e))return!1;var a=t.getChildren();if(0===a.length)return!1;for(var o=!1,h=0;h<a.length;h++)(a[h].body||a[h].isBody)&&this.collideSpriteVsTilemapLayer(a[h],e,i,s,n,r)&&(o=!0);return o},collideTiles:function(t,e,i,s,n){return!(0===e.length||t.body&&!t.body.enable||t.isBody&&!t.enable)&&this.collideSpriteVsTilesHandler(t,e,i,s,n,!1,!1)},overlapTiles:function(t,e,i,s,n){return!(0===e.length||t.body&&!t.body.enable||t.isBody&&!t.enable)&&this.collideSpriteVsTilesHandler(t,e,i,s,n,!0,!1)},collideSpriteVsTilemapLayer:function(t,e,i,s,n,r){var a=t.isBody?t:t.body;if(!a.enable||a.checkCollision.none||!this.canCollide(a,e))return!1;var o=e.layer,h=a.x-o.tileWidth*e.scaleX,l=a.y-o.tileHeight*e.scaleY,u=a.width+o.tileWidth*e.scaleX,c=a.height+o.tileHeight*e.scaleY,d=r?null:this.tileFilterOptions,f=y(h,l,u,c,d,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,a){for(var o,h,l=t.isBody?t:t.body,u={left:0,right:0,top:0,bottom:0},c=!1,f=0;f<e.length;f++){var p=(h=(o=e[f]).tilemapLayer).tileToWorldXY(o.x,o.y);u.left=p.x,u.top=p.y,u.right=u.left+o.width*h.scaleX,u.bottom=u.top+o.height*h.scaleY,P(u,l)&&(!s||s.call(n,t,o))&&T(o,t)&&(r||A(f,l,o,u,h,this.TILE_BIAS,a))&&(this._total++,c=!0,i&&i.call(n,t,o),r&&l.onOverlap?this.emit(d.TILE_OVERLAP,t,o,l):l.onCollide&&this.emit(d.TILE_COLLIDE,t,o,l))}return c},collideGroupVsGroup:function(t,e,i,s,n,r){if(0!==t.getLength()&&0!==e.getLength()&&this.canCollide(t,e))for(var a=t.getChildren(),o=0;o<a.length;o++)this.collideSpriteVsGroup(a[o],e,i,s,n,r)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=O(t.x,this.bounds.left-e,this.bounds.right+e),t.y=O(t.y,this.bounds.top-e,this.bounds.bottom+e)},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,this.debugGraphic&&(this.debugGraphic.destroy(),this.debugGraphic=null)}});t.exports=D},1093:t=>{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},59023:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62069:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,s){return this.body.setCollideWorldBounds(t,e,i,s),this}}},78389:(t,e,i)=>{var s=i(79599),n={setCollisionCategory:function(t){return(this.body?this.body:this).collisionCategory=t,this},willCollideWith:function(t){return 0!==((this.body?this.body:this).collisionMask&t)},addCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask|t,this},removeCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask&~t,this},setCollidesWith:function(t){return(this.body?this.body:this).collisionMask=s(t),this},resetCollisionCategory:function(){var t=this.body?this.body:this;return t.collisionCategory=1,t.collisionMask=2147483647,this}};t.exports=n},87118:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},52819:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},4074:t=>{t.exports={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}}},40831:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},26775:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},9437:t=>{t.exports={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}}},30621:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},72441:(t,e,i)=>{var s=i(47956),n=i(96503),r=i(2044),a=i(81491);t.exports=function(t,e,i,o,h,l){var u=s(t,e-o,i-o,2*o,2*o,h,l);if(0===u.length)return u;for(var c=new n(e,i,o),d=new n,f=[],p=0;p<u.length;p++){var g=u[p];g.isCircle?(d.setTo(g.center.x,g.center.y,g.halfWidth),r(c,d)&&f.push(g)):a(c,g)&&f.push(g)}return f}},47956:t=>{t.exports=function(t,e,i,s,n,r,a){void 0===r&&(r=!0),void 0===a&&(a=!1);var o=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,a&&(h=t.staticTree.search(l)),r&&t.useTree)o=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&o.push(t)}))}return h.concat(o)}},62121:t=>{t.exports={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}}},29384:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},15098:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},92209:(t,e,i)=>{t.exports={Acceleration:i(1093),Angular:i(59023),Bounce:i(62069),Collision:i(78389),Debug:i(87118),Drag:i(52819),Enable:i(4074),Friction:i(40831),Gravity:i(26775),Immovable:i(9437),Mass:i(30621),OverlapCirc:i(72441),OverlapRect:i(47956),Pushable:i(62121),Size:i(29384),Velocity:i(15098)}},37747:t=>{t.exports={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}},20009:t=>{t.exports="collide"},36768:t=>{t.exports="overlap"},60473:t=>{t.exports="pause"},89954:t=>{t.exports="resume"},61804:t=>{t.exports="tilecollide"},7161:t=>{t.exports="tileoverlap"},34689:t=>{t.exports="worldbounds"},16006:t=>{t.exports="worldstep"},63012:(t,e,i)=>{t.exports={COLLIDE:i(20009),OVERLAP:i(36768),PAUSE:i(60473),RESUME:i(89954),TILE_COLLIDE:i(61804),TILE_OVERLAP:i(7161),WORLD_BOUNDS:i(34689),WORLD_STEP:i(16006)}},27064:(t,e,i)=>{var s=i(37747),n=i(79291),r={ArcadePhysics:i(86689),Body:i(37742),Collider:i(79342),Components:i(92209),Events:i(63012),Factory:i(66022),GetCollidesWith:i(79599),GetOverlapX:i(64897),GetOverlapY:i(45170),SeparateX:i(14087),SeparateY:i(89936),Group:i(60758),Image:i(71289),Sprite:i(13759),StaticBody:i(72624),StaticGroup:i(71464),Tilemap:i(55173),World:i(82248)};r=n(!1,r,s),t.exports=r},96602:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},36294:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012:(t,e,i)=>{var s=i(21329),n=i(53442),r=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,c=a.top,d=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()<e.deltaAbsY()&&(x=-1),0!==e.deltaX()&&0!==e.deltaY()&&p&&g&&(y=Math.min(Math.abs(e.position.x-d),Math.abs(e.right-u)),x=Math.min(Math.abs(e.position.y-f),Math.abs(e.bottom-c))),y<x){if(p&&0!==(m=s(e,i,u,d,h,l))&&!r(a,e))return!0;g&&(v=n(e,i,c,f,h,l))}else{if(g&&0!==(v=n(e,i,c,f,h,l))&&!r(a,e))return!0;p&&(m=s(e,i,u,d,h,l))}return 0!==m||0!==v}},21329:(t,e,i)=>{var s=i(36294);t.exports=function(t,e,i,n,r,a){var o=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return a||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x<n&&(o=t.x-n)<-r&&(o=0):t.deltaX()>0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},53442:(t,e,i)=>{var s=i(67013);t.exports=function(t,e,i,n,r,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return a||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y<n&&(o=t.y-n)<-r&&(o=0):t.deltaY()>0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},2483:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173:(t,e,i)=>{var s={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=s},44563:(t,e,i)=>{t.exports={Arcade:i(27064),Matter:i(3875)}},68174:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,a=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},19933:(t,e,i)=>{var s=i(6790);s.Body=i(22562),s.Composite=i(69351),s.World=i(4372),s.Collision=i(52284),s.Detector=i(81388),s.Pairs=i(99561),s.Pair=i(4506),s.Query=i(73296),s.Resolver=i(66272),s.Constraint=i(48140),s.Common=i(53402),s.Engine=i(48413),s.Events=i(35810),s.Sleeping=i(53614),s.Plugin=i(73832),s.Bodies=i(66280),s.Composites=i(74116),s.Axes=i(66615),s.Bounds=i(15647),s.Svg=i(74058),s.Vector=i(31725),s.Vertices=i(41598),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},28137:(t,e,i)=>{var s=i(66280),n=i(83419),r=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),c=i(73834),d=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var a=s.rectangle(t,e,i,n,r);return this.world.add(a),a},trapezoid:function(t,e,i,n,r,a){var o=s.trapezoid(t,e,i,n,r,a);return this.world.add(o),o},circle:function(t,e,i,n,r){var a=s.circle(t,e,i,n,r);return this.world.add(a),a},polygon:function(t,e,i,n,r){var a=s.polygon(t,e,i,n,r);return this.world.add(a),a},fromVertices:function(t,e,i,n,r,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=s.fromVertices(t,e,i,n,r,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,a){void 0===n&&(n=1),void 0===r&&(r={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u<h.length;u++){var c=o.pathToVertices(h[u],30);1!==n&&g.scale(c,n,n),l.push(c)}var d=s.fromVertices(t,e,l,r);return a&&this.world.add(d),d},fromJSON:function(t,e,i,s,n){void 0===s&&(s={}),void 0===n&&(n=!0);var r=f.parseBody(t,e,i,s);return r&&n&&this.world.add(r),r},imageStack:function(t,e,i,s,n,a,o,h,u){void 0===o&&(o=0),void 0===h&&(h=0),void 0===u&&(u={});var c=this.world,d=this.sys.displayList;u.addToWorld=!1;var f=r.stack(i,s,n,a,o,h,(function(i,s){var n=new l(c,i,s,t,e,u);return d.add(n),n.body}));return c.add(f),f},stack:function(t,e,i,s,n,a,o){var h=r.stack(t,e,i,s,n,a,o);return this.world.add(h),h},pyramid:function(t,e,i,s,n,a,o){var h=r.pyramid(t,e,i,s,n,a,o);return this.world.add(h),h},chain:function(t,e,i,s,n,a){return r.chain(t,e,i,s,n,a)},mesh:function(t,e,i,s,n){return r.mesh(t,e,i,s,n)},newtonsCradle:function(t,e,i,s,n){var a=r.newtonsCradle(t,e,i,s,n);return this.world.add(a),a},car:function(t,e,i,s,n){var a=r.car(t,e,i,s,n);return this.world.add(a),a},softBody:function(t,e,i,s,n,a,o,h,l,u){var c=r.softBody(t,e,i,s,n,a,o,h,l,u);return this.world.add(c),c},joint:function(t,e,i,s,n){return this.constraint(t,e,i,s,n)},spring:function(t,e,i,s,n){return this.constraint(t,e,i,s,n)},constraint:function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n={}),n.bodyA="body"===t.type?t:t.body,n.bodyB="body"===e.type?e:e.body,isNaN(i)||(n.length=i),n.stiffness=s;var r=a.create(n);return this.world.add(r),r},worldConstraint:function(t,e,i,s){void 0===i&&(i=1),void 0===s&&(s={}),s.bodyB="body"===t.type?t:t.body,isNaN(e)||(s.length=e),s.stiffness=i;var n=a.create(s);return this.world.add(n),n},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new p(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,s,n){var r=new l(this.world,t,e,i,s,n);return this.sys.displayList.add(r),r},tileBody:function(t,e){return new c(this.world,t,e)},sprite:function(t,e,i,s,n){var r=new u(this.world,t,e,i,s,n);return this.sys.displayList.add(r),this.sys.updateList.add(r),r},gameObject:function(t,e,i){return h(this.world,t,e,i)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=m},75803:(t,e,i)=>{var s=i(31884),n=i(95540),r=i(26099);t.exports=function(t,e,i,a){void 0===i&&(i={}),void 0===a&&(a=!0);var o=e.x,h=e.y;if(e.body={temp:!0,position:{x:o,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(o,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,a);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=a,e.setBody(l,i)}return e}},23181:(t,e,i)=>{var s=i(83419),n=i(31884),r=i(95643),a=i(95540),o=i(88571),h=i(72699),l=i(26099),u=new s({Extends:o,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,o){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=a(o,"shape",null);h?this.setBody(h,o):this.setRectangle(this.width,this.height,o),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=u},42045:(t,e,i)=>{var s=i(60461),n=i(66615),r=i(66280),a=i(22562),o=i(68174),h=i(15647),l=i(83419),u=i(52284),c=i(53402),d=i(69351),f=i(74116),p=i(48140),g=i(81388),m=i(20339),v=i(28137),y=i(95540),x=i(35154),w=i(46975),b=i(4506),T=i(99561),S=i(37277),E=i(73296),A=i(66272),C=i(44594),M=i(74058),_=i(31725),R=i(41598),P=i(68243);c.setDecomp(i(55973));var L=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=a,this.composite=d,this.collision=u,this.detector=g,this.pair=b,this.pairs=T,this.query=E,this.resolver=A,this.constraint=p,this.bodies=r,this.composites=f,this.axes=n,this.bounds=h,this.svg=M,this.vector=_,this.vertices=R,this.verts=R,this._tempVec2=_.create(),A._restingThresh=x(this.config,"restingThresh",4),A._restingThreshTangent=x(this.config,"restingThreshTangent",6),A._positionDampen=x(this.config,"positionDampen",.9),A._positionWarming=x(this.config,"positionWarming",.8),A._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),t.sys.events.once(C.BOOT,this.boot,this),t.sys.events.on(C.START,this.start,this)},boot:function(){this.world=new P(this.scene,this.config),this.add=new v(this.world),this.bodyBounds=new o,this.systems.events.once(C.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new P(this.scene,this.config),this.add=new v(this.world));var t=this.systems.events;t.on(C.UPDATE,this.world.update,this.world),t.on(C.POST_UPDATE,this.world.postUpdate,this.world),t.once(C.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return w(y(e,"matter",{}),y(t,"matter",{}))},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(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=_.create(e,i);return E.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=_.create(t,e),n=[];return E.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var a={min:{x:t,y:e},max:{x:t+i,y:e+s}},o=[];return E.region(r,a,n).forEach((function(t){-1===o.indexOf(t)&&o.push(t)})),o},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var a=[],o=E.ray(r,_.create(t,e),_.create(i,s),n),h=0;h<o.length;h++)a.push(o[h].body);return a},intersectBody:function(t,e){e=this.getMatterBodies(e);for(var i=[],s=E.collides(t,e),n=0;n<s.length;n++){var r=s[n];r.bodyA===t?i.push(r.bodyB):i.push(r.bodyA)}return i},overlap:function(t,e,i,s,n){void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),Array.isArray(t)||(t=[t]),t=this.getMatterBodies(t),e=this.getMatterBodies(e);for(var r=!1,a=0;a<t.length;a++)for(var o=t[a],h=E.collides(o,e),l=0;l<h.length;l++){var u=h[l],c=u.bodyA.id===o.id?u.bodyB:u.bodyA;if(!s||s.call(n,o,c,u))if(r=!0,i)i.call(n,o,c,u);else if(!s)return!0}return r},setCollisionCategory:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){t.collisionFilter.category=e})),this},setCollisionGroup:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){t.collisionFilter.group=e})),this},setCollidesWith:function(t,e){t=this.getMatterBodies(t);var i=0;if(Array.isArray(e))for(var s=0;s<e.length;s++)i|=e[s];else i=e;return t.forEach((function(t){t.collisionFilter.mask=i})),this},getMatterBodies:function(t){if(!t)return this.world.getAllBodies();Array.isArray(t)||(t=[t]);for(var e=[],i=0;i<t.length;i++){var s=t[i].hasOwnProperty("body")?t[i].body:t[i];e.push(s)}return e},setVelocity:function(t,e,i){t=this.getMatterBodies(t);var s=this._tempVec2;return s.x=e,s.y=i,t.forEach((function(t){a.setVelocity(t,s)})),this},setVelocityX:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.x=e,t.forEach((function(t){i.y=t.velocity.y,a.setVelocity(t,i)})),this},setVelocityY:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.y=e,t.forEach((function(t){i.x=t.velocity.x,a.setVelocity(t,i)})),this},setAngularVelocity:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){a.setAngularVelocity(t,e)})),this},applyForce:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return t.forEach((function(t){i.x=t.position.x,i.y=t.position.y,a.applyForce(t,i,e)})),this},applyForceFromPosition:function(t,e,i,s){t=this.getMatterBodies(t);var n=this._tempVec2;return t.forEach((function(t){void 0===s&&(s=t.angle),n.x=i*Math.cos(s),n.y=i*Math.sin(s),a.applyForce(t,e,n)})),this},applyForceFromAngle:function(t,e,i){t=this.getMatterBodies(t);var s=this._tempVec2;return t.forEach((function(t){void 0===i&&(i=t.angle),s.x=e*Math.cos(i),s.y=e*Math.sin(i),a.applyForce(t,{x:t.position.x,y:t.position.y},s)})),this},getConstraintLength:function(t){var e=t.pointA.x,i=t.pointA.y,s=t.pointB.x,n=t.pointB.y;return t.bodyA&&(e+=t.bodyA.position.x,i+=t.bodyA.position.y),t.bodyB&&(s+=t.bodyB.position.x,n+=t.bodyB.position.y),m(e,i,s,n)},alignBody:function(t,e,i,n){var r;switch(t=t.hasOwnProperty("body")?t.body:t,n){case s.TOP_LEFT:case s.LEFT_TOP:r=this.bodyBounds.getTopLeft(t,e,i);break;case s.TOP_CENTER:r=this.bodyBounds.getTopCenter(t,e,i);break;case s.TOP_RIGHT:case s.RIGHT_TOP:r=this.bodyBounds.getTopRight(t,e,i);break;case s.LEFT_CENTER:r=this.bodyBounds.getLeftCenter(t,e,i);break;case s.CENTER:r=this.bodyBounds.getCenter(t,e,i);break;case s.RIGHT_CENTER:r=this.bodyBounds.getRightCenter(t,e,i);break;case s.LEFT_BOTTOM:case s.BOTTOM_LEFT:r=this.bodyBounds.getBottomLeft(t,e,i);break;case s.BOTTOM_CENTER:r=this.bodyBounds.getBottomCenter(t,e,i);break;case s.BOTTOM_RIGHT:case s.RIGHT_BOTTOM:r=this.bodyBounds.getBottomRight(t,e,i)}return r&&a.setPosition(t,r),this},shutdown:function(){var t=this.systems.events;this.world&&(t.off(C.UPDATE,this.world.update,this.world),t.off(C.POST_UPDATE,this.world.postUpdate,this.world)),t.off(C.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(C.START,this.start,this),this.scene=null,this.systems=null}});S.register("MatterPhysics",L,"matterPhysics"),t.exports=L},34803:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(31884),a=i(95643),o=i(95540),h=i(72699),l=i(68287),u=i(26099),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){a.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=o(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=c},73834:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(83419),a=i(31884),o=i(62644),h=i(50792),l=i(95540),u=i(97022),c=i(41598),d=new r({Extends:h,Mixins:[a.Bounce,a.Collision,a.Friction,a.Gravity,a.Mass,a.Sensor,a.Sleep,a.Static],initialize:function(t,e,i){h.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=l(i,"body",null),r=l(i,"addToWorld",!0);if(s)this.setBody(s,r);else{var a=e.getCollisionGroup();l(a,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,c=e.flipY?-1:1;n.scale(s,u,c,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),d=l(h,"objects",[]),f=[],p=0;p<d.length;p++){var g=d[p],m=r+g.x*e,v=a+g.y*i,y=g.width*e,x=g.height*i,w=null;if(g.rectangle)w=s.rectangle(m+y/2,v+x/2,y,x,t);else if(g.ellipse)w=s.circle(m+y/2,v+x/2,y/2,t);else if(g.polygon||g.polyline){var b=(g.polygon?g.polygon:g.polyline).map((function(t){return{x:t.x*e,y:t.y*i}})),T=c.create(b),S=c.centre(T);m+=S.x,v+=S.y,w=s.fromVertices(m,v,T,t)}w&&f.push(w)}if(1===f.length)this.setBody(f[0],t.addToWorld);else if(f.length>1){var E=o(t);E.parts=f,this.setBody(n.create(E),E.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&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()}});t.exports=d},19496:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var o=a(i,"fixtures",[]),h=[],l=0;l<o.length;l++)for(var u=this.parseFixture(o[l]),c=0;c<u.length;c++)h.push(u[c]);var d=r.clone(i,!0);r.extend(d,s,!0),delete d.fixtures,delete d.type;var f=n.create(d);return n.setParts(f,h),n.setPosition(f,{x:t,y:e}),f},parseFixture:function(t){var e,i=r.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var n=a(t.circle,"x"),o=a(t.circle,"y"),h=a(t.circle,"radius");e=[s.circle(n,o,h,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){void 0===e&&(e={});for(var i=[],a=0;a<t.length;a++)o.clockwiseSort(t[a]),i.push(n.create(r.extend({position:o.centre(t[a]),vertices:t[a]},e)));return s.flagCoincidentParts(i)}};t.exports=h},85791:(t,e,i)=>{var s=i(66280),n=i(22562),r={parseBody:function(t,e,i,r){var a;void 0===r&&(r={});var o=i.vertices;if(1===o.length)r.vertices=o[0],a=n.create(r),s.flagCoincidentParts(a.parts);else{for(var h=[],l=0;l<o.length;l++){var u=n.create({vertices:o[l]});h.push(u)}s.flagCoincidentParts(h),r.parts=h,a=n.create(r)}return a.label=i.label,n.setPosition(a,{x:t,y:e}),a}};t.exports=r},98713:(t,e,i)=>{var s=i(15647),n=i(83419),r=i(69351),a=i(48140),o=i(81388),h=i(1121),l=i(8214),u=i(46975),c=i(53614),d=i(26099),f=i(41598),p=new n({initialize:function(t,e,i){void 0===i&&(i={}),this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=a.create(u(i,{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(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),a=0;a<n.length;a++){var l=n[a];if(!l.ignorePointer&&s.contains(l.bounds,e)&&o.canCollide(l.collisionFilter,i.collisionFilter)&&this.hitTestBody(l,e))return this.world.emit(h.DRAG_START,l,this.part,this),!0}return!1},hitTestBody:function(t,e){for(var i=this.constraint,s=t.parts.length,n=s>1?1:0;n<s;n++){var r=t.parts[n];if(f.contains(r.vertices,e))return i.pointA=e,i.pointB={x:e.x-t.position.x,y:e.y-t.position.y},i.bodyB=t,i.angleB=t.angle,c.set(t,!1),this.part=r,this.body=t,!0}return!1},update:function(){var t=this.pointer,e=this.body;if(this.active&&t)if(t.isDown||!e){if(t.isDown){if(!this.camera||!e&&!this.getBody(t))return;e=this.body;var i=this.position,s=this.constraint;this.camera.getWorldPoint(t.x,t.y,i),s.pointA.x=i.x,s.pointA.y=i.y,c.set(e,!1),this.world.emit(h.DRAG,e,this)}}else this.stopDrag();else e&&this.stopDrag()},stopDrag:function(){var t=this.body,e=this.constraint;e.bodyB=null,e.pointB=null,this.pointer=null,this.body=null,this.part=null,t&&this.world.emit(h.DRAG_END,t,this)},destroy:function(){this.world.removeConstraint(this.constraint),this.pointer=null,this.constraint=null,this.body=null,this.part=null,this.world.off(h.BEFORE_UPDATE,this.update),this.scene.sys.input.off(l.POINTER_DOWN,this.onDown,this),this.scene.sys.input.off(l.POINTER_UP,this.onUp,this)}});t.exports=p},68243:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(83419),a=i(53402),o=i(69351),h=i(48413),l=i(50792),u=i(1121),c=i(95540),d=i(35154),f=i(22562),p=i(35810),g=i(73834),m=i(4372),v=i(13037),y=i(31725),x=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{});c(s,"fps",!1)&&(s.delta=1e3/c(s,"fps",60)),this.runner=v.create(s),this.autoUpdate=d(e,"autoUpdate",!0);var n=d(e,"debug",!1);if(this.drawDebug="object"==typeof n||n,this.debugGraphic,this.debugConfig={showAxes:c(n,"showAxes",!1),showAngleIndicator:c(n,"showAngleIndicator",!1),angleColor:c(n,"angleColor",15208787),showBroadphase:c(n,"showBroadphase",!1),broadphaseColor:c(n,"broadphaseColor",16757760),showBounds:c(n,"showBounds",!1),boundsColor:c(n,"boundsColor",16777215),showVelocity:c(n,"showVelocity",!1),velocityColor:c(n,"velocityColor",44783),showCollisions:c(n,"showCollisions",!1),collisionColor:c(n,"collisionColor",16094476),showSeparations:c(n,"showSeparations",!1),separationColor:c(n,"separationColor",16753920),showBody:c(n,"showBody",!0),showStaticBody:c(n,"showStaticBody",!0),showInternalEdges:c(n,"showInternalEdges",!1),renderFill:c(n,"renderFill",!1),renderLine:c(n,"renderLine",!0),fillColor:c(n,"fillColor",1075465),fillOpacity:c(n,"fillOpacity",1),lineColor:c(n,"lineColor",2678297),lineOpacity:c(n,"lineOpacity",1),lineThickness:c(n,"lineThickness",1),staticFillColor:c(n,"staticFillColor",857979),staticLineColor:c(n,"staticLineColor",1255396),showSleeping:c(n,"showSleeping",!1),staticBodySleepOpacity:c(n,"staticBodySleepOpacity",.7),sleepFillColor:c(n,"sleepFillColor",4605510),sleepLineColor:c(n,"sleepLineColor",10066585),showSensors:c(n,"showSensors",!0),sensorFillColor:c(n,"sensorFillColor",857979),sensorLineColor:c(n,"sensorLineColor",1255396),showPositions:c(n,"showPositions",!0),positionSize:c(n,"positionSize",4),positionColor:c(n,"positionColor",14697178),showJoint:c(n,"showJoint",!0),jointColor:c(n,"jointColor",14737474),jointLineOpacity:c(n,"jointLineOpacity",1),jointLineThickness:c(n,"jointLineThickness",2),pinSize:c(n,"pinSize",4),pinColor:c(n,"pinColor",4382944),springColor:c(n,"springColor",14697184),anchorColor:c(n,"anchorColor",15724527),anchorSize:c(n,"anchorSize",4),showConvexHulls:c(n,"showConvexHulls",!1),hullColor:c(n,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var r=e.setBounds;if("boolean"==typeof r)this.setBounds();else{var a=c(r,"x",0),o=c(r,"y",0),u=c(r,"width",t.sys.scale.width),f=c(r,"height",t.sys.scale.height),p=c(r,"thickness",64),g=c(r,"left",!0),m=c(r,"right",!0),y=c(r,"top",!0),x=c(r,"bottom",!0);this.setBounds(a,o,u,f,p,g,m,y,x)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,a=t.composites;for(e=0;e<n.length;e++)s=(i=n[e]).render,this.setBodyRenderStyle(i,s.lineColor,s.lineOpacity,s.lineThickness,s.fillColor,s.fillOpacity);for(e=0;e<r.length;e++)s=(i=r[e]).render,this.setConstraintRenderStyle(i,s.lineColor,s.lineOpacity,s.lineThickness,s.pinSize,s.anchorColor,s.anchorSize);for(e=0;e<a.length;e++)i=a[e],this.setCompositeRenderStyle(i);return this},setBodyRenderStyle:function(t,e,i,s,n,r){var a=t.render,o=this.debugConfig;return a?(null==e&&(e=t.isStatic?o.staticLineColor:o.lineColor),null==i&&(i=o.lineOpacity),null==s&&(s=o.lineThickness),null==n&&(n=t.isStatic?o.staticFillColor:o.fillColor),null==r&&(r=o.fillOpacity),!1!==e&&(a.lineColor=e),!1!==i&&(a.lineOpacity=i),!1!==s&&(a.lineThickness=s),!1!==n&&(a.fillColor=n),!1!==r&&(a.fillOpacity=r),this):this},setConstraintRenderStyle:function(t,e,i,s,n,r,a){var o=t.render,h=this.debugConfig;if(!o)return this;if(null==e){var l=o.type;"line"===l?e=h.jointColor:"pin"===l?e=h.pinColor:"spring"===l&&(e=h.springColor)}return null==i&&(i=h.jointLineOpacity),null==s&&(s=h.jointLineThickness),null==n&&(n=h.pinSize),null==r&&(r=h.anchorColor),null==a&&(a=h.anchorSize),!1!==e&&(o.lineColor=e),!1!==i&&(o.lineOpacity=i),!1!==s&&(o.lineThickness=s),!1!==n&&(o.pinSize=n),!1!==r&&(o.anchorColor=r),!1!==a&&(o.anchorSize=a),this},setEventsProxy:function(){var t=this,e=this.engine,i=this.localWorld;this.drawDebug&&(p.on(i,"compositeModified",(function(e){t.setCompositeRenderStyle(e)})),p.on(i,"beforeAdd",(function(e){for(var i=[].concat(e.object),s=0;s<i.length;s++){var n=i[s],r=n.render;"body"===n.type?t.setBodyRenderStyle(n,r.lineColor,r.lineOpacity,r.lineThickness,r.fillColor,r.fillOpacity):"composite"===n.type?t.setCompositeRenderStyle(n):"constraint"===n.type&&t.setConstraintRenderStyle(n,r.lineColor,r.lineOpacity,r.lineThickness,r.pinSize,r.anchorColor,r.anchorSize)}}))),p.on(i,"beforeAdd",(function(e){t.emit(u.BEFORE_ADD,e)})),p.on(i,"afterAdd",(function(e){t.emit(u.AFTER_ADD,e)})),p.on(i,"beforeRemove",(function(e){t.emit(u.BEFORE_REMOVE,e)})),p.on(i,"afterRemove",(function(e){t.emit(u.AFTER_REMOVE,e)})),p.on(e,"beforeUpdate",(function(e){t.emit(u.BEFORE_UPDATE,e)})),p.on(e,"afterUpdate",(function(e){t.emit(u.AFTER_UPDATE,e)})),p.on(e,"collisionStart",(function(e){var i,s,n=e.pairs;n.length>0&&n.map((function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,s,t),s.gameObject&&s.gameObject.emit("collide",s,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(s,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),s.onCollideCallback&&s.onCollideCallback(t),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,t),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,t)})),t.emit(u.COLLISION_START,e,i,s)})),p.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&n.map((function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,s,t),s.gameObject&&s.gameObject.emit("collideActive",s,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(s,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),s.onCollideActiveCallback&&s.onCollideActiveCallback(t)})),t.emit(u.COLLISION_ACTIVE,e,i,s)})),p.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&n.map((function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,s,t),s.gameObject&&s.gameObject.emit("collideEnd",s,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(s,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),s.onCollideEndCallback&&s.onCollideEndCallback(t)})),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(a,"right",t+i,e-n,n,s+2*n),this.updateWall(o,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,n,r){var a=s.rectangle(t,e,i,n,r);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i],n=s.body?s.body:s;o.remove(this.localWorld,n,e)}return this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,s=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(s,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new g(this,t[i],e);return this},nextGroup:function(t){return f.nextGroup(t)},nextCategory:function(){return f.nextCategory()},pause:function(){return this.enabled=!1,this.emit(u.PAUSE),this},resume:function(){return this.enabled=!0,this.runner.timeLastTick=a.now(),this.emit(u.RESUME),this},update:function(t){if(this.enabled&&this.autoUpdate){var e=this.engine,i=this.runner,s=a.now(),n=i.delta,r=0,o=t-i.timeLastTick;if((!o||!i.timeLastTick||o>Math.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+n*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var c=i.maxUpdates||Math.ceil(i.maxFrameTime/n),d=a.now();n>0&&i.timeBuffer>=n*v._timeBufferMargin;){h.update(e,n),i.timeBuffer-=n,r+=1;var f=a.now()-s,p=a.now()-d,g=f+v._elapsedNextEstimate*p/r;if(r>=c||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/n-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=a.keys(t.buckets),r=0;r<n.length;r++){var o=n[r];if(!(t.buckets[o].length<2)){var h=o.split(/C|R/);e.strokeRect(parseInt(h[1],10)*t.bucketWidth,parseInt(h[2],10)*t.bucketHeight,t.bucketWidth,t.bucketHeight)}}return this},renderSeparations:function(t,e,i){e.lineStyle(1,i,1);for(var s=0;s<t.length;s++){var n=t[s];if(n.isActive){var r=n.collision,a=r.bodyA,o=r.bodyB,h=a.position,l=o.position,u=r.penetration,c=a.isStatic||o.isStatic?1:4;o.isStatic&&(c=0),e.lineBetween(l.x,l.y,l.x-u.x*c,l.y-u.y*c),c=a.isStatic||o.isStatic?1:4,a.isStatic&&(c=0),e.lineBetween(h.x,h.y,h.x-u.x*c,h.y-u.y*c)}}return this},renderCollisions:function(t,e,i){var s,n;for(e.lineStyle(1,i,.5),e.fillStyle(i,1),s=0;s<t.length;s++)if((n=t[s]).isActive)for(var r=0;r<n.contactCount;r++){var a=n.contacts[r].vertex;a&&e.fillRect(a.x-2,a.y-2,5,5)}for(s=0;s<t.length;s++)if((n=t[s]).isActive){var o=n.collision,h=n.contacts;if(n.contactCount>0){var l=h[0].vertex.x,u=h[0].vertex.y;2===n.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n<t.length;n++){var r=t[n];if(r.render.visible){var a=r.bounds;if(a)e.strokeRect(a.min.x,a.min.y,a.max.x-a.min.x,a.max.y-a.min.y);else for(var o=r.parts,h=o.length>1?1:0;h<o.length;h++){var l=o[h];e.strokeRect(l.bounds.min.x,l.bounds.min.y,l.bounds.max.x-l.bounds.min.x,l.bounds.max.y-l.bounds.min.y)}}}return this},renderBodyAxes:function(t,e,i,s,n){e.lineStyle(1,s,n);for(var r=0;r<t.length;r++){var a,o,h,l=t[r],u=l.parts;if(l.render.visible)if(i)for(o=u.length>1?1:0;o<u.length;o++)for(a=u[o],h=0;h<a.axes.length;h++){var c=a.axes[h];e.lineBetween(a.position.x,a.position.y,a.position.x+20*c.x,a.position.y+20*c.y)}else for(o=u.length>1?1:0;o<u.length;o++)for(a=u[o],h=0;h<a.axes.length;h++)e.lineBetween(a.position.x,a.position.y,(a.vertices[0].x+a.vertices[a.vertices.length-1].x)/2,(a.vertices[0].y+a.vertices[a.vertices.length-1].y)/2)}return this},renderBodyVelocity:function(t,e,i,s,n){e.lineStyle(n,i,s);for(var r=0;r<t.length;r++){var a=t[r];a.render.visible&&e.lineBetween(a.position.x,a.position.y,a.position.x+2*(a.position.x-a.positionPrev.x),a.position.y+2*(a.position.y-a.positionPrev.y))}return this},renderBodies:function(t){for(var e=this.debugGraphic,i=this.debugConfig,s=i.showBody,n=i.showStaticBody,r=i.showSleeping,a=i.showInternalEdges,o=i.showConvexHulls,h=i.renderFill,l=i.renderLine,u=i.staticBodySleepOpacity,c=i.sleepFillColor,d=i.sleepLineColor,f=i.hullColor,p=0;p<t.length;p++){var g=t[p];if(g.render.visible&&(n||!g.isStatic)&&(s||g.isStatic)){var m=g.render.lineColor,v=g.render.lineOpacity,y=g.render.lineThickness,x=g.render.fillColor,w=g.render.fillOpacity;r&&g.isSleeping&&(g.isStatic?(v*=u,w*=u):(m=d,x=c)),h||(x=null),l||(m=null),this.renderBody(g,e,a,m,v,y,x,w);var b=g.parts.length;o&&b>1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,s,n,r,a,o){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,f=d>1?1:0;f<d;f++){var p=c[f],g=p.render,m=g.opacity;if(g.visible&&0!==m&&(!p.isSensor||h.showSensors)){var v=p.circleRadius;if(e.beginPath(),p.isSensor?(null!==a&&e.fillStyle(l,o*m),null!==s&&e.lineStyle(r,u,n*m)):(null!==a&&e.fillStyle(a,o*m),null!==s&&e.lineStyle(r,s,n*m)),v)e.arc(p.position.x,p.position.y,v,0,2*Math.PI);else{var y=p.vertices,x=y.length;e.moveTo(y[0].x,y[0].y);for(var w=1;w<x;w++){var b=y[w];if(!y[w-1].isInternal||i?e.lineTo(b.x,b.y):e.moveTo(b.x,b.y),w<x&&b.isInternal&&!i){var T=(w+1)%x;e.moveTo(y[T].x,y[T].y)}}e.closePath()}null!==a&&e.fillPath(),null!==s&&e.strokePath()}}if(h.showPositions&&!t.isStatic){var S=t.position.x,E=t.position.y,A=Math.ceil(h.positionSize/2);e.fillStyle(h.positionColor,1),e.fillRect(S-A,E-A,h.positionSize,h.positionSize)}return this},renderConvexHull:function(t,e,i,s){if(void 0===s&&(s=1),t.parts.length>1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r<n.length;r++)e.lineTo(n[r].x,n[r].y);e.lineTo(n[0].x,n[0].y),e.strokePath()}return this},renderJoints:function(){for(var t=this.debugGraphic,e=o.allConstraints(this.localWorld),i=0;i<e.length;i++){var s=e[i].render,n=s.lineColor,r=s.lineOpacity,a=s.lineThickness,h=s.pinSize,l=s.anchorColor,u=s.anchorSize;this.renderConstraint(e[i],t,n,r,a,h,l,u)}},renderConstraint:function(t,e,i,s,n,r,o,h){var l=t.render;if(!l.visible||!t.pointA||!t.pointB)return this;e.lineStyle(n,i,s);var u,c,d=t.bodyA,f=t.bodyB;if(u=d?y.add(d.position,t.pointA):t.pointA,"pin"===l.type)e.strokeCircle(u.x,u.y,r);else{if(c=f?y.add(f.position,t.pointB):t.pointB,e.beginPath(),e.moveTo(u.x,u.y),"spring"===l.type)for(var p,g=y.sub(c,u),m=y.perp(y.normalise(g)),v=Math.ceil(a.clamp(t.length/5,12,20)),x=1;x<v;x+=1)p=x%2==0?1:-1,e.lineTo(u.x+g.x*(x/v)+m.x*p*4,u.y+g.y*(x/v)+m.y*p*4);e.lineTo(c.x,c.y)}return e.strokePath(),l.anchors&&h>0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this},setOnCollide:function(t){return this.body.onCollideCallback=t,this},setOnCollideEnd:function(t){return this.body.onCollideEndCallback=t,this},setOnCollideActive:function(t){return this.body.onCollideActiveCallback=t,this},setOnCollideWith:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var s=t[i].hasOwnProperty("body")?t[i].body:t[i];this.body.setOnCollideWith(s,e)}return this}};t.exports=e},51607:(t,e,i)=>{var s=i(22562),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},5436:t=>{t.exports={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}}},39858:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},37302:(t,e,i)=>{var s=i(22562),n=i(26099),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},39132:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},57772:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(43855),a=i(95540),o=i(19496),h=i(85791),l=i(41598),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i<t.parts.length;i++)t.parts[i].gameObject=this;var s=this;if(t.destroy=function(){s.world.remove(s.body,!0),s.body.gameObject=null},e&&(this.world.has(t)&&this.world.remove(t,!0),this.world.add(t)),this._originComponent){var n=t.render.sprite.xOffset,a=t.render.sprite.yOffset,o=t.centerOfMass.x,h=t.centerOfMass.y;if(r(o,.5)&&r(h,.5))this.setOrigin(n+.5,a+.5);else{var l=t.centerOffset.x,u=t.centerOffset.y;this.setOrigin(n+l/this.displayWidth,a+u/this.displayHeight)}}return this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var r=a(t,"type","rectangle"),u=a(t,"x",this._tempVec2.x),c=a(t,"y",this._tempVec2.y),d=a(t,"width",this.width),f=a(t,"height",this.height);switch(r){case"rectangle":i=s.rectangle(u,c,d,f,e);break;case"circle":var p=a(t,"radius",Math.max(d,f)/2),g=a(t,"maxSides",25);i=s.circle(u,c,p,e,g);break;case"trapezoid":var m=a(t,"slope",.5);i=s.trapezoid(u,c,d,f,m,e);break;case"polygon":var v=a(t,"sides",5),y=a(t,"radius",Math.max(d,f)/2);i=s.polygon(u,c,v,y,e);break;case"fromVertices":case"fromVerts":var x=a(t,"verts",null);if(x)if("string"==typeof x&&(x=l.fromPath(x)),this.body&&!this.body.hasOwnProperty("temp"))n.setVertices(this.body,x),i=this.body;else{var w=a(t,"flagInternal",!1),b=a(t,"removeCollinear",.01),T=a(t,"minimumArea",10);i=s.fromVertices(u,c,x,e,w,b,T)}break;case"fromPhysicsEditor":i=o.parseBody(u,c,t,e);break;case"fromPhysicsTracer":i=h.parseBody(u,c,t,e)}return i&&this.setExistingBody(i,t.addToWorld),this}};t.exports=u},38083:(t,e,i)=>{var s=i(1121),n=i(53614),r=i(35810),a={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=a},90556:(t,e,i)=>{var s=i(22562),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},85436:(t,e,i)=>{var s=i(22562),n=i(36383),r=i(86554),a=i(30954),o={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this.setScale(t,t)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return a(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=o},42081:(t,e,i)=>{var s=i(22562),n={setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return s.getVelocity(this.body)},setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},getAngularVelocity:function(){return s.getAngularVelocity(this.body)},setAngularSpeed:function(t){return s.setAngularSpeed(this.body,t),this},getAngularSpeed:function(){return s.getAngularSpeed(this.body)}};t.exports=n},31884:(t,e,i)=>{t.exports={Bounce:i(70410),Collision:i(66968),Force:i(51607),Friction:i(5436),Gravity:i(39858),Mass:i(37302),Sensor:i(39132),SetBody:i(57772),Sleep:i(38083),Static:i(90556),Transform:i(85436),Velocity:i(42081)}},85608:t=>{t.exports="afteradd"},1213:t=>{t.exports="afterremove"},25968:t=>{t.exports="afterupdate"},67205:t=>{t.exports="beforeadd"},39438:t=>{t.exports="beforeremove"},44823:t=>{t.exports="beforeupdate"},92593:t=>{t.exports="collisionactive"},60128:t=>{t.exports="collisionend"},76861:t=>{t.exports="collisionstart"},92362:t=>{t.exports="dragend"},76408:t=>{t.exports="drag"},93971:t=>{t.exports="dragstart"},5656:t=>{t.exports="pause"},47861:t=>{t.exports="resume"},79099:t=>{t.exports="sleepend"},35906:t=>{t.exports="sleepstart"},1121:(t,e,i)=>{t.exports={AFTER_ADD:i(85608),AFTER_REMOVE:i(1213),AFTER_UPDATE:i(25968),BEFORE_ADD:i(67205),BEFORE_REMOVE:i(39438),BEFORE_UPDATE:i(44823),COLLISION_ACTIVE:i(92593),COLLISION_END:i(60128),COLLISION_START:i(76861),DRAG_END:i(92362),DRAG:i(76408),DRAG_START:i(93971),PAUSE:i(5656),RESUME:i(47861),SLEEP_END:i(79099),SLEEP_START:i(35906)}},3875:(t,e,i)=>{t.exports={BodyBounds:i(68174),Components:i(31884),Events:i(1121),Factory:i(28137),MatterGameObject:i(75803),Image:i(23181),Matter:i(19933),MatterPhysics:i(42045),PolyDecomp:i(55973),Sprite:i(34803),TileBody:i(73834),PhysicsEditorParser:i(19496),PhysicsJSONParser:i(85791),PointerConstraint:i(98713),World:i(68243)}},22562:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(31725),a=i(53614),o=i(53402),h=i(15647),l=i(66615);!function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(e){var i={id:o.nextId(),type:"body",label:"Body",parts:[],plugin:{},attractors:e.attractors||[],wrapBounds:null,angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{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,deltaTime:1e3/60,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:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=o.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){if(e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var i=t.bounds,a=t.centerOfMass,o=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;a.x=-(i.min.x-t.position.x)/u,a.y=-(i.min.y-t.position.y)/c,o.x=u*a.x,o.y=c*a.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":a.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"speed":s.setSpeed(t,i);break;case"angularSpeed":s.setAngularSpeed(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var s=t.parts[i];e?(s.isStatic||(s._original={restitution:s.restitution,friction:s.friction,mass:s.mass,inertia:s.inertia,density:s.density,inverseMass:s.inverseMass,inverseInertia:s.inverseInertia}),s.restitution=0,s.friction=1,s.mass=s.inertia=s.density=1/0,s.inverseMass=s.inverseInertia=0,s.positionPrev.x=s.position.x,s.positionPrev.y=s.position.y,s.anglePrev=s.angle,s.angularVelocity=0,s.speed=0,s.angularSpeed=0,s.motion=0):s._original&&(s.restitution=s._original.restitution,s.friction=s._original.friction,s.mass=s._original.mass,s.inertia=s._original.inertia,s.density=s._original.density,s.inverseMass=s._original.inverseMass,s.inverseInertia=s._original.inverseInertia,s._original=null),s.isStatic=e}},s.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},s.setDensity=function(t,e){s.setMass(t,e*t.area),t.density=e},s.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},s.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=n.create(e,t),t.axes=l.fromVertices(t.vertices),t.area=n.area(t.vertices),s.setMass(t,t.density*t.area);var i=n.centre(t.vertices);n.translate(t.vertices,i,-1),s.setInertia(t,s._inertiaScale*n.inertia(t.vertices,t.mass)),n.translate(t.vertices,t.position),h.update(t.bounds,t.vertices,t.velocity)},s.setParts=function(t,e,i){var r;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,r=0;r<e.length;r++){var a=e[r];a!==t&&(a.parent=t,t.parts.push(a))}if(1!==t.parts.length){if(i=void 0===i||i){var o=[];for(r=0;r<e.length;r++)o=o.concat(e[r].vertices);n.clockwiseSort(o);var l=n.hull(o),u=n.centre(l);s.setVertices(t,l),n.translate(t.vertices,u)}var c=s._totalProperties(t),d=c.centre.x,f=c.centre.y,p=t.bounds,g=t.centerOfMass,m=t.centerOffset;h.update(p,t.vertices,t.velocity),g.x=-(p.min.x-d)/(p.max.x-p.min.x),g.y=-(p.min.y-f)/(p.max.y-p.min.y),m.x=d,m.y=f,t.area=c.area,t.parent=t,t.position.x=d,t.position.y=f,t.positionPrev.x=d,t.positionPrev.y=f,s.setMass(t,c.mass),s.setInertia(t,c.inertia),s.setPosition(t,c.centre)}},s.setCentre=function(t,e,i){i?(t.positionPrev.x+=e.x,t.positionPrev.y+=e.y,t.position.x+=e.x,t.position.y+=e.y):(t.positionPrev.x=e.x-(t.position.x-t.positionPrev.x),t.positionPrev.y=e.y-(t.position.y-t.positionPrev.y),t.position.x=e.x,t.position.y=e.y)},s.setPosition=function(t,e,i){var s=r.sub(e,t.position);i?(t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.velocity.x=s.x,t.velocity.y=s.y,t.speed=r.magnitude(s)):(t.positionPrev.x+=s.x,t.positionPrev.y+=s.y);for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.position.x+=s.x,o.position.y+=s.y,n.translate(o.vertices,s),h.update(o.bounds,o.vertices,t.velocity)}},s.setAngle=function(t,e,i){var s=e-t.angle;i?(t.anglePrev=t.angle,t.angularVelocity=s,t.angularSpeed=Math.abs(s)):t.anglePrev+=s;for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.angle+=s,n.rotate(o.vertices,s,t.position),l.rotate(o.axes,s),h.update(o.bounds,o.vertices,t.velocity),a>0&&r.rotateAbout(o.position,s,t.position,o.position)}},s.setVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=r.magnitude(t.velocity)},s.getVelocity=function(t){var e=s._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},s.getSpeed=function(t){return r.magnitude(s.getVelocity(t))},s.setSpeed=function(t,e){s.setVelocity(t,r.mult(r.normalise(s.getVelocity(t)),e))},s.setAngularVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},s.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*s._baseDelta/t.deltaTime},s.getAngularSpeed=function(t){return Math.abs(s.getAngularVelocity(t))},s.setAngularSpeed=function(t,e){s.setAngularVelocity(t,o.sign(s.getAngularVelocity(t))*e)},s.translate=function(t,e,i){s.setPosition(t,r.add(t.position,e),i)},s.rotate=function(t,e,i,n){if(i){var r=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*r-h*a),y:i.y+(o*a+h*r)},n),s.setAngle(t,t.angle+e,n)}else s.setAngle(t,t.angle+e,n)},s.scale=function(t,e,i,r){var a=0,o=0;r=r||t.position;for(var u=t.inertia===1/0,c=0;c<t.parts.length;c++){var d=t.parts[c];d.scale.x=e,d.scale.y=i,n.scale(d.vertices,e,i,r),d.axes=l.fromVertices(d.vertices),d.area=n.area(d.vertices),s.setMass(d,t.density*d.area),n.translate(d.vertices,{x:-d.position.x,y:-d.position.y}),s.setInertia(d,s._inertiaScale*n.inertia(d.vertices,d.mass)),n.translate(d.vertices,{x:d.position.x,y:d.position.y}),c>0&&(a+=d.area,o+=d.inertia),d.position.x=r.x+(d.position.x-r.x)*e,d.position.y=r.y+(d.position.y-r.y)*i,h.update(d.bounds,d.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(s.setMass(t,t.density*a),s.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&s.setInertia(t,1/0)},s.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=s._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),c=(t.position.x-t.positionPrev.x)*a,d=(t.position.y-t.positionPrev.y)*a;t.velocity.x=c*u+t.force.x/t.mass*i,t.velocity.y=d*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f<t.parts.length;f++){var p=t.parts[f];n.translate(p.vertices,t.velocity),f>0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.updateVelocities=function(t){var e=s._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},s.applyForce=function(t,e,i){var s=e.x-t.position.x,n=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i<t.parts.length;i++){var s=t.parts[i],n=s.mass!==1/0?s.mass:1;e.mass+=n,e.area+=s.area,e.inertia+=s.inertia,e.centre=r.add(e.centre,r.mult(s.position,n))}return e.centre=r.div(e.centre,e.mass),e},s.wrap=function(t,e){var i=h.wrap(t.bounds,e);return i&&s.translate(t,i),i}}()},69351:(t,e,i)=>{var s={};t.exports=s;var n=i(35810),r=i(53402),a=i(15647),o=i(22562);s.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},wrapBounds:null,cache:{allBodies:null,allConstraints:null,allComposites:null}},t)},s.setModified=function(t,e,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var a=0;a<t.composites.length;a++){var o=t.composites[a];s.setModified(o,e,i,r)}},s.add=function(t,e){var i=[].concat(e);n.trigger(t,"beforeAdd",{object:e});for(var a=0;a<i.length;a++){var o=i[a];switch(o.type){case"body":if(o.parent!==o){r.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}s.addBody(t,o);break;case"constraint":s.addConstraint(t,o);break;case"composite":s.addComposite(t,o);break;case"mouseConstraint":s.addConstraint(t,o.constraint)}}return n.trigger(t,"afterAdd",{object:e}),t},s.remove=function(t,e,i){var r=[].concat(e);n.trigger(t,"beforeRemove",{object:e});for(var a=0;a<r.length;a++){var o=r[a];switch(o.type){case"body":s.removeBody(t,o,i);break;case"constraint":s.removeConstraint(t,o,i);break;case"composite":s.removeComposite(t,o,i);break;case"mouseConstraint":s.removeConstraint(t,o.constraint)}}return n.trigger(t,"afterRemove",{object:e}),t},s.addComposite=function(t,e){return t.composites.push(e),e.parent=t,s.setModified(t,!0,!0,!1),t},s.removeComposite=function(t,e,i){var n=r.indexOf(t.composites,e);if(-1!==n){var a=s.allBodies(e);s.removeCompositeAt(t,n);for(var o=0;o<a.length;o++)a[o].sleepCounter=0}if(i)for(o=0;o<t.composites.length;o++)s.removeComposite(t.composites[o],e,!0);return t},s.removeCompositeAt=function(t,e){return t.composites.splice(e,1),s.setModified(t,!0,!0,!1),t},s.addBody=function(t,e){return t.bodies.push(e),s.setModified(t,!0,!0,!1),t},s.removeBody=function(t,e,i){var n=r.indexOf(t.bodies,e);if(-1!==n&&(s.removeBodyAt(t,n),e.sleepCounter=0),i)for(var a=0;a<t.composites.length;a++)s.removeBody(t.composites[a],e,!0);return t},s.removeBodyAt=function(t,e){return t.bodies.splice(e,1),s.setModified(t,!0,!0,!1),t},s.addConstraint=function(t,e){return t.constraints.push(e),s.setModified(t,!0,!0,!1),t},s.removeConstraint=function(t,e,i){var n=r.indexOf(t.constraints,e);if(-1!==n&&s.removeConstraintAt(t,n),i)for(var a=0;a<t.composites.length;a++)s.removeConstraint(t.composites[a],e,!0);return t},s.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),s.setModified(t,!0,!0,!1),t},s.clear=function(t,e,i){if(i)for(var n=0;n<t.composites.length;n++)s.clear(t.composites[n],e,!0);return e?t.bodies=t.bodies.filter((function(t){return t.isStatic})):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,s.setModified(t,!0,!0,!1),t},s.allBodies=function(t){if(t.cache&&t.cache.allBodies)return t.cache.allBodies;for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(s.allBodies(t.composites[i]));return t.cache&&(t.cache.allBodies=e),e},s.allConstraints=function(t){if(t.cache&&t.cache.allConstraints)return t.cache.allConstraints;for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(s.allConstraints(t.composites[i]));return t.cache&&(t.cache.allConstraints=e),e},s.allComposites=function(t){if(t.cache&&t.cache.allComposites)return t.cache.allComposites;for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(s.allComposites(t.composites[i]));return t.cache&&(t.cache.allComposites=e),e},s.get=function(t,e,i){var n,r;switch(i){case"body":n=s.allBodies(t);break;case"constraint":n=s.allConstraints(t);break;case"composite":n=s.allComposites(t).concat(t)}return n?0===(r=n.filter((function(t){return t.id.toString()===e.toString()}))).length?null:r[0]:null},s.move=function(t,e,i){return s.remove(t,e),s.add(i,e),t},s.rebase=function(t){for(var e=s.allBodies(t).concat(s.allConstraints(t)).concat(s.allComposites(t)),i=0;i<e.length;i++)e[i].id=r.nextId();return t},s.translate=function(t,e,i){for(var n=i?s.allBodies(t):t.bodies,r=0;r<n.length;r++)o.translate(n[r],e);return t},s.rotate=function(t,e,i,n){for(var r=Math.cos(e),a=Math.sin(e),h=n?s.allBodies(t):t.bodies,l=0;l<h.length;l++){var u=h[l],c=u.position.x-i.x,d=u.position.y-i.y;o.setPosition(u,{x:i.x+(c*r-d*a),y:i.y+(c*a+d*r)}),o.rotate(u,e)}return t},s.scale=function(t,e,i,n,r){for(var a=r?s.allBodies(t):t.bodies,h=0;h<a.length;h++){var l=a[h],u=l.position.x-n.x,c=l.position.y-n.y;o.setPosition(l,{x:n.x+u*e,y:n.y+c*i}),o.scale(l,e,i)}return t},s.bounds=function(t){for(var e=s.allBodies(t),i=[],n=0;n<e.length;n+=1){var r=e[n];i.push(r.bounds.min,r.bounds.max)}return a.create(i)},s.wrap=function(t,e){var i=a.wrap(s.bounds(t),e);return i&&s.translate(t,i),i}},4372:(t,e,i)=>{var s={};t.exports=s;var n=i(69351);s.create=n.create,s.add=n.add,s.remove=n.remove,s.clear=n.clear,s.addComposite=n.addComposite,s.addBody=n.addBody,s.addConstraint=n.addConstraint},52284:(t,e,i)=>{var s={};t.exports=s;var n,r,a,o=i(41598),h=i(4506);n=[],r={overlap:0,axis:null},a={overlap:0,axis:null},s.create=function(t,e){return{pair:null,collided:!1,bodyA:t,bodyB:e,parentA:t.parent,parentB:e.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[null,null],supportCount:0}},s.collides=function(t,e,i){if(s._overlapAxes(r,t.vertices,e.vertices,t.axes),r.overlap<=0)return null;if(s._overlapAxes(a,e.vertices,t.vertices,e.axes),a.overlap<=0)return null;var n,l,u=i&&i.table[h.id(t,e)];u?n=u.collision:((n=s.create(t,e)).collided=!0,n.bodyA=t.id<e.id?t:e,n.bodyB=t.id<e.id?e:t,n.parentA=n.bodyA.parent,n.parentB=n.bodyB.parent),t=n.bodyA,e=n.bodyB,l=r.overlap<a.overlap?r:a;var c=n.normal,d=n.tangent,f=n.penetration,p=n.supports,g=l.overlap,m=l.axis,v=m.x,y=m.y;v*(e.position.x-t.position.x)+y*(e.position.y-t.position.y)>=0&&(v=-v,y=-y),c.x=v,c.y=y,d.x=-y,d.y=v,f.x=v*g,f.y=y*g,n.depth=g;var x=s._findSupports(t,e,c,1),w=0;if(o.contains(t.vertices,x[0])&&(p[w++]=x[0]),o.contains(t.vertices,x[1])&&(p[w++]=x[1]),w<2){var b=s._findSupports(e,t,c,-1);o.contains(e.vertices,b[0])&&(p[w++]=b[0]),w<2&&o.contains(e.vertices,b[1])&&(p[w++]=b[1])}return 0===w&&(p[w++]=x[0]),n.supportCount=w,n},s._overlapAxes=function(t,e,i,s){var n,r,a,o,h,l,u=e.length,c=i.length,d=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=s.length,v=Number.MAX_VALUE,y=0;for(h=0;h<m;h++){var x=s[h],w=x.x,b=x.y,T=d*w+f*b,S=p*w+g*b,E=T,A=S;for(l=1;l<u;l+=1)(o=e[l].x*w+e[l].y*b)>E?E=o:o<T&&(T=o);for(l=1;l<c;l+=1)(o=i[l].x*w+i[l].y*b)>A?A=o:o<S&&(S=o);if((n=(r=E-S)<(a=A-T)?r:a)<v&&(v=n,y=h,n<=0))break}t.axis=s[y],t.overlap=v},s._findSupports=function(t,e,i,s){var r,a,o,h=e.vertices,l=h.length,u=t.position.x,c=t.position.y,d=i.x*s,f=i.y*s,p=h[0],g=p,m=d*(u-g.x)+f*(c-g.y);for(o=1;o<l;o+=1)(a=d*(u-(g=h[o]).x)+f*(c-g.y))<m&&(m=a,p=g);return m=d*(u-(r=h[(l+p.index-1)%l]).x)+f*(c-r.y),d*(u-(g=h[(p.index+1)%l]).x)+f*(c-g.y)<m?(n[0]=p,n[1]=g,n):(n[0]=p,n[1]=r,n)}},43424:t=>{var e={};t.exports=e,e.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},81388:(t,e,i)=>{var s={};t.exports=s;var n=i(53402),r=i(52284);s.create=function(t){return n.extend({bodies:[],collisions:[],pairs:null},t)},s.setBodies=function(t,e){t.bodies=e.slice(0)},s.clear=function(t){t.bodies=[],t.collisions=[]},s.collisions=function(t){var e,i,n=t.pairs,a=t.bodies,o=a.length,h=s.canCollide,l=r.collides,u=t.collisions,c=0;for(a.sort(s._compareBoundsX),e=0;e<o;e++){var d=a[e],f=d.bounds,p=d.bounds.max.x,g=d.bounds.max.y,m=d.bounds.min.y,v=d.isStatic||d.isSleeping,y=d.parts.length,x=1===y;for(i=e+1;i<o;i++){var w=a[i];if((_=w.bounds).min.x>p)break;if(!(g<_.min.y||m>_.max.y)&&(!v||!w.isStatic&&!w.isSleeping)&&h(d.collisionFilter,w.collisionFilter)){var b=w.parts.length;if(x&&1===b)(C=l(d,w,n))&&(u[c++]=C);else for(var T=b>1?1:0,S=y>1?1:0;S<y;S++)for(var E=d.parts[S],A=(f=E.bounds,T);A<b;A++){var C,M=w.parts[A],_=M.bounds;f.min.x>_.max.x||f.max.x<_.min.x||f.max.y<_.min.y||f.min.y>_.max.y||(C=l(E,M,n))&&(u[c++]=C)}}}}return u.length!==c&&(u.length=c),u},s.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},s._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506:(t,e,i)=>{var s={};t.exports=s;var n=i(43424);s.create=function(t,e){var i=t.bodyA,r=t.bodyB,a={id:s.id(i,r),bodyA:i,bodyB:r,collision:t,contacts:[n.create(),n.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||r.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(a,t,e),a},s.update=function(t,e,i){var s=e.supports,n=e.supportCount,r=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.friction<o.friction?a.friction:o.friction,t.frictionStatic=a.frictionStatic>o.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=n,e.pair=t;var h=s[0],l=r[0],u=s[1],c=r[1];c.vertex!==h&&l.vertex!==u||(r[1]=l,r[0]=l=c,c=r[1]),l.vertex=h,c.vertex=u},s.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},s.id=function(t,e){return t.id<e.id?t.id.toString(36)+":"+e.id.toString(36):e.id.toString(36)+":"+t.id.toString(36)}},99561:(t,e,i)=>{var s={};t.exports=s;var n=i(4506),r=i(53402);s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,a,o=n.update,h=n.create,l=n.setActive,u=t.table,c=t.list,d=c.length,f=d,p=t.collisionStart,g=t.collisionEnd,m=t.collisionActive,v=e.length,y=0,x=0,w=0;for(a=0;a<v;a++)(r=(s=e[a]).pair)?(r.isActive&&(m[w++]=r),o(r,s,i)):(u[(r=h(s,i)).id]=r,p[y++]=r,c[f++]=r);for(f=0,d=c.length,a=0;a<d;a++)(r=c[a]).timeUpdated>=i?c[f++]=r:(l(r,!1,i),r.collision.bodyA.sleepCounter>0&&r.collision.bodyB.sleepCounter>0?c[f++]=r:(g[x++]=r,delete u[r.id]));c.length!==f&&(c.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==w&&(m.length=w)},s.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296:(t,e,i)=>{var s={};t.exports=s;var n=i(31725),r=i(52284),a=i(15647),o=i(66280),h=i(41598);s.collides=function(t,e){for(var i=[],s=e.length,n=t.bounds,o=r.collides,h=a.overlaps,l=0;l<s;l++){var u=e[l],c=u.parts.length,d=1===c?0:1;if(t!==u&&h(u.bounds,n))for(var f=d;f<c;f++){var p=u.parts[f];if(h(p.bounds,n)){var g=o(p,t);if(g){i.push(g);break}}}}return i},s.ray=function(t,e,i,r){r=r||1e-100;for(var a=n.angle(e,i),h=n.magnitude(n.sub(e,i)),l=.5*(i.x+e.x),u=.5*(i.y+e.y),c=o.rectangle(l,u,h,r,{angle:a}),d=s.collides(c,t),f=0;f<d.length;f+=1){var p=d[f];p.body=p.bodyB=p.bodyA}return d},s.region=function(t,e,i){for(var s=[],n=0;n<t.length;n++){var r=t[n],o=a.overlaps(r.bounds,e);(o&&!i||!o&&i)&&s.push(r)}return s},s.point=function(t,e){for(var i=[],s=0;s<t.length;s++){var n=t[s];if(a.contains(n.bounds,e))for(var r=1===n.parts.length?0:1;r<n.parts.length;r++){var o=n.parts[r];if(a.contains(o.bounds,e)&&h.contains(o.vertices,e)){i.push(n);break}}}return i}},66272:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(53402),a=i(15647);s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(t){var e,i,s,n=t.length;for(e=0;e<n;e++)(i=t[e]).isActive&&(s=i.contactCount,i.collision.parentA.totalContacts+=s,i.collision.parentB.totalContacts+=s)},s.solvePosition=function(t,e,i){var n,a,o,h,l,u,c,d,f=s._positionDampen*(i||1),p=r.clamp(e/r._baseDelta,0,1),g=t.length;for(n=0;n<g;n++)(a=t[n]).isActive&&!a.isSensor&&(h=(o=a.collision).parentA,l=o.parentB,u=o.normal,a.separation=o.depth+u.x*(l.positionImpulse.x-h.positionImpulse.x)+u.y*(l.positionImpulse.y-h.positionImpulse.y));for(n=0;n<g;n++)(a=t[n]).isActive&&!a.isSensor&&(h=(o=a.collision).parentA,l=o.parentB,u=o.normal,d=a.separation-a.slop*p,(h.isStatic||l.isStatic)&&(d*=2),h.isStatic||h.isSleeping||(c=f/h.totalContacts,h.positionImpulse.x+=u.x*d*c,h.positionImpulse.y+=u.y*d*c),l.isStatic||l.isSleeping||(c=f/l.totalContacts,l.positionImpulse.x-=u.x*d*c,l.positionImpulse.y-=u.y*d*c))},s.postSolvePosition=function(t){for(var e=s._positionWarming,i=t.length,r=n.translate,o=a.update,h=0;h<i;h++){var l=t[h],u=l.positionImpulse,c=u.x,d=u.y,f=l.velocity;if(l.totalContacts=0,0!==c||0!==d){for(var p=0;p<l.parts.length;p++){var g=l.parts[p];r(g.vertices,u),o(g.bounds,g.vertices,f),g.position.x+=c,g.position.y+=d}l.positionPrev.x+=c,l.positionPrev.y+=d,c*f.x+d*f.y<0?(u.x=0,u.y=0):(u.x*=e,u.y*=e)}}},s.preSolveVelocity=function(t){var e,i,s=t.length;for(e=0;e<s;e++){var n=t[e];if(n.isActive&&!n.isSensor){var r=n.contacts,a=n.contactCount,o=n.collision,h=o.parentA,l=o.parentB,u=o.normal,c=o.tangent;for(i=0;i<a;i++){var d=r[i],f=d.vertex,p=d.normalImpulse,g=d.tangentImpulse;if(0!==p||0!==g){var m=u.x*p+c.x*g,v=u.y*p+c.y*g;h.isStatic||h.isSleeping||(h.positionPrev.x+=m*h.inverseMass,h.positionPrev.y+=v*h.inverseMass,h.anglePrev+=h.inverseInertia*((f.x-h.position.x)*v-(f.y-h.position.y)*m)),l.isStatic||l.isSleeping||(l.positionPrev.x-=m*l.inverseMass,l.positionPrev.y-=v*l.inverseMass,l.anglePrev-=l.inverseInertia*((f.x-l.position.x)*v-(f.y-l.position.y)*m))}}}}},s.solveVelocity=function(t,e){var i,n,a,o,h=e/r._baseDelta,l=h*h*h,u=-s._restingThresh*h,c=s._restingThreshTangent,d=s._frictionNormalMultiplier*h,f=s._frictionMaxStatic,p=t.length;for(a=0;a<p;a++){var g=t[a];if(g.isActive&&!g.isSensor){var m=g.collision,v=m.parentA,y=m.parentB,x=m.normal.x,w=m.normal.y,b=m.tangent.x,T=m.tangent.y,S=g.inverseMass,E=g.friction*g.frictionStatic*d,A=g.contacts,C=g.contactCount,M=1/C,_=v.position.x-v.positionPrev.x,R=v.position.y-v.positionPrev.y,P=v.angle-v.anglePrev,L=y.position.x-y.positionPrev.x,F=y.position.y-y.positionPrev.y,O=y.angle-y.anglePrev;for(o=0;o<C;o++){var D=A[o],k=D.vertex,I=k.x-v.position.x,B=k.y-v.position.y,N=k.x-y.position.x,Y=k.y-y.position.y,X=_-B*P-(L-Y*O),U=R+I*P-(F+N*O),z=x*X+w*U,G=b*X+T*U,V=g.separation+z,W=Math.min(V,1),H=(W=V<0?0:W)*E;G<-H||G>H?(n=G>0?G:-G,(i=g.friction*(G>0?1:-1)*l)<-n?i=-n:i>n&&(i=n)):(i=G,n=f);var j=I*w-B*x,q=N*w-Y*x,K=M/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*z*K;if(i*=K,z<u)D.normalImpulse=0;else{var Q=D.normalImpulse;D.normalImpulse+=Z,D.normalImpulse>0&&(D.normalImpulse=0),Z=D.normalImpulse-Q}if(G<-c||G>c)D.tangentImpulse=0;else{var J=D.tangentImpulse;D.tangentImpulse+=i,D.tangentImpulse<-n&&(D.tangentImpulse=-n),D.tangentImpulse>n&&(D.tangentImpulse=n),i=D.tangentImpulse-J}var $=x*Z+b*i,tt=w*Z+T*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(I*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(N*tt-Y*$)*y.inverseInertia)}}}}},48140:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},s.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var i=t[e],s=i.constraintImpulse;i.isStatic||0===s.x&&0===s.y&&0===s.angle||(i.position.x+=s.x,i.position.y+=s.y,i.angle+=s.angle)}},s.solveAll=function(t,e){for(var i=l.clamp(e/l._baseDelta,0,1),n=0;n<t.length;n+=1){var r=t[n],a=!r.bodyA||r.bodyA&&r.bodyA.isStatic,o=!r.bodyB||r.bodyB&&r.bodyB.isStatic;(a||o)&&s.solve(t[n],i)}for(n=0;n<t.length;n+=1)a=!(r=t[n]).bodyA||r.bodyA&&r.bodyA.isStatic,o=!r.bodyB||r.bodyB&&r.bodyB.isStatic,a||o||s.solve(t[n],i)},s.solve=function(t,e){var i=t.bodyA,n=t.bodyB,a=t.pointA,o=t.pointB;if(i||n){i&&!i.isStatic&&(r.rotate(a,i.angle-t.angleA,a),t.angleA=i.angle),n&&!n.isStatic&&(r.rotate(o,n.angle-t.angleB,o),t.angleB=n.angle);var h=a,l=o;if(i&&(h=r.add(i.position,a)),n&&(l=r.add(n.position,o)),h&&l){var u=r.sub(h,l),c=r.magnitude(u);c<s._minLength&&(c=s._minLength);var d,f,p,g,m,v=(c-t.length)/c,y=t.stiffness>=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,w=r.mult(u,v*y),b=(i?i.inverseMass:0)+(n?n.inverseMass:0),T=b+((i?i.inverseInertia:0)+(n?n.inverseInertia:0));if(x>0){var S=r.create();p=r.div(u,c),m=r.sub(n&&r.sub(n.position,n.positionPrev)||S,i&&r.sub(i.position,i.positionPrev)||S),g=r.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/b,i.constraintImpulse.x-=w.x*f,i.constraintImpulse.y-=w.y*f,i.position.x-=w.x*f,i.position.y-=w.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),d=r.cross(a,w)/T*s._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),n&&!n.isStatic&&(f=n.inverseMass/b,n.constraintImpulse.x+=w.x*f,n.constraintImpulse.y+=w.y*f,n.position.x+=w.x*f,n.position.y+=w.y*f,x>0&&(n.positionPrev.x+=x*p.x*g*f,n.positionPrev.y+=x*p.y*g*f),d=r.cross(o,w)/T*s._torqueDampen*n.inverseInertia*(1-t.angularStiffness),n.constraintImpulse.angle+=d,n.angle+=d)}}},s.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],l=i.constraintImpulse;if(!(i.isStatic||0===l.x&&0===l.y&&0===l.angle)){a.set(i,!1);for(var u=0;u<i.parts.length;u++){var c=i.parts[u];n.translate(c.vertices,l),u>0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),o.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},s.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),s=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),n=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(s*s+n*n)}},53402:(t,e,i)=>{var s={};t.exports=s,function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,n;"boolean"==typeof e?(i=2,n=e):(i=1,n=!0);for(var r=i;r<arguments.length;r++){var a=arguments[r];if(a)for(var o in a)n&&a[o]&&a[o].constructor===Object?t[o]&&t[o].constructor!==Object?t[o]=a[o]:(t[o]=t[o]||{},s.extend(t[o],n,a[o])):t[o]=a[o]}return t},s.clone=function(t,e){return s.extend({},e,t)},s.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},s.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),s=0;s<i.length;s++)e.push(t[i[s]]);return e}for(var n in t)e.push(t[n]);return e},s.get=function(t,e,i,s){e=e.split(".").slice(i,s);for(var n=0;n<e.length;n+=1)t=t[e[n]];return t},s.set=function(t,e,i,n,r){var a=e.split(".").slice(n,r);return s.get(t,e,0,-1)[a[a.length-1]]=i,i},s.shuffle=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(s.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return t<e?e:t>i?i:t},s.sign=function(t){return t<0?-1:1},s.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 Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain((function(){s.warnOnce("🔅 deprecated 🔅",i)}),t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},s.map=function(t,e){if(t.map)return t.map(e);for(var i=[],s=0;s<t.length;s+=1)i.push(e(t[s]));return i},s.topologicalSort=function(t){var e=[],i=[],n=[];for(var r in t)i[r]||n[r]||s._topologicalSort(r,i,n,t,e);return e},s._topologicalSort=function(t,e,i,n,r){var a=n[t]||[];i[t]=!0;for(var o=0;o<a.length;o+=1){var h=a[o];i[h]||e[h]||s._topologicalSort(h,e,i,n,r)}i[t]=!1,e[t]=!0,r.push(t)},s.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var i=arguments[e];i._chained?t.push.apply(t,i._chained):t.push(i)}var s=function(){for(var e,i=new Array(arguments.length),s=0,n=arguments.length;s<n;s++)i[s]=arguments[s];for(s=0;s<t.length;s+=1){var r=t[s].apply(e,i);void 0!==r&&(e=r)}return e};return s._chained=t,s},s.chainPathBefore=function(t,e,i){return s.set(t,e,s.chain(i,s.get(t,e)))},s.chainPathAfter=function(t,e,i){return s.set(t,e,s.chain(s.get(t,e),i))},s.setDecomp=function(t){s._decomp=t},s.getDecomp=function(){var t=s._decomp;try{t||"undefined"==typeof window||(t=window.decomp),t||void 0===i.g||(t=i.g.decomp)}catch(e){t=null}return t}}()},48413:(t,e,i)=>{var s={};t.exports=s;var n=i(53614),r=i(66272),a=i(81388),o=i(99561),h=i(35810),l=i(69351),u=i(48140),c=i(53402),d=i(22562);s._deltaMax=1e3/60,s.create=function(t){t=t||{};var e=c.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0,lastUpdatesPerFrame:0}},t);return e.world=t.world||l.create({label:"World"}),e.pairs=t.pairs||o.create(),e.detector=t.detector||a.create(),e.detector.pairs=e.pairs,e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},s.update=function(t,e){var i,d=c.now(),f=t.world,p=t.detector,g=t.pairs,m=t.timing,v=m.timestamp;e>s._deltaMax&&c.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",s._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:c._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),w=l.allConstraints(f),b=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&n.update(x,e),s._bodiesApplyGravity(x,t.gravity),s.wrap(x,b),s.attractors(x),e>0&&s._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i<t.constraintIterations;i++)u.solveAll(w,e);u.postSolveAll(x);var T=a.collisions(p);o.update(g,T,v),t.enableSleeping&&n.afterCollisions(g.list),g.collisionStart.length>0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=c.clamp(20/t.positionIterations,0,1);for(r.preSolvePosition(g.list),i=0;i<t.positionIterations;i++)r.solvePosition(g.list,e,S);for(r.postSolvePosition(x),u.preSolveAll(x),i=0;i<t.constraintIterations;i++)u.solveAll(w,e);for(u.postSolveAll(x),r.preSolveVelocity(g.list),i=0;i<t.velocityIterations;i++)r.solveVelocity(g.list,e);return s._bodiesUpdateVelocities(x),g.collisionActive.length>0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:m.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:m.timestamp,delta:e}),s._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=c.now()-d,t},s.merge=function(t,e){if(c.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=l.allBodies(t.world),r=0;r<i.length;r++){var a=i[r];n.set(a,!1),a.id=c.nextId()}}},s.clear=function(t){o.clear(t.pairs),a.clear(t.detector)},s._bodiesClearForces=function(t){for(var e=t.length,i=0;i<e;i++){var s=t[i];s.force.x=0,s.force.y=0,s.torque=0}},s._bodiesApplyGravity=function(t,e){var i=void 0!==e.scale?e.scale:.001,s=t.length;if((0!==e.x||0!==e.y)&&0!==i)for(var n=0;n<s;n++){var r=t[n];r.ignoreGravity||r.isStatic||r.isSleeping||(r.force.y+=r.mass*e.y*i,r.force.x+=r.mass*e.x*i)}},s._bodiesUpdate=function(t,e){for(var i=t.length,s=0;s<i;s++){var n=t[s];n.isStatic||n.isSleeping||d.update(n,e)}},s._bodiesUpdateVelocities=function(t){for(var e=t.length,i=0;i<e;i++)d.updateVelocities(t[i])},s.wrap=function(t,e){for(var i=0;i<t.length;i+=1){var s=t[i];null!==s.wrapBounds&&d.wrap(s,s.wrapBounds)}for(i=0;i<e.length;i+=1){var n=e[i];null!==n.wrapBounds&&l.wrap(n,n.wrapBounds)}},s.attractors=function(t){for(var e=0;e<t.length;e++){var i=t[e],s=i.attractors;if(s&&s.length>0)for(var n=0;n<t.length;n++){var r=t[n];if(e!==n)for(var a=0;a<s.length;a++){var o=s[a],h=o;c.isFunction(o)&&(h=o(i,r)),h&&d.applyForce(r,r.position,h)}}}}},35810:(t,e,i)=>{var s={};t.exports=s;var n=i(53402);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r<n.length;r++)s=n[r],t.events=t.events||{},t.events[s]=t.events[s]||[],t.events[s].push(i);return i},s.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=n.keys(t.events).join(" "));for(var s=e.split(" "),r=0;r<s.length;r++){var a=t.events[s[r]],o=[];if(i&&a)for(var h=0;h<a.length;h++)a[h]!==i&&o.push(a[h]);t.events[s[r]]=o}}else t.events={}},s.trigger=function(t,e,i){var s,r,a,o,h=t.events;if(h&&n.keys(h).length>0){i||(i={}),s=e.split(" ");for(var l=0;l<s.length;l++)if(a=h[r=s[l]]){(o=n.clone(i,!1)).name=r,o.source=t;for(var u=0;u<a.length;u++)a[u].apply(t,[o])}}}},6790:(t,e,i)=>{var s={};t.exports=s;var n=i(73832),r=i(53402);s.name="matter-js",s.version="0.20.0",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},73832:(t,e,i)=>{var s={};t.exports=s;var n=i(53402);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i<r?n.warn("Plugin.register:",s.toString(e),"can not be downgraded to",s.toString(t)):t!==e&&n.warn("Plugin.register:",s.toString(t),"is already registered to different plugin object")}else s._registry[t.name]=t;return t},s.resolve=function(t){return s._registry[s.dependencyParse(t).name]},s.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},s.isPlugin=function(t){return t&&t.name&&t.version&&t.install},s.isUsed=function(t,e){return t.used.indexOf(e)>-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),a=[],o=0;o<r.length;o+=1)if(r[o]!==t.name){var h=s.resolve(r[o]);h?s.isUsed(t,h.name)||(s.isFor(h,t)||(n.warn("Plugin.use:",s.toString(h),"is for",h.for,"but installed on",s.toString(t)+"."),h._warned=!0),h.install?h.install(t):(n.warn("Plugin.use:",s.toString(h),"does not specify an install function."),h._warned=!0),h._warned?(a.push("🔶 "+s.toString(h)),delete h._warned):a.push("✅ "+s.toString(h)),t.used.push(h.name)):a.push("❌ "+r[o])}a.length>0&&!h.silent&&n.info(a.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),a=s.resolve(e);return a&&!s.versionSatisfies(a.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(a),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),a._warned=!0,t._warned=!0):a||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var a=0;a<e[r].length;a+=1)s.dependencies(e[r][a],e);return e}},s.dependencyParse=function(t){return n.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/.test(t)||n.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},s.versionParse=function(t){var e=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||n.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),s=Number(i[4]),r=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:s,minor:r,patch:a,parts:[s,r,a],prerelease:i[7],number:1e8*s+1e4*r+a}},s.versionSatisfies=function(t,e){e=e||"*";var i=s.versionParse(e),n=s.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return n.number>i.number;if(">="===i.operator)return n.number>=i.number;if("~"===i.operator)return n.major===i.major&&n.minor===i.minor&&n.patch>=i.patch;if("^"===i.operator)return i.major>0?n.major===i.major&&n.number>=i.number:i.minor>0?n.minor===i.minor&&n.patch>=i.patch:n.patch===i.patch}return t===e||"*"===t}},13037:(t,e,i)=>{var s={};t.exports=s;var n=i(35810),r=i(48413),a=i(53402);!function(){s._maxFrameDelta=1e3/15,s._frameDeltaFallback=1e3/60,s._timeBufferMargin=1.5,s._elapsedNextEstimate=1,s._smoothingLowerBound=.1,s._smoothingUpperBound=.9,s.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},s.run=function(t,e){return t.timeBuffer=s._frameDeltaFallback,function i(n){t.frameRequestId=s._onNextFrame(t,i),n&&t.enabled&&s.tick(t,e,n)}(),t},s.tick=function(e,i,o){var h=a.now(),l=e.delta,u=0,c=o-e.timeLastTick;if((!c||!e.timeLastTick||c>Math.max(s._maxFrameDelta,e.maxFrameTime))&&(c=e.frameDelta||s._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(c),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var d=e.frameDeltaHistory.slice(0).sort(),f=e.frameDeltaHistory.slice(d.length*s._smoothingLowerBound,d.length*s._smoothingUpperBound);c=t(f)||c}e.frameDeltaSnapping&&(c=1e3/Math.round(1e3/c)),e.frameDelta=c,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+l*s._timeBufferMargin),e.lastUpdatesDeferred=0;var p=e.maxUpdates||Math.ceil(e.maxFrameTime/l),g={timestamp:i.timing.timestamp};n.trigger(e,"beforeTick",g),n.trigger(e,"tick",g);for(var m=a.now();l>0&&e.timeBuffer>=l*s._timeBufferMargin;){n.trigger(e,"beforeUpdate",g),r.update(i,l),n.trigger(e,"afterUpdate",g),e.timeBuffer-=l,u+=1;var v=a.now()-h,y=a.now()-m,x=v+s._elapsedNextEstimate*y/u;if(u>=p||x>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/l-s._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,n.trigger(e,"afterTick",g),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/l)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},s.stop=function(t){s._cancelNextFrame(t)},s._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},s._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,i=t.length,s=0;s<i;s+=1)e+=t[s];return e/i||0};s._mean=t}()},53614:(t,e,i)=>{var s={};t.exports=s;var n=i(22562),r=i(35810),a=i(53402);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e/a._baseDelta,r=s._motionSleepThreshold,o=0;o<t.length;o++){var h=t[o],l=n.getSpeed(h),u=n.getAngularSpeed(h),c=l*l+u*u;if(0===h.force.x&&0===h.force.y){var d=Math.min(h.motion,c),f=Math.max(h.motion,c);h.motion=s._minBias*d+(1-s._minBias)*f,h.sleepThreshold>0&&h.motion<r?(h.sleepCounter+=1,h.sleepCounter>=h.sleepThreshold/i&&s.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else s.set(h,!1)}},s.afterCollisions=function(t){for(var e=s._motionSleepThreshold,i=0;i<t.length;i++){var n=t[i];if(n.isActive){var r=n.collision,a=r.bodyA.parent,o=r.bodyB.parent;if(!(a.isSleeping&&o.isSleeping||a.isStatic||o.isStatic)&&(a.isSleeping||o.isSleeping)){var h=a.isSleeping&&!a.isStatic?a:o,l=h===a?o:a;!h.isStatic&&l.motion>e&&s.set(h,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||r.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&r.trigger(t,"sleepEnd"))}},66280:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(53402),a=i(22562),o=i(15647),h=i(31725);s.rectangle=function(t,e,i,s,o){o=o||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(o.chamfer){var l=o.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete o.chamfer}return a.create(r.extend({},h,o))},s.trapezoid=function(t,e,i,s,o,h){h=h||{},o>=1&&r.warn("Bodies.trapezoid: slope parameter must be < 1.");var l,u=i*(o*=.5),c=u+(1-2*o)*i,d=c+u;l=o<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=n.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return a.create(r.extend({},f,h))},s.circle=function(t,e,i,n,a){n=n||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var h=Math.ceil(Math.max(10,Math.min(a,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},o,n))},s.polygon=function(t,e,i,o,h){if(h=h||{},i<3)return s.circle(t,e,o,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d<i;d+=1){var f=c+d*l,p=Math.cos(f)*o,g=Math.sin(f)*o;u+="L "+p.toFixed(3)+" "+g.toFixed(3)+" "}var m={label:"Polygon Body",position:{x:t,y:e},vertices:n.fromPath(u)};if(h.chamfer){var v=h.chamfer;m.vertices=n.chamfer(m.vertices,v.radius,v.quality,v.qualityMin,v.qualityMax),delete h.chamfer}return a.create(r.extend({},m,h))},s.fromVertices=function(t,e,i,s,l,u,c,d){var f,p,g,m,v,y,x,w,b,T,S=r.getDecomp();for(f=Boolean(S&&S.quickDecomp),s=s||{},g=[],l=void 0!==l&&l,u=void 0!==u?u:.01,c=void 0!==c?c:10,d=void 0!==d?d:.01,r.isArray(i[0])||(i=[i]),b=0;b<i.length;b+=1)if(v=i[b],!(m=n.isConvex(v))&&!f&&r.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),m||!f)v=m?n.clockwiseSort(v):n.hull(v),g.push({position:{x:t,y:e},vertices:v});else{var E=v.map((function(t){return[t.x,t.y]}));S.makeCCW(E),!1!==u&&S.removeCollinearPoints(E,u),!1!==d&&S.removeDuplicatePoints&&S.removeDuplicatePoints(E,d);var A=S.quickDecomp(E);for(y=0;y<A.length;y++){var C=A[y].map((function(t){return{x:t[0],y:t[1]}}));c>0&&n.area(C)<c||g.push({position:n.centre(C),vertices:C})}}for(y=0;y<g.length;y++)g[y]=a.create(r.extend(g[y],s));if(l)for(y=0;y<g.length;y++){var M=g[y];for(x=y+1;x<g.length;x++){var _=g[x];if(o.overlaps(M.bounds,_.bounds)){var R=M.vertices,P=_.vertices;for(w=0;w<M.vertices.length;w++)for(T=0;T<_.vertices.length;T++){var L=h.magnitudeSquared(h.sub(R[(w+1)%R.length],P[T])),F=h.magnitudeSquared(h.sub(R[w],P[(T+1)%P.length]));L<5&&F<5&&(R[w].isInternal=!0,P[T].isInternal=!0)}}}}return g.length>1?(p=a.create(r.extend({parts:g.slice(0)},s)),a.setPosition(p,{x:t,y:e}),p):g[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i<t.length;i++)for(var s=t[i],n=i+1;n<t.length;n++){var r=t[n];if(o.overlaps(s.bounds,r.bounds))for(var a=s.vertices,l=r.vertices,u=0;u<s.vertices.length;u++)for(var c=0;c<r.vertices.length;c++){var d=h.magnitudeSquared(h.sub(a[(u+1)%a.length],l[c])),f=h.magnitudeSquared(h.sub(a[u],l[(c+1)%l.length]));d<e&&f<e&&(a[u].isInternal=!0,l[c].isInternal=!0)}}return t}},74116:(t,e,i)=>{var s={};t.exports=s;var n=i(69351),r=i(48140),a=i(53402),o=i(22562),h=i(66280);s.stack=function(t,e,i,s,r,a,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,f=0,p=0;p<s;p++){for(var g=0,m=0;m<i;m++){var v=h(c,d,m,p,l,f);if(v){var y=v.bounds.max.y-v.bounds.min.y,x=v.bounds.max.x-v.bounds.min.x;y>g&&(g=y),o.translate(v,{x:.5*x,y:.5*y}),c=v.bounds.max.x+r,n.addBody(u,v),l=v,f+=1}else c+=r}d+=g+a,c=t}return u},s.chain=function(t,e,i,s,o,h){for(var l=t.bodies,u=1;u<l.length;u++){var c=l[u-1],d=l[u],f=c.bounds.max.y-c.bounds.min.y,p=c.bounds.max.x-c.bounds.min.x,g=d.bounds.max.y-d.bounds.min.y,m={bodyA:c,pointA:{x:p*e,y:f*i},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*s,y:g*o}},v=a.extend(m,h);n.addConstraint(t,r.create(v))}return t.label+=" Chain",t},s.mesh=function(t,e,i,s,o){var h,l,u,c,d,f=t.bodies;for(h=0;h<i;h++){for(l=1;l<e;l++)u=f[l-1+h*e],c=f[l+h*e],n.addConstraint(t,r.create(a.extend({bodyA:u,bodyB:c},o)));if(h>0)for(l=0;l<e;l++)u=f[l+(h-1)*e],c=f[l+h*e],n.addConstraint(t,r.create(a.extend({bodyA:u,bodyB:c},o))),s&&l>0&&(d=f[l-1+(h-1)*e],n.addConstraint(t,r.create(a.extend({bodyA:d,bodyB:c},o)))),s&&l<e-1&&(d=f[l+1+(h-1)*e],n.addConstraint(t,r.create(a.extend({bodyA:d,bodyB:c},o))))}return t.label+=" Mesh",t},s.pyramid=function(t,e,i,n,r,a,h){return s.stack(t,e,i,n,r,a,(function(e,s,a,l,u,c){var d=Math.min(n,Math.ceil(i/2)),f=u?u.bounds.max.x-u.bounds.min.x:0;if(!(l>d||a<(l=d-l)||a>i-1-l))return 1===c&&o.translate(u,{x:(a+(i%2==1?1:-1))*f,y:0}),h(t+(u?a*f:0)+a*r,s,a,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,a){for(var o=n.create({label:"Newtons Cradle"}),l=0;l<i;l++){var u=h.circle(t+l*(1.9*s),e+a,s,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),c=r.create({pointA:{x:t+l*(1.9*s),y:e},bodyB:u});n.addBody(o,u),n.addConstraint(o,c)}return o},s.car=function(t,e,i,s,a){var l=o.nextGroup(!0),u=.5*-i+20,c=.5*i-20,d=n.create({label:"Car"}),f=h.rectangle(t,e,i,s,{collisionFilter:{group:l},chamfer:{radius:.5*s},density:2e-4}),p=h.circle(t+u,e+0,a,{collisionFilter:{group:l},friction:.8}),g=h.circle(t+c,e+0,a,{collisionFilter:{group:l},friction:.8}),m=r.create({bodyB:f,pointB:{x:u,y:0},bodyA:p,stiffness:1,length:0}),v=r.create({bodyB:f,pointB:{x:c,y:0},bodyA:g,stiffness:1,length:0});return n.addBody(d,f),n.addBody(d,p),n.addBody(d,g),n.addConstraint(d,m),n.addConstraint(d,v),d},s.softBody=function(t,e,i,n,r,o,l,u,c,d){c=a.extend({inertia:1/0},c),d=a.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var f=s.stack(t,e,i,n,r,o,(function(t,e){return h.circle(t,e,u,c)}));return s.mesh(f,i,n,l,d),f.label="Soft Body",f}},66615:(t,e,i)=>{var s={};t.exports=s;var n=i(31725),r=i(53402);s.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var s=(i+1)%t.length,a=n.normalise({x:t[s].y-t[i].y,y:t[i].x-t[s].x}),o=0===a.y?1/0:a.x/a.y;e[o=o.toFixed(3).toString()]=a}return r.values(e)},s.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),s=Math.sin(e),n=0;n<t.length;n++){var r,a=t[n];r=a.x*i-a.y*s,a.y=a.x*s+a.y*i,a.x=r}}},15647:t=>{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;s<e.length;s++){var n=e[s];n.x>t.max.x&&(t.max.x=n.x),n.x<t.min.x&&(t.min.x=n.x),n.y>t.max.y&&(t.max.y=n.y),n.y<t.min.y&&(t.min.y=n.y)}i&&(i.x>0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s},e.wrap=function(t,e,i){var s=null,n=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?s=e.min.x-t.max.x:t.max.x<e.min.x&&(s=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?n=e.min.y-t.max.y:t.max.y<e.min.y&&(n=e.max.y-t.min.y)),null!==s||null!==n)return{x:s||0,y:n||0}}},74058:(t,e,i)=>{var s={};t.exports=s,i(15647);var n=i(53402);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,a,o,h,l,u,c,d,f,p,g=[],m=0,v=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(f=d.x,p=d.y):(f=0,p=0);var n={x:f+t,y:p+e};!s&&d||(d=n),g.push(n),v=f+t,y=p+e}},w=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),a=t.getTotalLength(),l=[],i=0;i<t.pathSegList.numberOfItems;i+=1)l.push(t.pathSegList.getItem(i));for(u=l.concat();m<a;){if((h=l[t.getPathSegAtLength(m)])!=c){for(;u.length&&u[0]!=h;)w(u.shift());c=h}switch(h.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":o=t.getPointAtLength(m),x(o.x,o.y,0)}m+=e}for(i=0,r=u.length;i<r;++i)w(u[i]);return g},s._svgPathToAbsolute=function(t){for(var e,i,s,n,r,a,o=t.pathSegList,h=0,l=0,u=o.numberOfItems,c=0;c<u;++c){var d=o.getItem(c),f=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(f))"x"in d&&(h=d.x),"y"in d&&(l=d.y);else switch("x1"in d&&(s=h+d.x1),"x2"in d&&(r=h+d.x2),"y1"in d&&(n=l+d.y1),"y2"in d&&(a=l+d.y2),"x"in d&&(h+=d.x),"y"in d&&(l+=d.y),f){case"m":o.replaceItem(t.createSVGPathSegMovetoAbs(h,l),c);break;case"l":o.replaceItem(t.createSVGPathSegLinetoAbs(h,l),c);break;case"h":o.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),c);break;case"v":o.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),c);break;case"c":o.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,s,n,r,a),c);break;case"s":o.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,r,a),c);break;case"q":o.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,s,n),c);break;case"t":o.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),c);break;case"a":o.replaceItem(t.createSVGPathSegArcAbs(h,l,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),c);break;case"z":case"Z":h=e,l=i}"M"!=f&&"m"!=f||(e=h,i=l)}}},31725:t=>{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var a=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=a,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},41598:(t,e,i)=>{var s={};t.exports=s;var n=i(31725),r=i(53402);s.create=function(t,e){for(var i=[],s=0;s<t.length;s++){var n=t[s],r={x:n.x,y:n.y,index:s,body:e,isInternal:!1};i.push(r)}return i},s.fromPath=function(t,e){var i=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,(function(t,e,s){i.push({x:parseFloat(e),y:parseFloat(s)})})),s.create(i,e)},s.centre=function(t){for(var e,i,r,a=s.area(t,!0),o={x:0,y:0},h=0;h<t.length;h++)r=(h+1)%t.length,e=n.cross(t[h],t[r]),i=n.mult(n.add(t[h],t[r]),e),o=n.add(o,i);return n.div(o,6*a)},s.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return n.div(e,t.length)},s.area=function(t,e){for(var i=0,s=t.length-1,n=0;n<t.length;n++)i+=(t[s].x-t[n].x)*(t[s].y+t[n].y),s=n;return e?i/2:Math.abs(i)/2},s.inertia=function(t,e){for(var i,s,r=0,a=0,o=t,h=0;h<o.length;h++)s=(h+1)%o.length,r+=(i=Math.abs(n.cross(o[s],o[h])))*(n.dot(o[s],o[s])+n.dot(o[s],o[h])+n.dot(o[h],o[h])),a+=i;return e/6*(r/a)},s.translate=function(t,e,i){i=void 0!==i?i:1;var s,n=t.length,r=e.x*i,a=e.y*i;for(s=0;s<n;s++)t[s].x+=r,t[s].y+=a;return t},s.rotate=function(t,e,i){if(0!==e){var s,n,r,a,o=Math.cos(e),h=Math.sin(e),l=i.x,u=i.y,c=t.length;for(a=0;a<c;a++)n=(s=t[a]).x-l,r=s.y-u,s.x=l+(n*o-r*h),s.y=u+(n*h+r*o);return t}},s.contains=function(t,e){for(var i,s=e.x,n=e.y,r=t.length,a=t[r-1],o=0;o<r;o++){if(i=t[o],(s-a.x)*(i.y-a.y)+(n-a.y)*(a.x-i.x)>0)return!1;a=i}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var a,o;r=r||s.centre(t);for(var h=0;h<t.length;h++)a=t[h],o=n.sub(a,r),t[h].x=r.x+o.x*e,t[h].y=r.y+o.y*i;return t},s.chamfer=function(t,e,i,s,a){e="number"==typeof e?[e]:e||[8],i=void 0!==i?i:-1,s=s||2,a=a||14;for(var o=[],h=0;h<t.length;h++){var l=t[h-1>=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h<e.length?h:e.length-1];if(0!==d){var f=n.normalise({x:u.y-l.y,y:l.x-u.x}),p=n.normalise({x:c.y-u.y,y:u.x-c.x}),g=Math.sqrt(2*Math.pow(d,2)),m=n.mult(r.clone(f),d),v=n.normalise(n.mult(n.add(f,p),.5)),y=n.sub(u,n.mult(v,g)),x=i;-1===i&&(x=1.75*Math.pow(d,.32)),(x=r.clamp(x,s,a))%2==1&&(x+=1);for(var w=Math.acos(n.dot(f,p))/x,b=0;b<x;b++)o.push(n.add(n.rotate(m,w*b),y))}else o.push(u)}return o},s.clockwiseSort=function(t){var e=s.mean(t);return t.sort((function(t,i){return n.angle(e,t)-n.angle(e,i)})),t},s.isConvex=function(t){var e,i,s,n,r=0,a=t.length;if(a<3)return null;for(e=0;e<a;e++)if(s=(e+2)%a,n=(t[i=(e+1)%a].x-t[e].x)*(t[s].y-t[i].y),(n-=(t[i].y-t[e].y)*(t[s].x-t[i].x))<0?r|=1:n>0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i<t.length;i+=1){for(e=t[i];r.length>=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},55973:t=>{function e(t,e,i){i=i||0;var s,n,r,a,o,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],a=e[1][1]-e[0][1],o=e[0][0]-e[1][0],h=a*e[0][0]+o*e[0][1],S(l=s*o-a*n,0,i)||(u[0]=(o*r-n*h)/l,u[1]=(s*h-a*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],a=s[0]-i[0],o=s[1]-i[1];if(a*r-o*n===0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(a*r-o*n),l=(a*(t[1]-i[1])+o*(i[0]-t[0]))/(o*n-a*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function o(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=w(t);return e.length>0?b(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var m=[0,0],v=[0,0],x=[0,0],w=0,b=0,S=0,E=0,A=0,C=0,M=0,_=[],R=[],P=e,L=e;if(L.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var F=0;F<e.length;++F)if(p(P,F)){s.push(P[F]),w=b=Number.MAX_VALUE;for(var O=0;O<e.length;++O)n(d(P,F-1),d(P,F),d(P,O))&&o(d(P,F-1),d(P,F),d(P,O-1))&&(x=T(d(P,F-1),d(P,F),d(P,O),d(P,O-1)),a(d(P,F+1),d(P,F),x)&&(S=c(P[F],x))<b&&(b=S,v=x,C=O)),n(d(P,F+1),d(P,F),d(P,O+1))&&o(d(P,F+1),d(P,F),d(P,O))&&(x=T(d(P,F+1),d(P,F),d(P,O),d(P,O+1)),n(d(P,F-1),d(P,F),x)&&(S=c(P[F],x))<w&&(w=S,m=x,A=O));if(C===(A+1)%e.length)x[0]=(v[0]+m[0])/2,x[1]=(v[1]+m[1])/2,h.push(x),F<A?(f(_,P,F,A+1),_.push(x),R.push(x),0!==C&&f(R,P,C,P.length),f(R,P,0,F+1)):(0!==F&&f(_,P,F,P.length),f(_,P,0,A+1),_.push(x),R.push(x),f(R,P,C,F+1));else{if(C>A&&(A+=e.length),E=Number.MAX_VALUE,A<C)return i;for(O=C;O<=A;++O)r(d(P,F-1),d(P,F),d(P,O))&&o(d(P,F+1),d(P,F),d(P,O))&&(S=c(d(P,F),d(P,O)))<E&&y(P,F,O)&&(E=S,M=O%e.length);F<M?(f(_,P,F,M+1),0!==M&&f(R,P,M,L.length),f(R,P,0,F+1)):(0!==F&&f(_,P,F,L.length),f(_,P,0,M+1),f(R,P,M,F+1))}return _.length<R.length?(t(_,i,s,h,l,u,g),t(R,i,s,h,l,u,g)):(t(R,i,s,h,l,u,g),t(_,i,s,h,l,u,g)),i}return i.push(e),i},isSimple:function(t){var e,s=t;for(e=0;e<s.length-1;e++)for(var n=0;n<e-1;n++)if(i(s[e],s[e+1],s[n],s[n+1]))return!1;for(e=1;e<s.length-2;e++)if(i(s[0],s[s.length-1],s[e],s[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,s=t.length-1;t.length>3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)E(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;s<t.length;++s)(i[s][1]<i[e][1]||i[s][1]===i[e][1]&&i[s][0]>i[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,a=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],a[0]=i[0]-e[0],a[1]=i[1]-e[1];var o=r[0]*a[0]+r[1]*a[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*c))<n}return 0===s(t,e,i)}function c(t,e){var i=e[0]-t[0],s=e[1]-t[1];return i*i+s*s}function d(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function f(t,e,i,s){for(var n=i;n<s;n++)t.push(e[n])}function p(t,e){return a(d(t,e-1),d(t,e),d(t,e+1))}var g=[],m=[];function v(t,i,s){var n,a,h=g,l=m;if(r(d(t,i+1),d(t,i),d(t,s))&&o(d(t,i-1),d(t,i),d(t,s)))return!1;a=c(d(t,i),d(t,s));for(var u=0;u!==t.length;++u)if((u+1)%t.length!==i&&u!==i&&r(d(t,i),d(t,s),d(t,u+1))&&o(d(t,i),d(t,s),d(t,u))&&(h[0]=d(t,i),h[1]=d(t,s),l[0]=d(t,u),l[1]=d(t,u+1),n=e(h,l),c(d(t,i),n)<a))return!1;return!0}function y(t,e,s){for(var n=0;n!==t.length;++n)if(n!==e&&n!==s&&(n+1)%t.length!==e&&(n+1)%t.length!==s&&i(d(t,e),d(t,s),d(t,n),d(t,n+1)))return!1;return!0}function x(t,e,i,s){var n=s||[];if(function(t){t.length=0}(n),e<i)for(var r=e;r<=i;r++)n.push(t[r]);else{for(r=0;r<=i;r++)n.push(t[r]);for(r=e;r<t.length;r++)n.push(t[r])}return n}function w(t){for(var e=[],i=[],s=[],n=[],r=Number.MAX_VALUE,a=0;a<t.length;++a)if(p(t,a))for(var o=0;o<t.length;++o)if(v(t,a,o)){i=w(x(t,a,o,n)),s=w(x(t,o,a,n));for(var h=0;h<s.length;h++)i.push(s[h]);i.length<r&&(e=i,r=i.length,e.push([d(t,a),d(t,o)]))}return e}function b(t,e){if(0===e.length)return[t];if(e instanceof Array&&e.length&&e[0]instanceof Array&&2===e[0].length&&e[0][0]instanceof Array){for(var i=[t],s=0;s<e.length;s++)for(var n=e[s],r=0;r<i.length;r++){var a=b(i[r],n);if(a){i.splice(r,1),i.push(a[0],a[1]);break}}return i}return n=e,s=t.indexOf(n[0]),r=t.indexOf(n[1]),-1!==s&&-1!==r&&[x(t,s,r),x(t,r,s)]}function T(t,e,i,s,n){n=n||0;var r=e[1]-t[1],a=t[0]-e[0],o=r*t[0]+a*t[1],h=s[1]-i[1],l=i[0]-s[0],u=h*i[0]+l*i[1],c=r*l-h*a;return S(c,0,n)?[0,0]:[(l*o-a*u)/c,(r*u-h*o)/c]}function S(t,e,i){return i=i||0,Math.abs(t-e)<=i}function E(t,e,i){return S(t[0],e[0],i)&&S(t[1],e[1],i)}},52018:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},42363:t=>{t.exports={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"]}},37277:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},77332:(t,e,i)=>{var s=i(83419),n=i(8443),r=i(50792),a=i(74099),o=i(44603),h=i(39429),l=i(95540),u=i(37277),c=i(72905),d=i(8054),f=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted||t.config.renderType===d.HEADLESS?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,a,o,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t<u.length;t++)e=u[t],i=l(e,"key",null),s=l(e,"plugin",null),r=l(e,"start",!1),a=l(e,"mapping",null),o=l(e,"data",null),i&&(s?this.install(i,s,r,a,o):console.warn("Missing `plugin` for key: "+i));for(u=(u=h.installScenePlugins).concat(this._pendingScene),t=0;t<u.length;t++)e=u[t],i=l(e,"key",null),s=l(e,"plugin",null),a=l(e,"mapping",null),i&&(s?this.installScenePlugin(i,s,a):console.warn("Missing `plugin` for key: "+i));this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(n.DESTROY,this.destroy,this)},addToScene:function(t,e,i){var s,n,r,a=this.game,o=t.scene,h=t.settings.map,l=t.settings.isBooted;for(s=0;s<e.length;s++)a[n=e[s]]?(t[n]=a[n],h.hasOwnProperty(n)&&(o[h[n]]=t[n])):"game"===n&&h.hasOwnProperty(n)&&(o[h[n]]=a);for(var c=0;c<i.length;c++)for(r=i[c],s=0;s<r.length;s++)if(n=r[s],u.hasCore(n)){var d=u.getCore(n),f=d.mapping,p=new d.plugin(o,this,f);t[f]=p,d.custom?o[f]=p:h.hasOwnProperty(f)&&(o[h[f]]=p),l&&p.boot()}for(r=this.plugins,s=0;s<r.length;s++){var g=r[s];g.mapping&&(o[g.mapping]=g.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,s,n){if(void 0===n&&(n=!1),"function"==typeof e){if(u.hasCore(t)||u.register(t,e,i,!0),-1===this.scenePlugins.indexOf(t))this.scenePlugins.push(t);else if(!n&&u.hasCore(t))return void console.warn("Scene Plugin key in use: "+t);if(s){var r=new e(s,this,t);s.sys[t]=r,i&&""!==i&&(s[i]=r),r.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,s,n){if(void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=null),"function"!=typeof e)return console.warn("Invalid Plugin: "+t),null;if(u.hasCustom(t))return console.warn("Plugin key in use: "+t),null;if(null!==s&&(i=!0),this.game.isBooted){if(u.registerCustom(t,e,s,n),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:s,data:n});return null},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++)if(e[i].key===t)return i;return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=u.getCustom(t);if(i){var s=new i.plugin(this);i={key:e,plugin:s,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),s.init(i.data),s.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var s=this.getClass(t);return s&&e?(i=this.createEntry(t,t))?i.plugin:null:s||null},getClass:function(t){return u.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&c(this.plugins,e),u.removeCustom(t)},removeScenePlugin:function(t){c(this.scenePlugins,t),u.remove(t)},registerGameObject:function(t,e,i){return e&&h.register(t,e),i&&o.register(t,i),this},removeGameObject:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),e&&h.remove(t),i&&o.remove(t),this},registerFileType:function(t,e,i){a.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();u.destroyCustomPlugins(),this.game.noReturn&&u.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=f},45145:(t,e,i)=>{var s=i(52018),n=i(83419),r=i(44594),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},18922:(t,e,i)=>{t.exports={BasePlugin:i(52018),DefaultPlugins:i(42363),PluginCache:i(37277),PluginManager:i(77332),ScenePlugin:i(45145)}},63595:()=>{"undefined"!=typeof HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),i=this.getVideoPlaybackQuality(),s=this.mozPresentedFrames||this.mozPaintedFrames||i.totalVideoFrames-i.droppedVideoFrames,n=(r,a)=>{const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>s){const s=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,n=a-r;t(a,{presentationTime:a+1e3*s,expectedDisplayTime:a+n,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+n/1e3,presentedFrames:h,processingDuration:s}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame((t=>n(a,t)))};return this._rvfcpolyfillmap[e]=requestAnimationFrame((t=>n(e,t))),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312:t=>{t.exports={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}},29795:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},68627:(t,e,i)=>{var s=i(19715),n=i(32880),r=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),c=i(69442),d=i(8443),f=i(61340),p=new r({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(d.BOOT,(function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}}),this),t.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,a,o,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d<n;d++){var f=e[d];f.mask&&f.mask.preRenderCanvas(this,f,i),f.renderCanvas(this,f,i),f.mask&&f.mask.postRenderCanvas(this,f,i)}u.setTransform(1,0,0,1,0,0),u.globalCompositeOperation="source-over",u.globalAlpha=1,i.flashEffect.postRenderCanvas(u),i.fadeEffect.postRenderCanvas(u),i.dirty=!1,c&&c.postRenderCanvas(this),u.restore(),i.renderToTexture&&(i.emit(s.POST_RENDER,i),i.renderToGame&&t.sys.context.drawImage(i.canvas,r,a)),i.emit(s.POST_RENDER,i)},postRender:function(){this.gameContext.restore(),this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(n(this.gameCanvas,t),t.callback=null)},snapshotCanvas:function(t,e,i,s,r,a,o,h,l){void 0===i&&(i=!1),this.snapshotArea(s,r,a,o,e,h,l);var u=this.snapshotState;return u.getPixel=i,n(t,u),u.callback=null,this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,t,e,i)},snapshotArea:function(t,e,i,s,n,r,a){var o=this.snapshotState;return o.callback=n,o.type=r,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=Math.min(i,this.gameCanvas.width),o.height=Math.min(s,this.gameCanvas.height),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},batchSprite:function(t,e,i,s){var n=i.alpha*t.alpha;if(0!==n){var r=this.currentContext,a=this._tempMatrix1,o=this._tempMatrix2,h=e.canvasData,l=h.x,u=h.y,c=e.cutWidth,d=e.cutHeight,f=e.customPivot,p=e.source.resolution,g=t.displayOriginX,m=t.displayOriginY,v=-g+e.x,y=-m+e.y;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),c=x.cw,d=x.ch,l=x.cx,u=x.cy,v=-g+x.x,y=-m+x.y,t.flipX&&(v>=0?v=-(v+c):v<0&&(v=Math.abs(v)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var w=1,b=1;t.flipX&&(f||(v+=-e.realWidth+2*g),w=-1),t.flipY&&(f||(y+=-e.realHeight+2*m),b=-1);var T=t.x,S=t.y;if(i.roundPixels&&(T=Math.floor(T),S=Math.floor(S)),o.applyITRS(T,S,t.rotation,t.scaleX*w,t.scaleY*b),a.copyFrom(i.matrix),s?(a.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),o.e=T,o.f=S):(o.e-=i.scrollX*t.scrollFactorX,o.f-=i.scrollY*t.scrollFactorY),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),r.save(),a.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),c>0&&d>0){var E=c/p,A=d/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),E+=.5,A+=.5),r.drawImage(e.source.image,l,u,c,d,v,y,E,A)}t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830:(t,e,i)=>{t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373:(t,e,i)=>{var s=i(10312),n=i(89289);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},20926:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n,r){var a=n.alpha*i.alpha;if(a<=0)return!1;var o=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899:t=>{t.exports="losewebgl"},6119:t=>{t.exports="postrender"},48070:t=>{t.exports="prerender"},15640:t=>{t.exports="render"},8912:t=>{t.exports="resize"},87124:t=>{t.exports="restorewebgl"},92503:(t,e,i)=>{t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124)}},36909:(t,e,i)=>{t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880:(t,e,i)=>{var s=i(27919),n=i(40987),r=i(95540);t.exports=function(t,e){var i=r(e,"callback"),a=r(e,"type","image/png"),o=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=Math.floor(r(e,"width",t.width)),c=Math.floor(r(e,"height",t.height));if(r(e,"getPixel",!1)){var d=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=s.createWebGL(this,u,c),p=f.getContext("2d",{willReadFrequently:!0});u>0&&c>0&&p.drawImage(t,h,l,u,c,0,0,u,c);var g=new Image;g.onerror=function(){i.call(null),s.remove(f)},g.onload=function(){i.call(null,g),s.remove(f)},g.src=f.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},88815:(t,e,i)=>{var s=i(27919),n=i(40987),r=i(95540);t.exports=function(t,e){var i=t,a=r(e,"callback"),o=r(e,"type","image/png"),h=r(e,"encoder",.92),l=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),f=d?r(e,"bufferWidth",1):i.drawingBufferWidth,p=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var g=new Uint8Array(4),m=d?u:p-u;i.readPixels(l,m,1,1,i.RGBA,i.UNSIGNED_BYTE,g),a.call(null,new n(g[0],g[1],g[2],g[3]))}else{var v=Math.floor(r(e,"width",f)),y=Math.floor(r(e,"height",p)),x=v*y*4,w=new Uint8Array(x);i.readPixels(l,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,w);for(var b=s.createWebGL(this,v,y),T=b.getContext("2d",{willReadFrequently:!0}),S=T.getImageData(0,0,v,y),E=S.data,A=0;A<y;A++)for(var C=0;C<v;C++){var M=4*((y-A-1)*v+C),_=d?x-4*(A*v+(v-C)):4*(A*v+C);E[_+0]=w[M+0],E[_+1]=w[M+1],E[_+2]=w[M+2],E[_+3]=w[M+3]}T.putImageData(S,0,0);var R=new Image;R.onerror=function(){a.call(null),s.remove(b)},R.onload=function(){a.call(null,R),s.remove(b)},R.src=b.toDataURL(o,h)}}},89966:(t,e,i)=>{t.exports={Canvas:i(32880),WebGL:i(88815)}},7530:(t,e,i)=>{var s=i(83419),n=i(36060),r=i(90330),a=i(82264),o=i(95540),h=i(32302),l=i(63448),u=i(31302),c=i(58918),d=i(14811),f=i(92651),p=i(96569),g=i(56527),m=i(57516),v=i(43439),y=i(81041),x=i(12385),w=i(7589),b=i(95428),T=i(72905),S=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,w],[n.MULTI_PIPELINE,m],[n.BITMAPMASK_PIPELINE,u],[n.SINGLE_PIPELINE,x],[n.ROPE_PIPELINE,y],[n.LIGHT_PIPELINE,p],[n.POINTLIGHT_PIPELINE,v],[n.MOBILE_PIPELINE,g]]),this.postPipelineClasses=new r,this.pipelines=new r,this.postPipelineInstances=[],this.default=null,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.MOBILE_PIPELINE=null,this.FX_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t,e,i){var s=this.renderer,r=this.renderTargets;this.frameInc=Math.floor(o(t,"frameInc",32));var l,u,p=s.width,g=s.height,m=this.game.config.disablePreFX;if(this.game.config.disablePostFX||this.postPipelineClasses.setAll([[String(d.BARREL),c.Barrel],[String(d.BLOOM),c.Bloom],[String(d.BLUR),c.Blur],[String(d.BOKEH),c.Bokeh],[String(d.CIRCLE),c.Circle],[String(d.COLOR_MATRIX),c.ColorMatrix],[String(d.DISPLACEMENT),c.Displacement],[String(d.GLOW),c.Glow],[String(d.GRADIENT),c.Gradient],[String(d.PIXELATE),c.Pixelate],[String(d.SHADOW),c.Shadow],[String(d.SHINE),c.Shine],[String(d.VIGNETTE),c.Vignette],[String(d.WIPE),c.Wipe]]),!m){this.classes.set(n.FX_PIPELINE,f);for(var v=Math.min(p,g),y=Math.ceil(v/this.frameInc),x=1;x<y;x++){var w=x*this.frameInc;r.push(new h(s,w,w)),r.push(new h(s,w,w)),r.push(new h(s,w,w)),this.maxDimension=w}r.push(new h(s,p,g,1,0,!0,!0)),r.push(new h(s,p,g,1,0,!0,!0)),r.push(new h(s,p,g,1,0,!0,!0))}var b=this,T=this.game;if(this.classes.each((function(t,e){l=b.add(t,new e({game:T})),t===n.UTILITY_PIPELINE&&(b.UTILITY_PIPELINE=l,b.fullFrame1=l.fullFrame1,b.fullFrame2=l.fullFrame2,b.halfFrame1=l.halfFrame1,b.halfFrame2=l.halfFrame2)})),this.MULTI_PIPELINE=this.get(n.MULTI_PIPELINE),this.BITMAPMASK_PIPELINE=this.get(n.BITMAPMASK_PIPELINE),this.MOBILE_PIPELINE=this.get(n.MOBILE_PIPELINE),m||(this.FX_PIPELINE=this.get(n.FX_PIPELINE)),t)for(u in t){var S=t[u];(l=new S(T)).name=u,l.isPostFX?this.postPipelineClasses.set(u,S):this.has(u)||(this.classes.set(u,S),this.add(u,l))}this.default=this.get(e),i&&!a.os.desktop&&(this.default=this.MOBILE_PIPELINE)},setDefaultPipeline:function(t){var e=this.get(t);return e&&(this.default=e),e},add:function(t,e){if(!e.isPostFX){var i=this.pipelines,s=this.renderer;return i.has(t)?console.warn("Pipeline exists: "+t):(e.name=t,e.manager=this,i.set(t,e)),e.hasBooted||e.boot(),0===s.width||0===s.height||e.isPreFX||e.resize(s.width,s.height),e}console.warn(t+" is a Post Pipeline. Use `addPostPipeline` instead")},addPostPipeline:function(t,e){this.postPipelineClasses.has(t)||this.postPipelineClasses.set(t,e)},flush:function(){this.current&&this.current.flush()},has:function(t){var e=this.pipelines;return"string"==typeof t?e.has(t):!!e.contains(t)},get:function(t){var e=this.pipelines;return"string"==typeof t?e.get(t):e.contains(t)?t:void 0},getPostPipeline:function(t,e,i){var s,n=this.postPipelineClasses,r="",a=typeof t;if("string"===a||"number"===a?(s=n.get(t),r=t):"function"===a?(n.contains(t)&&(s=t),r=t.name):"object"===a&&(s=n.get(t.name),r=t.name),s){var o=new s(this.game,i);return o.name=r,e&&(o.gameObject=e),this.postPipelineInstances.push(o),o}},removePostPipeline:function(t){T(this.postPipelineInstances,t)},remove:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0),this.pipelines.delete(t),e&&this.classes.delete(t),i&&this.postPipelineClasses.delete(t)},set:function(t,e,i){if(!t.isPostFX)return this.isCurrent(t,i)||(this.flush(),this.current&&this.current.unbind(),this.current=t,t.bind(i)),t.updateProjectionMatrix(),t.onBind(e),t},preBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=e.length-1;i>=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i<e.length;i++){var s=e[i];s.active&&s.postBatch(t)}}},preBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=e.length-1;i>=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i<e.length;i++){var s=e[i];s.active&&s.postBatch(t)}}},isCurrent:function(t,e){var i=this.renderer,s=this.current;return s&&!e&&(e=s.currentShader),!(s!==t||e.program!==i.currentProgram)},copyFrame:function(t,e,i,s,n){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyFrame(t,e,i,s,n),this},copyToGame:function(t){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyToGame(t),this},drawFrame:function(t,e,i,s){return this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader).drawFrame(t,e,i,s),this},blendFrames:function(t,e,i,s,n){return this.setUtility(this.UTILITY_PIPELINE.linearShader).blendFrames(t,e,i,s,n),this},blendFramesAdditive:function(t,e,i,s,n){return this.setUtility(this.UTILITY_PIPELINE.addShader).blendFramesAdditive(t,e,i,s,n),this},clearFrame:function(t,e){return this.UTILITY_PIPELINE.clearFrame(t,e),this},blitFrame:function(t,e,i,s,n,r){return this.setUtility(this.UTILITY_PIPELINE.copyShader).blitFrame(t,e,i,s,n,r),this},copyFrameRect:function(t,e,i,s,n,r,a,o){return this.UTILITY_PIPELINE.copyFrameRect(t,e,i,s,n,r,a,o),this},forceZero:function(){return this.current&&this.current.forceZero},setMulti:function(){return this.set(this.MULTI_PIPELINE)},setUtility:function(t){return this.UTILITY_PIPELINE.bind(t)},setFX:function(){return this.set(this.FX_PIPELINE)},restoreContext:function(){this.rebind(),this.pipelines.each((function(t,e){e.restoreContext()})),b(this.postPipelineInstances,(function(t){t.restoreContext()}))},rebind:function(t){void 0===t&&this.previous&&(t=this.previous);var e=this.renderer,i=e.gl;i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),e.hasActiveStencilMask()?i.clear(i.DEPTH_BUFFER_BIT):(i.disable(i.STENCIL_TEST),i.clear(i.DEPTH_BUFFER_BIT|i.STENCIL_BUFFER_BIT)),i.viewport(0,0,e.width,e.height),e.currentProgram=null,e.setBlendMode(0,!0);var s=e.vaoExtension;s&&s.bindVertexArrayOES(null);var n=this.pipelines.entries;for(var r in n)n[r].glReset=!0;t&&(this.current=t,t.rebind())},clear:function(){var t=this.renderer;this.flush(),this.current?(this.current.unbind(),this.previous=this.current,this.current=null):this.previous=null,t.currentProgram=null,t.setBlendMode(0,!0);var e=t.vaoExtension;e&&e.bindVertexArrayOES(null)},getRenderTarget:function(t){var e=this.renderTargets;if(t>this.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(l(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},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.default=null,this.current=null,this.previous=null}});t.exports=S},32302:(t,e,i)=>{var s=i(83419),n=i(92503),r=new s({initialize:function(t,e,i,s,r,a,o,h,l){void 0===s&&(s=1),void 0===r&&(r=0),void 0===a&&(a=!0),void 0===o&&(o=!1),void 0===h&&(h=!0),void 0===l&&(l=!0),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=r,this.autoClear=a,this.autoResize=!0,this.hasDepthBuffer=h,this.forceClamp=l,this.init(e,i),o?this.renderer.on(n.RESIZE,this.resize,this):this.autoResize=!1},init:function(t,e){var i=this.renderer;this.texture=i.createTextureFromSource(null,t,e,this.minFilter,this.forceClamp),this.framebuffer=i.createFramebuffer(t,e,this.texture,this.hasDepthBuffer),this.width=t,this.height=e},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){if(this.autoResize&&this.willResize(t,e)){var i=this.renderer;i.deleteFramebuffer(this.framebuffer),i.deleteTexture(this.texture),this.texture=i.createTextureFromSource(null,t,e,this.minFilter,this.forceClamp),this.framebuffer=i.createFramebuffer(t,e,this.texture,this.hasDepthBuffer),this.width=t,this.height=e}return this},willResize:function(t,e){return"number"==typeof t&&"number"==typeof e&&(t=Math.round(t*this.scale),e=Math.round(e*this.scale),t=Math.max(t,1),e=Math.max(e,1),t!==this.width||e!==this.height)},bind:function(t,e,i){void 0===t&&(t=!1);var s=this.renderer;if(t&&s.flush(),e&&i&&this.resize(e,i),s.pushFramebuffer(this.framebuffer,!1,!1),t&&this.adjustViewport(),this.autoClear){var n=this.renderer.gl;n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)}s.clearStencilMask()},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(t,e,i,s){var n=this.renderer,r=n.gl;n.pushFramebuffer(this.framebuffer),void 0!==t&&void 0!==e&&void 0!==i&&void 0!==s?(r.enable(r.SCISSOR_TEST),r.scissor(t,e,i,s)):r.disable(r.SCISSOR_TEST),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),n.popFramebuffer(),n.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.off(n.RESIZE,this.resize,this),t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},70554:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255*s&255)<<24|(255*t&255)<<16|(255*e&255)<<8|255*i&255)>>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="",s=0;s<e;s++)s>0&&(i+="\n\telse "),s<e-1&&(i+="if (outTexId < "+s+".5)"),i+="\n\t{",i+="\n\t\ttexture = texture2D(uMainSampler["+s+"], outTexCoord);",i+="\n\t}";return(t=t.replace(/%count%/gi,e.toString())).replace(/%forloop%/gi,i)},setGlowQuality:function(t,e,i,s){return void 0===i&&(i=e.config.glowFXQuality),void 0===s&&(s=e.config.glowFXDistance),(t=t.replace(/__SIZE__/gi,(1/i/s).toFixed(7))).replace(/__DIST__/gi,s.toFixed(0)+".0")}}},29100:(t,e,i)=>{var s=i(83419),n=i(62644),r=i(50792),a=i(77085),o=i(95540),h=i(37867),l=i(92503),u=i(32302),c=i(70554),d=i(38683),f=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=o(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=o(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=o(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isPreFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=o(t,"resizeUniform","")},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=o(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;t<r;t++)n.push(new u(s,c,d,1,0,!0));else if(Array.isArray(r))for(t=0;t<r.length;t++){var f=o(r[t],"scale",1),p=o(r[t],"minFilter",0),g=o(r[t],"autoClear",1),m=o(r[t],"autoResize",!1),v=o(r[t],"width",null),y=o(r[t],"height",v);v?n.push(new u(s,v,y,1,p,g,m)):n.push(new u(s,c,d,f,p,g,m))}n.length&&(this.currentRenderTarget=n[0]),this.setShadersFromConfig(i);var x=this.shaders,w=0;for(t=0;t<x.length;t++)x[t].vertexSize>w&&(w=x[t].vertexSize);var b=o(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*b;var T=new ArrayBuffer(this.vertexCapacity*w);this.vertexData=T,this.bytes=new Uint8Array(T),this.vertexViewF32=new Float32Array(T),this.vertexViewU32=new Uint32Array(T);var S=o(i,"vertices",null);for(S?(this.vertexViewF32.set(S),this.vertexBuffer=s.createVertexBuffer(T,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(T.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=x.length-1;t>=0;t--)x[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(a.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;return t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t),this},getShaderByName:function(t){for(var e=this.shaders,i=0;i<e.length;i++)if(e[i].name===t)return e[i]},setShadersFromConfig:function(t){var e,i=this.shaders,s=this.renderer;for(e=0;e<i.length;e++)i[e].destroy();var r="vertShader",a="fragShader",h="attributes",l=o(t,r,null),u=c.parseFragmentShaderMaxTextures(o(t,a,null),s.maxTextures),f=o(t,h,null),p=o(t,"shaders",[]),g=p.length;if(0===g)l&&u&&(this.shaders=[new d(this,"default",l,u,n(f))]);else{var m=[];for(e=0;e<g;e++){var v,y,x,w,b=p[e];if("string"==typeof b?(v="default",y=l,x=c.parseFragmentShaderMaxTextures(b,s.maxTextures),w=f):(v=o(b,"name","default"),y=o(b,r,l),x=c.parseFragmentShaderMaxTextures(o(b,a,u),s.maxTextures),w=o(b,h,f)),"default"===v){var T=x.split("\n")[0].trim();T.indexOf("#define SHADER_NAME")>-1&&(v=T.substring(20))}y&&x&&m.push(new d(this,v,y,x,n(w)))}this.shaders=m}return 0===this.shaders.length?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(t){return this.currentBatch={start:this.vertexCount,count:0,texture:[t],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=t,this.batch.push(this.currentBatch),0},addTextureToBatch:function(t){var e=this.currentBatch;e&&(e.texture.push(t),e.unit++,e.maxUnit++)},pushBatch:function(t){if(!this.currentBatch||this.forceZero&&t!==this.currentTexture)return this.createBatch(t);if(t===this.currentTexture)return this.currentUnit;var e=this.currentBatch,i=e.texture.indexOf(t);return-1===i?e.texture.length===this.renderer.maxTextures?this.createBatch(t):(e.unit++,e.maxUnit++,e.texture.push(t),this.currentUnit=e.unit,this.currentTexture=t,e.unit):(this.currentUnit=i,this.currentTexture=t,i)},setGameObject:function(t,e){return void 0===e&&(e=t.frame),this.pushBatch(e.source.glTexture)},shouldFlush:function(t){return void 0===t&&(t=0),this.vertexCount+t>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s<i.length;s++)i[s].resize(t,e);return this.setProjectionMatrix(t,e),this.resizeUniform&&this.set2f(this.resizeUniform,t,e),this.emit(a.RESIZE,t,e,this),this.onResize(t,e),this},setProjectionMatrix:function(t,e){var i=this.projectionMatrix;if(!i)return this;this.projectionWidth=t,this.projectionHeight=e,i.ortho(0,t,e,0,-1e3,1e3);for(var s=this.shaders,n="uProjectionMatrix",r=0;r<s.length;r++){var a=s[r];a.hasUniform(n)&&(a.resetUniform(n),a.setMatrix4fv(n,!1,i.val,a))}return this},flipProjectionMatrix:function(t){void 0===t&&(t=!0);var e=this.projectionMatrix;if(!e)return this;var i=this.projectionWidth,s=this.projectionHeight;t?e.ortho(0,i,0,s,-1e3,1e3):e.ortho(0,i,s,0,-1e3,1e3),this.setMatrix4fv("uProjectionMatrix",!1,e.val)},updateProjectionMatrix:function(){if(this.projectionMatrix){var t=this.renderer.projectionWidth,e=this.renderer.projectionHeight;this.projectionWidth===t&&this.projectionHeight===e||this.setProjectionMatrix(t,e)}},bind:function(t){if(void 0===t&&(t=this.currentShader),this.glReset)return this.rebind(t);var e=!1,i=this.gl;return i.getParameter(i.ARRAY_BUFFER_BINDING)!==this.vertexBuffer&&(i.bindBuffer(i.ARRAY_BUFFER,this.vertexBuffer.webGLBuffer),this.activeBuffer=this.vertexBuffer,e=!0),t.bind(e),this.currentShader=t,this.activeTextures.length=0,this.emit(a.BIND,this,t),this.onActive(t),this},rebind:function(t){this.activeBuffer=null,this.setVertexBuffer();for(var e=this.shaders,i=e.length-1;i>=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.activeTextures.length=0,this.emit(a.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var t=this.shaders,e=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,e&&this.setVertexBuffer();for(var i=0;i<t.length;i++){var s=t[i];s.syncUniforms(),e&&s.rebind()}},setVertexBuffer:function(t){if(void 0===t&&(t=this.vertexBuffer),t!==this.activeBuffer){var e=this.gl;return this.gl.bindBuffer(e.ARRAY_BUFFER,t.webGLBuffer),this.activeBuffer=t,!0}return!1},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(a.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize,n=this.topology;if(this.active){var r,o,h;this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s));var l=this.batch,u=this.activeTextures;if(this.forceZero)for(u[0]||e.activeTexture(e.TEXTURE0),r=0;r<l.length;r++)h=(o=l[r]).texture[0],u[0]!==h&&(e.bindTexture(e.TEXTURE_2D,h.webGLTexture),u[0]=h),e.drawArrays(n,o.start,o.count);else for(r=0;r<l.length;r++){o=l[r];for(var c=0;c<=o.maxUnit;c++)h=o.texture[c],u[c]!==h&&(e.activeTexture(e.TEXTURE0+c),e.bindTexture(e.TEXTURE_2D,h.webGLTexture),u[c]=h);e.drawArrays(n,o.start,o.count)}}this.vertexCount=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.emit(a.AFTER_FLUSH,this,t),this.onAfterFlush(t)}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(t,e,i,s,n,r,a){var o=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;o[++l]=t,o[++l]=e,o[++l]=i,o[++l]=s,o[++l]=n,o[++l]=r,h[++l]=a,this.vertexCount++,this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchQuad:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,g,m,v,y,x){void 0===x&&(x=this.currentUnit);var w=!1;this.shouldFlush(6)&&(this.flush(),w=!0),this.currentBatch||(x=this.setTexture2D(y));var b=this.vertexViewF32,T=this.vertexViewU32,S=this.vertexCount*this.currentShader.vertexComponentCount-1;return b[++S]=e,b[++S]=i,b[++S]=l,b[++S]=u,b[++S]=x,b[++S]=v,T[++S]=f,b[++S]=s,b[++S]=n,b[++S]=l,b[++S]=d,b[++S]=x,b[++S]=v,T[++S]=g,b[++S]=r,b[++S]=a,b[++S]=c,b[++S]=d,b[++S]=x,b[++S]=v,T[++S]=m,b[++S]=e,b[++S]=i,b[++S]=l,b[++S]=u,b[++S]=x,b[++S]=v,T[++S]=f,b[++S]=r,b[++S]=a,b[++S]=c,b[++S]=d,b[++S]=x,b[++S]=v,T[++S]=m,b[++S]=o,b[++S]=h,b[++S]=c,b[++S]=u,b[++S]=x,b[++S]=v,T[++S]=p,this.vertexCount+=6,this.currentBatch.count=this.vertexCount-this.currentBatch.start,this.onBatch(t),w},batchTri:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,g,m){void 0===m&&(m=this.currentUnit);var v=!1;this.shouldFlush(3)&&(this.flush(),v=!0),this.currentBatch||(m=this.setTexture2D(g));var y=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.currentShader.vertexComponentCount-1;return y[++w]=e,y[++w]=i,y[++w]=o,y[++w]=h,y[++w]=m,y[++w]=p,x[++w]=c,y[++w]=s,y[++w]=n,y[++w]=o,y[++w]=u,y[++w]=m,y[++w]=p,x[++w]=d,y[++w]=r,y[++w]=a,y[++w]=l,y[++w]=u,y[++w]=m,y[++w]=p,x[++w]=f,this.vertexCount+=3,this.currentBatch.count=this.vertexCount-this.currentBatch.start,this.onBatch(t),v},drawFillRect:function(t,e,i,s,n,r,a,o){void 0===a&&(a=this.renderer.whiteTexture),void 0===o&&(o=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+s),u=this.setTexture2D(a),d=c.getTintAppendFloatAlphaAndSwap(n,r),f=0,p=1;o&&(f=1,p=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,f,1,p,d,d,d,d,0,a,u)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture),this.pushBatch(t)},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t.webGLTexture),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t,e){return this.set1f(t,this.game.loop.getDuration(),e),this},setBoolean:function(t,e,i){return void 0===i&&(i=this.currentShader),i.setBoolean(t,e),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2f(t,e,i),this},set3f:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3f(t,e,i,s),this},set4f:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4f(t,e,i,s,n),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.set2i(t,e,i),this},set3i:function(t,e,i,s,n){return void 0===n&&(n=this.currentShader),n.set3i(t,e,i,s),this},set4i:function(t,e,i,s,n,r){return void 0===r&&(r=this.currentShader),r.set4i(t,e,i,s,n),this},setMatrix2fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,s){return void 0===s&&(s=this.currentShader),s.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(a.DESTROY,this);var e=this.shaders;for(t=0;t<e.length;t++)e[t].destroy();var i=this.renderTargets;for(t=0;t<i.length;t++)i[t].destroy();var s=this.renderer;return s.deleteBuffer(this.vertexBuffer),s.off(l.RESIZE,this.resize,this),s.off(l.PRE_RENDER,this.onPreRender,this),s.off(l.RENDER,this.onRender,this),s.off(l.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.activeTextures=null,this}});t.exports=f},74797:(t,e,i)=>{var s=i(95428),n=i(72905),r=i(19715),a=i(83419),o=i(8054),h=i(50792),l=i(92503),u=i(50030),c=i(37867),d=i(29747),f=i(7530),p=i(32302),g=i(97480),m=i(69442),v=i(70554),y=i(88815),x=i(26128),w=i(1482),b=i(82751),T=i(84387),S=i(93567),E=i(57183),A=new a({Extends:h,initialize:function(t){h.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!0,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.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.maxTextures=0,this.textureIndexes,this.glBufferWrappers=[],this.glProgramWrappers=[],this.glTextureWrappers=[],this.glFramebufferWrappers=[],this.glAttribLocationWrappers=[],this.glUniformLocationWrappers=[],this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.previousContextLostHandler=d,this.previousContextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.normalTexture=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.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.maskSource=null,this.maskTarget=null,this.spector=null,this._debugCapture=!1,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e,this.setExtensions(),this.setContextHandlers(),i.context=e;for(var r=0;r<=27;r++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});return this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats=[e.BYTE,e.SHORT,e.UNSIGNED_BYTE,e.UNSIGNED_SHORT,e.FLOAT],this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}},t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),e.clear(e.COLOR_BUFFER_BIT),-1!==["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"].indexOf(t.mipmapFilter)&&(this.mipmapFilter=e[t.mipmapFilter]),this.maxTextures=v.checkShaderMax(e,t.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new f(this),this.setBlendMode(o.BlendModes.NORMAL),this.projectionMatrix=(new c).identity(),i.textures.once(m.READY,this.boot,this),this},boot:function(){var t=this.game,e=this.pipelines,i=t.scale.baseSize,s=i.width,n=i.height;this.width=s,this.height=n,this.isBooted=!0,this.renderTarget=new p(this,s,n,1,0,!0,!0),this.maskTarget=new p(this,s,n,1,0,!0,!0),this.maskSource=new p(this,s,n,1,0,!0,!0);var r=t.config;e.boot(r.pipeline,r.defaultPipeline,r.autoMobilePipeline),this.blankTexture=t.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=t.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=t.textures.getFrame("__WHITE").glTexture;var a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,null),a.enable(a.SCISSOR_TEST),t.scale.on(g.RESIZE,this.onResize,this),this.resize(s,n)},setExtensions:function(){var t=this.gl,e=t.getSupportedExtensions();this.supportedExtensions=e;var i="ANGLE_instanced_arrays";this.instancedArraysExtension=e.indexOf(i)>-1?t.getExtension(i):null;var s="OES_vertex_array_object";this.vaoExtension=e.indexOf(s)>-1?t.getExtension(s):null},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(l.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){var e=this.gl;if(e.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.currentProgram=null,this.currentFramebuffer=null,this.setBlendMode(o.BlendModes.NORMAL),e.disable(e.BLEND),e.disable(e.DEPTH_TEST),e.enable(e.CULL_FACE),this.compression=this.getCompressedTextures();var i=function(t){t.createResource()};s(this.glTextureWrappers,i),s(this.glBufferWrappers,i),s(this.glFramebufferWrappers,i),s(this.glProgramWrappers,i),s(this.glAttribLocationWrappers,i),s(this.glUniformLocationWrappers,i),this.createTemporaryTextures(),this.pipelines.restoreContext(),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.setExtensions(),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(l.RESTORE_WEBGL,this),t.preventDefault()}},createTemporaryTextures:function(){for(var t=this.gl,e=0;e<this.maxTextures;e++){var i=t.createTexture();t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),this.textureIndexes.push(e)}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){},getFps:function(){},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},beginCapture:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.renderTarget.bind(!0,t,e),this.setProjectionMatrix(t,e)},endCapture:function(){return this.renderTarget.unbind(!0),this.resetProjectionMatrix(),this.renderTarget},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),i.viewport(0,0,t,e),this.drawingBufferHeight=i.drawingBufferHeight,i.scissor(0,i.drawingBufferHeight-e,t,e),this.defaultScissor[2]=t,this.defaultScissor[3]=e,this.emit(l.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,s){var n=i.getExtension(t+s)||i.getExtension(e+s)||i.getExtension("EXT_texture_compression_"+s);if(n){var r={};for(var a in n)r[n[a]]=a;return r}},s=this.gl;return{ETC:i(s,"etc"),ETC1:i(s,"etc1"),ATC:i(s,"atc"),ASTC:i(s,"astc"),BPTC:i(s,"bptc"),RGTC:i(s,"rgtc"),PVRTC:i(s,"pvrtc"),S3TC:i(s,"s3tc"),S3TCSRGB:i(s,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e){return t===this.projectionWidth&&e===this.projectionHeight||(this.projectionWidth=t,this.projectionHeight=e,this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.pipelines.flush()},pushScissor:function(t,e,i,s,n){void 0===n&&(n=this.drawingBufferHeight);var r=[t,e,i,s];return this.scissorStack.push(r),this.setScissor(t,e,i,s,n),this.currentScissor=r,r},setScissor:function(t,e,i,s,n){void 0===n&&(n=this.drawingBufferHeight);var r=this.gl,a=this.currentScissor,o=i>0&&s>0;if(a&&o){var h=a[0],l=a[1],u=a[2],c=a[3];o=h!==t||l!==e||u!==i||c!==s}o&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},pushFramebuffer:function(t,e,i,s,n){return t===this.currentFramebuffer?this:(this.fboStack.push(t),this.setFramebuffer(t,e,i,s,n))},setFramebuffer:function(t,e,i,s,n){if(void 0===e&&(e=!1),void 0===i&&(i=!0),void 0===s&&(s=null),void 0===n&&(n=!1),t===this.currentFramebuffer)return this;var r=this.gl,a=this.width,o=this.height;return t&&t.renderTexture&&i?(a=t.renderTexture.width,o=t.renderTexture.height):this.flush(),t?r.bindFramebuffer(r.FRAMEBUFFER,t.webGLFramebuffer):r.bindFramebuffer(r.FRAMEBUFFER,null),i&&r.viewport(0,0,a,o),s&&r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s.webGLTexture,0),n&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT)),e&&(t?(this.drawingBufferHeight=o,this.pushScissor(0,0,a,o)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t,this},popFramebuffer:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0);var i=this.fboStack;i.pop();var s=i[i.length-1];return s||(s=null),this.setFramebuffer(s,t,e),s},restoreFramebuffer:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0);var i=this.fboStack,s=i[i.length-1];s||(s=null),this.currentFramebuffer=null,this.setFramebuffer(s,t,e)},setProgram:function(t){return t!==this.currentProgram&&(this.flush(),this.gl.useProgram(t.webGLProgram),this.currentProgram=t,!0)},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(t,e,i,s,n){void 0===n&&(n=!1);var r=this.gl,a=r.NEAREST,h=r.NEAREST,l=r.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=u(e,i);if(c&&!n&&(l=r.REPEAT),s===o.ScaleModes.LINEAR&&this.config.antialias){var d=t&&t.compressed,f=!d&&c||d&&t.mipmaps.length>1;a=this.mipmapFilter&&f?this.mipmapFilter:r.LINEAR,h=r.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,h,l,l,r.RGBA,t):this.createTexture2D(0,a,h,l,l,r.RGBA,null,e,i)},createTexture2D:function(t,e,i,s,n,r,a,o,h,l,u,c){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var d=new b(this.gl,t,e,i,s,n,r,a,o,h,l,u,c);return this.glTextureWrappers.push(d),d},createFramebuffer:function(t,e,i,s){this.currentFramebuffer=null;var n=new T(this.gl,t,e,i,s);return this.glFramebufferWrappers.push(n),n},beginBitmapMask:function(t,e){this.gl&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==t&&(this.currentMask.mask=t,this.currentMask.camera=e))},drawBitmapMask:function(t,e,i){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),t.renderWebGL(this,t,e),this.maskSource.unbind(!0),this.maskTarget.unbind();var s=this.gl,n=this.getCurrentStencilMask();n?(s.enable(s.STENCIL_TEST),n.mask.applyStencil(this,n.camera,!0)):this.currentMask.mask=null,this.pipelines.set(i),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.maskTarget.texture.webGLTexture),s.activeTexture(s.TEXTURE1),s.bindTexture(s.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(t,e){var i=new w(this.gl,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,s=new x(i,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createAttribLocation:function(t,e){var i=new S(this.gl,t,e);return this.glAttribLocationWrappers.push(i),i},createUniformLocation:function(t,e){var i=new E(this.gl,t,e);return this.glUniformLocationWrappers.push(i),i},createIndexBuffer:function(t,e){var i=this.gl,s=new x(i,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},deleteTexture:function(t){if(t)return n(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(n(this.fboStack,t),n(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(n(this.glProgramWrappers,t),t.destroy()),this},deleteAttribLocation:function(t){return t&&(n(this.glAttribLocationWrappers,t),t.destroy()),this},deleteUniformLocation:function(t){return t&&(n(this.glUniformLocationWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(n(this.glBufferWrappers,t),t.destroy(),this):this},preRenderCamera:function(t){var e=t.x,i=t.y,s=t.width,n=t.height,a=t.backgroundColor;t.emit(r.PRE_RENDER,t),this.pipelines.preBatchCamera(t),this.pushScissor(e,i,s,n),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&this.pipelines.setMulti().drawFillRect(e,i,s,n,v.getTintFromFloats(a.blueGL,a.greenGL,a.redGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,v.getTintFromFloats),i.postRenderWebGL(s,v.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(r.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.emit(l.PRE_RENDER_CLEAR),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(l.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(l.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r<s;r++){this.finalType=r===s-1;var a=e[r],h=a.mask;(n=this.currentMask).mask&&n.mask!==h&&n.mask.postRenderWebGL(this,n.camera),h&&n.mask!==h&&h.preRenderWebGL(this,a,i),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var u=a.type;u!==this.currentType&&(this.newType=!0,this.currentType=u),this.finalType?this.nextTypeMatch=!1:this.nextTypeMatch=e[r+1].type===this.currentType,a.renderWebGL(this,a,i),this.newType=!1}(n=this.currentMask).mask&&n.mask.postRenderWebGL(this,n.camera),this.setBlendMode(o.BlendModes.NORMAL),this.postRenderCamera(i)}},postRender:function(){if(!this.contextLost){this.flush(),this.emit(l.POST_RENDER);var t=this.snapshotState;t.callback&&(y(this.gl,t),t.callback=null)}},clearStencilMask:function(){this.gl.disable(this.gl.STENCIL_TEST)},restoreStencilMask:function(){var t=this.gl,e=this.getCurrentStencilMask();if(e){var i=e.mask;t.enable(t.STENCIL_TEST),i.invertAlpha?t.stencilFunc(t.NOTEQUAL,i.level,255):t.stencilFunc(t.EQUAL,i.level,255)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,s,n,r,a){var o=this.snapshotState;return o.callback=n,o.type=r,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=s,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,s,n,r,a,o,h,l,u){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(n=!0,l="image/png");var c=this.currentFramebuffer;this.snapshotArea(r,a,o,h,s,l,u);var d=this.snapshotState;return d.getPixel=n,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.setFramebuffer(t),y(this.gl,d),this.setFramebuffer(c),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var n=this.gl,r=n.NEAREST,a=n.NEAREST,o=t.width,h=t.height,l=n.CLAMP_TO_EDGE,c=u(o,h);return!i&&c&&(l=n.REPEAT),this.config.antialias&&(r=c&&this.mipmapFilter?this.mipmapFilter:n.LINEAR,a=n.LINEAR),e?(e.update(t,o,h,s,l,l,r,a,e.format),e):this.createTexture2D(0,r,a,l,l,n.RGBA,t,o,h,!0,!1,s)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),this.canvasToTexture(t,e,s,i)},videoToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var n=this.gl,r=n.NEAREST,a=n.NEAREST,o=t.videoWidth,h=t.videoHeight,l=n.CLAMP_TO_EDGE,c=u(o,h);return!i&&c&&(l=n.REPEAT),this.config.antialias&&(r=c&&this.mipmapFilter?this.mipmapFilter:n.LINEAR,a=n.LINEAR),e?(e.update(t,o,h,s,l,l,r,a,e.format),e):this.createTexture2D(0,r,a,l,l,n.RGBA,t,o,h,!0,!0,s)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),this.videoToTexture(t,e,s,i)},createUint8ArrayTexture:function(t,e,i){var s=this.gl,n=s.NEAREST,r=s.NEAREST,a=s.CLAMP_TO_EDGE;return u(e,i)&&(a=s.REPEAT),this.createTexture2D(0,n,r,a,a,s.RGBA,t,e,i)},setTextureFilter:function(t,e){var i=this.gl,s=0===e?i.LINEAR:i.NEAREST;i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t.webGLTexture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),t.minFilter=s,t.magFilter=s,n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};s(this.glAttribLocationWrappers,t),s(this.glBufferWrappers,t),s(this.glFramebufferWrappers,t),s(this.glProgramWrappers,t),s(this.glTextureWrappers,t),s(this.glUniformLocationWrappers,t),this.maskTarget.destroy(),this.maskSource.destroy(),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}});t.exports=A},38683:(t,e,i)=>{var s=i(83419),n=i(95428),r=i(95540),a=i(14500),o=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.fragSrc=s,this.vertSrc=i,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var n=0;n<t.length;n++){var o=t[n],h=o.name,l=r(o,"size",1),u=r(o,"type",a.FLOAT),c=u.enum,d=u.size,f=!!o.normalized;s.push({name:h,size:l,type:c,normalized:f,offset:i,enabled:!1,location:-1}),4===d?e+=l:e++,i+=l*d}this.vertexSize=i,this.vertexComponentCount=e,this.attributes=s},bind:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),e&&this.pipeline.flush(),this.renderer.setProgram(this.program),t&&this.setAttribPointers(),this},rebind:function(){return this.renderer.setProgram(this.program),this.setAttribPointers(!0),this},setAttribPointers:function(t){void 0===t&&(t=!1);for(var e=this.gl,i=this.renderer,s=this.vertexSize,n=this.attributes,r=this.program,a=0;a<n.length;a++){var o=n[a],h=o.size,l=o.type,u=o.offset,c=o.enabled,d=o.location,f=!!o.normalized;if(t){-1!==d&&i.deleteAttribLocation(d);var p=this.renderer.createAttribLocation(r,o.name);p.webGLAttribLocation>=0?(e.enableVertexAttribArray(p.webGLAttribLocation),e.vertexAttribPointer(p.webGLAttribLocation,h,l,f,s,u),o.enabled=!0,o.location=p):-1!==p.webGLAttribLocation&&e.disableVertexAttribArray(p.webGLAttribLocation)}else c?e.vertexAttribPointer(d.webGLAttribLocation,h,l,f,s,u):!c&&-1!==d&&d.webGLAttribLocation>-1&&(e.disableVertexAttribArray(d.webGLAttribLocation),o.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,a=s.getProgramParameter(n.webGLProgram,s.ACTIVE_UNIFORMS);for(t=0;t<a;t++){var o=s.getActiveUniform(n.webGLProgram,t);if(o){e=o.name,null!==(i=this.renderer.createUniformLocation(n,e))&&(r[e]={name:e,location:i,setter:null,value1:null,value2:null,value3:null,value4:null});var h=e.indexOf("[");h>0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=this.renderer.createUniformLocation(n,e))&&(r[e]={name:e,location:i,setter:null,value1:null,value2:null,value3:null,value4:null}))}}return this},syncUniforms:function(){var t=this.gl;for(var e in this.renderer.setProgram(this.program),this.uniforms){var i=this.uniforms[e];i.setter&&i.setter.call(t,i.location.webGLUniformLocation,i.value1,i.value2,i.value3,i.value4)}},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.setter||(n.setter=t),n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location.webGLUniformLocation,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.setter||(r.setter=t),r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location.webGLUniformLocation,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var a=this.uniforms[e];return a?((r||a.value1!==i||a.value2!==s||a.value3!==n)&&(a.setter||(a.setter=t),a.value1=i,a.value2=s,a.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,a.location.webGLUniformLocation,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,a){var o=this.uniforms[e];return o?((a||o.value1!==i||o.value2!==s||o.value3!==n||o.value4!==r)&&(o.setter||(o.setter=t),o.value1=i,o.value2=s,o.value3=n,o.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,o.location.webGLUniformLocation,i,s,n,r),this.pipeline.currentShader=this),this):this},setBoolean:function(t,e){return this.setUniform1(this.gl.uniform1i,t,Number(e))},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},createProgram:function(t,e){return void 0===t&&(t=this.vertSrc),void 0===e&&(e=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=t,this.fragSrc=e,this.program=this.renderer.createProgram(t,e),this.createUniforms(),this.rebind()},destroy:function(){var t=this.renderer;n(this.uniforms,(function(e){t.deleteUniformLocation(e.location)})),this.uniforms=null,n(this.attributes,(function(e){t.deleteAttribLocation(e.location)})),this.attributes=null,t.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});t.exports=o},14500:t=>{t.exports={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}}},4159:(t,e,i)=>{var s=i(14500),n=i(79291),r={PipelineManager:i(7530),Pipelines:i(96615),RenderTarget:i(32302),Utils:i(70554),WebGLPipeline:i(29100),WebGLRenderer:i(74797),WebGLShader:i(38683),Wrappers:i(9503)};r=n(!1,r,s),t.exports=r},31302:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(78908),a=i(85191),o=i(14500),h=i(29100),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",a),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:o.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){this.renderer.beginBitmapMask(t,i)},endMask:function(t,e,i){var s=this.gl,n=this.renderer,r=t.bitmapMask;r&&s&&(n.drawBitmapMask(r,e,this),i&&this.set2f("uResolution",i.width,i.height),this.set1i("uInvertMaskAlpha",t.invertAlpha),s.drawArrays(this.topology,0,3),i&&this.set2f("uResolution",this.width,this.height),s.bindTexture(s.TEXTURE_2D,null))}});t.exports=l},92651:(t,e,i)=>{var s=i(83419),n=i(58918),r=i(14811),a=i(95540),o=i(43558),h=i(89350),l=i(70554),u=new s({Extends:o,initialize:function(t){t.shaders=[l.setGlowQuality(h.FXGlowFrag,t.game),h.FXShadowFrag,h.FXPixelateFrag,h.FXVignetteFrag,h.FXShineFrag,h.FXBlurLowFrag,h.FXBlurMedFrag,h.FXBlurHighFrag,h.FXGradientFrag,h.FXBloomFrag,h.ColorMatrixFrag,h.FXCircleFrag,h.FXBarrelFrag,h.FXDisplacementFrag,h.FXWipeFrag,h.FXBokehFrag],o.call(this,t);var e=this.game;this.glow=new n.Glow(e),this.shadow=new n.Shadow(e),this.pixelate=new n.Pixelate(e),this.vignette=new n.Vignette(e),this.shine=new n.Shine(e),this.gradient=new n.Gradient(e),this.circle=new n.Circle(e),this.barrel=new n.Barrel(e),this.wipe=new n.Wipe(e),this.bokeh=new n.Bokeh(e);var i=[];i[r.GLOW]=this.onGlow,i[r.SHADOW]=this.onShadow,i[r.PIXELATE]=this.onPixelate,i[r.VIGNETTE]=this.onVignette,i[r.SHINE]=this.onShine,i[r.BLUR]=this.onBlur,i[r.GRADIENT]=this.onGradient,i[r.BLOOM]=this.onBloom,i[r.COLOR_MATRIX]=this.onColorMatrix,i[r.CIRCLE]=this.onCircle,i[r.BARREL]=this.onBarrel,i[r.DISPLACEMENT]=this.onDisplacement,i[r.WIPE]=this.onWipe,i[r.BOKEH]=this.onBokeh,this.fxHandlers=i,this.source,this.target,this.swap},onDraw:function(t,e,i){this.source=t,this.target=e,this.swap=i;var s=t.width,n=t.height,r=this.tempSprite,a=this.fxHandlers;if(r&&r.preFX)for(var o=r.preFX.list,h=0;h<o.length;h++){var l=o[h];l.active&&a[l.type].call(this,l,s,n)}this.drawToGame(this.source)},runDraw:function(){var t=this.source,e=this.target;this.copy(t,e),this.source=e,this.target=t},onGlow:function(t,e,i){var s=this.shaders[r.GLOW];this.setShader(s),this.glow.onPreRender(t,s,e,i),this.runDraw()},onShadow:function(t){var e=this.shaders[r.SHADOW];this.setShader(e),this.shadow.onPreRender(t,e),this.runDraw()},onPixelate:function(t,e,i){var s=this.shaders[r.PIXELATE];this.setShader(s),this.pixelate.onPreRender(t,s,e,i),this.runDraw()},onVignette:function(t){var e=this.shaders[r.VIGNETTE];this.setShader(e),this.vignette.onPreRender(t,e),this.runDraw()},onShine:function(t,e,i){var s=this.shaders[r.SHINE];this.setShader(s),this.shine.onPreRender(t,s,e,i),this.runDraw()},onBlur:function(t,e,i){var s=a(t,"quality"),n=this.shaders[r.BLUR+s];this.setShader(n),this.set1i("uMainSampler",0),this.set2f("resolution",e,i),this.set1f("strength",a(t,"strength")),this.set3fv("color",a(t,"glcolor"));for(var o=a(t,"x"),h=a(t,"y"),l=a(t,"steps"),u=0;u<l;u++)this.set2f("offset",o,0),this.runDraw(),this.set2f("offset",0,h),this.runDraw()},onGradient:function(t){var e=this.shaders[r.GRADIENT];this.setShader(e),this.gradient.onPreRender(t,e),this.runDraw()},onBloom:function(t,e,i){var s=this.shaders[r.BLOOM];this.copySprite(this.source,this.swap),this.setShader(s),this.set1i("uMainSampler",0),this.set1f("strength",a(t,"blurStrength")),this.set3fv("color",a(t,"glcolor"));for(var n=2/e*a(t,"offsetX"),o=2/i*a(t,"offsetY"),h=a(t,"steps"),l=0;l<h;l++)this.set2f("offset",n,0),this.runDraw(),this.set2f("offset",0,o),this.runDraw();this.blendFrames(this.swap,this.source,this.target,a(t,"strength")),this.copySprite(this.target,this.source)},onColorMatrix:function(t){this.setShader(this.colorMatrixShader),this.set1fv("uColorMatrix",t.getData()),this.set1f("uAlpha",t.alpha),this.runDraw()},onCircle:function(t,e,i){var s=this.shaders[r.CIRCLE];this.setShader(s),this.circle.onPreRender(t,s,e,i),this.runDraw()},onBarrel:function(t){var e=this.shaders[r.BARREL];this.setShader(e),this.barrel.onPreRender(t,e),this.runDraw()},onDisplacement:function(t){this.setShader(this.shaders[r.DISPLACEMENT]),this.set1i("uDisplacementSampler",1),this.set2f("amount",t.x,t.y),this.bindTexture(t.glTexture,1),this.runDraw()},onWipe:function(t){var e=this.shaders[r.WIPE];this.setShader(e),this.wipe.onPreRender(t,e),this.runDraw()},onBokeh:function(t,e,i){var s=this.shaders[r.BOKEH];this.setShader(s),this.bokeh.onPreRender(t,s,e,i),this.runDraw()},destroy:function(){return this.glow.destroy(),this.shadow.destroy(),this.pixelate.destroy(),this.vignette.destroy(),this.shine.destroy(),this.gradient.destroy(),this.circle.destroy(),this.barrel.destroy(),this.wipe.destroy(),this.bokeh.destroy(),this.fxHandlers=null,this.source=null,this.target=null,this.swap=null,o.prototype.destroy.call(this),this}});t.exports=u},96569:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(31063),a=i(57516),o=i(61340),h=i(26099),l=i(29100),u=new s({Extends:a,initialize:function(t){var e=n(t,"fragShader",r);t.fragShader=e.replace("%LIGHT_COUNT%",t.game.renderer.config.maxLights),a.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new h,this._tempMatrix=new o,this._tempMatrix2=new o},boot:function(){l.prototype.boot.call(this)},onRender:function(t,e){var i=t.sys.lights;if(this.lightsActive=!1,i&&i.active){var s,n=i.getLights(e),r=n.length;this.lightsActive=!0;var a=this.renderer.height,o=e.matrix,h=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",e.x,e.y,e.rotation,e.zoom),this.set3f("uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),this.set1i("uLightCount",r),s=0;s<r;s++){var l=n[s].light,u=l.color,c="uLights["+s+"].";o.transformPoint(l.x,l.y,h),this.set2f(c+"position",h.x-e.scrollX*l.scrollFactorX*e.zoom,a-(h.y-e.scrollY*l.scrollFactorY*e.zoom)),this.set3f(c+"color",u.r,u.g,u.b),this.set1f(c+"intensity",l.intensity),this.set1f(c+"radius",l.radius)}this.currentNormalMapRotation=null}},setNormalMapRotation:function(t){if(t!==this.currentNormalMapRotation||0===this.vertexCount){this.vertexCount>0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.whiteTexture);var s=this.getNormalMap(e);this.isNewNormalMap(t,s)&&(this.flush(),this.createBatch(t),this.addTextureToBatch(s),this.currentNormalMap=s);var n=0;return e&&e.parentContainer?n=e.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2).rotationNormalized:e&&(n=e.rotation),null===this.currentBatch&&(this.createBatch(t),this.addTextureToBatch(s)),this.setNormalMapRotation(n),0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=e.glTexture,s=this.getNormalMap(t);if(this.isNewNormalMap(i,s)&&(this.flush(),this.createBatch(i),this.addTextureToBatch(s),this.currentNormalMap=s),t.parentContainer){var n=t.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(n.rotationNormalized)}else this.setNormalMapRotation(t.rotation);return null===this.currentBatch&&(this.createBatch(i),this.addTextureToBatch(s)),0},isNewNormalMap:function(t,e){return this.currentTexture!==t||this.currentNormalMap!==e},getNormalMap:function(t){var e;return t?(t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]),e?e.glTexture:this.renderer.normalTexture):this.renderer.normalTexture},batchSprite:function(t,e,i){this.lightsActive&&a.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,o,h,l,u,c,d,f,p,g,m,v,y,x,w,b,T,S,E,A,C,M,_,R,P,L,F){this.lightsActive&&a.prototype.batchTexture.call(this,t,e,i,s,n,r,o,h,l,u,c,d,f,p,g,m,v,y,x,w,b,T,S,E,A,C,M,_,R,P,L,F)},batchTextureFrame:function(t,e,i,s,n,r,o){this.lightsActive&&a.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,o)}});t.exports=u},56527:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(57516),a=i(45561),o=i(60722),h=i(14500),l=i(29100),u=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",a),t.vertShader=n(t,"vertShader",o),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),t.forceZero=!0,t.resizeUniform="uResolution",r.call(this,t)},boot:function(){l.prototype.boot.call(this);var t=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",t.width,t.height)}});t.exports=u},57516:(t,e,i)=>{var s=i(83419),n=i(94811),r=i(95540),a=i(98840),o=i(44667),h=i(61340),l=i(70554),u=i(14500),c=i(29100),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",a);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",o),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),t.resizeUniform="uResolution",c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,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(){c.prototype.boot.call(this);var t=this.renderer;this.set1iv("uMainSampler",t.textureIndexes),this.set2f("uResolution",t.width,t.height)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,a=t.frame,o=a.glTexture,h=a.u0,u=a.v0,c=a.u1,d=a.v1,f=a.x,p=a.y,g=a.cutWidth,m=a.cutHeight,v=a.customPivot,y=t.displayOriginX,x=t.displayOriginY,w=-y+f,b=-x+p;if(t.isCropped){var T=t._crop;T.flipX===t.flipX&&T.flipY===t.flipY||a.updateCropUVs(T,t.flipX,t.flipY),h=T.u0,u=T.v0,c=T.u1,d=T.v1,g=T.width,m=T.height,w=-y+(f=T.x),b=-x+(p=T.y)}var S=1,E=1;t.flipX&&(v||(w+=-a.realWidth+2*y),S=-1),t.flipY&&(v||(b+=-a.realHeight+2*x),E=-1);var A=t.x,C=t.y;e.roundPixels&&(A=Math.floor(A),C=Math.floor(C)),n.applyITRS(A,C,t.rotation,t.scaleX*S,t.scaleY*E),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=A,n.f=C):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var M=r.setQuad(w,b,w+g,b+m,e.renderRoundPixels),_=l.getTintAppendFloatAlpha,R=e.alpha,P=_(t.tintTopLeft,R*t._alphaTL),L=_(t.tintTopRight,R*t._alphaTR),F=_(t.tintBottomLeft,R*t._alphaBL),O=_(t.tintBottomRight,R*t._alphaBR);this.shouldFlush(6)&&this.flush();var D=this.setGameObject(t,a);this.manager.preBatch(t),this.batchQuad(t,M[0],M[1],M[2],M[3],M[4],M[5],M[6],M[7],h,u,c,d,P,L,F,O,t.tintFill,o,D),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,a,o,h,l,u,c,d,f,p,g,m,v,y,x,w,b,T,S,E,A,C,M,_,R,P,L,F){void 0===F&&(F=!1),this.manager.set(this,t);var O=this._tempMatrix1,D=this._tempMatrix2,k=this._tempMatrix3,I=v/i+C,B=y/s+M,N=(v+x)/i+C,Y=(y+w)/s+M,X=a,U=o,z=-g,G=-m;if(t.isCropped){var V=t._crop,W=V.width,H=V.height;X=W,U=H,a=W,o=H;var j=v=V.x,q=y=V.y;c&&(j=x-V.x-W),d&&(q=w-V.y-H),I=j/i+C,B=q/s+M,N=(j+W)/i+C,Y=(q+H)/s+M,z=-g+v,G=-m+y}c&&(X*=-1,z+=a),(d^=!P&&e.isRenderTexture?1:0)&&(U*=-1,G+=o),_.roundPixels&&(n=Math.floor(n),r=Math.floor(r)),D.applyITRS(n,r,u,h,l),O.copyFrom(_.matrix),R?(O.multiplyWithOffset(R,-_.scrollX*f,-_.scrollY*p),D.e=n,D.f=r):(D.e-=_.scrollX*f,D.f-=_.scrollY*p),O.multiply(D,k);var K=k.setQuad(z,G,z+X,G+U,_.renderRoundPixels);null==L&&(L=this.setTexture2D(e)),t&&!F&&this.manager.preBatch(t),this.batchQuad(t,K[0],K[1],K[2],K[3],K[4],K[5],K[6],K[7],I,B,N,Y,b,T,S,E,A,e,L),t&&!F&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,a){this.manager.set(this);var o=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2;a?o.multiply(a,h):h=o;var u=h.setQuad(e,i,e+t.width,i+t.height),c=this.setTexture2D(t.source.glTexture);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,c)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var a=this.calcMatrix;r&&r.multiply(n,a);var o=a.setQuad(t,e,t+i,e+s),h=this.fillTint;this.batchQuad(null,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],0,0,1,1,h.TL,h.TR,h.BL,h.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,a,o){this.renderer.pipelines.set(this);var h=this.calcMatrix;o&&o.multiply(a,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),f=h.getX(n,r),p=h.getY(n,r),g=this.fillTint;this.batchTri(null,l,u,c,d,f,p,0,0,1,1,g.TL,g.TR,g.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,a,o,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=a,l[1].x=i,l[1].y=s,l[1].width=a,l[2].x=n,l[2].y=r,l[2].width=a,l[3].x=t,l[3].y=e,l[3].width=a,this.batchStrokePath(l,a,!1,o,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,a,o=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d<o;++d)a=t[d],h.push(a.x,a.y);o=(r=n(h)).length;for(var f=0;f<o;f+=3){var p=2*r[f+0],g=2*r[f+1],m=2*r[f+2],v=h[p+0],y=h[p+1],x=h[g+0],w=h[g+1],b=h[m+0],T=h[m+1],S=s.getX(v,y),E=s.getY(v,y),A=s.getX(x,w),C=s.getY(x,w),M=s.getX(b,T),_=s.getY(b,T);this.batchTri(null,S,E,A,C,M,_,0,0,1,1,l,u,c,2)}h.length=0},batchStrokePath:function(t,e,i,s,n){this.renderer.pipelines.set(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var r=t.length-1,a=0;a<r;a++){var o=t[a],h=t[a+1];this.batchLine(o.x,o.y,h.x,h.y,o.width/2,h.width/2,e,a,!i&&a===r-1,s,n)}},batchLine:function(t,e,i,s,n,r,a,o,h,l,u){this.renderer.pipelines.set(this);var c=this.calcMatrix;u&&u.multiply(l,c);var d=i-t,f=s-e,p=Math.sqrt(d*d+f*f);if(0!==p){var g=n*(s-e)/p,m=n*(t-i)/p,v=r*(s-e)/p,y=r*(t-i)/p,x=i-v,w=s-y,b=t-g,T=e-m,S=i+v,E=s+y,A=t+g,C=e+m,M=c.getX(x,w),_=c.getY(x,w),R=c.getX(b,T),P=c.getY(b,T),L=c.getX(S,E),F=c.getY(S,E),O=c.getX(A,C),D=c.getY(A,C),k=this.strokeTint,I=k.TL,B=k.TR,N=k.BL,Y=k.BR;if(this.batchQuad(null,O,D,R,P,M,_,L,F,0,0,1,1,I,B,N,Y,2),!(a<=2)){var X=this.prevQuad,U=this.firstQuad;o>0&&X[4]?this.batchQuad(null,O,D,R,P,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,Y,2):(U[0]=O,U[1]=D,U[2]=R,U[3]=P,U[4]=1),h&&U[4]?this.batchQuad(null,M,_,L,F,U[0],U[1],U[2],U[3],0,0,1,1,I,B,N,Y,2):(X[0]=M,X[1]=_,X[2]=L,X[3]=F,X[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,c.prototype.destroy.call(this),this}});t.exports=d},43439:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(4127),a=i(89924),o=i(29100),h=new s({Extends:o,initialize:function(t){t.vertShader=n(t,"vertShader",a),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),o.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,a,o,h,l,u,c){var d=t.color,f=t.intensity,p=t.radius,g=t.attenuation,m=d.r*f,v=d.g*f,y=d.b*f,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(i,s,u,c,p,g,m,v,y,x),this.batchLightVert(n,r,u,c,p,g,m,v,y,x),this.batchLightVert(a,o,u,c,p,g,m,v,y,x),this.batchLightVert(i,s,u,c,p,g,m,v,y,x),this.batchLightVert(a,o,u,c,p,g,m,v,y,x),this.batchLightVert(h,l,u,c,p,g,m,v,y,x),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(t,e,i,s,n,r,a,o,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=a,u[++c]=o,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},84057:(t,e,i)=>{var s=i(83419),n=i(89422),r=i(95540),a=i(27681),o=i(49627),h=i(29100),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",a),t.vertShader=r(t,"vertShader",o),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.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],h.call(this,t),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2;var e=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",e.width,e.height);for(var i=this.renderTargets,s=0;s<i.length;s++)i[s].autoResize=!0},postBatch:function(t){return this.hasBooted||(this.bootFX(),this.currentRenderTarget&&this.currentRenderTarget.bind()),this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(t){this.bindAndDraw(t)},getController:function(t){return void 0!==t?t:this.controller?this.controller:this},copySprite:function(t,e,i){void 0===i&&(i=!1);var s=this.gl;s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,t.texture.webGLTexture);var n=s.getParameter(s.FRAMEBUFFER_BINDING);s.bindFramebuffer(s.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e.texture.webGLTexture,0),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.bufferData(s.ARRAY_BUFFER,this.vertexData,s.STATIC_DRAW),s.drawArrays(s.TRIANGLES,0,6),i&&(s.bindTexture(s.TEXTURE_2D,null),s.bindFramebuffer(s.FRAMEBUFFER,n))},copyFrame:function(t,e,i,s,n){this.manager.copyFrame(t,e,i,s,n)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,s,n,r){this.manager.blitFrame(t,e,i,s,n,r)},copyFrameRect:function(t,e,i,s,n,r,a,o){this.manager.copyFrameRect(t,e,i,s,n,r,a,o)},bindAndDraw:function(t,e,i,s,n){void 0===i&&(i=!0),void 0===s&&(s=!0);var r=this.gl,a=this.renderer;this.bind(n),this.set1i("uMainSampler",0),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture.webGLTexture,0),i&&(s?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT))):(a.popFramebuffer(!1,!1),a.currentFramebuffer||r.viewport(0,0,a.width,a.height)),a.restoreStencilMask(),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture.webGLTexture),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),e&&(r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,a.currentFramebuffer.webGLFramebuffer))},destroy:function(){return this.controller&&this.controller.destroy(),this.gameObject=null,this.controller=null,this.colorMatrix=null,this.fullFrame1=null,this.fullFrame2=null,this.halfFrame1=null,this.halfFrame2=null,this.manager.removePostPipeline(this),h.prototype.destroy.call(this),this}});t.exports=l},43558:(t,e,i)=>{var s=i(10312),n=i(67502),r=i(83419),a=i(96293),o=i(95540),h=i(57516),l=i(27681),u=i(87841),c=i(32302),d=i(45561),f=i(60722),p=i(29100),g=new r({Extends:h,initialize:function(t){var e=o(t,"fragShader",l),i=o(t,"vertShader",f),s=o(t,"drawShader",l),n=[{name:"DrawSprite",fragShader:d,vertShader:f},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:f},{name:"ColorMatrix",fragShader:a}],r=o(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,h.call(this,t),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new u,this.targetBounds=new u,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){p.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.colorMatrixShader=t[3],this.fsTarget=new c(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader,this.set2f("uResolution",e.width,e.height)},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchQuad:function(t,e,i,s,r,a,o,h,l,u,c,d,f,p,g,m,v,y,x){var w=Math.min(e,s,a,h),b=Math.min(i,r,o,l),T=Math.max(e,s,a,h)-w,S=Math.max(i,r,o,l)-b,E=this.spriteBounds.setTo(w,b,T,S),A=t?t.preFX.padding:0,C=T+2*A,M=S+2*A,_=Math.abs(Math.max(C,M)),R=this.manager.getRenderTarget(_),P=this.targetBounds.setTo(0,0,R.width,R.height);n(P,Math.round(E.centerX),Math.round(E.centerY)),this.tempSprite=t;var L=this.gl,F=this.renderer;F.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",F.width,F.height),this.flipProjectionMatrix(!0),t&&(this.onDrawSprite(t,R),t.preFX.onFX(this));var O=this.fsTarget;return this.flush(),L.viewport(0,0,F.width,F.height),L.bindFramebuffer(L.FRAMEBUFFER,O.framebuffer.webGLFramebuffer),L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,O.texture.webGLTexture,0),L.clearColor(0,0,0,0),L.clear(L.COLOR_BUFFER_BIT),this.setTexture2D(x),this.batchVert(e,i,u,c,0,y,p),this.batchVert(s,r,u,f,0,y,m),this.batchVert(a,o,d,f,0,y,v),this.batchVert(e,i,u,c,0,y,p),this.batchVert(a,o,d,f,0,y,v),this.batchVert(h,l,d,c,0,y,g),this.flush(),this.flipProjectionMatrix(!1),L.activeTexture(L.TEXTURE0),L.bindTexture(L.TEXTURE_2D,R.texture.webGLTexture),L.copyTexSubImage2D(L.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),L.bindFramebuffer(L.FRAMEBUFFER,null),L.bindTexture(L.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(R,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,a,o){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=this.copyShader);var h=this.gl,l=this.tempSprite;a&&(o=this.colorMatrixShader),this.currentShader=o;var u=this.setVertexBuffer(this.quadVertexBuffer);o.bind(u,!1);var c=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",c.width,c.height),l.preFX.onFXCopy(this),this.onCopySprite(t,e,l),a&&(this.set1fv("uColorMatrix",a.getData()),this.set1f("uAlpha",a.alpha)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture.webGLTexture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var d=e.height-t.height;h.viewport(0,d,t.width,t.height),this.resetUVs()}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture.webGLTexture,0),i&&(h.clearColor(0,0,0,Number(!n)),h.clear(h.COLOR_BUFFER_BIT)),r){var f=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}h.bufferData(h.ARRAY_BUFFER,this.quadVertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),r&&this.renderer.setBlendMode(f),h.bindFramebuffer(h.FRAMEBUFFER,null)},copy:function(t,e){var i=this.gl;this.set1i("uMainSampler",0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.webGLTexture),i.viewport(0,0,t.width,t.height),this.setUVs(0,0,0,1,1,1,1,0),i.bindFramebuffer(i.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e.texture.webGLTexture,0),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.bufferData(i.ARRAY_BUFFER,this.quadVertexData,i.STATIC_DRAW),i.drawArrays(i.TRIANGLES,0,6),i.bindFramebuffer(i.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,a=n+t.width,o=r+t.height,h=s.getX(n,r),l=s.getX(n,o),u=s.getX(a,o),c=s.getX(a,r),d=s.getY(n,r),f=s.getY(n,o),p=s.getY(a,o),g=s.getY(a,r),m=16777215;this.batchVert(h,d,0,0,0,0,m),this.batchVert(l,f,0,1,0,0,m),this.batchVert(u,p,1,1,0,0,m),this.batchVert(h,d,0,0,0,0,m),this.batchVert(u,p,1,1,0,0,m),this.batchVert(c,g,1,0,0,0,m),i.restoreFramebuffer(!1,!0),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),i.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,a,o){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=a,h[38]=o},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){return this.renderer.deleteBuffer(this.quadVertexBuffer),this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.colorMatrixShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,h.prototype.destroy.call(this),this}});t.exports=g},81041:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(57516),a=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=a},12385:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(57516),a=i(45561),o=i(60722),h=i(29100),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",a),t.vertShader=n(t,"vertShader",o),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this);var t=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",t.width,t.height)}});t.exports=l},7589:(t,e,i)=>{var s=i(35407),n=i(10312),r=i(83419),a=i(89422),o=i(96293),h=i(36682),l=i(95540),u=i(48247),c=i(49627),d=i(29100),f=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:o}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.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],t.batchSize=1,d.call(this,t),this.colorMatrix=new a,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture.webGLTexture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture.webGLTexture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,a,o){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===a&&(a=!1),void 0===o&&(o=!1);var h=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture.webGLTexture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var l=e.height-t.height;h.viewport(0,l,t.width,t.height)}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture.webGLTexture,0),s&&(r?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),a){var u=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}o&&this.flipY(),h.bufferData(h.ARRAY_BUFFER,this.vertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),a&&this.renderer.setBlendMode(u),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,a,o){void 0===a&&(a=!0),void 0===o&&(o=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer.webGLFramebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture.webGLTexture,0),a&&(o?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture.webGLTexture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture.webGLTexture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6)},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture.webGLTexture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture.webGLTexture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var a=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture.webGLTexture),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,e.texture.webGLTexture),i?(a.bindFramebuffer(a.FRAMEBUFFER,i.framebuffer.webGLFramebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,i.texture.webGLTexture,0),a.viewport(0,0,i.width,i.height)):a.viewport(0,0,t.width,t.height),n?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT),a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer.webGLFramebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s.webGLFramebuffer)},setUVs:function(t,e,i,s,n,r,a,o){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=a,h[23]=o},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},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)}});t.exports=f},36060:t=>{t.exports={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",MOBILE_PIPELINE:"MobilePipeline",FX_PIPELINE:"FxPipeline"}},84817:t=>{t.exports="pipelineafterflush"},36712:t=>{t.exports="pipelinebeforeflush"},40285:t=>{t.exports="pipelinebind"},65918:t=>{t.exports="pipelineboot"},92852:t=>{t.exports="pipelinedestroy"},56072:t=>{t.exports="pipelinerebind"},57566:t=>{t.exports="pipelineresize"},77085:(t,e,i)=>{t.exports={AFTER_FLUSH:i(84817),BEFORE_FLUSH:i(36712),BIND:i(40285),BOOT:i(65918),DESTROY:i(92852),REBIND:i(56072),RESIZE:i(57566)}},54812:(t,e,i)=>{var s=i(83419),n=i(99155),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.amount=1},onPreRender:function(t,e){t=this.getController(t),this.set1f("amount",t.amount,e)}});t.exports=a},67329:(t,e,i)=>{var s=i(83419),n=i(24400),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(t){t=this.getController(t),this.set1f("strength",t.blurStrength),this.set3fv("color",t.glcolor)},onDraw:function(t){var e=this.getController(),i=this.fullFrame1,s=this.fullFrame2;this.copyFrame(t,s);for(var n=2/t.width*e.offsetX,r=2/t.height*e.offsetY,a=0;a<e.steps;a++)this.set2f("offset",n,0),this.copySprite(t,i),this.set2f("offset",0,r),this.copySprite(i,t);this.blendFrames(s,t,i,e.strength),this.copyToGame(i)}});t.exports=a},8861:(t,e,i)=>{var s=i(83419),n=i(41514),r=i(51078),a=i(94328),o=i(84057),h=new s({Extends:o,initialize:function(t){o.call(this,{game:t,shaders:[{name:"Gaussian5",fragShader:n},{name:"Gaussian9",fragShader:r},{name:"Gaussian13",fragShader:a}]}),this.activeShader=this.shaders[0],this.x=2,this.y=2,this.steps=4,this.strength=1,this.glcolor=[1,1,1]},setQualityLow:function(){return this.activeShader=this.shaders[0],this},setQualityMedium:function(){return this.activeShader=this.shaders[1],this},setQualityHigh:function(){return this.activeShader=this.shaders[2],this},onDraw:function(t){var e=this.getController(),i=this.gl,s=this.fullFrame1,n=i.getParameter(i.FRAMEBUFFER_BINDING);this.bind(this.shaders[e.quality]),i.activeTexture(i.TEXTURE0),i.viewport(0,0,t.width,t.height),this.set1i("uMainSampler",0),this.set2f("resolution",t.width,t.height),this.set1f("strength",e.strength),this.set3fv("color",e.glcolor);for(var r=0;r<e.steps;r++)this.set2f("offset",e.x,0),this.copySprite(t,s),this.set2f("offset",0,e.y),this.copySprite(s,t);i.bindFramebuffer(i.FRAMEBUFFER,n),i.bindTexture(i.TEXTURE_2D,null),this.copyToGame(t)}});t.exports=h},51051:(t,e,i)=>{var s=i(83419),n=i(90610),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("radius",t.radius,e),this.set1f("amount",t.amount,e),this.set1f("contrast",t.contrast,e),this.set1f("strength",t.strength,e),this.set2f("blur",t.blurX,t.blurY,e),this.setBoolean("isTiltShift",t.isTiltShift,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=a},89428:(t,e,i)=>{var s=i(83419),n=i(91899),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("scale",t.scale,e),this.set1f("feather",t.feather,e),this.set1f("thickness",t.thickness,e),this.set3fv("color",t.glcolor,e),this.set4fv("backgroundColor",t.glcolor2,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=a},88904:(t,e,i)=>{var s=i(83419),n=i(84057),r=new s({Extends:n,initialize:function(t){n.call(this,{game:t})},onDraw:function(t){var e=this.fullFrame1;this.controller?this.manager.drawFrame(t,e,!0,this.controller):this.drawFrame(t,e),this.copyToGame(e)}});t.exports=r},63563:(t,e,i)=>{var s=i(83419),n=i(47838),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(t){var e=this.game.textures.getFrame(t);e&&(this.glTexture=e.glTexture)},onDraw:function(t){var e=this.getController(),i=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",e.x,e.y),this.bindTexture(e.glTexture,1),this.copySprite(t,i),this.copyToGame(i)}});t.exports=a},94045:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(98656),a=i(84057),o=i(70554),h=new s({Extends:a,initialize:function(t,e){var i=n(e,"quality",.1),s=n(e,"distance",10);a.call(this,{game:t,fragShader:o.setGlowQuality(r,t,i,s)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("outerStrength",t.outerStrength,e),this.set1f("innerStrength",t.innerStrength,e),this.set4fv("glowColor",t.glcolor,e),this.setBoolean("knockout",t.knockout,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=h},74088:(t,e,i)=>{var s=i(83419),n=i(70463),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.alpha=.2,this.size=0,this.fromX=0,this.fromY=0,this.toX=0,this.toY=1,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0]},onPreRender:function(t,e){t=this.getController(t),this.set1f("alpha",t.alpha,e),this.set1i("size",t.size,e),this.set3fv("color1",t.glcolor1,e),this.set3fv("color2",t.glcolor2,e),this.set2f("positionFrom",t.fromX,t.fromY,e),this.set2f("positionTo",t.toX,t.toY,e)}});t.exports=a},99636:(t,e,i)=>{var s=i(83419),n=i(50831),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.amount=1},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("amount",t.amount,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=a},34700:(t,e,i)=>{var s=i(83419),n=i(92595),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=0,this.y=0,this.decay=.1,this.power=1,this.glcolor=[0,0,0,1],this.samples=6,this.intensity=1},onPreRender:function(t,e){var i=(t=this.getController(t)).samples;this.set1i("samples",i,e),this.set1f("intensity",t.intensity,e),this.set1f("decay",t.decay,e),this.set1f("power",t.power/i,e),this.set2f("lightPosition",t.x,t.y,e),this.set4fv("color",t.glcolor,e)}});t.exports=a},91157:(t,e,i)=>{var s=i(83419),n=i(72464),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(t,e,i,s){t=this.getController(t),this.setTime("time",e),this.set1f("speed",t.speed,e),this.set1f("lineWidth",t.lineWidth,e),this.set1f("gradient",t.gradient,e),this.setBoolean("reveal",t.reveal,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=a},27797:(t,e,i)=>{var s=i(83419),n=i(39249),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(t,e){t=this.getController(t),this.set1f("radius",t.radius,e),this.set1f("strength",t.strength,e),this.set2f("position",t.x,t.y,e)}});t.exports=a},67603:(t,e,i)=>{var s=i(83419),n=i(2878),r=i(84057),a=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(t,e){var i=(t=this.getController(t)).progress,s=t.wipeWidth,n=t.direction,r=t.axis;this.set4f("config",i,s,n,r,e),this.setBoolean("reveal",t.reveal,e)}});t.exports=a},58918:(t,e,i)=>{var s={Barrel:i(54812),Bloom:i(67329),Blur:i(8861),Bokeh:i(51051),Circle:i(89428),ColorMatrix:i(88904),Displacement:i(63563),Glow:i(94045),Gradient:i(74088),Pixelate:i(99636),Shadow:i(34700),Shine:i(91157),Vignette:i(27797),Wipe:i(67603)};t.exports=s},96615:(t,e,i)=>{var s=i(36060),n=i(79291),r={FX:i(58918),BitmapMaskPipeline:i(31302),Events:i(77085),FXPipeline:i(92651),LightPipeline:i(96569),MobilePipeline:i(56527),MultiPipeline:i(57516),PointLightPipeline:i(43439),PostFXPipeline:i(84057),PreFXPipeline:i(43558),RopePipeline:i(81041),SinglePipeline:i(12385),UtilityPipeline:i(7589)};r=n(!1,r,s),t.exports=r},35407:t=>{t.exports=["#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")},78908:t=>{t.exports=["#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);"," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }"," gl_FragColor = mainColor;","}"].join("\n")},85191:t=>{t.exports=["#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")},96293:t=>{t.exports=["#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")},36682:t=>{t.exports=["#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")},99155:t=>{t.exports=["#define SHADER_NAME BARREL_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},24400:t=>{t.exports=["#define SHADER_NAME BLOOM_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec4 sum = texture2D(uMainSampler, outTexCoord) * 0.204164 * strength;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord - offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 3.294215) * 0.093913;"," gl_FragColor = (sum + texture2D(uMainSampler, outTexCoord - offset * 3.294215) * 0.093913) * vec4(color, 1);","}"].join("\n")},94328:t=>{t.exports=["#define SHADER_NAME BLUR_HIGH_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.1964825501511404;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += texture2D(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},41514:t=>{t.exports=["#define SHADER_NAME BLUR_LOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.29411764705882354;"," col += texture2D(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += texture2D(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},51078:t=>{t.exports=["#define SHADER_NAME BLUR_MED_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.2270270270;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},90610:t=>{t.exports=["#define SHADER_NAME BOKEH_FS","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = texture2D(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},91899:t=>{t.exports=["#define SHADER_NAME CIRCLE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec3 color;","uniform vec4 backgroundColor;","uniform float thickness;","uniform float scale;","uniform float feather;","varying vec2 outTexCoord;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 position = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;"," float aspectRatio = resolution.x / resolution.y;"," position.x *= aspectRatio;"," float grad = length(position);"," float outer = aspectRatio;"," float inner = outer - (thickness * 2.0 / resolution.y);"," if (aspectRatio >= 1.0)"," {"," float f = 2.0 + (resolution.y / resolution.x);"," outer = 1.0;"," inner = 1.0 - (thickness * f / resolution.x);"," }"," outer *= scale;"," inner *= scale;"," float circle = smoothstep(outer, outer - 0.01, grad);"," float ring = circle - smoothstep(inner, inner - feather, grad);"," texture = mix(backgroundColor * backgroundColor.a, texture, texture.a);"," texture = (texture * (circle - ring));"," gl_FragColor = vec4(texture.rgb + (ring * color), texture.a);","}"].join("\n")},47838:t=>{t.exports=["#define SHADER_NAME DISPLACEMENT_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rr) * amount;"," gl_FragColor = texture2D(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},98656:t=>{t.exports=["#define SHADER_NAME GLOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float DIST = __DIST__;","const float SIZE = min(__SIZE__, PI * 2.0);","const float STEP = ceil(PI * 2.0 / SIZE);","const float MAX_ALPHA = STEP * DIST * (DIST + 1.0) / 2.0;","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y);"," float totalAlpha = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float angle = 0.0; angle < PI * 2.0; angle += SIZE)"," {"," direction = vec2(cos(angle), sin(angle)) * px;"," for (float curDistance = 0.0; curDistance < DIST; curDistance++)"," {"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = texture2D(uMainSampler, displaced);"," totalAlpha += (DIST - curDistance) * color.a;"," }"," }"," color = texture2D(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," if (knockout)"," {"," float resultAlpha = outerGlowAlpha + innerGlowAlpha;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},70463:t=>{t.exports=["#define SHADER_NAME GRADIENT_FS","#define SRGB_TO_LINEAR(c) pow((c), vec3(2.2))","#define LINEAR_TO_SRGB(c) pow((c), vec3(1.0 / 2.2))","#define SRGB(r, g, b) SRGB_TO_LINEAR(vec3(float(r), float(g), float(b)) / 255.0)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 positionFrom;","uniform vec2 positionTo;","uniform vec3 color1;","uniform vec3 color2;","uniform float alpha;","uniform int size;","varying vec2 outTexCoord;","float gradientNoise(in vec2 uv)","{"," const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);"," return fract(magic.z * fract(dot(uv, magic.xy)));","}","float stepped (in float s, in float scale, in int steps)","{"," return steps > 0 ? floor( s / ((1.0 * scale) / float(steps))) * 1.0 / float(steps - 1) : s;","}","void main ()","{"," vec2 a = positionFrom;"," vec2 b = positionTo;"," vec2 ba = b - a;"," float d = dot(outTexCoord - a, ba) / dot(ba, ba);"," float t = size > 0 ? stepped(d, 1.0, size) : d;"," t = smoothstep(0.0, 1.0, clamp(t, 0.0, 1.0));"," vec3 color = mix(SRGB(color1.r, color1.g, color1.b), SRGB(color2.r, color2.g, color2.b), t);"," color = LINEAR_TO_SRGB(color);"," color += (1.0 / 255.0) * gradientNoise(outTexCoord) - (0.5 / 255.0);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = vec4(mix(color.rgb, texture.rgb, alpha), 1.0) * texture.a;","}"].join("\n")},50831:t=>{t.exports=["#define SHADER_NAME PIXELATE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},92595:t=>{t.exports=["#define SHADER_NAME SHADOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += texture2D(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, shadow * mask);","}"].join("\n")},72464:t=>{t.exports=["#define SHADER_NAME SHINE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform bool reveal;","uniform float speed;","uniform float time;","uniform float lineWidth;","uniform float gradient;","varying vec2 outTexCoord;","void main ()","{","\tvec2 uv = gl_FragCoord.xy / resolution.xy;"," vec4 tex = texture2D(uMainSampler, outTexCoord);"," vec4 col1 = vec4(0.3, 0.0, 0.0, 1.0);"," vec4 col2 = vec4(0.85, 0.85, 0.85, 1.0);"," uv.x = uv.x - mod(time * speed, 2.0) + 0.5;"," float y = uv.x * gradient;"," float s = smoothstep(y - lineWidth, y, uv.y) - smoothstep(y, y + lineWidth, uv.y);"," gl_FragColor = (((s * col1) + (s * col2)) * tex);"," if (!reveal)"," {"," gl_FragColor += tex;"," }","}"].join("\n")},39249:t=>{t.exports=["#define SHADER_NAME VIGNETTE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float radius;","uniform float strength;","uniform vec2 position;","varying vec2 outTexCoord;","void main ()","{"," vec4 col = vec4(1.0);"," float d = length(outTexCoord - position);"," if (d <= radius)"," {"," float g = d / radius;"," g = sin(g * 3.14 * strength);"," \tcol = vec4(g * g * g);"," }"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = texture * (1.0 - col);","}"].join("\n")},2878:t=>{t.exports=["#define SHADER_NAME WIPE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 config;","uniform bool reveal;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 color0;"," vec4 color1;"," if (reveal)"," {"," color0 = vec4(0);"," color1 = texture2D(uMainSampler, uv);"," }"," else"," {"," color0 = texture2D(uMainSampler, uv);"," color1 = vec4(0);"," }"," float distance = config.x;"," float width = config.y;"," float direction = config.z;"," float axis = uv.x;"," if (config.w == 1.0)"," {"," axis = uv.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},31063:t=>{t.exports=["#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;","uniform int uLightCount;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," 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)"," {"," if (index < uLightCount)"," {"," 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")},48247:t=>{t.exports=["#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")},41214:t=>{t.exports=["#define SHADER_NAME PHASER_MESH_FS","precision mediump float;","uniform vec3 uLightPosition;","uniform vec3 uLightAmbient;","uniform vec3 uLightDiffuse;","uniform vec3 uLightSpecular;","uniform vec3 uFogColor;","uniform float uFogNear;","uniform float uFogFar;","uniform vec3 uMaterialAmbient;","uniform vec3 uMaterialDiffuse;","uniform vec3 uMaterialSpecular;","uniform float uMaterialShine;","uniform vec3 uCameraPosition;","uniform sampler2D uTexture;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main (void)","{"," vec4 color = texture2D(uTexture, vTextureCoord);"," vec3 ambient = uLightAmbient * uMaterialAmbient;"," vec3 norm = normalize(vNormal);"," vec3 lightDir = normalize(uLightPosition - vPosition);"," float diff = max(dot(norm, lightDir), 0.0);"," vec3 diffuse = uLightDiffuse * (diff * uMaterialDiffuse);"," vec3 viewDir = normalize(uCameraPosition - vPosition);"," vec3 reflectDir = reflect(-lightDir, norm);"," float spec = pow(max(dot(viewDir, reflectDir), 0.0), uMaterialShine);"," vec3 specular = uLightSpecular * (spec * uMaterialSpecular);"," vec3 result = (ambient + diffuse + specular) * color.rgb;"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," float fogFactor = smoothstep(uFogNear, uFogFar, depth);"," gl_FragColor.rgb = mix(result.rgb, uFogColor, fogFactor);"," gl_FragColor.a = color.a;","}"].join("\n")},39653:t=>{t.exports=["#define SHADER_NAME PHASER_MESH_VS","precision mediump float;","attribute vec3 aVertexPosition;","attribute vec3 aVertexNormal;","attribute vec2 aTextureCoord;","uniform mat4 uViewProjectionMatrix;","uniform mat4 uModelMatrix;","uniform mat4 uNormalMatrix;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main ()","{"," vTextureCoord = aTextureCoord;"," vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));"," vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));"," gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);","}"].join("\n")},62143:t=>{t.exports=["#define SHADER_NAME PHASER_MOBILE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},47940:t=>{t.exports=["#define SHADER_NAME PHASER_MOBILE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","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")},98840:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","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);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},44667:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","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")},4127:t=>{t.exports=["#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;"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924:t=>{t.exports=["#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")},27681:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}"].join("\n")},49627:t=>{t.exports=["#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")},45561:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","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);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},60722:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","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")},89350:(t,e,i)=>{t.exports={AddBlendFrag:i(35407),BitmapMaskFrag:i(78908),BitmapMaskVert:i(85191),ColorMatrixFrag:i(96293),CopyFrag:i(36682),FXBarrelFrag:i(99155),FXBloomFrag:i(24400),FXBlurHighFrag:i(94328),FXBlurLowFrag:i(41514),FXBlurMedFrag:i(51078),FXBokehFrag:i(90610),FXCircleFrag:i(91899),FXDisplacementFrag:i(47838),FXGlowFrag:i(98656),FXGradientFrag:i(70463),FXPixelateFrag:i(50831),FXShadowFrag:i(92595),FXShineFrag:i(72464),FXVignetteFrag:i(39249),FXWipeFrag:i(2878),LightFrag:i(31063),LinearBlendFrag:i(48247),MeshFrag:i(41214),MeshVert:i(39653),MobileFrag:i(62143),MobileVert:i(47940),MultiFrag:i(98840),MultiVert:i(44667),PointLightFrag:i(4127),PointLightVert:i(89924),PostFXFrag:i(27681),QuadVert:i(49627),SingleFrag:i(45561),SingleVert:i(60722)}},93567:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.webGLAttribLocation=-1,this.gl=t,this.program=e,this.name=i,this.createResource()},createResource:function(){if(null!==this.program.webGLProgram){var t=this.gl;t.isContextLost()||(this.webGLAttribLocation=t.getAttribLocation(this.program.webGLProgram,this.name))}else this.webGLAttribLocation=-1},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});t.exports=s},26128:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){this.webGLBuffer=null,this.gl=t,this.initialDataOrSize=e,this.bufferType=i,this.bufferUsage=s,this.createResource()},createResource:function(){if(null!==this.initialDataOrSize){var t=this.gl;if(!t.isContextLost()){var e=this.bufferType,i=t.createBuffer();this.webGLBuffer=i,t.bindBuffer(e,this.webGLBuffer),t.bufferData(e,this.initialDataOrSize,this.bufferUsage),t.bindBuffer(e,null)}}},destroy:function(){var t=this.gl;t.isContextLost()||t.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});t.exports=s},84387:(t,e,i)=>{var s=i(83419),n={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},r=new s({initialize:function(t,e,i,s,n){this.webGLFramebuffer=null,this.gl=t,this.width=e,this.height=i,this.renderTexture=s,this.addDepthStencilBuffer=!!n,this.createResource()},createResource:function(){var t=this.gl;if(!t.isContextLost()){var e,i=this.renderTexture,s=t.createFramebuffer();if(this.webGLFramebuffer=s,t.bindFramebuffer(t.FRAMEBUFFER,s),i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i.webGLTexture,0),(e=t.checkFramebufferStatus(t.FRAMEBUFFER))!==t.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(n[e]||e));if(this.addDepthStencilBuffer){var r=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,r)}t.bindFramebuffer(t.FRAMEBUFFER,null)}},destroy:function(){if(null!==this.webGLFramebuffer){var t=this.gl;if(!t.isContextLost()){t.bindFramebuffer(t.FRAMEBUFFER,this.webGLFramebuffer);var e=t.getFramebufferAttachmentParameter(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);null!==e&&(t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,null,0),t.deleteTexture(e));var i=t.getFramebufferAttachmentParameter(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);null!==i&&t.deleteRenderbuffer(i),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(this.webGLFramebuffer)}this.renderTexture=null,this.webGLFramebuffer=null,this.gl=null}}});t.exports=r},1482:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.webGLProgram=null,this.gl=t,this.vertexSource=e,this.fragmentSource=i,this.createResource()},createResource:function(){var t=this.gl;if(!t.isContextLost()){var e=t.createProgram(),i=t.createShader(t.VERTEX_SHADER),s=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(i,this.vertexSource),t.shaderSource(s,this.fragmentSource),t.compileShader(i),t.compileShader(s);var n="Shader failed:\n";if(!t.getShaderParameter(i,t.COMPILE_STATUS))throw new Error("Vertex "+n+t.getShaderInfoLog(i));if(!t.getShaderParameter(s,t.COMPILE_STATUS))throw new Error("Fragment "+n+t.getShaderInfoLog(s));if(t.attachShader(e,i),t.attachShader(e,s),t.linkProgram(e),!t.getProgramParameter(e,t.LINK_STATUS))throw new Error("Link "+n+t.getProgramInfoLog(e));t.useProgram(e),this.webGLProgram=e}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});t.exports=s},82751:(t,e,i)=>{var s=i(83419),n=i(50030),r=new s({initialize:function(t,e,i,s,n,r,a,o,h,l,u,c,d){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=t,this.mipLevel=e,this.minFilter=i,this.magFilter=s,this.wrapT=n,this.wrapS=r,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!c,this.flipY=!!d,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var t=this.gl;if(!t.isContextLost())if(this.pixels instanceof r)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},update:function(t,e,i,s,n,r,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=s,this.wrapS=n,this.wrapT=r,this.minFilter=a,this.magFilter=o,this.format=h,this.gl.isContextLost()||this._processTexture())},_processTexture:function(){var t=this.gl;t.activeTexture(t.TEXTURE0);var e=t.getParameter(t.TEXTURE_BINDING_2D);t.bindTexture(t.TEXTURE_2D,this.webGLTexture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,this.flipY);var i=this.pixels,s=this.mipLevel,r=this.width,a=this.height,o=this.format,h=!1;if(null==i)t.texImage2D(t.TEXTURE_2D,s,o,r,a,0,o,t.UNSIGNED_BYTE,null),h=n(r,a);else if(i.compressed){r=i.width,a=i.height,h=i.generateMipmap;for(var l=0;l<i.mipmaps.length;l++)t.compressedTexImage2D(t.TEXTURE_2D,l,i.internalFormat,i.mipmaps[l].width,i.mipmaps[l].height,0,i.mipmaps[l].data)}else i instanceof Uint8Array?(t.texImage2D(t.TEXTURE_2D,s,o,r,a,0,o,t.UNSIGNED_BYTE,i),h=n(r,a)):(this.forceSize||(r=i.width,a=i.height),t.texImage2D(t.TEXTURE_2D,s,o,o,t.UNSIGNED_BYTE,i),h=n(r,a));h&&t.generateMipmap(t.TEXTURE_2D),e?t.bindTexture(t.TEXTURE_2D,e):t.bindTexture(t.TEXTURE_2D,null)},spectorMetadata:{get:function(){return this.__SPECTOR_Metadata},set:function(t){this.__SPECTOR_Metadata=t,this.gl.isContextLost()||(this.webGLTexture.__SPECTOR_Metadata=t)}},destroy:function(){null!==this.webGLTexture&&(this.gl.isContextLost()||this.pixels instanceof r||this.gl.deleteTexture(this.webGLTexture),this.pixels=null,this.webGLTexture=null,this.gl=null)}});t.exports=r},57183:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.webGLUniformLocation=null,this.gl=t,this.program=e,this.name=i,this.createResource()},createResource:function(){if(null!==this.program.webGLProgram){var t=this.gl;t.isContextLost()||(this.webGLUniformLocation=t.getUniformLocation(this.program.webGLProgram,this.name))}else this.webGLUniformLocation=null},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});t.exports=s},9503:(t,e,i)=>{var s={WebGLAttribLocationWrapper:i(93567),WebGLBufferWrapper:i(26128),WebGLProgramWrapper:i(1482),WebGLTextureWrapper:i(82751),WebGLFramebufferWrapper:i(84387),WebGLUniformLocationWrapper:i(57183)};t.exports=s},76531:(t,e,i)=>{var s=i(13560),n=i(83419),r=i(45319),a=i(50792),o=i(97480),h=i(8443),l=i(57811),u=i(74403),c=i(45818),d=i(29747),f=i(87841),p=i(86555),g=i(56583),m=i(26099),v=i(38058),y=new n({Extends:a,initialize:function(t){a.call(this),this.game=t,this.canvas,this.canvasBounds=new f,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.domlisteners={orientationChange:d,windowResize:d,fullScreenChange:d,fullScreenError:d}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(h.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen;var e=this.scaleMode;e!==s.SCALE_MODE.RESIZE&&e!==s.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(e),e===s.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()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=n,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=c(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return s&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=c(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===s.SCALE_MODE.NONE)this.displaySize.setSize(n*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===s.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),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===s.SCALE_MODE.EXPAND){var l,u,c=this.game.config.width,d=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,g=f/c,m=p/d;g<m?(l=c,u=0!==g?p/g:d):(l=0!==m?f/m:c,u=d);var v=r(l,this.displaySize.minWidth,this.displaySize.maxWidth),y=r(u,this.displaySize.minHeight,this.displaySize.maxHeight);this.baseSize.setSize(v,y),this.gameSize.setSize(v,y),h&&(v=Math.floor(v),y=Math.floor(y)),this.canvas.width=v,this.canvas.height=y;var x=f*(v/l),w=p*(y/u);this.displaySize.setSize(x,w),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"}else this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px";this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=g(this.parentSize.width,this.gameSize.width,0,!0),e=g(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,a=n.height,o=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-a)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(o=0),i.marginLeft=o+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}return this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas)),this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget()},leaveFullScreenSuccessHandler:function(){this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.domlisteners;e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0,t.refresh()},e.windowResize=function(){t.updateBounds(),t.dirty=!0},screen.orientation&&screen.orientation.addEventListener?screen.orientation.addEventListener("change",e.orientationChange,!1):window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available&&(e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)},["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1))},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():(this.stopFullscreen(),this.leaveFullScreenSuccessHandler())},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t,e){t instanceof v||(e=t,t=void 0),void 0===e&&(e=new f);var i,s,n=this.baseSize,r=this.parentSize,a=this.canvasBounds,o=this.displayScale,h=a.x>=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=r.width>=a.width?n.width:n.width-(a.width-r.width)*o.x,s=r.height>=a.height?n.height:n.height-(a.height-r.height)*o.y,e.setTo(h,l,i,s),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1),["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.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===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=y},64743:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:t=>{t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(t,e,i)=>{var s={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=s},56139:t=>{t.exports="enterfullscreen"},2336:t=>{t.exports="fullscreenfailed"},47412:t=>{t.exports="fullscreenunsupported"},51452:t=>{t.exports="leavefullscreen"},20666:t=>{t.exports="orientationchange"},47945:t=>{t.exports="resize"},97480:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364:(t,e,i)=>{var s=i(79291),n=i(13560),r={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},27397:(t,e,i)=>{var s=i(95540),n=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var a in i)a=n(a.concat("Physics")),-1===r.indexOf(a)&&r.push(a);return r}}},52106:(t,e,i)=>{var s=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033:t=>{t.exports={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",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},97482:(t,e,i)=>{var s=i(83419),n=i(2368),r=new s({initialize:function(t){this.sys=new n(this,t),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(){}});t.exports=r},60903:(t,e,i)=>{var s=i(83419),n=i(89993),r=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),c=i(2368),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once(a.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,s;for(this.systemScene=this.createSceneFromInstance("__SYSTEM",new u),this.game.events.emit(a.SYSTEM_READY,this.systemScene,this),t=0;t<this._pending.length;t++){var n;i=(e=this._pending[t]).key,(s=e.scene)instanceof u?n=this.createSceneFromInstance(i,s):"object"==typeof s?n=this.createSceneFromObject(i,s):"function"==typeof s&&(n=this.createSceneFromFunction(i,s)),i=n.sys.settings.key,this.keys[i]=n,this.scenes.push(n),this._data[i]&&(n.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||n.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,s;if(t){for(i=0;i<t;i++)s=this._pending[i],this.add(s.key,s.scene,s.autoStart,s.data);for(i=0;i<this._start.length;i++)s=this._start[i],this.start(s);this._start.length=0,this._pending.length=0}for(i=0;i<this._queue.length;i++)this[(s=this._queue[i]).op](s.keyA,s.keyB,s.data);this._queue.length=0}},add:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:s}),this.isBooted||(this._data[t]={data:s}),null):(t=this.getKey(t,e),e instanceof u?n=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,n=this.createSceneFromObject(t,e)):"function"==typeof e&&(n=this.createSceneFromFunction(t,e)),n.sys.settings.data=s,t=n.sys.settings.key,this.keys[t]=n,this.scenes.push(n),(i||n.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),n);var n},remove:function(t){if(this.isProcessing)return this.queueOp("remove",t);var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),s=e.sys.settings.key;return i>-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e),s.scenePlugin&&s.scenePlugin._target&&s.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=n.LOADING&&i.settings.status<n.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=n.CREATING,t.create.call(t,i.data),i.status===n.DESTROYED)||(i.isTransition&&e.events.emit(r.TRANSITION_START,i.transitionFrom,i.transitionDuration),t.update&&(e.sceneUpdate=t.update),i.status=n.RUNNING,e.events.emit(r.CREATE,t))},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof u){var s=i.sys.settings.key;if(""!==s&&(t=s),this.keys.hasOwnProperty(t))throw new Error("Cannot add Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new c(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){return""===e.sys.settings.key&&(e.sys.settings.key=t),e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new u(e),s=i.sys.settings.key;""!==s?t=s:i.sys.settings.key=t,i.sys.init(this.game);for(var n=["init","preload","create","update","render"],r=0;r<n.length;r++){var a=o(e,n[r],null);a&&(i[n[r]]=a)}if(e.hasOwnProperty("extend"))for(var h in e.extend)if(e.extend.hasOwnProperty(h)){var l=e.extend[h];"data"===h&&i.hasOwnProperty("data")&&"object"==typeof l?i.data.merge(l):"sys"!==h&&(i[h]=l)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof u?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add Scene with duplicate key: "+t);return t},getScenes:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1);for(var i=[],s=this.scenes,n=0;n<s.length;n++){var r=s[n];r&&(!t||t&&r.sys.isActive())&&i.push(r)}return e?i.reverse():i},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isPaused:function(t){var e=this.getScene(t);return e?e.sys.isPaused():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var s=0;s<this._pending.length;s++)if(this._pending[s].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isPaused()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(!i)return console.warn("Scene key not found: "+t),this;var s,r=i.sys,a=r.settings.status;if(a>=n.START&&a<=n.CREATING)return this;if(a>=n.RUNNING&&a<=n.SLEEPING)r.shutdown(),r.sceneUpdate=l,r.start(e);else if(r.sceneUpdate=l,r.start(e),r.load&&(s=r.load),s&&r.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:r.settings.pack})))return r.settings.status=n.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==n.SHUTDOWN){var s=i.sys.load;s&&(s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var s=this.getScene(t),n=this.getScene(e);return s&&n&&s!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e<i.length){var s=this.getScene(t);i.splice(e,1),i.push(s)}return this},sendToBack:function(t){if(this.isProcessing)return this.queueOp("sendToBack",t);var e=this.getIndex(t);if(-1!==e&&e>0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveAbove",t,e);var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s<i){var n=this.getAt(s);this.scenes.splice(s,1),this.scenes.splice(i+(s>i),0,n)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var n=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(n):this.scenes.splice(i-(s<i),0,n)}return this},queueOp:function(t,e,i,s){return this._queue.push({op:t,keyA:e,keyB:i,data:s}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("swapPosition",t,e);var i=this.getIndex(t),s=this.getIndex(e);if(i!==s&&-1!==i&&-1!==s){var n=this.getAt(i);this.scenes[i]=this.scenes[s],this.scenes[s]=n}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var s=this.scenes[i].sys,r=!s.settings.visible||s.settings.status!==n.RUNNING&&s.settings.status!==n.PAUSED?"[-] ":"[*] ";r+=s.settings.key+" ("+e[s.settings.status]+")",t.push(r)}console.log(t.join("\n"))},destroy:function(){for(var t=0;t<this.scenes.length;t++)this.scenes[t].sys.destroy();this.systemScene.sys.destroy(),this.update=l,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null,this.systemScene=null}});t.exports=d},52209:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(44594),a=i(95540),o=i(37277),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.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,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var n=a(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var o=a(t,"allowInput",!1);this.settings.transitionAllowInput=o;var h=i.sys.settings;h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=o,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(a(t,"data")):this.manager.start(e,a(t,"data"));var l=a(t,"onStart",null),u=a(t,"onStartScope",this.scene);return l&&l.call(u,this.scene,i,s),this.systems.events.emit(r.TRANSITION_OUT,i,s),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.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(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681:(t,e,i)=>{var s=i(89993),n=i(35154),r=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(a,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=o},2368:(t,e,i)=>{var s=i(83419),n=i(89993),r=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),c=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),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=l},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=n.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=n.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>n.PENDING&&t<=n.RUNNING},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.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(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s<i.length;s++)this[i[s]]=null}});t.exports=c},89993:t=>{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},69830:t=>{t.exports="addedtoscene"},7919:t=>{t.exports="boot"},46763:t=>{t.exports="create"},11763:t=>{t.exports="destroy"},71555:t=>{t.exports="pause"},36735:t=>{t.exports="postupdate"},3809:t=>{t.exports="prerender"},90716:t=>{t.exports="preupdate"},58262:t=>{t.exports="ready"},91633:t=>{t.exports="removedfromscene"},10319:t=>{t.exports="render"},87132:t=>{t.exports="resume"},81961:t=>{t.exports="shutdown"},90194:t=>{t.exports="sleep"},6265:t=>{t.exports="start"},33178:t=>{t.exports="transitioncomplete"},43063:t=>{t.exports="transitioninit"},11259:t=>{t.exports="transitionout"},61611:t=>{t.exports="transitionstart"},45209:t=>{t.exports="transitionwake"},22966:t=>{t.exports="update"},21747:t=>{t.exports="wake"},44594:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(69830),BOOT:i(7919),CREATE:i(46763),DESTROY:i(11763),PAUSE:i(71555),POST_UPDATE:i(36735),PRE_RENDER:i(3809),PRE_UPDATE:i(90716),READY:i(58262),REMOVED_FROM_SCENE:i(91633),RENDER:i(10319),RESUME:i(87132),SHUTDOWN:i(81961),SLEEP:i(90194),START:i(6265),TRANSITION_COMPLETE:i(33178),TRANSITION_INIT:i(43063),TRANSITION_OUT:i(11259),TRANSITION_START:i(61611),TRANSITION_WAKE:i(45209),UPDATE:i(22966),WAKE:i(21747)}},62194:(t,e,i)=>{var s=i(89993),n=i(79291),r={Events:i(44594),GetPhysicsPlugins:i(27397),GetScenePlugins:i(52106),SceneManager:i(60903),ScenePlugin:i(52209),Settings:i(55681),Systems:i(2368)};r=n(!1,r,s),t.exports=r},30341:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(14463),a=i(79291),o=i(29747),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,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=a(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=a(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=a(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],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=a(this.currentConfig,e),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:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.stop(),this.emit(r.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},85034:(t,e,i)=>{var s=i(83419),n=i(41786),r=i(50792),a=i(14463),o=i(8443),h=i(46710),l=i(58731),u=i(29747),c=i(26099),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.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,this.gameLostFocus=!1,this.listenerPosition=new c;var e=t.events;e.on(o.BLUR,this.onGameBlur,this),e.on(o.FOCUS,this.onGameFocus,this),e.on(o.PRE_STEP,this.update,this),e.once(o.DESTROY,this.destroy,this)},add:u,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),a=i.spritemap[s];r.loop=!!a.hasOwnProperty("loop")&&a.loop,i.addMarker({name:s,start:a.start,duration:a.end-a.start,config:r})}return i},get:function(t){return l(this.sounds,"key",t)},getAll:function(t){return t?h(this.sounds,"key",t):h(this.sounds)},getAllPlaying:function(){return h(this.sounds,"isPlaying",!0)},play:function(t,e){var i=this.add(t);return i.once(a.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(a.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.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(i){i.update(t,e)}))},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=d},14747:(t,e,i)=>{var s=i(33684),n=i(25960),r=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=a},19723:t=>{t.exports="complete"},98882:t=>{t.exports="decodedall"},57506:t=>{t.exports="decoded"},73146:t=>{t.exports="destroy"},11305:t=>{t.exports="detune"},40577:t=>{t.exports="detune"},30333:t=>{t.exports="mute"},20394:t=>{t.exports="rate"},21802:t=>{t.exports="volume"},1299:t=>{t.exports="looped"},99190:t=>{t.exports="loop"},97125:t=>{t.exports="mute"},89259:t=>{t.exports="pan"},79986:t=>{t.exports="pauseall"},17586:t=>{t.exports="pause"},19618:t=>{t.exports="play"},42306:t=>{t.exports="rate"},10387:t=>{t.exports="resumeall"},48959:t=>{t.exports="resume"},9960:t=>{t.exports="seek"},19180:t=>{t.exports="stopall"},98328:t=>{t.exports="stop"},50401:t=>{t.exports="unlocked"},52498:t=>{t.exports="volume"},14463:(t,e,i)=>{t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895:(t,e,i)=>{var s=i(30341),n=i(83419),r=i(14463),a=i(45319),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!s.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit(r.PLAY,this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||this.startTime>0||!s.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||this.startTime>0||!s.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit(r.RESUME,this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound((function(t){t.key===this.key&&t.audio&&i.push(t)}),this),i.sort((function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1}));var s=i[0];return this.audio=s.audio,s.reset(),s.audio=null,s.startTime=0,s.previousTime=0,!0},playCatchPromise:function(){var t=this.audio.play();t&&t.catch((function(t){console.warn(t)}))},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){s.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(t){if(this.isPlaying)if(this.startTime>0)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var e=this.currentMarker?this.currentMarker.start:0,i=e+this.duration,s=this.audio.currentTime;if(this.currentConfig.loop)s>=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s<e&&(this.audio.currentTime+=e,s=this.audio.currentTime),s<this.previousTime&&this.emit(r.LOOPED,this);else if(s>=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.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=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684:(t,e,i)=>{var s=i(85034),n=i(83419),r=i(14463),a=i(64895),o=new n({Extends:s,initialize:function(t){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,s.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s<i.length;s++)if("true"===i[s].dataset.locked)return t.locked=!0,!1;return!0})),this.locked){var e=!1,i=function(){e=!0},s=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",s);var n=[];if(t.game.cache.audio.entries.each((function(t,e){for(var i=0;i<e.length;i++){var s=e[i];"true"===s.dataset.locked&&n.push(s)}return!0})),0!==n.length){var r=n[n.length-1];r.oncanplaythrough=function(){r.oncanplaythrough=null,n.forEach((function(t){t.dataset.locked="false"})),t.unlocked=!0},n.forEach((function(t){t.load()}))}}};this.once(r.UNLOCKED,(function(){for(this.forEachActiveSound((function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration}));this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}}),this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",s,!1)}},onBlur:function(){this.forEachActiveSound((function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())}))},onFocus:function(){this.onBlurPausedSounds.forEach((function(t){t.onFocus()})),this.onBlurPausedSounds.length=0},destroy:function(){s.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound((function(t){t.updateMute()})),this.emit(r.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound((function(t){t.updateVolume()})),this.emit(r.GLOBAL_VOLUME,this,t)}}});t.exports=o},23717:(t,e,i)=>{t.exports={SoundManagerCreator:i(14747),Events:i(14463),BaseSound:i(30341),BaseSoundManager:i(85034),WebAudioSound:i(71741),WebAudioSoundManager:i(57490),HTML5AudioSound:i(64895),HTML5AudioSoundManager:i(33684),NoAudioSound:i(4603),NoAudioSoundManager:i(25960)}},4603:(t,e,i)=>{var s=i(30341),n=i(83419),r=i(50792),a=i(79291),o=i(29747),h=function(){return!1},l=function(){return null},u=function(){return this},c=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=a({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),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:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:o,calculateRate:l,destroy:function(){s.prototype.destroy.call(this)}});t.exports=c},25960:(t,e,i)=>{var s=i(85034),n=i(83419),r=i(50792),a=i(4603),o=i(29747),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return s.prototype.get.call(this,t)},getAll:function(t){return s.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeAll:function(){return s.prototype.removeAll.call(this)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},stopByKey:function(t){return s.prototype.stopByKey.call(this,t)},onBlur:o,onFocus:o,onGameBlur:o,onGameFocus:o,pauseAll:o,resumeAll:o,stopAll:o,update:o,setRate:o,setDetune:o,setMute:o,setVolume:o,unlock:o,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},71741:(t,e,i)=>{var s=i(30341),n=i(83419),r=i(14463),a=i(95540),o=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" not found in cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createPanner&&(this.spatialNode=t.context.createPanner(),this.volumeNode.connect(this.spatialNode)),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),t.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):t.context.createPanner?this.spatialNode.connect(t.destination):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime||!s.prototype.pause.call(this)||(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(r.PAUSE,this),0))},resume:function(){return!(this.manager.context.currentTime<this.startTime||!s.prototype.resume.call(this)||(this.createAndStartBufferSource(),this.emit(r.RESUME,this),0))},stop:function(){return!!s.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(r.STOP,this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,s=(this.currentMarker?this.currentMarker.start:0)+t,n=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,s),Math.max(0,n)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var t=this,e=this.manager.context.createBufferSource();return e.buffer=this.audioBuffer,e.connect(this.muteNode),e.onended=function(e){var i=e.target;i!==t.source&&i!==t.loopSource||(t.currentConfig.loop?t.hasLooped=!0:t.hasEnded=!0)},e},stopAndRemoveBufferSource:function(){if(this.source){var t=this.source;this.source=null,t.stop(),t.disconnect()}this.playTime=0,this.startTime=0,this.hasEnded=!1,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});var t=this.currentConfig.source;if(t&&this.manager.context.createPanner){var e=this.spatialNode;e.panningModel=a(t,"panningModel","equalpower"),e.distanceModel=a(t,"distanceModel","inverse"),e.orientationX.value=a(t,"orientationX",0),e.orientationY.value=a(t,"orientationY",0),e.orientationZ.value=a(t,"orientationZ",-1),e.refDistance=a(t,"refDistance",1),e.maxDistance=a(t,"maxDistance",1e4),e.rolloffFactor=a(t,"rolloffFactor",1),e.coneInnerAngle=a(t,"coneInnerAngle",360),e.coneOuterAngle=a(t,"coneOuterAngle",0),e.coneOuterGain=a(t,"coneOuterGain",0),this.spatialSource=a(t,"follow",null),this.spatialSource||(e.positionX.value=a(t,"x",0),e.positionY.value=a(t,"y",0),e.positionZ.value=a(t,"z",0))}s.prototype.applyConfig.call(this)},x:{get:function(){return this.spatialNode?this.spatialNode.positionX:0},set:function(t){this.spatialNode&&(this.spatialNode.positionX.value=t)}},y:{get:function(){return this.spatialNode?this.spatialNode.positionY:0},set:function(t){this.spatialNode&&(this.spatialNode.positionY.value=t)}},update:function(){if(this.isPlaying&&this.spatialSource){var t=a(this.spatialSource,"x",null),e=a(this.spatialSource,"y",null);t&&t!==this._spatialx&&(this._spatialx=this.spatialNode.positionX.value=t),e&&e!==this._spatialy&&(this._spatialy=this.spatialNode.positionY.value=e)}this.hasEnded?(s.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(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(r.LOOPED,this))},destroy:function(){this.pendingRemove||(s.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.spatialNode&&(this.spatialNode.disconnect(),this.spatialNode=null,this.spatialSource=null),this.rateUpdates.length=0,this.rateUpdates=null)},calculateRate:function(){s.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++)t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate;return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit(r.RATE,this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit(r.DETUNE,this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit(r.MUTE,this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit(r.VOLUME,this,t)}},setVolume:function(t){return this.volume=t,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(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit(r.LOOP,this,t)}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.pannerNode?this.pannerNode.pan.value:0},set:function(t){this.currentConfig.pan=t,this.pannerNode&&this.pannerNode.pan.setValueAtTime(t,this.manager.context.currentTime),this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},57490:(t,e,i)=>{var s=i(53134),n=i(85034),r=i(83419),a=i(14463),o=i(8443),h=i(71741),l=i(95540),u=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),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,n.call(this,t),this.locked&&(t.isBooted?this.unlock():t.events.once(o.BOOT,this.unlock,this)),t.events.on(o.VISIBLE,this.onGameVisible,this)},onGameVisible:function(){var t=this.context;window.setTimeout((function(){t&&(t.suspend(),t.resume())}),100)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,o=0;o<i.length;o++){var h=i[o],l=h.key,u=h.data;"string"==typeof u&&(u=s(u));var c=function(t,e){n.add(t,e),this.emit(a.DECODED,t),0===--r&&this.emit(a.DECODED_ALL)}.bind(this,l),d=function(t,e){console.error("Error decoding audio: "+t+" - ",e?e.message:""),0===--r&&this.emit(a.DECODED_ALL)}.bind(this,l);this.context.decodeAudioData(u,c,d)}},setListenerPosition:function(t,e){return void 0===t&&(t=this.game.scale.width/2),void 0===e&&(e=this.game.scale.height/2),this.listenerPosition.set(t,e),this},unlock:function(){var t=this,e=document.body,i=function i(){if(t.context&&e){var s=e.removeEventListener.bind(e);t.context.resume().then((function(){s("touchstart",i),s("touchend",i),s("mousedown",i),s("mouseup",i),s("keydown",i),t.unlocked=!0}),(function(){s("touchstart",i),s("touchend",i),s("mousedown",i),s("mouseup",i),s("keydown",i)}))}};e&&(e.addEventListener("touchstart",i,!1),e.addEventListener("touchend",i,!1),e.addEventListener("mousedown",i,!1),e.addEventListener("mouseup",i,!1),e.addEventListener("keydown",i,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){var t=this.context;!t||this.locked||"suspended"!==t.state&&"interrupted"!==t.state||t.resume()},update:function(t,e){var i=this.context.listener,s=l(this.listenerPosition,"x",null),r=l(this.listenerPosition,"y",null);if(i&&void 0!==i.positionX)s&&s!==this._spatialx&&(this._spatialx=i.positionX.value=s),r&&r!==this._spatialy&&(this._spatialy=i.positionY.value=r);else if(i){s&&s!==this._spatialx&&(this._spatialx=s),r&&r!==this._spatialy&&(this._spatialy=r);var a=l(i,"z",0);i.setPosition(this._spatialx||0,this._spatialy||0,a)}n.prototype.update.call(this,t,e),this.gameLostFocus||this.onFocus()},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 t=this;this.context.close().then((function(){t.context=null}))}this.game.events.off(o.VISIBLE,this.onGameVisible,this),n.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit(a.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit(a.GLOBAL_VOLUME,this,t)}}});t.exports=u},73162:(t,e,i)=>{var s=i(37105),n=i(83419),r=i(29747),a=i(19186),o=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),a(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s<arguments.length;s++)i.push(arguments[s]);for(s=0;s<this.list.length;s++)i[0]=this.list[s],t.apply(e,i)},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}}});t.exports=o},90330:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1]);return this},set:function(t,e){return this.has(t)||this.size++,this.entries[t]=e,this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach((function(t){delete this.entries[t]}),this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,s=t.entries;for(var n in s)i.hasOwnProperty(n)&&e?i[n]=s[n]:this.set(n,s[n]);return this}});t.exports=s},25774:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(82348),a=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t<i.length;t++){e=i[t];var n=s.indexOf(e);-1!==n&&(s.splice(n,1),this.emit(r.PROCESS_QUEUE_REMOVE,e))}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],(!this.checkQueue||this.checkQueue&&-1===s.indexOf(e))&&(s.push(e),this.emit(r.PROCESS_QUEUE_ADD,e));return i.length=0,this._toProcess=0,s},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}});t.exports=a},59542:(t,e,i)=>{var s=i(43886);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s<e.length;s++)if(i(t,e[s]))return s;return-1}function a(t,e){o(t,0,t.children.length,e,t)}function o(t,e,i,s,n){n||(n=g(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var r,a=e;a<i;a++)r=t.children[a],h(n,t.leaf?s(r):r);return n}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,e,i,n,r){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(a=e+Math.ceil((i-e)/n/2)*n,s(t,a,e,i,r),o.push(e,a,a,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!p(t,e))return i;for(var n,r,a,o,h=[];e;){for(n=0,r=e.children.length;n<r;n++)a=e.children[n],p(t,o=e.leaf?s(a):a)&&(e.leaf?i.push(a):f(t,o)?this._all(a,i):h.push(a));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!p(t,e))return!1;for(var s,n,r,a,o=[];e;){for(s=0,n=e.children.length;s<n;s++)if(r=e.children[s],p(t,a=e.leaf?i(r):r)){if(e.leaf||f(t,a))return!0;o.push(r)}e=o.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var s=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===s.height)this._splitRoot(this.data,s);else{if(this.data.height<s.height){var n=this.data;this.data=s,s=n}this._insert(s,this.data.height-s.height-1,!0)}else this.data=s;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(t,e){if(!t)return this;for(var i,s,n,a,o=this.data,h=this.toBBox(t),l=[],u=[];o||l.length;){if(o||(o=l.pop(),s=l[l.length-1],i=u.pop(),a=!0),o.leaf&&-1!==(n=r(t,o.children,e)))return o.children.splice(n,1),l.push(o),this._condense(l),this;a||o.leaf||!f(o,h)?s?(i++,o=s.children[i],a=!1):o=null:(l.push(o),u.push(i),i=0,s=o,o=o.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,s){var n,r=i-e+1,o=this._maxEntries;if(r<=o)return a(n=g(t.slice(e,i+1)),this.toBBox),n;s||(s=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,s-1))),(n=g([])).leaf=!1,n.height=s;var h,l,u,c,d=Math.ceil(r/o),f=d*Math.ceil(Math.sqrt(o));for(m(t,e,i,f,this.compareMinX),h=e;h<=i;h+=f)for(m(t,h,u=Math.min(h+f-1,i),d,this.compareMinY),l=h;l<=u;l+=d)c=Math.min(l+d-1,u),n.children.push(this._build(t,l,c,s-1));return a(n,this.toBBox),n},_chooseSubtree:function(t,e,i,s){for(var n,r,a,o,h,l,u,d,f,p;s.push(e),!e.leaf&&s.length-1!==i;){for(u=d=1/0,n=0,r=e.children.length;n<r;n++)h=c(a=e.children[n]),f=t,p=a,(l=(Math.max(p.maxX,f.maxX)-Math.min(p.minX,f.minX))*(Math.max(p.maxY,f.maxY)-Math.min(p.minY,f.minY))-h)<d?(d=l,u=h<u?h:u,o=a):l===d&&h<u&&(u=h,o=a);e=o||e.children[0]}return e},_insert:function(t,e,i){var s=this.toBBox,n=i?t:s(t),r=[],a=this._chooseSubtree(n,this.data,e,r);for(a.children.push(t),h(a,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),o=g(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,a,h,l,u,d,f,p,g,m,v,y;for(l=u=1/0,s=e;s<=i-e;s++)f=n=o(t,0,s,this.toBBox),p=r=o(t,s,i,this.toBBox),void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),m=Math.max(f.minY,p.minY),v=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),a=Math.max(0,v-g)*Math.max(0,y-m),h=c(n)+c(r),a<l?(l=a,d=s,u=h<u?h:u):a===l&&h<u&&(u=h,d=s);return d},_chooseSplitAxis:function(t,e,i){var s=t.leaf?this.compareMinX:l,n=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,s)<this._allDistMargin(t,e,i,n)&&t.children.sort(s)},_allDistMargin:function(t,e,i,s){t.children.sort(s);var n,r,a=this.toBBox,l=o(t,0,e,a),u=o(t,i-e,i,a),c=d(l)+d(u);for(n=e;n<i-e;n++)r=t.children[n],h(l,t.leaf?a(r):r),c+=d(l);for(n=i-e-1;n>=e;n--)r=t.children[n],h(u,t.leaf?a(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},35072:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var s=this.entries[i];if(s[t]===e)return s}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return e>-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t<this.entries.length;t++){var e=this.entries[t];console.log(e)}console.groupEnd()},each:function(t,e){var i,s=this.entries.slice(),n=s.length;if(e)for(i=0;i<n&&!1!==t.call(e,s[i],i);i++);else for(i=0;i<n&&!1!==t(s[i],i);i++);return this},iterate:function(t,e){var i,s=this.entries.length;if(e)for(i=0;i<s&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<s&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var s=this.entries.length;for(e=0;e<s;e++){var n=this.entries[e];n[t].apply(n,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return this.entries.indexOf(t)>-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t<this.entries.length?this.entries.length=t:this.entries.length}}});t.exports=s},86555:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(56583),a=i(26099),o=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio<n?(e=(t=r(t,s.x))/this.aspectRatio,s.y>0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRatio<n||!i&&this.aspectRatio>n)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238:t=>{t.exports="add"},56187:t=>{t.exports="remove"},82348:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392:(t,e,i)=>{t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Set:i(35072),Size:i(86555)}},57382:(t,e,i)=>{var s=i(83419),n=i(45319),r=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),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===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,s){return void 0===s&&(s=!0),this.context.drawImage(i,t,e),s&&this.update(),this},drawFrame:function(t,e,i,s,n){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=!0);var r=this.manager.getFrame(t,e);if(r){var a=r.canvasData,o=r.cutWidth,h=r.cutHeight,l=r.source.resolution;this.context.drawImage(r.source.image,a.x,a.y,o,h,i,s,o/l,h/l),n&&this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=s,a.data[2]=n,a.data[3]=r,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,s,n,r,a){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,s,n,r,a),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,a=n[s+0],o=n[s+1],h=n[s+2],l=n[s+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=n(t,0,this.width),o=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d<l;d++){for(var f=[],p=a;p<o;p++)u=this.getPixel(p,d,u),f.push({x:p,y:d,color:u.color,alpha:u.alphaGL});c.push(f)}return c},getIndex:function(t,e){return t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e)),t<this.width&&e<this.height?4*(t+e*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=!0),this.context.clearRect(t,e,i,s),n&&this.update(),this},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=o(t,e),this.frames.__BASE.setSize(t,e,0,0),this.width=t,this.height=e,this.refresh()),this},destroy:function(){h.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}});t.exports=l},81320:(t,e,i)=>{var s=i(10312),n=i(38058),r=i(27919),a=i(83419),o=i(8054),h=i(4327),l=i(95540),u=i(36060),c=i(32302),d=i(79237),f=i(70554),p=new a({Extends:d,initialize:function(t,e,i,s,a){void 0===i&&(i=256),void 0===s&&(s=256),void 0===a&&(a=!0),this.type="DynamicTexture";var h=t.game.renderer,l=h&&h.type===o.CANVAS,f=l?r.create2D(this,i,s):[this];d.call(this,t,e,f,i,s),this.add("__BASE",0,0,0,i,s),this.renderer=h,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=l?f:null,this.context=l?f.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new n(0,0,i,s).setScene(t.game.scene.systemScene,!1),this.renderTarget=l?null:new c(h,i,s,1,0,!1,!1,!0,!1),this.pipeline=l?null:h.pipelines.get(u.SINGLE_PIPELINE),this.setSize(i,s,a)},setSize:function(t,e,i){void 0===e&&(e=t),void 0===i&&(i=!0),i&&((t=Math.floor(t))%2!=0&&t++,(e=Math.floor(e))%2!=0&&e++);var s=this.get(),n=s.source;if(t!==this.width||e!==this.height){this.canvas&&(this.canvas.width=t,this.canvas.height=e);var r=this.renderTarget;r&&(r.willResize(t,e)&&r.resize(t,e),r.texture!==n.glTexture&&this.renderer.deleteTexture(n.glTexture),this.setFromRenderTarget()),this.camera.setSize(t,e),n.width=t,n.height=e,s.setSize(t,e),this.width=t,this.height=e}else{var a=this.getSourceImage();s.cutX+t>a.width&&(t=a.width-s.cutX),s.cutY+e>a.height&&(e=a.height-s.cutY),s.setSize(t,e,s.cutX,s.cutY)}return this},setFromRenderTarget:function(){var t=this.get().source,e=this.renderTarget;return t.isRenderTexture=!0,t.isGLTexture=!0,t.glTexture=e.texture,this},setIsSpriteTexture:function(t){return this.isSpriteTexture=t,this},fill:function(t,e,i,s,n,r){var a=this.camera,o=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height);var h=t>>16&255,l=t>>8&255,u=255&t,c=this.renderTarget;if(a.preRender(),c){c.bind(!0);var d=this.pipeline.manager.set(this.pipeline),p=o.width/c.width,g=o.height/c.height,m=c.height-(s+r);d.drawFillRect(i*p,m*g,n*p,r*g,f.getTintFromFloats(u/255,l/255,h/255,1),e),c.unbind(!0)}else{var v=this.context;o.setContext(v),v.globalCompositeOperation="source-over",v.fillStyle="rgba("+h+","+l+","+u+","+e+")",v.fillRect(i,s,n,r),o.setContext()}return this.dirty=!0,this},clear:function(t,e,i,s){if(this.dirty){var n=this.context,r=this.renderTarget;r?r.clear(t,e,i,s):n&&(void 0!==t&&void 0!==e&&void 0!==i&&void 0!==s?n.clearRect(t,e,i,s):(n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,this.width,this.height),n.restore())),this.dirty=!1}return this},stamp:function(t,e,i,s,n){void 0===i&&(i=0),void 0===s&&(s=0);var r=l(n,"alpha",1),a=l(n,"tint",16777215),o=l(n,"angle",0),h=l(n,"rotation",0),u=l(n,"scale",1),c=l(n,"scaleX",u),d=l(n,"scaleY",u),f=l(n,"originX",.5),p=l(n,"originY",.5),g=l(n,"blendMode",0),m=l(n,"erase",!1),v=l(n,"skipBatch",!1),y=this.manager.resetStamp(r,a);return y.setAngle(0),0!==o?y.setAngle(o):0!==h&&y.setRotation(h),y.setScale(c,d),y.setTexture(t,e),y.setOrigin(f,p),y.setBlendMode(g),m&&(this._eraseMode=!0),v?this.batchGameObject(y,i,s):this.draw(y,i,s),m&&(this._eraseMode=!1),this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},repeat:function(t,e,i,s,n,r,a,o,l){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===a&&(a=1),void 0===o&&(o=16777215),void 0===l&&(l=!1),!(e=t instanceof h?t:this.manager.getFrame(t,e)))return this;var u=this.manager.resetStamp(a,o);u.setFrame(e),u.setOrigin(0);var c=e.width,d=e.height;n=Math.floor(n),r=Math.floor(r);var f=Math.ceil(n/c),p=Math.ceil(r/d),g=f*c-n,m=p*d-r;g>0&&(g=c-g),m>0&&(m=d-m),i<0&&(f+=Math.ceil(Math.abs(i)/c)),s<0&&(p+=Math.ceil(Math.abs(s)/d));var v=i,y=s,x=!1,w=this.manager.stampCrop.setTo(0,0,c,d);l||this.beginDraw();for(var b=0;b<p;b++)if(y+d<0)y+=d;else{for(var T=0;T<f;T++)x=!1,v+c<0||(v<0&&(x=!0,w.width=c+v,w.x=c-w.width),y<0&&(x=!0,w.height=d+y,w.y=d-w.height),g>0&&T===f-1&&(x=!0,w.width=g),m>0&&b===p-1&&(x=!0,w.height=m),x&&u.setCrop(w),this.batchGameObject(u,v,y),u.isCropped=!1,w.setTo(0,0,c,d)),v+=c;v=i,y+=d}return l||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var t=this.camera,e=this.renderer,i=this.renderTarget;t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(t,e,i,s,n){return Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=1),void 0===r&&(r=16777215);var a=this.manager.getFrame(t,e);return a&&(this.renderTarget?this.pipeline.batchTextureFrame(a,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(a,i,s,n,r)),this},endDraw:function(t){if(void 0===t&&(t=this._eraseMode),this.isDrawing){var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t,this.isSpriteTexture),e.resetScissor(),e.resetViewport()}else e.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(t,e,i,s,n){var r=t.length;if(0!==r)for(var a=0;a<r;a++){var o=t[a];o&&o!==this&&(o.renderWebGL||o.renderCanvas?this.batchGameObject(o,e,i):o.isParent||o.list?this.batchGroup(o.getChildren(),e,i):"string"==typeof o?this.batchTextureFrameKey(o,null,e,i,s,n):o instanceof h?this.batchTextureFrame(o,e,i,s,n):Array.isArray(o)&&this.batchList(o,e,i,s,n))}},batchGroup:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);for(var s=0;s<t.length;s++){var n=t[s];n.willRender(this.camera)&&this.batchGameObject(n,n.x+e,n.y+i)}},batchGameObject:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,r=t.y,a=this.camera,o=this.renderer,h=this._eraseMode,l=t.mask;if(t.setPosition(e,i),this.canvas){if(h){var u=t.blendMode;t.blendMode=s.ERASE}l&&l.preRenderCanvas(o,t,a),t.renderCanvas(o,t,a,null),l&&l.postRenderCanvas(o,t,a),h&&(t.blendMode=u)}else o&&(l&&l.preRenderWebGL(o,t,a),h||o.setBlendMode(t.blendMode),t.renderWebGL(o,t,a),l&&l.postRenderWebGL(o,a,this.renderTarget));t.setPosition(n,r)},batchTextureFrameKey:function(t,e,i,s,n,r){var a=this.manager.getFrame(t,e);a&&this.batchTextureFrame(a,i,s,n,r)},batchTextureFrame:function(t,e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=16777215);var r=this.camera.matrix;if(this.renderTarget)this.pipeline.batchTextureFrame(t,e,i,n,s,r,null);else{var a=this.context,o=t.canvasData,h=t.source.image;a.save(),a.globalCompositeOperation=this._eraseMode?"destination-out":"source-over",a.globalAlpha=s,r.setToContext(a),o.width>0&&o.height>0&&a.drawImage(h,o.x,o.y,o.width,o.height,e,i,o.width,o.height),a.restore()}},snapshotArea:function(t,e,i,s,n,r,a){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,n,!1,t,e,i,s,r,a):this.renderer.snapshotCanvas(this.canvas,n,!1,t,e,i,s,r,a),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(t,e,i,s){var n=this.manager.resetStamp();n.setTexture(this),n.setOrigin(0),n.renderWebGL(t,n,i,s)},renderCanvas:function(){},destroy:function(){var t=this.manager.stamp;t&&t.texture===this&&this.manager.resetStamp(),d.prototype.destroy.call(this),r.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});t.exports=p},4327:(t,e,i)=>{var s=i(83419),n=i(45319),r=i(79291),a=new s({initialize:function(t,e,i,s,n,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,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},is3Slice:!1,scale9:!1,scale9Borders:{x:0,y:0,w:0,h:0}},this.setSize(r,a,s,n)},setCutPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.cutX=t,this.cutY=e,this.updateUVs()},setCutSize:function(t,e){return this.cutWidth=t,this.cutHeight=e,this.updateUVs()},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.setCutPosition(i,s),this.setCutSize(t,e),this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var a=n.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=n,o.h=r,o.r=i+n,o.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setScale9:function(t,e,i,s){var n=this.data;return n.scale9=!0,n.is3Slice=0===e&&s===this.height,n.scale9Borders.x=t,n.scale9Borders.y=e,n.scale9Borders.w=i,n.scale9Borders.h=s,this},setCropUVs:function(t,e,i,s,r,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),g=l+(i=n(i,0,f)),m=s=n(s,0,d-e),v=r=n(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,w=e+(s=n(s,0,x.x+u-e)),b=i+(r=n(r,0,x.y+c-i));if(x.r<e||x.b<i||x.x>w||x.y>b)p=0,g=0,m=0,v=0;else{var T=Math.max(x.x,e),S=Math.max(x.y,i),E=Math.min(x.r,w)-T,A=Math.min(x.b,b)-S;m=E,v=A,p=a?h+(u-(T-x.x)-E):h+(T-x.x),g=o?l+(c-(S-x.y)-A):l+(S-x.y),e=T,i=S,s=E,r=A}}else a&&(p=h+(u-e-s)),o&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+m)/C),t.v1=Math.min(1,(g+v)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=v,t.width=s,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},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}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237:(t,e,i)=>{var s=i(83419),n=i(4327),r=i(11876),a='Texture "%s" has no frame "%s"',o=new s({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var a=0;a<i.length;a++)this.source.push(new r(this,i[a],s,n))},add:function(t,e,i,s,r,a){if(this.has(t))return null;var o=new n(this,t,e,i,s,r,a);return this.frames[t]=o,"__BASE"===this.firstFrame&&(this.firstFrame=t),this.frameTotal++,o},remove:function(t){return!!this.has(t)&&(this.get(t).destroy(),delete this.frames[t],!0)},has:function(t){return this.frames.hasOwnProperty(t)},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(console.warn(a,this.key,t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var s in this.frames)if("__BASE"!==s||e){var n=this.frames[s];n.sourceIndex===t&&i.push(n)}return i},getFrameBounds:function(t){void 0===t&&(t=0);for(var e=this.getFramesFromTextureSource(t,!0),i=e[0],s=i.cutX,n=i.cutY,r=i.cutX+i.cutWidth,a=i.cutY+i.cutHeight,o=1;o<e.length;o++){var h=e[o];h.cutX<s&&(s=h.cutX),h.cutY<n&&(n=h.cutY),h.cutX+h.cutWidth>r&&(r=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:s,y:n,width:r-s,height:a-n}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new r(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t,e=this.source,i=this.dataSource;for(t=0;t<e.length;t++)e[t]&&e[t].destroy();for(t=0;t<i.length;t++)i[t]&&i[t].destroy();for(var s in this.frames){var n=this.frames[s];n&&n.destroy()}this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key),this.manager=null}});t.exports=o},17130:(t,e,i)=>{var s=i(27919),n=i(57382),r=i(83419),a=i(40987),o=i(8054),h=i(81320),l=i(50792),u=i(69442),c=i(4327),d=i(8443),f=i(99584),p=i(35154),g=i(88571),m=i(41212),v=i(61309),y=i(87841),x=i(79237),w=new r({Extends:l,initialize:function(t){l.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.silentWarnings=!1,t.events.once(d.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(u.LOAD,this.updatePending,this),this.on(u.ERROR,this.updatePending,this);var t=this.game.config;null!==t.defaultImage&&this.addBase64("__DEFAULT",t.defaultImage),null!==t.missingImage&&this.addBase64("__MISSING",t.missingImage),null!==t.whiteImage&&this.addBase64("__WHITE",t.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(d.DESTROY,this.destroy,this),this.game.events.once(d.SYSTEM_READY,(function(t){this.stamp=new g(t).setOrigin(0)}),this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(u.LOAD),this.off(u.ERROR),this.emit(u.READY))},checkKey:function(t){return!(!t||"string"!=typeof t||this.exists(t))||(this.silentWarnings||console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return this.silentWarnings||console.warn("No texture found matching key: "+t),this;t=this.get(t)}var e=t.key;return this.list.hasOwnProperty(e)&&(t.destroy(),this.emit(u.REMOVE,e),this.emit(u.REMOVE_KEY+e)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(u.ERROR,t)},s.onload=function(){var e=i.create(t,s);e&&(v.Image(e,0),i.emit(u.ADD,t,e),i.emit(u.ADD_KEY+t,e),i.emit(u.LOAD,t,e))},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",a=this.getFrame(t,e);if(a&&(a.source.isRenderTexture||a.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(a){var o=a.canvasData,h=s.create2D(this,o.width,o.height),l=h.getContext("2d",{willReadFrequently:!0});o.width>0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),v.Image(s,0),i&&s.setDataSource(i),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var s=e.width,n=e.height;(i=this.create(t,e,s,n)).add("__BASE",0,0,0,s,n),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var n=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var r=0;r<i.length;r++)n(s,r,i[r]);else n(s,0,i)}this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)}return s},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=s.create(this,1,1);return e.canvas=i,f(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var n=s.create(this,e,i,o.CANVAS,!0);return this.addCanvas(t,n)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var s=null;return i?s=new n(this,t,e,e.width,e.height):this.checkKey(t)&&(s=new n(this,t,e,e.width,e.height),this.list[t]=s,this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addDynamicTexture:function(t,e,i){var s=null;return"string"!=typeof t||this.exists(t)?t=(s=t).key:s=new h(this,t,e,i),this.checkKey(t)?(this.list[t]=s,this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)):s=null,s},addAtlas:function(t,e,i,s){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,s):this.addAtlasJSONHash(t,e,i,s)},addAtlasJSONArray:function(t,e,i,s){var n=null;if(e instanceof x?(t=e.key,n=e):this.checkKey(t)&&(n=this.create(t,e)),n){if(Array.isArray(i))for(var r=1===i.length,a=0;a<n.source.length;a++){var o=r?i[0]:i[a];v.JSONArray(n,a,o)}else v.JSONArray(n,0,i);s&&n.setDataSource(s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n)}return n},addAtlasJSONHash:function(t,e,i,s){var n=null;if(e instanceof x?(t=e.key,n=e):this.checkKey(t)&&(n=this.create(t,e)),n){if(Array.isArray(i))for(var r=0;r<i.length;r++)v.JSONHash(n,r,i[r]);else v.JSONHash(n,0,i);s&&n.setDataSource(s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n)}return n},addAtlasXML:function(t,e,i,s){var n=null;return e instanceof x?(t=e.key,n=e):this.checkKey(t)&&(n=this.create(t,e)),n&&(v.AtlasXML(n,0,i),s&&n.setDataSource(s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n)),n},addUnityAtlas:function(t,e,i,s){var n=null;return e instanceof x?(t=e.key,n=e):this.checkKey(t)&&(n=this.create(t,e)),n&&(v.UnityYAML(n,0,i),s&&n.setDataSource(s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n)),n},addSpriteSheet:function(t,e,i,s){var n=null;if(e instanceof x?(t=e.key,n=e):this.checkKey(t)&&(n=this.create(t,e)),n){var r=n.source[0].width,a=n.source[0].height;v.SpriteSheet(n,0,0,0,r,a,i),s&&n.setDataSource(s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=p(e,"atlas",null),s=p(e,"frame",null);if(i&&s){var n=this.get(i).get(s);if(n){var r=n.source.image;r||(r=n.source.glTexture);var a=this.create(t,r);return n.trimmed?v.SpriteSheetFromAtlas(a,n,e):v.SpriteSheet(a,0,n.cutX,n.cutY,n.cutWidth,n.cutHeight,e),this.emit(u.ADD,t,a),this.emit(u.ADD_KEY+t,a),a}}},addUint8Array:function(t,e,i,s){if(!this.checkKey(t)||e.length/4!==i*s)return null;var n=this.create(t,e,i,s);return n.add("__BASE",0,0,0,i,s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n),n},create:function(t,e,i,s){var n=null;return this.checkKey(t)&&(n=new x(this,t,e,i,s),this.list[t]=n),n},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:t instanceof x?t:t instanceof c?t.texture:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},parseFrame:function(t){if(t)return"string"==typeof t?this.getFrame(t):Array.isArray(t)&&2===t.length?this.getFrame(t[0],t[1]):m(t)?this.getFrame(t.key,t.frame):t instanceof x?t.get():t instanceof c?t:void 0},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&"__WHITE"!==e&&"__NORMAL"!==e&&t.push(e);return t},getPixel:function(t,e,i,s){var n=this.getFrame(i,s);if(n){t-=n.x,e-=n.y;var r=n.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var o=this._tempContext;o.clearRect(0,0,1,1),o.drawImage(n.source.image,t,e,1,1,0,0,1,1);var h=o.getImageData(0,0,1,1);return new a(h.data[0],h.data[1],h.data[2],h.data[3])}}return null},getPixelAlpha:function(t,e,i,s){var n=this.getFrame(i,s);if(n){t-=n.x,e-=n.y;var r=n.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var a=this._tempContext;return a.clearRect(0,0,1,1),a.drawImage(n.source.image,t,e,1,1,0,0,1,1),a.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e||(i.key=e,this.list[e]=i,delete this.list[t],0))},each:function(t,e){for(var i=[null],s=1;s<arguments.length;s++)i.push(arguments[s]);for(var n in this.list)i[0]=this.list[n],t.apply(e,i)},resetStamp:function(t,e){void 0===t&&(t=1),void 0===e&&(e=16777215);var i=this.stamp;return i.setCrop(),i.setPosition(0),i.setAngle(0),i.setScale(1),i.setAlpha(t),i.setTint(e),i.setTexture("__WHITE"),i},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.stamp.destroy(),this.game=null,this.stamp=null,s.remove(this._tempCanvas)}});t.exports=w},11876:(t,e,i)=>{var s=i(27919),n=i(83419),r=i(50030),a=i(29795),o=i(82751),h=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var h=t.manager.game;this.renderer=h.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type||"DynamicTexture"===e.type,this.isGLTexture=e instanceof o,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.flipY=n,this.init(h)},init:function(t){var e=this.renderer;if(e){var i=this.source;if(e.gl){var s=this.image,n=this.flipY,r=this.width,a=this.height,o=this.scaleMode;this.isCanvas?this.glTexture=e.createCanvasTexture(s,!1,n):this.isVideo?this.glTexture=e.createVideoTexture(s,!1,n):this.isRenderTexture?this.glTexture=e.createTextureFromSource(null,r,a,o):this.isGLTexture?this.glTexture=i:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(i,void 0,void 0,o):i instanceof Uint8Array?this.glTexture=e.createUint8ArrayTexture(i,r,a,o):this.glTexture=e.createTextureFromSource(s,r,a,o)}else this.isRenderTexture&&(this.image=i.canvas)}t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),t===this.flipY||(this.flipY=t,this.update()),this},update:function(){var t=this.renderer,e=this.image,i=this.flipY,s=t.gl;s&&this.isCanvas?t.updateCanvasTexture(e,this.glTexture,i):s&&this.isVideo&&t.updateVideoTexture(e,this.glTexture,i)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=h},19673:t=>{t.exports={LINEAR:0,NEAREST:1}},44538:t=>{t.exports="addtexture"},63486:t=>{t.exports="addtexture-"},94851:t=>{t.exports="onerror"},29099:t=>{t.exports="onload"},8678:t=>{t.exports="ready"},86415:t=>{t.exports="removetexture"},30879:t=>{t.exports="removetexture-"},69442:(t,e,i)=>{t.exports={ADD:i(44538),ADD_KEY:i(63486),ERROR:i(94851),LOAD:i(29099),READY:i(8678),REMOVE:i(86415),REMOVE_KEY:i(30879)}},27458:(t,e,i)=>{var s=i(79291),n=i(19673),r={CanvasTexture:i(57382),DynamicTexture:i(81320),Events:i(69442),FilterMode:n,Frame:i(4327),Parsers:i(61309),Texture:i(79237),TextureManager:i(17130),TextureSource:i(11876)};r=s(!1,r,n),t.exports=r},89905:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),a=0;a<r.length;a++){var o=r[a].attributes,h=o.name.value,l=parseInt(o.x.value,10),u=parseInt(o.y.value,10),c=parseInt(o.width.value,10),d=parseInt(o.height.value,10);if(n=t.add(h,e,l,u,c,d),o.frameX){var f=Math.abs(parseInt(o.frameX.value,10)),p=Math.abs(parseInt(o.frameY.value,10)),g=parseInt(o.frameWidth.value,10),m=parseInt(o.frameHeight.value,10);n.setTrim(c,d,f,p,g,m)}}return t}console.warn("Invalid Texture Atlas XML given")}},72893:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},4832:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},78566:(t,e,i)=>{var s=i(41786);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,a=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o<a.length;o++){var h=a[o];if(r=t.add(h.filename,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),h.scale9Borders&&r.setScale9(h.scale9Borders.x,h.scale9Borders.y,h.scale9Borders.w,h.scale9Borders.h),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+h.filename)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Array")}},39711:(t,e,i)=>{var s=i(41786);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,a=i.frames;for(var o in a)if(a.hasOwnProperty(o)){var h=a[o];if(r=t.add(o,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),h.scale9Borders&&r.setScale9(h.scale9Borders.x,h.scale9Borders.y,h.scale9Borders.w,h.scale9Borders.h),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+o)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},31403:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e<s.length;e++)if(s[e]!==i[e])return void console.warn("KTXParser - Invalid file format");var n=Uint32Array.BYTES_PER_ELEMENT,r=new DataView(t,12,13*n),a=67305985===r.getUint32(0,!0);if(0===r.getUint32(1*n,a)){var o=r.getUint32(4*n,a),h=r.getUint32(6*n,a),l=r.getUint32(7*n,a),u=Math.max(1,r.getUint32(11*n,a)),c=r.getUint32(12*n,a),d=new Array(u),f=64+c,p=h,g=l;for(e=0;e<u;e++){var m=new Int32Array(t,f,1)[0];f+=4,d[e]={data:new Uint8Array(t,f,m),width:p,height:g},p=Math.max(1,p>>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:d,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},82038:t=>{function e(t,e,i,s,n,r,a){return void 0===a&&(a=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*a}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,e){return Math.ceil(t/4)*Math.ceil(e/4)*16}function r(t,i){return e(t,i,3,3,4,4,8)}function a(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:[35841]},1:{sizeFunc:i,glFormat:[35843]},2:{sizeFunc:s,glFormat:[35840]},3:{sizeFunc:s,glFormat:[35842]},6:{sizeFunc:r,glFormat:[36196]},7:{sizeFunc:r,glFormat:[33776,35916]},8:{sizeFunc:a,glFormat:[33777,35917]},9:{sizeFunc:a,glFormat:[33778,35918]},11:{sizeFunc:a,glFormat:[33779,35919]},14:{sizeFunc:n,glFormat:[36494,36495]},15:{sizeFunc:n,glFormat:[36492,36493]},22:{sizeFunc:r,glFormat:[37492,37493]},23:{sizeFunc:a,glFormat:[37496,37497]},24:{sizeFunc:r,glFormat:[37494,37495]},25:{sizeFunc:r,glFormat:[37488]},26:{sizeFunc:a,glFormat:[37490]},27:{sizeFunc:a,glFormat:[37808,37840]},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:[37809,37841]},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:[37810,37842]},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:[37811,37843]},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:[37812,37844]},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:[37813,37845]},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:[37814,37846]},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:[37815,37847]},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:[37816,37848]},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:[37817,37849]},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:[37818,37850]},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:[37819,37851]},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:[37820,37852]},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:[37821,37853]}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=55727696===e[0]?e[2]:e[3],s=e[4],n=o[i].glFormat[s],r=o[i].sizeFunc,a=e[11],h=e[7],l=e[6],u=52+e[12],c=new Uint8Array(t,u),d=new Array(a),f=0,p=h,g=l,m=0;m<a;m++){var v=r(p,g);d[m]={data:new Uint8Array(c.buffer,c.byteOffset+f,v),width:p,height:g},p=Math.max(1,p>>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:d,width:h,height:l,internalFormat:n,compressed:!0,generateMipmap:!1}}},75549:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i,n,r,a,o){var h=s(o,"frameWidth",null),l=s(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(o,"startFrame",0),d=s(o,"endFrame",-1),f=s(o,"margin",0),p=s(o,"spacing",0),g=Math.floor((r-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>g||c<-g)&&(c=0),c<0&&(c=g+c),(-1===d||d>g||d<c)&&(d=g);for(var m=f,v=f,y=0,x=0,w=0,b=0;b<g;b++){y=0,x=0;var T=m+h,S=v+l;T>r&&(y=T-r),S>a&&(x=S-a),b>=c&&b<=d&&(t.add(w,e,i+m,n+v,h-y,l-x),w++),(m+=h+p)+h>r&&(m=f,v+=l+p)}return t}},47534:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,m=e.realWidth,v=e.realHeight,y=Math.floor((m-u+c)/(n+c)),x=Math.floor((v-u+c)/(r+c)),w=y*x,b=e.x,T=n-b,S=n-(m-p-b),E=e.y,A=r-E,C=r-(v-g-E);(h>w||h<-w)&&(h=0),h<0&&(h=w+h),-1!==l&&(w=h+(l+1));for(var M=u,_=u,R=0,P=0;P<x;P++){for(var L=0===P,F=P===x-1,O=0;O<y;O++){var D=0===O,k=O===y-1;if(o=t.add(R,0,d+M,f+_,n,r),D||L||k||F){var I=D?b:0,B=L?E:0,N=0,Y=0;D&&(N+=n-T),k&&(N+=n-S),L&&(Y+=r-A),F&&(Y+=r-C);var X=n-N,U=r-Y;o.cutWidth=X,o.cutHeight=U,o.setTrim(n,r,I,B,X,U)}M+=c,M+=D?T:k?S:n,R++}M=u,_+=c,_+=L?A:F?C:r}return t}},86147:t=>{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var a=n.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c<a.length;c++){var d=a[c].match(o);if(d){var f="- "===d[1],p=d[2],g=d[3];if(f&&(l!==h&&(i(t,s,l,u),h=l),u={x:0,y:0,width:0,height:0}),"name"!==p)switch(p){case"x":case"y":case"width":case"height":u[p]=parseInt(g,10)}else l=g}}return l!==h&&i(t,s,l,u),t}},55222:(t,e,i)=>{var s=i(50030);function n(t){for(var e=t.mipmaps,i=0;i<e.length;i++){var s=e[i].width,n=e[i].height;if((s<<i)%4!=0||(n<<i)%4!=0)return console.warn("BPTC, RGTC, and S3TC dimensions must be a multiple of 4 pixels, and each successive mip level must be half the size of the previous level, rounded down. Mip level "+i+" is "+s+"x"+n),!1}return!0}function r(){return!0}function a(t){var e=t.mipmaps[0];return!!s(e.width,e.height)||(console.warn("PVRTC base dimensions must be power of two. Base level is "+e.width+"x"+e.height),!1)}function o(t){var e=t.mipmaps[0];return e.width%4==0&&e.height%4==0||(console.warn("S3TC SRGB base dimensions must be a multiple of 4 pixels. Base level is "+e.width+"x"+e.height+" pixels"),!1)}var h={37488:r,37489:r,37490:r,37491:r,37492:r,37493:r,37494:r,37495:r,37496:r,37497:r,36196:r,37808:r,37809:r,37810:r,37811:r,37812:r,37813:r,37814:r,37815:r,37816:r,37817:r,37818:r,37819:r,37820:r,37821:r,37840:r,37841:r,37842:r,37843:r,37844:r,37845:r,37846:r,37847:r,37848:r,37849:r,37850:r,37851:r,37852:r,37853:r,36492:n,36493:n,36494:n,36495:n,36283:n,36284:n,36285:n,36286:n,35840:a,35841:a,35842:a,35843:a,33776:n,33777:n,33778:n,33779:n,35916:o,35917:o,35918:o,35919:o};t.exports=function(t){for(var e=t.mipmaps,i=1;i<e.length;i++){var n=e[i].width,r=e[i].height;if(!s(n,r))return console.warn("Mip level "+i+" is not a power-of-two size: "+n+"x"+r),!1}var a=h[t.internalFormat];return a?a(t):(console.warn("No format checker found for internal format "+t.internalFormat+". Assuming valid."),!0)}},61309:(t,e,i)=>{t.exports={AtlasXML:i(89905),Canvas:i(72893),Image:i(4832),JSONArray:i(78566),JSONHash:i(39711),KTXParser:i(31403),PVRParser:i(82038),SpriteSheet:i(75549),SpriteSheetFromAtlas:i(47534),UnityYAML:i(86147)}},80341:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n,r,a){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=a||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e,i,s){return this.images.push({gid:t,image:e,width:i,height:s}),this.total++,this}});t.exports=s},27462:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e<t.length;++e)for(var i=t[e],s=0;s<i.total;++s)this.gids[i.firstgid+s]=i;this._gids=this.gids},enabled:{get:function(){return!!this.gids},set:function(t){this.gids=t?this._gids:void 0}},getTypeIncludingTile:function(t){if(void 0!==t.type&&""!==t.type)return t.type;if(this.gids&&void 0!==t.gid){var e=this.gids[t.gid];if(e){var i=e.getTileData(t.gid);if(i)return i.type}}},setTextureAndFrame:function(t,e,i,s){if(null===e&&this.gids&&void 0!==s.gid){var n=this.gids[s.gid];n&&(null===e&&void 0!==n.image&&(e=n.image.key),null===i&&(i=s.gid-n.firstgid),t.scene.textures.getFrame(e,i)||(e=null,i=null))}t.setTexture(e,i)},setPropertiesFromTiledObject:function(t,e){if(void 0!==this.gids&&void 0!==e.gid){var i=this.gids[e.gid];void 0!==i&&this.setFromJSON(t,i.getTileProperties(e.gid))}this.setFromJSON(t,e.properties)},setFromJSON:function(t,e){if(e)if(Array.isArray(e))for(var i=0;i<e.length;i++){var s=e[i];void 0!==t[s.name]?t[s.name]=s.value:t.setData(s.name,s.value)}else for(var n in e)void 0!==t[n]?t[n]=e[n]:t.setData(n,e[n])}});t.exports=s},31989:(t,e,i)=>{var s=i(80341),n=i(87010),r=i(46177),a=i(49075);t.exports=function(t,e,i,o,h,l,u,c){void 0===i&&(i=32),void 0===o&&(o=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,o,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,o,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:o,width:h,height:l})),new a(t,d)}},23029:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(91907),a=i(62644),o=i(93232),h=new s({Mixins:[n.AlphaSingle,n.Flip,n.Visible],initialize:function(t,e,i,s,n,r,a,o){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==a?a:n,this.baseHeight=void 0!==o?o:r,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.tintFill=!1,this.physics={}},containsPoint:function(t,e){return!(t<this.pixelX||e<this.pixelY||t>this.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.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(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!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,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===r.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===r.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===r.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===r.HEXAGONAL){var e,i,s=this.layer.staggerAxis,n=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===s?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===n?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===s&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===n?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}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 t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=h},49075:(t,e,i)=>{var s=i(84101),n=i(83419),r=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),c=i(36305),d=i(19133),f=i(68287),p=i(23029),g=i(81086),m=i(20442),v=i(33629),y=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,r,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var c=u.get(e),d=this.getTilesetIndex(t);if(null===d&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[d];return f?((i||n)&&f.setTileSize(i,n),(r||o)&&f.setSpacing(r,o),f.setImage(c),f):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===r&&(r=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new v(t,h,i,n,r,o,void 0,void 0,l)).setImage(c),this.tilesets.push(f),this.tiles=s(this),f)},copy:function(t,e,i,s,n,r,a,o){return null!==(o=this.getLayer(o))?(g.Copy(t,e,i,s,n,r,a,o),this):null},createBlankLayer:function(t,e,i,s,n,r,a,o){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:n,height:r,orientation:this.orientation,hexSideLength:this.hexSideLength}),c=0;c<r;c++){l=[];for(var d=0;d<n;d++)l.push(new p(u,-1,d,c,a,o,this.tileWidth,this.tileHeight));u.data.push(l)}this.layers.push(u),this.currentLayerIndex=this.layers.length-1;var f=new m(this.scene,this,this.currentLayerIndex,e,i,s);return f.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(f),f},createLayer:function(t,e,i,s){var n=this.getLayerIndex(t);if(null===n)return console.warn("Invalid Tilemap Layer ID: "+t),"string"==typeof t&&console.warn("Valid tilelayer names: %o",this.getTileLayerNames()),null;var r=this.layers[n];if(r.tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+t),null;this.currentLayerIndex=n,void 0===i&&(i=r.x),void 0===s&&(s=r.y);var a=new m(this.scene,this,n,e,i,s);return a.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var s=[],n=this.getObjectLayer(t);if(!n)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),s;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);for(var h=n.objects,d=0;d<e.length;d++){var p,g=e[d],m=o(g,"id",null),v=o(g,"gid",null),y=o(g,"name",null),x=o(g,"type",null);a.enabled=!o(g,"ignoreTileset",null);for(var w=[],b=0;b<h.length;b++)p=h[b],(null===m&&null===v&&null===y&&null===x||null!==m&&p.id===m||null!==v&&p.gid===v||null!==y&&p.name===y||null!==x&&a.getTypeIncludingTile(p)===x)&&w.push(p);for(var T=o(g,"classType",f),S=o(g,"scene",this.scene),E=o(g,"container",null),A=o(g,"key",null),C=o(g,"frame",null),M=0;M<w.length;M++){p=w[M];var _=new T(S);if(_.setName(p.name),_.setPosition(p.x,p.y),a.setTextureAndFrame(_,A,C,p),p.width&&(_.displayWidth=p.width),p.height&&(_.displayHeight=p.height),this.orientation===u.ISOMETRIC){var R=this.tileWidth/this.tileHeight,P={x:_.x-_.y,y:(_.x+_.y)/R};_.x=P.x,_.y=P.y}var L={x:_.originX*p.width,y:(_.originY-(p.gid?1:0))*p.height};if(p.rotation){var F=r(p.rotation);c(L,F),_.rotation=F}_.x+=L.x,_.y+=L.y,void 0===p.flippedHorizontal&&void 0===p.flippedVertical||_.setFlip(p.flippedHorizontal,p.flippedVertical),p.visible||(_.visible=!1),a.setPropertiesFromTiledObject(_,p),E?E.add(_):S.add.existing(_),s.push(_)}}return s},createFromTiles:function(t,e,i,s,n,r){return null===(r=this.getLayer(r))?null:g.CreateFromTiles(t,e,i,s,n,r)},fill:function(t,e,i,s,n,r,a){return void 0===r&&(r=!0),null===(a=this.getLayer(a))?null:(g.Fill(t,e,i,s,n,r,a),this)},filterObjects:function(t,e,i){if("string"==typeof t){var s=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+s),null}return t.objects.filter(e,i)},filterTiles:function(t,e,i,s,n,r,a,o){return null===(o=this.getLayer(o))?null:g.FilterTiles(t,e,i,s,n,r,a,o)},findByIndex:function(t,e,i,s){return null===(s=this.getLayer(s))?null:g.FindByIndex(t,e,i,s)},findObject:function(t,e,i){if("string"==typeof t){var s=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+s),null}return t.objects.find(e,i)||null},findTile:function(t,e,i,s,n,r,a,o){return null===(o=this.getLayer(o))?null:g.FindTile(t,e,i,s,n,r,a,o)},forEachTile:function(t,e,i,s,n,r,a,o){return null===(o=this.getLayer(o))?null:(g.ForEachTile(t,e,i,s,n,r,a,o),this)},getImageIndex:function(t){return this.getIndex(this.images,t)},getImageLayerNames:function(){return this.images&&Array.isArray(this.images)?this.images.map((function(t){return t.name})):[]},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getObjectLayerNames:function(){return this.objects&&Array.isArray(this.objects)?this.objects.map((function(t){return t.name})):[]},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof m&&t.tilemap===this?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,s){return null===(s=this.getLayer(s))?null:g.GetTileAt(t,e,i,s)},getTileAtWorldXY:function(t,e,i,s,n){return null===(n=this.getLayer(n))?null:g.GetTileAtWorldXY(t,e,i,s,n)},getTileLayerNames:function(){return this.layers&&Array.isArray(this.layers)?this.layers.map((function(t){return t.name})):[]},getTilesWithin:function(t,e,i,s,n,r){return null===(r=this.getLayer(r))?null:g.GetTilesWithin(t,e,i,s,n,r)},getTilesWithinShape:function(t,e,i,s){return null===(s=this.getLayer(s))?null:g.GetTilesWithinShape(t,e,i,s)},getTilesWithinWorldXY:function(t,e,i,s,n,r,a){return null===(a=this.getLayer(a))?null:g.GetTilesWithinWorldXY(t,e,i,s,n,r,a)},getTileset:function(t){var e=this.getIndex(this.tilesets,t);return null!==e?this.tilesets[e]:null},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:g.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,s){return null===(s=this.getLayer(s))?null:g.HasTileAtWorldXY(t,e,i,s)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,s,n){return void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:g.PutTileAt(t,e,i,s,n)},putTileAtWorldXY:function(t,e,i,s,n,r){return void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:g.PutTileAtWorldXY(t,e,i,s,n,r)},putTilesAt:function(t,e,i,s,n){return void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:(g.PutTilesAt(t,e,i,s,n),this)},randomize:function(t,e,i,s,n,r){return null===(r=this.getLayer(r))?null:(g.Randomize(t,e,i,s,n,r),this)},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))?null:(g.CalculateFacesAt(t,e,i),this)},calculateFacesWithin:function(t,e,i,s,n){return null===(n=this.getLayer(n))?null:(g.CalculateFacesWithin(t,e,i,s,n),this)},removeLayer:function(t){var e=this.getLayerIndex(t);if(null!==e){d(this.layers,e);for(var i=e;i<this.layers.length;i++)this.layers[i].tilemapLayer&&this.layers[i].tilemapLayer.layerIndex--;return this.currentLayerIndex===e&&(this.currentLayerIndex=0),this}return null},destroyLayer:function(t){var e=this.getLayerIndex(t);return null!==e?((t=this.layers[e]).tilemapLayer.destroy(),d(this.layers,e),this.currentLayerIndex===e&&(this.currentLayerIndex=0),this):null},removeAllLayers:function(){for(var t=this.layers,e=0;e<t.length;e++)t[e].tilemapLayer&&t[e].tilemapLayer.destroy(!1);return t.length=0,this.currentLayerIndex=0,this},removeTile:function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=!0);var s=[];Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var r=t[n];s.push(this.removeTileAt(r.x,r.y,!0,i,r.tilemapLayer)),e>-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:g.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s<i.length;s++)g.RenderDebug(t,e,i[s]);return this},replaceByIndex:function(t,e,i,s,n,r,a){return null===(a=this.getLayer(a))?null:(g.ReplaceByIndex(t,e,i,s,n,r,a),this)},setCollision:function(t,e,i,s,n){return void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:(g.SetCollision(t,e,i,s,n),this)},setCollisionBetween:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:(g.SetCollisionBetween(t,e,i,s,n),this)},setCollisionByProperty:function(t,e,i,s){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(s=this.getLayer(s))?null:(g.SetCollisionByProperty(t,e,i,s),this)},setCollisionByExclusion:function(t,e,i,s){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(s=this.getLayer(s))?null:(g.SetCollisionByExclusion(t,e,i,s),this)},setCollisionFromCollisionGroup:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),null===(i=this.getLayer(i))?null:(g.SetCollisionFromCollisionGroup(t,e,i),this)},setTileIndexCallback:function(t,e,i,s){return null===(s=this.getLayer(s))?null:(g.SetTileIndexCallback(t,e,i,s),this)},setTileLocationCallback:function(t,e,i,s,n,r,a){return null===(a=this.getLayer(a))?null:(g.SetTileLocationCallback(t,e,i,s,n,r,a),this)},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=t,this.layers[i].baseTileHeight=e;for(var s=this.layers[i].data,n=this.layers[i].width,r=this.layers[i].height,a=0;a<r;a++)for(var o=0;o<n;o++){var h=s[a][o];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var s=i.data,n=i.width,r=i.height,a=0;a<r;a++)for(var o=0;o<n;o++){var h=s[a][o];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,s,n){return null===(n=this.getLayer(n))?null:(g.Shuffle(t,e,i,s,n),this)},swapByIndex:function(t,e,i,s,n,r,a){return null===(a=this.getLayer(a))?null:(g.SwapByIndex(t,e,i,s,n,r,a),this)},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,s,n){return null===(n=this.getLayer(n))?null:this._convert.TileToWorldXY(t,e,i,s,n)},getTileCorners:function(t,e,i,s){return null===(s=this.getLayer(s))?null:this._convert.GetTileCorners(t,e,i,s)},weightedRandomize:function(t,e,i,s,n,r){return null===(r=this.getLayer(r))?null:(g.WeightedRandomize(e,i,s,n,t,r),this)},worldToTileX:function(t,e,i,s){return null===(s=this.getLayer(s))?null:this._convert.WorldToTileX(t,e,i,s)},worldToTileY:function(t,e,i,s){return null===(s=this.getLayer(s))?null:this._convert.WorldToTileY(t,e,i,s)},worldToTileXY:function(t,e,i,s,n,r){return null===(r=this.getLayer(r))?null:this._convert.WorldToTileXY(t,e,i,s,n,r)},destroy:function(){this.removeAllLayers(),this.tiles.length=0,this.tilesets.length=0,this.objects.length=0,this.scene=null}});t.exports=y},45939:(t,e,i)=>{var s=i(44603),n=i(31989);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},46029:(t,e,i)=>{var s=i(39429),n=i(31989);s.register("tilemap",(function(t,e,i,s,r,a,o){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,a,o)}))},20442:(t,e,i)=>{var s=i(83419),n=i(78389),r=i(31401),a=i(95643),o=i(81086),h=i(19218),l=i(26099),u=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,n,h],initialize:function(t,e,i,s,n,r){a.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],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=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,r),this.setOrigin(0,0),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var r=t[n];if("string"==typeof r&&(r=s.getTileset(r)),r){i.push(r);for(var a=r.firstgid,o=0;o<r.total;o++)e[a+o]=r}}this.gidMap=e,this.tileset=i},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return o.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return o.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,a){return o.Copy(t,e,i,s,n,r,a,this.layer),this},fill:function(t,e,i,s,n,r){return o.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,a){return o.FilterTiles(t,e,i,s,n,r,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,a){return o.FindTile(t,e,i,s,n,r,a,this.layer)},forEachTile:function(t,e,i,s,n,r,a){return o.ForEachTile(t,e,i,s,n,r,a,this.layer),this},setTint:function(t,e,i,s,n,r){return void 0===t&&(t=16777215),this.forEachTile((function(e){e.tint=t,e.tintFill=!1}),this,e,i,s,n,r)},setTintFill:function(t,e,i,s,n,r){return void 0===t&&(t=16777215),this.forEachTile((function(e){e.tint=t,e.tintFill=!0}),this,e,i,s,n,r)},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return o.GetTileAtWorldXY(t,e,i,s,this.layer)},getIsoTileAtWorldXY:function(t,e,i,s,n){void 0===i&&(i=!0);var r=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,r,n,this.layer,i),this.getTileAt(r.x,r.y,s)},getTilesWithin:function(t,e,i,s,n){return o.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return o.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return o.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return o.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return o.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return o.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return o.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return o.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return o.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return o.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return o.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return o.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return o.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return o.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,s,n){return o.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=u},16153:(t,e,i)=>{var s=i(61340),n=new s,r=new s,a=new s;t.exports=function(t,e,i,s){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=a;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var f=t.currentContext,p=e.gidMap;f.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(f)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(f)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(f.imageSmoothingEnabled=!1);for(var g=0;g<h;g++){var m=o[g],v=p[m.index];if(v){var y=v.image.getSourceImage(),x=v.getTileTextureCoordinates(m.index),w=v.tileWidth,b=v.tileHeight;if(null!==x&&0!==w&&0!==b){var T=.5*w,S=.5*b;x.x+=v.tileOffset.x,x.y+=v.tileOffset.y,f.save(),f.translate(m.pixelX+T,m.pixelY+S),0!==m.rotation&&f.rotate(m.rotation),(m.flipX||m.flipY)&&f.scale(m.flipX?-1:1,m.flipY?-1:1),f.globalAlpha=l*m.alpha,f.drawImage(y,x.x,x.y,w,b,-T,-S,w,b),f.restore()}}}f.restore()}}},19218:(t,e,i)=>{var s,n,r=i(29747);s=i(99558),n=i(16153),t.exports={renderWebGL:s,renderCanvas:n}},99558:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,a=i.alpha*e.alpha;if(!(0===r||a<=0)){var o=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,f=e.y,p=e.scaleX,g=e.scaleY;t.pipelines.preBatch(e);for(var m=0;m<r;m++){var v=n[m],y=o[v.index];if(y){var x=y.getTileTextureCoordinates(v.index),w=y.tileWidth,b=y.tileHeight;if(x&&0!==w&&0!==b){var T=.5*w,S=.5*b,E=y.glTexture,A=h.setTexture2D(E,e),C=w,M=b,_=x.x,R=x.y,P=y.tileOffset.x,L=y.tileOffset.y,F=l(v.tint,a*v.alpha);h.batchTexture(e,E,E.width,E.height,d+v.pixelX*p+(T*p-P),f+v.pixelY*g+(S*g-L),w,b,p,g,v.rotation,v.flipX,v.flipY,u,c,T,S,_,R,C,M,F,F,F,F,v.tintFill,0,0,i,null,!0,A,!0)}}}t.pipelines.postBatch(e)}}},33629:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(t,e,i,s,r,a,o,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=a,this.tileProperties=o,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){this.image=t;var e=t.get(),i=t.getFrameBounds();return this.glTexture=e.source.glTexture,e.width>i.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),r=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);n%1==0&&r%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),n=Math.floor(n),r=Math.floor(r),this.rows=n,this.columns=r,this.total=n*r,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+s,h=0;h<this.rows;h++){for(var l=0;l<this.columns;l++)this.texCoordinates.push({x:a,y:o}),a+=this.tileWidth+this.tileSpacing;a=this.tileMargin+i,o+=this.tileHeight+this.tileSpacing}return this}});t.exports=r},72023:(t,e,i)=>{var s=i(7423);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),a=s(t,e+1,!0,i),o=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),a&&a.collides&&(l&&(n.faceBottom=!1),a.faceTop=!l),o&&o.collides&&(l&&(n.faceLeft=!1),o.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},42573:(t,e,i)=>{var s=i(7423),n=i(7386);t.exports=function(t,e,i,r,a){for(var o=null,h=null,l=null,u=null,c=n(t,e,i,r,null,a),d=0;d<c.length;d++){var f=c[d];f&&(f.collides?(o=s(f.x,f.y-1,!0,a),h=s(f.x,f.y+1,!0,a),l=s(f.x-1,f.y,!0,a),u=s(f.x+1,f.y,!0,a),f.faceTop=!o||!o.collides,f.faceBottom=!h||!h.collides,f.faceLeft=!l||!l.collides,f.faceRight=!u||!u.collides):f.resetFaces())}}},33528:(t,e,i)=>{var s=new(i(26099));t.exports=function(t,e,i,n){var r=i.tilemapLayer,a=r.cullPaddingX,o=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-a-.5)&&h.x<n.worldView.right+r.scaleX*i.tileWidth*(a-.5)&&h.y>n.worldView.y+r.scaleY*i.tileHeight*(-o-1)&&h.y<n.worldView.bottom+r.scaleY*i.tileHeight*(o-.5)}},1785:(t,e,i)=>{var s=i(42573),n=i(7386),r=i(62991),a=i(23029);t.exports=function(t,e,i,o,h,l,u,c){void 0===u&&(u=!0);var d=n(t,e,i,o,null,c),f=[];d.forEach((function(t){var e=new a(t.layer,t.index,t.x,t.y,t.width,t.height,t.baseWidth,t.baseHeight);e.copy(t),f.push(e)}));for(var p=h-t,g=l-e,m=0;m<f.length;m++){var v=f[m],y=v.x+p,x=v.y+g;r(y,x,c)&&c.data[x][y]&&(v.x=y,v.y=x,v.updatePixelXY(),c.data[x][y]=v)}u&&s(h-1,l-1,i+2,o+2,c),d.length=0,f.length=0}},78419:(t,e,i)=>{var s=i(62644),n=i(7386),r=i(27987);t.exports=function(t,e,i,a,o,h){i||(i={}),Array.isArray(t)||(t=[t]);var l=h.tilemapLayer;a||(a=l.scene),o||(o=a.cameras.main);var u,c=h.width,d=h.height,f=n(0,0,c,d,null,h),p=[],g=function(t,e,i){for(var s=0;s<i.length;s++){var n=i[s];t.hasOwnProperty(n)||(t[n]=e[n])}};for(u=0;u<f.length;u++){var m=f[u],v=s(i);if(-1!==t.indexOf(m.index)){var y=l.tileToWorldXY(m.x,m.y,void 0,o,h);v.x=y.x,v.y=y.y,g(v,m,["rotation","flipX","flipY","alpha","visible","tint"]),v.hasOwnProperty("origin")||(v.x+=.5*m.width,v.y+=.5*m.height),v.hasOwnProperty("useSpriteSheet")&&(v.key=m.tileset.image,v.frame=m.index-m.tileset.firstgid),p.push(a.make.sprite(v))}}if(Array.isArray(e))for(u=0;u<t.length;u++)r(t[u],e[u],0,0,c,d,h);else if(null!==e)for(u=0;u<t.length;u++)r(t[u],e,0,0,c,d,h);return p}},19545:(t,e,i)=>{var s=i(87841),n=i(63448),r=i(56583),a=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return a.setTo(l,c,u-l,d-c)}},30003:(t,e,i)=>{var s=i(19545),n=i(32483);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return(a.skipCull||1!==a.scrollFactorX||1!==a.scrollFactorY)&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),n(t,o,r,i),i}},35137:(t,e,i)=>{var s=i(7386),n=i(42573),r=i(20576);t.exports=function(t,e,i,a,o,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,a,o,null,l),d=0;d<c.length;d++)c[d].index=t,r(c[d],u);h&&n(e-1,i-1,a+2,o+2,l)}},40253:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,a,o,h){return s(i,n,r,a,o,h).filter(t,e)}},52692:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,a,o=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((a=s.data[r][n])&&a.index===t){if(o===e)return a;o+=1}}else for(r=0;r<s.height;r++)for(n=0;n<s.width;n++)if((a=s.data[r][n])&&a.index===t){if(o===e)return a;o+=1}return null}},66151:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,a,o,h){return s(i,n,r,a,o,h).find(t,e)||null}},97560:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,a,o,h){s(i,n,r,a,o,h).forEach(t,e)}},43305:(t,e,i)=>{var s=i(91907),n=i(30003),r=i(9474),a=i(14018),o=i(29747),h=i(54503);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?a:o}},7423:(t,e,i)=>{var s=i(62991);t.exports=function(t,e,i,n){if(s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},60540:(t,e,i)=>{var s=i(7423),n=new(i(26099));t.exports=function(t,e,i,r,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,a)}},55826:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n){var r=n.baseTileWidth,a=n.baseTileHeight,o=n.tilemapLayer,h=0,l=0;o&&(i||(i=o.scene.cameras.main),h=o.x+i.scrollX*(1-o.scrollFactorX),l=o.y+i.scrollY*(1-o.scrollFactorY),r*=o.scaleX,a*=o.scaleY);var u=h+t*r,c=l+e*a;return[new s(u,c),new s(u+r,c),new s(u+r,c+a),new s(u,c+a)]}},11758:(t,e,i)=>{var s=i(91907),n=i(27229),r=i(29747),a=i(55826);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:(s.STAGGERED,r)}},39167:(t,e,i)=>{var s=i(91907),n=i(29747),r=i(97281);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},62e3:(t,e,i)=>{var s=i(91907),n=i(19951),r=i(14127),a=i(29747),o=i(97202),h=i(70326);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?o:a}},5984:(t,e,i)=>{var s=i(91907),n=i(29747),r=i(28054),a=i(29650);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.STAGGERED?r:n}},7386:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i,n,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=a.width),void 0===n&&(n=a.height),r||(r={});var o=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>a.width&&(i=Math.max(a.width-t,0)),e+n>a.height&&(n=Math.max(a.height-e,0));for(var u=[],c=e;c<e+n;c++)for(var d=t;d<t+i;d++){var f=a.data[c][d];if(null!==f){if(o&&-1===f.index)continue;if(h&&!f.collides)continue;if(l&&!f.hasInterestingFace)continue;u.push(f)}}return u}},91141:(t,e,i)=>{var s=i(55738),n=i(7386),r=i(91865),a=i(29747),o=i(26099),h=i(91907),l=function(t,e){return r.RectangleToTriangle(e,t)},u=new o,c=new o,d=new o;t.exports=function(t,e,i,o){if(o.orientation!==h.ORTHOGONAL)return console.warn("GetTilesWithinShape only works with orthogonal tilemaps"),[];if(void 0===t)return[];var f=a;t instanceof s.Circle?f=r.CircleToRectangle:t instanceof s.Rectangle?f=r.RectangleToRectangle:t instanceof s.Triangle?f=l:t instanceof s.Line&&(f=r.LineToRectangle),o.tilemapLayer.worldToTileXY(t.left,t.top,!0,c,i);var p=c.x,g=c.y;o.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,d,i);var m=Math.ceil(d.x),v=Math.ceil(d.y),y=Math.max(m-p,1),x=Math.max(v-g,1),w=n(p,g,y,x,e,o),b=o.tileWidth,T=o.tileHeight;o.tilemapLayer&&(b*=o.tilemapLayer.scaleX,T*=o.tilemapLayer.scaleY);for(var S=[],E=new s.Rectangle(0,0,b,T),A=0;A<w.length;A++){var C=w[A];o.tilemapLayer.tileToWorldXY(C.x,C.y,u,i),E.x=u.x,E.y=u.y,f(t,E)&&S.push(C)}return S}},96523:(t,e,i)=>{var s=i(7386),n=i(26099),r=new n,a=new n;t.exports=function(t,e,i,n,o,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,a,h,l);var f=Math.ceil(a.x),p=Math.ceil(a.y);return s(c,d,f-c,p-d,o,l)}},96113:(t,e,i)=>{var s=i(91907),n=i(20242),r=i(10095);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},16926:(t,e,i)=>{var s=i(91907),n=i(86625),r=i(96897),a=i(29747),o=i(15108),h=i(85896);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?o:a}},55762:(t,e,i)=>{var s=i(91907),n=i(20242),r=i(51900),a=i(63288);t.exports=function(t){return t===s.ORTHOGONAL?a:t===s.STAGGERED?r:n}},45091:(t,e,i)=>{var s=i(62991);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},24152:(t,e,i)=>{var s=i(45091),n=new(i(26099));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var a=n.x,o=n.y;return s(a,o,r)}},90454:(t,e,i)=>{var s=i(63448),n=i(56583);t.exports=function(t,e){var i,r,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),c=Math.floor(h.tileHeight*l.scaleY),d=t.hexSideLength;if("y"===t.staggerAxis){var f=(c-d)/2+d;i=n(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,r=s(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=n(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-d)/2+d;i=n(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,r=s(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=n(e.worldView.y-l.y,c,0,!0)-l.cullPaddingY,o=s(e.worldView.bottom-l.y,c,0,!0)+l.cullPaddingY}return{left:i,right:r,top:a,bottom:o}}},9474:(t,e,i)=>{var s=i(90454),n=i(32483);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),n(t,o,r,i),i}},27229:(t,e,i)=>{var s=i(19951),n=i(26099),r=new n;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,c,d=s(t,e,r,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,c=h/2):(u=o/2,c=p*h);for(var g=0;g<6;g++){var m=2*Math.PI*(.5-g)/6;f.push(new n(d.x+u*Math.cos(m),d.y+c*Math.sin(m)))}return f}},19951:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){i||(i=new s);var a=r.baseTileWidth,o=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var c,d,f=a/2,p=o/2,g=r.staggerAxis,m=r.staggerIndex;return"y"===g?(c=l+a*t+a,d=u+1.5*e*p+p,e%2==0&&("odd"===m?c-=f:c+=f)):"x"===g&&"odd"===m&&(c=l+1.5*t*f+f,d=u+o*t+o,t%2==0&&("odd"===m?d-=p:d+=p)),i.set(c,d)}},86625:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,a){n||(n=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(r||(r=l.scene.cameras.main),t-=l.x+r.scrollX*(1-l.scrollFactorX),e-=l.y+r.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,c,d,f,p,g=.5773502691896257,m=-.3333333333333333,v=.6666666666666666,y=o/2,x=h/2;"y"===a.staggerAxis?(d=g*(u=(t-y)/(g*o))+m*(c=(e-x)/x),f=0*u+v*c):(d=m*(u=(t-y)/y)+g*(c=(e-x)/(g*h)),f=v*u+0*c),p=-d-f;var w,b=Math.round(d),T=Math.round(f),S=Math.round(p),E=Math.abs(b-d),A=Math.abs(T-f),C=Math.abs(S-p);E>A&&E>C?b=-T-S:A>C&&(T=-b-S);var M=T;return w="odd"===a.staggerIndex?M%2==0?T/2+b:T/2+b-.5:M%2==0?T/2+b:T/2+b+.5,n.set(w,M)}},62991:t=>{t.exports=function(t,e,i){return t>=0&&t<i.width&&e>=0&&e<i.height}},14018:(t,e,i)=>{var s=i(33528);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,a,o,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=h.skipCull,f=u,p=c;if(0===n)for(a=0;a<p;a++)for(r=0;r<f;r++)(o=l[a][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||s(r,a,t,e))&&i.push(o);else if(1===n)for(a=0;a<p;a++)for(r=f;r>=0;r--)(o=l[a][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||s(r,a,t,e))&&i.push(o);else if(2===n)for(a=p;a>=0;a--)for(r=0;r<f;r++)(o=l[a][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||s(r,a,t,e))&&i.push(o);else if(3===n)for(a=p;a>=0;a--)for(r=f;r>=0;r--)(o=l[a][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&(d||s(r,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},14127:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){i||(i=new s);var a=r.baseTileWidth,o=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=l+a/2*(t-e),d=u+(t+e)*(o/2);return i.set(c,d)}},96897:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,a,o){n||(n=new s);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(r||(r=u.scene.cameras.main),e-=u.y+r.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+r.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var c=h/2,d=l/2;o||(e-=l);var f=.5*((t-=c)/c+e/d),p=.5*(-t/c+e/d);return i&&(f=Math.floor(f),p=Math.floor(p)),n.set(f,p)}},71558:(t,e,i)=>{var s=i(23029),n=i(62991),r=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!n(e,i,h))return null;var l,u=h.data[i][e],c=u&&u.collides;t instanceof s?(null===h.data[i][e]&&(h.data[i][e]=new s(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new s(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var d=h.data[i][e],f=-1!==h.collideIndexes.indexOf(d.index);if(-1===(l=t instanceof s?t.index:t))d.width=h.tileWidth,d.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],m=p.tilesets[g];d.width=m.tileWidth,d.height=m.tileHeight}return a(d,f),o&&c!==d.collides&&r(e,i,h),d}},26303:(t,e,i)=>{var s=i(71558),n=new(i(26099));t.exports=function(t,e,i,r,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,n,a,o),s(t,n.x,n.y,r,o)}},14051:(t,e,i)=>{var s=i(42573),n=i(71558);t.exports=function(t,e,i,r,a){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l<o;l++)for(var u=0;u<h;u++){var c=t[l][u];n(c,e+u,i+l,!1,a)}r&&s(e-1,i-1,h+2,o+2,a)}},77389:(t,e,i)=>{var s=i(7386),n=i(26546);t.exports=function(t,e,i,r,a,o){var h,l=s(t,e,i,r,{},o);if(!a)for(a=[],h=0;h<l.length;h++)-1===a.indexOf(l[h].index)&&a.push(l[h].index);for(h=0;h<l.length;h++)l[h].index=n(a)}},63557:(t,e,i)=>{var s=i(23029),n=i(62991),r=i(72023);t.exports=function(t,e,i,a,o){if(void 0===i&&(i=!0),void 0===a&&(a=!0),!n(t,e,o))return null;var h=o.data[e][t];return h?(o.data[e][t]=i?null:new s(o,-1,t,e,o.tileWidth,o.tileHeight),a&&h&&h.collides&&r(t,e,o),h):null}},94178:(t,e,i)=>{var s=i(63557),n=new(i(26099));t.exports=function(t,e,i,r,a,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,a,o),s(n.x,n.y,i,r,o)}},15533:(t,e,i)=>{var s=i(7386),n=i(3956),r=new n(105,210,231,150),a=new n(243,134,48,200),o=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:a,l=void 0!==e.faceColor?e.faceColor:o,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c<u.length;c++){var d=u[c],f=d.tileset?d.tileset.tileOffset:{x:0,y:0},p=d.width,g=d.height,m=d.pixelX-f.x,v=d.pixelY-f.y,y=d.collides?h:n;null!==y&&(t.fillStyle(y.color,y.alpha/255),t.fillRect(m,v,p,g)),m+=1,v+=1,p-=2,g-=2,null!==l&&(t.lineStyle(1,l.color,l.alpha/255),d.faceTop&&t.lineBetween(m,v,m+p,v),d.faceRight&&t.lineBetween(m+p,v,m+p,v+g),d.faceBottom&&t.lineBetween(m,v+g,m+p,v+g),d.faceLeft&&t.lineBetween(m,v,m,v+g))}}},27987:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,a,o){for(var h=s(i,n,r,a,null,o),l=0;l<h.length;l++)h[l]&&h[l].index===t&&(h[l].index=e)}},32483:t=>{t.exports=function(t,e,i,s){var n,r,a,o=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),f=Math.max(0,e.top),p=Math.min(l,e.bottom);if(0===i)for(r=f;r<p;r++)for(n=c;o[r]&&n<d;n++)(a=o[r][n])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(1===i)for(r=f;r<p;r++)for(n=d;o[r]&&n>=c;n--)(a=o[r][n])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(2===i)for(r=p;r>=f;r--)for(n=c;o[r]&&n<d;n++)(a=o[r][n])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);else if(3===i)for(r=p;r>=f;r--)for(n=d;o[r]&&n>=c;n--)(a=o[r][n])&&-1!==a.index&&a.visible&&0!==a.alpha&&s.push(a);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},57068:(t,e,i)=>{var s=i(20576),n=i(42573),r=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;h<t.length;h++)r(t[h],e,a);if(o)for(var l=0;l<a.height;l++)for(var u=0;u<a.width;u++){var c=a.data[l][u];c&&-1!==t.indexOf(c.index)&&s(c,e)}i&&n(0,0,a.width,a.height,a)}},37266:(t,e,i)=>{var s=i(20576),n=i(42573),r=i(9589);t.exports=function(t,e,i,a,o,h){if(void 0===i&&(i=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,o);if(h)for(var u=0;u<o.height;u++)for(var c=0;c<o.width;c++){var d=o.data[u][c];d&&d.index>=t&&d.index<=e&&s(d,i)}a&&n(0,0,o.width,o.height,o)}}},75661:(t,e,i)=>{var s=i(20576),n=i(42573),r=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o<a.height;o++)for(var h=0;h<a.width;h++){var l=a.data[o][h];l&&-1===t.indexOf(l.index)&&(s(l,e),r(l.index,e,a))}i&&n(0,0,a.width,a.height,a)}},64740:(t,e,i)=>{var s=i(20576),n=i(42573),r=i(97022);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var o=0;o<a.height;o++)for(var h=0;h<a.width;h++){var l=a.data[o][h];if(l)for(var u in t)if(r(l.properties,u)){var c=t[u];Array.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++)l.properties[u]===c[d]&&s(l,e)}}i&&n(0,0,a.width,a.height,a)}},63307:(t,e,i)=>{var s=i(20576),n=i(42573);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r<i.height;r++)for(var a=0;a<i.width;a++){var o=i.data[r][a];if(o){var h=o.getCollisionGroup();h&&h.objects&&h.objects.length>0&&s(o,t)}}e&&n(0,0,i.width,i.height,i)}},9589:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},20576:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n<r;n++)s.callbacks[t[n]]=null!==e?{callback:e,callbackContext:i}:void 0}},93254:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,a,o){for(var h=s(t,e,i,n,null,o),l=0;l<h.length;l++)h[l].setCollisionCallback(r,a)}},32903:(t,e,i)=>{var s=i(7386),n=i(33680);t.exports=function(t,e,i,r,a){var o=s(t,e,i,r,null,a),h=o.map((function(t){return t.index}));n(h);for(var l=0;l<o.length;l++)o[l].index=h[l]}},61325:(t,e,i)=>{var s=i(63448),n=i(56583);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,a=Math.floor(i.tileWidth*r.scaleX),o=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,a,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,a,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,o/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,o/2,0,!0)+r.cullPaddingY}}},54503:(t,e,i)=>{var s=i(61325),n=i(32483);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var a=t.tilemapLayer,o=s(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),n(t,o,r,i),i}},97202:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){i||(i=new s);var a=r.baseTileWidth,o=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var c=l+t*a+e%2*(a/2),d=u+e*(o/2);return i.set(c,d)}},28054:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},15108:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,a){n||(n=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*o)/o):(t+u%2*.5*o)/o;return n.set(c,u)}},51900:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},86560:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,a,o){for(var h=s(i,n,r,a,null,o),l=0;l<h.length;l++)h[l]&&(h[l].index===t?h[l].index=e:h[l].index===e&&(h[l].index=t))}},97281:t=>{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},70326:(t,e,i)=>{var s=i(97281),n=i(29650),r=i(26099);t.exports=function(t,e,i,a,o){return i||(i=new r(0,0)),i.x=s(t,a,o),i.y=n(e,a,o),i}},29650:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},77366:(t,e,i)=>{var s=i(7386),n=i(75508);t.exports=function(t,e,i,r,a,o){if(a){var h,l=s(t,e,i,r,null,o),u=0;for(h=0;h<a.length;h++)u+=a[h].weight;if(!(u<=0))for(h=0;h<l.length;h++){for(var c=n.RND.frac()*u,d=0,f=-1,p=0;p<a.length;p++)if(c<=(d+=a[p].weight)){var g=a[p].index;f=Array.isArray(g)?g[Math.floor(n.RND.frac()*g.length)]:g;break}l[h].index=f}}}},10095:(t,e,i)=>{var s=i(85896),n=new(i(26099));t.exports=function(t,e,i,r){return s(t,0,e,n,i,r),n.x}},85896:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,a){void 0===i&&(i=!0),n||(n=new s);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(r||(r=l.scene.cameras.main),t-=l.x+r.scrollX*(1-l.scrollFactorX),e-=l.y+r.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u=t/o,c=e/h;return i&&(u=Math.floor(u),c=Math.floor(c)),n.set(u,c)}},63288:(t,e,i)=>{var s=i(85896),n=new(i(26099));t.exports=function(t,e,i,r){return s(0,t,e,n,i,r),n.y}},81086:(t,e,i)=>{t.exports={CalculateFacesAt:i(72023),CalculateFacesWithin:i(42573),CheckIsoBounds:i(33528),Copy:i(1785),CreateFromTiles:i(78419),CullBounds:i(19545),CullTiles:i(30003),Fill:i(35137),FilterTiles:i(40253),FindByIndex:i(52692),FindTile:i(66151),ForEachTile:i(97560),GetCullTilesFunction:i(43305),GetTileAt:i(7423),GetTileAtWorldXY:i(60540),GetTileCorners:i(55826),GetTileCornersFunction:i(11758),GetTilesWithin:i(7386),GetTilesWithinShape:i(91141),GetTilesWithinWorldXY:i(96523),GetTileToWorldXFunction:i(39167),GetTileToWorldXYFunction:i(62e3),GetTileToWorldYFunction:i(5984),GetWorldToTileXFunction:i(96113),GetWorldToTileXYFunction:i(16926),GetWorldToTileYFunction:i(55762),HasTileAt:i(45091),HasTileAtWorldXY:i(24152),HexagonalCullBounds:i(90454),HexagonalCullTiles:i(9474),HexagonalGetTileCorners:i(27229),HexagonalTileToWorldXY:i(19951),HexagonalWorldToTileXY:i(86625),IsInLayerBounds:i(62991),IsometricCullTiles:i(14018),IsometricTileToWorldXY:i(14127),IsometricWorldToTileXY:i(96897),PutTileAt:i(71558),PutTileAtWorldXY:i(26303),PutTilesAt:i(14051),Randomize:i(77389),RemoveTileAt:i(63557),RemoveTileAtWorldXY:i(94178),RenderDebug:i(15533),ReplaceByIndex:i(27987),RunCull:i(32483),SetCollision:i(57068),SetCollisionBetween:i(37266),SetCollisionByExclusion:i(75661),SetCollisionByProperty:i(64740),SetCollisionFromCollisionGroup:i(63307),SetLayerCollisionIndex:i(9589),SetTileCollision:i(20576),SetTileIndexCallback:i(79583),SetTileLocationCallback:i(93254),Shuffle:i(32903),StaggeredCullBounds:i(61325),StaggeredCullTiles:i(54503),StaggeredTileToWorldXY:i(97202),StaggeredTileToWorldY:i(28054),StaggeredWorldToTileXY:i(15108),StaggeredWorldToTileY:i(51900),SwapByIndex:i(86560),TileToWorldX:i(97281),TileToWorldXY:i(70326),TileToWorldY:i(29650),WeightedRandomize:i(77366),WorldToTileX:i(10095),WorldToTileXY:i(85896),WorldToTileY:i(63288)}},91907:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(t,e,i)=>{var s={ORIENTATION:i(91907)};t.exports=s},62501:(t,e,i)=>{var s=i(79291),n=i(21829),r={Components:i(81086),Parsers:i(57442),Formats:i(80341),ImageCollection:i(16536),ParseToTilemap:i(31989),Tile:i(23029),Tilemap:i(49075),TilemapCreator:i(45939),TilemapFactory:i(46029),Tileset:i(33629),TilemapLayer:i(20442),Orientation:i(91907),LayerData:i(14977),MapData:i(87010),ObjectLayer:i(48700)};r=s(!1,r,n.ORIENTATION),t.exports=r},14977:(t,e,i)=>{var s=i(83419),n=i(91907),r=i(95540),a=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.id=r(t,"id",0),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0),this.staggerAxis=r(t,"staggerAxis","y"),this.staggerIndex=r(t,"staggerIndex","odd")}});t.exports=a},87010:(t,e,i)=>{var s=i(83419),n=i(91907),r=i(95540),a=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0),this.staggerAxis=r(t,"staggerAxis","y"),this.staggerIndex=r(t,"staggerIndex","odd")}});t.exports=a},48700:(t,e,i)=>{var s=i(83419),n=i(95540),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.id=n(t,"id",0),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});t.exports=r},6641:(t,e,i)=>{var s=i(91907);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},46177:(t,e,i)=>{var s=i(80341),n=i(2342),r=i(82593),a=i(46594),o=i(87021);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=a(t,i,u);break;case s.WELTMEISTER:c=o(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},2342:(t,e,i)=>{var s=i(80341),n=i(14977),r=i(87010),a=i(23029);t.exports=function(t,e,i,o,h){for(var l=new n({tileWidth:i,tileHeight:o}),u=new r({name:t,tileWidth:i,tileHeight:o,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p<e.length;p++){c[p]=[];for(var g=e[p],m=0;m<g.length;m++){var v=parseInt(g[m],10);isNaN(v)||-1===v?c[p][m]=h?null:new a(l,-1,m,p,i,o):c[p][m]=new a(l,v,m,p,i,o)}0===f&&(f=g.length)}return u.width=l.width=f,u.height=l.height=d,u.widthInPixels=l.widthInPixels=f*i,u.heightInPixels=l.heightInPixels=d*o,l.data=c,u}},82593:(t,e,i)=>{var s=i(80341),n=i(2342);t.exports=function(t,e,i,r,a){var o=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,o,i,r,a);return h.format=s.CSV,h}},6656:(t,e,i)=>{var s=i(14977),n=i(23029);t.exports=function(t,e){for(var i=[],r=0;r<t.layer.length;r++){for(var a=t.layer[r],o=new s({name:a.name,width:a.width,height:a.height,tileWidth:a.tilesize,tileHeight:a.tilesize,visible:1===a.visible}),h=[],l=[],u=0;u<a.data.length;u++){for(var c=0;c<a.data[u].length;c++){var d,f=a.data[u][c]-1;d=f>-1?new n(o,f,c,u,a.tilesize,a.tilesize):e?null:new n(o,-1,c,u,a.tilesize,a.tilesize),h.push(d)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483:(t,e,i)=>{var s=i(33629);t.exports=function(t){for(var e=[],i=[],n=0;n<t.layer.length;n++){var r=t.layer[n],a=r.tilesetName;""!==a&&-1===i.indexOf(a)&&(i.push(a),e.push(new s(a,0,r.tilesize,r.tilesize,0,0)))}return e}},87021:(t,e,i)=>{var s=i(80341),n=i(87010),r=i(6656),a=i(96483);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var o=0,h=0,l=0;l<e.layer.length;l++)e.layer[l].width>o&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=a(e),u}},52833:(t,e,i)=>{t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442:(t,e,i)=>{t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233:(t,e,i)=>{var s=i(79291);t.exports=function(t){for(var e,i,n,r,a,o=0;o<t.layers.length;o++){e=t.layers[o],r=null;for(var h=0;h<e.data.length;h++){a=e.data[h];for(var l=0;l<a.length;l++)null===(i=a[l])||i.index<0||(n=t.tiles[i.index][2],r=t.tilesets[n],i.width=r.tileWidth,i.height=r.tileHeight,r.tileProperties&&r.tileProperties[i.index-r.firstgid]&&(i.properties=s(i.properties,r.tileProperties[i.index-r.firstgid])))}}}},41868:t=>{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n<i;n+=4)s[n/4]=(e.charCodeAt(n)|e.charCodeAt(n+1)<<8|e.charCodeAt(n+2)<<16|e.charCodeAt(n+3)<<24)>>>0;return s}},84101:(t,e,i)=>{var s=i(33629);t.exports=function(t){var e,i,n=[];for(e=0;e<t.imageCollections.length;e++)for(var r=t.imageCollections[e].images,a=0;a<r.length;a++){var o=r[a],h={x:0,y:o.height-t.tileHeight};(i=new s(o.image,o.gid,o.width,o.height,0,0,void 0,void 0,h)).updateTileData(o.width,o.height),t.tilesets.push(i)}for(e=0;e<t.tilesets.length;e++)for(var l=(i=t.tilesets[e]).tileMargin,u=i.tileMargin,c=0,d=0,f=0,p=i.firstgid;p<i.firstgid+i.total&&(n[p]=[l,u,e],l+=i.tileWidth+i.tileSpacing,++c!==i.total)&&(++d!==i.columns||(l=i.tileMargin,u+=i.tileHeight+i.tileSpacing,d=0,++f!==i.rows));p++);return n}},79677:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},29920:t=>{t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),s=Boolean(536870912&t);t&=536870911;var n=0,r=!1;return e&&i&&s?(n=Math.PI/2,r=!0):e&&i&&!s?(n=Math.PI,r=!1):e&&!i&&s?(n=Math.PI/2,r=!1):!e||i||s?!e&&i&&s?(n=3*Math.PI/2,r=!1):e||!i||s?e||i||!s?e||i||s||(n=0,r=!1):(n=3*Math.PI/2,r=!0):(n=Math.PI,r=!0):(n=0,r=!0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:s,rotation:n,flipped:r}}},12635:(t,e,i)=>{var s=i(95540),n=i(79677);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i<r.layers.length||i.length>0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var a=r.layers[r.i];if(r.i++,"imagelayer"===a.type){var o=s(a,"offsetx",0)+s(a,"startx",0),h=s(a,"offsety",0)+s(a,"starty",0);e.push({name:r.name+a.name,image:a.image,x:r.x+o+a.x,y:r.y+h+a.y,alpha:r.opacity*a.opacity,visible:r.visible&&a.visible,properties:s(a,"properties",{})})}else if("group"===a.type){var l=n(t,a,r);i.push(r),r=l}}return e}},46594:(t,e,i)=>{var s=i(51233),n=i(84101),r=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),c=i(22611),d=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(g.orientation===r.HEXAGONAL)if(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex,"y"===g.staggerAxis){var m=(g.tileHeight-g.hexSideLength)/2;g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+m)+m}else{var v=(g.tileWidth-g.hexSideLength)/2;g.widthInPixels=g.width*(g.hexSideLength+v)+v,g.heightInPixels=g.tileHeight*(g.height+.5)}g.layers=d(p,i),g.images=u(p);var y=f(p);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=c(p),g.tiles=n(g),s(g),g}},52205:(t,e,i)=>{var s=i(18254),n=i(29920),r=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=s(t,a);if(o.x+=e,o.y+=i,t.gid){var h=n(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(r):t.polygon?o.polygon=t.polygon.map(r):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611:(t,e,i)=>{var s=i(95540),n=i(52205),r=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i<o.layers.length||i.length>0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+s(h,"startx",0)+s(h,"offsetx",0),u=o.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d<h.objects.length;d++){var f=n(h.objects[d],l,u);c.push(f)}var p=new r(h);p.objects=c,e.push(p)}else if("group"===h.type){var g=a(t,h,o);i.push(o),o=g}}return e}},28200:(t,e,i)=>{var s=i(41868),n=i(91907),r=i(79677),a=i(6641),o=i(95540),h=i(14977),l=i(29920),u=i(23029);t.exports=function(t,e){for(var i=o(t,"infinite",!1),c=[],d=[],f=r(t);f.i<f.layers.length||d.length>0;)if(f.i>=f.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=d.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g<p.chunks.length;g++)p.chunks[g].data=s(p.chunks[g].data);p.data&&(p.data=s(p.data)),delete p.encoding}var m,v,y,x,w,b,T=[],S=0;if(i){var E=o(p,"startx",0)+p.x,A=o(p,"starty",0)+p.y;(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+E*t.tilewidth,y:f.y+o(p,"offsety",0)+A*t.tileheight,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===n.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(w=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+w)+w):(b=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+b)+b,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var C=0;C<p.height;C++){T[C]=[null];for(var M=0;M<p.width;M++)T[C][M]=null}for(C=0,N=p.chunks.length;C<N;C++)for(var _=p.chunks[C],R=_.x-E,P=_.y-A,L=0,F=0,O=_.data.length;F<O;F++){var D=S+R,k=L+P;(v=l(_.data[F])).gid>0?((y=new u(m,v.gid,D,k,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,T[k][D]=y):(x=e?null:new u(m,-1,D,k,t.tilewidth,t.tileheight),T[k][D]=x),++S===_.width&&(L++,S=0)}}else{(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===n.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(w=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+w)+w):(b=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+b)+b,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var I=[],B=0,N=p.data.length;B<N;B++)(v=l(p.data[B])).gid>0?((y=new u(m,v.gid,S,T.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,I.push(y)):(x=e?null:new u(m,-1,S,T.length,t.tilewidth,t.tileheight),I.push(x)),++S===p.width&&(T.push(I),S=0,I=[])}m.data=T,c.push(m)}else if("group"===p.type){var Y=r(t,p,f);d.push(f),f=Y}}return c}},24619:(t,e,i)=>{var s=i(33629),n=i(16536),r=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l<t.tilesets.length;l++){var u=t.tilesets[l];if(u.source)console.warn("External tilesets unsupported. Use Embed Tileset and re-export");else if(u.image){var c=new s(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,void 0,void 0,u.tileoffset);if(t.version>1){var d=void 0,f=void 0;if(Array.isArray(u.tiles)){d=d||{},f=f||{};for(var p=0;p<u.tiles.length;p++){var g=u.tiles[p];if(g.properties){var m={};g.properties.forEach((function(t){m[t.name]=t.value})),f[g.id]=m}if(g.objectgroup&&((d[g.id]||(d[g.id]={})).objectgroup=g.objectgroup,g.objectgroup.objects)){var v=g.objectgroup.objects.map((function(t){return r(t)}));d[g.id].objectgroup.objects=v}g.animation&&((d[g.id]||(d[g.id]={})).animation=g.animation),g.type&&((d[g.id]||(d[g.id]={})).type=g.type)}}Array.isArray(u.wangsets)&&(d=d||{},f=f||{},a(u.wangsets,d)),d&&(c.tileData=d,c.tileProperties=f)}else if(u.tileproperties&&(c.tileProperties=u.tileproperties),u.tiles)for(e in c.tileData=u.tiles,c.tileData){var y=c.tileData[e].objectgroup;if(y&&y.objects){var x=y.objects.map((function(t){return r(t)}));c.tileData[e].objectgroup.objects=x}}c.updateTileData(u.imagewidth,u.imageheight),i.push(c)}else{var w=new n(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,u.properties),b=0;for(p=0;p<u.tiles.length;p++){var T=(g=u.tiles[p]).image,S=parseInt(g.id,10),E=u.firstgid+S,A=g.imagewidth,C=g.imageheight;w.addImage(E,T,A,C),b=Math.max(S,b)}w.maxId=b,o.push(w)}h&&(h.lastgid=u.firstgid-1),h=u}return{tilesets:i,imageCollections:o}}},57880:t=>{t.exports=function(t,e){for(var i=0;i<t.length;i++){var s=t[i],n=i;if(s.name&&""!==s.name&&(n=s.name),Array.isArray(s.wangtiles)&&s.wangtiles.length>0){var r,a,o,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r<s.edgecolors.length;r++)o=1+r,""!==(a=s.edgecolors[r]).name&&(h[o]=a.name);if(Array.isArray(s.cornercolors))for(r=0;r<s.cornercolors.length;r++)o=1+r,""!==(a=s.cornercolors[r]).name&&(l[o]=a.name);if(Array.isArray(s.colors))for(r=0;r<s.colors.length;r++)o=1+r,""!==(a=s.colors[r]).name&&(h[o]=l[o]=a.name);for(var u=[h,l,h,l,h,l,h,l],c=0;c<s.wangtiles.length;c++){var d=s.wangtiles[c],f=e[d.tileid]||(e[d.tileid]={});f=f.wangid||(f.wangid={});for(var p=[],g=0;g<Math.min(u.length,d.wangid.length);g++)if(0!==(a=d.wangid[g])){var m=u[g][a];void 0===m?p.push(a):p.push(m)}else p.push(void 0);f[n]=p}}}}},96761:(t,e,i)=>{t.exports={AssignTileProperties:i(51233),Base64Decode:i(41868),BuildTilesetIndex:i(84101),CreateGroupLayer:i(79677),ParseGID:i(29920),ParseImageLayers:i(12635),ParseJSONTiled:i(46594),ParseObject:i(52205),ParseObjectLayers:i(22611),ParseTileLayers:i(28200),ParseTilesets:i(24619)}},33385:(t,e,i)=>{var s=i(83419),n=i(37277),r=i(44594),a=i(94880),o=i(72905),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;if(t instanceof a){if(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat,e.delay<=0&&e.repeatCount>0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];o(this._pendingRemoval,i),o(this._pendingInsertion,i),o(this._active,i)}return this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,s;for(i=0;i<t;i++){s=this._pendingRemoval[i];var n=this._active.indexOf(s);n>-1&&this._active.splice(n,1),s.destroy()}for(i=0;i<e;i++)s=this._pendingInsertion[i],this._active.push(s);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var s=this._active[i];if(!s.paused&&(s.elapsed+=e*s.timeScale,s.elapsed>=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off(r.PRE_UPDATE,this.preUpdate,this),e.off(r.UPDATE,this.update,this),e.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null}});n.register("Clock",h,"time"),t.exports=h},96120:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(39429),a=i(95540),o=i(44594),h=i(89809),l=new s({Extends:n,initialize:function(t,e){n.call(this),this.scene=t,this.systems=t.sys,this.elapsed=0,this.timeScale=1,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var i=this.systems.events;i.on(o.PRE_UPDATE,this.preUpdate,this),i.on(o.UPDATE,this.update,this),i.once(o.SHUTDOWN,this.destroy,this),e&&this.add(e)},preUpdate:function(t,e){this.paused||(this.elapsed+=e*this.timeScale)},update:function(){if(!this.paused&&!this.complete){var t,e,i=this.events,s=!1,n=this.systems;for(t=0;t<i.length;t++){var r=i[t];if(!r.complete&&r.time<=this.elapsed){if(r.complete=!0,this.totalComplete++,e=r.target?r.target:this,r.if&&!r.if.call(e,r))continue;if(r.once&&(s=!0),r.set&&r.target)for(var a in r.set)r.target[a]=r.set[a];this.iteration&&r.repeat++,r.loop&&r.repeat&&r.loop.call(e),r.tween&&(r.tweenInstance=n.tweens.add(r.tween)),r.sound&&("string"==typeof r.sound?n.sound.play(r.sound):n.sound.play(r.sound.key,r.sound.config)),r.event&&this.emit(r.event,e),r.run&&r.run.call(e),r.stop&&this.stop()}}if(s)for(t=0;t<i.length;t++)i[t].complete&&i[t].once&&(i.splice(t,1),t--);this.totalComplete>=i.length&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e<t.length;e++){var i=t[e];i.tweenInstance&&(i.tweenInstance.paused=!0)}return this},repeat:function(t){return void 0!==t&&!0!==t||(t=-1),!1===t&&(t=0),this.loop=t,this},resume:function(){this.paused=!1;for(var t=this.events,e=0;e<t.length;e++){var i=t[e];i.tweenInstance&&(i.tweenInstance.paused=!1)}return this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(t){void 0===t&&(t=!1),this.elapsed=0,t||(this.iteration=0);for(var e=this.events,i=0;i<e.length;i++){var s=e[i];s.complete=!1,t||(s.repeat=0),s.tweenInstance&&s.tweenInstance.stop()}return this.play(!1)},add:function(t){Array.isArray(t)||(t=[t]);var e=this.events,i=0;e.length>0&&(i=e[e.length-1].time);for(var s=0;s<t.length;s++){var n=t[s],r=a(n,"at",0),o=a(n,"in",null);null!==o&&(r=this.elapsed+o);var h=a(n,"from",null);null!==h&&(r=i+h),e.push({complete:!1,time:r,repeat:0,if:a(n,"if",null),run:a(n,"run",null),loop:a(n,"loop",null),event:a(n,"event",null),target:a(n,"target",null),set:a(n,"set",null),tween:a(n,"tween",null),sound:a(n,"sound",null),once:a(n,"once",!1),stop:a(n,"stop",!1)}),i=r}return this.complete=!1,this},clear:function(){for(var t=this.events,e=0;e<t.length;e++){var i=t[e];i.tweenInstance&&i.tweenInstance.stop()}return t=[],this.elapsed=0,this.paused=!0,this},isPlaying:function(){return!this.paused&&!this.complete},getProgress:function(){return Math.min(this.totalComplete,this.events.length)/this.events.length},destroy:function(){var t=this.systems.events;t.off(o.PRE_UPDATE,this.preUpdate,this),t.off(o.UPDATE,this.update,this),t.off(o.SHUTDOWN,this.destroy,this),this.clear(),this.scene=null,this.systems=null}});r.register("timeline",(function(t){return new l(this.scene,t)})),t.exports=l},94880:(t,e,i)=>{var s=i(83419),n=i(95540),r=new s({initialize:function(t){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(t)},reset:function(t){if(this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}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(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},35945:t=>{t.exports="complete"},89809:(t,e,i)=>{t.exports={COMPLETE:i(35945)}},90291:(t,e,i)=>{t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382:(t,e,i)=>{var s=i(72905),n=i(83419),r=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(86081),c=i(8357),d=i(43960),f=i(26012),p=new n({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i<t.length;i++){var s=t[i];s instanceof u||s instanceof d?e.push(s):Array.isArray(s.tweens)?e.push(f(this,s)):e.push(c(this,s))}return 1===e.length?e[0]:e},add:function(t){var e=t,i=this.tweens;return e instanceof u||e instanceof d||(e=Array.isArray(e.tweens)?f(this,e):c(this,e)),i.push(e.reset()),e},addMultiple:function(t){for(var e,i=[],s=this.tweens,n=0;n<t.length;n++)(e=t[n])instanceof u||e instanceof d||(e=Array.isArray(e.tweens)?f(this,e):c(this,e)),s.push(e.reset()),i.push(e);return i},chain:function(t){var e=f(this,t);return this.tweens.push(e.init()),e},getChainedTweens:function(t){return t.getChainedTweens()},has:function(t){return this.tweens.indexOf(t)>-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,n=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):n=0,n},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,s;this.processing=!0;var n=[],r=this.tweens;for(i=0;i<r.length;i++)(s=r[i]).update(e)&&n.push(s);var a=n.length;if(a&&r.length>0){for(i=0;i<a;i++){s=n[i];var o=r.indexOf(s);o>-1&&(s.isPendingRemove()||s.isDestroyed())&&(r.splice(o,1),s.destroy())}n.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;i<arguments.length;i++)s.push(arguments[i]);return this.tweens.forEach((function(i){s[0]=i,t.apply(e,s)})),this},getTweens:function(){return this.tweens.slice()},getTweensOf:function(t){for(var e=[],i=this.tweens,s=(t=Array.isArray(t)?r(t):[t]).length,n=0;n<i.length;n++)for(var a=i[n],o=0;o<s;o++)!a.isDestroyed()&&a.hasTarget(t[o])&&e.push(a);return e},getGlobalTimeScale:function(){return this.timeScale},setGlobalTimeScale:function(t){return this.timeScale=t,this},isTweening:function(t){for(var e,i=this.tweens,s=0;s<i.length;s++)if((e=i[s]).isPlaying()&&e.hasTarget(t))return!0;return!1},killAll:function(){for(var t=this.processing?this.getTweens():this.tweens,e=0;e<t.length;e++)t[e].destroy();return this.processing||(t.length=0),this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].destroy();return this},pauseAll:function(){return this.paused=!0,this},resumeAll:function(){return this.paused=!1,this},shutdown:function(){this.killAll(),this.tweens=[],this.events.off(h.UPDATE,this.update,this),this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.events=null}});o.register("TweenManager",p,"tweens"),t.exports=p},57355:t=>{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},6113:(t,e,i)=>{var s=i(62640),n=i(35355);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";if(t.indexOf(".")){var a=(r=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===a?r="easeIn":"out"===a?r="easeOut":"inout"===a&&(r="easeInOut")}t=n(t.substring(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t&&(i=t);if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},91389:(t,e,i)=>{var s=i(89318),n=i(77259),r={bezier:s,catmull:n,catmullrom:n,linear:i(28392)};t.exports=function(t){if(null===t)return null;var e=r.linear;return"string"==typeof t?r.hasOwnProperty(t)&&(e=r[t]):"function"==typeof t&&(e=t),e}},55292:t=>{t.exports=function(t,e,i){return t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,s,n,r,a,o){return t[e](i,s,n,r,a,o)}:function(){return t[e]}:"function"==typeof i?i:function(){return i}}},82985:(t,e,i)=>{var s=i(81076);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},62329:(t,e,i)=>{var s=i(35154);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},17777:(t,e,i)=>{var s=i(30976),n=i(99472);function r(t){return!!t.getActive&&"function"==typeof t.getActive}function a(t){return!!t.getStart&&"function"==typeof t.getStart}function o(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},c=function(t,e,i){return i},d=null,f=typeof e;if("number"===f)u=function(){return e};else if(Array.isArray(e))c=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===f){var p=e.toLowerCase(),g="random"===p.substring(0,6),m="int"===p.substring(0,3);if(g||m){var v=p.indexOf("("),y=p.indexOf(")"),x=p.indexOf(",");if(!(v&&y&&x))throw new Error("invalid random() format");var w=parseFloat(p.substring(v+1,x)),b=parseFloat(p.substring(x+1,y));u=g?function(){return n(w,b)}:function(){return s(w,b)}}else{p=p[0];var T=parseFloat(e.substr(2));switch(p){case"+":u=function(t,e,i){return i+T};break;case"-":u=function(t,e,i){return i-T};break;case"*":u=function(t,e,i){return i*T};break;case"/":u=function(t,e,i){return i/T};break;default:u=function(){return parseFloat(e)}}}}else if("function"===f)u=e;else if("object"===f)if(a(l=e)||o(l)||r(l))r(e)&&(d=e.getActive),o(e)&&(u=e.getEnd),a(e)&&(c=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var S=e.hasOwnProperty("to"),E=e.hasOwnProperty("from"),A=e.hasOwnProperty("start");if(S&&(E||A)){if(i=h(t,e.to),A){var C=h(t,e.start);i.getActive=C.getEnd}if(E){var M=h(t,e.from);i.getStart=M.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};t.exports=h},88032:(t,e,i)=>{var s=i(70402),n=i(69902),r=i(23568),a=i(57355),o=i(6113),h=i(95540),l=i(55292),u=i(35154),c=i(17777),d=i(269),f=i(86081);t.exports=function(t,e,i){if(e instanceof f)return e.parent=t,e;i=void 0===i?n:d(n,i);var p=h(e,"from",0),g=h(e,"to",1),m=[{value:p}],v=h(e,"delay",i.delay),y=h(e,"easeParams",i.easeParams),x=h(e,"ease",i.ease),w=c("value",g),b=new f(t,m),T=b.add(0,"value",w.getEnd,w.getStart,w.getActive,o(h(e,"ease",x),h(e,"easeParams",y)),l(e,"delay",v),h(e,"duration",i.duration),a(e,"yoyo",i.yoyo),h(e,"hold",i.hold),h(e,"repeat",i.repeat),h(e,"repeatDelay",i.repeatDelay),!1,!1);T.start=p,T.current=p,b.completeDelay=r(e,"completeDelay",0),b.loop=Math.round(r(e,"loop",0)),b.loopDelay=Math.round(r(e,"loopDelay",0)),b.paused=a(e,"paused",!1),b.persist=a(e,"persist",!1),b.isNumberTween=!0,b.callbackScope=u(e,"callbackScope",b);for(var S=s.TYPES,E=0;E<S.length;E++){var A=S[E],C=u(e,A,!1);if(C){var M=u(e,A+"Params",[]);b.setCallback(A,C,M)}}return b}},93109:(t,e,i)=>{var s=i(6113),n=i(35154),r=i(36383);t.exports=function(t,e){var i;void 0===e&&(e={});var a=n(e,"start",0),o=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,f="number"==typeof l,p=Array.isArray(t),g=p?parseFloat(t[0]):parseFloat(t),m=p?parseFloat(t[1]):0,v=Math.max(g,m);if(p&&(a+=g),h){var y=h[0],x=h[1],w=0,b=0,T=0,S=0,E=[];d?(w=y-1,b=x-1):f?(w=l%y,b=Math.floor(l/y)):c&&(w=(y-1)/2,b=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,C=0;C<x;C++){E[C]=[];for(var M=0;M<y;M++){T=w-M,S=b-C;var _=Math.sqrt(T*T+S*S);_>A&&(A=_),E[C][M]=_}}}var R=o?s(o):null;return i=h?function(t,e,i,s){var n,r=0,o=s%y,h=Math.floor(s/y);if(o>=0&&o<y&&h>=0&&h<x&&(r=E[h][o]),p){var l=m-g;n=R?r/A*l*R(r/A):r/A*l}else n=R?r*g*R(r/A):r*g;return n+a}:function(t,e,i,s,n){var r,o,h;return n--,u?r=s:c?r=Math.abs(n/2-s):d?r=n-s:f&&(r=Math.abs(l-s)),p?(h=c?(m-g)/n*(2*r):(m-g)/n*r,o=R?h*R(r/n):h):o=R?n*v*R(r/n):r*g,o+a},i}},8357:(t,e,i)=>{var s=i(70402),n=i(69902),r=i(23568),a=i(57355),o=i(6113),h=i(95540),l=i(91389),u=i(55292),c=i(82985),d=i(62329),f=i(35154),p=i(17777),g=i(269),m=i(86081);t.exports=function(t,e,i){if(e instanceof m)return e.parent=t,e;i=void 0===i?n:g(n,i);var v=d(e);!v&&i.targets&&(v=i.targets);for(var y=c(e),x=h(e,"delay",i.delay),w=h(e,"duration",i.duration),b=h(e,"easeParams",i.easeParams),T=h(e,"ease",i.ease),S=h(e,"hold",i.hold),E=h(e,"repeat",i.repeat),A=h(e,"repeatDelay",i.repeatDelay),C=a(e,"yoyo",i.yoyo),M=a(e,"flipX",i.flipX),_=a(e,"flipY",i.flipY),R=h(e,"interpolation",i.interpolation),P=function(t,e,i,s){if("texture"===i){var n=s,r=void 0;Array.isArray(s)?(n=s[0],r=s[1]):s.hasOwnProperty("value")?(n=s.value,Array.isArray(s.value)?(n=s.value[0],r=s.value[1]):"string"==typeof s.value&&(n=s.value)):"string"==typeof s&&(n=s),t.addFrame(e,n,r,u(s,"delay",x),h(s,"duration",w),h(s,"hold",S),h(s,"repeat",E),h(s,"repeatDelay",A),a(s,"flipX",M),a(s,"flipY",_))}else{var c=p(i,s),d=l(h(s,"interpolation",R));t.add(e,i,c.getEnd,c.getStart,c.getActive,o(h(s,"ease",T),h(s,"easeParams",b)),u(s,"delay",x),h(s,"duration",w),a(s,"yoyo",C),h(s,"hold",S),h(s,"repeat",E),h(s,"repeatDelay",A),a(s,"flipX",M),a(s,"flipY",_),d,d?s:null)}},L=new m(t,v),F=0;F<y.length;F++)for(var O=y[F].key,D=y[F].value,k=0;k<v.length;k++)"scale"!==O||v[k].hasOwnProperty("scale")?P(L,k,O,D):(P(L,k,"scaleX",D),P(L,k,"scaleY",D));L.completeDelay=r(e,"completeDelay",0),L.loop=Math.round(r(e,"loop",0)),L.loopDelay=Math.round(r(e,"loopDelay",0)),L.paused=a(e,"paused",!1),L.persist=a(e,"persist",!1),L.callbackScope=h(e,"callbackScope",L);for(var I=s.TYPES,B=0;B<I.length;B++){var N=I[B],Y=f(e,N,!1);if(Y){var X=f(e,N+"Params",[]);L.setCallback(N,Y,X)}}return L}},26012:(t,e,i)=>{var s=i(70402),n=i(23568),r=i(57355),a=i(62329),o=i(35154),h=i(8357),l=i(43960);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=o(e,"delay",0),u.completeDelay=n(e,"completeDelay",0),u.loop=Math.round(n(e,"loop",o(e,"repeat",0))),u.loopDelay=Math.round(n(e,"loopDelay",o(e,"repeatDelay",0))),u.paused=r(e,"paused",!1),u.persist=r(e,"persist",!1),u.callbackScope=o(e,"callbackScope",u);var c=s.TYPES;for(i=0;i<c.length;i++){var d=c[i],f=o(e,d,!1);if(f){var p=o(e,d+"Params",[]);u.setCallback(d,f,p)}}var g=o(e,"tweens",null);if(Array.isArray(g)){var m=[],v=a(e),y=void 0;for(v&&(y={targets:v}),i=0;i<g.length;i++)m.push(h(u,g[i],y));u.add(m)}return u}},30231:(t,e,i)=>{t.exports={GetBoolean:i(57355),GetEaseFunction:i(6113),GetInterpolationFunction:i(91389),GetNewValue:i(55292),GetProps:i(82985),GetTargets:i(62329),GetValueOp:i(17777),NumberTweenBuilder:i(88032),StaggerBuilder:i(93109),TweenBuilder:i(8357)}},73685:t=>{t.exports="active"},98540:t=>{t.exports="complete"},67233:t=>{t.exports="loop"},2859:t=>{t.exports="pause"},98336:t=>{t.exports="repeat"},25764:t=>{t.exports="resume"},32193:t=>{t.exports="start"},84371:t=>{t.exports="stop"},70766:t=>{t.exports="update"},55659:t=>{t.exports="yoyo"},842:(t,e,i)=>{t.exports={TWEEN_ACTIVE:i(73685),TWEEN_COMPLETE:i(98540),TWEEN_LOOP:i(67233),TWEEN_PAUSE:i(2859),TWEEN_RESUME:i(25764),TWEEN_REPEAT:i(98336),TWEEN_START:i(32193),TWEEN_STOP:i(84371),TWEEN_UPDATE:i(70766),TWEEN_YOYO:i(55659)}},43066:(t,e,i)=>{var s={States:i(86353),Builders:i(30231),Events:i(842),TweenManager:i(40382),Tween:i(86081),TweenData:i(48177),TweenFrameData:i(42220),BaseTween:i(70402),TweenChain:i(43960)};t.exports=s},70402:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(842),a=i(86353),o=new s({Extends:n,initialize:function(t){n.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(r.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(r.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(r.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(r.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(r.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach((function(t){t.destroy()})),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042:(t,e,i)=>{var s=i(83419),n=i(842),r=i(86353),a=new s({initialize:function(t,e,i,s,n,r,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=s<=0?.01:s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=n,this.hold=r,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=r.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=r.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=r.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=r.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=r.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=r.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=r.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=r.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===r.CREATED},isDelayed:function(){return this.state===r.DELAY},isPendingRender:function(){return this.state===r.PENDING_RENDER},isPlayingForward:function(){return this.state===r.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===r.PLAYING_BACKWARD},isHolding:function(){return this.state===r.HOLD_DELAY},isRepeating:function(){return this.state===r.REPEAT_DELAY},isComplete:function(){return this.state===r.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,s=t.targets[i],n=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(s,n,0,i,e,t),this.repeatCounter=-1===this.repeat?r.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*r.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay<t.startDelay&&(t.startDelay=this.delay),this.delay>0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var s=this.tween,r=s.totalTargets,a=this.targetIndex,o=s.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,r,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(n.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,r,s)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(n.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},86081:(t,e,i)=>{var s=i(70402),n=i(83419),r=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),c=i(42220),d=new n({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,s,n,r,a,o,h,l,c,d,f,p,g,m){var v=new u(this,t,e,i,s,n,r,a,o,h,l,c,d,f,p,g,m);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,s,n,r,a,o,h,l){var u=new c(this,t,e,i,s,n,r,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var s=0;s<this.totalData;s++){var n=this.data[s];n.key===t&&(n.isPlayingForward()||n.isPlayingBackward())&&(n.end=e,i&&(n.start=n.current))}return this},restart:function(){switch(this.state){case l.REMOVED:case l.FINISHED:this.seek(),this.parent.makeActive(this);break;case l.PENDING:case l.PENDING_REMOVE:this.parent.reset(this);break;case l.DESTROYED:console.warn("Cannot restart destroyed Tween",this);break;default:this.seek()}return this.paused=!1,this.hasStarted=!1,this},nextState:function(){if(this.loopCounter>0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive");var s=this.paused;if(this.paused=!1,t>0){for(var n=Math.floor(t/e),a=t-n*e,o=0;o<n;o++)this.update(e);a>0&&this.update(a)}return this.paused=s,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i<this.totalData;i++)e[i].reset(t);this.duration=Math.max(this.duration,.01);var s=this.duration,n=this.completeDelay,r=this.loopCounter,a=this.loopDelay;this.totalDuration=r>0?s+n+(s+a)*r:s+n},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(r.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s<this.totalData;s++)i[s].update(t)&&(e=!0);this.elapsed+=t,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=t,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),e||this.nextState();var n=this.isPendingRemove();return n&&this.persist&&(this.setFinishedState(),n=!1),n},forward:function(t){return this.update(t),this},rewind:function(t){return this.update(-t),this},dispatchEvent:function(t,e){if(!this.isSeeking){if(this.emit(t,this,this.targets),!this.callbacks)return;var i=this.callbacks[e];i&&i.func.apply(this.callbackScope,[this,this.targets].concat(i.params))}},destroy:function(){s.prototype.destroy.call(this),this.targets=null}});o.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),a.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=d},43960:(t,e,i)=>{var s=i(72905),n=i(70402),r=i(83419),a=i(842),o=i(44603),h=i(39429),l=i(86353),u=new r({Extends:n,initialize:function(t){n.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s<e.length;s++){var n=e[s];n.parent=this,i.push(n.reset())}return this.totalData=i.length,this},remove:function(t){return s(this.data,t),t.setRemovedState(),t===this.currentTween&&this.nextTween(),this.totalData=this.data.length,this},hasTarget:function(t){for(var e=this.data,i=0;i<this.totalData;i++)if(e[i].hasTarget(t))return!0;return!1},restart:function(){return this.isDestroyed()?(console.warn("Cannot restart destroyed TweenChain",this),this):(this.isRemoved()&&this.parent.makeActive(this),this.resetTweens(),this.paused=!1,this.init())},reset:function(t){return t.seek(),t.setActiveState(),this},makeActive:function(t){return t.reset(),t.setActiveState(),this},nextState:function(){if(this.loopCounter>0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i<e;i++)t[i].reset(!1);this.setCurrentTween(0)},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.isFinished()||this.paused)return!1;if(t*=this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,"onStart"),t=0));var e=!1;return this.isActive()&&this.currentTween&&(this.currentTween.update(t)&&this.nextTween()&&this.nextState(),(e=this.isPendingRemove())&&this.persist&&(this.setFinishedState(),e=!1)),e},nextTween:function(){return this.currentIndex++,this.currentIndex===this.totalData||(this.setCurrentTween(this.currentIndex),!1)},setCurrentTween:function(t){this.currentIndex=t,this.currentTween=this.data[t],this.currentTween.setActiveState()},dispatchEvent:function(t,e){this.emit(t,this);var i=this.callbacks[e];i&&i.func.apply(this.callbackScope,[this].concat(i.params))},destroy:function(){n.prototype.destroy.call(this),this.currentTween=null}});h.register("tweenchain",(function(t){return this.scene.sys.tweens.chain(t)})),o.register("tweenchain",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=u},48177:(t,e,i)=>{var s=i(95042),n=i(45319),r=i(83419),a=i(842),o=new r({Extends:s,initialize:function(t,e,i,n,r,a,o,h,l,u,c,d,f,p,g,m,v){s.call(this,t,e,h,l,u,c,d,f,p,g),this.key=i,this.getActiveValue=a,this.getEndValue=n,this.getStartValue=r,this.ease=o,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=m,this.interpolationData=v},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex],i=this.key;t&&(e[i]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(e[i]=this.getActiveValue(e,i,0))},update:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,r=e.targets[s],o=this.key;if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(r,o,r[o],s,i,e),this.end=this.getEndValue(r,o,this.start,s,i,e),this.current=this.start,r[o]=this.start,this.setPlayingForwardState(),!0;var h=this.isPlayingForward(),l=this.isPlayingBackward();if(h||l){var u=this.elapsed,c=this.duration,d=0,f=!1;(u+=t)>=c?(d=u-c,u=c,f=!0):u<0&&(u=0);var p=n(u/c,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,r[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,r[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(d)):(e.isNumberTween&&(this.current=this.start,r[o]=this.current),this.setStateFromStart(d))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key,r=this.current,a=this.previous;i.emit(t,i,n,s,r,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,s,n,r,a].concat(o.params))}},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220:(t,e,i)=>{var s=i(95042),n=i(45319),r=i(83419),a=i(842),o=new r({Extends:s,initialize:function(t,e,i,n,r,a,o,h,l,u,c){s.call(this,t,e,r,a,!1,o,h,l,u,c),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=n,this.yoyo=0!==h},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var r=this.isPlayingForward(),o=this.isPlayingBackward();if(r||o){var h=this.elapsed,l=this.duration,u=0,c=!1;(h+=t)>=l?(u=h-l,h=l,c=!0):h<0&&(h=0);var d=n(h/l,0,1);this.elapsed=h,this.progress=d,c&&(r?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key;i.emit(t,i,n,s);var r=i.callbacks[e];r&&r.func.apply(i.callbackScope,[i,s,n].concat(r.params))}},destroy:function(){s.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,a){for(var o in s)if(s.hasOwnProperty(o)){var h=e(s,o,n);if(!1!==h){if(i((a||t).prototype,o)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=s[o]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)s(t,e[i].prototype||e[i])}}function r(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var r=t.Extends;e=function(){r.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var a=null;return t.Mixins&&(a=t.Mixins,delete t.Mixins),n(e,a),s(e,t,!0,i),e}r.extend=s,r.mixin=n,r.ignoreFinals=!1,t.exports=r},29747:t=>{t.exports=function(){}},20242:t=>{t.exports=function(){return null}},71146:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o<a;o++){var h=e[o];t.push(h),s&&s.call(n,h)}return e}},51067:t=>{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},66905:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},21612:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=0;if(s(t,n,r))for(var o=n;o<r;o++)t[o][e]===i&&a++;return a}},95428:t=>{t.exports=function(t,e,i){var s,n=[null];for(s=3;s<arguments.length;s++)n.push(arguments[s]);for(s=0;s<t.length;s++)n[0]=t[s],e.apply(i,n);return t}},36914:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var a,o=[null];for(a=5;a<arguments.length;a++)o.push(arguments[a]);for(a=n;a<r;a++)o[0]=t[a],e.apply(i,o)}return t}},81957:t=>{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(t<e[0][i])return e[0];for(;e[r][i]<t;)r++}else for(;e[r]<t;)r++;return r>e.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},43491:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s<t.length;s++)Array.isArray(t[s])?e(t[s],i):i.push(t[s]);return i};t.exports=e},46710:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=[];if(s(t,n,r))for(var o=n;o<r;o++){var h=t[o];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&a.push(h)}return a}},58731:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),-1!==n){if(s(t,n,r))for(var a=n;a<r;a++){var o=t[a];if(!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o}}else if(s(t,0,r))for(a=r;a>=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},85835:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n=t.indexOf(i),t.splice(n+1,0,e)),t}},83371:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s<n||(t.splice(s,1),0===n?t.unshift(e):t.splice(n,0,e)),t}},70864:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},69693:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},40853:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-1){var s=t[i+1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},20283:t=>{t.exports=function(t,e,i,s){var n,r=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e<t)for(n=t;n>=e;n--)a?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)a?r.push(i+n.toString()+s):r.push(n);return r}},593:(t,e,i)=>{var s=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),a=0;a<r;a++)n.push(t),t+=i;return n}},43886:t=>{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return t<e?-1:t>e?1:0}var s=function(t,n,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>r;){if(a-r>600){var h=a-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(n-l*c/h+d)),p=Math.min(a,Math.floor(n+(h-l)*c/h+d));s(t,n,f,p,o)}var g=t[n],m=r,v=a;for(e(t,r,n),o(t[a],g)>0&&e(t,r,a);m<v;){for(e(t,m,v),m++,v--;o(t[m],g)<0;)m++;for(;o(t[v],g)>0;)v--}0===o(t[r],g)?e(t,r,v):e(t,++v,a),v<=n&&(r=v+1),n<=v&&(a=v-1)}};t.exports=s},88492:(t,e,i)=>{var s=i(35154),n=i(33680),r=function(t,e,i){for(var s=[],n=0;n<t.length;n++)for(var r=0;r<e.length;r++)for(var a=0;a<i;a++)s.push({a:t[n],b:e[r]});return s};t.exports=function(t,e,i){var a=s(i,"max",0),o=s(i,"qty",1),h=s(i,"random",!1),l=s(i,"randomB",!1),u=s(i,"repeat",0),c=s(i,"yoyo",!1),d=[];if(l&&n(e),-1===u)if(0===a)u=0;else{var f=t.length*e.length*o;c&&(f*=2),u=Math.ceil(a/f)}for(var p=0;p<=u;p++){var g=r(t,e,o);h&&n(g),d=d.concat(g),c&&(g.reverse(),d=d.concat(g))}return a&&d.splice(a),d}},72905:(t,e,i)=>{var s=i(19133);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(r=t.indexOf(h))&&(s(t,r),o.push(h),i&&i.call(n,h)),a--}return o}},60248:(t,e,i)=>{var s=i(19133);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},81409:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(n)for(var h=0;h<o.length;h++){var l=o[h];n.call(r,l)}return o}return[]}},31856:(t,e,i)=>{var s=i(19133);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},42169:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},86003:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s<e;s++)i=t.shift(),t.push(i);return i}},49498:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s<e;s++)i=t.pop(),t.unshift(i);return i}},82011:t=>{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>=n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a<r;a++){var o=t[a];o.hasOwnProperty(e)&&(o[e]=i)}return t}},33680:t=>{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},90126:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},19133:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n<i;n++)t[n]=t[n+1];return t.length=i,s}}},19186:(t,e,i)=>{var s=i(82264);function n(t,e){return String(t).localeCompare(e)}function r(t,e,i,s){var n,r,a,o,h,l=t.length,u=0,c=2*i;for(n=0;n<l;n+=c)for(a=(r=n+i)+i,r>l&&(r=l),a>l&&(a=l),o=n,h=r;;)if(o<r&&h<a)e(t[o],t[h])<=0?s[u++]=t[o++]:s[u++]=t[h++];else if(o<r)s[u++]=t[o++];else{if(!(h<a))break;s[u++]=t[h++]}}t.exports=function(t,e){if(void 0===e&&(e=n),!t||t.length<2)return t;if(s.features.stableSort)return t.sort(e);var i=function(t,e){var i=t.length;if(i<=1)return t;for(var s=new Array(i),n=1;n<i;n*=2){r(t,e,n,s);var a=t;t=s,s=a}return t}(t,e);return i!==t&&r(i,null,t.length,t),t}},25630:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},37105:(t,e,i)=>{t.exports={Matrix:i(54915),Add:i(71146),AddAt:i(51067),BringToTop:i(66905),CountAllMatching:i(21612),Each:i(95428),EachInRange:i(36914),FindClosestInSorted:i(81957),Flatten:i(43491),GetAll:i(46710),GetFirst:i(58731),GetRandom:i(26546),MoveDown:i(70864),MoveTo:i(69693),MoveUp:i(40853),MoveAbove:i(85835),MoveBelow:i(83371),NumberArray:i(20283),NumberArrayStep:i(593),QuickSelect:i(43886),Range:i(88492),Remove:i(72905),RemoveAt:i(60248),RemoveBetween:i(81409),RemoveRandomElement:i(31856),Replace:i(42169),RotateLeft:i(86003),RotateRight:i(49498),SafeRange:i(82011),SendToBack:i(89545),SetAll:i(17810),Shuffle:i(33680),SortByDigits:i(90126),SpliceOne:i(19133),StableSort:i(19186),Swap:i(25630)}},86922:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},63362:(t,e,i)=>{var s=i(41836),n=i(86922);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i<t.length;i++){for(var r=0;r<t[i].length;r++){var a=t[i][r].toString();e+="undefined"!==a?s(a,2):"?",r<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var o=0;o<t[i].length;o++)e+="---",o<t[i].length-1&&(e+="+");e+="\n"}}return e}},92598:t=>{t.exports=function(t){return t.reverse()}},21224:t=>{t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},98717:(t,e,i)=>{var s=i(37829);t.exports=function(t){return s(t,180)}},44657:(t,e,i)=>{var s=i(37829);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i<e;i++)t=s(t,90);return t}},37829:(t,e,i)=>{var s=i(86922),n=i(2429);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},92632:(t,e,i)=>{var s=i(37829);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i<e;i++)t=s(t,-90);return t}},69512:(t,e,i)=>{var s=i(86003),n=i(49498);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r<t.length;r++){var a=t[r];e<0?s(a,Math.abs(e)):n(a,e)}return t}},2429:t=>{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n<i;n++){s[n]=new Array(e);for(var r=e-1;r>-1;r--)s[n][r]=t[r][n]}return s}},54915:(t,e,i)=>{t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",a=0;a<n;a+=3)r+=e[s[a]>>2],r+=e[(3&s[a])<<4|s[a+1]>>4],r+=e[(15&s[a+1])<<2|s[a+2]>>6],r+=e[63&s[a+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},53134:t=>{for(var e=new Uint8Array(256),i=0;i<64;i++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(i)]=i;t.exports=function(t){var i,s,n,r,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),c=0;c<a;c+=4)i=e[t.charCodeAt(c)],s=e[t.charCodeAt(c+1)],n=e[t.charCodeAt(c+2)],r=e[t.charCodeAt(c+3)],u[h++]=i<<2|s>>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},65839:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799:(t,e,i)=>{t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},79291:(t,e,i)=>{var s=i(41212),n=function(){var t,e,i,r,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(e in t)i=h[e],h!==(r=t[e])&&(c&&r&&(s(r)||(a=Array.isArray(r)))?(a?(a=!1,o=i&&Array.isArray(i)?i:[]):o=i&&s(i)?i:{},h[e]=n(c,o,r)):void 0!==r&&(h[e]=r));return h};t.exports=n},23568:(t,e,i)=>{var s=i(75508),n=i(35154);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},95540:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},82840:(t,e,i)=>{var s=i(35154),n=i(45319);t.exports=function(t,e,i,r,a){void 0===a&&(a=i);var o=s(t,e,a);return n(o,i,r)}},35154:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,a=s,o=i,h=i,l=!0,u=!0,c=0;c<n.length;c++)r&&r.hasOwnProperty(n[c])?(o=r[n[c]],r=r[n[c]]):l=!1,a&&a.hasOwnProperty(n[c])?(h=a[n[c]],a=a[n[c]]):u=!1;return l?o:u?h:i}return i}},69036:t=>{t.exports=function(t,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},1985:t=>{t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},97022:t=>{t.exports=function(t,e){return t.hasOwnProperty(e)}},41212:t=>{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},46975:(t,e,i)=>{var s=i(41786);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},269:(t,e,i)=>{var s=i(41786);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},18254:(t,e,i)=>{var s=i(97022);t.exports=function(t,e){for(var i={},n=0;n<e.length;n++){var r=e[n];s(t,r)&&(i[r]=t[r])}return i}},61622:t=>{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,a=0;a<s.length;a++){if(!n.hasOwnProperty(s[a]))return!1;r=n,n=n[s[a]]}return r[s[s.length-1]]=i,!0}return!1}},1183:(t,e,i)=>{t.exports={Clone:i(41786),DeepCopy:i(62644),Extend:i(79291),GetAdvancedValue:i(23568),GetFastValue:i(95540),GetMinMaxValue:i(82840),GetValue:i(35154),HasAll:i(69036),HasAny:i(1985),HasValue:i(97022),IsPlainObject:i(41212),Merge:i(46975),MergeRight:i(269),Pick:i(18254),SetValue:i(61622)}},27902:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},41836:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671:t=>{t.exports=function(t){return t.split("").reverse().join("")}},45650:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},35355:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749:(t,e,i)=>{t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(85454)})(),t.exports=e()},549:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AlphaTimeline:()=>s._Y,Animation:()=>s.X5,AnimationState:()=>s.oA,AnimationStateAdapter:()=>s.b5,AnimationStateData:()=>s.Qq,AssetManager:()=>a,AssetManagerBase:()=>s.f,AtlasAttachmentLoader:()=>s.qd,Attachment:()=>s.o3,AttachmentTimeline:()=>s.zK,BinaryInput:()=>s.aG,BlendMode:()=>s.Nx,Bone:()=>s.$K,BoneData:()=>s.h9,BoundingBoxAttachment:()=>s.bw,CURRENT:()=>s.eN,CameraController:()=>_,ClippingAttachment:()=>s.K$,Color:()=>s.Q1,Color2Attribute:()=>I,ColorAttribute:()=>k,ConstraintData:()=>s.qD,CurveTimeline:()=>s.Rh,CurveTimeline1:()=>s.Mq,CurveTimeline2:()=>s.H6,DebugUtils:()=>s.lw,DeformTimeline:()=>s.jQ,Downloader:()=>s._7,DrawOrderTimeline:()=>s.Kn,Event:()=>s.Jh,EventData:()=>s.RV,EventQueue:()=>s.Cb,EventTimeline:()=>s.qs,EventType:()=>s.Bx,FIRST:()=>s.RK,FakeTexture:()=>s.pT,GLTexture:()=>r,HOLD_FIRST:()=>s.FM,HOLD_MIX:()=>s.dG,HOLD_SUBSEQUENT:()=>s.gB,IkConstraint:()=>s.cw,IkConstraintData:()=>s.Qs,IkConstraintTimeline:()=>s.pA,Input:()=>C,IntSet:()=>s.ON,Interpolation:()=>s.lc,LoadingScreen:()=>$,M00:()=>h,M01:()=>l,M02:()=>u,M03:()=>c,M10:()=>d,M11:()=>f,M12:()=>p,M13:()=>g,M20:()=>m,M21:()=>v,M22:()=>y,M23:()=>x,M30:()=>w,M31:()=>b,M32:()=>T,M33:()=>S,ManagedWebGLRenderingContext:()=>n,MathUtils:()=>s.cj,Matrix4:()=>E,Mesh:()=>P,MeshAttachment:()=>s.fj,MixBlend:()=>s.qU,MixDirection:()=>s.mj,OrthoCamera:()=>A,PathAttachment:()=>s.He,PathConstraint:()=>s.OI,PathConstraintData:()=>s.rX,PathConstraintMixTimeline:()=>s.I6,PathConstraintPositionTimeline:()=>s.vz,PathConstraintSpacingTimeline:()=>s.vl,PointAttachment:()=>s.YV,PolygonBatcher:()=>Y,Pool:()=>s.bC,Position2Attribute:()=>F,Position3Attribute:()=>O,PositionMode:()=>s.pw,Pow:()=>s.py,PowOut:()=>s.Ff,RGB2Timeline:()=>s.fT,RGBA2Timeline:()=>s.Ev,RGBATimeline:()=>s.EP,RGBTimeline:()=>s.Di,RegionAttachment:()=>s.Qb,ResizeMode:()=>q,RotateMode:()=>s.Dr,RotateTimeline:()=>s.NQ,SETUP:()=>s.K1,SUBSEQUENT:()=>s.y,ScaleTimeline:()=>s.i9,ScaleXTimeline:()=>s.So,ScaleYTimeline:()=>s.pR,SceneRenderer:()=>j,SequenceTimeline:()=>s.lP,Shader:()=>R,ShapeRenderer:()=>X,ShapeType:()=>N,ShearTimeline:()=>s.$l,ShearXTimeline:()=>s.jx,ShearYTimeline:()=>s.eP,Skeleton:()=>s.EA,SkeletonBinary:()=>s.t7,SkeletonBounds:()=>s.VT,SkeletonClipping:()=>s.qy,SkeletonData:()=>s.Ym,SkeletonDebugRenderer:()=>U,SkeletonJson:()=>s.mI,SkeletonRenderer:()=>G,Skin:()=>s.MR,SkinEntry:()=>s.Su,Slot:()=>s.DX,SlotData:()=>s.PN,SpacingMode:()=>s.r9,SpineCanvas:()=>it,StringSet:()=>s.eE,TexCoordAttribute:()=>D,Texture:()=>s.gP,TextureAtlas:()=>s.Lw,TextureAtlasPage:()=>s.Pd,TextureAtlasRegion:()=>s.TE,TextureFilter:()=>s.O$,TextureRegion:()=>s.QL,TextureWrap:()=>s.w3,TimeKeeper:()=>s.oM,Timeline:()=>s.Kf,Touch:()=>M,TrackEntry:()=>s.IT,TransformConstraint:()=>s.UF,TransformConstraintData:()=>s._6,TransformConstraintTimeline:()=>s.To,TransformMode:()=>s._C,TranslateTimeline:()=>s.Sr,TranslateXTimeline:()=>s.GU,TranslateYTimeline:()=>s.nS,Triangulator:()=>s.Rb,Utils:()=>s.Aq,Vector2:()=>s.I9,Vector3:()=>o,VertexAttachment:()=>s.eJ,VertexAttribute:()=>L,VertexAttributeType:()=>B,WindowedMean:()=>s.p0});var s=i(673);class n{canvas;gl;restorables=new Array;constructor(t,e={alpha:"true"}){if(t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)this.gl=t,this.canvas=this.gl.canvas;else{let i=t;this.gl=i.getContext("webgl2",e)||i.getContext("webgl",e),this.canvas=i,i.addEventListener("webglcontextlost",(t=>{t&&t.preventDefault()})),i.addEventListener("webglcontextrestored",(t=>{for(let t=0,e=this.restorables.length;t<e;t++)this.restorables[t].restore()}))}}addRestorable(t){this.restorables.push(t)}removeRestorable(t){let e=this.restorables.indexOf(t);e>-1&&this.restorables.splice(e,1)}}class r extends s.gP{context;texture=null;boundUnit=0;useMipMaps=!1;static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;constructor(t,e,i=!1){super(e),this.context=t instanceof n?t:new n(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,r.validateMagFilter(e)),this.useMipMaps=r.usesMipMaps(t),this.useMipMaps&&i.generateMipmap(i.TEXTURE_2D)}static validateMagFilter(t){switch(t){case s.O$.MipMapLinearLinear:case s.O$.MipMapLinearNearest:case s.O$.MipMapNearestLinear:case s.O$.MipMapNearestNearest:return s.O$.Linear;default:return t}}static usesMipMaps(t){switch(t){case s.O$.MipMapLinearLinear:case s.O$.MipMapLinearNearest:case s.O$.MipMapNearestLinear:case s.O$.MipMapNearestNearest:return!0;default:return!1}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),r.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}}class a extends s.f{constructor(t,e="",i=new s._7){super((e=>new r(t,e)),e,i)}}class o{x=0;y=0;z=0;constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[h]+this.y*e[l]+this.z*e[u]+e[c],this.x*e[d]+this.y*e[f]+this.z*e[p]+e[g],this.x*e[m]+this.y*e[v]+this.z*e[y]+e[x])}project(t){let e=t.values,i=1/(this.x*e[w]+this.y*e[b]+this.z*e[T]+e[S]);return this.set((this.x*e[h]+this.y*e[l]+this.z*e[u]+e[c])*i,(this.x*e[d]+this.y*e[f]+this.z*e[p]+e[g])*i,(this.x*e[m]+this.y*e[v]+this.z*e[y]+e[x])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}}const h=0,l=4,u=8,c=12,d=1,f=5,p=9,g=13,m=2,v=6,y=10,x=14,w=3,b=7,T=11,S=15;class E{temp=new Float32Array(16);values=new Float32Array(16);static xAxis=new o;static yAxis=new o;static zAxis=new o;static tmpMatrix=new E;constructor(){let t=this.values;t[h]=1,t[f]=1,t[y]=1,t[S]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[h]=e[h],t[l]=e[d],t[u]=e[m],t[c]=e[w],t[d]=e[l],t[f]=e[f],t[p]=e[v],t[g]=e[b],t[m]=e[u],t[v]=e[p],t[y]=e[y],t[x]=e[T],t[w]=e[c],t[b]=e[g],t[T]=e[x],t[S]=e[S],this.set(t)}identity(){let t=this.values;return t[h]=1,t[l]=0,t[u]=0,t[c]=0,t[d]=0,t[f]=1,t[p]=0,t[g]=0,t[m]=0,t[v]=0,t[y]=1,t[x]=0,t[w]=0,t[b]=0,t[T]=0,t[S]=1,this}invert(){let t=this.values,e=this.temp,i=t[w]*t[v]*t[p]*t[c]-t[m]*t[b]*t[p]*t[c]-t[w]*t[f]*t[y]*t[c]+t[d]*t[b]*t[y]*t[c]+t[m]*t[f]*t[T]*t[c]-t[d]*t[v]*t[T]*t[c]-t[w]*t[v]*t[u]*t[g]+t[m]*t[b]*t[u]*t[g]+t[w]*t[l]*t[y]*t[g]-t[h]*t[b]*t[y]*t[g]-t[m]*t[l]*t[T]*t[g]+t[h]*t[v]*t[T]*t[g]+t[w]*t[f]*t[u]*t[x]-t[d]*t[b]*t[u]*t[x]-t[w]*t[l]*t[p]*t[x]+t[h]*t[b]*t[p]*t[x]+t[d]*t[l]*t[T]*t[x]-t[h]*t[f]*t[T]*t[x]-t[m]*t[f]*t[u]*t[S]+t[d]*t[v]*t[u]*t[S]+t[m]*t[l]*t[p]*t[S]-t[h]*t[v]*t[p]*t[S]-t[d]*t[l]*t[y]*t[S]+t[h]*t[f]*t[y]*t[S];if(0==i)throw new Error("non-invertible matrix");let s=1/i;return e[h]=t[p]*t[x]*t[b]-t[g]*t[y]*t[b]+t[g]*t[v]*t[T]-t[f]*t[x]*t[T]-t[p]*t[v]*t[S]+t[f]*t[y]*t[S],e[l]=t[c]*t[y]*t[b]-t[u]*t[x]*t[b]-t[c]*t[v]*t[T]+t[l]*t[x]*t[T]+t[u]*t[v]*t[S]-t[l]*t[y]*t[S],e[u]=t[u]*t[g]*t[b]-t[c]*t[p]*t[b]+t[c]*t[f]*t[T]-t[l]*t[g]*t[T]-t[u]*t[f]*t[S]+t[l]*t[p]*t[S],e[c]=t[c]*t[p]*t[v]-t[u]*t[g]*t[v]-t[c]*t[f]*t[y]+t[l]*t[g]*t[y]+t[u]*t[f]*t[x]-t[l]*t[p]*t[x],e[d]=t[g]*t[y]*t[w]-t[p]*t[x]*t[w]-t[g]*t[m]*t[T]+t[d]*t[x]*t[T]+t[p]*t[m]*t[S]-t[d]*t[y]*t[S],e[f]=t[u]*t[x]*t[w]-t[c]*t[y]*t[w]+t[c]*t[m]*t[T]-t[h]*t[x]*t[T]-t[u]*t[m]*t[S]+t[h]*t[y]*t[S],e[p]=t[c]*t[p]*t[w]-t[u]*t[g]*t[w]-t[c]*t[d]*t[T]+t[h]*t[g]*t[T]+t[u]*t[d]*t[S]-t[h]*t[p]*t[S],e[g]=t[u]*t[g]*t[m]-t[c]*t[p]*t[m]+t[c]*t[d]*t[y]-t[h]*t[g]*t[y]-t[u]*t[d]*t[x]+t[h]*t[p]*t[x],e[m]=t[f]*t[x]*t[w]-t[g]*t[v]*t[w]+t[g]*t[m]*t[b]-t[d]*t[x]*t[b]-t[f]*t[m]*t[S]+t[d]*t[v]*t[S],e[v]=t[c]*t[v]*t[w]-t[l]*t[x]*t[w]-t[c]*t[m]*t[b]+t[h]*t[x]*t[b]+t[l]*t[m]*t[S]-t[h]*t[v]*t[S],e[y]=t[l]*t[g]*t[w]-t[c]*t[f]*t[w]+t[c]*t[d]*t[b]-t[h]*t[g]*t[b]-t[l]*t[d]*t[S]+t[h]*t[f]*t[S],e[x]=t[c]*t[f]*t[m]-t[l]*t[g]*t[m]-t[c]*t[d]*t[v]+t[h]*t[g]*t[v]+t[l]*t[d]*t[x]-t[h]*t[f]*t[x],e[w]=t[p]*t[v]*t[w]-t[f]*t[y]*t[w]-t[p]*t[m]*t[b]+t[d]*t[y]*t[b]+t[f]*t[m]*t[T]-t[d]*t[v]*t[T],e[b]=t[l]*t[y]*t[w]-t[u]*t[v]*t[w]+t[u]*t[m]*t[b]-t[h]*t[y]*t[b]-t[l]*t[m]*t[T]+t[h]*t[v]*t[T],e[T]=t[u]*t[f]*t[w]-t[l]*t[p]*t[w]-t[u]*t[d]*t[b]+t[h]*t[p]*t[b]+t[l]*t[d]*t[T]-t[h]*t[f]*t[T],e[S]=t[l]*t[p]*t[m]-t[u]*t[f]*t[m]+t[u]*t[d]*t[v]-t[h]*t[p]*t[v]-t[l]*t[d]*t[y]+t[h]*t[f]*t[y],t[h]=e[h]*s,t[l]=e[l]*s,t[u]=e[u]*s,t[c]=e[c]*s,t[d]=e[d]*s,t[f]=e[f]*s,t[p]=e[p]*s,t[g]=e[g]*s,t[m]=e[m]*s,t[v]=e[v]*s,t[y]=e[y]*s,t[x]=e[x]*s,t[w]=e[w]*s,t[b]=e[b]*s,t[T]=e[T]*s,t[S]=e[S]*s,this}determinant(){let t=this.values;return t[w]*t[v]*t[p]*t[c]-t[m]*t[b]*t[p]*t[c]-t[w]*t[f]*t[y]*t[c]+t[d]*t[b]*t[y]*t[c]+t[m]*t[f]*t[T]*t[c]-t[d]*t[v]*t[T]*t[c]-t[w]*t[v]*t[u]*t[g]+t[m]*t[b]*t[u]*t[g]+t[w]*t[l]*t[y]*t[g]-t[h]*t[b]*t[y]*t[g]-t[m]*t[l]*t[T]*t[g]+t[h]*t[v]*t[T]*t[g]+t[w]*t[f]*t[u]*t[x]-t[d]*t[b]*t[u]*t[x]-t[w]*t[l]*t[p]*t[x]+t[h]*t[b]*t[p]*t[x]+t[d]*t[l]*t[T]*t[x]-t[h]*t[f]*t[T]*t[x]-t[m]*t[f]*t[u]*t[S]+t[d]*t[v]*t[u]*t[S]+t[m]*t[l]*t[p]*t[S]-t[h]*t[v]*t[p]*t[S]-t[d]*t[l]*t[y]*t[S]+t[h]*t[f]*t[y]*t[S]}translate(t,e,i){let s=this.values;return s[c]+=t,s[g]+=e,s[x]+=i,this}copy(){return(new E).set(this.values)}projection(t,e,i,s){this.identity();let n=1/Math.tan(i*(Math.PI/180)/2),r=(e+t)/(t-e),a=2*e*t/(t-e),o=this.values;return o[h]=n/s,o[d]=0,o[m]=0,o[w]=0,o[l]=0,o[f]=n,o[v]=0,o[b]=0,o[u]=0,o[p]=0,o[y]=r,o[T]=-1,o[c]=0,o[g]=0,o[x]=a,o[S]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,n,r){this.identity();let a=2/(e-t),o=2/(s-i),E=-2/(r-n),A=-(e+t)/(e-t),C=-(s+i)/(s-i),M=-(r+n)/(r-n),_=this.values;return _[h]=a,_[d]=0,_[m]=0,_[w]=0,_[l]=0,_[f]=o,_[v]=0,_[b]=0,_[u]=0,_[p]=0,_[y]=E,_[T]=0,_[c]=A,_[g]=C,_[x]=M,_[S]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[h]=i[h]*s[h]+i[l]*s[d]+i[u]*s[m]+i[c]*s[w],e[l]=i[h]*s[l]+i[l]*s[f]+i[u]*s[v]+i[c]*s[b],e[u]=i[h]*s[u]+i[l]*s[p]+i[u]*s[y]+i[c]*s[T],e[c]=i[h]*s[c]+i[l]*s[g]+i[u]*s[x]+i[c]*s[S],e[d]=i[d]*s[h]+i[f]*s[d]+i[p]*s[m]+i[g]*s[w],e[f]=i[d]*s[l]+i[f]*s[f]+i[p]*s[v]+i[g]*s[b],e[p]=i[d]*s[u]+i[f]*s[p]+i[p]*s[y]+i[g]*s[T],e[g]=i[d]*s[c]+i[f]*s[g]+i[p]*s[x]+i[g]*s[S],e[m]=i[m]*s[h]+i[v]*s[d]+i[y]*s[m]+i[x]*s[w],e[v]=i[m]*s[l]+i[v]*s[f]+i[y]*s[v]+i[x]*s[b],e[y]=i[m]*s[u]+i[v]*s[p]+i[y]*s[y]+i[x]*s[T],e[x]=i[m]*s[c]+i[v]*s[g]+i[y]*s[x]+i[x]*s[S],e[w]=i[w]*s[h]+i[b]*s[d]+i[T]*s[m]+i[S]*s[w],e[b]=i[w]*s[l]+i[b]*s[f]+i[T]*s[v]+i[S]*s[b],e[T]=i[w]*s[u]+i[b]*s[p]+i[T]*s[y]+i[S]*s[T],e[S]=i[w]*s[c]+i[b]*s[g]+i[T]*s[x]+i[S]*s[S],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[h]=s[h]*i[h]+s[l]*i[d]+s[u]*i[m]+s[c]*i[w],e[l]=s[h]*i[l]+s[l]*i[f]+s[u]*i[v]+s[c]*i[b],e[u]=s[h]*i[u]+s[l]*i[p]+s[u]*i[y]+s[c]*i[T],e[c]=s[h]*i[c]+s[l]*i[g]+s[u]*i[x]+s[c]*i[S],e[d]=s[d]*i[h]+s[f]*i[d]+s[p]*i[m]+s[g]*i[w],e[f]=s[d]*i[l]+s[f]*i[f]+s[p]*i[v]+s[g]*i[b],e[p]=s[d]*i[u]+s[f]*i[p]+s[p]*i[y]+s[g]*i[T],e[g]=s[d]*i[c]+s[f]*i[g]+s[p]*i[x]+s[g]*i[S],e[m]=s[m]*i[h]+s[v]*i[d]+s[y]*i[m]+s[x]*i[w],e[v]=s[m]*i[l]+s[v]*i[f]+s[y]*i[v]+s[x]*i[b],e[y]=s[m]*i[u]+s[v]*i[p]+s[y]*i[y]+s[x]*i[T],e[x]=s[m]*i[c]+s[v]*i[g]+s[y]*i[x]+s[x]*i[S],e[w]=s[w]*i[h]+s[b]*i[d]+s[T]*i[m]+s[S]*i[w],e[b]=s[w]*i[l]+s[b]*i[f]+s[T]*i[v]+s[S]*i[b],e[T]=s[w]*i[u]+s[b]*i[p]+s[T]*i[y]+s[S]*i[T],e[S]=s[w]*i[c]+s[b]*i[g]+s[T]*i[x]+s[S]*i[S],this.set(this.temp)}lookAt(t,e,i){let s=E.xAxis,n=E.yAxis,r=E.zAxis;r.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),n.setFrom(s).cross(r).normalize(),this.identity();let a=this.values;return a[h]=s.x,a[l]=s.y,a[u]=s.z,a[d]=n.x,a[f]=n.y,a[p]=n.z,a[m]=-r.x,a[v]=-r.y,a[y]=-r.z,E.tmpMatrix.identity(),E.tmpMatrix.values[c]=-t.x,E.tmpMatrix.values[g]=-t.y,E.tmpMatrix.values[x]=-t.z,this.multiply(E.tmpMatrix),this}}class A{position=new o(0,0,0);direction=new o(0,0,-1);up=new o(0,1,0);near=0;far=100;zoom=1;viewportWidth=0;viewportHeight=0;projectionView=new E;inverseProjectionView=new E;projection=new E;view=new E;constructor(t,e){this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,n=this.zoom,r=this.viewportWidth,a=this.viewportHeight;t.ortho(n*(-r/2),n*(r/2),n*(-a/2),n*(a/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,n=i-t.y-1;return t.x=2*s/e-1,t.y=2*n/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}}class C{element;mouseX=0;mouseY=0;buttonDown=!1;touch0=null;touch1=null;initialPinchDistance=0;listeners=new Array;eventListeners=[];constructor(t){this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent){let i=t.getBoundingClientRect();this.mouseX=e.clientX-i.left,this.mouseY=e.clientY-i.top,this.listeners.map((t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY):t.moved&&t.moved(this.mouseX,this.mouseY)}))}},i=s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!1,this.listeners.map((t=>{t.up&&t.up(this.mouseX,this.mouseY)})),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)}};t.addEventListener("mousedown",(s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!0,this.listeners.map((t=>{t.down&&t.down(this.mouseX,this.mouseY)})),document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}}),!0),t.addEventListener("mousemove",e,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",(t=>{t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map((e=>{e.wheel&&e.wheel(t.deltaY)}))}),!0),t.addEventListener("touchstart",(e=>{if(!this.touch0||!this.touch1){let i=e.changedTouches.item(0);if(!i)return;let s=t.getBoundingClientRect(),n=i.clientX-s.left,r=i.clientY-s.top,a=new M(i.identifier,n,r);if(this.mouseX=n,this.mouseY=r,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=a;let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+e*e),this.listeners.map((t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance)}))}}else this.touch0=a,this.listeners.map((t=>{t.down&&t.down(a.x,a.y)}))}e.preventDefault()}),!1),t.addEventListener("touchmove",(e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s<i.length;s++){var n=i[s];let t=n.clientX-r.left,e=n.clientY-r.top;this.touch0.identifier===n.identifier&&(this.touch0.x=this.mouseX=t,this.touch0.y=this.mouseY=e,this.listeners.map((i=>{i.dragged&&i.dragged(t,e)}))),this.touch1&&this.touch1.identifier===n.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=e)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+e*e);this.listeners.map((t=>{t.zoom&&t.zoom(this.initialPinchDistance,i)}))}}e.preventDefault()}),!1);let s=e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s<i.length;s++){var n=i[s];let t=n.clientX-r.left,e=n.clientY-r.top;if(this.touch0.identifier===n.identifier){if(this.touch0=null,this.mouseX=t,this.mouseY=e,this.listeners.map((i=>{i.up&&i.up(t,e)})),!this.touch1){this.buttonDown=!1;break}this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map((t=>{t.down&&t.down(this.touch0.x,this.touch0.y)}))}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}e.preventDefault()};t.addEventListener("touchend",s,!1),t.addEventListener("touchcancel",s)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}}class M{identifier;x;y;constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}}class _{canvas;camera;constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,n=0,r=0,a=0,h=0,l=0;new C(t).addListener({down:(t,o)=>{i=e.position.x,s=e.position.y,n=a=t,r=h=o,l=e.zoom},dragged:(l,u)=>{let c=l-n,d=u-r,f=e.screenToWorld(new o(0,0),t.clientWidth,t.clientHeight),p=e.screenToWorld(new o(c,d),t.clientWidth,t.clientHeight).sub(f);e.position.set(i-p.x,s-p.y,0),e.update(),a=l,h=u},wheel:i=>{let s=i/200*e.zoom,n=e.zoom+s;if(n>0){let s=0,r=0;if(i<0)s=a,r=h;else{let e=new o(t.clientWidth/2+15,t.clientHeight/2),i=a-e.x,n=t.clientHeight-1-h-e.y;s=e.x-i,r=t.clientHeight-1-e.y+n}let l=e.screenToWorld(new o(s,r),t.clientWidth,t.clientHeight);e.zoom=n,e.update();let u=e.screenToWorld(new o(s,r),t.clientWidth,t.clientHeight);e.position.add(l.sub(u)),e.update()}},zoom:(t,i)=>{let s=t/i;e.zoom=l*s},up:(t,e)=>{a=t,h=e},moved:(t,e)=>{a=t,h=e}})}}class R{vertexShader;fragmentShader;static MVP_MATRIX="u_projTrans";static POSITION="a_position";static COLOR="a_color";static COLOR2="a_color2";static TEXCOORDS="a_texCoords";static SAMPLER="u_texture";context;vs=null;vsSource;fs=null;fsSource;program=null;tmp2x2=new Float32Array(4);tmp3x3=new Float32Array(9);tmp4x4=new Float32Array(16);getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vsSource=e,this.fsSource=i,this.context=t instanceof n?t:new n(t),this.context.addRestorable(this),this.compile()}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw new Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw new Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(!s)throw new Error("Couldn't create shader.");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let t="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(t)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(!s)throw new Error("Couldn't compile program.");if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let t="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(t)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,n){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,n)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error(`Couldn't find location for uniform ${t}`);return i}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getAttribLocation(this.program,t);if(-1==i&&!e.isContextLost())throw new Error(`Couldn't find location for attribute ${t}`);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`\nattribute vec4 ${R.POSITION};\nattribute vec4 ${R.COLOR};\nattribute vec2 ${R.TEXCOORDS};\nuniform mat4 ${R.MVP_MATRIX};\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_color = ${R.COLOR};\n\tv_texCoords = ${R.TEXCOORDS};\n\tgl_Position = ${R.MVP_MATRIX} * ${R.POSITION};\n}\n`;return new R(t,e,"\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n}\n")}static newTwoColoredTextured(t){let e=`\nattribute vec4 ${R.POSITION};\nattribute vec4 ${R.COLOR};\nattribute vec4 ${R.COLOR2};\nattribute vec2 ${R.TEXCOORDS};\nuniform mat4 ${R.MVP_MATRIX};\nvarying vec4 v_light;\nvarying vec4 v_dark;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_light = ${R.COLOR};\n\tv_dark = ${R.COLOR2};\n\tv_texCoords = ${R.TEXCOORDS};\n\tgl_Position = ${R.MVP_MATRIX} * ${R.POSITION};\n}\n`;return new R(t,e,"\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_light;\nvarying LOWP vec4 v_dark;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\tgl_FragColor.a = texColor.a * v_light.a;\n\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n}\n")}static newColored(t){let e=`\nattribute vec4 ${R.POSITION};\nattribute vec4 ${R.COLOR};\nuniform mat4 ${R.MVP_MATRIX};\nvarying vec4 v_color;\n\nvoid main () {\n\tv_color = ${R.COLOR};\n\tgl_Position = ${R.MVP_MATRIX} * ${R.POSITION};\n}\n`;return new R(t,e,"\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\n\nvoid main () {\n\tgl_FragColor = v_color;\n}\n")}}class P{attributes;context;vertices;verticesBuffer=null;verticesLength=0;dirtyVertices=!1;indices;indicesBuffer=null;indicesLength=0;dirtyIndices=!1;elementsPerVertex=0;getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(t){this.dirtyVertices=!0,this.verticesLength=t}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(t){this.dirtyIndices=!0,this.indicesLength=t}getIndices(){return this.indices}getVertexSizeInFloats(){let t=0;for(var e=0;e<this.attributes.length;e++)t+=this.attributes[e].numElements;return t}constructor(t,e,i,s){this.attributes=e,this.context=t instanceof n?t:new n(t),this.elementsPerVertex=0;for(let t=0;t<e.length;t++)this.elementsPerVertex+=e[t].numElements;this.vertices=new Float32Array(i*this.elementsPerVertex),this.indices=new Uint16Array(s),this.context.addRestorable(this)}setVertices(t){if(this.dirtyVertices=!0,t.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let n=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?n.drawElements(e,s,n.UNSIGNED_SHORT,2*i):n.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s<this.attributes.length;s++){let n=this.attributes[s],r=t.getAttributeLocation(n.name);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,n.numElements,e.FLOAT,!1,4*this.elementsPerVertex,4*i),i+=n.numElements}this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i<this.attributes.length;i++){let s=this.attributes[i],n=t.getAttributeLocation(s.name);e.disableVertexAttribArray(n)}e.bindBuffer(e.ARRAY_BUFFER,null),this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}}class L{name;type;numElements;constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}}class F extends L{constructor(){super(R.POSITION,B.Float,2)}}class O extends L{constructor(){super(R.POSITION,B.Float,3)}}class D extends L{constructor(t=0){super(R.TEXCOORDS+(0==t?"":t),B.Float,2)}}class k extends L{constructor(){super(R.COLOR,B.Float,4)}}class I extends L{constructor(){super(R.COLOR2,B.Float,4)}}var B,N;!function(t){t[t.Float=0]="Float"}(B||(B={}));class Y{static disableCulling=!1;context;drawCalls=0;static globalDrawCalls=0;isDrawing=!1;mesh;shader=null;lastTexture=null;verticesLength=0;indicesLength=0;srcColorBlend;srcAlphaBlend;dstBlend;cullWasEnabled=!1;constructor(t,e=!0,i=10920){if(i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof n?t:new n(t);let s=e?[new F,new k,new D,new I]:[new F,new k,new D];this.mesh=new P(t,s,i,3*i);let r=this.context.gl;this.srcColorBlend=r.SRC_ALPHA,this.srcAlphaBlend=r.ONE,this.dstBlend=r.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),Y.disableCulling&&(this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE))}static blendModesGL=[{srcRgb:770,srcRgbPma:1,dstRgb:771,srcAlpha:1},{srcRgb:770,srcRgbPma:1,dstRgb:1,srcAlpha:1},{srcRgb:774,srcRgbPma:774,dstRgb:771,srcAlpha:1},{srcRgb:1,srcRgbPma:1,dstRgb:769,srcAlpha:1}];setBlendMode(t,e){const i=Y.blendModesGL[t],s=e?i.srcRgbPma:i.srcRgb,n=i.srcAlpha,r=i.dstRgb;this.srcColorBlend==s&&this.srcAlphaBlend==n&&this.dstBlend==r||(this.srcColorBlend=s,this.srcAlphaBlend=n,this.dstBlend=r,this.isDrawing&&this.flush(),this.context.gl.blendFuncSeparate(s,r,n,r))}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let n=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e<i.length;t++,e++)n[t]=i[e]+s;this.indicesLength+=i.length,this.mesh.setIndicesLength(this.indicesLength)}flush(){if(0!=this.verticesLength){if(!this.lastTexture)throw new Error("No texture set.");if(!this.shader)throw new Error("No shader set.");this.lastTexture.bind(),this.mesh.draw(this.shader,this.context.gl.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++,Y.globalDrawCalls++}}end(){if(!this.isDrawing)throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()");(this.verticesLength>0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),Y.disableCulling&&this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=Y.globalDrawCalls;return Y.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}}class X{context;isDrawing=!1;mesh;shapeType=N.Filled;color=new s.Q1(1,1,1,1);shader=null;vertexIndex=0;tmp=new s.I9;srcColorBlend;srcAlphaBlend;dstBlend;constructor(t,e=10920){if(e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof n?t:new n(t),this.mesh=new P(t,[new F,new k],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing&&(this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i))}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i){this.check(N.Point,1),i||(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,n){this.check(N.Line,2),this.mesh.getVertices(),this.vertexIndex,n||(n=this.color),this.vertex(t,e,n),this.vertex(i,s,n)}triangle(t,e,i,s,n,r,a,o,h,l){this.check(t?N.Filled:N.Line,3),this.mesh.getVertices(),this.vertexIndex,o||(o=this.color),h||(h=this.color),l||(l=this.color),t?(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(r,a,l)):(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(s,n,o),this.vertex(r,a,h),this.vertex(r,a,o),this.vertex(e,i,h))}quad(t,e,i,s,n,r,a,o,h,l,u,c,d){this.check(t?N.Filled:N.Line,3),this.mesh.getVertices(),this.vertexIndex,l||(l=this.color),u||(u=this.color),c||(c=this.color),d||(d=this.color),t?(this.vertex(e,i,l),this.vertex(s,n,u),this.vertex(r,a,c),this.vertex(r,a,c),this.vertex(o,h,d),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,n,u),this.vertex(s,n,u),this.vertex(r,a,c),this.vertex(r,a,c),this.vertex(o,h,d),this.vertex(o,h,d),this.vertex(e,i,l))}rect(t,e,i,s,n,r){this.quad(t,e,i,e+s,i,e+s,i+n,e,i+n,r,r,r,r)}rectLine(t,e,i,s,n,r,a){this.check(t?N.Filled:N.Line,8),a||(a=this.color);let o=this.tmp.set(n-i,e-s);o.normalize(),r*=.5;let h=o.x*r,l=o.y*r;t?(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e-h,i-l,a)):(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e+h,i+l,a),this.vertex(s-h,n-l,a),this.vertex(e-h,i-l,a))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(N.Line,2*i),s||(s=this.color),this.mesh.getVertices(),this.vertexIndex,i<<=1;let n=t[e<<=1],r=t[e+1],a=e+i;for(let o=e,h=e+i-2;o<h;o+=2){let e=t[o],i=t[o+1],h=0,l=0;o+2>=a?(h=n,l=r):(h=t[o+2],l=t[o+3]),this.vertex(e,i,s),this.vertex(h,l,s)}}circle(t,e,i,n,r,a=0){if(0==a&&(a=Math.max(1,6*s.cj.cbrt(n)|0)),a<=0)throw new Error("segments must be > 0.");r||(r=this.color);let o=2*s.cj.PI/a,h=Math.cos(o),l=Math.sin(o),u=n,c=0;if(t){this.check(N.Filled,3*a+3),a--;for(let t=0;t<a;t++){this.vertex(e,i,r),this.vertex(e+u,i+c,r);let t=u;u=h*u-l*c,c=l*t+h*c,this.vertex(e+u,i+c,r)}this.vertex(e,i,r),this.vertex(e+u,i+c,r)}else{this.check(N.Line,2*a+2);for(let t=0;t<a;t++){this.vertex(e+u,i+c,r);let t=u;u=h*u-l*c,c=l*t+h*c,this.vertex(e+u,i+c,r)}this.vertex(e+u,i+c,r)}u=n,c=0,this.vertex(e+u,i+c,r)}curve(t,e,i,s,n,r,a,o,h,l){this.check(N.Line,2*h+2),l||(l=this.color);let u=1/h,c=u*u,d=u*u*u,f=3*u,p=3*c,g=6*c,m=6*d,v=t-2*i+n,y=e-2*s+r,x=3*(i-n)-t+a,w=3*(s-r)-e+o,b=t,T=e,S=(i-t)*f+v*p+x*d,E=(s-e)*f+y*p+w*d,A=v*g+x*m,C=y*g+w*m,M=x*m,_=w*m;for(;h-- >0;)this.vertex(b,T,l),b+=S,T+=E,S+=A,E+=C,A+=M,C+=_,this.vertex(b,T,l);this.vertex(b,T,l),this.vertex(a,o,l)}vertex(t,e,i){let s=this.vertexIndex,n=this.mesh.getVertices();n[s++]=t,n[s++]=e,n[s++]=i.r,n[s++]=i.g,n[s++]=i.b,n[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw new Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()<e))return;this.flush()}else this.flush(),this.shapeType=t}dispose(){this.mesh.dispose()}}!function(t){t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled"}(N||(N={}));class U{boneLineColor=new s.Q1(1,0,0,1);boneOriginColor=new s.Q1(0,1,0,1);attachmentLineColor=new s.Q1(0,0,1,.5);triangleLineColor=new s.Q1(1,.64,0,.5);pathColor=(new s.Q1).setFromString("FF7F00");clipColor=new s.Q1(.8,0,0,2);aabbColor=new s.Q1(0,1,0,.5);drawBones=!0;drawRegionAttachments=!0;drawBoundingBoxes=!0;drawMeshHull=!0;drawMeshTriangles=!0;drawPaths=!0;drawSkeletonXY=!1;drawClipping=!0;premultipliedAlpha=!1;scale=1;boneWidth=2;context;bounds=new s.VT;temp=new Array;vertices=s.Aq.newFloatArray(2048);static LIGHT_GRAY=new s.Q1(192/255,192/255,192/255,1);static GREEN=new s.Q1(0,1,0,1);constructor(t){this.context=t instanceof n?t:new n(t)}draw(t,e,i){let n=e.x,r=e.y,a=this.context.gl,o=this.premultipliedAlpha?a.ONE:a.SRC_ALPHA;t.setBlendMode(o,a.ONE,a.ONE_MINUS_SRC_ALPHA);let h=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,s=h.length;e<s;e++){let s=h[e];if(i&&i.indexOf(s.data.name)>-1)continue;if(!s.parent)continue;let n=s.data.length*s.a+s.worldX,r=s.data.length*s.c+s.worldY;t.rectLine(!0,s.worldX,s.worldY,n,r,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(n,r,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let i=e.slots;for(let e=0,n=i.length;e<n;e++){let n=i[e],r=n.getAttachment();if(r instanceof s.Qb){let e=r,i=this.vertices;e.computeWorldVertices(n,i,0,2),t.line(i[0],i[1],i[2],i[3]),t.line(i[2],i[3],i[4],i[5]),t.line(i[4],i[5],i[6],i[7]),t.line(i[6],i[7],i[0],i[1])}}}if(this.drawMeshHull||this.drawMeshTriangles){let i=e.slots;for(let e=0,n=i.length;e<n;e++){let n=i[e];if(!n.bone.active)continue;let r=n.getAttachment();if(!(r instanceof s.fj))continue;let a=r,o=this.vertices;a.computeWorldVertices(n,0,a.worldVerticesLength,o,0,2);let h=a.triangles,l=a.hullLength;if(this.drawMeshTriangles){t.setColor(this.triangleLineColor);for(let e=0,i=h.length;e<i;e+=3){let i=2*h[e],s=2*h[e+1],n=2*h[e+2];t.triangle(!1,o[i],o[i+1],o[s],o[s+1],o[n],o[n+1])}}if(this.drawMeshHull&&l>0){t.setColor(this.attachmentLineColor),l=2*(l>>1);let e=o[l-2],i=o[l-1];for(let s=0,n=l;s<n;s+=2){let n=o[s],r=o[s+1];t.line(n,r,e,i),e=n,i=r}}}}if(this.drawBoundingBoxes){let i=this.bounds;i.update(e,!0),t.setColor(this.aabbColor),t.rect(!1,i.minX,i.minY,i.getWidth(),i.getHeight());let s=i.polygons,n=i.boundingBoxes;for(let e=0,i=s.length;e<i;e++){let i=s[e];t.setColor(n[e].color),t.polygon(i,0,i.length)}}if(this.drawPaths){let i=e.slots;for(let e=0,n=i.length;e<n;e++){let n=i[e];if(!n.bone.active)continue;let r=n.getAttachment();if(!(r instanceof s.He))continue;let a=r,o=a.worldVerticesLength,h=this.temp=s.Aq.setArraySize(this.temp,o,0);a.computeWorldVertices(n,0,o,h,0,2);let l=this.pathColor,u=h[2],c=h[3],d=0,f=0;if(a.closed){t.setColor(l);let e=h[0],i=h[1],s=h[o-2],n=h[o-1];d=h[o-4],f=h[o-3],t.curve(u,c,e,i,s,n,d,f,32),t.setColor(U.LIGHT_GRAY),t.line(u,c,e,i),t.line(d,f,s,n)}o-=4;for(let e=4;e<o;e+=6){let i=h[e],s=h[e+1],n=h[e+2],r=h[e+3];d=h[e+4],f=h[e+5],t.setColor(l),t.curve(u,c,i,s,n,r,d,f,32),t.setColor(U.LIGHT_GRAY),t.line(u,c,i,s),t.line(d,f,n,r),u=d,c=f}}}if(this.drawBones){t.setColor(this.boneOriginColor);for(let e=0,s=h.length;e<s;e++){let s=h[e];i&&i.indexOf(s.data.name)>-1||t.circle(!0,s.worldX,s.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let i=e.slots;t.setColor(this.clipColor);for(let e=0,n=i.length;e<n;e++){let n=i[e];if(!n.bone.active)continue;let r=n.getAttachment();if(!(r instanceof s.K$))continue;let a=r,o=a.worldVerticesLength,h=this.temp=s.Aq.setArraySize(this.temp,o,0);a.computeWorldVertices(n,0,o,h,0,2);for(let e=0,i=h.length;e<i;e+=2){let i=h[e],s=h[e+1],n=h[(e+2)%h.length],r=h[(e+3)%h.length];t.line(i,s,n,r)}}}}dispose(){}}class z{vertices;numVertices;numFloats;constructor(t,e,i){this.vertices=t,this.numVertices=e,this.numFloats=i}}class G{static QUAD_TRIANGLES=[0,1,2,2,3,0];premultipliedAlpha=!1;tempColor=new s.Q1;tempColor2=new s.Q1;vertices;vertexSize=8;twoColorTint=!1;renderable=new z([],0,0);clipper=new s.qy;temp=new s.I9;temp2=new s.I9;temp3=new s.Q1;temp4=new s.Q1;constructor(t,e=!0){this.twoColorTint=e,e&&(this.vertexSize+=4),this.vertices=s.Aq.newFloatArray(1024*this.vertexSize)}draw(t,e,i=-1,n=-1,r=null){let a,o,h,l=this.clipper,u=this.premultipliedAlpha,c=this.twoColorTint,d=null,f=this.renderable,p=e.drawOrder,g=e.color,m=c?12:8,v=!1;-1==i&&(v=!0);for(let e=0,y=p.length;e<y;e++){let y=l.isClipping()?2:m,x=p[e];if(!x.bone.active){l.clipEndWithSlot(x);continue}if(i>=0&&i==x.data.index&&(v=!0),!v){l.clipEndWithSlot(x);continue}n>=0&&n==x.data.index&&(v=!1);let w,b=x.getAttachment();if(b instanceof s.Qb){let t=b;f.vertices=this.vertices,f.numVertices=4,f.numFloats=y<<2,t.computeWorldVertices(x,f.vertices,0,y),o=G.QUAD_TRIANGLES,a=t.uvs,w=t.region.texture,h=t.color}else{if(!(b instanceof s.fj)){if(b instanceof s.K$){let t=b;l.clipStart(x,t);continue}l.clipEndWithSlot(x);continue}{let t=b;f.vertices=this.vertices,f.numVertices=t.worldVerticesLength>>1,f.numFloats=f.numVertices*y,f.numFloats>f.vertices.length&&(f.vertices=this.vertices=s.Aq.newFloatArray(f.numFloats)),t.computeWorldVertices(x,0,t.worldVerticesLength,f.vertices,0,y),o=t.triangles,w=t.region.texture,a=t.uvs,h=t.color}}if(w){let e=x.color,i=this.tempColor;i.r=g.r*e.r*h.r,i.g=g.g*e.g*h.g,i.b=g.b*e.b*h.b,i.a=g.a*e.a*h.a,u&&(i.r*=i.a,i.g*=i.a,i.b*=i.a);let s=this.tempColor2;x.darkColor?(u?(s.r=x.darkColor.r*i.a,s.g=x.darkColor.g*i.a,s.b=x.darkColor.b*i.a):s.setFromColor(x.darkColor),s.a=u?1:0):s.set(0,0,0,1);let n=x.data.blendMode;if(n!=d&&(d=n,t.setBlendMode(d,u)),l.isClipping()){l.clipTriangles(f.vertices,f.numFloats,o,o.length,a,i,s,c);let e=new Float32Array(l.clippedVertices),n=l.clippedTriangles;r&&r(e,e.length,m),t.draw(w,e,n)}else{let e=f.vertices;if(c)for(let t=2,n=0,r=f.numFloats;t<r;t+=m,n+=2)e[t]=i.r,e[t+1]=i.g,e[t+2]=i.b,e[t+3]=i.a,e[t+4]=a[n],e[t+5]=a[n+1],e[t+6]=s.r,e[t+7]=s.g,e[t+8]=s.b,e[t+9]=s.a;else for(let t=2,s=0,n=f.numFloats;t<n;t+=m,s+=2)e[t]=i.r,e[t+1]=i.g,e[t+2]=i.b,e[t+3]=i.a,e[t+4]=a[s],e[t+5]=a[s+1];let n=f.vertices.subarray(0,f.numFloats);r&&r(f.vertices,f.numFloats,m),t.draw(w,n,o)}}l.clipEndWithSlot(x)}l.clipEnd()}}const V=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],W=[0,1,2,2,3,0],H=new s.Q1(1,1,1,1);class j{context;canvas;camera;batcher;twoColorTint=!1;batcherShader;shapes;shapesShader;activeRenderer=null;skeletonRenderer;skeletonDebugRenderer;constructor(t,e,i=!0){this.canvas=t,this.context=e instanceof n?e:new n(e),this.twoColorTint=i,this.camera=new A(t.width,t.height),this.batcherShader=i?R.newTwoColoredTextured(this.context):R.newColoredTextured(this.context),this.batcher=new Y(this.context,i),this.shapesShader=R.newColored(this.context),this.shapes=new X(this.context),this.skeletonRenderer=new G(this.context,i),this.skeletonDebugRenderer=new U(this.context)}dispose(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()}begin(){this.camera.update(),this.enableRenderer(this.batcher)}drawSkeleton(t,e=!1,i=-1,s=-1,n=null){this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,s,n)}drawSkeletonDebug(t,e=!1,i){this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)}drawTexture(t,e,i,s,n,r){this.enableRenderer(this.batcher),r||(r=H);var a=0;V[a++]=e,V[a++]=i,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=0,V[a++]=1,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a++]=0),V[a++]=e+s,V[a++]=i,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=1,V[a++]=1,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a++]=0),V[a++]=e+s,V[a++]=i+n,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=1,V[a++]=0,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a++]=0),V[a++]=e,V[a++]=i+n,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=0,V[a++]=0,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a]=0),this.batcher.draw(t,V,W)}drawTextureUV(t,e,i,s,n,r,a,o,h,l){this.enableRenderer(this.batcher),l||(l=H);var u=0;V[u++]=e,V[u++]=i,V[u++]=l.r,V[u++]=l.g,V[u++]=l.b,V[u++]=l.a,V[u++]=r,V[u++]=a,this.twoColorTint&&(V[u++]=0,V[u++]=0,V[u++]=0,V[u++]=0),V[u++]=e+s,V[u++]=i,V[u++]=l.r,V[u++]=l.g,V[u++]=l.b,V[u++]=l.a,V[u++]=o,V[u++]=a,this.twoColorTint&&(V[u++]=0,V[u++]=0,V[u++]=0,V[u++]=0),V[u++]=e+s,V[u++]=i+n,V[u++]=l.r,V[u++]=l.g,V[u++]=l.b,V[u++]=l.a,V[u++]=o,V[u++]=h,this.twoColorTint&&(V[u++]=0,V[u++]=0,V[u++]=0,V[u++]=0),V[u++]=e,V[u++]=i+n,V[u++]=l.r,V[u++]=l.g,V[u++]=l.b,V[u++]=l.a,V[u++]=r,V[u++]=h,this.twoColorTint&&(V[u++]=0,V[u++]=0,V[u++]=0,V[u]=0),this.batcher.draw(t,V,W)}drawTextureRotated(t,e,i,n,r,a,o,h,l){this.enableRenderer(this.batcher),l||(l=H);let u=e+a,c=i+o,d=-a,f=-o,p=n-a,g=r-o,m=d,v=f,y=d,x=g,w=p,b=g,T=p,S=f,E=0,A=0,C=0,M=0,_=0,R=0,P=0,L=0;if(0!=h){let t=s.cj.cosDeg(h),e=s.cj.sinDeg(h);E=t*m-e*v,A=e*m+t*v,P=t*y-e*x,L=e*y+t*x,_=t*w-e*b,R=e*w+t*b,C=_+(E-P),M=R+(A-L)}else E=m,A=v,P=y,L=x,_=w,R=b,C=T,M=S;E+=u,A+=c,C+=u,M+=c,_+=u,R+=c,P+=u,L+=c;var F=0;V[F++]=E,V[F++]=A,V[F++]=l.r,V[F++]=l.g,V[F++]=l.b,V[F++]=l.a,V[F++]=0,V[F++]=1,this.twoColorTint&&(V[F++]=0,V[F++]=0,V[F++]=0,V[F++]=0),V[F++]=C,V[F++]=M,V[F++]=l.r,V[F++]=l.g,V[F++]=l.b,V[F++]=l.a,V[F++]=1,V[F++]=1,this.twoColorTint&&(V[F++]=0,V[F++]=0,V[F++]=0,V[F++]=0),V[F++]=_,V[F++]=R,V[F++]=l.r,V[F++]=l.g,V[F++]=l.b,V[F++]=l.a,V[F++]=1,V[F++]=0,this.twoColorTint&&(V[F++]=0,V[F++]=0,V[F++]=0,V[F++]=0),V[F++]=P,V[F++]=L,V[F++]=l.r,V[F++]=l.g,V[F++]=l.b,V[F++]=l.a,V[F++]=0,V[F++]=0,this.twoColorTint&&(V[F++]=0,V[F++]=0,V[F++]=0,V[F]=0),this.batcher.draw(t,V,W)}drawRegion(t,e,i,s,n,r){this.enableRenderer(this.batcher),r||(r=H);var a=0;V[a++]=e,V[a++]=i,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=t.u,V[a++]=t.v2,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a++]=0),V[a++]=e+s,V[a++]=i,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=t.u2,V[a++]=t.v2,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a++]=0),V[a++]=e+s,V[a++]=i+n,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=t.u2,V[a++]=t.v,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a++]=0),V[a++]=e,V[a++]=i+n,V[a++]=r.r,V[a++]=r.g,V[a++]=r.b,V[a++]=r.a,V[a++]=t.u,V[a++]=t.v,this.twoColorTint&&(V[a++]=0,V[a++]=0,V[a++]=0,V[a]=0),this.batcher.draw(t.page.texture,V,W)}line(t,e,i,s,n,r){this.enableRenderer(this.shapes),this.shapes.line(t,e,i,s,n)}triangle(t,e,i,s,n,r,a,o,h,l){this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,s,n,r,a,o,h,l)}quad(t,e,i,s,n,r,a,o,h,l,u,c,d){this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,s,n,r,a,o,h,l,u,c,d)}rect(t,e,i,s,n,r){this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,s,n,r)}rectLine(t,e,i,s,n,r,a){this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,s,n,r,a)}polygon(t,e,i,s){this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,s)}circle(t,e,i,s,n,r=0){this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,s,n,r)}curve(t,e,i,s,n,r,a,o,h,l){this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,s,n,r,a,o,h,l)}end(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null}resize(t){let e=this.canvas;var i=window.devicePixelRatio||1,s=Math.round(e.clientWidth*i),n=Math.round(e.clientHeight*i);if(e.width==s&&e.height==n||(e.width=s,e.height=n),this.context.gl.viewport(0,0,e.width,e.height),t===q.Expand)this.camera.setViewport(s,n);else if(t===q.Fit){let t=e.width,i=e.height,s=this.camera.viewportWidth,n=this.camera.viewportHeight,r=n/s<i/t?s/t:n/i;this.camera.setViewport(t*r,i*r)}this.camera.update()}enableRenderer(t){this.activeRenderer!==t&&(this.end(),t instanceof Y?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(R.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi("u_texture",0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):t instanceof X?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(R.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)}}var q;let K,Z;!function(t){t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit"}(q||(q={}));let Q=0;const J=163;class ${renderer;logo=null;spinner=null;angle=0;fadeOut=0;fadeIn=0;timeKeeper=new s.oM;backgroundColor=new s.Q1(.135,.135,.135,1);tempColor=new s.Q1;constructor(t){if(this.renderer=t,this.timeKeeper.maxDelta=9,!Z){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>Q++;Z=new Image,Z.src=et,t||(Z.crossOrigin="anonymous"),Z.onload=e,K=new Image,K.src=tt,t||(K.crossOrigin="anonymous"),K.onload=e}}dispose(){this.logo?.dispose(),this.spinner?.dispose()}draw(t=!1){if(Q<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let i=this.tempColor,n=this.renderer,a=n.canvas,o=n.context.gl;if(n.resize(q.Expand),n.camera.position.set(a.width/2,a.height/2,0),n.batcher.setBlendMode(s.Nx.Normal,!0),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/1,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(n.camera.zoom=1,n.begin(),n.quad(!0,0,0,a.width,0,a.width,a.height,0,a.height,i,i,i,i),n.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(o.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),o.clear(o.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),i.set(e,e,e,e),this.logo||(this.logo=new r(n.context,Z),this.spinner=new r(n.context,K)),n.camera.zoom=Math.max(1,J/a.height),n.begin(),n.drawTexture(this.logo,(a.width-165)/2,(a.height-108)/2,165,108,i),this.spinner&&n.drawTextureRotated(this.spinner,(a.width-J)/2,(a.height-J)/2,J,J,81.5,81.5,this.angle,i),n.end()}}let tt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZxvaQW6vZzto7MYnQIpNkf7kp5EuozYUroqEjcNKHHd0Tl9mBPN1pk+hFeieGBnBtog7UXjsj9pWg+m6duecw2cay1OC/uxMC47KmP9OIYfoz1YoC20J/rzRG4quTZK2EAyJGs20qwUbYw0aNRmUxtvfUW/uEtNzc1NB1/X8LVyd15hh82F43AvD+VlXcsSJEZa1CQ3ejleAO7oxR3RDP0XN91X4+NXYb8nkv7UNTwV7e0YTdu7I3g33t7tuaEbNwSZpps2fSyvs4M2Tjhot+jb0Xzbltj8r5j/xVt/6Z1Ob93U1ZYO691EhhzchcHeXosVjcNZysyezLw4xRZt05R+fTeuj8vOj+zKyG0j2aZcVVs6v+QalnjrMFZASQYl2nBoSyz06e3j/Xk8rgWYmMvEICu2pm1HOTuc7okV8FgRj0XukwzanhvCc/F+72TjoQjdObN1OFuDLmh0xP+WHtxiI10ukJlCprb4guiv1fP+avZrS1C7NAkliHZjDtZwMMgqbukAltpMlwuMy2FcEBPqvfLLar5Uqi0hBdEwryy+Mv5n6zkbjTBa+dlMlwvUZFETZKGiFM7tvbhdJ3gSVRO0wzIjnxmvl/J6a6JsGMYGrahtpssFeqbR841S3mhN80OjOaSDEdqd6SjaMKgzgzRK7q1ib3PT9sYyNo7JZoyNFNvRcVMZmy7WOvIuryv/Zvdmdt90+nY0bRp3AvROohFwdwW7dTG7RFlbwlqdrbOBYg005NAQmZU0HWt1rXMBH1Xw0dQ8pmqzoaPmdhun7bHZjNVe9qP9eFQfO1VkUmHjhAVUZ1GtnKFSbjrkrPfy4i4UW5t/6ZxM54J0CqxFe81KpGsQyE4h23oYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjLna+bdOy+IiFquIpGq16Pb79cNYv3IIK/X/ugx+Ui6TVKvYVU9Nc8gX8od8Ir/IN/KPfCQ/yVfyl/6/pfJvLChkQdD6wyqntquCXYuKWJSfRr6D0dEAxV3xlw/khyD+kd/ku/88cHo+09tS3LBpO1HHCVUqcIA6CqB4K+6X6x35L/JM2loXurlWmUmlA5XogOIcK8/If5HncrSWo7F6cKIWPjT/RXGOlWfkv8hzaWsN4uaaysE6WIkOKM6x8oz8F3kusXqo2vxC5jtYiQ4ozrH0TeS5qIZcrB7qkrwdA8U5Vp6R/yLPZV8V+2L14Cl5THGwEh1QnGPlGfkv8lyUlIzFQ1cNYVVHrcjZ0VCcFe9Y+Eb+izy3ceclUl43aFN52DXXssYpnY6a4qFS8ZcP2uIf+e7inRh6pdFrdTGrm8uiHx/L8T2V7NGWzvJBLJ/bl7mTuzO5qBNFDoiJID/IF/KHfCK/yDfyT3O7d/KbfNfS80hNIrU0g9L6HOq1x5iTQo6FNpeLfCQ/yVfyl3xmXYwxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHNk9z4JwJ0SqKTdQkbyEwhU393T6V7zzR6pieR3tE1ITeVXImhe6BXDGZFdRbVeank2TBhcaEMr0rwbixj49IBLL2/L/ffmMuNHfqO9tFZjJYBd1ewO3Lx+IcVfKhqna5nHZYR6XFPH+5R3eeI5t9fx/fvjeC9Jdew5OKZKqFR/RDVKL6vL/f9PJafmyvHsL+a/ff24V6NmjZQbGchVbY6UM2BluqHv1rCqzVZ1KQlkZboepCdQvacPsz5bjTfXao+yMEaDt7Wk9tSIMVGig3TejCtJSM2bSpkPjWPqd1S6Zao+lORSYWmgkOjORRNwZqd5ezMSiHLRooNr5XwWjS6/1XHX9vL2T67N7M1iyXa9JCrYjVrS1gbpJyw6hBfsmiNCYT0P9/A+Wj1/6qGr5YNYFlJBiWJogEzezLz/ZG8/9s4fgtSyuvNYbyp1IONFBtu7sHNv4/j9yAxUHWrdaWsG9+N8XHd+YxkMpSy+aySz841cC5oXbmHCnnI74yxAgZ3YbDeB4PEQCOpBpFNZWwa2ZWRcdnxLsl00crtRB0n2lLg8JNRfDKoM4NsolgBSmw/UMADba1+qpmqfyf6x1u/0a/og3I+aEunP6/i86osqmygcGarF4p54dex/Bo0LqfqOfVwIQ/HW5/RSkwV1oN2WLlHTc82TljAwM4M1O5LWwYKZTjibYXNS0N5KcjKTe10PadfLObFuJwK4ozp+UzXDBTUjL+M5ZcBnRkQV53dMIwNQTu6bSTbVEzbi5awuVByd2E/FgaN0Tc1fKOzBHHV2aAdVSdv6s5NNkp7cSH/++xAng2yyHx+CM/H21YhfdPp+0U1X0TbSZnXx8faG9Aop0MS0cToh1p+iLcpOkLj9t/JOk5eqoPHxnDsyf486an5yqCDK7XZ1O4oZ4dWyy3FSXHUAYq47uyYbMZoGmhpG3DlEFb6uNiVBhpyaHhnBO8oJmfqOROJjzIiP43hJ8UxITqqX56S2Hur2KsOnq3nrE6PPNKPRwrSKbAZrjTQNZmuE7oxYXMZmxWbw9dxWFu4W4ezVedOE6qzI7oyYkY+M7TPeWsPbk2UX1qioSN+E3OZqOR2cReKE+qQRFN0Pi7y73g/UawU1KzezJpXwLz5hczX1ueUPKYkNb6GJQZ+j7/aAfRZREsv+quGsMoamXZBW2Gt5eU0alorEzYsKmJRa/m4NdeyxlqZsCGa84DKnVorEzboC7podis69DfIJmwufHMc7famvvmxZiYsKOtKWbRm1OcW1syEBboSJFozLh/EcmtmwgIluaM14/phrLdmJixYXMTiaM24p5I91syEBTphFOR7Y2tmwgJNvUFOr+tov3UzoaAv44KYUatv62ZCoemdhtG0+hzqrZsJBR08DWLG0gxKrZu50qvpxos3U5NItW4mFPp1ot+lPlpq2lYXs9qamVBZUMiC1ox4pJYjvlfStAu6GmTLcLboMtPIV4/6im5fFfuUi9QIap2MiWP+D96R1vPmsD/fAAAAAElFTkSuQmCC",et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAABsCAYAAAALzHKmAAAQ7klEQVR42u3da4xdVRUA4D0zd2Y6nZY59DVtZ1puS9+lzC0YAi2UQ8AAQczFpPgA9VIeIQbirRqJ0cBUBVGjDr/QCKSNRSMmpuODxAdxqhgwxkhFjf6Sxh/+UUNVNGJCzR7uTvas7LXX2q9zzp3em6y0gTN3Zu75utZe5+yztxC9V+/Ve5X9En1Vjd7J6SFbLNF7naPw+l2jh7YHMBWssqMHtlsRdim4qsLtIawaPiHEQOLoNrA9iIkQDnRrVA1qD2LZ8ISoxYqKo13sQAtBWBayQWZUAXGRQM9JjCngDVY0UqJNDbQrMcaGmArdUKpIjbYiQLsCZCyIMQBy8QwnilR4Q5AuCpxFYvRFmBLbEiwKwpsSaWycVQGZBKMrwBjA9BhxDe57u2L2hOoKNCbOrgAZitEVYUxoKSMErQvSxYIzCkguRg5EF4AUhqUlhy/YUKSxcRaKsioYOQhD4I0yYxkR3PcJBcuFysmgsXAWBTMJyBCMIQh9kGGxXIXvexCQXbHGAMrBWTbM2CCpMSMLIxehC77lSJwXGth7M0FzoVJIXXDWQnGmhOkL0ic7YhhtWdGGkAuPAjUWGoF4faCmwBkbZmyUqUCyMqMLRA4+E6IsdTjidUHKBYrh9CnpRcH0ypKxsyOGEYNIIeTCOz91OIJ1QYoB5eAMyZo+MFNnyVTZ0YiRC9EGEMOyAgshxErHsL2XK1gOUgwohtM1a5YNM7Rsu4K0ZkcbRm4mpPBRwFZ5hg9eCqkrUB+csWGGogzNkqEgrdnRhpGLkINudaLgwvVB6oqzCjCTZElb2Y4B0gUjBtEG0ARnDRLjjoG9DwcshtQGlIPTljVjwUySLWNkyRCQVHa0ZUUTRAwgF91a33BEy0VKAcVwwqwZC2bqbOlUurllOxQkJzNyINoAYqjWhYYjWg5SCiiG05Q1U8FMjTIoS8YE6YORi1BHtJ4KIcQEEtTXUWAxpK44YVlPBdO1jCdFWTZIE8bVGEYMIRPcZGBw4HKQcoBiOE1ZMzbMgVQwU6JMAdKEEcuIJogUvg1YCCE2gsCO42DlIIVAKZwpYJaSLVNnSU6XjYHUmxhTmXaFaMO3EYkLqMC+FsLlIoVAKZzMrEnBhJeLfLNlKMrYWRIDCbOkFSSVHbHM6AKRC6/ODUewNqQ+OLlZkxpjUmV8MBbMUJSxyzY3Q1IgTRgxiBRCHdem0KDAUkBh9sRwwjEnAXMMgTnKhFlUtiwkS5rGka4g9SaGgxFmRC7AzTCEEBcyA36dDSsXqAtOLkysjGMwY5XxVChjZ0kuSCo7YlkRQsQQYtDEFsegsLoCxUp7Kpgps2UslFGzJGccSYHUmxhOZqwzEZqAbfUMCisHKIZzgsCpl3MTzMwTpi1bYp2477gyFKUxS7qWbdjY2EBS2dGE0QQRA7gNCyHEdhjE8RhUDlBT9tzgmjWZMFNlSy+Urk1OzCyJlW0XkK4YOQh1cDtcgwBrQmoDWkdgboBZE8mYsJSHlnFbJ+5bwmOPJ7lZkirbC8aRsMvmgtTHjBhGE0QbwJ2egUE1ITVlUC5OmDVdYNrKuN70xM6WoShjlW4464dbtiFIWK6x7GjESEHUUe0iYncnbMdQSE0Z1ITTNOb0hRmjjLtmS9dmJ2rp1jtuKktyyrb6YLEMCUHq2dGG0QQRQ7f72kzc+cJecerne8Wvv7JNPHPvenEkz8Sh3UtFc92QyGt9Yko/HgOLAIUZlItTz5ouMF3KuE+2jFLCQ1D6lm6fLMkBacuOJowYRBUXyfjuHjF3NhdnsfjvAfH6E9vFt9XxKgikEKgJZyyYalzOLeMu2bLbULI6bh+QGwmQ+rgRlumdGEQAao+K56bEL2woVUwOiev0r8OAUjiJrMmFCbvykGxZRAmPitK1dHM7bohyMsuyi/I8f0+e57fJYIKEZXpXo9E4mOf5XTKyLLvCBLETF8uY2SKepkC+dpX4T02Ivepr4HvZcOZ5fmee54fyPL+DmTUhzAs6n4n8bN5dr9f3YdkSg8nsxG0lPBVKVpNjG0/aGhzfLDmRZdnumZmZp8+c+cdZPV555fSr7Xb7s0jJ3i5Pcue4MxKkPPkvvXTqz/B92u32l0wYOzG1fkhcd/py8Rcbyq/vFM/KY1WA95h/3zzP71bfU6JsNpsfgj+P/FlbrdaDGExYyuXvLz8H+DudODH700ajcSM3W6Yu4alQ1spCOTd38jcKocTZbh9+9NixY99XJ8AEUkcpo9W64yH197m5k7+bnZ19QT+J09NHntQhwji/Jg58qi6++ofLxJ8gSFneVw2Ka4QQDfh1Ok4dZavVmtZ/nrm5k7/Vf55O1tRhboUw5+ZOvqyOl5+R/FyOHj32PYVU/tloNG5IXcKrhJIzngwp3fNjomazea/64BuNxts646f50lWv169utw9/DmtqdJQyZFaSJVuV6nq9fqMEof5/vV6/CYBqgJDlee+yAbF/+4i4ZWqZeNfaIfHWzn+Hx0KcEuU9+s8jv3ej0bhVlXOZydX/k0iRMeb8P0D5e6tj8zy/Xb9UJIc56h/yqVOnXul8lmuZ2bJslKmbHG7XrbpCmCXFRLvdfqQD6jTS3Jiy5I4OykM6ADV+1Eu1DmV6evopBORexzDi1L+X/HnGxsb2w3Hm9PSRJ9QxWPOTZdmlKht2hi+w6dkox5bqffI8fye3hDteGqKaHVsHXihKl0tB+h0cY+lute54AGRKDCW89LNTRynHb7ChUWVVjetOnJh9EYBUyPZeNCoOtsbFQwdXi4/esELcd+tq8cCHJ8UXp+viy9efLz7AgamjlKXc1AA1m83DoIRDlFubzeb96hhZLVTlgJ24gttutx+ONa50bHZKRenaeTs1OfpAfnr6yOOdE7EZdNwmlKocntXLNkA5JTGq47Ds+Lf94lWsyfnXleLfnIwJUN4DOnNYwuUxh2A3Ln9XULrfK8t3J27Tu3BVwiOjXJqoAy8UZej1yclGo3GTLN+gu3w+z/P3YaWbQqk3Ne12e4ZC+c8rxWsYytcPiP9RpZxCqWDKnxOiBNlyAUpOnGsoh4tA2Rm8X9xqtT6md5wyZmYe+0YRKL+1S/wYQ3n8zctBl5SBUv5djivfjMOPduIzcizeiYfr9foVvUwZG+XCuzibZKnSceZ5/v4QlKp8y7ElhnJlTeTP7BI/kllRYfzrfvHqFy4UX1vaL/aVlSmROzwbwdS29T2UcEwZF+V8ozM2lu1VY812u/15akypGh3TmFJesJbHHD167IdUxz3YJy5bNySuX1mbvy55CbMLtzU6tjGlsdFptVqfUMc0Go23F4wy1l2dSnbfvpMwVPe9WWVLDsrOJaF9MFu2Wq1PqmNkGce67xiXhTjdNwdlvV6/BgxfbPfBfVCetxi6b9/rlCup65QzM48dl2OjLMv26CibzeZ96sTIzEFdpwQXz9U1yrtVlpR/Zll2Fec65Y6l4pbbx8XHH9kknvzJlPjlHy8Tp29eKT5ou0aJoIT3w3dBlLDzVpfAJEZ1XOdaJZxnOSlvPMjPzxFljIvng914RwebsjYO7uhMyHu46sOfnf3Oz2TXDW6vvYxdFoIXz3Wc8J5zs9n8iOn2IrxTc2BM3Glqdp7dI553uaOjxrhwcob+MyuUpjs6WZZdon8OcigjPx8V+u+GTWFTSWEx3WYcdJ225jNDSE4q0GHCzlueHOyujn6bUWYgeb9ZZUaQPe+GzQ+Gc8+oOGhC+c1d4gfI16n3XDAhQ7+9qE9l01E2Go132GYKyXE1NiFDTcpoNpv3LOYJGWXNErJNW9sEp63p2RKiVPMn1bS1DgxsyhoGdGpmizj+xtXiDYnx7/vFmce3iWdW1cTVGEY4hQ2ZW0nNq8Qm/M6XbXm3S100lwGedFybuvNOibLI+ZS2ceU4eAxiEuvCkfmU8ycToDxETe6FgCBQHeqyAbFvfEhcO7BwDuXFCEbTZF840XeHK0jYcbs2OIGle0mVJ/mmnClEPQqxyTY5I8/zFhif7fSZee4bnrPOU4AssnRXHaVTCTd14dRDY3UbTIiSeFhsN/aMjgnqthFx880rxX3yATL5p3y4LPXzOaBkUyBjZMlYpbtQlIOBD475ZEusjMNSvkXe6VEoJVDkeZ2dzIfIFsRzU+JF2OyM9M9fTC/6SUYOyFQPjQ2nWiUjxnPfw5EeHqMWIqAeIFsAU847lJM2JM6xsewt1OIDLs99P7ZFHNdB/upS8XtPiD7PfLuCXJNolYyyFiNI/Zit65ItrOVafFbHcFohY7hPTN21Tjz4uc3iqfsnxKdX1MTl1OoYRFaMsToGB6Trw2JFP/OdZC2hJZ7ZkrMoAbbSGmelDJ91hFKuJeS7jlBMkJnrAqqJlgMUZS/dArPlGHNdSg5M3xXXtvquuEatvIYtDRhpxbUJuIgqsU5lGWtUploK0KuEU9mSW8YpmFQ556xNuYW7NiW13B+FkMiKHIy+C6eGgBxJvMR0oSv5hi6+z4HJyZoU0M2RVvDlrOQbcxVfX5AhZbuqy0v7ZstYMLHlAVlLTF9ALLbvu9Y5Zylpn/XOsd0ibIvxr2KCLHpp6SCUIdnSZSF+WzfOhem6GD+1KwR3Z4jNjrtDpNoZwmWd8yrupZN6Hx3fbMmFSe0Swdq2ZIPjxk1112Duo8OBGLrBkw/IoncdK2XHsdC9dHz204m50xh3tzFq1zFqtzHXrfCw7OgDsqyNnZLszVijsmXgrmNcmGtS78lIoMX2aJz03fKO2sDJddPQSCDPiQ1DfWBycY6XtXstc2PQKuxgG2McmXTPb9/9vmuJYXKyJrWjbeg+3xPM4O73nWqvbyw7xgZZSJbEUBa157cNJjdr2vb+5iA1YV3HxYscj30PDCEHIgcjtfm8K8hSsmRotkwFk5s1TTghUAopB6xrjHMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=";class it{config;context;time=new s.oM;htmlCanvas;gl;renderer;assetManager;input;disposed=!1;constructor(t,e){this.config=e,e.pathPrefix||(e.pathPrefix=""),e.app||(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{},dispose:()=>{}}),e.webglConfig||(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new n(t,e.webglConfig),this.renderer=new j(t,this.context),this.gl=this.context.gl,this.assetManager=new a(this.context,e.pathPrefix),this.input=new C(t),e.app.loadAssets&&e.app.loadAssets(this);let i=()=>{this.disposed||(requestAnimationFrame(i),this.time.update(),e.app.update&&e.app.update(this,this.time.delta),e.app.render&&e.app.render(this))},s=()=>{this.disposed||(this.assetManager.isLoadingComplete()?this.assetManager.hasErrors()?e.app.error&&e.app.error(this,this.assetManager.getErrors()):(e.app.initialize&&e.app.initialize(this),i()):requestAnimationFrame(s))};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}dispose(){this.config.app.dispose&&this.config.app.dispose(this),this.disposed=!0}}},673:(t,e,i)=>{"use strict";i.d(e,{_Y:()=>X,X5:()=>b,oA:()=>$,b5:()=>st,Qq:()=>ct,f:()=>Bt,qd:()=>Ot,o3:()=>m,zK:()=>G,aG:()=>te,Nx:()=>bt,$K:()=>kt,h9:()=>Dt,bw:()=>dt,eN:()=>ut,K$:()=>ft,Q1:()=>r,qD:()=>It,Rh:()=>A,Mq:()=>C,H6:()=>M,lw:()=>c,jQ:()=>V,_7:()=>Nt,Kn:()=>H,Jh:()=>Yt,RV:()=>Xt,Cb:()=>et,qs:()=>W,Bx:()=>it,RK:()=>rt,pT:()=>Et,FM:()=>ot,dG:()=>ht,gB:()=>at,cw:()=>Ut,Qs:()=>zt,pA:()=>j,ON:()=>s,lc:()=>o,cj:()=>a,fj:()=>Rt,qU:()=>T,mj:()=>S,He:()=>Pt,OI:()=>Vt,rX:()=>Gt,I6:()=>Q,vz:()=>K,vl:()=>Z,YV:()=>Lt,bC:()=>d,pw:()=>yt,py:()=>h,Ff:()=>l,fT:()=>z,Ev:()=>U,EP:()=>N,Di:()=>Y,Qb:()=>Ft,Dr:()=>wt,NQ:()=>_,K1:()=>lt,y:()=>nt,i9:()=>F,So:()=>O,pR:()=>D,lP:()=>J,$l:()=>k,jx:()=>I,eP:()=>B,EA:()=>jt,t7:()=>$t,VT:()=>Re,qy:()=>Le,Ym:()=>qt,mI:()=>Fe,MR:()=>Zt,Su:()=>Kt,DX:()=>Wt,PN:()=>Qt,r9:()=>xt,eE:()=>n,gP:()=>pt,Lw:()=>At,Pd:()=>Mt,TE:()=>_t,O$:()=>gt,QL:()=>St,w3:()=>mt,oM:()=>p,Kf:()=>E,IT:()=>tt,UF:()=>Ht,_6:()=>Jt,To:()=>q,_C:()=>vt,Sr:()=>R,GU:()=>P,nS:()=>L,Rb:()=>Pe,Aq:()=>u,I9:()=>f,eJ:()=>v,p0:()=>g});class s{array=new Array;add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}}class n{entries={};size=0;add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i<s;i++)this.add(t[i]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}class r{r;g;b;a;static WHITE=new r(1,1,1,1);static RED=new r(1,0,0,1);static GREEN=new r(0,1,0,1);static BLUE=new r(0,0,1,1);static MAGENTA=new r(1,0,1,1);constructor(t=0,e=0,i=0,s=0){this.r=t,this.g=e,this.b=i,this.a=s}set(t,e,i,s){return this.r=t,this.g=e,this.b=i,this.a=s,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,i,s){return this.r+=t,this.g+=e,this.b+=i,this.a+=s,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new r).setFromString(t)}}class a{static PI=3.1415927;static PI2=2*a.PI;static radiansToDegrees=180/a.PI;static radDeg=a.radiansToDegrees;static degreesToRadians=a.PI/180;static degRad=a.degreesToRadians;static clamp(t,e,i){return t<e?e:t>i?i:t}static cosDeg(t){return Math.cos(t*a.degRad)}static sinDeg(t){return Math.sin(t*a.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return a.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),n=e-t;return s<=(i-t)/n?t+Math.sqrt(s*n*(i-t)):e-Math.sqrt((1-s)*n*(e-i))}static isPowerOfTwo(t){return t&&!(t&t-1)}}class o{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class h extends o{power=2;constructor(t){super(),this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}class l extends h{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}class u{static SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;static arrayCopy(t,e,i,s,n){for(let r=e,a=s;r<e+n;r++,a++)i[a]=t[r]}static arrayFill(t,e,i,s){for(let n=e;n<i;n++)t[n]=s}static setArraySize(t,e,i=0){let s=t.length;if(s==e)return t;if(t.length=e,s<e)for(let n=s;n<e;n++)t[n]=i;return t}static ensureArrayCapacity(t,e,i=0){return t.length>=e?t:u.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s<t;s++)i[s]=e;return i}static newFloatArray(t){if(u.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(u.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return u.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return u.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,i=!0){for(var s=0;s<t.length;s++)if(t[s]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}class c{static logBones(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e];console.log(i.data.name+", "+i.a+", "+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}}}class d{items=new Array;instantiator;constructor(t){this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class f{x;y;constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}class p{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class g{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(t=32){this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}}class m{name;constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}class v extends m{static nextID=0;id=v.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,e,i,s,n,r){i=n+(i>>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,u=a.worldY,c=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=n;a<i;t+=2,a+=r){let e=h[t],i=h[t+1];s[a]=e*c+i*d+l,s[a+1]=e*f+i*p+u}return}let u=0,c=0;for(let t=0;t<e;t+=2){let t=l[u];u+=t+1,c+=t}let d=a.bones;if(0==o.length)for(let t=n,e=3*c;t<i;t+=r){let i=0,n=0,r=l[u++];for(r+=u;u<r;u++,e+=3){let t=d[l[u]],s=h[e],r=h[e+1],a=h[e+2];i+=(s*t.a+r*t.b+t.worldX)*a,n+=(s*t.c+r*t.d+t.worldY)*a}s[t]=i,s[t+1]=n}else{let t=o;for(let e=n,a=3*c,o=c<<1;e<i;e+=r){let i=0,n=0,r=l[u++];for(r+=u;u<r;u++,a+=3,o+=2){let e=d[l[u]],s=h[a]+t[o],r=h[a+1]+t[o+1],c=h[a+2];i+=(s*e.a+r*e.b+e.worldX)*c,n+=(s*e.c+r*e.d+e.worldY)*c}s[e]=i,s[e+1]=n}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),u.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=u.newFloatArray(this.vertices.length),u.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}}class y{static _nextID=0;id=y.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new y(this.regions.length);return u.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let i=t.sequenceIndex;-1==i&&(i=this.setupIndex),i>=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return y._nextID++}}var x;!function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(x||(x={}));const w=[x.hold,x.once,x.loop,x.pingpong,x.onceReverse,x.loopReverse,x.pingpongReverse];class b{name;timelines=[];timelineIds=new n;duration;constructor(t,e,i){if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,i,s,n,r,a,o){if(!t)throw new Error("skeleton cannot be null.");s&&0!=this.duration&&(i%=this.duration,e>0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s<l;s++)h[s].apply(t,e,i,n,r,a,o)}}var T,S;!function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(T||(T={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(S||(S={}));class E{propertyIds;frames;constructor(t,e){this.propertyIds=e,this.frames=u.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;s<i;s++)if(t[s]>e)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let n=i;n<s;n+=i)if(t[n]>e)return n-i;return s-i}}class A extends E{curves;constructor(t,e,i){super(t,i),this.curves=u.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=u.newFloatArray(e);u.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,n,r,a,o,h,l,u){let c=this.curves,d=this.getFrameCount()+18*t;0==i&&(c[e]=2+d);let f=.03*(s-2*r+o),p=.03*(n-2*a+h),g=.006*(3*(r-o)-s+l),m=.006*(3*(a-h)-n+u),v=2*f+g,y=2*p+m,x=.3*(r-s)+f+.16666667*g,w=.3*(a-n)+p+.16666667*m,b=s+x,T=n+w;for(let t=d+18;d<t;d+=2)c[d]=b,c[d+1]=T,x+=v,w+=y,v+=g,y+=m,b+=x,T+=w}getBezierValue(t,e,i,s){let n=this.curves;if(n[s]>t){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(n[s]-r)*(n[s+1]-a)}let r=s+18;for(s+=2;s<r;s+=2)if(n[s]>=t){let e=n[s-2],i=n[s-1];return i+(t-e)/(n[s]-e)*(n[s+1]-i)}e+=this.getFrameEntries();let a=n[r-2],o=n[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}}class C extends A{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],n=e[i+1];return n+(t-s)/(e[i+2]-s)*(e[i+2+1]-n);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}}class M extends A{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}}class _ extends C{boneIndex=0;constructor(t,e,i){super(t,e,"0|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.rotation=o.data.rotation);case T.first:o.rotation+=(o.data.rotation-o.rotation)*n}return}let h=this.getCurveValue(i);switch(r){case T.setup:o.rotation=o.data.rotation+h*n;break;case T.first:case T.replace:h+=o.data.rotation-o.rotation;case T.add:o.rotation+=h*n}}}class R extends M{boneIndex=0;constructor(t,e,i){super(t,e,"1|"+i,"2|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case T.setup:return o.x=o.data.x,void(o.y=o.data.y);case T.first:o.x+=(o.data.x-o.x)*n,o.y+=(o.data.y-o.y)*n}return}let l=0,u=0,c=E.search(h,i,3),d=this.curves[c/3];switch(d){case 0:let t=h[c];l=h[c+1],u=h[c+2];let e=(i-t)/(h[c+3]-t);l+=(h[c+3+1]-l)*e,u+=(h[c+3+2]-u)*e;break;case 1:l=h[c+1],u=h[c+2];break;default:l=this.getBezierValue(i,c,1,d-2),u=this.getBezierValue(i,c,2,d+18-2)}switch(r){case T.setup:o.x=o.data.x+l*n,o.y=o.data.y+u*n;break;case T.first:case T.replace:o.x+=(o.data.x+l-o.x)*n,o.y+=(o.data.y+u-o.y)*n;break;case T.add:o.x+=l*n,o.y+=u*n}}}class P extends C{boneIndex=0;constructor(t,e,i){super(t,e,"1|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.x=o.data.x);case T.first:o.x+=(o.data.x-o.x)*n}return}let h=this.getCurveValue(i);switch(r){case T.setup:o.x=o.data.x+h*n;break;case T.first:case T.replace:o.x+=(o.data.x+h-o.x)*n;break;case T.add:o.x+=h*n}}}class L extends C{boneIndex=0;constructor(t,e,i){super(t,e,"2|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.y=o.data.y);case T.first:o.y+=(o.data.y-o.y)*n}return}let h=this.getCurveValue(i);switch(r){case T.setup:o.y=o.data.y+h*n;break;case T.first:case T.replace:o.y+=(o.data.y+h-o.y)*n;break;case T.add:o.y+=h*n}}}class F extends M{boneIndex=0;constructor(t,e,i){super(t,e,"3|"+i,"4|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,o){let h=t.bones[this.boneIndex];if(!h.active)return;let l,u,c=this.frames;if(i<c[0]){switch(r){case T.setup:return h.scaleX=h.data.scaleX,void(h.scaleY=h.data.scaleY);case T.first:h.scaleX+=(h.data.scaleX-h.scaleX)*n,h.scaleY+=(h.data.scaleY-h.scaleY)*n}return}let d=E.search(c,i,3),f=this.curves[d/3];switch(f){case 0:let t=c[d];l=c[d+1],u=c[d+2];let e=(i-t)/(c[d+3]-t);l+=(c[d+3+1]-l)*e,u+=(c[d+3+2]-u)*e;break;case 1:l=c[d+1],u=c[d+2];break;default:l=this.getBezierValue(i,d,1,f-2),u=this.getBezierValue(i,d,2,f+18-2)}if(l*=h.data.scaleX,u*=h.data.scaleY,1==n)r==T.add?(h.scaleX+=l-h.data.scaleX,h.scaleY+=u-h.data.scaleY):(h.scaleX=l,h.scaleY=u);else{let t=0,e=0;if(o==S.mixOut)switch(r){case T.setup:t=h.data.scaleX,e=h.data.scaleY,h.scaleX=t+(Math.abs(l)*a.signum(t)-t)*n,h.scaleY=e+(Math.abs(u)*a.signum(e)-e)*n;break;case T.first:case T.replace:t=h.scaleX,e=h.scaleY,h.scaleX=t+(Math.abs(l)*a.signum(t)-t)*n,h.scaleY=e+(Math.abs(u)*a.signum(e)-e)*n;break;case T.add:h.scaleX+=(l-h.data.scaleX)*n,h.scaleY+=(u-h.data.scaleY)*n}else switch(r){case T.setup:t=Math.abs(h.data.scaleX)*a.signum(l),e=Math.abs(h.data.scaleY)*a.signum(u),h.scaleX=t+(l-t)*n,h.scaleY=e+(u-e)*n;break;case T.first:case T.replace:t=Math.abs(h.scaleX)*a.signum(l),e=Math.abs(h.scaleY)*a.signum(u),h.scaleX=t+(l-t)*n,h.scaleY=e+(u-e)*n;break;case T.add:h.scaleX+=(l-h.data.scaleX)*n,h.scaleY+=(u-h.data.scaleY)*n}}}}class O extends C{boneIndex=0;constructor(t,e,i){super(t,e,"3|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,o){let h=t.bones[this.boneIndex];if(!h.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(h.scaleX=h.data.scaleX);case T.first:h.scaleX+=(h.data.scaleX-h.scaleX)*n}return}let l=this.getCurveValue(i)*h.data.scaleX;if(1==n)r==T.add?h.scaleX+=l-h.data.scaleX:h.scaleX=l;else{let t=0;if(o==S.mixOut)switch(r){case T.setup:t=h.data.scaleX,h.scaleX=t+(Math.abs(l)*a.signum(t)-t)*n;break;case T.first:case T.replace:t=h.scaleX,h.scaleX=t+(Math.abs(l)*a.signum(t)-t)*n;break;case T.add:h.scaleX+=(l-h.data.scaleX)*n}else switch(r){case T.setup:t=Math.abs(h.data.scaleX)*a.signum(l),h.scaleX=t+(l-t)*n;break;case T.first:case T.replace:t=Math.abs(h.scaleX)*a.signum(l),h.scaleX=t+(l-t)*n;break;case T.add:h.scaleX+=(l-h.data.scaleX)*n}}}}class D extends C{boneIndex=0;constructor(t,e,i){super(t,e,"4|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,o){let h=t.bones[this.boneIndex];if(!h.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(h.scaleY=h.data.scaleY);case T.first:h.scaleY+=(h.data.scaleY-h.scaleY)*n}return}let l=this.getCurveValue(i)*h.data.scaleY;if(1==n)r==T.add?h.scaleY+=l-h.data.scaleY:h.scaleY=l;else{let t=0;if(o==S.mixOut)switch(r){case T.setup:t=h.data.scaleY,h.scaleY=t+(Math.abs(l)*a.signum(t)-t)*n;break;case T.first:case T.replace:t=h.scaleY,h.scaleY=t+(Math.abs(l)*a.signum(t)-t)*n;break;case T.add:h.scaleY+=(l-h.data.scaleY)*n}else switch(r){case T.setup:t=Math.abs(h.data.scaleY)*a.signum(l),h.scaleY=t+(l-t)*n;break;case T.first:case T.replace:t=Math.abs(h.scaleY)*a.signum(l),h.scaleY=t+(l-t)*n;break;case T.add:h.scaleY+=(l-h.data.scaleY)*n}}}}class k extends M{boneIndex=0;constructor(t,e,i){super(t,e,"5|"+i,"6|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case T.setup:return o.shearX=o.data.shearX,void(o.shearY=o.data.shearY);case T.first:o.shearX+=(o.data.shearX-o.shearX)*n,o.shearY+=(o.data.shearY-o.shearY)*n}return}let l=0,u=0,c=E.search(h,i,3),d=this.curves[c/3];switch(d){case 0:let t=h[c];l=h[c+1],u=h[c+2];let e=(i-t)/(h[c+3]-t);l+=(h[c+3+1]-l)*e,u+=(h[c+3+2]-u)*e;break;case 1:l=h[c+1],u=h[c+2];break;default:l=this.getBezierValue(i,c,1,d-2),u=this.getBezierValue(i,c,2,d+18-2)}switch(r){case T.setup:o.shearX=o.data.shearX+l*n,o.shearY=o.data.shearY+u*n;break;case T.first:case T.replace:o.shearX+=(o.data.shearX+l-o.shearX)*n,o.shearY+=(o.data.shearY+u-o.shearY)*n;break;case T.add:o.shearX+=l*n,o.shearY+=u*n}}}class I extends C{boneIndex=0;constructor(t,e,i){super(t,e,"5|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.shearX=o.data.shearX);case T.first:o.shearX+=(o.data.shearX-o.shearX)*n}return}let h=this.getCurveValue(i);switch(r){case T.setup:o.shearX=o.data.shearX+h*n;break;case T.first:case T.replace:o.shearX+=(o.data.shearX+h-o.shearX)*n;break;case T.add:o.shearX+=h*n}}}class B extends C{boneIndex=0;constructor(t,e,i){super(t,e,"6|"+i),this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.shearY=o.data.shearY);case T.first:o.shearY+=(o.data.shearY-o.shearY)*n}return}let h=this.getCurveValue(i);switch(r){case T.setup:o.shearY=o.data.shearY+h*n;break;case T.first:case T.replace:o.shearY+=(o.data.shearY+h-o.shearY)*n;break;case T.add:o.shearY+=h*n}}}class N extends A{slotIndex=0;constructor(t,e,i){super(t,e,["7|"+i,"8|"+i]),this.slotIndex=i}getFrameEntries(){return 5}setFrame(t,e,i,s,n,r){t*=5,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(i<h[0]){let t=o.data.color;switch(r){case T.setup:return void l.setFromColor(t);case T.first:l.add((t.r-l.r)*n,(t.g-l.g)*n,(t.b-l.b)*n,(t.a-l.a)*n)}return}let u=0,c=0,d=0,f=0,p=E.search(h,i,5),g=this.curves[p/5];switch(g){case 0:let t=h[p];u=h[p+1],c=h[p+2],d=h[p+3],f=h[p+4];let e=(i-t)/(h[p+5]-t);u+=(h[p+5+1]-u)*e,c+=(h[p+5+2]-c)*e,d+=(h[p+5+3]-d)*e,f+=(h[p+5+4]-f)*e;break;case 1:u=h[p+1],c=h[p+2],d=h[p+3],f=h[p+4];break;default:u=this.getBezierValue(i,p,1,g-2),c=this.getBezierValue(i,p,2,g+18-2),d=this.getBezierValue(i,p,3,g+36-2),f=this.getBezierValue(i,p,4,g+54-2)}1==n?l.set(u,c,d,f):(r==T.setup&&l.setFromColor(o.data.color),l.add((u-l.r)*n,(c-l.g)*n,(d-l.b)*n,(f-l.a)*n))}}class Y extends A{slotIndex=0;constructor(t,e,i){super(t,e,["7|"+i]),this.slotIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,n){t<<=2,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(i<h[0]){let t=o.data.color;switch(r){case T.setup:return l.r=t.r,l.g=t.g,void(l.b=t.b);case T.first:l.r+=(t.r-l.r)*n,l.g+=(t.g-l.g)*n,l.b+=(t.b-l.b)*n}return}let u=0,c=0,d=0,f=E.search(h,i,4),p=this.curves[f>>2];switch(p){case 0:let t=h[f];u=h[f+1],c=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);u+=(h[f+4+1]-u)*e,c+=(h[f+4+2]-c)*e,d+=(h[f+4+3]-d)*e;break;case 1:u=h[f+1],c=h[f+2],d=h[f+3];break;default:u=this.getBezierValue(i,f,1,p-2),c=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==n)l.r=u,l.g=c,l.b=d;else{if(r==T.setup){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(u-l.r)*n,l.g+=(c-l.g)*n,l.b+=(d-l.b)*n}}}class X extends C{slotIndex=0;constructor(t,e,i){super(t,e,"8|"+i),this.slotIndex=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i<this.frames[0]){let t=o.data.color;switch(r){case T.setup:return void(h.a=t.a);case T.first:h.a+=(t.a-h.a)*n}return}let l=this.getCurveValue(i);1==n?h.a=l:(r==T.setup&&(h.a=o.data.color.a),h.a+=(l-h.a)*n)}}class U extends A{slotIndex=0;constructor(t,e,i){super(t,e,["7|"+i,"8|"+i,"9|"+i]),this.slotIndex=i}getFrameEntries(){return 8}setFrame(t,e,i,s,n,r,a,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o,this.frames[t+7]=h}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,u=o.darkColor;if(i<h[0]){let t=o.data.color,e=o.data.darkColor;switch(r){case T.setup:return l.setFromColor(t),u.r=e.r,u.g=e.g,void(u.b=e.b);case T.first:l.add((t.r-l.r)*n,(t.g-l.g)*n,(t.b-l.b)*n,(t.a-l.a)*n),u.r+=(e.r-u.r)*n,u.g+=(e.g-u.g)*n,u.b+=(e.b-u.b)*n}return}let c=0,d=0,f=0,p=0,g=0,m=0,v=0,y=E.search(h,i,8),x=this.curves[y>>3];switch(x){case 0:let t=h[y];c=h[y+1],d=h[y+2],f=h[y+3],p=h[y+4],g=h[y+5],m=h[y+6],v=h[y+7];let e=(i-t)/(h[y+8]-t);c+=(h[y+8+1]-c)*e,d+=(h[y+8+2]-d)*e,f+=(h[y+8+3]-f)*e,p+=(h[y+8+4]-p)*e,g+=(h[y+8+5]-g)*e,m+=(h[y+8+6]-m)*e,v+=(h[y+8+7]-v)*e;break;case 1:c=h[y+1],d=h[y+2],f=h[y+3],p=h[y+4],g=h[y+5],m=h[y+6],v=h[y+7];break;default:c=this.getBezierValue(i,y,1,x-2),d=this.getBezierValue(i,y,2,x+18-2),f=this.getBezierValue(i,y,3,x+36-2),p=this.getBezierValue(i,y,4,x+54-2),g=this.getBezierValue(i,y,5,x+72-2),m=this.getBezierValue(i,y,6,x+90-2),v=this.getBezierValue(i,y,7,x+108-2)}if(1==n)l.set(c,d,f,p),u.r=g,u.g=m,u.b=v;else{if(r==T.setup){l.setFromColor(o.data.color);let t=o.data.darkColor;u.r=t.r,u.g=t.g,u.b=t.b}l.add((c-l.r)*n,(d-l.g)*n,(f-l.b)*n,(p-l.a)*n),u.r+=(g-u.r)*n,u.g+=(m-u.g)*n,u.b+=(v-u.b)*n}}}class z extends A{slotIndex=0;constructor(t,e,i){super(t,e,["7|"+i,"9|"+i]),this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,u=o.darkColor;if(i<h[0]){let t=o.data.color,e=o.data.darkColor;switch(r){case T.setup:return l.r=t.r,l.g=t.g,l.b=t.b,u.r=e.r,u.g=e.g,void(u.b=e.b);case T.first:l.r+=(t.r-l.r)*n,l.g+=(t.g-l.g)*n,l.b+=(t.b-l.b)*n,u.r+=(e.r-u.r)*n,u.g+=(e.g-u.g)*n,u.b+=(e.b-u.b)*n}return}let c=0,d=0,f=0,p=0,g=0,m=0,v=E.search(h,i,7),y=this.curves[v/7];switch(y){case 0:let t=h[v];c=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],g=h[v+5],m=h[v+6];let e=(i-t)/(h[v+7]-t);c+=(h[v+7+1]-c)*e,d+=(h[v+7+2]-d)*e,f+=(h[v+7+3]-f)*e,p+=(h[v+7+4]-p)*e,g+=(h[v+7+5]-g)*e,m+=(h[v+7+6]-m)*e;break;case 1:c=h[v+1],d=h[v+2],f=h[v+3],p=h[v+4],g=h[v+5],m=h[v+6];break;default:c=this.getBezierValue(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),g=this.getBezierValue(i,v,5,y+72-2),m=this.getBezierValue(i,v,6,y+90-2)}if(1==n)l.r=c,l.g=d,l.b=f,u.r=p,u.g=g,u.b=m;else{if(r==T.setup){let t=o.data.color,e=o.data.darkColor;l.r=t.r,l.g=t.g,l.b=t.b,u.r=e.r,u.g=e.g,u.b=e.b}l.r+=(c-l.r)*n,l.g+=(d-l.g)*n,l.b+=(f-l.b)*n,u.r+=(p-u.r)*n,u.g+=(g-u.g)*n,u.b+=(m-u.b)*n}}}class G extends E{slotIndex=0;attachmentNames;constructor(t,e){super(t,["10|"+e]),this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];o.bone.active&&(a!=S.mixOut?i<this.frames[0]?r!=T.setup&&r!=T.first||this.setAttachment(t,o,o.data.attachmentName):this.setAttachment(t,o,this.attachmentNames[E.search1(this.frames,i)]):r==T.setup&&this.setAttachment(t,o,o.data.attachmentName))}setAttachment(t,e,i){e.setAttachment(i?t.getAttachment(this.slotIndex,i):null)}}class V extends A{slotIndex=0;attachment;vertices;constructor(t,e,i,s){super(t,e,["11|"+i+"|"+s.id]),this.slotIndex=i,this.attachment=s,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.vertices[t]=i}setBezier(t,e,i,s,n,r,a,o,h,l,u){let c=this.curves,d=this.getFrameCount()+18*t;0==i&&(c[e]=2+d);let f=.03*(s-2*r+o),p=.03*h-.06*a,g=.006*(3*(r-o)-s+l),m=.018*(a-h+.33333333),v=2*f+g,y=2*p+m,x=.3*(r-s)+f+.16666667*g,w=.3*a+p+.16666667*m,b=s+x,T=w;for(let t=d+18;d<t;d+=2)c[d]=b,c[d+1]=T,x+=v,w+=y,v+=g,y+=m,b+=x,T+=w}getCurvePercent(t,e){let i=this.curves,s=i[e];switch(s){case 0:let i=this.frames[e];return(t-i)/(this.frames[e+this.getFrameEntries()]-i);case 1:return 0}if(s-=2,i[s]>t){let n=this.frames[e];return i[s+1]*(t-n)/(i[s]-n)}let n=s+18;for(s+=2;s<n;s+=2)if(i[s]>=t){let e=i[s-2],n=i[s-1];return n+(t-e)/(i[s]-e)*(i[s+1]-n)}let r=i[n-2],a=i[n-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof v)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=T.setup);let c=this.vertices,d=c[0].length,f=this.frames;if(i<f[0]){switch(r){case T.setup:return void(l.length=0);case T.first:if(1==n)return void(l.length=0);l.length=d;let t=h;if(t.bones)for(n=1-n,p=0;p<d;p++)l[p]*=n;else{let e=t.vertices;for(var p=0;p<d;p++)l[p]+=(e[p]-l[p])*n}}return}if(l.length=d,i>=f[f.length-1]){let t=c[f.length-1];if(1==n)if(r==T.add){let e=h;if(e.bones)for(let e=0;e<d;e++)l[e]+=t[e];else{let i=e.vertices;for(let e=0;e<d;e++)l[e]+=t[e]-i[e]}}else u.arrayCopy(t,0,l,0,d);else switch(r){case T.setup:{let e=h;if(e.bones)for(let e=0;e<d;e++)l[e]=t[e]*n;else{let i=e.vertices;for(let e=0;e<d;e++){let s=i[e];l[e]=s+(t[e]-s)*n}}break}case T.first:case T.replace:for(let e=0;e<d;e++)l[e]+=(t[e]-l[e])*n;break;case T.add:let e=h;if(e.bones)for(let e=0;e<d;e++)l[e]+=t[e]*n;else{let i=e.vertices;for(let e=0;e<d;e++)l[e]+=(t[e]-i[e])*n}}return}let g=E.search1(f,i),m=this.getCurvePercent(i,g),y=c[g],x=c[g+1];if(1==n)if(r==T.add){let t=h;if(t.bones)for(let t=0;t<d;t++){let e=y[t];l[t]+=e+(x[t]-e)*m}else{let e=t.vertices;for(let t=0;t<d;t++){let i=y[t];l[t]+=i+(x[t]-i)*m-e[t]}}}else for(let t=0;t<d;t++){let e=y[t];l[t]=e+(x[t]-e)*m}else switch(r){case T.setup:{let t=h;if(t.bones)for(let t=0;t<d;t++){let e=y[t];l[t]=(e+(x[t]-e)*m)*n}else{let e=t.vertices;for(let t=0;t<d;t++){let i=y[t],s=e[t];l[t]=s+(i+(x[t]-i)*m-s)*n}}break}case T.first:case T.replace:for(let t=0;t<d;t++){let e=y[t];l[t]+=(e+(x[t]-e)*m-l[t])*n}break;case T.add:let t=h;if(t.bones)for(let t=0;t<d;t++){let e=y[t];l[t]+=(e+(x[t]-e)*m)*n}else{let e=t.vertices;for(let t=0;t<d;t++){let i=y[t];l[t]+=(i+(x[t]-i)*m-e[t])*n}}}}}class W extends E{static propertyIds=["12"];events;constructor(t){super(t,W.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,s,n,r,a){if(!s)return;let o=this.frames,h=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,s,n,r,a),e=-1;else if(e>=o[h-1])return;if(i<o[0])return;let l=0;if(e<o[0])l=0;else{l=E.search1(o,e)+1;let t=o[l];for(;l>0&&o[l-1]==t;)l--}for(;l<h&&i>=o[l];l++)s.push(this.events[l])}}class H extends E{static propertyIds=["13"];drawOrders;constructor(t){super(t,H.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,r,a){if(a==S.mixOut)return void(r==T.setup&&u.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i<this.frames[0])return void(r!=T.setup&&r!=T.first||u.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let o=E.search1(this.frames,i),h=this.drawOrders[o];if(h){let e=t.drawOrder,i=t.slots;for(let t=0,s=h.length;t<s;t++)e[t]=i[h[t]]}else u.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)}}class j extends A{ikConstraintIndex=0;constructor(t,e,i){super(t,e,["14|"+i]),this.ikConstraintIndex=i}getFrameEntries(){return 6}setFrame(t,e,i,s,n,r,a){t*=6,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r?1:0,this.frames[t+5]=a?1:0}apply(t,e,i,s,n,r,a){let o=t.ikConstraints[this.ikConstraintIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case T.setup:return o.mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,void(o.stretch=o.data.stretch);case T.first:o.mix+=(o.data.mix-o.mix)*n,o.softness+=(o.data.softness-o.softness)*n,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}return}let l=0,u=0,c=E.search(h,i,6),d=this.curves[c/6];switch(d){case 0:let t=h[c];l=h[c+1],u=h[c+2];let e=(i-t)/(h[c+6]-t);l+=(h[c+6+1]-l)*e,u+=(h[c+6+2]-u)*e;break;case 1:l=h[c+1],u=h[c+2];break;default:l=this.getBezierValue(i,c,1,d-2),u=this.getBezierValue(i,c,2,d+18-2)}r==T.setup?(o.mix=o.data.mix+(l-o.data.mix)*n,o.softness=o.data.softness+(u-o.data.softness)*n,a==S.mixOut?(o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch):(o.bendDirection=h[c+3],o.compress=0!=h[c+4],o.stretch=0!=h[c+5])):(o.mix+=(l-o.mix)*n,o.softness+=(u-o.softness)*n,a==S.mixIn&&(o.bendDirection=h[c+3],o.compress=0!=h[c+4],o.stretch=0!=h[c+5]))}}class q extends A{transformConstraintIndex=0;constructor(t,e,i){super(t,e,["15|"+i]),this.transformConstraintIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){let h=this.frames;h[t*=7]=e,h[t+1]=i,h[t+2]=s,h[t+3]=n,h[t+4]=r,h[t+5]=a,h[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.transformConstraints[this.transformConstraintIndex];if(!o.active)return;let h,l,u,c,d,f,p=this.frames;if(i<p[0]){let t=o.data;switch(r){case T.setup:return o.mixRotate=t.mixRotate,o.mixX=t.mixX,o.mixY=t.mixY,o.mixScaleX=t.mixScaleX,o.mixScaleY=t.mixScaleY,void(o.mixShearY=t.mixShearY);case T.first:o.mixRotate+=(t.mixRotate-o.mixRotate)*n,o.mixX+=(t.mixX-o.mixX)*n,o.mixY+=(t.mixY-o.mixY)*n,o.mixScaleX+=(t.mixScaleX-o.mixScaleX)*n,o.mixScaleY+=(t.mixScaleY-o.mixScaleY)*n,o.mixShearY+=(t.mixShearY-o.mixShearY)*n}return}let g=E.search(p,i,7),m=this.curves[g/7];switch(m){case 0:let t=p[g];h=p[g+1],l=p[g+2],u=p[g+3],c=p[g+4],d=p[g+5],f=p[g+6];let e=(i-t)/(p[g+7]-t);h+=(p[g+7+1]-h)*e,l+=(p[g+7+2]-l)*e,u+=(p[g+7+3]-u)*e,c+=(p[g+7+4]-c)*e,d+=(p[g+7+5]-d)*e,f+=(p[g+7+6]-f)*e;break;case 1:h=p[g+1],l=p[g+2],u=p[g+3],c=p[g+4],d=p[g+5],f=p[g+6];break;default:h=this.getBezierValue(i,g,1,m-2),l=this.getBezierValue(i,g,2,m+18-2),u=this.getBezierValue(i,g,3,m+36-2),c=this.getBezierValue(i,g,4,m+54-2),d=this.getBezierValue(i,g,5,m+72-2),f=this.getBezierValue(i,g,6,m+90-2)}if(r==T.setup){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(u-t.mixY)*n,o.mixScaleX=t.mixScaleX+(c-t.mixScaleX)*n,o.mixScaleY=t.mixScaleY+(d-t.mixScaleY)*n,o.mixShearY=t.mixShearY+(f-t.mixShearY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(u-o.mixY)*n,o.mixScaleX+=(c-o.mixScaleX)*n,o.mixScaleY+=(d-o.mixScaleY)*n,o.mixShearY+=(f-o.mixShearY)*n}}class K extends C{pathConstraintIndex=0;constructor(t,e,i){super(t,e,"16|"+i),this.pathConstraintIndex=i}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.position=o.data.position);case T.first:o.position+=(o.data.position-o.position)*n}return}let h=this.getCurveValue(i);r==T.setup?o.position=o.data.position+(h-o.data.position)*n:o.position+=(h-o.position)*n}}class Z extends C{pathConstraintIndex=0;constructor(t,e,i){super(t,e,"17|"+i),this.pathConstraintIndex=i}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case T.setup:return void(o.spacing=o.data.spacing);case T.first:o.spacing+=(o.data.spacing-o.spacing)*n}return}let h=this.getCurveValue(i);r==T.setup?o.spacing=o.data.spacing+(h-o.data.spacing)*n:o.spacing+=(h-o.spacing)*n}}class Q extends A{pathConstraintIndex=0;constructor(t,e,i){super(t,e,["18|"+i]),this.pathConstraintIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,n){let r=this.frames;r[t<<=2]=e,r[t+1]=i,r[t+2]=s,r[t+3]=n}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;let h,l,u,c=this.frames;if(i<c[0]){switch(r){case T.setup:return o.mixRotate=o.data.mixRotate,o.mixX=o.data.mixX,void(o.mixY=o.data.mixY);case T.first:o.mixRotate+=(o.data.mixRotate-o.mixRotate)*n,o.mixX+=(o.data.mixX-o.mixX)*n,o.mixY+=(o.data.mixY-o.mixY)*n}return}let d=E.search(c,i,4),f=this.curves[d>>2];switch(f){case 0:let t=c[d];h=c[d+1],l=c[d+2],u=c[d+3];let e=(i-t)/(c[d+4]-t);h+=(c[d+4+1]-h)*e,l+=(c[d+4+2]-l)*e,u+=(c[d+4+3]-u)*e;break;case 1:h=c[d+1],l=c[d+2],u=c[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),u=this.getBezierValue(i,d,3,f+36-2)}if(r==T.setup){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(u-t.mixY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(u-o.mixY)*n}}class J extends E{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,e,i){super(t,["19|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return J.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,n){let r=this.frames;r[t*=J.ENTRIES]=e,r[t+J.MODE]=i|s<<4,r[t+J.DELAY]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof v&&h.timelineAttachment==l))return;let u=this.frames;if(i<u[0])return void(r!=T.setup&&r!=T.first||(o.sequenceIndex=-1));let c=E.search(u,i,J.ENTRIES),d=u[c],f=u[c+J.MODE],p=u[c+J.DELAY];if(!this.attachment.sequence)return;let g=f>>4,m=this.attachment.sequence.regions.length,y=w[15&f];if(y!=x.hold)switch(g+=(i-d)/p+1e-5|0,y){case x.once:g=Math.min(m-1,g);break;case x.loop:g%=m;break;case x.pingpong:{let t=(m<<1)-2;g=0==t?0:g%t,g>=m&&(g=t-g);break}case x.onceReverse:g=Math.max(m-1-g,0);break;case x.loopReverse:g=m-1-g%m;break;case x.pingpongReverse:{let t=(m<<1)-2;g=0==t?0:(g+m-1)%t,g>=m&&(g=t-g)}}o.sequenceIndex=g}}class ${static _emptyAnimation=new b("<empty>",[],0);static emptyAnimation(){return $._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new et(this);propertyIDs=new n;animationsChanged=!1;trackEntryPool=new d((()=>new tt));constructor(t){this.data=t}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(!s)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let n=t*s.timeScale;if(s.delay>0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let r=s.next;if(r){let e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=n,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let r=0,a=i.length;r<a;r++){let a=i[r];if(!a||a.delay>0)continue;s=!0;let o=0==r?T.first:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),d=c,f=e;a.reverse&&(d=a.animation.duration-d,f=null);let p=a.animation.timelines,g=p.length;if(0==r&&1==h||o==T.add)for(let e=0;e<g;e++){u.webkit602BugfixHelper(h,o);var n=p[e];n instanceof G?this.applyAttachmentTimeline(n,t,d,o,!0):n.apply(t,l,d,f,h,o,S.mixIn)}else{let e=a.timelineMode,i=a.shortestRotation,s=!i&&a.timelinesRotation.length!=g<<1;s&&(a.timelinesRotation.length=g<<1);for(let n=0;n<g;n++){let r=p[n],c=e[n]==nt?o:T.setup;!i&&r instanceof _?this.applyRotateTimeline(r,t,d,h,c,a.timelinesRotation,n<<1,s):r instanceof G?this.applyAttachmentTimeline(r,t,d,o,!0):(u.webkit602BugfixHelper(h,o),r.apply(t,l,d,f,h,c,S.mixIn))}}this.queueEvents(a,c),e.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime}for(var r=this.unkeyedState+lt,a=t.slots,o=0,h=t.slots.length;o<h;o++){var l=a[o];if(l.attachmentState==r){var c=l.data.attachmentName;l.setAttachment(c?t.getAttachment(l.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),s}applyMixingFrom(t,e,i){let s=t.mixingFrom;s.mixingFrom&&this.applyMixingFrom(s,e,i);let n=0;0==t.mixDuration?(n=1,i==T.first&&(i=T.setup)):(n=t.mixTime/t.mixDuration,n>1&&(n=1),i!=T.first&&(i=s.mixBlend));let r=n<s.attachmentThreshold,a=n<s.drawOrderThreshold,o=s.animation.timelines,h=o.length,l=s.alpha*t.interruptAlpha,c=l*(1-n),d=s.animationLast,f=s.getAnimationTime(),p=f,g=null;if(s.reverse?p=s.animation.duration-p:n<s.eventThreshold&&(g=this.events),i==T.add)for(let t=0;t<h;t++)o[t].apply(e,d,p,g,c,i,S.mixOut);else{let t=s.timelineMode,n=s.timelineHoldMix,f=s.shortestRotation,m=!f&&s.timelinesRotation.length!=h<<1;m&&(s.timelinesRotation.length=h<<1),s.totalAlpha=0;for(let v=0;v<h;v++){let h,y=o[v],x=S.mixOut,w=0;switch(t[v]){case nt:if(!a&&y instanceof H)continue;h=i,w=c;break;case rt:h=T.setup,w=c;break;case at:h=i,w=l;break;case ot:h=T.setup,w=l;break;default:h=T.setup;let t=n[v];w=l*Math.max(0,1-t.mixTime/t.mixDuration)}s.totalAlpha+=w,!f&&y instanceof _?this.applyRotateTimeline(y,e,p,w,h,s.timelinesRotation,v<<1,m):y instanceof G?this.applyAttachmentTimeline(y,e,p,h,r):(u.webkit602BugfixHelper(w,i),a&&y instanceof H&&h==T.setup&&(x=S.mixIn),y.apply(e,d,p,g,w,h,x))}}return t.mixDuration>0&&this.queueEvents(s,f),this.events.length=0,s.nextAnimationLast=f,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,i,s,n){var r=e.slots[t.slotIndex];r.bone.active&&(i<t.frames[0]?s!=T.setup&&s!=T.first||this.setAttachment(e,r,r.data.attachmentName,n):this.setAttachment(e,r,t.attachmentNames[E.search1(t.frames,i)],n),r.attachmentState<=this.unkeyedState&&(r.attachmentState=this.unkeyedState+lt))}setAttachment(t,e,i,s){e.setAttachment(i?t.getAttachment(e.data.index,i):null),s&&(e.attachmentState=this.unkeyedState+ut)}applyRotateTimeline(t,e,i,s,n,r,o,h){if(h&&(r[o]=0),1==s)return void t.apply(e,0,i,null,1,n,S.mixIn);let l=e.bones[t.boneIndex];if(!l.active)return;let u=0,c=0;if(i<t.frames[0])switch(n){case T.setup:l.rotation=l.data.rotation;default:return;case T.first:u=l.rotation,c=l.data.rotation}else u=n==T.setup?l.data.rotation:l.rotation,c=l.data.rotation+t.getCurveValue(i);let d=0,f=c-u;if(f-=360*(16384-(16384.499999999996-f/360|0)),0==f)d=r[o];else{let t=0,e=0;h?(t=0,e=f):(t=r[o],e=r[o+1]);let i=f>0,s=t>=0;a.signum(e)!=a.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*a.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*a.signum(t)),r[o]=d}r[o+1]=f,l.rotation=u+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,n=s-i,r=t.trackLast%n,a=this.events,o=0,h=a.length;for(;o<h;o++){let e=a[o];if(e.time<r)break;e.time>s||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==n||r>t.trackTime%n:e>=s&&t.animationLast<s,l&&this.queue.complete(t);o<h;o++){let e=a[o];e.time<i||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,s=!1):this.clearNext(n));let r=this.trackEntry(t,e,i,n);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,i=!1,s=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let r=this.trackEntry(t,e,i,n);return n?(n.next=r,r.previous=n,s<=0&&(s+=n.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=s,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,$.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,$.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){let i=this.tracks[e];i&&this.setEmptyAnimation(i.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(u.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,i,s){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=i,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.attachmentThreshold=0,n.drawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=s?this.data.getMix(s.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=T.replace,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do{i.mixingTo&&i.mixBlend==T.add||this.computeHold(i),i=i.mixingTo}while(i)}}}computeHold(t){let e=t.mixingTo,i=t.animation.timelines,s=t.animation.timelines.length,n=t.timelineMode;n.length=s;let r=t.timelineHoldMix;r.length=0;let a=this.propertyIDs;if(e&&e.holdPrevious)for(let t=0;t<s;t++)n[t]=a.addAll(i[t].getPropertyIds())?ot:at;else t:for(let o=0;o<s;o++){let s=i[o],h=s.getPropertyIds();if(a.addAll(h))if(!e||s instanceof G||s instanceof H||s instanceof W||!e.animation.hasTimeline(h))n[o]=rt;else{for(let i=e.mixingTo;i;i=i.mixingTo)if(!i.animation.hasTimeline(h)){if(t.mixDuration>0){n[o]=ht,r[o]=i;continue t}break}n[o]=ot}else n[o]=nt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}class tt{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;attachmentThreshold=0;drawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;mixDuration=0;interruptAlpha=0;totalAlpha=0;mixBlend=T.replace;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}}class et{objects=[];drainDisabled=!1;animState;constructor(t){this.animState=t}start(t){this.objects.push(it.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(it.interrupt),this.objects.push(t)}end(t){this.objects.push(it.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(it.dispose),this.objects.push(t)}complete(t){this.objects.push(it.complete),this.objects.push(t)}event(t,e){this.objects.push(it.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let i=0;i<t.length;i+=2){let s=t[i],n=t[i+1];switch(s){case it.start:n.listener&&n.listener.start&&n.listener.start(n);for(let t=0;t<e.length;t++){let i=e[t];i.start&&i.start(n)}break;case it.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let t=0;t<e.length;t++){let i=e[t];i.interrupt&&i.interrupt(n)}break;case it.end:n.listener&&n.listener.end&&n.listener.end(n);for(let t=0;t<e.length;t++){let i=e[t];i.end&&i.end(n)}case it.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let t=0;t<e.length;t++){let i=e[t];i.dispose&&i.dispose(n)}this.animState.trackEntryPool.free(n);break;case it.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let t=0;t<e.length;t++){let i=e[t];i.complete&&i.complete(n)}break;case it.event:let s=t[2+i++];n.listener&&n.listener.event&&n.listener.event(n,s);for(let t=0;t<e.length;t++){let i=e[t];i.event&&i.event(n,s)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}var it;!function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(it||(it={}));class st{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}}const nt=0,rt=1,at=2,ot=3,ht=4,lt=1,ut=2;class ct{skeletonData;animationToMixTime={};defaultMix=0;constructor(t){if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(s,n,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}}class dt extends v{color=new r(1,1,1,1);constructor(t){super(t)}copy(){let t=new dt(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}class ft extends v{endSlot=null;color=new r(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new ft(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}class pt{_image;constructor(t){this._image=t}getImage(){return this._image}}var gt,mt,vt,yt,xt,wt,bt,Tt;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(gt||(gt={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(mt||(mt={}));class St{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0}class Et extends pt{setFilters(t,e){}setWraps(t,e){}dispose(){}}class At{pages=new Array;regions=new Array;constructor(t){let e=new Ct(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=u.enumValue(gt,i[1]),t.magFilter=u.enumValue(gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=mt.Repeat),-1!=i[1].indexOf("y")&&(t.vWrap=mt.Repeat)},pma:t=>{t.pma="true"==i[1]}};var n={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new _t(a,r);for(;;){let s=e.readEntry(i,r=e.readLine());if(0==s)break;let a=n[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e<s;e++)t.push(parseInt(i[e+1]));h.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),o&&o.length>0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Mt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let i of this.pages)i.setTexture(t.get(e+i.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture?.dispose()}}class Ct{lines;index=0;constructor(t){this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,n=i+1;;s++){let i=e.indexOf(",",n);if(-1==i)return t[s]=e.substr(n).trim(),s;if(t[s]=e.substr(n,i-n).trim(),n=i+1,4==s)return 4}}}class Mt{name;minFilter=gt.Nearest;magFilter=gt.Nearest;uWrap=mt.ClampToEdge;vWrap=mt.ClampToEdge;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(t){this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}}class _t extends St{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(t,e){super(),this.page=t,this.name=e,t.regions.push(this)}}class Rt extends v{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new r(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new r(0,0,0,0);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=u.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,n=this.region.v,r=0,a=0;if(this.region instanceof _t){let o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,n-=(o.originalWidth-o.offsetX-o.width)/u,r=o.originalHeight/l,a=o.originalWidth/u;for(let o=0;o<i;o+=2)e[o]=s+t[o+1]*r,e[o+1]=n+(1-t[o])*a;return;case 180:s-=(o.originalWidth-o.offsetX-o.width)/l,n-=o.offsetY/u,r=o.originalWidth/l,a=o.originalHeight/u;for(let o=0;o<i;o+=2)e[o]=s+(1-t[o])*r,e[o+1]=n+(1-t[o+1])*a;return;case 270:s-=o.offsetY/l,n-=o.offsetX/u,r=o.originalHeight/l,a=o.originalWidth/u;for(let o=0;o<i;o+=2)e[o]=s+(1-t[o+1])*r,e[o+1]=n+t[o]*a;return}s-=o.offsetX/l,n-=(o.originalHeight-o.offsetY-o.height)/u,r=o.originalWidth/l,a=o.originalHeight/u}else this.region?(r=this.region.u2-s,a=this.region.v2-n):(s=n=0,r=a=1);for(let o=0;o<i;o+=2)e[o]=s+t[o]*r,e[o+1]=n+t[o+1]*a}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new Rt(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),u.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),u.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),u.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),u.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,i,s,n,r){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,i,s,n,r)}newLinkedMesh(){let t=new Rt(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t}}class Pt extends v{lengths=[];closed=!1;constantSpeed=!1;color=new r(1,1,1,1);constructor(t){super(t)}copy(){let t=new Pt(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),u.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Lt extends v{x=0;y=0;rotation=0;color=new r(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){let e=a.cosDeg(this.rotation),i=a.sinDeg(this.rotation),s=e*t.a+i*t.b,n=e*t.c+i*t.d;return Math.atan2(n,s)*a.radDeg}copy(){let t=new Lt(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}class Ft extends m{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new r(1,1,1,1);path;region=null;sequence=null;offset=u.newFloatArray(8);uvs=u.newFloatArray(8);tempColor=new r(1,1,1,1);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);let i=this.width/this.region.originalWidth*this.scaleX,s=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*i,r=-this.height/2*this.scaleY+this.region.offsetY*s,a=n+this.region.width*i,o=r+this.region.height*s,h=this.rotation*Math.PI/180,l=Math.cos(h),u=Math.sin(h),c=this.x,d=this.y,f=n*l+c,p=n*u,g=r*l+d,m=r*u,v=a*l+c,y=a*u,x=o*l+d,w=o*u,b=this.offset;b[0]=f-m,b[1]=g+p,b[2]=f-w,b[3]=x+p,b[4]=v-w,b[5]=x+y,b[6]=v-m,b[7]=g+y,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,i,s){null!=this.sequence&&this.sequence.apply(t,this);let n=t.bone,r=this.offset,a=n.worldX,o=n.worldY,h=n.a,l=n.b,u=n.c,c=n.d,d=0,f=0;d=r[0],f=r[1],e[i]=d*h+f*l+a,e[i+1]=d*u+f*c+o,i+=s,d=r[2],f=r[3],e[i]=d*h+f*l+a,e[i+1]=d*u+f*c+o,i+=s,d=r[4],f=r[5],e[i]=d*h+f*l+a,e[i+1]=d*u+f*c+o,i+=s,d=r[6],f=r[7],e[i]=d*h+f*l+a,e[i+1]=d*u+f*c+o}copy(){let t=new Ft(this.name,this.path);return t.region=this.region,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,u.arrayCopy(this.uvs,0,t.uvs,0,8),u.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31}class Ot{atlas;constructor(t){this.atlas=t}loadSequence(t,e,i){let s=i.regions;for(let n=0,r=s.length;n<r;n++){let r=i.getPath(e,n),a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (sequence: "+t+")");s[n]=a}}newRegionAttachment(t,e,i,s){let n=new Ft(e,i);if(null!=s)this.loadSequence(e,i,s);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (region attachment: "+e+")");n.region=t}return n}newMeshAttachment(t,e,i,s){let n=new Rt(e,i);if(null!=s)this.loadSequence(e,i,s);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+e+")");n.region=t}return n}newBoundingBoxAttachment(t,e){return new dt(e)}newPathAttachment(t,e){return new Pt(e)}newPointAttachment(t,e){return new Lt(e)}newClippingAttachment(t,e){return new ft(e)}}class Dt{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;transformMode=vt.Normal;skinRequired=!1;color=new r;constructor(t,e,i){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}}!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(vt||(vt={}));class kt{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;sorted=!1;active=!1;constructor(t,e,i){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,r,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=r,this.ashearY=o;let h=this.parent;if(!h){let h=this.skeleton,l=i+90+o,u=h.scaleX,c=h.scaleY;return this.a=a.cosDeg(i+r)*s*u,this.b=a.cosDeg(l)*n*u,this.c=a.sinDeg(i+r)*s*c,this.d=a.sinDeg(l)*n*c,this.worldX=t*u+h.x,void(this.worldY=e*c+h.y)}let l=h.a,u=h.b,c=h.c,d=h.d;switch(this.worldX=l*t+u*e+h.worldX,this.worldY=c*t+d*e+h.worldY,this.data.transformMode){case vt.Normal:{let t=i+90+o,e=a.cosDeg(i+r)*s,h=a.cosDeg(t)*n,f=a.sinDeg(i+r)*s,p=a.sinDeg(t)*n;return this.a=l*e+u*f,this.b=l*h+u*p,this.c=c*e+d*f,void(this.d=c*h+d*p)}case vt.OnlyTranslation:{let t=i+90+o;this.a=a.cosDeg(i+r)*s,this.b=a.cosDeg(t)*n,this.c=a.sinDeg(i+r)*s,this.d=a.sinDeg(t)*n;break}case vt.NoRotationOrReflection:{let t=l*l+c*c,e=0;t>1e-4?(t=Math.abs(l*d-u*c)/t,l/=this.skeleton.scaleX,c/=this.skeleton.scaleY,u=c*t,d=l*t,e=Math.atan2(c,l)*a.radDeg):(l=0,c=0,e=90-Math.atan2(d,u)*a.radDeg);let h=i+r-e,f=i+o-e+90,p=a.cosDeg(h)*s,g=a.cosDeg(f)*n,m=a.sinDeg(h)*s,v=a.sinDeg(f)*n;this.a=l*p-u*m,this.b=l*g-u*v,this.c=c*p+d*m,this.d=c*g+d*v;break}case vt.NoScale:case vt.NoScaleOrReflection:{let t=a.cosDeg(i),e=a.sinDeg(i),h=(l*t+u*e)/this.skeleton.scaleX,f=(c*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(h*h+f*f);p>1e-5&&(p=1/p),h*=p,f*=p,p=Math.sqrt(h*h+f*f),this.data.transformMode==vt.NoScale&&l*d-u*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let g=Math.PI/2+Math.atan2(f,h),m=Math.cos(g)*p,v=Math.sin(g)*p,y=a.cosDeg(r)*s,x=a.cosDeg(90+o)*n,w=a.sinDeg(r)*s,b=a.sinDeg(90+o)*n;this.a=h*y+m*w,this.b=h*x+m*b,this.c=f*y+v*w,this.d=f*x+v*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*a.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*a.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*a.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*a.radDeg);let e=t.a,i=t.b,s=t.c,n=t.d,r=1/(e*n-i*s),o=this.worldX-t.worldX,h=this.worldY-t.worldY;this.ax=o*n*r-h*i*r,this.ay=h*e*r-o*s*r;let l=r*n,u=r*e,c=r*i,d=r*s,f=l*this.a-c*this.c,p=l*this.b-c*this.d,g=u*this.c-d*this.a,m=u*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+g*g),this.ascaleX>1e-4){let t=f*m-p*g;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+g*m,t)*a.radDeg,this.arotation=Math.atan2(g,f)*a.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,p)*a.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=a.sinDeg(t),i=a.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*a.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=a.sinDeg(t),i=a.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*a.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,n=this.d,r=a.cosDeg(t),o=a.sinDeg(t);this.a=r*e-o*s,this.b=r*i-o*n,this.c=o*e+r*s,this.d=o*i+r*n}}class It{name;order;skinRequired;constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}}class Bt{pathPrefix="";textureLoader;downloader;assets={};errors={};toLoad=0;loaded=0;constructor(t,e="",i=new Nt){this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise(((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)}))}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},i=()=>{}){t=this.start(t),this.downloader.downloadBinary(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)}))}loadText(t,e=()=>{},i=()=>{}){t=this.start(t),this.downloader.downloadText(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)}))}loadJson(t,e=()=>{},i=()=>{}){t=this.start(t),this.downloader.downloadJson(t,(i=>{this.success(e,t,i)}),((e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)}))}loadTexture(t,e=()=>{},i=()=>{}){if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}else fetch(t,{mode:"cors"}).then((e=>e.ok?e.blob():(this.error(i,t,`Couldn't load image: ${t}`),null))).then((t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null)).then((i=>{i&&this.success(e,t,this.textureLoader(i))}))}loadTextureAtlas(t,e=()=>{},i=()=>{},s){let n=t.lastIndexOf("/"),r=n>=0?t.substring(0,n+1):"";t=this.start(t),this.downloader.downloadText(t,(n=>{try{let a=new At(n),o=a.pages.length,h=!1;for(let n of a.pages)this.loadTexture(s?s[n.name]:r+n.name,((i,s)=>{h||(n.setTexture(s),0==--o&&this.success(e,t,a))}),((e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0}))}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}}),((e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)}))}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}}class Nt{callbacks={};rawDataUris={};dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n<i;n++)s[n]=e.charCodeAt(n);return s}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(-1==e)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.overrideMimeType("text/html"),s.open("GET",t,!0);let n=()=>{this.finish(t,s.status,s.responseText)};s.onload=n,s.onerror=n,s.send()}downloadJson(t,e,i){this.downloadText(t,(t=>{e(JSON.parse(t))}),i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let n=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):n()},s.onerror=n,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[i]:[e,i];for(let t=n.length-1,e=s.length;t<e;t+=2)s[t].apply(null,n)}}class Yt{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(t,e){if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}}class Xt{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(t){this.name=t}}class Ut{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}`);this.bones.push(s)}let i=e.findBone(t.target.name);if(!i)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=i}isActive(){return this.active}update(){if(0==this.mix)return;let t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}apply1(t,e,i,s,n,r,o){let h=t.parent;if(!h)throw new Error("IK bone must have parent.");let l=h.a,u=h.b,c=h.c,d=h.d,f=-t.ashearX-t.arotation,p=0,g=0;switch(t.data.transformMode){case vt.OnlyTranslation:p=(e-t.worldX)*a.signum(t.skeleton.scaleX),g=(i-t.worldY)*a.signum(t.skeleton.scaleY);break;case vt.NoRotationOrReflection:let s=Math.abs(l*d-u*c)/Math.max(1e-4,l*l+c*c),n=l/t.skeleton.scaleX,r=c/t.skeleton.scaleY;u=-r*s*t.skeleton.scaleX,d=n*s*t.skeleton.scaleY,f+=Math.atan2(r,n)*a.radDeg;default:let o=e-h.worldX,m=i-h.worldY,v=l*d-u*c;Math.abs(v)<=1e-4?(p=0,g=0):(p=(o*d-m*u)/v-t.ax,g=(m*l-o*c)/v-t.ay)}f+=Math.atan2(g,p)*a.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let m=t.ascaleX,v=t.ascaleY;if(s||n){switch(t.data.transformMode){case vt.NoScale:case vt.NoScaleOrReflection:p=e-t.worldX,g=i-t.worldY}let a=t.data.length*m,h=Math.sqrt(p*p+g*g);if(s&&h<a||n&&h>a&&a>1e-4){let t=(h/a-1)*o+1;m*=t,r&&(v*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,m,v,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,r,o,h,l){let u=t.ax,c=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,g=f,m=e.ascaleX,v=0,y=0,x=0;d<0?(d=-d,v=180,x=-1):(v=0,x=1),f<0&&(f=-f,x=-x),m<0?(m=-m,y=180):y=0;let w=e.ax,b=0,T=0,S=0,E=t.a,A=t.b,C=t.c,M=t.d,_=Math.abs(d-f)<=1e-4;!_||r?(b=0,T=E*w+t.worldX,S=C*w+t.worldY):(b=e.ay,T=E*w+A*b+t.worldX,S=C*w+M*b+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");E=R.a,A=R.b,C=R.c,M=R.d;let P=E*M-A*C,L=T-R.worldX,F=S-R.worldY;P=Math.abs(P)<=1e-4?0:1/P;let O,D,k=(L*M-F*A)*P-u,I=(F*E-L*C)*P-c,B=Math.sqrt(k*k+I*I),N=e.data.length*m;if(B<1e-4)return this.apply1(t,i,s,!1,r,!1,l),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);L=i-R.worldX,F=s-R.worldY;let Y=(L*M-F*A)*P-u,X=(F*E-L*C)*P-c,U=Y*Y+X*X;if(0!=h){h*=d*(m+1)*.5;let t=Math.sqrt(U),e=t-B-N*d+h;if(e>0){let i=Math.min(1,e/(2*h))-1;i=(e-h*(1-i*i))/t,Y-=i*Y,X-=i*X,U=Y*Y+X*X}}t:if(_){N*=d;let t=(U-B*B-N*N)/(2*B*N);t<-1?(t=-1,D=Math.PI*n):t>1?(t=1,D=0,r&&(E=(Math.sqrt(U)/(B+N)-1)*l+1,p*=E,o&&(g*=E))):D=Math.acos(t)*n,E=B+N*t,A=N*Math.sin(D),O=Math.atan2(X*E-Y*A,Y*E+X*A)}else{E=d*N,A=f*N;let t=E*E,e=A*A,i=Math.atan2(X,Y);C=e*B*B+t*U-t*e;let s=-2*e*B,r=e-t;if(M=s*s-4*r*C,M>=0){let t=Math.sqrt(M);s<0&&(t=-t),t=.5*-(s+t);let e=t/r,a=C/t,o=Math.abs(e)<Math.abs(a)?e:a;if(o*o<=U){F=Math.sqrt(U-o*o)*n,O=i-Math.atan2(F,o),D=Math.atan2(F/f,(o-B)/d);break t}}let o=a.PI,h=B-E,l=h*h,u=0,c=0,p=B+E,g=p*p,m=0;C=-E*B/(t-e),C>=-1&&C<=1&&(C=Math.acos(C),L=E*Math.cos(C)+B,F=A*Math.sin(C),M=L*L+F*F,M<l&&(o=C,l=M,h=L,u=F),M>g&&(c=C,g=M,p=L,m=F)),U<=.5*(l+g)?(O=i-Math.atan2(u*n,h),D=o*n):(O=i-Math.atan2(m*n,p),D=c*n)}let z=Math.atan2(b,w)*x,G=t.arotation;O=(O-z)*a.radDeg+v-G,O>180?O-=360:O<-180&&(O+=360),t.updateWorldTransformWith(u,c,G+O*l,p,g,0,0),G=e.arotation,D=((D+z)*a.radDeg-e.ashearX)*x+y-G,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(w,b,G+D*l,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}class zt extends It{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=1;compress=!1;stretch=!1;uniform=!1;mix=1;softness=0;constructor(t){super(t,0,!1)}}class Gt extends It{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=yt.Fixed;spacingMode=xt.Fixed;rotateMode=wt.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(t){super(t,0,!1)}}!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(yt||(yt={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(xt||(xt={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(wt||(wt={}));class Vt{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i<s;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(s)}let i=e.findSlot(t.target.name);if(!i)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=i,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}update(){let t=this.target.getAttachment();if(!(t instanceof Pt))return;let e=this.mixRotate,i=this.mixX,s=this.mixY;if(0==e&&0==i&&0==s)return;let n=this.data,r=n.rotateMode==wt.Tangent,o=n.rotateMode==wt.ChainScale,h=this.bones,l=h.length,c=r?l:l+1,d=u.setArraySize(this.spaces,c),f=o?this.lengths=u.setArraySize(this.lengths,l):[],p=this.spacing;switch(n.spacingMode){case xt.Percent:if(o)for(let t=0,e=c-1;t<e;t++){let e=h[t],i=e.data.length;if(i<Vt.epsilon)f[t]=0;else{let s=i*e.a,n=i*e.c;f[t]=Math.sqrt(s*s+n*n)}}u.arrayFill(d,1,c,p);break;case xt.Proportional:let t=0;for(let e=0,i=c-1;e<i;){let i=h[e],s=i.data.length;if(s<Vt.epsilon)o&&(f[e]=0),d[++e]=p;else{let n=s*i.a,r=s*i.c,a=Math.sqrt(n*n+r*r);o&&(f[e]=a),d[++e]=a,t+=a}}if(t>0){t=c/t*p;for(let e=1;e<c;e++)d[e]*=t}break;default:let e=n.spacingMode==xt.Length;for(let t=0,i=c-1;t<i;){let i=h[t],s=i.data.length;if(s<Vt.epsilon)o&&(f[t]=0),d[++t]=p;else{let n=s*i.a,r=s*i.c,a=Math.sqrt(n*n+r*r);o&&(f[t]=a),d[++t]=(e?s+p:p)*a/s}}}let g=this.computeWorldPositions(t,c,r),m=g[0],v=g[1],y=n.offsetRotation,x=!1;if(0==y)x=n.rotateMode==wt.Chain;else{x=!1;let t=this.target.bone;y*=t.a*t.d-t.b*t.c>0?a.degRad:-a.degRad}for(let t=0,n=3;t<l;t++,n+=3){let l=h[t];l.worldX+=(m-l.worldX)*i,l.worldY+=(v-l.worldY)*s;let u=g[n],c=g[n+1],p=u-m,w=c-v;if(o){let i=f[t];if(0!=i){let t=(Math.sqrt(p*p+w*w)/i-1)*e+1;l.a*=t,l.c*=t}}if(m=u,v=c,e>0){let i=l.a,s=l.b,o=l.c,h=l.d,u=0,c=0,f=0;if(u=r?g[n-1]:0==d[t+1]?g[n+2]:Math.atan2(w,p),u-=Math.atan2(o,i),x){c=Math.cos(u),f=Math.sin(u);let t=l.data.length;m+=(t*(c*i-f*o)-p)*e,v+=(t*(f*i+c*o)-w)*e}else u+=y;u>a.PI?u-=a.PI2:u<-a.PI&&(u+=a.PI2),u*=e,c=Math.cos(u),f=Math.sin(u),l.a=c*i-f*o,l.b=c*s-f*h,l.c=f*i+c*o,l.d=f*s+c*h}l.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,n=this.position,r=this.spaces,a=u.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,d=Vt.NONE;if(!t.constantSpeed){let f=t.lengths;c-=h?1:2;let p,g=f[c];switch(this.data.positionMode==yt.Percent&&(n*=g),this.data.spacingMode){case xt.Percent:p=g;break;case xt.Proportional:p=g/e;break;default:p=1}o=u.setArraySize(this.world,8);for(let u=0,m=0,v=0;u<e;u++,m+=3){let e=r[u]*p;n+=e;let y=n;if(h)y%=g,y<0&&(y+=g),v=0;else{if(y<0){d!=Vt.BEFORE&&(d=Vt.BEFORE,t.computeWorldVertices(s,2,4,o,0,2)),this.addBeforePosition(y,o,0,a,m);continue}if(y>g){d!=Vt.AFTER&&(d=Vt.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(y-g,o,0,a,m);continue}}for(;;v++){let t=f[v];if(!(y>t)){if(0==v)y/=t;else{let e=f[v-1];y=(y-e)/(t-e)}break}}v!=d&&(d=v,h&&v==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*v+2,8,o,0,2)),this.addCurvePosition(y,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,m,i||u>0&&0==e)}return a}h?(l+=2,o=u.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=u.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let f,p=u.setArraySize(this.curves,c),g=0,m=o[0],v=o[1],y=0,x=0,w=0,b=0,T=0,S=0,E=0,A=0,C=0,M=0,_=0,R=0,P=0,L=0;for(let t=0,e=2;t<c;t++,e+=6)y=o[e],x=o[e+1],w=o[e+2],b=o[e+3],T=o[e+4],S=o[e+5],E=.1875*(m-2*y+w),A=.1875*(v-2*x+b),C=.09375*(3*(y-w)-m+T),M=.09375*(3*(x-b)-v+S),_=2*E+C,R=2*A+M,P=.75*(y-m)+E+.16666667*C,L=.75*(x-v)+A+.16666667*M,g+=Math.sqrt(P*P+L*L),P+=_,L+=R,_+=C,R+=M,g+=Math.sqrt(P*P+L*L),P+=_,L+=R,g+=Math.sqrt(P*P+L*L),P+=_+C,L+=R+M,g+=Math.sqrt(P*P+L*L),p[t]=g,m=T,v=S;switch(this.data.positionMode==yt.Percent&&(n*=g),this.data.spacingMode){case xt.Percent:f=g;break;case xt.Proportional:f=g/e;break;default:f=1}let F=this.segments,O=0;for(let t=0,s=0,u=0,c=0;t<e;t++,s+=3){let e=r[t]*f;n+=e;let D=n;if(h)D%=g,D<0&&(D+=g),u=0;else{if(D<0){this.addBeforePosition(D,o,0,a,s);continue}if(D>g){this.addAfterPosition(D-g,o,l-4,a,s);continue}}for(;;u++){let t=p[u];if(!(D>t)){if(0==u)D/=t;else{let e=p[u-1];D=(D-e)/(t-e)}break}}if(u!=d){d=u;let t=6*u;for(m=o[t],v=o[t+1],y=o[t+2],x=o[t+3],w=o[t+4],b=o[t+5],T=o[t+6],S=o[t+7],E=.03*(m-2*y+w),A=.03*(v-2*x+b),C=.006*(3*(y-w)-m+T),M=.006*(3*(x-b)-v+S),_=2*E+C,R=2*A+M,P=.3*(y-m)+E+.16666667*C,L=.3*(x-v)+A+.16666667*M,O=Math.sqrt(P*P+L*L),F[0]=O,t=1;t<8;t++)P+=_,L+=R,_+=C,R+=M,O+=Math.sqrt(P*P+L*L),F[t]=O;P+=_,L+=R,O+=Math.sqrt(P*P+L*L),F[8]=O,P+=_+C,L+=R+M,O+=Math.sqrt(P*P+L*L),F[9]=O,c=0}for(D*=O;;c++){let t=F[c];if(!(D>t)){if(0==c)D/=t;else{let e=F[c-1];D=c+(D-e)/(t-e)}break}}this.addCurvePosition(.1*D,m,v,y,x,w,b,T,S,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,n){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addAfterPosition(t,e,i,s,n){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addCurvePosition(t,e,i,s,n,r,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=i,void(l[u+2]=Math.atan2(n-i,s-e));let d=t*t,f=d*t,p=1-t,g=p*p,m=g*p,v=p*t,y=3*v,x=p*y,w=y*t,b=e*m+s*x+r*w+o*f,T=i*m+n*x+a*w+h*f;l[u]=b,l[u+1]=T,c&&(l[u+2]=t<.001?Math.atan2(n-i,s-e):Math.atan2(T-(i*g+n*v*2+a*d),b-(e*g+s*v*2+r*d)))}}class Wt{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new r,this.darkColor=t.darkColor?new r:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof v&&this.attachment instanceof v&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}class Ht{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new f;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(s)}let i=e.findBone(t.target.name);if(!i)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=i}isActive(){return this.active}update(){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,o=0!=e||0!=i,h=this.target,l=h.a,u=h.b,c=h.c,d=h.d,f=l*d-u*c>0?a.degRad:-a.degRad,p=this.data.offsetRotation*f,g=this.data.offsetShearY*f,m=this.bones;for(let f=0,v=m.length;f<v;f++){let v=m[f];if(0!=t){let e=v.a,i=v.b,s=v.c,n=v.d,r=Math.atan2(c,l)-Math.atan2(s,e)+p;r>a.PI?r-=a.PI2:r<-a.PI&&(r+=a.PI2),r*=t;let o=Math.cos(r),h=Math.sin(r);v.a=o*e-h*s,v.b=o*i-h*n,v.c=h*e+o*s,v.d=h*i+o*n}if(o){let t=this.temp;h.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(t.x-v.worldX)*e,v.worldY+=(t.y-v.worldY)*i}if(0!=s){let t=Math.sqrt(v.a*v.a+v.c*v.c);0!=t&&(t=(t+(Math.sqrt(l*l+c*c)-t+this.data.offsetScaleX)*s)/t),v.a*=t,v.c*=t}if(0!=n){let t=Math.sqrt(v.b*v.b+v.d*v.d);0!=t&&(t=(t+(Math.sqrt(u*u+d*d)-t+this.data.offsetScaleY)*n)/t),v.b*=t,v.d*=t}if(r>0){let t=v.b,e=v.d,i=Math.atan2(e,t),s=Math.atan2(d,u)-Math.atan2(c,l)-(i-Math.atan2(v.c,v.a));s>a.PI?s-=a.PI2:s<-a.PI&&(s+=a.PI2),s=i+(s+g)*r;let n=Math.sqrt(t*t+e*e);v.b=Math.cos(s)*n,v.d=Math.sin(s)*n}v.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,o=0!=e||0!=i,h=this.target,l=h.a,u=h.b,c=h.c,d=h.d,f=l*d-u*c>0?a.degRad:-a.degRad,p=this.data.offsetRotation*f,g=this.data.offsetShearY*f,m=this.bones;for(let f=0,v=m.length;f<v;f++){let v=m[f];if(0!=t){let e=v.a,i=v.b,s=v.c,n=v.d,r=Math.atan2(c,l)+p;r>a.PI?r-=a.PI2:r<-a.PI&&(r+=a.PI2),r*=t;let o=Math.cos(r),h=Math.sin(r);v.a=o*e-h*s,v.b=o*i-h*n,v.c=h*e+o*s,v.d=h*i+o*n}if(o){let t=this.temp;h.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),v.worldX+=t.x*e,v.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleX)*s+1;v.a*=t,v.c*=t}if(0!=n){let t=(Math.sqrt(u*u+d*d)-1+this.data.offsetScaleY)*n+1;v.b*=t,v.d*=t}if(r>0){let t=Math.atan2(d,u)-Math.atan2(c,l);t>a.PI?t-=a.PI2:t<-a.PI&&(t+=a.PI2);let e=v.b,i=v.d;t=Math.atan2(i,e)+(t-a.PI/2+g)*r;let s=Math.sqrt(e*e+i*i);v.b=Math.cos(t)*s,v.d=Math.sin(t)*s}v.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h<l;h++){let l=o[h],u=l.arotation;if(0!=t){let e=a.arotation-u+this.data.offsetRotation;e-=360*(16384-(16384.499999999996-e/360|0)),u+=e*t}let c=l.ax,d=l.ay;c+=(a.ax-c+this.data.offsetX)*e,d+=(a.ay-d+this.data.offsetY)*i;let f=l.ascaleX,p=l.ascaleY;0!=s&&0!=f&&(f=(f+(a.ascaleX-f+this.data.offsetScaleX)*s)/f),0!=n&&0!=p&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p);let g=l.ashearY;if(0!=r){let t=a.ashearY-g+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),g+=t*r}l.updateWorldTransformWith(c,d,u,f,p,l.ashearX,g)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h<l;h++){let l=o[h],u=l.arotation+(a.arotation+this.data.offsetRotation)*t,c=l.ax+(a.ax+this.data.offsetX)*e,d=l.ay+(a.ay+this.data.offsetY)*i,f=l.ascaleX*((a.ascaleX-1+this.data.offsetScaleX)*s+1),p=l.ascaleY*((a.ascaleY-1+this.data.offsetScaleY)*n+1),g=l.ashearY+(a.ashearY+this.data.offsetShearY)*r;l.updateWorldTransformWith(c,d,u,f,p,l.ashearX,g)}}}class jt{static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return jt.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;constructor(t){if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let i,s=t.bones[e];if(s.parent){let t=this.bones[s.parent.index];i=new kt(s,this,t),t.children.push(i)}else i=new kt(s,this,null);this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let i=t.slots[e],s=this.bones[i.boneData.index],n=new Wt(i,s);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let i=t.ikConstraints[e];this.ikConstraints.push(new Ut(i,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let i=t.transformConstraints[e];this.transformConstraints.push(new Ht(i,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let i=t.pathConstraints[e];this.pathConstraints.push(new Vt(i,this))}this.color=new r(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.sorted=i.data.skinRequired,i.active=!i.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,i=this.skin.bones.length;e<i;e++){let i=this.bones[t[e].index];do{i.sorted=!1,i.active=!0,i=i.parent}while(i)}}let e=this.ikConstraints,i=this.transformConstraints,s=this.pathConstraints,n=e.length,r=i.length,a=s.length,o=n+r+a;t:for(let t=0;t<o;t++){for(let i=0;i<n;i++){let s=e[i];if(s.data.order==t){this.sortIkConstraint(s);continue t}}for(let e=0;e<r;e++){let s=i[e];if(s.data.order==t){this.sortTransformConstraint(s);continue t}}for(let e=0;e<a;e++){let i=s[e];if(i.data.order==t){this.sortPathConstraint(i);continue t}}}for(let e=0,i=t.length;e<i;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&u.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let i=t.bones,s=i[0];if(this.sortBone(s),1==i.length)this._updateCache.push(t),this.sortReset(s.children);else{let e=i[i.length-1];this.sortBone(e),this._updateCache.push(t),this.sortReset(s.children),e.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&u.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,i=e.data.index,s=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,i,s),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,s);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],i,s);let n=e.getAttachment();n instanceof Pt&&this.sortPathConstraintAttachmentWith(n,s);let r=t.bones,a=r.length;for(let t=0;t<a;t++)this.sortBone(r[t]);this._updateCache.push(t);for(let t=0;t<a;t++)this.sortReset(r[t].children);for(let t=0;t<a;t++)r[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&u.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,i=e.length;if(t.data.local)for(let t=0;t<i;t++){let i=e[t];this.sortBone(i.parent),this.sortBone(i)}else for(let t=0;t<i;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<i;t++)this.sortReset(e[t].children);for(let t=0;t<i;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,i){let s=t.attachments[e];if(s)for(let t in s)this.sortPathConstraintAttachmentWith(s[t],i)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof Pt))return;let i=t.bones;if(i){let t=this.bones;for(let e=0,s=i.length;e<s;){let s=i[e++];for(s+=e;e<s;)this.sortBone(t[i[e++]])}}else this.sortBone(e)}sortBone(t){if(!t)return;if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,i=t.length;e<i;e++){let i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY}let e=this._updateCache;for(let t=0,i=e.length;t<i;t++)e[t].update()}updateWorldTransformWith(t){let e=this.getRootBone();if(!e)throw new Error("Root bone must not be null.");let i=t.a,s=t.b,n=t.c,r=t.d;e.worldX=i*this.x+s*this.y+t.worldX,e.worldY=n*this.x+r*this.y+t.worldY;let o=e.rotation+90+e.shearY,h=a.cosDeg(e.rotation+e.shearX)*e.scaleX,l=a.cosDeg(o)*e.scaleY,u=a.sinDeg(e.rotation+e.shearX)*e.scaleX,c=a.sinDeg(o)*e.scaleY;e.a=(i*h+s*u)*this.scaleX,e.b=(i*l+s*c)*this.scaleX,e.c=(n*h+r*u)*this.scaleY,e.d=(n*l+r*c)*this.scaleY;let d=this._updateCache;for(let t=0,i=d.length;t<i;t++){let i=d[t];i!=e&&i.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose();let e=this.ikConstraints;for(let t=0,i=e.length;t<i;t++){let i=e[t];i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}let i=this.transformConstraints;for(let t=0,e=i.length;t<e;t++){let e=i[t],s=e.data;e.mixRotate=s.mixRotate,e.mixX=s.mixX,e.mixY=s.mixY,e.mixScaleX=s.mixScaleX,e.mixScaleY=s.mixScaleY,e.mixShearY=s.mixShearY}let s=this.pathConstraints;for(let t=0,e=s.length;t<e;t++){let e=s[t],i=e.data;e.position=i.position,e.spacing=i.spacing,e.mixRotate=i.mixRotate,e.mixX=i.mixX,e.mixY=i.mixY}}setSlotsToSetupPose(){let t=this.slots;u.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i],n=s.data.attachmentName;if(n){let e=t.getAttachment(i,n);e&&s.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let i=this.data.findSlot(t);if(!i)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(i.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let s=0,n=i.length;s<n;s++){let n=i[s];if(n.data.name==t){let i=null;if(e&&(i=this.getAttachment(s,e),!i))throw new Error("Attachment not found: "+e+", for slot: "+t);return void n.setAttachment(i)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}getBoundsRect(){let t=new f,e=new f;return this.getBounds(t,e),{x:t.x,y:t.y,width:e.x,height:e.y}}getBounds(t,e,i=new Array(2)){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let s=this.drawOrder,n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let t=0,e=s.length;t<e;t++){let e=s[t];if(!e.bone.active)continue;let h=0,l=null,c=e.getAttachment();if(c instanceof Ft)h=8,l=u.setArraySize(i,h,0),c.computeWorldVertices(e,l,0,2);else if(c instanceof Rt){let t=c;h=t.worldVerticesLength,l=u.setArraySize(i,h,0),t.computeWorldVertices(e,0,h,l,0,2)}if(l)for(let t=0,e=l.length;t<e;t+=2){let e=l[t],i=l[t+1];n=Math.min(n,e),r=Math.min(r,i),a=Math.max(a,e),o=Math.max(o,i)}}t.set(n,r),e.set(a-n,o-r)}}class qt{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;x=0;y=0;width=0;height=0;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}}class Kt{slotIndex;name;attachment;constructor(t=0,e,i){this.slotIndex=t,this.name=e,this.attachment=i}}class Zt{name;attachments=new Array;bones=Array();constraints=new Array;constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,i){if(!i)throw new Error("attachment cannot be null.");let s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==i){s=!0;break}s||this.bones.push(i)}for(let e=0;e<t.constraints.length;e++){let i=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==i){s=!0;break}s||this.constraints.push(i)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var i=e[t];this.setAttachment(i.slotIndex,i.name,i.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==i){s=!0;break}s||this.bones.push(i)}for(let e=0;e<t.constraints.length;e++){let i=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==i){s=!0;break}s||this.constraints.push(i)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var i=e[t];i.attachment&&(i.attachment instanceof Rt?(i.attachment=i.attachment.newLinkedMesh(),this.setAttachment(i.slotIndex,i.name,i.attachment)):(i.attachment=i.attachment.copy(),this.setAttachment(i.slotIndex,i.name,i.attachment)))}}getAttachment(t,e){let i=this.attachments[t];return i?i[e]:null}removeAttachment(t,e){let i=this.attachments[t];i&&delete i[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let i=this.attachments[e];if(i)for(let s in i){let n=i[s];n&&t.push(new Kt(e,s,n))}}return t}getAttachmentsForSlot(t,e){let i=this.attachments[t];if(i)for(let s in i){let n=i[s];n&&e.push(new Kt(t,s,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let i=0;for(let s=0;s<t.slots.length;s++){let n=t.slots[s],r=n.getAttachment();if(r&&i<e.attachments.length){let t=e.attachments[i];for(let e in t)if(r==t[e]){let t=this.getAttachment(i,e);t&&n.setAttachment(t);break}}i++}}}class Qt{index=0;name;boneData;color=new r(1,1,1,1);darkColor=null;attachmentName=null;blendMode=bt.Normal;constructor(t,e,i){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}}!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(bt||(bt={}));class Jt extends It{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(t){super(t,0,!1)}}class $t{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new qt;i.name="";let s=new te(t),n=s.readInt32(),a=s.readInt32();i.hash=0==a&&0==n?null:a.toString(16)+n.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let o=s.readBoolean();o&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let h=0;h=s.readInt(!0);for(let t=0;t<h;t++){let t=s.readString();if(!t)throw new Error("String in string table must not be null.");s.strings.push(t)}h=s.readInt(!0);for(let t=0;t<h;t++){let n=s.readString();if(!n)throw new Error("Bone name must not be null.");let a=0==t?null:i.bones[s.readInt(!0)],h=new Dt(t,n,a);h.rotation=s.readFloat(),h.x=s.readFloat()*e,h.y=s.readFloat()*e,h.scaleX=s.readFloat(),h.scaleY=s.readFloat(),h.shearX=s.readFloat(),h.shearY=s.readFloat(),h.length=s.readFloat()*e,h.transformMode=s.readInt(!0),h.skinRequired=s.readBoolean(),o&&r.rgba8888ToColor(h.color,s.readInt32()),i.bones.push(h)}h=s.readInt(!0);for(let t=0;t<h;t++){let e=s.readString();if(!e)throw new Error("Slot name must not be null.");let n=i.bones[s.readInt(!0)],a=new Qt(t,e,n);r.rgba8888ToColor(a.color,s.readInt32());let o=s.readInt32();-1!=o&&r.rgb888ToColor(a.darkColor=new r,o),a.attachmentName=s.readStringRef(),a.blendMode=s.readInt(!0),i.slots.push(a)}h=s.readInt(!0);for(let t,n=0;n<h;n++){let n=s.readString();if(!n)throw new Error("IK constraint data name must not be null.");let r=new zt(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.bones[s.readInt(!0)],r.mix=s.readFloat(),r.softness=s.readFloat()*e,r.bendDirection=s.readByte(),r.compress=s.readBoolean(),r.stretch=s.readBoolean(),r.uniform=s.readBoolean(),i.ikConstraints.push(r)}h=s.readInt(!0);for(let t,n=0;n<h;n++){let n=s.readString();if(!n)throw new Error("Transform constraint data name must not be null.");let r=new Jt(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.bones[s.readInt(!0)],r.local=s.readBoolean(),r.relative=s.readBoolean(),r.offsetRotation=s.readFloat(),r.offsetX=s.readFloat()*e,r.offsetY=s.readFloat()*e,r.offsetScaleX=s.readFloat(),r.offsetScaleY=s.readFloat(),r.offsetShearY=s.readFloat(),r.mixRotate=s.readFloat(),r.mixX=s.readFloat(),r.mixY=s.readFloat(),r.mixScaleX=s.readFloat(),r.mixScaleY=s.readFloat(),r.mixShearY=s.readFloat(),i.transformConstraints.push(r)}h=s.readInt(!0);for(let t,n=0;n<h;n++){let n=s.readString();if(!n)throw new Error("Path constraint data name must not be null.");let r=new Gt(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.slots[s.readInt(!0)],r.positionMode=s.readInt(!0),r.spacingMode=s.readInt(!0),r.rotateMode=s.readInt(!0),r.offsetRotation=s.readFloat(),r.position=s.readFloat(),r.positionMode==yt.Fixed&&(r.position*=e),r.spacing=s.readFloat(),r.spacingMode!=xt.Length&&r.spacingMode!=xt.Fixed||(r.spacing*=e),r.mixRotate=s.readFloat(),r.mixX=s.readFloat(),r.mixY=s.readFloat(),i.pathConstraints.push(r)}let l=this.readSkin(s,i,!0,o);l&&(i.defaultSkin=l,i.skins.push(l));{let t=i.skins.length;for(u.setArraySize(i.skins,h=t+s.readInt(!0));t<h;t++){let e=this.readSkin(s,i,!1,o);if(!e)throw new Error("readSkin() should not have returned null.");i.skins[t]=e}}h=this.linkedMeshes.length;for(let t=0;t<h;t++){let e=this.linkedMeshes[t],s=e.skin?i.findSkin(e.skin):i.defaultSkin;if(!s)throw new Error("Not skin found for linked mesh.");if(!e.parent)throw new Error("Linked mesh parent must not be null");let n=s.getAttachment(e.slotIndex,e.parent);if(!n)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?n:e.mesh,e.mesh.setParentMesh(n),null!=e.mesh.region&&e.mesh.updateRegion()}this.linkedMeshes.length=0,h=s.readInt(!0);for(let t=0;t<h;t++){let t=s.readStringRef();if(!t)throw new Error;let e=new Xt(t);e.intValue=s.readInt(!1),e.floatValue=s.readFloat(),e.stringValue=s.readString(),e.audioPath=s.readString(),e.audioPath&&(e.volume=s.readFloat(),e.balance=s.readFloat()),i.events.push(e)}h=s.readInt(!0);for(let t=0;t<h;t++){let t=s.readString();if(!t)throw new Error("Animatio name must not be null.");i.animations.push(this.readAnimation(s,t,i))}return i}readSkin(t,e,i,s){let n=null,r=0;if(i){if(r=t.readInt(!0),0==r)return null;n=new Zt("default")}else{let i=t.readStringRef();if(!i)throw new Error("Skin name must not be null.");n=new Zt(i),n.bones.length=t.readInt(!0);for(let i=0,s=n.bones.length;i<s;i++)n.bones[i]=e.bones[t.readInt(!0)];for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);r=t.readInt(!0)}for(let i=0;i<r;i++){let i=t.readInt(!0);for(let r=0,a=t.readInt(!0);r<a;r++){let r=t.readStringRef();if(!r)throw new Error("Attachment name must not be null");let a=this.readAttachment(t,e,n,i,r,s);a&&n.setAttachment(i,r,a)}}return n}readAttachment(t,e,i,s,n,a){let o=this.scale,h=t.readStringRef();switch(h||(h=n),t.readByte()){case Tt.Region:{let e=t.readStringRef(),s=t.readFloat(),n=t.readFloat(),a=t.readFloat(),l=t.readFloat(),u=t.readFloat(),c=t.readFloat(),d=t.readFloat(),f=t.readInt32(),p=this.readSequence(t);e||(e=h);let g=this.attachmentLoader.newRegionAttachment(i,h,e,p);return g?(g.path=e,g.x=n*o,g.y=a*o,g.scaleX=l,g.scaleY=u,g.rotation=s,g.width=c*o,g.height=d*o,r.rgba8888ToColor(g.color,f),g.sequence=p,null==p&&g.updateRegion(),g):null}case Tt.BoundingBox:{let e=t.readInt(!0),s=this.readVertices(t,e),n=a?t.readInt32():0,o=this.attachmentLoader.newBoundingBoxAttachment(i,h);return o?(o.worldVerticesLength=e<<1,o.vertices=s.vertices,o.bones=s.bones,a&&r.rgba8888ToColor(o.color,n),o):null}case Tt.Mesh:{let e=t.readStringRef(),s=t.readInt32(),n=t.readInt(!0),l=this.readFloatArray(t,n<<1,1),u=this.readShortArray(t),c=this.readVertices(t,n),d=t.readInt(!0),f=this.readSequence(t),p=[],g=0,m=0;a&&(p=this.readShortArray(t),g=t.readFloat(),m=t.readFloat()),e||(e=h);let v=this.attachmentLoader.newMeshAttachment(i,h,e,f);return v?(v.path=e,r.rgba8888ToColor(v.color,s),v.bones=c.bones,v.vertices=c.vertices,v.worldVerticesLength=n<<1,v.triangles=u,v.regionUVs=l,null==f&&v.updateRegion(),v.hullLength=d<<1,v.sequence=f,a&&(v.edges=p,v.width=g*o,v.height=m*o),v):null}case Tt.LinkedMesh:{let e=t.readStringRef(),n=t.readInt32(),l=t.readStringRef(),u=t.readStringRef(),c=t.readBoolean(),d=this.readSequence(t),f=0,p=0;a&&(f=t.readFloat(),p=t.readFloat()),e||(e=h);let g=this.attachmentLoader.newMeshAttachment(i,h,e,d);return g?(g.path=e,r.rgba8888ToColor(g.color,n),g.sequence=d,a&&(g.width=f*o,g.height=p*o),this.linkedMeshes.push(new ee(g,l,s,u,c)),g):null}case Tt.Path:{let e=t.readBoolean(),s=t.readBoolean(),n=t.readInt(!0),l=this.readVertices(t,n),c=u.newArray(n/3,0);for(let e=0,i=c.length;e<i;e++)c[e]=t.readFloat()*o;let d=a?t.readInt32():0,f=this.attachmentLoader.newPathAttachment(i,h);return f?(f.closed=e,f.constantSpeed=s,f.worldVerticesLength=n<<1,f.vertices=l.vertices,f.bones=l.bones,f.lengths=c,a&&r.rgba8888ToColor(f.color,d),f):null}case Tt.Point:{let e=t.readFloat(),s=t.readFloat(),n=t.readFloat(),l=a?t.readInt32():0,u=this.attachmentLoader.newPointAttachment(i,h);return u?(u.x=s*o,u.y=n*o,u.rotation=e,a&&r.rgba8888ToColor(u.color,l),u):null}case Tt.Clipping:{let s=t.readInt(!0),n=t.readInt(!0),o=this.readVertices(t,n),l=a?t.readInt32():0,u=this.attachmentLoader.newClippingAttachment(i,h);return u?(u.endSlot=e.slots[s],u.worldVerticesLength=n<<1,u.vertices=o.vertices,u.bones=o.bones,a&&r.rgba8888ToColor(u.color,l),u):null}}return null}readSequence(t){if(!t.readBoolean())return null;let e=new y(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){let i=this.scale,s=e<<1,n=new ie;if(!t.readBoolean())return n.vertices=this.readFloatArray(t,s,i),n;let r=new Array,a=new Array;for(let s=0;s<e;s++){let e=t.readInt(!0);a.push(e);for(let s=0;s<e;s++)a.push(t.readInt(!0)),r.push(t.readFloat()*i),r.push(t.readFloat()*i),r.push(t.readFloat())}return n.vertices=u.toFloatArray(r),n.bones=a,n}readFloatArray(t,e,i){let s=new Array(e);if(1==i)for(let i=0;i<e;i++)s[i]=t.readFloat();else for(let n=0;n<e;n++)s[n]=t.readFloat()*i;return s}readShortArray(t){let e=t.readInt(!0),i=new Array(e);for(let s=0;s<e;s++)i[s]=t.readShort();return i}readAnimation(t,e,i){t.readInt(!0);let s=new Array,n=this.scale;new r,new r;for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0);for(let i=0,n=t.readInt(!0);i<n;i++){let i=t.readByte(),n=t.readInt(!0),r=n-1;switch(i){case me:{let i=new G(n,e);for(let e=0;e<n;e++)i.setFrame(e,t.readFloat(),t.readStringRef());s.push(i);break}case ve:{let i=t.readInt(!0),a=new N(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,u,c),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;switch(t.readByte()){case Me:a.setStepped(e);break;case _e:re(t,a,i++,e,0,o,s,h,n,1),re(t,a,i++,e,1,o,s,l,r,1),re(t,a,i++,e,2,o,s,u,d,1),re(t,a,i++,e,3,o,s,c,f,1)}o=s,h=n,l=r,u=d,c=f}s.push(a);break}case ye:{let i=t.readInt(!0),a=new Y(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,u),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255;switch(t.readByte()){case Me:a.setStepped(e);break;case _e:re(t,a,i++,e,0,o,s,h,n,1),re(t,a,i++,e,1,o,s,l,r,1),re(t,a,i++,e,2,o,s,u,c,1)}o=s,h=n,l=r,u=c}s.push(a);break}case xe:{let i=t.readInt(!0),a=new U(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,u,c,d,f,p),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255,y=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255;switch(t.readByte()){case Me:a.setStepped(e);break;case _e:re(t,a,i++,e,0,o,s,h,n,1),re(t,a,i++,e,1,o,s,l,r,1),re(t,a,i++,e,2,o,s,u,g,1),re(t,a,i++,e,3,o,s,c,m,1),re(t,a,i++,e,4,o,s,d,v,1),re(t,a,i++,e,5,o,s,f,y,1),re(t,a,i++,e,6,o,s,p,x,1)}o=s,h=n,l=r,u=g,c=m,d=v,f=y,p=x}s.push(a);break}case we:{let i=t.readInt(!0),a=new z(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,u,c,d,f),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255;switch(t.readByte()){case Me:a.setStepped(e);break;case _e:re(t,a,i++,e,0,o,s,h,n,1),re(t,a,i++,e,1,o,s,l,r,1),re(t,a,i++,e,2,o,s,u,p,1),re(t,a,i++,e,3,o,s,c,g,1),re(t,a,i++,e,4,o,s,d,m,1),re(t,a,i++,e,5,o,s,f,v,1)}o=s,h=n,l=r,u=p,c=g,d=m,f=v}s.push(a);break}case be:{let i=new X(n,t.readInt(!0),e),a=t.readFloat(),o=t.readUnsignedByte()/255;for(let e=0,s=0;i.setFrame(e,a,o),e!=r;e++){let n=t.readFloat(),r=t.readUnsignedByte()/255;switch(t.readByte()){case Me:i.setStepped(e);break;case _e:re(t,i,s++,e,0,a,n,o,r,1)}a=n,o=r}s.push(i)}}}}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0);for(let i=0,r=t.readInt(!0);i<r;i++){let i=t.readByte(),r=t.readInt(!0),a=t.readInt(!0);switch(i){case ae:s.push(se(t,new _(r,a,e),1));break;case oe:s.push(ne(t,new R(r,a,e),n));break;case he:s.push(se(t,new P(r,a,e),n));break;case le:s.push(se(t,new L(r,a,e),n));break;case ue:s.push(ne(t,new F(r,a,e),1));break;case ce:s.push(se(t,new O(r,a,e),1));break;case de:s.push(se(t,new D(r,a,e),1));break;case fe:s.push(ne(t,new k(r,a,e),1));break;case pe:s.push(se(t,new I(r,a,e),1));break;case ge:s.push(se(t,new B(r,a,e),1))}}}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0),i=t.readInt(!0),r=i-1,a=new j(i,t.readInt(!0),e),o=t.readFloat(),h=t.readFloat(),l=t.readFloat()*n;for(let e=0,i=0;a.setFrame(e,o,h,l,t.readByte(),t.readBoolean(),t.readBoolean()),e!=r;e++){let s=t.readFloat(),r=t.readFloat(),u=t.readFloat()*n;switch(t.readByte()){case Me:a.setStepped(e);break;case _e:re(t,a,i++,e,0,o,s,h,r,1),re(t,a,i++,e,1,o,s,l,u,n)}o=s,h=r,l=u}s.push(a)}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0),i=t.readInt(!0),n=i-1,r=new q(i,t.readInt(!0),e),a=t.readFloat(),o=t.readFloat(),h=t.readFloat(),l=t.readFloat(),u=t.readFloat(),c=t.readFloat(),d=t.readFloat();for(let e=0,i=0;r.setFrame(e,a,o,h,l,u,c,d),e!=n;e++){let s=t.readFloat(),n=t.readFloat(),f=t.readFloat(),p=t.readFloat(),g=t.readFloat(),m=t.readFloat(),v=t.readFloat();switch(t.readByte()){case Me:r.setStepped(e);break;case _e:re(t,r,i++,e,0,a,s,o,n,1),re(t,r,i++,e,1,a,s,h,f,1),re(t,r,i++,e,2,a,s,l,p,1),re(t,r,i++,e,3,a,s,u,g,1),re(t,r,i++,e,4,a,s,c,m,1),re(t,r,i++,e,5,a,s,d,v,1)}a=s,o=n,h=f,l=p,u=g,c=m,d=v}s.push(r)}for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0),r=i.pathConstraints[e];for(let i=0,a=t.readInt(!0);i<a;i++)switch(t.readByte()){case Ee:s.push(se(t,new K(t.readInt(!0),t.readInt(!0),e),r.positionMode==yt.Fixed?n:1));break;case Ae:s.push(se(t,new Z(t.readInt(!0),t.readInt(!0),e),r.spacingMode==xt.Length||r.spacingMode==xt.Fixed?n:1));break;case Ce:let i=new Q(t.readInt(!0),t.readInt(!0),e),a=t.readFloat(),o=t.readFloat(),h=t.readFloat(),l=t.readFloat();for(let e=0,s=0,n=i.getFrameCount()-1;i.setFrame(e,a,o,h,l),e!=n;e++){let n=t.readFloat(),r=t.readFloat(),u=t.readFloat(),c=t.readFloat();switch(t.readByte()){case Me:i.setStepped(e);break;case _e:re(t,i,s++,e,0,a,n,o,r,1),re(t,i,s++,e,1,a,n,h,u,1),re(t,i,s++,e,2,a,n,l,c,1)}a=n,o=r,h=u,l=c}s.push(i)}}for(let e=0,r=t.readInt(!0);e<r;e++){let e=i.skins[t.readInt(!0)];for(let i=0,r=t.readInt(!0);i<r;i++){let i=t.readInt(!0);for(let r=0,a=t.readInt(!0);r<a;r++){let r=t.readStringRef();if(!r)throw new Error("attachmentName must not be null.");let a=e.getAttachment(i,r),o=t.readByte(),h=t.readInt(!0),l=h-1;switch(o){case Te:{let e=a,r=e.bones,o=e.vertices,c=r?o.length/3*2:o.length,d=t.readInt(!0),f=new V(h,d,i,e),p=t.readFloat();for(let e=0,i=0;;e++){let s,a=t.readInt(!0);if(0==a)s=r?u.newFloatArray(c):o;else{s=u.newFloatArray(c);let e=t.readInt(!0);if(a+=e,1==n)for(let i=e;i<a;i++)s[i]=t.readFloat();else for(let i=e;i<a;i++)s[i]=t.readFloat()*n;if(!r)for(let t=0,e=s.length;t<e;t++)s[t]+=o[t]}if(f.setFrame(e,p,s),e==l)break;let h=t.readFloat();switch(t.readByte()){case Me:f.setStepped(e);break;case _e:re(t,f,i++,e,0,p,h,0,1,1)}p=h}s.push(f);break}case Se:{let e=new J(h,i,a);for(let i=0;i<h;i++){let s=t.readFloat(),n=t.readInt32();e.setFrame(i,s,w[15&n],n>>4,t.readFloat())}s.push(e);break}}}}}let a=t.readInt(!0);if(a>0){let e=new H(a),n=i.slots.length;for(let i=0;i<a;i++){let s=t.readFloat(),r=t.readInt(!0),a=u.newArray(n,0);for(let t=n-1;t>=0;t--)a[t]=-1;let o=u.newArray(n-r,0),h=0,l=0;for(let e=0;e<r;e++){let e=t.readInt(!0);for(;h!=e;)o[l++]=h++;a[h+t.readInt(!0)]=h++}for(;h<n;)o[l++]=h++;for(let t=n-1;t>=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let o=t.readInt(!0);if(o>0){let e=new W(o);for(let s=0;s<o;s++){let n=t.readFloat(),r=i.events[t.readInt(!0)],a=new Yt(n,r);a.intValue=t.readInt(!1),a.floatValue=t.readFloat(),a.stringValue=t.readBoolean()?t.readString():r.stringValue,a.data.audioPath&&(a.volume=t.readFloat(),a.balance=t.readFloat()),e.setFrame(s,a)}s.push(e)}let h=0;for(let t=0,e=s.length;t<e;t++)h=Math.max(h,s[t].getDuration());return new b(e,s,h)}}class te{strings;index;buffer;constructor(t,e=new Array,i=0,s=new DataView(t.buffer)){this.strings=e,this.index=i,this.buffer=s}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),i=127&e;return 128&e&&(e=this.readByte(),i|=(127&e)<<7,128&e&&(e=this.readByte(),i|=(127&e)<<14,128&e&&(e=this.readByte(),i|=(127&e)<<21,128&e&&(e=this.readByte(),i|=(127&e)<<28)))),t?i:i>>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i<t;){let t=this.readUnsignedByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}}class ee{parent;skin;slotIndex;mesh;inheritTimeline;constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}}class ie{bones;vertices;constructor(t=null,e=null){this.bones=t,this.vertices=e}}function se(t,e,i){let s=t.readFloat(),n=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,s,n),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case Me:e.setStepped(r);break;case _e:re(t,e,a++,r,0,s,o,n,h,i)}s=o,n=h}return e}function ne(t,e,i){let s=t.readFloat(),n=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,n,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,u=t.readFloat()*i;switch(t.readByte()){case Me:e.setStepped(a);break;case _e:re(t,e,o++,a,0,s,h,n,l,i),re(t,e,o++,a,1,s,h,r,u,i)}s=h,n=l,r=u}return e}function re(t,e,i,s,n,r,a,o,h,l){e.setBezier(i,s,n,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Tt||(Tt={}));const ae=0,oe=1,he=2,le=3,ue=4,ce=5,de=6,fe=7,pe=8,ge=9,me=0,ve=1,ye=2,xe=3,we=4,be=5,Te=0,Se=1,Ee=0,Ae=1,Ce=2,Me=1,_e=2;class Re{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new d((()=>u.newFloatArray(16)));update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,n=this.polygonPool,r=t.slots,a=r.length;i.length=0,n.freeAll(s),s.length=0;for(let t=0;t<a;t++){let e=r[t];if(!e.bone.active)continue;let a=e.getAttachment();if(a instanceof dt){let t=a;i.push(t);let r=n.obtain();r.length!=t.worldVerticesLength&&(r=u.newFloatArray(t.worldVerticesLength)),s.push(r),t.computeWorldVertices(e,0,t.worldVerticesLength,r,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,n=this.polygons;for(let r=0,a=n.length;r<a;r++){let a=n[r],o=a;for(let n=0,r=a.length;n<r;n+=2){let r=o[n],a=o[n+1];t=Math.min(t,r),e=Math.min(e,a),i=Math.max(i,r),s=Math.max(s,a)}}this.minX=t,this.minY=e,this.maxX=i,this.maxY=s}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let n=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=n&&i<=n||e<=r&&s<=r||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(n-t)+e;if(l>r&&l<o)return!0;if(l=h*(a-t)+e,l>r&&l<o)return!0;let u=(r-e)/h+t;return u>n&&u<a||(u=(o-e)/h+t,u>n&&u<a)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,n=i.length;s<n;s++)if(this.containsPointPolygon(i[s],t,e))return this.boundingBoxes[s];return null}containsPointPolygon(t,e,i){let s=t,n=t.length,r=n-2,a=!1;for(let t=0;t<n;t+=2){let n=s[t+1],o=s[r+1];if(n<i&&o>=i||o<i&&n>=i){let h=s[t];h+(i-n)/(o-n)*(s[r]-h)<e&&(a=!a)}r=t}return a}intersectsSegment(t,e,i,s){let n=this.polygons;for(let r=0,a=n.length;r<a;r++)if(this.intersectsSegmentPolygon(n[r],t,e,i,s))return this.boundingBoxes[r];return null}intersectsSegmentPolygon(t,e,i,s,n){let r=t,a=t.length,o=e-s,h=i-n,l=e*n-i*s,u=r[a-2],c=r[a-1];for(let t=0;t<a;t+=2){let a=r[t],d=r[t+1],f=u*d-c*a,p=u-a,g=c-d,m=o*g-h*p,v=(l*p-o*f)/m;if((v>=u&&v<=a||v>=a&&v<=u)&&(v>=e&&v<=s||v>=s&&v<=e)){let t=(l*g-h*f)/m;if((t>=c&&t<=d||t>=d&&t<=c)&&(t>=i&&t<=n||t>=n&&t<=i))return!0}u=a,c=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class Pe{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new d((()=>new Array));polygonIndicesPool=new d((()=>new Array));triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t<i;t++)s[t]=t;let n=this.isConcaveArray;n.length=0;for(let t=0,r=i;t<r;++t)n[t]=Pe.isConcave(t,i,e,s);let r=this.triangles;for(r.length=0;i>3;){let t=i-1,a=0,o=1;for(;;){t:if(!n[a]){let r=s[t]<<1,h=s[a]<<1,l=s[o]<<1,u=e[r],c=e[r+1],d=e[h],f=e[h+1],p=e[l],g=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=s[r]<<1,i=e[t],a=e[t+1];if(Pe.positiveArea(p,g,u,c,i,a)&&Pe.positiveArea(u,c,d,f,i,a)&&Pe.positiveArea(d,f,p,g,i,a))break t}break}if(0==o){do{if(!n[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(s[(i+a-1)%i]),r.push(s[a]),r.push(s[(a+1)%i]),s.splice(a,1),n.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;n[h]=Pe.isConcave(h,i,e,s),n[l]=Pe.isConcave(l,i,e,s)}return 3==i&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t<l;t+=3){let l=e[t]<<1,u=e[t+1]<<1,c=e[t+2]<<1,d=i[l],f=i[l+1],p=i[u],g=i[u+1],m=i[c],v=i[c+1],y=!1;if(o==l){let t=a.length-4,e=Pe.winding(a[t],a[t+1],a[t+2],a[t+3],m,v),i=Pe.winding(m,v,a[0],a[1],a[2],a[3]);e==h&&i==h&&(a.push(m),a.push(v),r.push(c),y=!0)}y||(a.length>0?(s.push(a),n.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(g),a.push(m),a.push(v),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(u),r.push(c),h=Pe.winding(d,f,p,g,m,v),o=l)}a.length>0&&(s.push(a),n.push(r));for(let t=0,e=s.length;t<e;t++){if(r=n[t],0==r.length)continue;let i=r[0],o=r[r.length-1];a=s[t];let h=a.length-4,l=a[h],u=a[h+1],c=a[h+2],d=a[h+3],f=a[0],p=a[1],g=a[2],m=a[3],v=Pe.winding(l,u,c,d,f,p);for(let h=0;h<e;h++){if(h==t)continue;let e=n[h];if(3!=e.length)continue;let y=e[0],x=e[1],w=e[2],b=s[h],T=b[b.length-2],S=b[b.length-1];if(y!=i||x!=o)continue;let E=Pe.winding(l,u,c,d,T,S),A=Pe.winding(T,S,f,p,g,m);E==v&&A==v&&(b.length=0,e.length=0,a.push(T),a.push(S),r.push(w),l=c,u=d,c=T,d=S,h=0)}}for(let t=s.length-1;t>=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,i,s){let n=s[(e+t-1)%e]<<1,r=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[n],i[n+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,s,n,r){return t*(r-s)+i*(e-r)+n*(s-e)>=0}static winding(t,e,i,s,n,r){let a=i-t,o=s-e;return n*o-r*a+a*e-t*o>=0?1:-1}}class Le{triangulator=new Pe;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=u.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let n=this.clippingPolygon;Le.makeClockwise(n);let r=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,e=r.length;t<e;t++){let e=r[t];Le.makeClockwise(e),e.push(e[0]),e.push(e[1])}return r.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return null!=this.clipAttachment}clipTriangles(t,e,i,s,n,r,a,o){let h=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,d=this.clippingPolygons,f=d.length,p=o?12:8,g=0;l.length=0,c.length=0;t:for(let e=0;e<s;e+=3){let s=i[e]<<1,m=t[s],v=t[s+1],y=n[s],x=n[s+1];s=i[e+1]<<1;let w=t[s],b=t[s+1],T=n[s],S=n[s+1];s=i[e+2]<<1;let E=t[s],A=t[s+1],C=n[s],M=n[s+1];for(let t=0;t<f;t++){let e=l.length;if(!this.clip(m,v,w,b,E,A,d[t],h)){let t=u.setArraySize(l,e+3*p);t[e]=m,t[e+1]=v,t[e+2]=r.r,t[e+3]=r.g,t[e+4]=r.b,t[e+5]=r.a,o?(t[e+6]=y,t[e+7]=x,t[e+8]=a.r,t[e+9]=a.g,t[e+10]=a.b,t[e+11]=a.a,t[e+12]=w,t[e+13]=b,t[e+14]=r.r,t[e+15]=r.g,t[e+16]=r.b,t[e+17]=r.a,t[e+18]=T,t[e+19]=S,t[e+20]=a.r,t[e+21]=a.g,t[e+22]=a.b,t[e+23]=a.a,t[e+24]=E,t[e+25]=A,t[e+26]=r.r,t[e+27]=r.g,t[e+28]=r.b,t[e+29]=r.a,t[e+30]=C,t[e+31]=M,t[e+32]=a.r,t[e+33]=a.g,t[e+34]=a.b,t[e+35]=a.a):(t[e+6]=y,t[e+7]=x,t[e+8]=w,t[e+9]=b,t[e+10]=r.r,t[e+11]=r.g,t[e+12]=r.b,t[e+13]=r.a,t[e+14]=T,t[e+15]=S,t[e+16]=E,t[e+17]=A,t[e+18]=r.r,t[e+19]=r.g,t[e+20]=r.b,t[e+21]=r.a,t[e+22]=C,t[e+23]=M),e=c.length;let i=u.setArraySize(c,e+3);i[e]=g,i[e+1]=g+1,i[e+2]=g+2,g+=3;continue t}{let t=h.length;if(0==t)continue;let i=b-A,s=E-w,n=m-E,d=A-v,f=1/(i*n+s*(v-A)),_=t>>1,R=this.clipOutput,P=u.setArraySize(l,e+_*p);for(let h=0;h<t;h+=2){let t=R[h],l=R[h+1];P[e]=t,P[e+1]=l,P[e+2]=r.r,P[e+3]=r.g,P[e+4]=r.b,P[e+5]=r.a;let u=t-E,c=l-A,g=(i*u+s*c)*f,m=(d*u+n*c)*f,v=1-g-m;P[e+6]=y*g+T*m+C*v,P[e+7]=x*g+S*m+M*v,o&&(P[e+8]=a.r,P[e+9]=a.g,P[e+10]=a.b,P[e+11]=a.a),e+=p}e=c.length;let L=u.setArraySize(c,e+3*(_-2));_--;for(let t=1;t<_;t++)L[e]=g,L[e+1]=g+t,L[e+2]=g+t+1,e+=3;g+=_+1}}}}clip(t,e,i,s,n,r,a,o){let h,l=o,u=!1;a.length%4>=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(n),h.push(r),h.push(t),h.push(e),o.length=0;let c=a,d=a.length-4;for(let t=0;;t+=2){let e=c[t],i=c[t+1],s=c[t+2],n=c[t+3],r=e-s,a=i-n,f=h,p=h.length-2,g=o.length;for(let t=0;t<p;t+=2){let h=f[t],l=f[t+1],c=f[t+2],d=f[t+3],p=r*(d-n)-a*(c-s)>0;if(r*(l-n)-a*(h-s)>0){if(p){o.push(c),o.push(d);continue}let t=d-l,r=c-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let u=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*u),o.push(i+(n-i)*u)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=c-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let u=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*u),o.push(i+(n-i)*u)}else o.push(e),o.push(i);o.push(c),o.push(d)}u=!0}if(g==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let m=o;(o=h).length=0,h=m}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t<e;t++)l[t]=o[t]}else l.length=l.length-2;return u}static makeClockwise(t){let e=t,i=t.length,s=e[i-2]*e[1]-e[0]*e[i-1],n=0,r=0,a=0,o=0;for(let t=0,h=i-3;t<h;t+=2)n=e[t],r=e[t+1],a=e[t+2],o=e[t+3],s+=n*o-a*r;if(!(s<0))for(let t=0,s=i-2,n=i>>1;t<n;t+=2){let i=e[t],n=e[t+1],r=s-t;e[t]=e[r],e[t+1]=e[r+1],e[r]=i,e[r+1]=n}}}class Fe{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new qt,s="string"==typeof t?JSON.parse(t):t,n=s.skeleton;if(n&&(i.hash=n.hash,i.version=n.spine,i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height,i.fps=n.fps,i.imagesPath=n.images),s.bones)for(let t=0;t<s.bones.length;t++){let n=s.bones[t],r=null,a=Be(n,"parent",null);a&&(r=i.findBone(a));let o=new Dt(i.bones.length,n.name,r);o.length=Be(n,"length",0)*e,o.x=Be(n,"x",0)*e,o.y=Be(n,"y",0)*e,o.rotation=Be(n,"rotation",0),o.scaleX=Be(n,"scaleX",1),o.scaleY=Be(n,"scaleY",1),o.shearX=Be(n,"shearX",0),o.shearY=Be(n,"shearY",0),o.transformMode=u.enumValue(vt,Be(n,"transform","Normal")),o.skinRequired=Be(n,"skin",!1);let h=Be(n,"color",null);h&&o.color.setFromString(h),i.bones.push(o)}if(s.slots)for(let t=0;t<s.slots.length;t++){let e=s.slots[t],n=i.findBone(e.bone);if(!n)throw new Error(`Couldn't find bone ${e.bone} for slot ${e.name}`);let a=new Qt(i.slots.length,e.name,n),o=Be(e,"color",null);o&&a.color.setFromString(o);let h=Be(e,"dark",null);h&&(a.darkColor=r.fromString(h)),a.attachmentName=Be(e,"attachment",null),a.blendMode=u.enumValue(bt,Be(e,"blend","normal")),i.slots.push(a)}if(s.ik)for(let t=0;t<s.ik.length;t++){let n=s.ik[t],r=new zt(n.name);r.order=Be(n,"order",0),r.skinRequired=Be(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=i.findBone(n.bones[t]);if(!e)throw new Error(`Couldn't find bone ${n.bones[t]} for IK constraint ${n.name}.`);r.bones.push(e)}let a=i.findBone(n.target);if(!a)throw new Error(`Couldn't find target bone ${n.target} for IK constraint ${n.name}.`);r.target=a,r.mix=Be(n,"mix",1),r.softness=Be(n,"softness",0)*e,r.bendDirection=Be(n,"bendPositive",!0)?1:-1,r.compress=Be(n,"compress",!1),r.stretch=Be(n,"stretch",!1),r.uniform=Be(n,"uniform",!1),i.ikConstraints.push(r)}if(s.transform)for(let t=0;t<s.transform.length;t++){let n=s.transform[t],r=new Jt(n.name);r.order=Be(n,"order",0),r.skinRequired=Be(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=n.bones[t],s=i.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for transform constraint ${n.name}.`);r.bones.push(s)}let a=n.target,o=i.findBone(a);if(!o)throw new Error(`Couldn't find target bone ${a} for transform constraint ${n.name}.`);r.target=o,r.local=Be(n,"local",!1),r.relative=Be(n,"relative",!1),r.offsetRotation=Be(n,"rotation",0),r.offsetX=Be(n,"x",0)*e,r.offsetY=Be(n,"y",0)*e,r.offsetScaleX=Be(n,"scaleX",0),r.offsetScaleY=Be(n,"scaleY",0),r.offsetShearY=Be(n,"shearY",0),r.mixRotate=Be(n,"mixRotate",1),r.mixX=Be(n,"mixX",1),r.mixY=Be(n,"mixY",r.mixX),r.mixScaleX=Be(n,"mixScaleX",1),r.mixScaleY=Be(n,"mixScaleY",r.mixScaleX),r.mixShearY=Be(n,"mixShearY",1),i.transformConstraints.push(r)}if(s.path)for(let t=0;t<s.path.length;t++){let n=s.path[t],r=new Gt(n.name);r.order=Be(n,"order",0),r.skinRequired=Be(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=n.bones[t],s=i.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for path constraint ${n.name}.`);r.bones.push(s)}let a=n.target,o=i.findSlot(a);if(!o)throw new Error(`Couldn't find target slot ${a} for path constraint ${n.name}.`);r.target=o,r.positionMode=u.enumValue(yt,Be(n,"positionMode","Percent")),r.spacingMode=u.enumValue(xt,Be(n,"spacingMode","Length")),r.rotateMode=u.enumValue(wt,Be(n,"rotateMode","Tangent")),r.offsetRotation=Be(n,"rotation",0),r.position=Be(n,"position",0),r.positionMode==yt.Fixed&&(r.position*=e),r.spacing=Be(n,"spacing",0),r.spacingMode!=xt.Length&&r.spacingMode!=xt.Fixed||(r.spacing*=e),r.mixRotate=Be(n,"mixRotate",1),r.mixX=Be(n,"mixX",1),r.mixY=Be(n,"mixY",r.mixX),i.pathConstraints.push(r)}if(s.skins)for(let t=0;t<s.skins.length;t++){let e=s.skins[t],n=new Zt(e.name);if(e.bones)for(let t=0;t<e.bones.length;t++){let s=e.bones[t],r=i.findBone(s);if(!r)throw new Error(`Couldn't find bone ${s} for skin ${e.name}.`);n.bones.push(r)}if(e.ik)for(let t=0;t<e.ik.length;t++){let s=e.ik[t],r=i.findIkConstraint(s);if(!r)throw new Error(`Couldn't find IK constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}if(e.transform)for(let t=0;t<e.transform.length;t++){let s=e.transform[t],r=i.findTransformConstraint(s);if(!r)throw new Error(`Couldn't find transform constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}if(e.path)for(let t=0;t<e.path.length;t++){let s=e.path[t],r=i.findPathConstraint(s);if(!r)throw new Error(`Couldn't find path constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}for(let t in e.attachments){let s=i.findSlot(t);if(!s)throw new Error(`Couldn't find slot ${t} for skin ${e.name}.`);let r=e.attachments[t];for(let t in r){let e=this.readAttachment(r[t],n,s.index,t,i);e&&n.setAttachment(s.index,t,e)}}i.skins.push(n),"default"==n.name&&(i.defaultSkin=n)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=e.skin?i.findSkin(e.skin):i.defaultSkin;if(!s)throw new Error(`Skin not found: ${e.skin}`);let n=s.getAttachment(e.slotIndex,e.parent);if(!n)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?n:e.mesh,e.mesh.setParentMesh(n),null!=e.mesh.region&&e.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(let t in s.events){let e=s.events[t],n=new Xt(t);n.intValue=Be(e,"int",0),n.floatValue=Be(e,"float",0),n.stringValue=Be(e,"string",""),n.audioPath=Be(e,"audio",null),n.audioPath&&(n.volume=Be(e,"volume",1),n.balance=Be(e,"balance",0)),i.events.push(n)}if(s.animations)for(let t in s.animations){let e=s.animations[t];this.readAnimation(e,t,i)}return i}readAttachment(t,e,i,s,n){let r=this.scale;switch(s=Be(t,"name",s),Be(t,"type","region")){case"region":{let i=Be(t,"path",s),n=this.readSequence(Be(t,"sequence",null)),a=this.attachmentLoader.newRegionAttachment(e,s,i,n);if(!a)return null;a.path=i,a.x=Be(t,"x",0)*r,a.y=Be(t,"y",0)*r,a.scaleX=Be(t,"scaleX",1),a.scaleY=Be(t,"scaleY",1),a.rotation=Be(t,"rotation",0),a.width=t.width*r,a.height=t.height*r,a.sequence=n;let o=Be(t,"color",null);return o&&a.color.setFromString(o),null!=a.region&&a.updateRegion(),a}case"boundingbox":{let i=this.attachmentLoader.newBoundingBoxAttachment(e,s);if(!i)return null;this.readVertices(t,i,t.vertexCount<<1);let n=Be(t,"color",null);return n&&i.color.setFromString(n),i}case"mesh":case"linkedmesh":{let n=Be(t,"path",s),a=this.readSequence(Be(t,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(e,s,n,a);if(!o)return null;o.path=n;let h=Be(t,"color",null);h&&o.color.setFromString(h),o.width=Be(t,"width",0)*r,o.height=Be(t,"height",0)*r,o.sequence=a;let l=Be(t,"parent",null);if(l)return this.linkedMeshes.push(new Oe(o,Be(t,"skin",null),i,l,Be(t,"timelines",!0))),o;let u=t.uvs;return this.readVertices(t,o,u.length),o.triangles=t.triangles,o.regionUVs=u,null!=o.region&&o.updateRegion(),o.edges=Be(t,"edges",null),o.hullLength=2*Be(t,"hull",0),o}case"path":{let i=this.attachmentLoader.newPathAttachment(e,s);if(!i)return null;i.closed=Be(t,"closed",!1),i.constantSpeed=Be(t,"constantSpeed",!0);let n=t.vertexCount;this.readVertices(t,i,n<<1);let a=u.newArray(n/3,0);for(let e=0;e<t.lengths.length;e++)a[e]=t.lengths[e]*r;i.lengths=a;let o=Be(t,"color",null);return o&&i.color.setFromString(o),i}case"point":{let i=this.attachmentLoader.newPointAttachment(e,s);if(!i)return null;i.x=Be(t,"x",0)*r,i.y=Be(t,"y",0)*r,i.rotation=Be(t,"rotation",0);let n=Be(t,"color",null);return n&&i.color.setFromString(n),i}case"clipping":{let i=this.attachmentLoader.newClippingAttachment(e,s);if(!i)return null;let r=Be(t,"end",null);r&&(i.endSlot=n.findSlot(r));let a=t.vertexCount;this.readVertices(t,i,a<<1);let o=Be(t,"color",null);return o&&i.color.setFromString(o),i}}return null}readSequence(t){if(null==t)return null;let e=new y(Be(t,"count",0));return e.start=Be(t,"start",1),e.digits=Be(t,"digits",0),e.setupIndex=Be(t,"setup",0),e}readVertices(t,e,i){let s=this.scale;e.worldVerticesLength=i;let n=t.vertices;if(i==n.length){let t=u.toFloatArray(n);if(1!=s)for(let e=0,i=n.length;e<i;e++)t[e]*=s;return void(e.vertices=t)}let r=new Array,a=new Array;for(let t=0,e=n.length;t<e;){let e=n[t++];a.push(e);for(let i=t+4*e;t<i;t+=4)a.push(n[t]),r.push(n[t+1]*s),r.push(n[t+2]*s),r.push(n[t+3])}e.bones=a,e.vertices=u.toFloatArray(r)}readAnimation(t,e,i){let s=this.scale,n=new Array;if(t.slots)for(let e in t.slots){let s=t.slots[e],a=i.findSlot(e);if(!a)throw new Error("Slot not found: "+e);let o=a.index;for(let t in s){let e=s[t];if(!e)continue;let i=e.length;if("attachment"==t){let t=new G(i,o);for(let s=0;s<i;s++){let i=e[s];t.setFrame(s,Be(i,"time",0),Be(i,"name",null))}n.push(t)}else if("rgba"==t){let t=new N(i,i<<2,o),s=e[0],a=Be(s,"time",0),h=r.fromString(s.color);for(let i=0,n=0;;i++){t.setFrame(i,a,h.r,h.g,h.b,h.a);let o=e[i+1];if(!o){t.shrink(n);break}let l=Be(o,"time",0),u=r.fromString(o.color),c=s.curve;c&&(n=Ie(c,t,n,i,0,a,l,h.r,u.r,1),n=Ie(c,t,n,i,1,a,l,h.g,u.g,1),n=Ie(c,t,n,i,2,a,l,h.b,u.b,1),n=Ie(c,t,n,i,3,a,l,h.a,u.a,1)),a=l,h=u,s=o}n.push(t)}else if("rgb"==t){let t=new Y(i,3*i,o),s=e[0],a=Be(s,"time",0),h=r.fromString(s.color);for(let i=0,n=0;;i++){t.setFrame(i,a,h.r,h.g,h.b);let o=e[i+1];if(!o){t.shrink(n);break}let l=Be(o,"time",0),u=r.fromString(o.color),c=s.curve;c&&(n=Ie(c,t,n,i,0,a,l,h.r,u.r,1),n=Ie(c,t,n,i,1,a,l,h.g,u.g,1),n=Ie(c,t,n,i,2,a,l,h.b,u.b,1)),a=l,h=u,s=o}n.push(t)}else if("alpha"==t)n.push(De(e,new X(i,i,o),0,1));else if("rgba2"==t){let t=new U(i,7*i,o),s=e[0],a=Be(s,"time",0),h=r.fromString(s.light),l=r.fromString(s.dark);for(let i=0,n=0;;i++){t.setFrame(i,a,h.r,h.g,h.b,h.a,l.r,l.g,l.b);let o=e[i+1];if(!o){t.shrink(n);break}let u=Be(o,"time",0),c=r.fromString(o.light),d=r.fromString(o.dark),f=s.curve;f&&(n=Ie(f,t,n,i,0,a,u,h.r,c.r,1),n=Ie(f,t,n,i,1,a,u,h.g,c.g,1),n=Ie(f,t,n,i,2,a,u,h.b,c.b,1),n=Ie(f,t,n,i,3,a,u,h.a,c.a,1),n=Ie(f,t,n,i,4,a,u,l.r,d.r,1),n=Ie(f,t,n,i,5,a,u,l.g,d.g,1),n=Ie(f,t,n,i,6,a,u,l.b,d.b,1)),a=u,h=c,l=d,s=o}n.push(t)}else if("rgb2"==t){let t=new z(i,6*i,o),s=e[0],a=Be(s,"time",0),h=r.fromString(s.light),l=r.fromString(s.dark);for(let i=0,n=0;;i++){t.setFrame(i,a,h.r,h.g,h.b,l.r,l.g,l.b);let o=e[i+1];if(!o){t.shrink(n);break}let u=Be(o,"time",0),c=r.fromString(o.light),d=r.fromString(o.dark),f=s.curve;f&&(n=Ie(f,t,n,i,0,a,u,h.r,c.r,1),n=Ie(f,t,n,i,1,a,u,h.g,c.g,1),n=Ie(f,t,n,i,2,a,u,h.b,c.b,1),n=Ie(f,t,n,i,3,a,u,l.r,d.r,1),n=Ie(f,t,n,i,4,a,u,l.g,d.g,1),n=Ie(f,t,n,i,5,a,u,l.b,d.b,1)),a=u,h=c,l=d,s=o}n.push(t)}}}if(t.bones)for(let e in t.bones){let r=t.bones[e],a=i.findBone(e);if(!a)throw new Error("Bone not found: "+e);let o=a.index;for(let t in r){let e=r[t],i=e.length;if(0!=i)if("rotate"===t)n.push(De(e,new _(i,i,o),0,1));else if("translate"===t){let t=new R(i,i<<1,o);n.push(ke(e,t,"x","y",0,s))}else if("translatex"===t){let t=new P(i,i,o);n.push(De(e,t,0,s))}else if("translatey"===t){let t=new L(i,i,o);n.push(De(e,t,0,s))}else if("scale"===t){let t=new F(i,i<<1,o);n.push(ke(e,t,"x","y",1,1))}else if("scalex"===t){let t=new O(i,i,o);n.push(De(e,t,1,1))}else if("scaley"===t){let t=new D(i,i,o);n.push(De(e,t,1,1))}else if("shear"===t){let t=new k(i,i<<1,o);n.push(ke(e,t,"x","y",0,1))}else if("shearx"===t){let t=new I(i,i,o);n.push(De(e,t,0,1))}else if("sheary"===t){let t=new B(i,i,o);n.push(De(e,t,0,1))}}}if(t.ik)for(let e in t.ik){let r=t.ik[e],a=r[0];if(!a)continue;let o=i.findIkConstraint(e);if(!o)throw new Error("IK Constraint not found: "+e);let h=i.ikConstraints.indexOf(o),l=new j(r.length,r.length<<1,h),u=Be(a,"time",0),c=Be(a,"mix",1),d=Be(a,"softness",0)*s;for(let t=0,e=0;;t++){l.setFrame(t,u,c,d,Be(a,"bendPositive",!0)?1:-1,Be(a,"compress",!1),Be(a,"stretch",!1));let i=r[t+1];if(!i){l.shrink(e);break}let n=Be(i,"time",0),o=Be(i,"mix",1),h=Be(i,"softness",0)*s,f=a.curve;f&&(e=Ie(f,l,e,t,0,u,n,c,o,1),e=Ie(f,l,e,t,1,u,n,d,h,s)),u=n,c=o,d=h,a=i}n.push(l)}if(t.transform)for(let e in t.transform){let s=t.transform[e],r=s[0];if(!r)continue;let a=i.findTransformConstraint(e);if(!a)throw new Error("Transform constraint not found: "+e);let o=i.transformConstraints.indexOf(a),h=new q(s.length,6*s.length,o),l=Be(r,"time",0),u=Be(r,"mixRotate",1),c=Be(r,"mixX",1),d=Be(r,"mixY",c),f=Be(r,"mixScaleX",1),p=Be(r,"mixScaleY",f),g=Be(r,"mixShearY",1);for(let t=0,e=0;;t++){h.setFrame(t,l,u,c,d,f,p,g);let i=s[t+1];if(!i){h.shrink(e);break}let n=Be(i,"time",0),a=Be(i,"mixRotate",1),o=Be(i,"mixX",1),m=Be(i,"mixY",o),v=Be(i,"mixScaleX",1),y=Be(i,"mixScaleY",v),x=Be(i,"mixShearY",1),w=r.curve;w&&(e=Ie(w,h,e,t,0,l,n,u,a,1),e=Ie(w,h,e,t,1,l,n,c,o,1),e=Ie(w,h,e,t,2,l,n,d,m,1),e=Ie(w,h,e,t,3,l,n,f,v,1),e=Ie(w,h,e,t,4,l,n,p,y,1),e=Ie(w,h,e,t,5,l,n,g,x,1)),l=n,u=a,c=o,d=m,f=v,p=y,f=v,r=i}n.push(h)}if(t.path)for(let e in t.path){let r=t.path[e],a=i.findPathConstraint(e);if(!a)throw new Error("Path constraint not found: "+e);let o=i.pathConstraints.indexOf(a);for(let t in r){let e=r[t],i=e[0];if(!i)continue;let h=e.length;if("position"===t){let t=new K(h,h,o);n.push(De(e,t,0,a.positionMode==yt.Fixed?s:1))}else if("spacing"===t){let t=new Z(h,h,o);n.push(De(e,t,0,a.spacingMode==xt.Length||a.spacingMode==xt.Fixed?s:1))}else if("mix"===t){let t=new Q(h,3*h,o),s=Be(i,"time",0),r=Be(i,"mixRotate",1),a=Be(i,"mixX",1),l=Be(i,"mixY",a);for(let n=0,o=0;;n++){t.setFrame(n,s,r,a,l);let h=e[n+1];if(!h){t.shrink(o);break}let u=Be(h,"time",0),c=Be(h,"mixRotate",1),d=Be(h,"mixX",1),f=Be(h,"mixY",d),p=i.curve;p&&(o=Ie(p,t,o,n,0,s,u,r,c,1),o=Ie(p,t,o,n,1,s,u,a,d,1),o=Ie(p,t,o,n,2,s,u,l,f,1)),s=u,r=c,a=d,l=f,i=h}n.push(t)}}}if(t.attachments)for(let e in t.attachments){let r=t.attachments[e],a=i.findSkin(e);if(!a)throw new Error("Skin not found: "+e);for(let t in r){let e=r[t],o=i.findSlot(t);if(!o)throw new Error("Slot not found: "+t);let h=o.index;for(let t in e){let i=e[t],r=a.getAttachment(h,t);for(let t in i){let e=i[t],a=e[0];if(a)if("deform"==t){let t=r.bones,i=r.vertices,o=t?i.length/3*2:i.length,l=new V(e.length,e.length,h,r),c=Be(a,"time",0);for(let n=0,r=0;;n++){let h,d=Be(a,"vertices",null);if(d){h=u.newFloatArray(o);let e=Be(a,"offset",0);if(u.arrayCopy(d,0,h,e,d.length),1!=s)for(let t=e,i=t+d.length;t<i;t++)h[t]*=s;if(!t)for(let t=0;t<o;t++)h[t]+=i[t]}else h=t?u.newFloatArray(o):i;l.setFrame(n,c,h);let f=e[n+1];if(!f){l.shrink(r);break}let p=Be(f,"time",0),g=a.curve;g&&(r=Ie(g,l,r,n,0,c,p,0,1,1)),c=p,a=f}n.push(l)}else if("sequence"==t){let t=new J(e.length,h,r),i=0;for(let s=0;s<e.length;s++){let n=Be(a,"delay",i),r=Be(a,"time",0),o=x[Be(a,"mode","hold")],h=Be(a,"index",0);t.setFrame(s,r,o,h,n),i=n,a=e[s+1]}n.push(t)}}}}}if(t.drawOrder){let e=new H(t.drawOrder.length),s=i.slots.length,r=0;for(let n=0;n<t.drawOrder.length;n++,r++){let a=t.drawOrder[n],o=null,h=Be(a,"offsets",null);if(h){o=u.newArray(s,-1);let t=u.newArray(s-h.length,0),e=0,n=0;for(let s=0;s<h.length;s++){let r=h[s],a=i.findSlot(r.slot);if(!a)throw new Error("Slot not found: "+a);let l=a.index;for(;e!=l;)t[n++]=e++;o[e+r.offset]=e++}for(;e<s;)t[n++]=e++;for(let e=s-1;e>=0;e--)-1==o[e]&&(o[e]=t[--n])}e.setFrame(r,Be(a,"time",0),o)}n.push(e)}if(t.events){let e=new W(t.events.length),s=0;for(let n=0;n<t.events.length;n++,s++){let r=t.events[n],a=i.findEvent(r.name);if(!a)throw new Error("Event not found: "+r.name);let o=new Yt(u.toSinglePrecision(Be(r,"time",0)),a);o.intValue=Be(r,"int",a.intValue),o.floatValue=Be(r,"float",a.floatValue),o.stringValue=Be(r,"string",a.stringValue),o.data.audioPath&&(o.volume=Be(r,"volume",1),o.balance=Be(r,"balance",0)),e.setFrame(s,o)}n.push(e)}let a=0;for(let t=0,e=n.length;t<e;t++)a=Math.max(a,n[t].getDuration());i.animations.push(new b(e,n,a))}}class Oe{parent;skin;slotIndex;mesh;inheritTimeline;constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}}function De(t,e,i,s){let n=t[0],r=Be(n,"time",0),a=Be(n,"value",i)*s,o=0;for(let h=0;;h++){e.setFrame(h,r,a);let l=t[h+1];if(!l)return e.shrink(o),e;let u=Be(l,"time",0),c=Be(l,"value",i)*s;n.curve&&(o=Ie(n.curve,e,o,h,0,r,u,a,c,s)),r=u,a=c,n=l}}function ke(t,e,i,s,n,r){let a=t[0],o=Be(a,"time",0),h=Be(a,i,n)*r,l=Be(a,s,n)*r,u=0;for(let c=0;;c++){e.setFrame(c,o,h,l);let d=t[c+1];if(!d)return e.shrink(u),e;let f=Be(d,"time",0),p=Be(d,i,n)*r,g=Be(d,s,n)*r,m=a.curve;m&&(u=Ie(m,e,u,c,0,o,f,h,p,r),u=Ie(m,e,u,c,1,o,f,l,g,r)),o=f,h=p,l=g,a=d}}function Ie(t,e,i,s,n,r,a,o,h,l){if("stepped"==t)return e.setStepped(s),i;let u=n<<2,c=t[u],d=t[u+1]*l,f=t[u+2],p=t[u+3]*l;return e.setBezier(i,s,n,r,o,c,d,f,p,a,h),i+1}function Be(t,e,i){return void 0!==t[e]?t[e]:i}var Ne;void 0===Math.fround&&(Math.fround=(Ne=new Float32Array(1),function(t){return Ne[0]=t,Ne[0]}))}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};return(()=>{"use strict";i.r(s),i.d(s,{SpinePlugin:()=>q,ZButton:()=>o,ZContainer:()=>n,ZCuePointsManager:()=>l,ZNineSlice:()=>m,ZResizeables:()=>h,ZScene:()=>b,ZSceneStack:()=>T,ZScroll:()=>g,ZSlider:()=>p,ZSpine:()=>x,ZState:()=>d,ZTextInput:()=>v,ZTimeline:()=>c,ZToggle:()=>f,ZUpdatables:()=>u});var t=i(440),e=i.n(t);class n extends e().GameObjects.Container{constructor(t,e=0,i=0,s){super(t,e,i,s),this.resizeable=!0,this.name="",this._fitToScreen=!1,t.add.existing(this)}getChildByName(t){return this.list.find((e=>e.name===t))||null}get(t){const e=[];for(this.list.forEach((t=>{t instanceof n&&e.push(t)}));e.length>0;){const i=e.shift();if(i.name===t)return i;i.list.forEach((t=>{t instanceof n&&e.push(t)}))}return null}getAllByName(t){const e=[],i=[];for(this.list.forEach((t=>{t instanceof n&&i.push(t)}));i.length>0;){const s=i.shift();s.name===t&&e.push(s),s.list.forEach((t=>{t instanceof n&&i.push(t)}))}return e}init(){}getType(){return"ZContainer"}getProps(){return this._props}setText(t){let e=this.getTextField();if(e){if(e.setText(t),this.fixedBoxSize){let t=this.originalTextWidth,i=this.originalTextHeight;if(void 0!==t&&t>0||void 0!==i&&i>0)for(;void 0!==t&&e.width>t||void 0!==i&&e.height>i;){const t=parseFloat(e.style.fontSize)||12;e.setFontSize(t-1)}}"center"===e.style.align&&e.setOrigin(.5,.5)}}setTextStyle(t){let e=this.getTextField();e&&(e.setStyle(t),this.resizeText(e))}resizeText(t){if(this.fixedBoxSize){let e=this.originalTextWidth,i=this.originalTextHeight;if(void 0!==e&&e>0||void 0!==i&&i>0)for(;void 0!==e&&t.width>e||void 0!==i&&t.height>i;){const e=parseFloat(t.style.fontSize)||12;if(e<=1)break;t.setFontSize(e-1)}}}getTextField(){let t=this.getByName("label");if(t)return t;for(let t of this.list)if(t instanceof e().GameObjects.Text)return t;return null}setInstanceData(t,e){var i;this.portrait=t.portrait,this.landscape=t.landscape,this.currentTransform="portrait"===e?this.portrait:this.landscape,this.applyTransform(),this.name=t.instanceName||"",this._props=t,void 0!==(null===(i=t.attrs)||void 0===i?void 0:i.fitToScreen)&&(this.fitToScreen=t.attrs.fitToScreen);const s=this.getTextField();s&&(this.setFixedBoxSize(!1),this.originalTextWidth=s.width,this.originalTextHeight=s.height,this.originalFontSize="number"==typeof s.style.fontSize?s.style.fontSize:void 0!==s.style.fontSize?parseFloat(s.style.fontSize):void 0)}setFixedBoxSize(t){this.fixedBoxSize=t}set fitToScreen(t){this._fitToScreen=t,t?this.executeFitToScreen():this.applyTransform()}get fitToScreen(){return this._fitToScreen}applyTransform(){var t;if(this._fitToScreen)return void this.executeFitToScreen();if(!this.currentTransform)return;if(!this.resizeable)return;if(this.parentContainer){let t=this.parentContainer.currentFrame;if(void 0!==t&&t>0)return}let e=this.parentContainer;if(e&&e.currentTransform){let t=e.currentTransform.pivotX||0,i=e.currentTransform.pivotY||0;this.setX(this.currentTransform.x-t||0),this.setY(this.currentTransform.y-i||0)}else this.setX(this.currentTransform.x||0),this.setY(this.currentTransform.y||0);this.rotation=this.currentTransform.rotation||0,this.alpha=null!==(t=this.currentTransform.alpha)&&void 0!==t?t:1,this.setScale(this.currentTransform.scaleX||1,this.currentTransform.scaleY||1),this.setOrigin(),this.applyAnchor()}setOrigin(){const t=this.currentTransform.pivotX||0,e=this.currentTransform.pivotY||0;this.list.forEach((i=>{if(i._fitToScreen)return;let s=i.currentTransform;s?(i.setX(s.x-t),i.setY(s.y-e)):(i.setX(-t),i.setY(-e))}))}resize(t,e,i){this.currentTransform="portrait"===i?this.portrait:this.landscape,this.applyTransform()}executeFitToScreen(){if(0===this.list.length)return;const t=this.scene.scale.width,i=this.scene.scale.height;this.setScale(1,1);const s=this.parentContainer?this.parentContainer.getWorldTransformMatrix():null,n=(t,e)=>s?s.applyInverse(t,e):{x:t,y:e},r=n(0,0),a=n(t,i),o=n(t/2,i/2),h=a.x-r.x,l=a.y-r.y;this.x=r.x,this.y=r.y;const u=this.list[0];if(u instanceof e().GameObjects.NineSlice)return u.width=h,void(u.height=l);const c=this.getBounds();if(0===c.width||0===c.height)return;const d=s?this._getParentWorldScaleX():1,f=s?this._getParentWorldScaleY():1,p=c.width/d,g=c.height/f;let m;m=t>i?h/p:l/g,this.setScale(m,m);const v=p*m,y=g*m;this.x=o.x-v/2,this.y=o.y-y/2}_getParentWorldScaleX(){if(!this.parentContainer)return 1;const t=this.parentContainer.getWorldTransformMatrix();return Math.sqrt(t.a*t.a+t.b*t.b)}_getParentWorldScaleY(){if(!this.parentContainer)return 1;const t=this.parentContainer.getWorldTransformMatrix();return Math.sqrt(t.c*t.c+t.d*t.d)}setX(t){return super.setX(t),this.currentTransform,this}setY(t){return super.setY(t),this.currentTransform,this}setWidth(t){return super.setSize(t,this.height),this.currentTransform,this}setHeight(t){return super.setSize(this.width,t),this.currentTransform,this}setScaleX(t){return super.setScale(t,this.scaleY),this.currentTransform,this}setScaleY(t){return super.setScale(this.scaleX,t),this.currentTransform,this}applyAnchor(){if(this.currentTransform&&this.currentTransform.isAnchored&&this.parentContainer){let t=this.currentTransform.anchorPercentage.x||0,i=this.currentTransform.anchorPercentage.y||0,s=t*window.innerWidth,n=i*window.innerHeight;const r=this.getWorldTransformMatrix().transformPoint(s,n),a=this.parentContainer.getWorldTransformMatrix(),o=new(e().GameObjects.Components.TransformMatrix);o.copyFrom(a),o.invert();const h=o.transformPoint(r.x,r.y);this.x=h.x,this.y=h.y}}isAnchored(){var t;return!!(null===(t=this.currentTransform)||void 0===t?void 0:t.isAnchored)}getAllOfType(t){var e,i;this.getType=this.getType||(()=>"default");const s=[],n=[];if(this.list&&this.list.length>0)for(let t of this.list)t.getType&&s.push(t);for(;s.length>0;){const r=s.shift();if((null===(i=(e=r).getType)||void 0===i?void 0:i.call(e))===t&&n.push(r),r.list&&r.list.length>0)for(let t of r.list)t.getType&&s.push(t)}return n}loadParticle(t,e){}playParticleAnim(){}stopParticleAnim(){}}function r(t){if(t._hitAreaGraphics&&(t.remove(t._hitAreaGraphics,!0),t._hitAreaGraphics.destroy(),t._hitAreaGraphics=void 0),!t.scene||!t.scene.add)return;let e=1/0,i=1/0,s=-1/0,n=-1/0;const r=t.getWorldTransformMatrix();t.iterate((t=>{if(!t.visible||!t.getBounds)return;const a=t.getBounds();[{x:a.x,y:a.y},{x:a.x+a.width,y:a.y},{x:a.x,y:a.y+a.height},{x:a.x+a.width,y:a.y+a.height}].forEach((t=>{const a=r.applyInverse(t.x,t.y);e=Math.min(e,a.x),i=Math.min(i,a.y),s=Math.max(s,a.x),n=Math.max(n,a.y)}))})),isFinite(e)&&isFinite(i)&&isFinite(s)&&isFinite(n)||(e=0,i=0,s=1,n=1);const a=s-e,o=n-i,h=t.scene.add.graphics();h.fillStyle(16777215,.001),h.fillRect(e,i,a,o),h.setName("_hitAreaGraphics"),h.setInteractive(new Phaser.Geom.Rectangle(e,i,a,o),Phaser.Geom.Rectangle.Contains),h.input.cursor="pointer";const l=["pointerdown","pointerup","pointerover","pointerout","mouseup","touchend","touchendoutside","mouseupoutside","mousedown","touchstart"];for(let e of l)h.on(e,(i=>t.emit(e,i)));t.add(h),t._hitAreaGraphics=h}const a=(t,e,i)=>{let s=null,n=!1,a=null;const o=t=>({x:t.worldX,y:t.worldY}),h=e=>{n=!1,a=o(e),s=setTimeout((()=>{n=!0,i&&i(),r(t)}),500),t.on("pointerupoutside",l),t.on("pointerup",l),t.on("mouseup",l),t.on("touchend",l),t.on("touchendoutside",l),t.on("mouseupoutside",l)},l=i=>{clearTimeout(s),s=null;let h=!1;const u=o(i);if(a&&u){const t=u.x-a.x,e=u.y-a.y;Math.sqrt(t*t+e*e)>20&&(h=!0)}a=null,n||h||e&&e(),t.off("pointerupoutside",l),t.off("pointerup",l),t.off("mouseup",l),t.off("touchend",l),t.off("touchendoutside",l),t.off("mouseupoutside",l),r(t)};t.on("pointerdown",h),t.on("touchstart",h),r(t)};class o extends n{constructor(){super(...arguments),this.labelState="none"}getType(){return"ZButton"}init(t=""){var e,i,s,n,r,a,o,h,l,u,c,d,f,p,g,m,v;null===(e=super.init)||void 0===e||e.call(this),this.overState&&(this.overLabelContainer=null===(s=(i=this.overState).getByName)||void 0===s?void 0:s.call(i,"labelContainer"),this.overLabelContainer2=null===(r=(n=this.overState).getByName)||void 0===r?void 0:r.call(n,"labelContainer2")),this.disabledState&&(this.disabledLabelContainer=null===(o=(a=this.disabledState).getByName)||void 0===o?void 0:o.call(a,"labelContainer"),this.disabledLabelContainer2=null===(l=(h=this.disabledState).getByName)||void 0===l?void 0:l.call(h,"labelContainer2")),this.downState&&(this.downLabelContainer=null===(c=(u=this.downState).getByName)||void 0===c?void 0:c.call(u,"labelContainer"),this.downLabelContainer2=null===(f=(d=this.downState).getByName)||void 0===f?void 0:f.call(d,"labelContainer2")),this.upState&&(this.upLabelContainer=null===(g=(p=this.upState).getByName)||void 0===g?void 0:g.call(p,"labelContainer"),this.upLabelContainer2=null===(v=(m=this.upState).getByName)||void 0===v?void 0:v.call(m,"labelContainer2")),this.topLabelContainer=this.labelContainer,this.topLabelContainer2=this.labelContainer2,this.topLabelContainer?this.labelState="single":this.overState&&this.disabledState&&this.downState&&this.upState&&this.overLabelContainer&&this.disabledLabelContainer&&this.downLabelContainer&&this.upLabelContainer&&(this.labelState="multi"),this.enable()}applyTransform(){super.applyTransform(),r(this)}setLabel(t){var e,i;"single"===this.labelState&&this.topLabelContainer?(this.topLabelContainer.setVisible(!0),null===(i=(e=this.topLabelContainer).setText)||void 0===i||i.call(e,t)):"multi"===this.labelState&&[this.overLabelContainer,this.disabledLabelContainer,this.downLabelContainer,this.upLabelContainer].forEach((e=>{var i,s;e&&(e.setVisible(!0),null===(s=(i=e).setText)||void 0===s||s.call(i,t))}))}setLabel2(t){var e,i;"single"===this.labelState&&this.topLabelContainer2?(this.topLabelContainer2.setVisible(!0),null===(i=(e=this.topLabelContainer2).setText)||void 0===i||i.call(e,t)):"multi"===this.labelState&&[this.overLabelContainer2,this.disabledLabelContainer2,this.downLabelContainer2,this.upLabelContainer2].forEach((e=>{var i,s;e&&(e.setVisible(!0),null===(s=(i=e).setText)||void 0===s||s.call(i,t))}))}setFixedTextSize(t){}makeSingleLine(){}setCallback(t){this.callback=t}removeCallback(){this.callback=void 0}setLongPressCallback(t){this.longPressCallback=t}removeLongPressCallback(){this.longPressCallback=void 0}onClicked(){this.callback&&this.callback()}enable(){this.removeAllListeners&&this.removeAllListeners(),this.hideAllStates(),this.upState&&(this.upState.setVisible(!0),this.add(this.upState)),"single"===this.labelState&&this.topLabelContainer&&(this.add(this.topLabelContainer),this.topLabelContainer.alpha=1,this.topLabelContainer2&&(this.add(this.topLabelContainer2),this.topLabelContainer2.alpha=1)),this.on("pointerout",this.onOut,this),this.on("pointerover",this.onOver,this),this.on("pointerdown",this.onDown,this),this.on("pointerup",this.onOut,this),a(this,(()=>this.onClicked()),(()=>{this.longPressCallback&&this.longPressCallback()}))}disable(){this.removeAllListeners&&this.removeAllListeners(),this.disableInteractive&&this.disableInteractive(),this.hideAllStates(),this.disabledState&&(this.disabledState.setVisible(!0),this.add(this.disabledState)),this.topLabelContainer&&(this.add(this.topLabelContainer),this.topLabelContainer.alpha=.5),this.topLabelContainer2&&(this.add(this.topLabelContainer2),this.topLabelContainer2.alpha=.5)}hideAllStates(){this.overState&&this.overState.setVisible(!1),this.downState&&this.downState.setVisible(!1),this.upState&&this.upState.setVisible(!1),this.disabledState&&this.disabledState.setVisible(!1)}onDown(){this.downState&&(this.hideAllStates(),this.downState.setVisible(!0),this.add(this.downState)),this.topLabelContainer&&(this.add(this.topLabelContainer),this.topLabelContainer.alpha=.5,this.topLabelContainer2&&(this.add(this.topLabelContainer2),this.topLabelContainer2.alpha=.5))}onOut(){this.upState&&(this.hideAllStates(),this.upState.setVisible(!0),this.add(this.upState)),this.topLabelContainer&&(this.add(this.topLabelContainer),this.topLabelContainer.alpha=1,this.topLabelContainer2&&(this.add(this.topLabelContainer2),this.topLabelContainer2.alpha=1))}onOver(){this.overState&&(this.hideAllStates(),this.overState.setVisible(!0),this.add(this.overState)),this.topLabelContainer&&(this.add(this.topLabelContainer),this.topLabelContainer.alpha=1,this.topLabelContainer2&&(this.add(this.topLabelContainer2),this.topLabelContainer2.alpha=1))}}class h{static addResizeable(t){h.resizeables.set(t,!0)}static resize(){for(const[t]of h.resizeables)t.resize()}static removeResizeable(t){h.resizeables.delete(t)}}h.resizeables=new Map;class l{static addCuePointListener(t,e){var i;this.cuePoints.has(t)||this.cuePoints.set(t,[]),null===(i=this.cuePoints.get(t))||void 0===i||i.push(e)}static removeCuePointListener(t,e){if(this.cuePoints.has(t)){const i=this.cuePoints.get(t);if(i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}}static triggerCuePoint(t,...e){if(this.cuePoints.has(t)){const i=this.cuePoints.get(t);if(i)for(const t of i)t(...e)}}}l.cuePoints=new Map;class u{static init(t){this.fpsInterval=1e3/t,this.then=Date.now(),this.startTime=this.then}static addUpdateAble(t){u.updatables.set(t,!0)}static update(){if(this.now=Date.now(),this.elapsed=this.now-this.then,this.elapsed>this.fpsInterval){this.then=this.now-this.elapsed%this.fpsInterval;for(const[t]of u.updatables)t.update()}}static removeUpdateAble(t){u.updatables.delete(t)}}u.updatables=new Map,u.fpsInterval=0,u.then=0,u.now=0,u.elapsed=0,u.startTime=0;class c extends n{constructor(t,e=0,i=0,s){super(t,e,i,s),this.currentFrame=0,this.looping=!0,this.cuePoints={},this.totalFrames,this._frames,this.currentFrame=0,this.looping=!0}setCuePoints(t){this.cuePoints=t}getFrames(){return this._frames}setFrames(t){this._frames=t;let e=0;if(null!=this._frames){for(const t in this._frames)this._frames[t]instanceof Array&&this._frames[t].length>e&&(e=this._frames[t].length);this.totalFrames=e}}removeStateEndEventListener(){this.func=void 0}addStateEndEventListener(t){this.func=t}play(){u.addUpdateAble(this);for(let t=0;t<this.list.length;t++){const e=this.list[t];e instanceof c&&e.play()}}stop(){u.removeUpdateAble(this);for(let t=0;t<this.list.length;t++){const e=this.list[t];e instanceof c&&e.stop()}}gotoAndPlay(t){this.currentFrame=t,u.removeUpdateAble(this),this.play()}update(){this.gotoAndStop(this.currentFrame),this.cuePoints&&void 0!==this.cuePoints[this.currentFrame]&&l.triggerCuePoint(this.cuePoints[this.currentFrame],this),this.currentFrame++,this.currentFrame>this.totalFrames&&(this.looping?this.currentFrame=0:u.removeUpdateAble(this),this.func&&this.func.call(this,this))}gotoAndStop(t){if(this.currentFrame=t,null!=this._frames)for(const t in this._frames)if(this._frames[t][this.currentFrame]){const e=this._frames[t][this.currentFrame];if(this[t]){const i=this[t];null!=e.pivotX&&null!=e.pivotY&&("function"==typeof i.setOrigin&&"number"==typeof i.width&&i.width>0?i.setOrigin(e.pivotX/i.width,e.pivotY/i.height):i.currentTransform&&(i.currentTransform.pivotX=e.pivotX,i.currentTransform.pivotY=e.pivotY)),null!=e.scaleX&&(i.setScale?i.setScale(e.scaleX,null!=e.scaleY?e.scaleY:i.scaleY):i.scaleX=e.scaleX),null!=e.scaleY&&null==e.scaleX&&(i.setScale?i.setScale(i.scaleX,e.scaleY):i.scaleY=e.scaleY),null!=e.x&&(i.x=e.x),null!=e.y&&(i.y=e.y),null!=e.alpha&&(i.alpha=e.alpha),null!=e.rotation&&(i.rotation=e.rotation)}}}}class d extends n{constructor(){super(...arguments),this.currentState=null}init(){this.setViewState("idle")}getCurrentState(){return this.currentState}hasState(t){return null!==this.getChildByName(t)}setState(t){return"string"==typeof t&&this.setViewState(t),this}setViewState(t){let e=this.get(t);if(e||(e=this.get("idle"),!e&&this.list.length>0&&(e=this.list[0])),this.list)for(let t=0;t<this.list.length;t++){let e=this.list[t];e.visible=!1,e instanceof c&&e.stop()}return e?(e.visible=!0,this.currentState=e,e.parentContainer&&e.parentContainer.bringToTop(e),e instanceof c&&e.play(),e):null}getAllStateNames(){return this.list.map((t=>t.name))}getType(){return"ZState"}}class f extends d{init(){this.input&&(this.input.cursor="pointer"),a(this,(()=>{this.setViewState("offState"===this.currentState.name?"onState":"offState"),this.callback&&this.callback("onState"===this.currentState.name),this.toggleCallback&&this.toggleCallback("onState"===this.currentState.name)})),this.setViewState("offState")}applyTransform(){super.applyTransform(),r(this)}setCallback(t){this.toggleCallback=t}removeCallback(){this.toggleCallback=void 0}setIsClickable(t){this.setInteractive(t?{}:void 0),this.input&&(this.input.cursor=t?"pointer":"default")}isOn(){return"onState"===this.currentState.name}toggle(t,e=!0){this.setViewState(t?"onState":"offState"),this.toggleCallback&&e&&this.toggleCallback(t)}enable(){this.setInteractive(),this.input&&(this.input.cursor="pointer")}disable(){this.setInteractive(void 0),this.input&&(this.input.cursor="default")}setLabelOnAllStates(t,e){let i=this.getAllByName(t);for(let t of i)t.setText(e)}getType(){return"ZToggle"}}class p extends n{constructor(){super(...arguments),this.dragging=!1,this.sliderWidth=0}init(){super.init(),this.handle=this.getByName("handle"),this.track=this.getByName("track"),this.handle&&this.track?(this.sliderWidth=this.track.width,this.onDragStartBinded=this.onDragStart.bind(this),this.onDragEndBinded=this.onDragEnd.bind(this),this.onDragBinded=this.onDrag.bind(this),this.handle.setInteractive({cursor:"pointer"}),this.handle.on("pointerdown",this.onDragStartBinded),this.handle.on("touchstart",this.onDragStartBinded)):console.error("ZSlider is missing handle or track")}getType(){return"ZSlider"}setHandlePosition(t){this.handle.x=t*this.sliderWidth,this.callback&&this.callback(t)}setCallback(t){this.callback=t}removeCallback(){this.callback=void 0}onDragStart(t){this.dragging=!0,this.handle.on("pointerup",this.onDragEndBinded),this.handle.on("pointerupoutside",this.onDragEndBinded),this.handle.on("touchend",this.onDragEndBinded),this.handle.on("touchendoutside",this.onDragEndBinded),window.addEventListener("pointerup",this.onDragEndBinded),window.addEventListener("touchend",this.onDragEndBinded),window.addEventListener("pointermove",this.onDragBinded),window.addEventListener("touchmove",this.onDragBinded)}onDragEnd(t){this.dragging=!1,this.handle.off("pointerup",this.onDragEndBinded),this.handle.off("pointerupoutside",this.onDragEndBinded),this.handle.off("touchend",this.onDragEndBinded),this.handle.off("touchendoutside",this.onDragEndBinded),window.removeEventListener("pointerup",this.onDragEndBinded),window.removeEventListener("touchend",this.onDragEndBinded),window.removeEventListener("pointermove",this.onDragBinded),window.removeEventListener("touchmove",this.onDragBinded)}onDrag(t){let i;if(t&&t.touches&&t.touches.length>0?i=t.touches[0].clientX:t&&"number"==typeof t.clientX&&(i=t.clientX),void 0===i)return;const s=(this.handle.parentContainer||this).getBounds(),n=e().Math.Clamp(i-s.x,0,this.sliderWidth);this.handle.x=n;const r=this.handle.x/this.sliderWidth;this.callback&&this.callback(r),t.stopPropagation&&t.stopPropagation()}}class g extends n{constructor(){super(...arguments),this.scrollBarHeight=0,this.contentHeight=0,this.dragStartY=0,this.beedStartY=0,this.isDragging=!1,this.isBeedDragging=!1,this.scrollingEnabled=!0,this.msk=null}init(){super.init(),this.beed=this.get("beed"),this.scrollBar=this.get("scrollBar"),this.scrollContent=this.get("scrollContent"),this.beed&&this.scrollBar&&this.scrollContent?this.scene.time.delayedCall(0,(()=>this.calculateScrollBar())):console.warn("ZScroll requires 'beed', 'scrollBar', and 'scrollContent' children.",this.name)}getType(){return"ZScroll"}calculateScrollBar(){var t,i,s;if(this.msk&&(null===(t=this.scrollContent)||void 0===t||t.clearMask(!0),this.msk.destroy(),this.msk=null),this.removeEventListeners(),!this.scrollBar||!this.scrollContent||!this.beed)return;const n=this.getWorldScaleY();if(this.scrollBarHeight=this.scrollBar.getBounds().height/n,this.contentHeight=this.scrollContent.getBounds().height/n,console.log(`[ZScroll] "${this.name}" scrollBarH=${this.scrollBarHeight.toFixed(1)}, contentH=${this.contentHeight.toFixed(1)}`),this.contentHeight<=this.scrollBarHeight)return console.log(`[ZScroll] "${this.name}" content fits — no scroll needed`),this.beed.setVisible(!1),this.scrollBar.setVisible(!1),void(this.scrollContent.y=0);this.beed.setVisible(!0),this.scrollBar.setVisible(!0);const r=this.scrollBar.x-this.scrollContent.x,a=this.scrollContent.x,o=null!==(s=null===(i=this.scrollContent.currentTransform)||void 0===i?void 0:i.y)&&void 0!==s?s:this.scrollContent.y;this.msk=new(e().GameObjects.Graphics)(this.scene);const h=new(e().GameObjects.Components.TransformMatrix),l=new(e().GameObjects.Components.TransformMatrix);this.getWorldTransformMatrix(h,l);const u=h.transformPoint(a,o),c=h.transformPoint(a+r,o+this.scrollBarHeight);this.msk.fillStyle(16777215,1),this.msk.fillRect(u.x,u.y,c.x-u.x,c.y-u.y),this.scrollContent.setMask(this.msk.createGeometryMask()),this.scrollContent.y=o,this.beed.y=0,this.addEventListeners()}addEventListeners(){this.removeEventListeners(),this.scene.input.on(e().Input.Events.POINTER_DOWN,this.onScenePointerDown,this),this.scene.input.on(e().Input.Events.POINTER_MOVE,this.onPointerMove,this),this.scene.input.on(e().Input.Events.POINTER_UP,this.onPointerUp,this),this.scene.input.on("wheel",this.onWheel,this)}removeEventListeners(){var t;(null===(t=this.scene)||void 0===t?void 0:t.input)&&(this.scene.input.off(e().Input.Events.POINTER_DOWN,this.onScenePointerDown,this),this.scene.input.off(e().Input.Events.POINTER_MOVE,this.onPointerMove,this),this.scene.input.off(e().Input.Events.POINTER_UP,this.onPointerUp,this),this.scene.input.off("wheel",this.onWheel,this))}removeListeners(){this.removeEventListeners()}onScenePointerDown(t){var e,i;const s=this.worldToLocal(t.worldX,t.worldY),n=this.scrollContent.x,r=null!==(i=null===(e=this.scrollContent.currentTransform)||void 0===e?void 0:e.y)&&void 0!==i?i:this.scrollContent.y,a=this.scrollBar.x-n,o=this.getWorldScaleY();this.scrollBarHeight=this.scrollBar.getBounds().height/o;const h=this.beed.getBounds();if(t.worldX>=h.x&&t.worldX<=h.right&&t.worldY>=h.y&&t.worldY<=h.bottom)return this.isBeedDragging=!0,this.dragStartY=s.y,this.beedStartY=this.beed.y,void console.log(`[ZScroll] beedDrag start beed.y=${this.beed.y.toFixed(1)}`);s.x<n||s.x>n+a||s.y<r||s.y>r+this.scrollBarHeight||(this.isDragging=!0,this.dragStartY=s.y,this.beedStartY=this.beed.y,console.log(`[ZScroll] contentDrag start local=(${s.x.toFixed(1)},${s.y.toFixed(1)})`))}onPointerMove(t){if(!this.isDragging&&!this.isBeedDragging)return;const e=this.worldToLocal(t.worldX,t.worldY).y,i=this.isDragging?this.dragStartY-e:e-this.dragStartY;this.beed.y=this.beedStartY+i,this.clampAndSync()}onPointerUp(){this.isDragging=!1,this.isBeedDragging=!1}onWheel(t,e,i,s){this.scrollingEnabled&&(this.scrollBarHeight=this.scrollBar.getBounds().height/this.getWorldScaleY(),this.beed.y-=.5*s,this.clampAndSync())}clampAndSync(){var t,i;const s=this.getWorldScaleY(),n=Math.max(1,this.beed.getBounds().height/s),r=Math.max(0,this.scrollBarHeight-n);this.beed.y=e().Math.Clamp(this.beed.y,0,r);const a=r>0?this.beed.y/r:0,o=this.scrollContent.getBounds().height/s,h=null!==(i=null===(t=this.scrollContent.currentTransform)||void 0===t?void 0:t.y)&&void 0!==i?i:0;this.scrollContent.y=h-a*(o-this.scrollBarHeight)}worldToLocal(t,i){const s=new(e().GameObjects.Components.TransformMatrix);return this.getWorldTransformMatrix(s),s.invert(),s.transformPoint(t,i)}getWorldScaleY(){var t,i,s;const n=new(e().GameObjects.Components.TransformMatrix);return this.getWorldTransformMatrix(n),(null!==(s=null===(i=(t=n).getScaleY)||void 0===i?void 0:i.call(t))&&void 0!==s?s:Math.sqrt(n.c*n.c+n.d*n.d))||1}applyTransform(){super.applyTransform(),this.beed&&this.scrollBar&&this.scrollContent&&this.scene.time.delayedCall(0,(()=>this.calculateScrollBar()))}}class m extends e().GameObjects.NineSlice{constructor(t,e,i,s,n,r,a){super(t,e,i,s,n,r.width,r.height,Math.min(r.left,Math.floor(r.width/2)),Math.min(r.right,Math.floor(r.width/2)),Math.min(r.top,Math.floor(r.height/2)),Math.min(r.bottom,Math.floor(r.height/2))),this._nineSliceData=r,this.portrait=r.portrait,this.landscape=r.landscape,this.currentTransform="portrait"===a?this.portrait:this.landscape,this.setOrigin(0,0),this.applyTransform(),t.add.existing(this)}resize(t,e,i){this.currentTransform="portrait"===i?this.portrait:this.landscape,this.applyTransform()}applyTransform(){var t,e,i,s,n;if(!this.currentTransform)return;const r=this.currentTransform.width||(null===(t=this._nineSliceData)||void 0===t?void 0:t.width)||1,a=this.currentTransform.height||(null===(e=this._nineSliceData)||void 0===e?void 0:e.height)||1;this.leftWidth=Math.min(this._nineSliceData.left,Math.floor(r/2)),this.rightWidth=Math.min(this._nineSliceData.right,Math.floor(r/2)),this.topHeight=Math.min(this._nineSliceData.top,Math.floor(a/2)),this.bottomHeight=Math.min(this._nineSliceData.bottom,Math.floor(a/2)),this.setSize(r,a);const o=this.currentTransform.scaleX||1,h=this.currentTransform.scaleY||1,l=this.currentTransform.pivotX||0,u=this.currentTransform.pivotY||0,c=this.parentContainer,d=(null===(i=null==c?void 0:c.currentTransform)||void 0===i?void 0:i.pivotX)||0,f=(null===(s=null==c?void 0:c.currentTransform)||void 0===s?void 0:s.pivotY)||0;this.setPosition((this.currentTransform.x||0)-o*l-d,(this.currentTransform.y||0)-h*u-f),this.setScale(o,h),this.rotation=this.currentTransform.rotation||0,this.alpha=null!==(n=this.currentTransform.alpha)&&void 0!==n?n:1,this.visible=!1!==this.currentTransform.visible}}class v extends n{constructor(t,e){var i,s;super(t,null!==(i=e.x)&&void 0!==i?i:0,null!==(s=e.y)&&void 0!==s?s:0),this.domElement=null,this.inputElement=null,this._text="",this.props=e.props,this._text=e.text||"",this.createInput(t,e)}createInput(t,e){var i,s,n,r,a,o;const h=document.createElement("input");h.type="text",h.value=this._text;const l=null===(i=this.props)||void 0===i?void 0:i.input;l&&(l.fontFamily&&(h.style.fontFamily=l.fontFamily),l.fontSize&&(h.style.fontSize=l.fontSize),l.padding&&(h.style.padding=l.padding),l.width&&(h.style.width=l.width),l.color&&(h.style.color="number"==typeof l.color?"#"+l.color.toString(16).padStart(6,"0"):l.color),l.fontWeight&&(h.style.fontWeight=l.fontWeight),l.textAlign&&(h.style.textAlign=l.textAlign),l.textIndent&&(h.style.textIndent=l.textIndent),l.lineHeight&&(h.style.lineHeight=l.lineHeight));const u=null===(n=null===(s=this.props)||void 0===s?void 0:s.box)||void 0===n?void 0:n.default;if(u&&(void 0!==u.fill&&(h.style.backgroundColor="#"+u.fill.toString(16).padStart(6,"0")),void 0!==u.rounded&&(h.style.borderRadius=u.rounded+"px"),u.stroke)){const t=u.stroke,e=void 0!==t.color?"#"+t.color.toString(16).padStart(6,"0"):"#000000",i=void 0!==t.width?t.width:1,s=void 0!==t.alpha?t.alpha:1;h.style.border=`${i}px solid ${e}`,h.style.opacity=String(s)}h.style.outline="none",h.style.boxSizing="border-box",h.addEventListener("focus",(()=>{var t,e;const i=null===(e=null===(t=this.props)||void 0===t?void 0:t.box)||void 0===e?void 0:e.focused;void 0!==(null==i?void 0:i.fill)&&(h.style.backgroundColor="#"+i.fill.toString(16).padStart(6,"0"))})),h.addEventListener("blur",(()=>{var t,e;const i=null===(e=null===(t=this.props)||void 0===t?void 0:t.box)||void 0===e?void 0:e.default;void 0!==(null==i?void 0:i.fill)&&(h.style.backgroundColor="#"+i.fill.toString(16).padStart(6,"0"))})),h.addEventListener("input",(()=>{this._text=h.value}));try{this.domElement=t.add.dom(0,0,h),this.add(this.domElement),this.inputElement=h}catch(i){console.warn(`ZTextInput: DOM support not available (add 'dom: { createContainer: true }' to your Phaser game config). Rendering "${e.name}" as a plain text label instead.`);const s=null===(r=this.props)||void 0===r?void 0:r.input,n=(null==s?void 0:s.color)?"number"==typeof s.color?"#"+s.color.toString(16).padStart(6,"0"):s.color:"#ffffff",h=t.add.text(0,0,this._text,{fontFamily:null!==(a=null==s?void 0:s.fontFamily)&&void 0!==a?a:"Arial",fontSize:null!==(o=null==s?void 0:s.fontSize)&&void 0!==o?o:"16px",color:n});h.setName(e.name),this.add(h)}}getText(){var t,e;return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.value)&&void 0!==e?e:this._text}setValue(t){this._text=t,this.inputElement&&(this.inputElement.value=t)}focus(){var t;null===(t=this.inputElement)||void 0===t||t.focus()}blur(){var t;null===(t=this.inputElement)||void 0===t||t.blur()}setDisabled(t){var e,i,s,n;if(this.inputElement){this.inputElement.disabled=t;const r=t?null===(i=null===(e=this.props)||void 0===e?void 0:e.box)||void 0===i?void 0:i.disabled:null===(n=null===(s=this.props)||void 0===s?void 0:s.box)||void 0===n?void 0:n.default;void 0!==(null==r?void 0:r.fill)&&(this.inputElement.style.backgroundColor="#"+r.fill.toString(16).padStart(6,"0"))}}getType(){return"ZTextInput"}}var y=i(673);class x{constructor(t,e,i){this.phaserScene=t,this.spineData=e,this.assetBasePath=i.endsWith("/")?i:i+"/"}load(t){return e=this,i=void 0,n=function*(){var e,i;const s=this.phaserScene,n=this.spineData,r=this.assetBasePath,a=s.spine;if(!a)return console.warn(`ZSpine: SpinePlugin not registered on scene.\nAdd to Phaser config: plugins: { scene: [{ key:"SpinePlugin", plugin: SpinePlugin, mapping:"spine" }] }\nSpine asset "${n.name}" will not be displayed.`),void t(void 0);const o=Math.random().toString(36).slice(2),h=`${n.name}_json_${o}`,l=`${n.name}_atlas_${o}`;try{if(n.spineAtlas&&""!==n.spineAtlas)s.load.spineJson(h,r+n.spineJson),s.load.spineAtlas(l,r+n.spineAtlas),yield this.waitForLoader();else{if(!(n.pngFiles&&n.pngFiles.length>0))return console.warn(`ZSpine: No atlas or pngFiles for "${n.name}"`),void t(void 0);{const[t]=yield Promise.all([fetch(r+n.spineJson).then((t=>t.json())),this.loadImages(n.pngFiles,r)]);yield this.loadJsonFile(h,r+n.spineJson),this.buildAndInjectAtlas(l,n.pngFiles,t,a)}}const o=s.add.spine(0,0,h,l);if(!o)return console.error(`ZSpine: scene.add.spine returned null for "${n.name}"`),void t(void 0);if(n.skin)try{o.skeleton.setSkinByName(n.skin),o.skeleton.setToSetupPose()}catch(t){}if((null===(e=n.playOnStart)||void 0===e?void 0:e.value)&&(null===(i=n.playOnStart)||void 0===i?void 0:i.animation))try{o.animationState.setAnimation(0,n.playOnStart.animation,!0)}catch(t){}t(o)}catch(e){console.error(`ZSpine: Error loading "${n.name}":`,e),t(void 0)}},new((s=void 0)||(s=Promise))((function(t,r){function a(t){try{h(n.next(t))}catch(t){r(t)}}function o(t){try{h(n.throw(t))}catch(t){r(t)}}function h(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(a,o)}h((n=n.apply(e,i||[])).next())}));var e,i,s,n}buildAndInjectAtlas(t,e,s,n){var r,a,o;const h=n.isWebGL,l=n.gl,u=new y.Lw("");u.pages=[],u.regions=[];for(const t of e){const e=this.texKey(t),s=this.phaserScene.textures.get(e),n=null===(r=null==s?void 0:s.getSourceImage)||void 0===r?void 0:r.call(s);if(!n){console.warn(`ZSpine: No loaded image for "${t}" (key: ${e})`);continue}const a=n.naturalWidth||n.width||1,o=n.naturalHeight||n.height||1,c=this.fileName(t),d=this.baseName(t),f=new y.Pd(c);f.width=a,f.height=o,f.minFilter=y.O$.Linear,f.magFilter=y.O$.Linear,f.uWrap=y.w3.ClampToEdge,f.vWrap=y.w3.ClampToEdge;const p=new y.TE(f,d);if(p.x=0,p.y=0,p.width=a,p.height=o,p.originalWidth=a,p.originalHeight=o,p.offsetX=0,p.offsetY=0,p.degrees=0,p.index=-1,p.u=0,p.v=0,p.u2=1,p.v2=1,h&&l){const{GLTexture:t}=i(549);f.setTexture(new t(l,n,!1))}else{const{CanvasTexture:t}=i(421);f.setTexture(new t(n))}u.pages.push(f),u.regions.push(p);const g=d.match(/^(.*?)(\d+)$/);if(g&&0===parseInt(g[2],10)){const t=g[1];if(!u.regions.find((e=>e.name===t))){const e=new y.TE(f,t);e.x=p.x,e.y=p.y,e.width=p.width,e.height=p.height,e.originalWidth=p.originalWidth,e.originalHeight=p.originalHeight,e.offsetX=p.offsetX,e.offsetY=p.offsetY,e.degrees=p.degrees,e.index=p.index,e.u=p.u,e.v=p.v,e.u2=p.u2,e.v2=p.v2,u.regions.push(e)}}}const c=new Set(u.regions.map((t=>t.name))),d=document.createElement("canvas");d.width=1,d.height=1;const f=new Image(1,1);f.src=d.toDataURL();const p=new y.Pd("__fallback__.png");if(p.width=1,p.height=1,p.minFilter=y.O$.Linear,p.magFilter=y.O$.Linear,p.uWrap=y.w3.ClampToEdge,p.vWrap=y.w3.ClampToEdge,h&&l){const{GLTexture:t}=i(549);p.setTexture(new t(l,f,!1))}else{const{CanvasTexture:t}=i(421);p.setTexture(new t(f))}let g=!1;const m=null!==(a=null==s?void 0:s.skins)&&void 0!==a?a:[];for(const t of m)if(t.attachments)for(const e of Object.values(t.attachments))for(const[t,i]of Object.entries(e)){const e=null!==(o=null==i?void 0:i.path)&&void 0!==o?o:t;if(!c.has(e)){console.warn(`ZSpine "${this.spineData.name}": region "${e}" not in pngFiles — using transparent fallback`);const t=new y.TE(p,e);t.x=0,t.y=0,t.width=1,t.height=1,t.originalWidth=1,t.originalHeight=1,t.offsetX=0,t.offsetY=0,t.degrees=0,t.index=-1,t.u=0,t.v=0,t.u2=1,t.v2=1,u.regions.push(t),c.add(e),g=!0}}g&&u.pages.push(p);const v=n.atlasCache;v?v.add(t,u):console.error("ZSpine: SpinePlugin.atlasCache not accessible")}loadImages(t,e){let i=0;for(const s of t){const t=this.texKey(s);this.phaserScene.textures.exists(t)||(this.phaserScene.load.image(t,e+s),i++)}return 0===i?Promise.resolve():this.waitForLoader()}loadJsonFile(t,e){return this.phaserScene.load.json(t,e),this.waitForLoader()}waitForLoader(){return new Promise(((t,e)=>{this.phaserScene.load.isLoading()?(this.phaserScene.load.once("complete",(()=>t())),this.phaserScene.load.once("loaderror",(t=>e(new Error(`ZSpine: Load error for ${null==t?void 0:t.key}`))))):(this.phaserScene.load.once("complete",(()=>t())),this.phaserScene.load.once("loaderror",(t=>e(new Error(`ZSpine: Load error for ${null==t?void 0:t.key}`)))),this.phaserScene.load.start())}))}texKey(t){return`${this.spineData.name}_tex_${t.replace(/[^a-zA-Z0-9]/g,"_")}`}fileName(t){return t.includes("/")?t.substring(t.lastIndexOf("/")+1):t}baseName(t){const e=this.fileName(t);return e.includes(".")?e.substring(0,e.lastIndexOf(".")):e}}var w=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{h(s.next(t))}catch(t){r(t)}}function o(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((s=s.apply(t,e||[])).next())}))};class b{constructor(t,e){this.assetBasePath="",this.resizeMap=new Map,this.orientation="portrait",this.sceneName=null,this.usesAtlas=!0,this.sceneId=t,this.phaserScene=e,this.setOrientation(),b.Map.set(t,this)}destroy(){return w(this,void 0,void 0,(function*(){this._sceneStage&&(this._sceneStage.removeAll(!0),this._sceneStage.scene&&this._sceneStage.scene.children.remove(this._sceneStage)),this.sceneName&&this.phaserScene.textures.exists(this.sceneName)&&this.phaserScene.textures.remove(this.sceneName)}))}createBitmapTextFromXML(t,e,i,s,n){return w(this,void 0,void 0,(function*(){const e=yield fetch(t);if(!e.ok)throw new Error(`Failed to fetch XML font data: ${e.statusText}`);const s=yield e.text(),r=(new DOMParser).parseFromString(s,"text/xml").querySelector("page");if(!r)throw new Error("Page element not found in XML");const a=r.getAttribute("file");if(!a)throw new Error("Page file attribute not found in XML");const o=this.assetBasePath+a;return yield this.loadTexture(o),this.phaserScene.cache.bitmapFont.exists(i)&&n(),null}))}loadTexture(t){return new Promise(((e,i)=>{const s="dynamic_"+Math.random().toString(36).substr(2,9);this.phaserScene.load.image(s,t),this.phaserScene.load.once("filecomplete-image-"+s,(()=>{e()})),this.phaserScene.load.once("loaderror",(t=>{t.key===s&&i(new Error("Failed to load texture."))})),this.phaserScene.load.start()}))}applyFilters(t,e){if(t.filters&&Array.isArray(t.filters))for(const e of t.filters);}get sceneStage(){return this._sceneStage}setOrientation(){var t,e;let i,s;(null===(t=this.phaserScene)||void 0===t?void 0:t.scale)?(i=this.phaserScene.scale.width,s=this.phaserScene.scale.height):(i=window.innerWidth,s=window.innerHeight),i!==s&&0!==i&&0!==s||!(null===(e=this.data)||void 0===e?void 0:e.resolution)?this.orientation=i>s?"landscape":"portrait":this.orientation=this.data.resolution.x>=this.data.resolution.y?"landscape":"portrait"}static getSceneById(t){return b.Map.get(t)}loadStage(t,e=!0){this.orientation="portrait";const i=this.data.stage,s=null==i?void 0:i.children;if(s&&e)for(const t of s){const e=t.name,i=this.spawn(e);i?(i.setInstanceData(t,this.orientation),this.addToResizeMap(i),this._sceneStage.add(i),this._sceneStage[i.name]=i):console.warn("Failed to spawn template:",e)}this.phaserScene.add.existing(this._sceneStage);const n=this.phaserScene.scale.width||window.innerWidth,r=this.phaserScene.scale.height||window.innerHeight;this.resize(n,r)}getInnerDimensions(){var t;if(!(null===(t=this.data)||void 0===t?void 0:t.resolution))return{width:0,height:0};let e=this.data.resolution.x,i=this.data.resolution.y;return"portrait"===this.orientation&&([e,i]=[i,e]),{width:e,height:i}}addToResizeMap(t){this.resizeMap.set(t,!0)}removeFromResizeMap(t){this.resizeMap.delete(t)}resize(t,e){var i;if(!(null===(i=this.data)||void 0===i?void 0:i.resolution))return;this.setOrientation();let s=this.data.resolution.x,n=this.data.resolution.y;"portrait"===this.orientation&&([s,n]=[n,s]);const r=t/s,a=e/n,o=Math.min(r,a);this._sceneStage.setScale(o),this._sceneStage.setPosition((t-s*o)/2,(e-n*o)/2);for(const[t]of this.resizeMap)t.currentTransform="portrait"===this.orientation?t.portrait:t.landscape;for(const[i]of this.resizeMap)i.resize(t,e,this.orientation)}get sceneWidth(){let t=this.data.resolution.x;return"portrait"===this.orientation&&(t=this.data.resolution.y),t}get sceneHeight(){let t=this.data.resolution.y;return"portrait"===this.orientation&&(t=this.data.resolution.x),t}load(t,e){return w(this,void 0,void 0,(function*(){this._sceneStage=new n(this.phaserScene),this.assetBasePath=t;const i=t+"placements.json?rnd="+Math.random();try{const s=yield fetch(i),n=yield s.json();this.loadAssets(t,n,e)}catch(t){console.error("Failed to load placements:",t)}}))}loadAssets(t,e,i){return w(this,void 0,void 0,(function*(){var s;const n=null===(s=e.atlas)||void 0===s||s;if(this.usesAtlas=!!n,n){const s="sceneAtlas",n=t+"ta.json?rnd="+Math.random(),r=t+"ta.png?rnd="+Math.random();return this.phaserScene.load.once("filecomplete-image-"+s,(()=>{})),this.phaserScene.load.once("filecomplete-json-"+s,(()=>{})),this.phaserScene.load.once("loaderror",(t=>{})),this.phaserScene.load.atlas(s,r,n),this.phaserScene.load.once("complete",(()=>{const t=this.phaserScene.textures.get(s);t?(0===Object.keys(t.frames).length&&console.warn("Atlas has no frames! Check JSON format."),this.scene=t,this.sceneName=s,this.initScene(e),i()):console.error("Atlas texture not found after load complete:",s)})),void this.phaserScene.load.start()}if(this.createImagesObject(t,e).forEach((t=>{this.phaserScene.textures.exists(t.alias)||this.phaserScene.load.image(t.alias,t.src)})),e.fonts&&e.fonts.length>0){const s=e.fonts;for(const e of s){const i=t+e+".png",s=t+e+".fnt";this.phaserScene.load.bitmapFont(e,i,s)}return this.phaserScene.load.once("complete",(()=>{this.sceneName="images",this.initScene(e),i()})),void this.phaserScene.load.start()}this.phaserScene.load.once("complete",(()=>{this.sceneName="images",this.initScene(e),i()})),this.phaserScene.load.start()}))}initScene(t){this.data=t}static getAssetType(t){return this.assetTypes.get(t)}static isAssetType(t){return this.assetTypes.has(t)}spawn(t){var e;const i=this.data.templates[t];if(!i)return void console.warn("Template not found:",t);let s;const r=this.getChildrenFrames(t);return Object.keys(r).length>0?(s=new c(this.phaserScene),this.createAsset(s,i),s.setFrames(r),(null===(e=this.data.cuePoints)||void 0===e?void 0:e[t])&&s.setCuePoints(this.data.cuePoints[t]),s.gotoAndStop(0)):(s=new(b.getAssetType(i.type)||n)(this.phaserScene),this.createAsset(s,i),s.init()),s}getChildrenFrames(t){const e={},i=this.data.templates,s=this.data.animTracks,n=i[t];if(null==n?void 0:n.children)for(const i of n.children){const n=i,r=n.instanceName+"_"+t;s[r]&&(e[n.instanceName]=s[r])}return e}createAsset(t,e){return w(this,void 0,void 0,(function*(){var i,s,r,a,o,h,l,u,d,f,p,g,y,w,T,S,E,A,C,M,_,R,P,L,F,O,D;for(const k of e.children){const e=k.type;let I;if("inputField"===e){try{const e=k,i=new v(this.phaserScene,e);i.setName(e.name),t[e.name]=i,t.add(i),this.applyFilters(k,i)}catch(t){console.warn(`ZScene: Failed to create inputField "${k.name}":`,t)}continue}if("bitmapFontLocked"===e){const e=k;if(e.fontName&&this.phaserScene.cache.bitmapFont.exists(e.fontName)){const n=(null!==(i=e.x)&&void 0!==i?i:0)-(null!==(s=e.pivotX)&&void 0!==s?s:0),o=(null!==(r=e.y)&&void 0!==r?r:0)-(null!==(a=e.pivotY)&&void 0!==a?a:0),h=this.phaserScene.add.bitmapText(n,o,e.fontName,e.text||"");void 0!==e.textAnchorX&&void 0!==e.textAnchorY&&h.setOrigin(e.textAnchorX,e.textAnchorY),h.currentTransform={x:n,y:o},h.setName(e.name),t[e.name]=h,t.add(h),this.applyFilters(k,h)}continue}if("textField"===e||"bmpTextField"===e||"bitmapText"===e){const e=k,i=(null!==(o=e.x)&&void 0!==o?o:0)-(null!==(h=e.pivotX)&&void 0!==h?h:0),s=(null!==(l=e.y)&&void 0!==l?l:0)-(null!==(u=e.pivotY)&&void 0!==u?u:0),n=e.uniqueFontName||e.fontName;if(n&&this.phaserScene.cache.bitmapFont.exists(n)){const r=this.phaserScene.add.bitmapText(i,s,n,e.text||"",e.size||void 0);"number"==typeof e.letterSpacing&&r.setLetterSpacing(e.letterSpacing),void 0!==e.textAnchorX&&void 0!==e.textAnchorY&&r.setOrigin(e.textAnchorX,e.textAnchorY),e.rotation&&(r.rotation=e.rotation),void 0!==e.alpha&&(r.alpha=e.alpha),r.currentTransform={x:i,y:s},r.setName(e.name),t.add(r),t[e.name]=r,this.applyFilters(k,r)}else{let n="#ffffff";const r=e.gradientData;if("gradient"===e.fillType&&(null==r?void 0:r.colors)&&r.colors.length>=2){const t=r.colors[0];n="number"==typeof t?"#"+t.toString(16).padStart(6,"0"):t,console.warn(`ZScene: gradient fill on text "${e.name}" — using first color only (Phaser Text has no native gradient)`)}else void 0!==e.color&&null!==e.color&&(n="number"==typeof e.color?"#"+e.color.toString(16).padStart(6,"0"):e.color);const a={fontFamily:e.fontName||"Arial",fontSize:"number"==typeof e.size?`${e.size}px`:e.size,color:n,align:e.align||"left"};if("string"==typeof e.fontWeight&&(a.fontStyle=e.fontWeight),e.wordWrap&&(a.wordWrap={width:null!==(d=e.wordWrapWidth)&&void 0!==d?d:0,useAdvancedWrap:!0}),e.breakWords&&(a.wordWrap||(a.wordWrap={width:null!==(f=e.wordWrapWidth)&&void 0!==f?f:500,useAdvancedWrap:!1})),"string"==typeof e.stroke||"number"==typeof e.stroke){const t="number"==typeof e.stroke?"#"+e.stroke.toString(16).padStart(6,"0"):e.stroke;a.stroke=t,a.strokeThickness=null!==(p=e.strokeThickness)&&void 0!==p?p:0}"number"==typeof e.padding?a.padding={x:e.padding,y:e.padding}:Array.isArray(e.padding)&&(a.padding={left:e.padding[0],top:null!==(g=e.padding[1])&&void 0!==g?g:e.padding[0]});const o=this.phaserScene.add.text(i,s,(null!==(y=e.text)&&void 0!==y?y:"")+"",a);if("number"==typeof e.letterSpacing&&o.setLetterSpacing(e.letterSpacing),"number"==typeof e.leading&&o.setLineSpacing(e.leading),e.dropShadow){const t=null!==(w=e.dropShadowAngle)&&void 0!==w?w:0,i=null!==(T=e.dropShadowDistance)&&void 0!==T?T:4,s="number"==typeof e.dropShadowColor?"#"+e.dropShadowColor.toString(16).padStart(6,"0"):e.dropShadowColor||"#000000";o.setShadow(Math.cos(t)*i,Math.sin(t)*i,s,null!==(S=e.dropShadowBlur)&&void 0!==S?S:0,!1,!0)}void 0!==e.textAnchorX&&void 0!==e.textAnchorY&&o.setOrigin(e.textAnchorX,e.textAnchorY),e.rotation&&(o.rotation=e.rotation),void 0!==e.alpha&&(o.alpha=e.alpha),o.currentTransform={x:i,y:s},o.setName(e.name),t[e.name]=o,t.add(o),this.applyFilters(k,o)}}if("img"===e){const e=k,i=e.name.replace(/(_IMG|_9S)$/,"");if(this.usesAtlas){const t=this.scene;if(!t){console.error("Cannot create sprite - atlas texture not loaded");continue}t.has(i)||console.warn("Frame not found in atlas:",i),I=this.phaserScene.add.sprite(null!==(E=e.x)&&void 0!==E?E:0,null!==(A=e.y)&&void 0!==A?A:0,this.sceneName,i)}else I=this.phaserScene.add.sprite(null!==(C=e.x)&&void 0!==C?C:0,null!==(M=e.y)&&void 0!==M?M:0,i);if(!I){console.error("Failed to create sprite for:",i);continue}I.setDisplaySize(e.width,e.height);const s=null!==(_=e.pivotX)&&void 0!==_?_:0,n=null!==(R=e.pivotY)&&void 0!==R?R:0,r=e.width>0?s/e.width:0,a=e.height>0?n/e.height:0;I.setOrigin(r,a),I.currentTransform={x:null!==(P=e.x)&&void 0!==P?P:0,y:null!==(L=e.y)&&void 0!==L?L:0},t.add(I),t[e.name]=I,this.applyFilters(k,I)}if("9slice"===e){const e=k,i=e.name.replace("_9S",""),s=this.usesAtlas?this.sceneName:i,n=this.usesAtlas?i:void 0,r=new m(this.phaserScene,0,0,s,n,e,this.orientation);t.add(r),t[e.name]=r,this.addToResizeMap(r)}if(b.isAssetType(e)){const i=k,s=this.getChildrenFrames(k.name);if(Object.keys(s).length>0?(I=new c(this.phaserScene),I.setFrames(s),(null===(F=this.data.cuePoints)||void 0===F?void 0:F[k.name])&&I.setCuePoints(this.data.cuePoints[k.name])):I=new(b.getAssetType(e)||n)(this.phaserScene),I.name=i.instanceName,!I.name)continue;t[I.name]=I,this.applyFilters(k,I),I.setInstanceData(i,this.orientation),t.add(I),this.addToResizeMap(I)}if("particle"===e){const e=k;let i=this.assetBasePath;i.endsWith("/")||(i+="/");const s=Array.isArray(e.pngPaths)?e.pngPaths:[e.pngPaths],n=[],r=s.map((t=>new Promise((e=>{const s="particle_"+t.replace(/[^a-zA-Z0-9]/g,"_");n.push(s),this.phaserScene.textures.exists(s)?e():(this.phaserScene.load.image(s,i+t),this.phaserScene.load.once("filecomplete-image-"+s,(()=>e())),this.phaserScene.load.once("loaderror",(()=>e())),this.phaserScene.load.start())}))));Promise.all(r).then((()=>{const s=i+e.jsonPath+"?t="+Date.now();fetch(s).then((t=>t.json())).then((i=>{try{const s=n[0];if(s&&this.phaserScene.textures.exists(s)){const n=this.phaserScene.add.particles(0,0,s,i);n.setName(e.name||k.name),t.add(n),t[k.name]=n}}catch(t){console.error("Error creating particle emitter:",t)}})).catch((t=>console.error("Failed to load particle config:",t)))}));continue}if("spine"===e){const e=k;let i=this.assetBasePath;i.endsWith("/")||(i+="/"),new x(this.phaserScene,e,i).load((i=>{if(i){i.setName(e.name||k.name),t.add(i),t[k.name]=i;const s=this.phaserScene.scale.width||window.innerWidth,n=this.phaserScene.scale.height||window.innerHeight;this.resize(s,n)}}));continue}const B=this.data.templates[k.name];(null==B?void 0:B.children)&&(this.createAsset(I||t,B),null===(O=null==I?void 0:I.applyTransform)||void 0===O||O.call(I)),null===(D=null==I?void 0:I.init)||void 0===D||D.call(I)}}))}createImagesObject(t,e){const i=[],s={},n=e.templates;for(const e in n){const r=n[e].children;for(const e of r)if("img"===e.type||"9slice"===e.type){const n=e;if(!s[n.name]){s[n.name]=!0;let e=n.name.endsWith("_9S")?n.name.slice(0,-3):n.name;e=e.endsWith("_IMG")?e.slice(0,-4):e,i.push({alias:e,src:t+n.filePath})}}}return i}}b.assetTypes=new Map([["btn",o],["asset",n],["state",d],["toggle",f],["slider",p],["scrollBar",g],["fullScreen",n],["animation",c]]),b.Map=new Map;class T{static push(t){this.stack[this.top]=t,this.top++,this.stackSize++}static pop(){return this.stackSize>0?(this.top--,this.stackSize--,this.stack[this.top]):null}static peek(){return this.stackSize>0?this.stack[this.top-1]:null}static getStackSize(){return this.stackSize}static clear(){this.stack=[],this.stackSize=0,this.top=0}static spawn(t){for(let e=this.stack.length-1;e>=0;e--){let i=this.stack[e].spawn(t);if(i)return i}}static resize(t,e){for(let i=this.stack.length-1;i>=0;i--)this.stack[i].resize(t,e)}}if(T.stack=[],T.stackSize=0,T.top=0,"undefined"!=typeof window&&window.Phaser){let t=window.require;window.require=e=>t?t(e):"Phaser"===e?window.Phaser:void 0}const S="spine";var E=i(549);let A=Phaser.GameObjects.Components;const C=A.ComputedSize,M=A.Depth,_=A.Flip,R=A.ScrollFactor,P=A.Transform,L=A.Visible,F=A.Origin,O=A.Alpha;function D(...t){return e=>(Phaser.Class.mixin(e,t),e)}const k=D(C),I=D(M),B=D(_),N=D(R),Y=D(P),X=D(L),U=D(F),z=D(O);class G extends Phaser.GameObjects.GameObject{constructor(t,e){super(t,e)}}class V{calculateBounds(t){if(!t.skeleton)return{x:0,y:0,width:0,height:0};const e=new y.EA(t.skeleton.data);e.setToSetupPose(),e.updateWorldTransform();const i=e.getBoundsRect();return i.width==Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:i}}class W extends(I(U(k(B(N(Y(X(z(G))))))))){plugin;boundsProvider;blendMode=-1;skeleton;animationStateData;animationState;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};premultipliedAlpha=!1;constructor(t,e,i,s,n,r,a=new V){super(t,window.SPINE_GAME_OBJECT_TYPE?window.SPINE_GAME_OBJECT_TYPE:S),this.plugin=e,this.boundsProvider=a,this.setPosition(i,s),this.premultipliedAlpha=this.plugin.isAtlasPremultiplied(r),this.skeleton=this.plugin.createSkeleton(n,r),this.animationStateData=new y.Qq(this.skeleton.data),this.animationState=new y.oA(this.animationStateData),this.skeleton.updateWorldTransform(),this.updateSize()}updateSize(){if(!this.skeleton)return;let t=this.boundsProvider.calculateBounds(this);this.width=t.width,this.height=t.height,this.displayOriginX=-t.x,this.displayOriginY=-t.y}skeletonToPhaserWorldCoordinates(t){let e=this.getWorldTransformMatrix(),i=e.a,s=e.b,n=e.c,r=e.d,a=e.tx,o=e.ty,h=t.x,l=t.y;t.x=h*i+l*n+a,t.y=h*s+l*r+o}phaserWorldCoordinatesToSkeleton(t){let e=this.getWorldTransformMatrix();e=e.invert();let i=e.a,s=e.b,n=e.c,r=e.d,a=e.tx,o=e.ty,h=t.x,l=t.y;t.x=h*i+l*n+a,t.y=h*s+l*r+o}phaserWorldCoordinatesToBone(t,e){this.phaserWorldCoordinatesToSkeleton(t),e.parent?e.parent.worldToLocal(t):e.worldToLocal(t)}updatePose(t){this.animationState.update(t/1e3),this.animationState.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.updateWorldTransform(),this.afterUpdateWorldTransforms(this)}preUpdate(t,e){this.skeleton&&this.animationState&&this.updatePose(e)}preDestroy(){}willRender(t){var e=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(this.visible||(e=!1),!e&&this.parentContainer&&this.plugin.webGLRenderer){var i=this.plugin.webGLRenderer;this.plugin.gl&&this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer&&i.batcher.isDrawing&&(i.end(),this.plugin.phaserRenderer.pipelines.rebind())}return e}renderWebGL(t,e,i,s){if(!this.skeleton||!this.animationState||!this.plugin.webGLRenderer)return;let n=this.plugin.webGLRenderer;t.newType&&(t.pipelines.clear(),n.begin()),i.addToRenderList(e);let r=Phaser.GameObjects.GetCalcMatrix(e,i,s).calc,a=r.a,o=r.b,h=r.c,l=r.d,u=r.tx,c=r.ty;n.drawSkeleton(this.skeleton,this.premultipliedAlpha,-1,-1,((t,e,i)=>{for(let s=0;s<e;s+=i){let e=t[s],i=t[s+1];t[s]=e*a+i*h+u,t[s+1]=e*o+i*l+c}})),t.nextTypeMatch||(n.end(),t.pipelines.rebind())}renderCanvas(t,e,i,s){if(!this.skeleton||!this.animationState||!this.plugin.canvasRenderer)return;let n=t.currentContext,r=this.plugin.canvasRenderer;r.ctx=n,i.addToRenderList(e);let a=Phaser.GameObjects.GetCalcMatrix(e,i,s).calc,o=this.skeleton;o.x=a.tx,o.y=a.ty,o.scaleX=a.scaleX,o.scaleY=a.scaleY,o.getRootBone().rotation=-y.cj.radiansToDegrees*a.rotationNormalized,this.skeleton.updateWorldTransform(),n.save(),r.draw(o),n.restore()}}var H,j=i(421);class q extends t.Plugins.ScenePlugin{game;isWebGL;gl;static gameWebGLRenderer=null;get webGLRenderer(){return q.gameWebGLRenderer}canvasRenderer;phaserRenderer;skeletonDataCache;atlasCache;constructor(e,i,s){super(e,i,s),this.game=i.game,this.isWebGL=2===this.game.config.renderType,this.gl=this.isWebGL?this.game.renderer.gl:null,this.phaserRenderer=this.game.renderer,this.canvasRenderer=null,this.skeletonDataCache=this.game.cache.addCustom("esotericsoftware.spine.skeletonFile.cache"),this.atlasCache=this.game.cache.addCustom("esotericsoftware.spine.atlas.cache"),i.registerFileType("spineJson",(function(t,e,i){let s=new K(this,t,e,H.json,i);return this.addFile(s.files),this}),e),i.registerFileType("spineBinary",(function(t,e,i){let s=new K(this,t,e,H.binary,i);return this.addFile(s.files),this}),e),i.registerFileType("spineAtlas",(function(t,e,i,s){let n=new Z(this,t,e,i,s);return this.addFile(n.files),this}),e);let n=this;i.registerGameObject(window.SPINE_GAME_OBJECT_TYPE?window.SPINE_GAME_OBJECT_TYPE:S,(function(t,e,i,s,r){let a=new W(this.scene,n,t,e,i,s,r);return this.displayList.add(a),this.updateList.add(a),a}),(function(e,i=!1){let s=e.x?e.x:0,r=e.y?e.y:0,a=e.boundsProvider?e.boundsProvider:void 0,o=new W(this.scene,n,s,r,e.dataKey,e.atlasKey,a);return void 0!==i&&(e.add=i),t.GameObjects.BuildGameObject(this.scene,o,e)}))}static rendererId=0;boot(){E.Skeleton.yDown=!0,this.isWebGL?(q.gameWebGLRenderer||(q.gameWebGLRenderer=new E.SceneRenderer(this.game.renderer.canvas,this.gl,!0)),this.onResize(),this.game.scale.on(t.Scale.Events.RESIZE,this.onResize,this)):this.canvasRenderer||(this.canvasRenderer=new j.SkeletonRenderer(this.scene.sys.context));var e=this.systems.events;e.once("shutdown",this.shutdown,this),e.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)}onResize(){var t=this.game.renderer,e=this.webGLRenderer;if(t&&e){var i=t.width,s=t.height;e.camera.position.x=i/2,e.camera.position.y=s/2,e.camera.up.y=-1,e.camera.direction.z=1,e.camera.setViewport(i,s)}}shutdown(){this.systems.events.off("shutdown",this.shutdown,this),this.isWebGL&&this.game.scale.off(t.Scale.Events.RESIZE,this.onResize,this)}destroy(){this.shutdown()}gameDestroy(){this.pluginManager.removeGameObject(window.SPINE_GAME_OBJECT_TYPE?window.SPINE_GAME_OBJECT_TYPE:S,!0,!0),this.webGLRenderer&&this.webGLRenderer.dispose(),q.gameWebGLRenderer=null}getAtlas(t){let e;if(this.atlasCache.exists(t))e=this.atlasCache.get(t);else{let i=this.game.cache.text.get(t);if(e=new E.TextureAtlas(i.data),this.isWebGL){let i=this.gl;const s=i.getParameter(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL);s&&i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);for(let s of e.pages)s.setTexture(new E.GLTexture(i,this.game.textures.get(t+"!"+s.name).getSourceImage(),!1));s&&i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}else for(let i of e.pages)i.setTexture(new j.CanvasTexture(this.game.textures.get(t+"!"+i.name).getSourceImage()));this.atlasCache.add(t,e)}return e}isAtlasPremultiplied(t){let e=this.game.cache.text.get(t);return!!e&&e.premultipliedAlpha}getSkeletonData(t,e){const i=this.getAtlas(e),s=t+e;let n;if(this.skeletonDataCache.exists(s))n=this.skeletonDataCache.get(s);else{if(this.game.cache.json.exists(t)){let e=this.game.cache.json.get(t);n=new E.SkeletonJson(new E.AtlasAttachmentLoader(i)).readSkeletonData(e)}else{let e=this.game.cache.binary.get(t);n=new E.SkeletonBinary(new E.AtlasAttachmentLoader(i)).readSkeletonData(new Uint8Array(e))}this.skeletonDataCache.add(s,n)}return n}createSkeleton(t,e){return new E.Skeleton(this.getSkeletonData(t,e))}}!function(t){t[t.json=0]="json",t[t.binary=1]="binary"}(H||(H={}));class K extends t.Loader.MultiFile{fileType;constructor(e,i,s,n,r){if("string"!=typeof i){const t=i;i=t.key,s=t.url,n="spineJson"===t.type?H.json:H.binary,r=t.xhrSettings}let a=null;a=n==H.json?new t.Loader.FileTypes.JSONFile(e,{key:i,url:s,extension:"json",xhrSettings:r}):new t.Loader.FileTypes.BinaryFile(e,{key:i,url:s,extension:"skel",xhrSettings:r}),super(e,"spineSkeletonData",i,[a]),this.fileType=n}onFileComplete(t){this.pending--}addToCache(){this.isReadyToProcess()&&this.files[0].addToCache()}}class Z extends t.Loader.MultiFile{premultipliedAlpha;constructor(e,i,s,n,r){if("string"!=typeof i){const t=i;i=t.key,s=t.url,n=t.premultipliedAlpha,r=t.xhrSettings}super(e,"spineAtlasData",i,[new t.Loader.FileTypes.TextFile(e,{key:i,url:s,xhrSettings:r,extension:"atlas"})]),this.premultipliedAlpha=n}onFileComplete(e){if(-1!=this.files.indexOf(e)&&(this.pending--,"text"==e.type)){var i=e.data.split(/\r\n|\r|\n/);let l=[];l.push(i[0]);for(var s=1;s<i.length;s++){var n=i[s];""===n.trim()&&s<i.length-1&&(n=i[s+1],l.push(n))}let u=e.src.match(/^.*\//)??"";for(var r=0;r<l.length;r++){var a=u+l[r],o=e.key+"!"+l[r],h=new t.Loader.FileTypes.ImageFile(this.loader,o,a);this.loader.keyExists(h)||(this.addToMultiFile(h),this.loader.addFile(h))}}}addToCache(){if(this.isReadyToProcess()){let t=this.loader.textureManager;for(let e of this.files)"image"==e.type?t.exists(e.key)||t.addImage(e.key,e.data):(this.premultipliedAlpha=this.premultipliedAlpha??(e.data.indexOf("pma: true")>=0||e.data.indexOf("pma:true")>=0),e.data={data:e.data,premultipliedAlpha:this.premultipliedAlpha},e.addToCache())}}}window.spine={SpinePlugin:q},window["spine.SpinePlugin"]=q})(),s})()));
|
|
3
|
+
//# sourceMappingURL=zimporter-phaser.min.js.map
|