From 466b62a8514465058ea3f2714cdd765caad14787 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Mar 2026 16:25:35 +0000 Subject: [PATCH 1/2] Refactor API: add renderer export, fix rolldown builds, update docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add solidion/renderer to package.json exports and all example vite.config.ts aliases to fix Vite 8 rolldown build failures - Update README: test count (101→443), project structure (add ecs/, debug/), list all 5 examples - Add import statements to guide pages (components, behaviors, hooks) in both EN and JA - Create ECS guide (EN + JA) documenting step functions, System component, and forActive helper - Update CLAUDE.md test count https://claude.ai/code/session_013XHS9XjPJ3tkMikyjVXNUC --- CLAUDE.md | 2 +- README.md | 33 +++++--- .../{index-DXpeFDb9.js => index-CBWJ4zHt.js} | 2 +- examples/aquarium/dist/index.html | 2 +- examples/aquarium/vite.config.ts | 1 + .../{index-C5iHtZ1c.js => index-ClY0sCA3.js} | 2 +- examples/breakout/dist/index.html | 2 +- examples/breakout/vite.config.ts | 1 + .../{index-BQY7vmBW.js => index-BTNBT8dr.js} | 2 +- examples/floppy-heads/dist/index.html | 2 +- examples/floppy-heads/vite.config.ts | 1 + .../{index-BtiCr2mZ.js => index-DirEFGQ8.js} | 2 +- examples/nadion-defense/dist/index.html | 2 +- examples/nadion-defense/vite.config.ts | 1 + .../{index-157JVz5-.js => index-yj2HKat-.js} | 2 +- examples/null-pow/dist/index.html | 2 +- examples/null-pow/vite.config.ts | 1 + package.json | 3 + site/src/content/docs/guides/behaviors.md | 4 + site/src/content/docs/guides/components.md | 4 + site/src/content/docs/guides/ecs.md | 84 +++++++++++++++++++ site/src/content/docs/guides/hooks.md | 5 ++ site/src/content/docs/ja/guides/behaviors.md | 4 + site/src/content/docs/ja/guides/components.md | 4 + site/src/content/docs/ja/guides/ecs.md | 84 +++++++++++++++++++ site/src/content/docs/ja/guides/hooks.md | 5 ++ 26 files changed, 235 insertions(+), 22 deletions(-) rename examples/aquarium/dist/assets/{index-DXpeFDb9.js => index-CBWJ4zHt.js} (99%) rename examples/breakout/dist/assets/{index-C5iHtZ1c.js => index-ClY0sCA3.js} (99%) rename examples/floppy-heads/dist/assets/{index-BQY7vmBW.js => index-BTNBT8dr.js} (99%) rename examples/nadion-defense/dist/assets/{index-BtiCr2mZ.js => index-DirEFGQ8.js} (99%) rename examples/null-pow/dist/assets/{index-157JVz5-.js => index-yj2HKat-.js} (99%) create mode 100644 site/src/content/docs/guides/ecs.md create mode 100644 site/src/content/docs/ja/guides/ecs.md diff --git a/CLAUDE.md b/CLAUDE.md index 2a74c99..c8b8193 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,7 +34,7 @@ src/ contexts.ts # Solid contexts types.ts # JSX IntrinsicElements index.ts # Public API -tests/ # Unit (79) + Integration (13) + Component (9) = 101 tests +tests/ # 443 tests across 15 suites docs/ # Design specification examples/ # Runnable demos (breakout) ``` diff --git a/README.md b/README.md index 05ef665..fc12d04 100644 --- a/README.md +++ b/README.md @@ -57,14 +57,16 @@ solidion/ core/ # Renderer internals: meta, props, events, texture, scene-stack, frame, sync hooks/ # L1a/L1b hooks: useTween, useSpring, useStateMachine, etc. behaviors/ # L1c composition components: SpringBehavior, OscillateBehavior, etc. - components/ # Game, Scene, Preload, Overlay + components/ # Game, Scene, Preload, Overlay, GameLoop, Show, For + ecs/ # Data-driven ECS: pure step functions + System component + debug/ # Dev-only utilities: inspectBindings, profiling, expose renderer.ts # solid-js/universal createRenderer implementation contexts.ts # Solid contexts (Game, Scene, FrameManager, ParentNode) types.ts # JSX IntrinsicElements type definitions - index.ts # Public API - tests/ # Unit tests (79) + integration tests (13) + component tests (9) + index.ts # Public API (L0–L1c) + tests/ # 443 tests across 15 suites docs/ # Design specification - examples/ # Runnable demos + examples/ # Runnable demos (breakout, null-pow, floppy-heads, nadion-defense, aquarium) ``` ## Testing @@ -74,20 +76,25 @@ npm install npm test ``` -101 tests across 10 suites: +443 tests across 15 suites: | Suite | Tests | Scope | |---|---|---| +| renderer | 110 | Renderer logic (mock Phaser) | +| hooks | 107 | State machine, spring, tween, sequence, etc. | +| props | 48 | Property application & composition | +| ecs | 38 | Pure step functions & System component | +| texture | 29 | Texture auto-loading | +| components | 18 | Sync, reapplyProp, preload | +| visibility | 16 | Recursive visibility toggling | +| debug | 14 | Debug utilities & profiling | +| integration | 13 | Real Solid reactivity + renderer | +| contexts | 12 | Context providers & accessors | | meta | 11 | Metadata & delta system | | events | 9 | Event name resolution | -| props | 14 | Property application & composition | -| texture | 9 | Texture auto-loading | +| store-compat | 8 | SolidJS store compatibility | | scene-stack | 5 | Scene stack management | | frame | 5 | Frame callback lifecycle | -| renderer | 12 | Renderer logic (mock Phaser) | -| hooks | 14 | State machine & sequence logic | -| components | 9 | Sync, reapplyProp, preload | -| **integration** | **13** | **Real Solid reactivity + renderer** | ## Entry Points @@ -124,6 +131,10 @@ See [docs/solidion-spec.md](docs/solidion-spec.md) for the full design specifica See [examples/](examples/) for runnable demos. - **[Breakout](examples/breakout/)** — Block breaker game demonstrating reactive signals, frame-loop physics, batch updates, and conditional state +- **[Null Pow!](examples/null-pow/)** — Pac-Man-style maze game with ghost AI, useOverlap collision, and useScene keyboard input +- **[Floppy Heads](examples/floppy-heads/)** — Flappy Bird-style game with procedural pipe generation and score tracking +- **[Nadion Defense](examples/nadion-defense/)** — Space Invaders-style tower defense with 40 reactive enemies and projectile pools +- **[Aquarium](examples/aquarium/)** — Hybrid ECS + hooks demo with fish, food, bubbles, jellyfish, and seaweed ## Why "Solidion"? diff --git a/examples/aquarium/dist/assets/index-DXpeFDb9.js b/examples/aquarium/dist/assets/index-CBWJ4zHt.js similarity index 99% rename from examples/aquarium/dist/assets/index-DXpeFDb9.js rename to examples/aquarium/dist/assets/index-CBWJ4zHt.js index 9d9a4e2..52b07ec 100644 --- a/examples/aquarium/dist/assets/index-DXpeFDb9.js +++ b/examples/aquarium/dist/assets/index-CBWJ4zHt.js @@ -65,4 +65,4 @@ return new `+this.key+`(); `),s=/^[ ]*(- )*(\w+)+[: ]+(.*)/,c=``,l=``,u={x:0,y:0,width:0,height:0},d=0;d{var r=n(50030),i=function(e){for(var t=e.mipmaps,n=1;n{e.exports={AtlasXML:n(89905),Canvas:n(72893),Image:n(4832),JSONArray:n(78566),JSONHash:n(39711),KTXParser:n(31403),PVRParser:n(82038),SpriteSheet:n(75549),SpriteSheetFromAtlas:n(47534),UnityYAML:n(86147)}}),80341:(e=>{e.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}}),16536:((e,t,n)=>{e.exports=new(n(83419))({initialize:function(e,t,n,r,i,a,o){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),i===void 0&&(i=0),a===void 0&&(a=0),this.name=e,this.firstgid=t|0,this.imageWidth=n|0,this.imageHeight=r|0,this.imageMargin=i|0,this.imageSpacing=a|0,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(e){return e>=this.firstgid&&e{e.exports=new(n(83419))({initialize:function(e){if(this.gids=[],e!==void 0)for(var t=0;t{var r=n(80341),i=n(87010),a=n(46177),o=n(49075);e.exports=function(e,t,n,s,c,l,u,d){n===void 0&&(n=32),s===void 0&&(s=32),c===void 0&&(c=10),l===void 0&&(l=10),d===void 0&&(d=!1);var f=null;if(Array.isArray(u))f=a(t===void 0?`map`:t,r.ARRAY_2D,u,n,s,d);else if(t!==void 0){var p=e.cache.tilemap.get(t);p?f=a(t,p.format,p.data,n,s,d):console.warn(`No map data found for key `+t)}return f===null&&(f=new i({tileWidth:n,tileHeight:s,width:c,height:l})),new o(e,f)}}),23029:((e,t,n)=>{var r=n(83419),i=n(31401),a=n(91907),o=n(62644),s=n(93232);e.exports=new r({Mixins:[i.AlphaSingle,i.Flip,i.Visible],initialize:function(e,t,n,r,i,a,o,s){this.layer=e,this.index=t,this.x=n,this.y=r,this.width=i,this.height=a,this.right,this.bottom,this.baseWidth=o===void 0?i:o,this.baseHeight=s===void 0?a:s,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(e,t){return!(ethis.right||t>this.bottom)},copy:function(e){return this.index=e.index,this.alpha=e.alpha,this.properties=o(e.properties),this.visible=e.visible,this.setFlip(e.flipX,e.flipY),this.tint=e.tint,this.rotation=e.rotation,this.collideUp=e.collideUp,this.collideDown=e.collideDown,this.collideLeft=e.collideLeft,this.collideRight=e.collideRight,this.collisionCallback=e.collisionCallback,this.collisionCallbackContext=e.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(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).x:this.x*this.baseWidth},getRight:function(e){var t=this.tilemapLayer;return t?this.getLeft(e)+this.width*t.scaleX:this.getLeft(e)+this.width},getTop:function(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(e){var t=this.tilemapLayer;return t?this.getTop(e)+this.height*t.scaleY:this.getTop(e)+this.height},getBounds:function(e,t){return t===void 0&&(t=new s),t.x=this.getLeft(e),t.y=this.getTop(e),t.width=this.getRight(e)-t.x,t.height=this.getBottom(e)-t.y,t},getCenterX:function(e){return(this.getLeft(e)+this.getRight(e))/2},getCenterY:function(e){return(this.getTop(e)+this.getBottom(e))/2},intersects:function(e,t,n,r){return!(n<=this.pixelX||r<=this.pixelY||e>=this.right||t>=this.bottom)},isInteresting:function(e,t){return e&&t?this.canCollide||this.hasInterestingFace:e?this.collides:t?this.hasInterestingFace:!1},resetCollision:function(e){return e===void 0&&(e=!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,e&&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(e,t,n,r,i){return t===void 0&&(t=e),n===void 0&&(n=e),r===void 0&&(r=e),i===void 0&&(i=!0),this.collideLeft=e,this.collideRight=t,this.collideUp=n,this.collideDown=r,this.faceLeft=e,this.faceRight=t,this.faceTop=n,this.faceBottom=r,i&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(e,t){return e===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=e,this.collisionCallbackContext=t),this},setSize:function(e,t,n,r){return e!==void 0&&(this.width=e),t!==void 0&&(this.height=t),n!==void 0&&(this.baseWidth=n),r!==void 0&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var e=this.layer.orientation;if(e===a.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(e===a.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(e===a.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(e===a.HEXAGONAL){var t=this.layer.staggerAxis,n=this.layer.staggerIndex,r=this.layer.hexSideLength,i,o;t===`y`?(o=(this.baseHeight-r)/2+r,n===`odd`?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*o):t===`x`&&(i=(this.baseWidth-r)/2+r,this.pixelX=this.x*i,n===`odd`?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=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||this.collisionCallback!==void 0}},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 e=this.layer.tilemapLayer;if(e){var t=e.gidMap[this.index];if(t)return t}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var e=this.tilemapLayer;return e?e.tilemap:null}}})}),49075:((e,t,n)=>{var r=n(84101),i=n(83419),a=n(39506),o=n(80341),s=n(95540),c=n(14977),l=n(27462),u=n(91907),d=n(36305),f=n(19133),p=n(68287),m=n(23029),h=n(81086),g=n(20442),_=n(33629);e.exports=new i({initialize:function(e,t){this.scene=e,this.tileWidth=t.tileWidth,this.tileHeight=t.tileHeight,this.width=t.width,this.height=t.height,this.orientation=t.orientation,this.renderOrder=t.renderOrder,this.format=t.format,this.version=t.version,this.properties=t.properties,this.widthInPixels=t.widthInPixels,this.heightInPixels=t.heightInPixels,this.imageCollections=t.imageCollections,this.images=t.images,this.layers=t.layers,this.tiles=t.tiles,this.tilesets=t.tilesets,this.objects=t.objects,this.currentLayerIndex=0,this.hexSideLength=t.hexSideLength;var n=this.orientation;this._convert={WorldToTileXY:h.GetWorldToTileXYFunction(n),WorldToTileX:h.GetWorldToTileXFunction(n),WorldToTileY:h.GetWorldToTileYFunction(n),TileToWorldXY:h.GetTileToWorldXYFunction(n),TileToWorldX:h.GetTileToWorldXFunction(n),TileToWorldY:h.GetTileToWorldYFunction(n),GetTileCorners:h.GetTileCornersFunction(n)}},setRenderOrder:function(e){var t=[`right-down`,`left-down`,`right-up`,`left-up`];return typeof e==`number`&&(e=t[e]),t.indexOf(e)>-1&&(this.renderOrder=e),this},addTilesetImage:function(e,t,n,i,a,s,c,l){if(e===void 0)return null;t??=e;var u=this.scene.sys.textures;if(!u.exists(t))return console.warn(`Texture key "%s" not found`,t),null;var d=u.get(t),f=this.getTilesetIndex(e);if(f===null&&this.format===o.TILED_JSON)return console.warn(`Tilemap has no tileset "%s". Its tilesets are %o`,e,this.tilesets),null;var p=this.tilesets[f];return p?((n||i)&&p.setTileSize(n,i),(a||s)&&p.setSpacing(a,s),p.setImage(d),p):(n===void 0&&(n=this.tileWidth),i===void 0&&(i=this.tileHeight),a===void 0&&(a=0),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l={x:0,y:0}),p=new _(e,c,n,i,a,s,void 0,void 0,l),p.setImage(d),this.tilesets.push(p),this.tiles=r(this),p)},copy:function(e,t,n,r,i,a,o,s){return s=this.getLayer(s),s===null?null:(h.Copy(e,t,n,r,i,a,o,s),this)},createBlankLayer:function(e,t,n,r,i,a,o,s){if(n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=this.width),a===void 0&&(a=this.height),o===void 0&&(o=this.tileWidth),s===void 0&&(s=this.tileHeight),this.getLayerIndex(e)!==null)return console.warn(`Invalid Tilemap Layer ID: `+e),null;for(var l=new c({name:e,tileWidth:o,tileHeight:s,width:i,height:a,orientation:this.orientation,hexSideLength:this.hexSideLength}),u,d=0;d-1&&this.putTileAt(t,a.x,a.y,n,a.tilemapLayer)}return r},removeTileAt:function(e,t,n,r,i){return n===void 0&&(n=!0),r===void 0&&(r=!0),i=this.getLayer(i),i===null?null:h.RemoveTileAt(e,t,n,r,i)},removeTileAtWorldXY:function(e,t,n,r,i,a){return n===void 0&&(n=!0),r===void 0&&(r=!0),a=this.getLayer(a),a===null?null:h.RemoveTileAtWorldXY(e,t,n,r,i,a)},renderDebug:function(e,t,n){return n=this.getLayer(n),n===null?null:(this.orientation===u.ORTHOGONAL&&h.RenderDebug(e,t,n),this)},renderDebugFull:function(e,t){for(var n=this.layers,r=0;r{var r=n(44603),i=n(31989);r.register(`tilemap`,function(e){var t=e===void 0?{}:e;return i(this.scene,t.key,t.tileWidth,t.tileHeight,t.width,t.height,t.data,t.insertNull)})}),46029:((e,t,n)=>{var r=n(39429),i=n(31989);r.register(`tilemap`,function(e,t,n,r,a,o,s){return e===null&&(e=void 0),t===null&&(t=void 0),n===null&&(n=void 0),r===null&&(r=void 0),a===null&&(a=void 0),i(this.scene,e,t,n,r,a,o,s)})}),20442:((e,t,n)=>{var r=n(83419),i=n(78389),a=n(31401),o=n(95643),s=n(81086),c=n(19218),l=n(26099);e.exports=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,i,c],initialize:function(e,t,n,r,i,a){o.call(this,e,`TilemapLayer`),this.isTilemap=!0,this.tilemap=t,this.layerIndex=n,this.layer=t.layers[n],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=s.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(r),this.setAlpha(this.layer.alpha),this.setPosition(i,a),this.setOrigin(0,0),this.setSize(t.tileWidth*this.layer.width,t.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(e){var t=[],n=[],r=this.tilemap;Array.isArray(e)||(e=[e]);for(var i=0;i=0&&e<4&&(this._renderOrder=e),this},calculateFacesAt:function(e,t){return s.CalculateFacesAt(e,t,this.layer),this},calculateFacesWithin:function(e,t,n,r){return s.CalculateFacesWithin(e,t,n,r,this.layer),this},createFromTiles:function(e,t,n,r,i){return s.CreateFromTiles(e,t,n,r,i,this.layer)},cull:function(e){return this.cullCallback(this.layer,e,this.culledTiles,this._renderOrder)},copy:function(e,t,n,r,i,a,o){return s.Copy(e,t,n,r,i,a,o,this.layer),this},fill:function(e,t,n,r,i,a){return s.Fill(e,t,n,r,i,a,this.layer),this},filterTiles:function(e,t,n,r,i,a,o){return s.FilterTiles(e,t,n,r,i,a,o,this.layer)},findByIndex:function(e,t,n){return s.FindByIndex(e,t,n,this.layer)},findTile:function(e,t,n,r,i,a,o){return s.FindTile(e,t,n,r,i,a,o,this.layer)},forEachTile:function(e,t,n,r,i,a,o){return s.ForEachTile(e,t,n,r,i,a,o,this.layer),this},setTint:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!1},this,t,n,r,i,a)},setTintFill:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!0},this,t,n,r,i,a)},getTileAt:function(e,t,n){return s.GetTileAt(e,t,n,this.layer)},getTileAtWorldXY:function(e,t,n,r){return s.GetTileAtWorldXY(e,t,n,r,this.layer)},getIsoTileAtWorldXY:function(e,t,n,r,i){n===void 0&&(n=!0);var a=this.tempVec;return s.IsometricWorldToTileXY(e,t,!0,a,i,this.layer,n),this.getTileAt(a.x,a.y,r)},getTilesWithin:function(e,t,n,r,i){return s.GetTilesWithin(e,t,n,r,i,this.layer)},getTilesWithinShape:function(e,t,n){return s.GetTilesWithinShape(e,t,n,this.layer)},getTilesWithinWorldXY:function(e,t,n,r,i,a){return s.GetTilesWithinWorldXY(e,t,n,r,i,a,this.layer)},hasTileAt:function(e,t){return s.HasTileAt(e,t,this.layer)},hasTileAtWorldXY:function(e,t,n){return s.HasTileAtWorldXY(e,t,n,this.layer)},putTileAt:function(e,t,n,r){return s.PutTileAt(e,t,n,r,this.layer)},putTileAtWorldXY:function(e,t,n,r,i){return s.PutTileAtWorldXY(e,t,n,r,i,this.layer)},putTilesAt:function(e,t,n,r){return s.PutTilesAt(e,t,n,r,this.layer),this},randomize:function(e,t,n,r,i){return s.Randomize(e,t,n,r,i,this.layer),this},removeTileAt:function(e,t,n,r){return s.RemoveTileAt(e,t,n,r,this.layer)},removeTileAtWorldXY:function(e,t,n,r,i){return s.RemoveTileAtWorldXY(e,t,n,r,i,this.layer)},renderDebug:function(e,t){return s.RenderDebug(e,t,this.layer),this},replaceByIndex:function(e,t,n,r,i,a){return s.ReplaceByIndex(e,t,n,r,i,a,this.layer),this},setSkipCull:function(e){return e===void 0&&(e=!0),this.skipCull=e,this},setCullPadding:function(e,t){return e===void 0&&(e=1),t===void 0&&(t=1),this.cullPaddingX=e,this.cullPaddingY=t,this},setCollision:function(e,t,n,r){return s.SetCollision(e,t,n,this.layer,r),this},setCollisionBetween:function(e,t,n,r){return s.SetCollisionBetween(e,t,n,r,this.layer),this},setCollisionByProperty:function(e,t,n){return s.SetCollisionByProperty(e,t,n,this.layer),this},setCollisionByExclusion:function(e,t,n){return s.SetCollisionByExclusion(e,t,n,this.layer),this},setCollisionFromCollisionGroup:function(e,t){return s.SetCollisionFromCollisionGroup(e,t,this.layer),this},setTileIndexCallback:function(e,t,n){return s.SetTileIndexCallback(e,t,n,this.layer),this},setTileLocationCallback:function(e,t,n,r,i,a){return s.SetTileLocationCallback(e,t,n,r,i,a,this.layer),this},shuffle:function(e,t,n,r){return s.Shuffle(e,t,n,r,this.layer),this},swapByIndex:function(e,t,n,r,i,a){return s.SwapByIndex(e,t,n,r,i,a,this.layer),this},tileToWorldX:function(e,t){return this.tilemap.tileToWorldX(e,t,this)},tileToWorldY:function(e,t){return this.tilemap.tileToWorldY(e,t,this)},tileToWorldXY:function(e,t,n,r){return this.tilemap.tileToWorldXY(e,t,n,r,this)},getTileCorners:function(e,t,n){return this.tilemap.getTileCorners(e,t,n,this)},weightedRandomize:function(e,t,n,r,i){return s.WeightedRandomize(t,n,r,i,e,this.layer),this},worldToTileX:function(e,t,n){return this.tilemap.worldToTileX(e,t,n,this)},worldToTileY:function(e,t,n){return this.tilemap.worldToTileY(e,t,n,this)},worldToTileXY:function(e,t,n,r,i){return this.tilemap.worldToTileXY(e,t,n,r,i,this)},destroy:function(e){e===void 0&&(e=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),e&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}})}),16153:((e,t,n)=>{var r=n(61340),i=new r,a=new r,o=new r;e.exports=function(e,t,n,r){var s=t.cull(n),c=s.length,l=n.alpha*t.alpha;if(!(c===0||l<=0)){var u=i,d=a,f=o;d.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),u.copyFrom(n.matrix);var p=e.currentContext,m=t.gidMap;p.save(),r?(u.multiplyWithOffset(r,-n.scrollX*t.scrollFactorX,-n.scrollY*t.scrollFactorY),d.e=t.x,d.f=t.y,u.multiply(d,f),f.copyToContext(p)):(d.e-=n.scrollX*t.scrollFactorX,d.f-=n.scrollY*t.scrollFactorY,d.copyToContext(p)),(!e.antialias||t.scaleX>1||t.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var h=0;h{var r=n(29747),i=r,a=r;i=n(99558),a=n(16153),e.exports={renderWebGL:i,renderCanvas:a}}),99558:((e,t,n)=>{var r=n(70554);e.exports=function(e,t,n){var i=t.cull(n),a=i.length,o=n.alpha*t.alpha;if(!(a===0||o<=0)){var s=t.gidMap,c=e.pipelines.set(t.pipeline,t),l=r.getTintAppendFloatAlpha,u=t.scrollFactorX,d=t.scrollFactorY,f=t.x,p=t.y,m=t.scaleX,h=t.scaleY;e.pipelines.preBatch(t);for(var g=0;g{var r=n(83419),i=n(26099);e.exports=new r({initialize:function(e,t,n,r,a,o,s,c,l){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),a===void 0&&(a=0),o===void 0&&(o=0),s===void 0&&(s={}),c===void 0&&(c={}),this.name=e,this.firstgid=t,this.tileWidth=n,this.tileHeight=r,this.tileMargin=a,this.tileSpacing=o,this.tileProperties=s,this.tileData=c,this.tileOffset=new i,l!==void 0&&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(e){return this.containsTileIndex(e)?this.tileProperties[e-this.firstgid]:null},getTileData:function(e){return this.containsTileIndex(e)?this.tileData[e-this.firstgid]:null},getTileCollisionGroup:function(e){var t=this.getTileData(e);return t&&t.objectgroup?t.objectgroup:null},containsTileIndex:function(e){return e>=this.firstgid&&en.width||t.height>n.height?this.updateTileData(t.width,t.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(e,t){return e!==void 0&&(this.tileWidth=e),t!==void 0&&(this.tileHeight=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(e,t){return e!==void 0&&(this.tileMargin=e),t!==void 0&&(this.tileSpacing=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=(t-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),a=(e-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(i%1!=0||a%1!=0)&&console.warn(`Image tile area not tile size multiple in: `+this.name),i=Math.floor(i),a=Math.floor(a),this.rows=i,this.columns=a,this.total=i*a,this.texCoordinates.length=0;for(var o=this.tileMargin+n,s=this.tileMargin+r,c=0;c{var r=n(7423);e.exports=function(e,t,n){var i=r(e,t,!0,n),a=r(e,t-1,!0,n),o=r(e,t+1,!0,n),s=r(e-1,t,!0,n),c=r(e+1,t,!0,n),l=i&&i.collides;return l&&(i.faceTop=!0,i.faceBottom=!0,i.faceLeft=!0,i.faceRight=!0),a&&a.collides&&(l&&(i.faceTop=!1),a.faceBottom=!l),o&&o.collides&&(l&&(i.faceBottom=!1),o.faceTop=!l),s&&s.collides&&(l&&(i.faceLeft=!1),s.faceRight=!l),c&&c.collides&&(l&&(i.faceRight=!1),c.faceLeft=!l),i&&!i.collides&&i.resetFaces(),i}}),42573:((e,t,n)=>{var r=n(7423),i=n(7386);e.exports=function(e,t,n,a,o){for(var s=null,c=null,l=null,u=null,d=i(e,t,n,a,null,o),f=0;f{var r=new(n(26099));e.exports=function(e,t,n,i){var a=n.tilemapLayer,o=a.cullPaddingX,s=a.cullPaddingY,c=a.tilemap.tileToWorldXY(e,t,r,i,a);return c.x>i.worldView.x+a.scaleX*n.tileWidth*(-o-.5)&&c.xi.worldView.y+a.scaleY*n.tileHeight*(-s-1)&&c.y{var r=n(42573),i=n(7386),a=n(62991),o=n(23029);e.exports=function(e,t,n,s,c,l,u,d){u===void 0&&(u=!0);var f=i(e,t,n,s,null,d),p=[];f.forEach(function(e){var t=new o(e.layer,e.index,e.x,e.y,e.width,e.height,e.baseWidth,e.baseHeight);t.copy(e),p.push(t)});for(var m=c-e,h=l-t,g=0;g{var r=n(62644),i=n(7386),a=n(27987);e.exports=function(e,t,n,o,s,c){n||={},Array.isArray(e)||(e=[e]);var l=c.tilemapLayer;o||=l.scene,s||=o.cameras.main;var u=c.width,d=c.height,f=i(0,0,u,d,null,c),p=[],m,h=function(e,t,n){for(var r=0;r{var r=n(87841),i=n(63448),a=n(56583),o=new r;e.exports=function(e,t){var n=e.tilemapLayer.tilemap,r=e.tilemapLayer,s=Math.floor(n.tileWidth*r.scaleX),c=Math.floor(n.tileHeight*r.scaleY),l=a(t.worldView.x-r.x,s,0,!0)-r.cullPaddingX,u=i(t.worldView.right-r.x,s,0,!0)+r.cullPaddingX,d=a(t.worldView.y-r.y,c,0,!0)-r.cullPaddingY,f=i(t.worldView.bottom-r.y,c,0,!0)+r.cullPaddingY;return o.setTo(l,d,u-l,f-d)}}),30003:((e,t,n)=>{var r=n(19545),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return(o.skipCull||o.scrollFactorX!==1||o.scrollFactorY!==1)&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),35137:((e,t,n)=>{var r=n(7386),i=n(42573),a=n(20576);e.exports=function(e,t,n,o,s,c,l){for(var u=l.collideIndexes.indexOf(e)!==-1,d=r(t,n,o,s,null,l),f=0;f{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).filter(e,t)}}),52692:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=!1);var i=0,a,o,s;if(n){for(o=r.height-1;o>=0;o--)for(a=r.width-1;a>=0;a--)if(s=r.data[o][a],s&&s.index===e){if(i===t)return s;i+=1}}else for(o=0;o{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).find(e,t)||null}}),97560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){r(n,i,a,o,s,c).forEach(e,t)}}),43305:((e,t,n)=>{var r=n(91907),i=n(30003),a=n(9474),o=n(14018),s=n(29747),c=n(54503);e.exports=function(e){return e===r.ORTHOGONAL?i:e===r.HEXAGONAL?a:e===r.STAGGERED?c:e===r.ISOMETRIC?o:s}}),7423:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n,i){if(r(e,t,i)){var a=i.data[t][e]||null;return a?a.index===-1?n?a:null:a:null}else return null}}),60540:((e,t,n)=>{var r=n(7423),i=new(n(26099));e.exports=function(e,t,n,a,o){return o.tilemapLayer.worldToTileXY(e,t,!0,i,a),r(i.x,i.y,n,o)}}),55826:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i){var a=i.baseTileWidth,o=i.baseTileHeight,s=i.tilemapLayer,c=0,l=0;s&&(n||=s.scene.cameras.main,c=s.x+n.scrollX*(1-s.scrollFactorX),l=s.y+n.scrollY*(1-s.scrollFactorY),a*=s.scaleX,o*=s.scaleY);var u=c+e*a,d=l+t*o;return[new r(u,d),new r(u+a,d),new r(u+a,d+o),new r(u,d+o)]}}),11758:((e,t,n)=>{var r=n(91907),i=n(27229),a=n(29747),o=n(55826);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:(r.STAGGERED,a)}}),39167:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(97281);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),62e3:((e,t,n)=>{var r=n(91907),i=n(19951),a=n(14127),o=n(29747),s=n(97202),c=n(70326);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),5984:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(28054),o=n(29650);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),7386:((e,t,n)=>{var r=n(95540);e.exports=function(e,t,n,i,a,o){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=o.width),i===void 0&&(i=o.height),a||={};var s=r(a,`isNotEmpty`,!1),c=r(a,`isColliding`,!1),l=r(a,`hasInterestingFace`,!1);e<0&&(n+=e,e=0),t<0&&(i+=t,t=0),e+n>o.width&&(n=Math.max(o.width-e,0)),t+i>o.height&&(i=Math.max(o.height-t,0));for(var u=[],d=t;d{var r=n(55738),i=n(7386),a=n(91865),o=n(29747),s=n(26099),c=n(91907),l=function(e,t){return a.RectangleToTriangle(t,e)},u=new s,d=new s,f=new s;e.exports=function(e,t,n,s){if(s.orientation!==c.ORTHOGONAL)return console.warn(`GetTilesWithinShape only works with orthogonal tilemaps`),[];if(e===void 0)return[];var p=o;e instanceof r.Circle?p=a.CircleToRectangle:e instanceof r.Rectangle?p=a.RectangleToRectangle:e instanceof r.Triangle?p=l:e instanceof r.Line&&(p=a.LineToRectangle),s.tilemapLayer.worldToTileXY(e.left,e.top,!0,d,n);var m=d.x,h=d.y;s.tilemapLayer.worldToTileXY(e.right,e.bottom,!1,f,n);var g=Math.ceil(f.x),_=Math.ceil(f.y),v=i(m,h,Math.max(g-m,1),Math.max(_-h,1),t,s),y=s.tileWidth,b=s.tileHeight;s.tilemapLayer&&(y*=s.tilemapLayer.scaleX,b*=s.tilemapLayer.scaleY);for(var x=[],S=new r.Rectangle(0,0,y,b),C=0;C{var r=n(7386),i=n(26099),a=new i,o=new i;e.exports=function(e,t,n,i,s,c,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,t,!0,a,c,l);var d=a.x,f=a.y;u(e+n,t+i,!1,o,c,l);var p=Math.ceil(o.x),m=Math.ceil(o.y);return r(d,f,p-d,m-f,s,l)}}),96113:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(10095);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),16926:((e,t,n)=>{var r=n(91907),i=n(86625),a=n(96897),o=n(29747),s=n(15108),c=n(85896);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),55762:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(51900),o=n(63288);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),45091:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n){if(r(e,t,n)){var i=n.data[t][e];return i!==null&&i.index>-1}else return!1}}),24152:((e,t,n)=>{var r=n(45091),i=new(n(26099));e.exports=function(e,t,n,a){a.tilemapLayer.worldToTileXY(e,t,!0,i,n);var o=i.x,s=i.y;return r(o,s,a)}}),90454:((e,t,n)=>{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY),c=e.hexSideLength,l,u,d,f;if(e.staggerAxis===`y`){var p=(s-c)/2+c;l=i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,p,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,p,0,!0)+a.cullPaddingY}else{var m=(o-c)/2+c;l=i(t.worldView.x-a.x,m,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,m,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,s,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,s,0,!0)+a.cullPaddingY}return{left:l,right:u,top:d,bottom:f}}}),9474:((e,t,n)=>{var r=n(90454),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),27229:((e,t,n)=>{var r=n(19951),i=n(26099),a=new i;e.exports=function(e,t,n,o){var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(s*=l.scaleX,c*=l.scaleY);var u=r(e,t,a,n,o),d=[],f=.5773502691896257,p,m;o.staggerAxis===`y`?(p=f*s,m=c/2):(p=s/2,m=f*c);for(var h=0;h<6;h++){var g=2*Math.PI*(.5-h)/6;d.push(new i(u.x+p*Math.cos(g),u.y+m*Math.sin(g)))}return d}}),19951:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),u=c.y+i.scrollY*(1-c.scrollFactorY),o*=c.scaleX,s*=c.scaleY);var d=o/2,f=s/2,p,m,h=a.staggerAxis,g=a.staggerIndex;return h===`y`?(p=l+o*e+o,m=u+1.5*t*f+f,t%2==0&&(g===`odd`?p-=d:p+=d)):h===`x`&&g===`odd`&&(p=l+1.5*e*d+d,m=u+s*e+s,e%2==0&&(g===`odd`?m-=f:m+=f)),n.set(p,m)}}),86625:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=.5773502691896257,d=-.3333333333333333,f=0,p=.6666666666666666,m=s/2,h=c/2,g,_,v,y,b;o.staggerAxis===`y`?(g=(e-m)/(u*s),_=(t-h)/h,v=u*g+d*_,y=f*g+p*_):(g=(e-m)/m,_=(t-h)/(u*c),v=d*g+u*_,y=p*g+f*_),b=-v-y;var x=Math.round(v),S=Math.round(y),C=Math.round(b),w=Math.abs(x-v),T=Math.abs(S-y),E=Math.abs(C-b);w>T&&w>E?x=-S-C:T>E&&(S=-x-C);var D,O=S;return D=o.staggerIndex===`odd`?O%2==0?S/2+x:S/2+x-.5:O%2==0?S/2+x:S/2+x+.5,i.set(D,O)}}),62991:(e=>{e.exports=function(e,t,n){return e>=0&&e=0&&t{var r=n(33528);e.exports=function(e,t,n,i){n===void 0&&(n=[]),i===void 0&&(i=0),n.length=0;var a=e.tilemapLayer,o=e.data,s=e.width,c=e.height,l=a.skipCull,u=0,d=s,f=0,p=c,m,h,g;if(i===0)for(h=f;h=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));else if(i===2)for(h=p;h>=f;h--)for(m=u;m=f;h--)for(m=d;m>=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));return a.tilesDrawn=n.length,a.tilesTotal=s*c,n}}),14127:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+(e-t)*(o/2),f=u+(e+t)*(s/2);return n.set(d,f)}}),96897:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o,s){i||=new r;var c=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(a||=u.scene.cameras.main,t-=u.y+a.scrollY*(1-u.scrollFactorY),l*=u.scaleY,e-=u.x+a.scrollX*(1-u.scrollFactorX),c*=u.scaleX);var d=c/2,f=l/2;e-=d,s||(t-=l);var p=.5*(e/d+t/f),m=.5*(-e/d+t/f);return n&&(p=Math.floor(p),m=Math.floor(m)),i.set(p,m)}}),71558:((e,t,n)=>{var r=n(23029),i=n(62991),a=n(72023),o=n(20576);e.exports=function(e,t,n,s,c){if(s===void 0&&(s=!0),!i(t,n,c))return null;var l,u=c.data[n][t],d=u&&u.collides;e instanceof r?(c.data[n][t]===null&&(c.data[n][t]=new r(c,e.index,t,n,c.tileWidth,c.tileHeight)),c.data[n][t].copy(e)):(l=e,c.data[n][t]===null?c.data[n][t]=new r(c,l,t,n,c.tileWidth,c.tileHeight):c.data[n][t].index=l);var f=c.data[n][t],p=c.collideIndexes.indexOf(f.index)!==-1;if(l=e instanceof r?e.index:e,l===-1)f.width=c.tileWidth,f.height=c.tileHeight;else{var m=c.tilemapLayer.tilemap,h=m.tiles[l][2],g=m.tilesets[h];f.width=g.tileWidth,f.height=g.tileHeight}return o(f,p),s&&d!==f.collides&&a(t,n,c),f}}),26303:((e,t,n)=>{var r=n(71558),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(t,n,!0,i,o,s),r(e,i.x,i.y,a,s)}}),14051:((e,t,n)=>{var r=n(42573),i=n(71558);e.exports=function(e,t,n,a,o){if(a===void 0&&(a=!0),!Array.isArray(e))return null;Array.isArray(e[0])||(e=[e]);for(var s=e.length,c=e[0].length,l=0;l{var r=n(7386),i=n(26546);e.exports=function(e,t,n,a,o,s){var c,l=r(e,t,n,a,{},s);if(!o)for(o=[],c=0;c{var r=n(23029),i=n(62991),a=n(72023);e.exports=function(e,t,n,o,s){if(n===void 0&&(n=!0),o===void 0&&(o=!0),!i(e,t,s))return null;var c=s.data[t][e];if(c)s.data[t][e]=n?null:new r(s,-1,e,t,s.tileWidth,s.tileHeight);else return null;return o&&c&&c.collides&&a(e,t,s),c}}),94178:((e,t,n)=>{var r=n(63557),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(e,t,!0,i,o,s),r(i.x,i.y,n,a,s)}}),15533:((e,t,n)=>{var r=n(7386),i=n(3956),a=new i(105,210,231,150),o=new i(243,134,48,200),s=new i(40,39,37,150);e.exports=function(e,t,n){t===void 0&&(t={});var i=t.tileColor===void 0?a:t.tileColor,c=t.collidingTileColor===void 0?o:t.collidingTileColor,l=t.faceColor===void 0?s:t.faceColor,u=r(0,0,n.width,n.height,null,n);e.translateCanvas(n.tilemapLayer.x,n.tilemapLayer.y),e.scaleCanvas(n.tilemapLayer.scaleX,n.tilemapLayer.scaleY);for(var d=0;d{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n,r){var i=e.data,a=e.width,o=e.height,s=e.tilemapLayer,c=Math.max(0,t.left),l=Math.min(a,t.right),u=Math.max(0,t.top),d=Math.min(o,t.bottom),f,p,m;if(n===0)for(p=u;p=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);else if(n===2)for(p=d;p>=u;p--)for(f=c;i[p]&&f=u;p--)for(f=l;i[p]&&f>=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);return s.tilesDrawn=r.length,s.tilesTotal=a*o,r}}),57068:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s){t===void 0&&(t=!0),n===void 0&&(n=!0),s===void 0&&(s=!0),Array.isArray(e)||(e=[e]);for(var c=0;c{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s,c){if(n===void 0&&(n=!0),o===void 0&&(o=!0),c===void 0&&(c=!0),!(e>t)){for(var l=e;l<=t;l++)a(l,n,s);if(c)for(var u=0;u=e&&f.index<=t&&r(f,n)}o&&i(0,0,s.width,s.height,s)}}}),75661:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0),Array.isArray(e)||(e=[e]);for(var s=0;s{var r=n(20576),i=n(42573),a=n(97022);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0);for(var s=0;s{var r=n(20576),i=n(42573);e.exports=function(e,t,n){e===void 0&&(e=!0),t===void 0&&(t=!0);for(var a=0;a0&&r(s,e)}}t&&i(0,0,n.width,n.height,n)}}),9589:(e=>{e.exports=function(e,t,n){var r=n.collideIndexes.indexOf(e);t&&r===-1?n.collideIndexes.push(e):!t&&r!==-1&&n.collideIndexes.splice(r,1)}}),20576:(e=>{e.exports=function(e,t){t?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)}}),79583:(e=>{e.exports=function(e,t,n,r){if(typeof e==`number`)r.callbacks[e]=t===null?void 0:{callback:t,callbackContext:n};else for(var i=0,a=e.length;i{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(e,t,n,i,null,s),l=0;l{var r=n(7386),i=n(33680);e.exports=function(e,t,n,a,o){var s=r(e,t,n,a,null,o),c=s.map(function(e){return e.index});i(c);for(var l=0;l{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY);return{left:i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,right:r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,top:i(t.worldView.y-a.y,s/2,0,!0)-a.cullPaddingY,bottom:r(t.worldView.bottom-a.y,s/2,0,!0)+a.cullPaddingY}}}),54503:((e,t,n)=>{var r=n(61325),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),97202:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+e*o+t%2*(o/2),f=u+s/2*t;return n.set(d,f)}}),28054:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t===void 0&&(t=i.scene.cameras.main),a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+r/2*e+r}}),15108:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,t-=l.y+a.scrollY*(1-l.scrollFactorY),c*=l.scaleY,e-=l.x+a.scrollX*(1-l.scrollFactorX),s*=l.scaleX);var u=n?Math.floor(t/(c/2)):t/(c/2),d=n?Math.floor((e+u%2*.5*s)/s):(e+u%2*.5*s)/s;return i.set(d,u)}}),51900:(e=>{e.exports=function(e,t,n,r){var i=r.baseTileHeight,a=r.tilemapLayer;return a&&(n||=a.scene.cameras.main,e-=a.y+n.scrollY*(1-a.scrollFactorY),i*=a.scaleY),t?Math.floor(e/(i/2)):e/(i/2)}}),86560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n){var r=n.baseTileWidth,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.x+t.scrollX*(1-i.scrollFactorX),r*=i.scaleX),a+e*r}}),70326:((e,t,n)=>{var r=n(97281),i=n(29650),a=n(26099);e.exports=function(e,t,n,o,s){return n||=new a(0,0),n.x=r(e,o,s),n.y=i(t,o,s),n}}),29650:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+e*r}}),77366:((e,t,n)=>{var r=n(7386),i=n(75508);e.exports=function(e,t,n,a,o,s){if(o){var c,l=r(e,t,n,a,null,s),u=0;for(c=0;c{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(e,0,t,i,n,a),i.x}}),85896:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){n===void 0&&(n=!0),i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=e/s,d=t/c;return n&&(u=Math.floor(u),d=Math.floor(d)),i.set(u,d)}}),63288:((e,t,n)=>{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(0,e,t,i,n,a),i.y}}),81086:((e,t,n)=>{e.exports={CalculateFacesAt:n(72023),CalculateFacesWithin:n(42573),CheckIsoBounds:n(33528),Copy:n(1785),CreateFromTiles:n(78419),CullBounds:n(19545),CullTiles:n(30003),Fill:n(35137),FilterTiles:n(40253),FindByIndex:n(52692),FindTile:n(66151),ForEachTile:n(97560),GetCullTilesFunction:n(43305),GetTileAt:n(7423),GetTileAtWorldXY:n(60540),GetTileCorners:n(55826),GetTileCornersFunction:n(11758),GetTilesWithin:n(7386),GetTilesWithinShape:n(91141),GetTilesWithinWorldXY:n(96523),GetTileToWorldXFunction:n(39167),GetTileToWorldXYFunction:n(62e3),GetTileToWorldYFunction:n(5984),GetWorldToTileXFunction:n(96113),GetWorldToTileXYFunction:n(16926),GetWorldToTileYFunction:n(55762),HasTileAt:n(45091),HasTileAtWorldXY:n(24152),HexagonalCullBounds:n(90454),HexagonalCullTiles:n(9474),HexagonalGetTileCorners:n(27229),HexagonalTileToWorldXY:n(19951),HexagonalWorldToTileXY:n(86625),IsInLayerBounds:n(62991),IsometricCullTiles:n(14018),IsometricTileToWorldXY:n(14127),IsometricWorldToTileXY:n(96897),PutTileAt:n(71558),PutTileAtWorldXY:n(26303),PutTilesAt:n(14051),Randomize:n(77389),RemoveTileAt:n(63557),RemoveTileAtWorldXY:n(94178),RenderDebug:n(15533),ReplaceByIndex:n(27987),RunCull:n(32483),SetCollision:n(57068),SetCollisionBetween:n(37266),SetCollisionByExclusion:n(75661),SetCollisionByProperty:n(64740),SetCollisionFromCollisionGroup:n(63307),SetLayerCollisionIndex:n(9589),SetTileCollision:n(20576),SetTileIndexCallback:n(79583),SetTileLocationCallback:n(93254),Shuffle:n(32903),StaggeredCullBounds:n(61325),StaggeredCullTiles:n(54503),StaggeredTileToWorldXY:n(97202),StaggeredTileToWorldY:n(28054),StaggeredWorldToTileXY:n(15108),StaggeredWorldToTileY:n(51900),SwapByIndex:n(86560),TileToWorldX:n(97281),TileToWorldXY:n(70326),TileToWorldY:n(29650),WeightedRandomize:n(77366),WorldToTileX:n(10095),WorldToTileXY:n(85896),WorldToTileY:n(63288)}}),91907:(e=>{e.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}}),21829:((e,t,n)=>{e.exports={ORIENTATION:n(91907)}}),62501:((e,t,n)=>{var r=n(79291),i=n(21829),a={Components:n(81086),Parsers:n(57442),Formats:n(80341),ImageCollection:n(16536),ParseToTilemap:n(31989),Tile:n(23029),Tilemap:n(49075),TilemapCreator:n(45939),TilemapFactory:n(46029),Tileset:n(33629),TilemapLayer:n(20442),Orientation:n(91907),LayerData:n(14977),MapData:n(87010),ObjectLayer:n(48700)};a=r(!1,a,i.ORIENTATION),e.exports=a}),14977:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`layer`),this.id=a(e,`id`,0),this.x=a(e,`x`,0),this.y=a(e,`y`,0),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.baseTileWidth=a(e,`baseTileWidth`,this.tileWidth),this.baseTileHeight=a(e,`baseTileHeight`,this.tileHeight),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.widthInPixels=a(e,`widthInPixels`,this.width*this.baseTileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.baseTileHeight),this.alpha=a(e,`alpha`,1),this.visible=a(e,`visible`,!0),this.properties=a(e,`properties`,[]),this.indexes=a(e,`indexes`,[]),this.collideIndexes=a(e,`collideIndexes`,[]),this.callbacks=a(e,`callbacks`,[]),this.bodies=a(e,`bodies`,[]),this.data=a(e,`data`,[]),this.tilemapLayer=a(e,`tilemapLayer`,null),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),87010:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`map`),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.infinite=a(e,`infinite`,!1),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.widthInPixels=a(e,`widthInPixels`,this.width*this.tileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.tileHeight),this.format=a(e,`format`,null),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.renderOrder=a(e,`renderOrder`,`right-down`),this.version=a(e,`version`,`1`),this.properties=a(e,`properties`,{}),this.layers=a(e,`layers`,[]),this.images=a(e,`images`,[]),this.objects=a(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=a(e,`collision`,{}),this.tilesets=a(e,`tilesets`,[]),this.imageCollections=a(e,`imageCollections`,[]),this.tiles=a(e,`tiles`,[]),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),48700:((e,t,n)=>{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=i(e,`name`,`object layer`),this.id=i(e,`id`,0),this.opacity=i(e,`opacity`,1),this.properties=i(e,`properties`,{}),this.propertyTypes=i(e,`propertytypes`,{}),this.type=i(e,`type`,`objectgroup`),this.visible=i(e,`visible`,!0),this.objects=i(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[])}})}),6641:((e,t,n)=>{var r=n(91907);e.exports=function(e){return e=e.toLowerCase(),e===`isometric`?r.ISOMETRIC:e===`staggered`?r.STAGGERED:e===`hexagonal`?r.HEXAGONAL:r.ORTHOGONAL}}),46177:((e,t,n)=>{var r=n(80341),i=n(2342),a=n(82593),o=n(46594),s=n(87021);e.exports=function(e,t,n,c,l,u){var d;switch(t){case r.ARRAY_2D:d=i(e,n,c,l,u);break;case r.CSV:d=a(e,n,c,l,u);break;case r.TILED_JSON:d=o(e,n,u);break;case r.WELTMEISTER:d=s(e,n,u);break;default:console.warn(`Unrecognized tilemap data format: `+t),d=null}return d}}),2342:((e,t,n)=>{var r=n(80341),i=n(14977),a=n(87010),o=n(23029);e.exports=function(e,t,n,s,c){for(var l=new i({tileWidth:n,tileHeight:s}),u=new a({name:e,tileWidth:n,tileHeight:s,format:r.ARRAY_2D,layers:[l]}),d=[],f=t.length,p=0,m=0;m{var r=n(80341),i=n(2342);e.exports=function(e,t,n,a,o){var s=i(e,t.trim().split(` `).map(function(e){return e.split(`,`)}),n,a,o);return s.format=r.CSV,s}}),6656:((e,t,n)=>{var r=n(14977),i=n(23029);e.exports=function(e,t){for(var n=[],a=0;a-1?new i(s,f,d,u,o.tilesize,o.tilesize):t?null:new i(s,-1,d,u,o.tilesize,o.tilesize);c.push(p)}l.push(c),c=[]}s.data=l,n.push(s)}return n}}),96483:((e,t,n)=>{var r=n(33629);e.exports=function(e){for(var t=[],n=[],i=0;i{var r=n(80341),i=n(87010),a=n(6656),o=n(96483);e.exports=function(e,t,n){if(t.layer.length===0)return console.warn(`No layers found in the Weltmeister map: `+e),null;for(var s=0,c=0,l=0;ls&&(s=t.layer[l].width),t.layer[l].height>c&&(c=t.layer[l].height);var u=new i({width:s,height:c,name:e,tileWidth:t.layer[0].tilesize,tileHeight:t.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=a(t,n),u.tilesets=o(t),u}}),52833:((e,t,n)=>{e.exports={ParseTileLayers:n(6656),ParseTilesets:n(96483),ParseWeltmeister:n(87021)}}),57442:((e,t,n)=>{e.exports={FromOrientationString:n(6641),Parse:n(46177),Parse2DArray:n(2342),ParseCSV:n(82593),Impact:n(52833),Tiled:n(96761)}}),51233:((e,t,n)=>{var r=n(79291);e.exports=function(e){for(var t,n,i,a,o,s=0;s{e.exports=function(e){for(var t=window.atob(e),n=t.length,r=Array(n/4),i=0;i>>0;return r}}),84101:((e,t,n)=>{var r=n(33629);e.exports=function(e){var t,n,i=[];for(t=0;t{var r=n(95540);e.exports=function(e,t,n){if(!t)return{i:0,layers:e.layers,name:``,opacity:1,visible:!0,x:0,y:0};var i=t.x+r(t,`startx`,0)*e.tilewidth+r(t,`offsetx`,0),a=t.y+r(t,`starty`,0)*e.tileheight+r(t,`offsety`,0);return{i:0,layers:t.layers,name:n.name+t.name+`/`,opacity:n.opacity*t.opacity,visible:n.visible&&t.visible,x:n.x+i,y:n.y+a}}}),29920:(e=>{var t=2147483648,n=1073741824,r=536870912;e.exports=function(e){var i=!!(e&t),a=!!(e&n),o=!!(e&r);e&=~(t|n|r);var s=0,c=!1;return i&&a&&o?(s=Math.PI/2,c=!0):i&&a&&!o?(s=Math.PI,c=!1):i&&!a&&o?(s=Math.PI/2,c=!1):i&&!a&&!o?(s=0,c=!0):!i&&a&&o?(s=3*Math.PI/2,c=!1):!i&&a&&!o?(s=Math.PI,c=!0):!i&&!a&&o?(s=3*Math.PI/2,c=!0):!i&&!a&&!o&&(s=0,c=!1),{gid:e,flippedHorizontal:i,flippedVertical:a,flippedAntiDiagonal:o,rotation:s,flipped:c}}}),12635:((e,t,n)=>{var r=n(95540),i=n(79677);e.exports=function(e){for(var t=[],n=[],a=i(e);a.i0;){if(a.i>=a.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}a=n.pop();continue}var o=a.layers[a.i];if(a.i++,o.type!==`imagelayer`){if(o.type===`group`){var s=i(e,o,a);n.push(a),a=s}continue}var c=r(o,`offsetx`,0)+r(o,`startx`,0),l=r(o,`offsety`,0)+r(o,`starty`,0);t.push({name:a.name+o.name,image:o.image,x:a.x+c+o.x,y:a.y+l+o.y,alpha:a.opacity*o.opacity,visible:a.visible&&o.visible,properties:r(o,`properties`,{})})}return t}}),46594:((e,t,n)=>{var r=n(51233),i=n(84101),a=n(91907),o=n(62644),s=n(80341),c=n(6641),l=n(87010),u=n(12635),d=n(22611),f=n(28200),p=n(24619);e.exports=function(e,t,n){var m=o(t),h=new l({width:m.width,height:m.height,name:e,tileWidth:m.tilewidth,tileHeight:m.tileheight,orientation:c(m.orientation),format:s.TILED_JSON,version:m.version,properties:m.properties,renderOrder:m.renderorder,infinite:m.infinite});if(h.orientation===a.HEXAGONAL)if(h.hexSideLength=m.hexsidelength,h.staggerAxis=m.staggeraxis,h.staggerIndex=m.staggerindex,h.staggerAxis===`y`){var g=(h.tileHeight-h.hexSideLength)/2;h.widthInPixels=h.tileWidth*(h.width+.5),h.heightInPixels=h.height*(h.hexSideLength+g)+g}else{var _=(h.tileWidth-h.hexSideLength)/2;h.widthInPixels=h.width*(h.hexSideLength+_)+_,h.heightInPixels=h.tileHeight*(h.height+.5)}h.layers=f(m,n),h.images=u(m);var v=p(m);return h.tilesets=v.tilesets,h.imageCollections=v.imageCollections,h.objects=d(m),h.tiles=i(h),r(h),h}}),52205:((e,t,n)=>{var r=n(18254),i=n(29920),a=function(e){return{x:e.x,y:e.y}},o=[`id`,`name`,`type`,`rotation`,`properties`,`visible`,`x`,`y`,`width`,`height`];e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var s=r(e,o);if(s.x+=t,s.y+=n,e.gid){var c=i(e.gid);s.gid=c.gid,s.flippedHorizontal=c.flippedHorizontal,s.flippedVertical=c.flippedVertical,s.flippedAntiDiagonal=c.flippedAntiDiagonal}else e.polyline?s.polyline=e.polyline.map(a):e.polygon?s.polygon=e.polygon.map(a):e.ellipse?s.ellipse=e.ellipse:e.text?s.text=e.text:e.point?s.point=!0:s.rectangle=!0;return s}}),22611:((e,t,n)=>{var r=n(95540),i=n(52205),a=n(48700),o=n(79677);e.exports=function(e){for(var t=[],n=[],s=o(e);s.i0;){if(s.i>=s.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}s=n.pop();continue}var c=s.layers[s.i];if(s.i++,c.opacity*=s.opacity,c.visible=s.visible&&c.visible,c.type!==`objectgroup`){if(c.type===`group`){var l=o(e,c,s);n.push(s),s=l}continue}c.name=s.name+c.name;for(var u=s.x+r(c,`startx`,0)+r(c,`offsetx`,0),d=s.y+r(c,`starty`,0)+r(c,`offsety`,0),f=[],p=0;p{var r=n(41868),i=n(91907),a=n(79677),o=n(6641),s=n(95540),c=n(14977),l=n(29920),u=n(23029);e.exports=function(e,t){for(var n=s(e,`infinite`,!1),d=[],f=[],p=a(e);p.i0;){if(p.i>=p.layers.length){if(f.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}p=f.pop();continue}var m=p.layers[p.i];if(p.i++,m.type!==`tilelayer`){if(m.type===`group`){var h=a(e,m,p);f.push(p),p=h}continue}if(m.compression){console.warn(`TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '`+m.name+`'`);continue}else if(m.encoding&&m.encoding===`base64`){if(m.chunks)for(var g=0;g0?(y=new u(_,v.gid,F,I,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,C[I][F]=y):(b=t?null:new u(_,-1,F,I,e.tilewidth,e.tileheight),C[I][F]=b),w++,w===k.width&&(M++,w=0)}}else{_=new c({name:p.name+m.name,id:m.id,x:p.x+s(m,`offsetx`,0)+m.x,y:p.y+s(m,`offsety`,0)+m.y,width:m.width,height:m.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:p.opacity*m.opacity,visible:p.visible&&m.visible,properties:s(m,`properties`,[]),orientation:o(e.orientation)}),_.orientation===i.HEXAGONAL&&(_.hexSideLength=e.hexsidelength,_.staggerAxis=e.staggeraxis,_.staggerIndex=e.staggerindex,_.staggerAxis===`y`?(x=(_.tileHeight-_.hexSideLength)/2,_.widthInPixels=_.tileWidth*(_.width+.5),_.heightInPixels=_.height*(_.hexSideLength+x)+x):(S=(_.tileWidth-_.hexSideLength)/2,_.widthInPixels=_.width*(_.hexSideLength+S)+S,_.heightInPixels=_.tileHeight*(_.height+.5)));for(var L=[],R=0,z=m.data.length;R0?(y=new u(_,v.gid,w,C.length,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,L.push(y)):(b=t?null:new u(_,-1,w,C.length,e.tilewidth,e.tileheight),L.push(b)),w++,w===m.width&&(C.push(L),w=0,L=[])}_.data=C,d.push(_)}return d}}),24619:((e,t,n)=>{var r=n(33629),i=n(16536),a=n(52205),o=n(57880);e.exports=function(e){for(var t=[],n=[],s=null,c,l=0;l1){var f=void 0,p=void 0;if(Array.isArray(u.tiles)){f||={},p||={};for(var m=0;m{e.exports=function(e,t){for(var n=0;n0){var a={},o={},s,c,l;if(Array.isArray(r.edgecolors))for(s=0;s{e.exports={AssignTileProperties:n(51233),Base64Decode:n(41868),BuildTilesetIndex:n(84101),CreateGroupLayer:n(79677),ParseGID:n(29920),ParseImageLayers:n(12635),ParseJSONTiled:n(46594),ParseObject:n(52205),ParseObjectLayers:n(22611),ParseTileLayers:n(28200),ParseTilesets:n(24619)}}),33385:((e,t,n)=>{var r=n(83419),i=n(37277),a=n(44594),o=n(94880),s=n(72905),c=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],e.sys.events.once(a.BOOT,this.boot,this),e.sys.events.on(a.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var e=this.systems.events;e.on(a.PRE_UPDATE,this.preUpdate,this),e.on(a.UPDATE,this.update,this),e.once(a.SHUTDOWN,this.shutdown,this)},addEvent:function(e){var t;if(e instanceof o){if(t=e,this.removeEvent(t),t.elapsed=t.startAt,t.hasDispatched=!1,t.repeatCount=t.repeat===-1||t.loop?999999999999:t.repeat,t.delay<=0&&t.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`)}else t=new o(e);return this._pendingInsertion.push(t),t},delayedCall:function(e,t,n,r){return this.addEvent({delay:e,callback:t,args:n,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t-1&&this._active.splice(i,1),r.destroy()}for(n=0;n=r.delay)){var i=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,i>=r.delay)for(;i>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),i-=r.delay,r.repeatCount--;r.elapsed=i,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var e;for(e=0;e{var r=n(83419),i=n(50792),a=n(39429),o=n(95540),s=n(44594),c=n(89809),l=new r({Extends:i,initialize:function(e,t){i.call(this),this.scene=e,this.systems=e.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 n=this.systems.events;n.on(s.PRE_UPDATE,this.preUpdate,this),n.on(s.UPDATE,this.update,this),n.once(s.SHUTDOWN,this.destroy,this),t&&this.add(t)},preUpdate:function(e,t){this.paused||(this.elapsed+=t*this.timeScale)},update:function(){if(!(this.paused||this.complete)){var e,t=this.events,n=!1,r=this.systems,i;for(e=0;e=t.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(c.COMPLETE,this)}},play:function(e){return e===void 0&&(e=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,e&&this.reset(),this},pause:function(){this.paused=!0;for(var e=this.events,t=0;t0&&(n=t[t.length-1].time);for(var r=0;r{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){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(e)},reset:function(e){if(this.delay=i(e,`delay`,0),this.repeat=i(e,`repeat`,0),this.loop=i(e,`loop`,!1),this.callback=i(e,`callback`,void 0),this.callbackScope=i(e,`callbackScope`,this),this.args=i(e,`args`,[]),this.timeScale=i(e,`timeScale`,1),this.startAt=i(e,`startAt`,0),this.paused=i(e,`paused`,!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`);return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var e=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/e}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(e){e===void 0&&(e=!1),this.elapsed=this.delay,this.hasDispatched=!e,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}})}),35945:(e=>{e.exports=`complete`}),89809:((e,t,n)=>{e.exports={COMPLETE:n(35945)}}),90291:((e,t,n)=>{e.exports={Clock:n(33385),Events:n(89809),Timeline:n(96120),TimerEvent:n(94880)}}),40382:((e,t,n)=>{var r=n(72905),i=n(83419),a=n(43491),o=n(88032),s=n(37277),c=n(44594),l=n(93109),u=n(86081),d=n(8357),f=n(43960),p=n(26012),m=new i({initialize:function(e){this.scene=e,this.events=e.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(c.BOOT,this.boot,this),this.events.on(c.START,this.start,this)},boot:function(){this.events.once(c.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(c.UPDATE,this.update,this),this.events.once(c.SHUTDOWN,this.shutdown,this)},create:function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0;n-1},existing:function(e){return this.has(e)||this.tweens.push(e.reset()),this},addCounter:function(e){var t=o(this,e);return this.tweens.push(t.reset()),t},stagger:function(e,t){return l(e,t)},setLagSmooth:function(e,t){return e===void 0&&(e=1/1e-8),t===void 0&&(t=0),this.maxLag=e,this.lagSkip=Math.min(t,this.maxLag),this},setFps:function(e){return e===void 0&&(e=240),this.gap=1e3/e,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(e){var t=Date.now()-this.prevTime;t>this.maxLag&&(this.startTime+=t-this.lagSkip),this.prevTime+=t;var n=this.prevTime-this.startTime,r=n-this.nextTime,i=n-this.time*1e3;return r>0||e?(n/=1e3,this.time=n,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):i=0,i},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(e){e===void 0&&(e=!1);var t=this.getDelta(e);if(!(t<=0)){this.processing=!0;var n,r,i=[],a=this.tweens;for(n=0;n0){for(n=0;n-1&&(r.isPendingRemove()||r.isDestroyed())&&(a.splice(s,1),r.destroy())}i.length=0}this.processing=!1}},remove:function(e){return this.processing?e.setPendingRemoveState():(r(this.tweens,e),e.setRemovedState()),this},reset:function(e){return this.existing(e),e.seek(),e.setActiveState(),this},makeActive:function(e){return this.existing(e),e.setActiveState(),this},each:function(e,t){var n,r=[null];for(n=1;n{e.exports=function(e,t,n){return e&&e.hasOwnProperty(t)?e[t]:n}}),6113:((e,t,n)=>{var r=n(62640),i=n(35355);e.exports=function(e,t){var n=r.Power0;if(typeof e==`string`)if(r.hasOwnProperty(e))n=r[e];else{var a=``;if(e.indexOf(`.`)){a=e.substring(e.indexOf(`.`)+1);var o=a.toLowerCase();o===`in`?a=`easeIn`:o===`out`?a=`easeOut`:o===`inout`&&(a=`easeInOut`)}e=i(e.substring(0,e.indexOf(`.`)+1)+a),r.hasOwnProperty(e)&&(n=r[e])}else typeof e==`function`&&(n=e);if(!t)return n;var s=t.slice(0);return s.unshift(0),function(e){return s[0]=e,n.apply(this,s)}}}),91389:((e,t,n)=>{var r=n(89318),i=n(77259),a={bezier:r,catmull:i,catmullrom:i,linear:n(28392)};e.exports=function(e){if(e===null)return null;var t=a.linear;return typeof e==`string`?a.hasOwnProperty(e)&&(t=a[e]):typeof e==`function`&&(t=e),t}}),55292:(e=>{e.exports=function(e,t,n){return e.hasOwnProperty(t)?typeof e[t]==`function`?function(n,r,i,a,o,s){return e[t](n,r,i,a,o,s)}:function(){return e[t]}:typeof n==`function`?n:function(){return n}}}),82985:((e,t,n)=>{var r=n(81076);e.exports=function(e){var t,n=[];if(e.hasOwnProperty(`props`))for(t in e.props)t.substring(0,1)!==`_`&&n.push({key:t,value:e.props[t]});else for(t in e)r.indexOf(t)===-1&&t.substring(0,1)!==`_`&&n.push({key:t,value:e[t]});return n}}),62329:((e,t,n)=>{var r=n(35154);e.exports=function(e){var t=r(e,`targets`,null);return t===null?t:(typeof t==`function`&&(t=t.call()),Array.isArray(t)||(t=[t]),t)}}),17777:((e,t,n)=>{var r=n(30976),i=n(99472);function a(e){return!!e.getActive&&typeof e.getActive==`function`}function o(e){return!!e.getStart&&typeof e.getStart==`function`}function s(e){return!!e.getEnd&&typeof e.getEnd==`function`}function c(e){return o(e)||s(e)||a(e)}var l=function(e,t){var n,u=function(e,t,n){return n},d=function(e,t,n){return n},f=null,p=typeof t;if(p===`number`)u=function(){return t};else if(Array.isArray(t))d=function(){return t[0]},u=function(){return t[t.length-1]};else if(p===`string`){var m=t.toLowerCase(),h=m.substring(0,6)===`random`,g=m.substring(0,3)===`int`;if(h||g){var _=m.indexOf(`(`),v=m.indexOf(`)`),y=m.indexOf(`,`);if(_&&v&&y){var b=parseFloat(m.substring(_+1,y)),x=parseFloat(m.substring(y+1,v));u=h?function(){return i(b,x)}:function(){return r(b,x)}}else throw Error(`invalid random() format`)}else{m=m[0];var S=parseFloat(t.substr(2));switch(m){case`+`:u=function(e,t,n){return n+S};break;case`-`:u=function(e,t,n){return n-S};break;case`*`:u=function(e,t,n){return n*S};break;case`/`:u=function(e,t,n){return n/S};break;default:u=function(){return parseFloat(t)}}}}else if(p===`function`)u=t;else if(p===`object`)if(c(t))a(t)&&(f=t.getActive),s(t)&&(u=t.getEnd),o(t)&&(d=t.getStart);else if(t.hasOwnProperty(`value`))n=l(e,t.value);else{var C=t.hasOwnProperty(`to`),w=t.hasOwnProperty(`from`),T=t.hasOwnProperty(`start`);if(C&&(w||T)){if(n=l(e,t.to),T){var E=l(e,t.start);n.getActive=E.getEnd}if(w){var D=l(e,t.from);n.getStart=D.getEnd}}}return n||={getActive:f,getEnd:u,getStart:d},n};e.exports=l}),88032:((e,t,n)=>{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(55292),u=n(35154),d=n(17777),f=n(269),p=n(86081);e.exports=function(e,t,n){if(t instanceof p)return t.parent=e,t;n=n===void 0?i:f(i,n);var m=c(t,`from`,0),h=c(t,`to`,1),g=[{value:m}],_=c(t,`delay`,n.delay),v=c(t,`easeParams`,n.easeParams),y=c(t,`ease`,n.ease),b=d(`value`,h),x=new p(e,g),S=x.add(0,`value`,b.getEnd,b.getStart,b.getActive,s(c(t,`ease`,y),c(t,`easeParams`,v)),l(t,`delay`,_),c(t,`duration`,n.duration),o(t,`yoyo`,n.yoyo),c(t,`hold`,n.hold),c(t,`repeat`,n.repeat),c(t,`repeatDelay`,n.repeatDelay),!1,!1);S.start=m,S.current=m,x.completeDelay=a(t,`completeDelay`,0),x.loop=Math.round(a(t,`loop`,0)),x.loopDelay=Math.round(a(t,`loopDelay`,0)),x.paused=o(t,`paused`,!1),x.persist=o(t,`persist`,!1),x.isNumberTween=!0,x.callbackScope=u(t,`callbackScope`,x);for(var C=r.TYPES,w=0;w{var r=n(6113),i=n(35154),a=n(36383);e.exports=function(e,t){t===void 0&&(t={});var n,o=i(t,`start`,0),s=i(t,`ease`,null),c=i(t,`grid`,null),l=i(t,`from`,0),u=l===`first`,d=l===`center`,f=l===`last`,p=typeof l==`number`,m=Array.isArray(e),h=parseFloat(m?e[0]:e),g=m?parseFloat(e[1]):0,_=Math.max(h,g);if(m&&(o+=h),c){var v=c[0],y=c[1],b=0,x=0,S=0,C=0,w=[];f?(b=v-1,x=y-1):p?(b=l%v,x=Math.floor(l/v)):d&&(b=(v-1)/2,x=(y-1)/2);for(var T=a.MIN_SAFE_INTEGER,E=0;ET&&(T=O),w[E][D]=O}}}var k=s?r(s):null;return n=c?function(e,t,n,r){var i=0,a=r%v,s=Math.floor(r/v);a>=0&&a=0&&s{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(91389),u=n(55292),d=n(82985),f=n(62329),p=n(35154),m=n(17777),h=n(269),g=n(86081);e.exports=function(e,t,n){if(t instanceof g)return t.parent=e,t;n=n===void 0?i:h(i,n);var _=f(t);!_&&n.targets&&(_=n.targets);for(var v=d(t),y=c(t,`delay`,n.delay),b=c(t,`duration`,n.duration),x=c(t,`easeParams`,n.easeParams),S=c(t,`ease`,n.ease),C=c(t,`hold`,n.hold),w=c(t,`repeat`,n.repeat),T=c(t,`repeatDelay`,n.repeatDelay),E=o(t,`yoyo`,n.yoyo),D=o(t,`flipX`,n.flipX),O=o(t,`flipY`,n.flipY),k=c(t,`interpolation`,n.interpolation),A=function(e,t,n,r){if(n===`texture`){var i=r,a=void 0;Array.isArray(r)?(i=r[0],a=r[1]):r.hasOwnProperty(`value`)?(i=r.value,Array.isArray(r.value)?(i=r.value[0],a=r.value[1]):typeof r.value==`string`&&(i=r.value)):typeof r==`string`&&(i=r),e.addFrame(t,i,a,u(r,`delay`,y),c(r,`duration`,b),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O))}else{var d=m(n,r),f=l(c(r,`interpolation`,k));e.add(t,n,d.getEnd,d.getStart,d.getActive,s(c(r,`ease`,S),c(r,`easeParams`,x)),u(r,`delay`,y),c(r,`duration`,b),o(r,`yoyo`,E),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O),f,f?r:null)}},j=new g(e,_),M=0;M{var r=n(70402),i=n(23568),a=n(57355),o=n(62329),s=n(35154),c=n(8357),l=n(43960);e.exports=function(e,t){if(t instanceof l)return t.parent=e,t;var n=new l(e);n.startDelay=s(t,`delay`,0),n.completeDelay=i(t,`completeDelay`,0),n.loop=Math.round(i(t,`loop`,s(t,`repeat`,0))),n.loopDelay=Math.round(i(t,`loopDelay`,s(t,`repeatDelay`,0))),n.paused=a(t,`paused`,!1),n.persist=a(t,`persist`,!1),n.callbackScope=s(t,`callbackScope`,n);var u,d=r.TYPES;for(u=0;u{e.exports={GetBoolean:n(57355),GetEaseFunction:n(6113),GetInterpolationFunction:n(91389),GetNewValue:n(55292),GetProps:n(82985),GetTargets:n(62329),GetValueOp:n(17777),NumberTweenBuilder:n(88032),StaggerBuilder:n(93109),TweenBuilder:n(8357)}}),73685:(e=>{e.exports=`active`}),98540:(e=>{e.exports=`complete`}),67233:(e=>{e.exports=`loop`}),2859:(e=>{e.exports=`pause`}),98336:(e=>{e.exports=`repeat`}),25764:(e=>{e.exports=`resume`}),32193:(e=>{e.exports=`start`}),84371:(e=>{e.exports=`stop`}),70766:(e=>{e.exports=`update`}),55659:(e=>{e.exports=`yoyo`}),842:((e,t,n)=>{e.exports={TWEEN_ACTIVE:n(73685),TWEEN_COMPLETE:n(98540),TWEEN_LOOP:n(67233),TWEEN_PAUSE:n(2859),TWEEN_RESUME:n(25764),TWEEN_REPEAT:n(98336),TWEEN_START:n(32193),TWEEN_STOP:n(84371),TWEEN_UPDATE:n(70766),TWEEN_YOYO:n(55659)}}),43066:((e,t,n)=>{e.exports={States:n(86353),Builders:n(30231),Events:n(842),TweenManager:n(40382),Tween:n(86081),TweenData:n(48177),TweenFrameData:n(42220),BaseTween:n(70402),TweenChain:n(43960)}}),70402:((e,t,n)=>{var r=n(83419),i=n(50792),a=n(842),o=n(86353),s=new r({Extends:i,initialize:function(e){i.call(this),this.parent=e,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=o.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(e){return this.timeScale=e,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(a.TWEEN_PAUSE,`onPause`)),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(a.TWEEN_RESUME,`onResume`)),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(a.TWEEN_COMPLETE,`onComplete`)},complete:function(e){return e===void 0&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return e===void 0&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(a.TWEEN_STOP,`onStop`),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(a.TWEEN_START,`onStart`),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,t,n){return n===void 0&&(n=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:t,params:n}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});s.TYPES=[`onActive`,`onComplete`,`onLoop`,`onPause`,`onRepeat`,`onResume`,`onStart`,`onStop`,`onUpdate`,`onYoyo`],e.exports=s}),95042:((e,t,n)=>{var r=n(83419),i=n(842),a=n(86353);e.exports=new r({initialize:function(e,t,n,r,i,a,o,s,c,l){this.tween=e,this.targetIndex=t,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=n,this.yoyo=i,this.hold=a,this.repeat=o,this.repeatDelay=s,this.repeatCounter=0,this.flipX=c,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(e){e===void 0&&(e=this.current),this.tween.targets[this.targetIndex][this.key]=e},setCreatedState:function(){this.state=a.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=a.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=a.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=a.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=a.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=a.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=a.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=a.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===a.CREATED},isDelayed:function(){return this.state===a.DELAY},isPendingRender:function(){return this.state===a.PENDING_RENDER},isPlayingForward:function(){return this.state===a.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===a.PLAYING_BACKWARD},isHolding:function(){return this.state===a.HOLD_DELAY},isRepeating:function(){return this.state===a.REPEAT_DELAY},isComplete:function(){return this.state===a.COMPLETE},setStateFromEnd:function(e){this.yoyo?this.onRepeat(e,!0,!0):this.repeatCounter>0?this.onRepeat(e,!0,!1):this.setCompleteState()},setStateFromStart:function(e){this.repeatCounter>0?this.onRepeat(e,!1):this.setCompleteState()},reset:function(){var e=this.tween,t=e.totalTargets,n=this.targetIndex,r=e.targets[n],i=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,i,0,n,t,e),this.repeatCounter=this.repeat===-1?a.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var s=o+this.repeatDelay;this.totalDuration=this.delay+o,this.repeat===-1?(this.totalDuration+=s*a.MAX,e.isInfinite=!0):this.repeat>0&&(this.totalDuration+=s*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(e,t,n){var r=this.tween,a=r.totalTargets,o=this.targetIndex,s=r.targets[o],c=this.key,l=c!==`texture`;if(this.elapsed=e,this.progress=e/this.duration,this.flipX&&s.toggleFlipX(),this.flipY&&s.toggleFlipY(),l&&(t||n)&&(this.start=this.getStartValue(s,c,this.start,o,a,r)),n){this.setPlayingBackwardState(),this.dispatchEvent(i.TWEEN_YOYO,`onYoyo`);return}this.repeatCounter--,l&&(this.end=this.getEndValue(s,c,this.start,o,a,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-e,l&&(this.current=this.start,s[c]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(i.TWEEN_REPEAT,`onRepeat`))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}})}),69902:(e=>{e.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:(e=>{e.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`.split(`.`)}),86081:((e,t,n)=>{var r=n(70402),i=n(83419),a=n(842),o=n(44603),s=n(39429),c=n(36383),l=n(86353),u=n(48177),d=n(42220),f=new i({Extends:r,initialize:function(e,t){r.call(this,e),this.targets=t,this.totalTargets=t.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(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g){var _=new u(this,e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g);return this.totalData=this.data.push(_),_},addFrame:function(e,t,n,r,i,a,o,s,c,l){var u=new d(this,e,t,n,r,i,a,o,s,c,l);return this.totalData=this.data.push(u),u},getValue:function(e){e===void 0&&(e=0);var t=null;return this.data&&(t=this.data[e].current),t},hasTarget:function(e){return this.targets&&this.targets.indexOf(e)!==-1},updateTo:function(e,t,n){if(n===void 0&&(n=!1),e!==`texture`)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.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(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=16.6),n===void 0&&(n=!1),this.isDestroyed())return console.warn(`Cannot seek destroyed Tween`,this),this;n||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`);var r=this.paused;if(this.paused=!1,e>0){for(var i=Math.floor(e/t),o=e-i*t,s=0;s0&&this.update(o)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(e){e===void 0&&(e=!1),this.duration=0,this.startDelay=c.MAX_SAFE_INTEGER;for(var t=this.data,n=0;n0?this.totalDuration=r+i+(r+o)*a:this.totalDuration=r+i},reset:function(e){return e===void 0&&(e=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=l.MAX),e||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)),this},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return this.persist?(this.setFinishedState(),!1):!0;if(this.paused||this.isFinished())return!1;if(e*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,`onStart`),e=0));var t=!1;if(this.isActive())for(var n=this.data,r=0;r{var r=n(72905),i=n(70402),a=n(83419),o=n(842),s=n(44603),c=n(39429),l=n(86353),u=new a({Extends:i,initialize:function(e){i.call(this,e),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(e){var t=this.parent.create(e);Array.isArray(t)||(t=[t]);for(var n=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;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 e=this.data,t=this.totalData,n=0;n{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g,_){r.call(this,e,t,c,l,u,d,f,p,m,h),this.key=n,this.getActiveValue=o,this.getEndValue=i,this.getStartValue=a,this.ease=s,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=_},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex],n=this.key;e&&(t[n]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(t[n]=this.getActiveValue(t,n,0))},update:function(e){var t=this.tween,n=t.totalTargets,r=this.targetIndex,a=t.targets[r],s=this.key;if(!a)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(a,s,a[s],r,n,t),this.end=this.getEndValue(a,s,this.start,r,n,t),this.current=this.start,a[s]=this.start,this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),l=this.isPlayingBackward();if(c||l){var u=this.elapsed,d=this.duration,f=0,p=!1;u+=e,u>=d?(f=u-d,u=d,p=!0):u<0&&(u=0);var m=i(u/d,0,1);this.elapsed=u,this.progress=m,this.previous=this.current,c||(m=1-m);var h=this.ease(m);this.interpolation?this.current=this.interpolation(this.interpolationData,h):this.current=this.start+(this.end-this.start)*h,a[s]=this.current,p&&(c?(t.isNumberTween&&(this.current=this.end,a[s]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(f)):(t.isNumberTween&&(this.current=this.start,a[s]=this.current),this.setStateFromStart(f))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key,a=this.current,o=this.previous;n.emit(e,n,i,r,a,o);var s=n.callbacks[t];s&&s.func.apply(n.callbackScope,[n,r,i,a,o].concat(s.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}})}),42220:((e,t,n)=>{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d){r.call(this,e,t,a,o,!1,s,c,l,u,d),this.key=`texture`,this.startTexture=null,this.endTexture=n,this.startFrame=null,this.endFrame=i,this.yoyo=c!==0},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=t.texture.key,this.startFrame=t.frame.name),e&&t.setTexture(this.startTexture,this.startFrame)},update:function(e){var t=this.tween,n=this.targetIndex,r=t.targets[n];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),s=this.isPlayingBackward();if(a||s){var c=this.elapsed,l=this.duration,u=0,d=!1;c+=e,c>=l?(u=c-l,c=l,d=!0):c<0&&(c=0);var f=i(c/l,0,1);this.elapsed=c,this.progress=f,d&&(a?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key;n.emit(e,n,i,r);var a=n.callbacks[t];a&&a.func.apply(n.callbackScope,[n,r,i].concat(a.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}})}),86353:(e=>{e.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:(e=>{function t(e){return!!e.get&&typeof e.get==`function`||!!e.set&&typeof e.set==`function`}function n(e,n,r){var i=r?e[n]:Object.getOwnPropertyDescriptor(e,n);return!r&&i.value&&typeof i.value==`object`&&(i=i.value),i&&t(i)?(i.enumerable===void 0&&(i.enumerable=!0),i.configurable===void 0&&(i.configurable=!0),i):!1}function r(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return n?(n.value&&typeof n.value==`object`&&(n=n.value),n.configurable===!1):!1}function i(e,t,i,a){for(var s in t)if(t.hasOwnProperty(s)){var c=n(t,s,i);if(c!==!1){if(r((a||e).prototype,s)){if(o.ignoreFinals)continue;throw Error(`cannot override final property '`+s+`', set Class.ignoreFinals = true to skip`)}Object.defineProperty(e.prototype,s,c)}else e.prototype[s]=t[s]}}function a(e,t){if(t){Array.isArray(t)||(t=[t]);for(var n=0;n{e.exports=function(){}}),20242:(e=>{e.exports=function(){return null}}),71146:(e=>{e.exports=function(e,t,n,r,i){if(i===void 0&&(i=e),n>0){var a=n-e.length;if(a<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.push(t),r&&r.call(i,t),t):null;for(var o=t.length-1;o>=0;)e.indexOf(t[o])!==-1&&t.splice(o,1),o--;if(o=t.length,o===0)return null;n>0&&o>a&&(t.splice(a),o=a);for(var s=0;s{e.exports=function(e,t,n,r,i,a){if(n===void 0&&(n=0),a===void 0&&(a=e),r>0){var o=r-e.length;if(o<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.splice(n,0,t),i&&i.call(a,t),t):null;for(var s=t.length-1;s>=0;)e.indexOf(t[s])!==-1&&t.pop(),s--;if(s=t.length,s===0)return null;r>0&&s>o&&(t.splice(o),s=o);for(var c=s-1;c>=0;c--){var l=t[c];e.splice(n,0,l),i&&i.call(a,l)}return t}}),66905:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=0;if(r(e,i,a))for(var s=i;s{e.exports=function(e,t,n){var r,i=[null];for(r=3;r{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a)){var o,s=[null];for(o=5;o{e.exports=function(e,t,n){if(!t.length)return NaN;if(t.length===1)return t[0];var r=1,i,a;if(n){if(et.length&&(r=t.length),n?(i=t[r-1][n],a=t[r][n],a-e<=e-i?t[r]:t[r-1]):(i=t[r-1],a=t[r],a-e<=e-i?a:i)}}),43491:(e=>{var t=function(e,n){n===void 0&&(n=[]);for(var r=0;r{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=[];if(r(e,i,a))for(var s=i;s{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),i!==-1){if(r(e,i,a))for(var o=i;o=0;o--){var s=e[o];if(!t||t&&n===void 0&&s.hasOwnProperty(t)||t&&n!==void 0&&s[t]===n)return s}return null}}),26546:(e=>{e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=e.length);var r=t+Math.floor(Math.random()*n);return e[r]===void 0?null:e[r]}}),85835:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r>i?e:(e.splice(r,1),i=e.indexOf(n),e.splice(i+1,0,t),e)}}),83371:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r{e.exports=function(e,t){var n=e.indexOf(t);if(n>0){var r=e[n-1],i=e.indexOf(r);e[n]=r,e[i]=t}return e}}),69693:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t);if(r===-1||n<0||n>=e.length)throw Error(`Supplied index out of bounds`);return r!==n&&(e.splice(r,1),e.splice(n,0,t)),t}}),40853:(e=>{e.exports=function(e,t){var n=e.indexOf(t);if(n!==-1&&n{e.exports=function(e,t,n,r){var i=[],a,o=!1;if((n||r)&&(o=!0,n||=``,r||=``),t=t;a--)o?i.push(n+a.toString()+r):i.push(a);else for(a=e;a<=t;a++)o?i.push(n+a.toString()+r):i.push(a);return i}}),593:((e,t,n)=>{var r=n(2284);e.exports=function(e,t,n){e===void 0&&(e=0),t===void 0&&(t=null),n===void 0&&(n=1),t===null&&(t=e,e=0);for(var i=[],a=Math.max(r((t-e)/(n||1)),0),o=0;o{function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e,i,a,o,s){for(a===void 0&&(a=0),o===void 0&&(o=e.length-1),s===void 0&&(s=n);o>a;){if(o-a>600){var c=o-a+1,l=i-a+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(l-c/2<0?-1:1);r(e,i,Math.max(a,Math.floor(i-l*d/c+f)),Math.min(o,Math.floor(i+(c-l)*d/c+f)),s)}var p=e[i],m=a,h=o;for(t(e,a,i),s(e[o],p)>0&&t(e,a,o);m0;)h--}s(e[a],p)===0?t(e,a,h):(h++,t(e,h,o)),h<=i&&(a=h+1),i<=h&&(o=h-1)}};e.exports=r}),88492:((e,t,n)=>{var r=n(35154),i=n(33680),a=function(e,t,n){for(var r=[],i=0;i{var r=n(19133);e.exports=function(e,t,n,i){i===void 0&&(i=e);var a;if(!Array.isArray(t))return a=e.indexOf(t),a===-1?null:(r(e,a),n&&n.call(i,t),t);for(var o=t.length-1,s=[];o>=0;){var c=t[o];a=e.indexOf(c),a!==-1&&(r(e,a),s.push(c),n&&n.call(i,c)),o--}return s}}),60248:((e,t,n)=>{var r=n(19133);e.exports=function(e,t,n,i){if(i===void 0&&(i=e),t<0||t>e.length-1)throw Error(`Index out of bounds`);var a=r(e,t);return n&&n.call(i,a),a}}),81409:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(t===void 0&&(t=0),n===void 0&&(n=e.length),a===void 0&&(a=e),r(e,t,n)){var o=n-t,s=e.splice(t,o);if(i)for(var c=0;c{var r=n(19133);e.exports=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.length),r(e,t+Math.floor(Math.random()*n))}}),42169:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t),i=e.indexOf(n);return r!==-1&&i===-1?(e[r]=n,!0):!1}}),86003:(e=>{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t,n,r){var i=e.length;if(t<0||t>=i||t>=n||n>i){if(r)throw Error(`Range Error: Values outside acceptable range`);return!1}else return!0}}),89545:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n>0&&(e.splice(n,1),e.unshift(t)),t}}),17810:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a))for(var o=i;o{e.exports=function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}}),90126:(e=>{e.exports=function(e){var t=/\D/g;return e.sort(function(e,n){return parseInt(e.replace(t,``),10)-parseInt(n.replace(t,``),10)}),e}}),19133:(e=>{e.exports=function(e,t){if(!(t>=e.length)){for(var n=e.length-1,r=e[t],i=t;i{var r=n(82264);function i(e,t){return String(e).localeCompare(t)}function a(e,t){var n=e.length;if(n<=1)return e;for(var r=Array(n),i=1;ii&&(c=i),l>i&&(l=i),u=s,d=c;;)if(u{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return e[r]=n,e[i]=t,e}}),37105:((e,t,n)=>{e.exports={Matrix:n(54915),Add:n(71146),AddAt:n(51067),BringToTop:n(66905),CountAllMatching:n(21612),Each:n(95428),EachInRange:n(36914),FindClosestInSorted:n(81957),Flatten:n(43491),GetAll:n(46710),GetFirst:n(58731),GetRandom:n(26546),MoveDown:n(70864),MoveTo:n(69693),MoveUp:n(40853),MoveAbove:n(85835),MoveBelow:n(83371),NumberArray:n(20283),NumberArrayStep:n(593),QuickSelect:n(43886),Range:n(88492),Remove:n(72905),RemoveAt:n(60248),RemoveBetween:n(81409),RemoveRandomElement:n(31856),Replace:n(42169),RotateLeft:n(86003),RotateRight:n(49498),SafeRange:n(82011),SendToBack:n(89545),SetAll:n(17810),Shuffle:n(33680),SortByDigits:n(90126),SpliceOne:n(19133),StableSort:n(19186),Swap:n(25630)}}),86922:(e=>{e.exports=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var t=e[0].length,n=1;n{var r=n(41836),i=n(86922);e.exports=function(e){var t=``;if(!i(e))return t;for(var n=0;n{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),ln=G(),un=G(),dn=G();G();function fn(){let e=ee(un);if(!e)throw Error(`Solidion: useScene() must be used within a component.`);return e}function pn(){let e=ee(dn);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function mn(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function hn(e,t,n){Qe(),I(()=>{e.update(t,n)}),$e()}function gn(e,t){return new Promise(n=>{let r=mn(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){hn(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:cn.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new cn.default.Game(o)})}function _n(e){let[t,n]=M(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&gn(r,e).then(t=>{n(t),je(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=Mt(()=>be(ln.Provider,{value:t.game,get children(){return be(un.Provider,{value:t.scene,get children(){return be(dn.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),z(()=>{let e=L(t);i&&i(),e&&(Me(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}function vn(e){return z(pn().register(e.onUpdate)),null}var yn=10;function bn(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)bn(r,t,n);return}if(typeof e==`function`){if(n>=yn)return;bn(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Le(e))){let r=Ie(e);for(let e of r.children)bn(e,t,n)}}}function xn(e){let t=e.children;return N(()=>{bn(t,!!e.when)}),t}function Sn(e){let t=null,n,r=mn(),i=e.name??`__solidion_scene_${Math.random().toString(36).slice(2)}`,a={key:i,active:e.active??!0,...e.physics?{physics:e.physics}:{},create(){t=this,je(this);let i=this.add.container(0,0);Ie(i),n=Mt(()=>be(un.Provider,{value:this,get children(){return be(dn.Provider,{value:r,get children(){return e.children}})}}),i)},update(e,t){hn(r,e,t)}},o=Ne();return o&&o.scene.add(i,a,e.active??!0),z(()=>{if(n&&n(),t){Me();try{t.scene.remove(i)}catch{}}}),null}function Cn(e){let[t,n]=M(!1);R(()=>{let t=Ne();if(!t){console.warn(`Solidion: used outside of a Scene. Assets not loaded.`),n(!0);return}vt(t,e.assets).then(()=>{n(!0)}).catch(e=>{console.error(`Solidion: Preload failed:`,e),n(!0)})});let r=e.fallback;P(()=>{r&&bn(r,!t())});let i=[];return r&&i.push(r),i.push(e.children),i}function wn(e,t,n){let r=t.mass??1,i=t.targetX-e.x,a=t.targetY-e.y,o=(i*t.stiffness-e.vx*t.damping)/r,s=(a*t.stiffness-e.vy*t.damping)/r,c=e.vx+o*n,l=e.vy+s*n;return{x:e.x+c*n,y:e.y+l*n,vx:c,vy:l}}function Tn(e,t){let n=e*t.frequency*Math.PI*2+(t.phase??0);return{x:(t.amplitudeX??0)*Math.sin(n),y:(t.amplitudeY??0)*Math.sin(n)}}function En(e,t,n){let r=e.vx+(t.ax??0)*n,i=e.vy+(t.ay??0)*n;if(t.drag){let e=1-t.drag*n;r*=e,i*=e}let a=e.x+r*n,o=e.y+i*n,s=t.bounce??0;if(t.boundsX){let[e,n]=t.boundsX;an&&(a=n,r=-Math.abs(r)*s)}if(t.boundsY){let[e,n]=t.boundsY;on&&(o=n,i=-Math.abs(i)*s)}return{x:a,y:o,vx:r,vy:i}}function Dn(e,t,n,r){let i=1-Math.max(0,1-n.speed)**(r*60);return{x:e+(n.targetX-e)*i,y:t+(n.targetY-t)*i}}function On(e,t,n){let r=t[e.current];if(!r)return{state:e.current,timer:e.timer,transitioned:!1,previous:e.current};let i=e.timer+n;return r.duration&&r.onComplete&&i>=r.duration?{state:r.onComplete,timer:0,transitioned:!0,previous:e.current}:{state:e.current,timer:i,transitioned:!1,previous:e.current}}function kn(e,t,n){let r=t[e];if(!r?.on)return{state:e,transitioned:!1};let i=r.on[n];return i?{state:i,transitioned:!0}:{state:e,transitioned:!1}}function An(e,t,n){if(!e.active)return{...e,completed:!1};let r=n/t.duration*e.direction,i=e.progress+r,a=e.direction,o=!1;return i>=1?t.yoyo?(i=1-(i-1),a=-1):(i=1,o=!0):i<=0&&e.direction===-1&&(i=0,o=!0,a=1),{progress:i,active:!o,direction:a,completed:o}}function jn(e){let t=e.timerMode??`frame`,[n,r]=M(e.initial),i=0,a=0,o=null,s=null,c=e.scene??null;if(t===`scene`&&!c)throw Error('useStateMachine: timerMode "scene" requires a `scene` property in the config. Pass useScene() or a direct Phaser.Scene reference.');let l=()=>e.states[n()],u=F(()=>{let e=l().animation;return e?typeof e==`function`?e():e:``});function d(e){!e.duration||!e.onComplete||(t===`frame`?(i=0,a=e.duration,o=e.onComplete):s=c.time.delayedCall(e.duration,()=>{p(e.onComplete)}))}function f(){t===`frame`?(i=0,a=0,o=null):s&&=(s.remove(),null)}function p(t){let i=n();if(i===t)return;e.states[i].onExit?.(),f(),r(()=>t);let a=e.states[t];a.onEnter?.(),d(a)}return R(()=>{let t=e.states[e.initial];t.onEnter?.(),d(t)}),z(()=>{f()}),{state:n,animation:u,send:t=>{let r=kn(n(),e.states,t);r.transitioned&&p(r.state)},is:e=>n()===e,tick:r=>{if(t!==`frame`||!o||a<=0)return;let s=On({current:n(),timer:i},e.states,r);i=s.timer,s.transitioned&&p(s.state)}}}function Mn(e){z(pn().register(e))}function Nn(e){let t=e.stiffness??200,n=e.damping??20,r=e.mass??1,i=e.target(),a={x:e.initial?.x??i.x,y:e.initial?.y??i.y,vx:0,vy:0},[o,s]=M({x:a.x,y:a.y});return Mn((i,o)=>{let c=Math.min(o/1e3,.05),l=e.target();a=wn(a,{targetX:l.x,targetY:l.y,stiffness:t,damping:n,mass:r},c),s({x:a.x,y:a.y})}),o}function Pn(e){let t=e.frequency??1,n=e.phase??0,r=e.amplitude.x??0,i=e.amplitude.y??0,[a,o]=M({x:0,y:0});return Mn(e=>{o(Tn(e/1e3,{amplitudeX:r,amplitudeY:i,frequency:t,phase:n}))}),a}var Fn=0;function In(){return`__behavior_${++Fn}`}function Ln(e,t,n){ze(e,t,n);for(let t of Object.keys(n))ct(e,t)}function Rn(e,t,n){Be(e,t);for(let t of n)ct(e,t)}function zn(e){let t=In(),n=e.stiffness??200,r=e.damping??20,i=e.mass??1,a=e.target(),o={x:a.x,y:a.y,vx:0,vy:0};return Mn((a,s)=>{let c=Math.min(s/1e3,.05),l=e.target();o=wn(o,{targetX:l.x,targetY:l.y,stiffness:n,damping:r,mass:i},c),Ln(e.parent,t,{x:o.x,y:o.y})}),z(()=>Rn(e.parent,t,[`x`,`y`])),null}function Bn(e){return z(pn().register((t,n)=>{e.when&&!e.when()||e.update(t,n)})),null}function Vn(e,t){I(()=>{for(let n=0;n({active:!1,id:0,x:0,y:0,vx:0,vy:0,targetX:0,targetY:0,fsmState:`idle`,fsmTimer:0,stateDuration:3e3,hunger:0,color:nr[0],texture:Un[0],size:1,dir:1,sleeping:!1,popProgress:0,popActive:!1,feedStep:0,feedTimer:0,eating:!1}))),[ar,or]=rn(Array.from({length:Zn},()=>({active:!1,x:0,y:0,vx:0,vy:0}))),[sr,cr]=rn(Array.from({length:Qn},(e,t)=>({active:!1,x:0,y:0,vx:0,vy:0,dia:4,wobblePhase:t*2.1,wobbleFreq:1.5+Math.random()*.5}))),[lr,ur]=rn(Array.from({length:$n},()=>({active:!1,parentSlot:-1,x:Wn/2,y:Gn/2,color:nr[0],offsetX:0,offsetY:0,speed:.1}))),dr=1,fr={idle:{on:{FOOD_NEARBY:`eat`}},swim:{on:{FOOD_NEARBY:`eat`,SLEEPY:`sleep`}},eat:{},sleep:{on:{WAKE:`idle`}}},pr={idle:`swim`,swim:`idle`,eat:`idle`,sleep:`idle`},mr=[800,400,600];function hr(e,t,n){ir(e,sn(e=>{switch(n===`sleep`&&(e.sleeping=!1),e.fsmState=t,e.fsmTimer=0,t){case`idle`:e.targetX=e.x,e.targetY=e.y,e.stateDuration=2e3+Math.random()*2e3;break;case`swim`:{let t=Jn+40+Math.random()*(Yn-Jn-80),n=Kn+60+Math.random()*(qn-Kn-120);e.targetX=t,e.targetY=n,e.dir=t>e.x?1:-1,e.stateDuration=3e3+Math.random()*3e3;break}case`eat`:e.feedStep=0,e.feedTimer=0,e.eating=!0,e.stateDuration=2500;break;case`sleep`:e.sleeping=!0,e.targetX=e.x,e.targetY=qn-50,e.stateDuration=5e3+Math.random()*3e3;break}}))}function gr(e,t){let n=rr[e],r=kn(n.fsmState,fr,t);r.transitioned&&hr(e,r.state,n.fsmState)}function _r(e){let t=1.70158,n=e-1;return 1+(t+1)*n*n*n+t*n*n}var vr=[],yr=[],br=null;function xr(e){let[t,n]=M(!1),r=Pn({amplitude:{y:30,x:6},frequency:.08,phase:e.baseX*.01}),i=Pn({amplitude:{x:4,y:3},frequency:.24,phase:e.baseX*.03}),a=jn({initial:`drift`,states:{drift:{on:{STARTLE:`startled`}},startled:{duration:800,onComplete:`drift`,onEnter:()=>n(!0),onExit:()=>n(!1)}}}),o=Pn({amplitude:{x:2},frequency:.6,phase:0}),s=Pn({amplitude:{x:3},frequency:.5,phase:1.2}),c=Pn({amplitude:{x:2},frequency:.7,phase:2.4}),l=()=>a.send(`STARTLE`);vr.push(e=>a.tick(e)),yr.push(t);let u=()=>e.baseX+(t()?0:r().x),d=()=>e.baseY+(t()?-10:r().y),f=()=>t()?24:30+i().x,p=()=>t()?18:24+i().y;return[(()=>{var e=Q(`ellipse`);return $(e,`fillColor`,13404415),$(e,`origin`,.5),$(e,`depth`,8),$(e,`onClick`,l),X(n=>{var r=u(),i=d(),a=f(),o=p(),s=t()?.4:.6;return r!==n.e&&(n.e=$(e,`x`,r,n.e)),i!==n.t&&(n.t=$(e,`y`,i,n.t)),a!==n.a&&(n.a=$(e,`width`,a,n.a)),o!==n.o&&(n.o=$(e,`height`,o,n.o)),s!==n.i&&(n.i=$(e,`alpha`,s,n.i)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`width`,2),$(e,`height`,16),$(e,`fillColor`,12285934),$(e,`origin`,.5),$(e,`depth`,7),$(e,`alpha`,.4),X(t=>{var n=u()-6+o().x,r=d()+p()/2+2;return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`width`,2),$(e,`height`,20),$(e,`fillColor`,12285934),$(e,`origin`,.5),$(e,`depth`,7),$(e,`alpha`,.4),X(t=>{var n=u()+s().x,r=d()+p()/2+3;return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`width`,2),$(e,`height`,16),$(e,`fillColor`,12285934),$(e,`origin`,.5),$(e,`depth`,7),$(e,`alpha`,.4),X(t=>{var n=u()+6+c().x,r=d()+p()/2+2;return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})()]}function Sr(e){let t=Pn({amplitude:{x:8},frequency:.3+e.index*.08,phase:e.index*1.2}),n=e.height,r=()=>e.x+t().x;return[(()=>{var e=Q(`rectangle`);return $(e,`y`,qn-n/2),$(e,`width`,6),$(e,`height`,n),$(e,`fillColor`,2984774),$(e,`origin`,.5),$(e,`depth`,2),$(e,`alpha`,.7),X(t=>$(e,`x`,r(),t)),e})(),(()=>{var e=Q(`rectangle`);return $(e,`y`,qn-n*.3),$(e,`width`,5),$(e,`height`,n*.6),$(e,`fillColor`,3845468),$(e,`origin`,.5),$(e,`depth`,2),$(e,`alpha`,.5),X(t=>$(e,`x`,r()+8,t)),e})()]}function Cr(){let e=fn();return br=()=>e.cameras.main.shake(120,.005),null}function wr(e){return Nt(()=>rr.map((t,n)=>{let r=()=>t.fsmState!==`idle`&&t.fsmState!==`sleep`?0:Tn(performance.now()/1e3,{amplitudeY:3,frequency:.5,phase:n*1.7}).y,i=()=>t.size*_r(t.popProgress),a=()=>cn.default.Math.Clamp(t.y+r(),Kn+30,qn-20),o=()=>t.eating&&t.feedStep===1;return Z(xn,{get when(){return t.active},get children(){return[(()=>{var r=Q(`rectangle`);return $(r,`fillColor`,0),$(r,`origin`,.5),$(r,`depth`,13),$(r,`alpha`,.001),$(r,`onClick`,()=>e.onSelect(n)),X(e=>{var n=t.x,i=a(),o=40*t.size,s=28*t.size;return n!==e.e&&(e.e=$(r,`x`,n,e.e)),i!==e.t&&(e.t=$(r,`y`,i,e.t)),o!==e.a&&(e.a=$(r,`width`,o,e.a)),s!==e.o&&(e.o=$(r,`height`,s,e.o)),e},{e:void 0,t:void 0,a:void 0,o:void 0}),r})(),(()=>{var e=Q(`sprite`);return $(e,`origin`,.5),$(e,`depth`,10),X(n=>{var r=t.x,o=a(),s=t.texture,c=t.dir*i()*2,l=i()*2,u=t.sleeping?.5:1;return r!==n.e&&(n.e=$(e,`x`,r,n.e)),o!==n.t&&(n.t=$(e,`y`,o,n.t)),s!==n.a&&(n.a=$(e,`texture`,s,n.a)),c!==n.o&&(n.o=$(e,`scaleX`,c,n.o)),l!==n.i&&(n.i=$(e,`scaleY`,l,n.i)),u!==n.n&&(n.n=$(e,`alpha`,u,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e})(),(()=>{var e=Q(`ellipse`);return $(e,`fillColor`,16777215),$(e,`origin`,.5),$(e,`depth`,11),X(n=>{var r=t.x+t.dir*8*i(),s=a()-2*i(),c=5*i(),l=t.sleeping||o()?1*i():5*i();return r!==n.e&&(n.e=$(e,`x`,r,n.e)),s!==n.t&&(n.t=$(e,`y`,s,n.t)),c!==n.a&&(n.a=$(e,`width`,c,n.a)),l!==n.o&&(n.o=$(e,`height`,l,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=Q(`ellipse`);return $(e,`fillColor`,1118481),$(e,`origin`,.5),$(e,`depth`,12),X(n=>{var r=t.x+t.dir*9*i(),s=a()-2*i(),c=2.5*i(),l=t.sleeping||o()?.5*i():2.5*i();return r!==n.e&&(n.e=$(e,`x`,r,n.e)),s!==n.t&&(n.t=$(e,`y`,s,n.t)),c!==n.a&&(n.a=$(e,`width`,c,n.a)),l!==n.o&&(n.o=$(e,`height`,l,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e})()]}})}))}function Tr(){return Nt(()=>ar.map(e=>(()=>{var t=Q(`ellipse`);return $(t,`width`,6),$(t,`height`,6),$(t,`fillColor`,14527044),$(t,`origin`,.5),$(t,`depth`,3),X(n=>{var r=e.x,i=e.y,a=e.active;return r!==n.e&&(n.e=$(t,`x`,r,n.e)),i!==n.t&&(n.t=$(t,`y`,i,n.t)),a!==n.a&&(n.a=$(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()))}function Er(){return Nt(()=>sr.map(e=>{let t=()=>Tn(performance.now()/1e3,{amplitudeX:3,frequency:e.wobbleFreq,phase:e.wobblePhase}).x;return(()=>{var n=Q(`ellipse`);return $(n,`fillColor`,8965358),$(n,`origin`,.5),$(n,`depth`,4),$(n,`alpha`,.6),X(r=>{var i=e.x+t(),a=e.y,o=e.dia,s=e.dia,c=e.active;return i!==r.e&&(r.e=$(n,`x`,i,r.e)),a!==r.t&&(r.t=$(n,`y`,a,r.t)),o!==r.a&&(r.a=$(n,`width`,o,r.a)),s!==r.o&&(r.o=$(n,`height`,s,r.o)),c!==r.i&&(r.i=$(n,`visible`,c,r.i)),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}))}function Dr(){return Nt(()=>lr.map(e=>Z(xn,{get when(){return e.active},get children(){return[(()=>{var t=Q(`ellipse`);return $(t,`width`,12),$(t,`height`,7),$(t,`origin`,.5),$(t,`depth`,10),$(t,`alpha`,.7),X(n=>{var r=e.x,i=e.y,a=e.color;return r!==n.e&&(n.e=$(t,`x`,r,n.e)),i!==n.t&&(n.t=$(t,`y`,i,n.t)),a!==n.a&&(n.a=$(t,`fillColor`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Q(`ellipse`);return $(t,`width`,2),$(t,`height`,2),$(t,`fillColor`,16777215),$(t,`origin`,.5),$(t,`depth`,11),X(n=>{var r=e.x+3,i=e.y-1;return r!==n.e&&(n.e=$(t,`x`,r,n.e)),i!==n.t&&(n.t=$(t,`y`,i,n.t)),n},{e:void 0,t:void 0}),t})()]}})))}function Or(){let[e,t]=M(`title`),[n,r]=M(0),[i,a]=M(-1),[o,s]=M(!1),[c,l]=M(``),u=!1,d=0,f=()=>e()===`aquarium`;function p(){let e=rr.findIndex(e=>!e.active);if(e<0)return;let t=Math.floor(Math.random()*Un.length),n=Jn+60+Math.random()*(Yn-Jn-120),i=Kn+80+Math.random()*(qn-Kn-160);if(ir(e,{active:!0,id:dr++,x:n,y:i,vx:0,vy:0,targetX:n,targetY:i,fsmState:`idle`,fsmTimer:0,stateDuration:2e3+Math.random()*2e3,hunger:0,color:nr[t],texture:Un[t],size:.8+Math.random()*.4,dir:1,sleeping:!1,popProgress:0,popActive:!0,feedStep:0,feedTimer:0,eating:!1}),r(e=>e+1),br?.(),Math.random()<.2){let r=lr.findIndex(e=>!e.active);r>=0&&ur(r,{active:!0,parentSlot:e,x:n,y:i,color:nr[t],offsetX:(r%2==0?-1:1)*(12+r*4),offsetY:8+r*3,speed:.08+r*.02})}}let m=()=>{let e=i();if(!(e<0)){ir(e,`active`,!1);for(let t=0;t<$n;t++)lr[t].parentSlot===e&&ur(t,`active`,!1);a(-1),s(!1),r(e=>e-1)}},h=n=>{if(e()===`title`){t(`aquarium`),u||(u=!0,p(),p(),p());return}if(n.x>Wn-120&&n.y<35||i()>=0&&n.x>Wn-160&&n.y>Gn/2-100&&n.yqn||n.xYn)return;let r=ar.findIndex(e=>!e.active);r>=0&&or(r,{active:!0,x:n.x,y:n.y,vx:0,vy:18})},g=e=>{a(e),s(!0)},_=(e,t)=>{Vn(rr,(e,n)=>{let r=e.fsmTimer+t;r>=e.stateDuration?hr(n,pr[e.fsmState]??`idle`,e.fsmState):ir(n,`fsmTimer`,r)})},v=(e,t)=>{Vn(rr,(e,n)=>{let r=e.hunger+t*.003;ir(n,`hunger`,r),r>100&&e.fsmState===`swim`&&Math.random()<.001&&gr(n,`SLEEPY`)})},y=()=>{I(()=>{for(let e=0;e30){let t=ar[n];ir(e,sn(e=>{e.targetX=t.x,e.targetY=t.y,e.dir=t.x>e.x?1:-1})),gr(e,`FOOD_NEARBY`)}}}})},b=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(rr,(e,t)=>{let r=wn({x:e.x,y:e.y,vx:e.vx,vy:e.vy},{targetX:e.targetX,targetY:e.targetY,stiffness:15,damping:8},n);ir(t,{x:cn.default.Math.Clamp(r.x,Jn+20,Yn-20),y:cn.default.Math.Clamp(r.y,Kn+30,qn-20),vx:r.vx,vy:r.vy})})},x=(e,t)=>{Vn(rr,(e,n)=>{if(!e.eating)return;let r=e.feedTimer+t;if(r>=mr[e.feedStep]){let t=e.feedStep+1;t>=3?ir(n,{eating:!1,feedStep:0,feedTimer:0}):ir(n,{feedStep:t,feedTimer:0})}else ir(n,`feedTimer`,r)})},S=(e,t)=>{Vn(rr,(e,n)=>{if(!e.popActive)return;let r=An({progress:e.popProgress,active:!0,direction:1},{duration:400},t);ir(n,{popProgress:r.progress,popActive:r.active})})},C=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(ar,(e,t)=>{let r=En({x:e.x,y:e.y,vx:e.vx,vy:e.vy},{boundsY:[Kn,qn]},n);r.y>=qn-1?or(t,`active`,!1):or(t,{x:r.x,y:r.y,vx:r.vx,vy:r.vy})})},w=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(sr,(e,t)=>{let r=En({x:e.x,y:e.y,vx:e.vx,vy:e.vy},{boundsY:[Kn,qn]},n);r.y<=Kn+1?cr(t,`active`,!1):cr(t,{x:r.x,y:r.y,vx:r.vx,vy:r.vy})})},T=0,E=(e,t)=>{if(T-=t,T<=0){T=200+Math.random()*500;let e=sr.findIndex(e=>!e.active);e>=0&&cr(e,{active:!0,x:Jn+20+Math.random()*(Yn-Jn-40),y:qn-10,vx:0,vy:-(30+Math.random()*60),dia:3+Math.random()*4})}},D=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(lr,(e,t)=>{let r=e.parentSlot,i=r>=0&&rr[r].active?rr[r]:{x:Wn/2,y:Gn/2},a=Dn(e.x,e.y,{targetX:i.x+e.offsetX,targetY:i.y+e.offsetY,speed:e.speed},n);ur(t,{x:a.x,y:a.y})})},O=(t,r)=>{if(!f()){rt({phase:e(),fishCount:n(),foodCount:0});return}for(let e of vr)e(r);if(d-=r,d<=0){d=500;let t=et();l(`props/f: ${t.setPropertyCalls} ${t.frameTimeMs.toFixed(1)}ms`),rt({phase:e(),fishCount:n(),foodCount:ar.filter(e=>e.active).length,bubbleCount:sr.filter(e=>e.active).length,fryCount:lr.filter(e=>e.active).length,selIdx:i(),showPanel:o(),fishPositions:rr.filter(e=>e.active).map(e=>({x:e.x,y:e.y})),fishStates:rr.filter(e=>e.active).map(e=>e.fsmState),fishHungers:rr.filter(e=>e.active).map(e=>e.hunger),fishEating:rr.filter(e=>e.active).map(e=>e.eating),jellyStartled:yr.map(e=>e())})}},k=()=>i()>=0?rr[i()]:null;return Z(_n,{width:Wn,height:Gn,backgroundColor:662062,parent:`game-container`,onPointerDown:h,get children(){return[Z(vn,{onUpdate:O}),Z(xn,{get when(){return e()===`title`},get children(){return[(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,240),$(e,`width`,640),$(e,`height`,480),$(e,`fillColor`,662062),$(e,`origin`,.5),$(e,`depth`,100),e})(),(()=>{var e=Q(`text`);return $(e,`x`,320),$(e,`y`,200),$(e,`text`,`Solidion Aquarium`),$(e,`fontSize`,36),$(e,`fontFamily`,`Georgia, serif`),$(e,`color`,`#4488cc`),$(e,`origin`,.5),$(e,`depth`,101),e})(),(()=>{var e=Q(`text`);return $(e,`x`,320),$(e,`y`,260),$(e,`text`,`tap to start`),$(e,`fontSize`,16),$(e,`fontFamily`,`monospace`),$(e,`color`,`#336688`),$(e,`origin`,.5),$(e,`depth`,101),e})(),(()=>{var e=Q(`ellipse`);return $(e,`x`,320),$(e,`y`,320),$(e,`width`,32),$(e,`height`,18),$(e,`fillColor`,5164484),$(e,`origin`,.5),$(e,`depth`,101),$(e,`alpha`,.6),e})(),(()=>{var e=Q(`rectangle`);return $(e,`x`,302),$(e,`y`,320),$(e,`width`,10),$(e,`height`,12),$(e,`fillColor`,5164484),$(e,`origin`,.5),$(e,`depth`,101),$(e,`alpha`,.5),e})()]}}),Z(xn,{get when(){return f()},get children(){return Z(Sn,{name:`aquarium`,get children(){return Z(Cn,{assets:Hn,get fallback(){return[(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,240),$(e,`width`,640),$(e,`height`,480),$(e,`fillColor`,662062),$(e,`origin`,.5),$(e,`depth`,50),e})(),(()=>{var e=Q(`text`);return $(e,`x`,320),$(e,`y`,230),$(e,`text`,`Loading aquarium...`),$(e,`fontSize`,16),$(e,`fontFamily`,`monospace`),$(e,`color`,`#336688`),$(e,`origin`,.5),$(e,`depth`,51),e})(),(()=>{var e=Q(`ellipse`);return $(e,`x`,320),$(e,`y`,270),$(e,`width`,20),$(e,`height`,12),$(e,`fillColor`,5164484),$(e,`origin`,.5),$(e,`depth`,51),$(e,`alpha`,.5),e})()]},get children(){return[Z(Cr,{}),Z(Bn,{update:_}),Z(Bn,{update:v}),Z(Bn,{update:y}),Z(Bn,{update:b}),Z(Bn,{update:x}),Z(Bn,{update:S}),Z(Bn,{update:C}),Z(Bn,{update:w}),Z(Bn,{update:E}),Z(Bn,{update:D}),(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,240),$(e,`width`,600),$(e,`height`,420),$(e,`fillColor`,925760),$(e,`origin`,.5),$(e,`depth`,0),$(e,`alpha`,.5),e})(),(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,465),$(e,`width`,600),$(e,`height`,30),$(e,`fillColor`,9139029),$(e,`origin`,.5),$(e,`depth`,1),e})(),(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,30),$(e,`width`,600),$(e,`height`,2),$(e,`fillColor`,4491434),$(e,`origin`,.5),$(e,`depth`,5),$(e,`alpha`,.5),e})(),Nt(()=>[{x:80,h:40},{x:200,h:55},{x:350,h:70},{x:500,h:85},{x:580,h:60}].map((e,t)=>Z(Sr,{get x(){return e.x},get height(){return e.h},index:t}))),Z(xr,{baseX:520,baseY:150}),Z(xr,{baseX:120,baseY:200}),Z(Er,{}),Z(Tr,{}),Z(wr,{onSelect:g}),Z(Dr,{}),Z(xn,{get when(){return f()},get children(){return[(()=>{var e=Q(`rectangle`);return $(e,`x`,580),$(e,`y`,16),$(e,`width`,100),$(e,`height`,24),$(e,`fillColor`,2250120),$(e,`origin`,.5),$(e,`depth`,20),$(e,`onClick`,()=>p()),e})(),(()=>{var e=Q(`text`);return $(e,`x`,580),$(e,`y`,16),$(e,`text`,`+ Add Fish`),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#aaccee`),$(e,`origin`,.5),$(e,`depth`,21),e})(),(()=>{var e=Q(`text`);return $(e,`x`,20),$(e,`y`,16),$(e,`fontSize`,12),$(e,`fontFamily`,`monospace`),$(e,`color`,`#668899`),$(e,`originX`,0),$(e,`originY`,.5),$(e,`depth`,20),X(t=>$(e,`text`,`Fish: ${n()}`,t)),e})(),(()=>{var e=Q(`text`);return $(e,`x`,20),$(e,`y`,470),$(e,`fontSize`,9),$(e,`fontFamily`,`monospace`),$(e,`color`,`#334455`),$(e,`originX`,0),$(e,`originY`,.5),$(e,`depth`,20),X(t=>$(e,`text`,c(),t)),e})()]}}),Nt(()=>(()=>{let e=Nn({target:()=>({x:o()&&i()>=0?Wn-80:Wn+100,y:Gn/2}),stiffness:80,damping:14,initial:{x:Wn+100,y:Gn/2}}),t=()=>e().x,n=()=>t(){var e=Q(`rectangle`);return $(e,`y`,240),$(e,`width`,140),$(e,`height`,180),$(e,`fillColor`,1122867),$(e,`origin`,.5),$(e,`depth`,30),$(e,`alpha`,.9),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`text`);return zt(e=>{r=e},e),$(e,`y`,180),$(e,`fontSize`,14),$(e,`fontFamily`,`monospace`),$(e,`color`,`#88bbdd`),$(e,`origin`,.5),$(e,`depth`,31),X(r=>{var i=t(),a=`Fish #${k()?.id??``}`,o=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`text`,a,r.t)),o!==r.a&&(r.a=$(e,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),e})(),r&&Z(zn,{parent:r,target:()=>({x:0,y:0}),stiffness:30,damping:3}),(()=>{var e=Q(`text`);return $(e,`y`,210),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#668899`),$(e,`origin`,.5),$(e,`depth`,31),X(r=>{var i=t(),a=`State: ${k()?.fsmState??``}`,o=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`text`,a,r.t)),o!==r.a&&(r.a=$(e,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=Q(`text`);return $(e,`y`,230),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#668899`),$(e,`origin`,.5),$(e,`depth`,31),X(r=>{var i=t(),a=`Hunger: ${Math.floor(k()?.hunger??0)}`,o=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`text`,a,r.t)),o!==r.a&&(r.a=$(e,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`y`,270),$(e,`width`,80),$(e,`height`,24),$(e,`fillColor`,8930372),$(e,`origin`,.5),$(e,`depth`,31),$(e,`onClick`,m),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`text`);return $(e,`y`,270),$(e,`text`,`Release`),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#ffaaaa`),$(e,`origin`,.5),$(e,`depth`,32),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`y`,300),$(e,`width`,80),$(e,`height`,24),$(e,`fillColor`,4473958),$(e,`origin`,.5),$(e,`depth`,31),$(e,`onClick`,()=>{a(-1),s(!1)}),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`text`);return $(e,`y`,300),$(e,`text`,`Close`),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#aaaacc`),$(e,`origin`,.5),$(e,`depth`,32),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})()]})())]}})}})}})]}})}j(()=>{let e=Or();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file +`}}return t}}),92598:(e=>{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),ln=G(),un=G(),dn=G();G();function fn(){let e=ee(un);if(!e)throw Error(`Solidion: useScene() must be used within a component.`);return e}function pn(){let e=ee(dn);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function mn(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function hn(e,t,n){Qe(),I(()=>{e.update(t,n)}),$e()}function gn(e,t){return new Promise(n=>{let r=mn(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){hn(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:cn.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new cn.default.Game(o)})}function _n(e){let[t,n]=M(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&gn(r,e).then(t=>{n(t),je(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=Mt(()=>be(ln.Provider,{value:t.game,get children(){return be(un.Provider,{value:t.scene,get children(){return be(dn.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),z(()=>{let e=L(t);i&&i(),e&&(Me(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}function vn(e){let t=null,n,r=mn(),i=e.name??`__solidion_scene_${Math.random().toString(36).slice(2)}`,a={key:i,active:e.active??!0,...e.physics?{physics:e.physics}:{},create(){t=this,je(this);let i=this.add.container(0,0);Ie(i),n=Mt(()=>be(un.Provider,{value:this,get children(){return be(dn.Provider,{value:r,get children(){return e.children}})}}),i)},update(e,t){hn(r,e,t)}},o=Ne();return o&&o.scene.add(i,a,e.active??!0),z(()=>{if(n&&n(),t){Me();try{t.scene.remove(i)}catch{}}}),null}var yn=10;function bn(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)bn(r,t,n);return}if(typeof e==`function`){if(n>=yn)return;bn(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Le(e))){let r=Ie(e);for(let e of r.children)bn(e,t,n)}}}function xn(e){let[t,n]=M(!1);R(()=>{let t=Ne();if(!t){console.warn(`Solidion: used outside of a Scene. Assets not loaded.`),n(!0);return}vt(t,e.assets).then(()=>{n(!0)}).catch(e=>{console.error(`Solidion: Preload failed:`,e),n(!0)})});let r=e.fallback;P(()=>{r&&bn(r,!t())});let i=[];return r&&i.push(r),i.push(e.children),i}function Sn(e){return z(pn().register(e.onUpdate)),null}function Cn(e){let t=e.children;return N(()=>{bn(t,!!e.when)}),t}function wn(e){z(pn().register(e))}function Tn(e,t,n){let r=t.mass??1,i=t.targetX-e.x,a=t.targetY-e.y,o=(i*t.stiffness-e.vx*t.damping)/r,s=(a*t.stiffness-e.vy*t.damping)/r,c=e.vx+o*n,l=e.vy+s*n;return{x:e.x+c*n,y:e.y+l*n,vx:c,vy:l}}function En(e,t){let n=e*t.frequency*Math.PI*2+(t.phase??0);return{x:(t.amplitudeX??0)*Math.sin(n),y:(t.amplitudeY??0)*Math.sin(n)}}function Dn(e,t,n){let r=e.vx+(t.ax??0)*n,i=e.vy+(t.ay??0)*n;if(t.drag){let e=1-t.drag*n;r*=e,i*=e}let a=e.x+r*n,o=e.y+i*n,s=t.bounce??0;if(t.boundsX){let[e,n]=t.boundsX;an&&(a=n,r=-Math.abs(r)*s)}if(t.boundsY){let[e,n]=t.boundsY;on&&(o=n,i=-Math.abs(i)*s)}return{x:a,y:o,vx:r,vy:i}}function On(e,t,n,r){let i=1-Math.max(0,1-n.speed)**(r*60);return{x:e+(n.targetX-e)*i,y:t+(n.targetY-t)*i}}function kn(e,t,n){let r=t[e.current];if(!r)return{state:e.current,timer:e.timer,transitioned:!1,previous:e.current};let i=e.timer+n;return r.duration&&r.onComplete&&i>=r.duration?{state:r.onComplete,timer:0,transitioned:!0,previous:e.current}:{state:e.current,timer:i,transitioned:!1,previous:e.current}}function An(e,t,n){let r=t[e];if(!r?.on)return{state:e,transitioned:!1};let i=r.on[n];return i?{state:i,transitioned:!0}:{state:e,transitioned:!1}}function jn(e,t,n){if(!e.active)return{...e,completed:!1};let r=n/t.duration*e.direction,i=e.progress+r,a=e.direction,o=!1;return i>=1?t.yoyo?(i=1-(i-1),a=-1):(i=1,o=!0):i<=0&&e.direction===-1&&(i=0,o=!0,a=1),{progress:i,active:!o,direction:a,completed:o}}function Mn(e){let t=e.timerMode??`frame`,[n,r]=M(e.initial),i=0,a=0,o=null,s=null,c=e.scene??null;if(t===`scene`&&!c)throw Error('useStateMachine: timerMode "scene" requires a `scene` property in the config. Pass useScene() or a direct Phaser.Scene reference.');let l=()=>e.states[n()],u=F(()=>{let e=l().animation;return e?typeof e==`function`?e():e:``});function d(e){!e.duration||!e.onComplete||(t===`frame`?(i=0,a=e.duration,o=e.onComplete):s=c.time.delayedCall(e.duration,()=>{p(e.onComplete)}))}function f(){t===`frame`?(i=0,a=0,o=null):s&&=(s.remove(),null)}function p(t){let i=n();if(i===t)return;e.states[i].onExit?.(),f(),r(()=>t);let a=e.states[t];a.onEnter?.(),d(a)}return R(()=>{let t=e.states[e.initial];t.onEnter?.(),d(t)}),z(()=>{f()}),{state:n,animation:u,send:t=>{let r=An(n(),e.states,t);r.transitioned&&p(r.state)},is:e=>n()===e,tick:r=>{if(t!==`frame`||!o||a<=0)return;let s=kn({current:n(),timer:i},e.states,r);i=s.timer,s.transitioned&&p(s.state)}}}function Nn(e){let t=e.stiffness??200,n=e.damping??20,r=e.mass??1,i=e.target(),a={x:e.initial?.x??i.x,y:e.initial?.y??i.y,vx:0,vy:0},[o,s]=M({x:a.x,y:a.y});return wn((i,o)=>{let c=Math.min(o/1e3,.05),l=e.target();a=Tn(a,{targetX:l.x,targetY:l.y,stiffness:t,damping:n,mass:r},c),s({x:a.x,y:a.y})}),o}function Pn(e){let t=e.frequency??1,n=e.phase??0,r=e.amplitude.x??0,i=e.amplitude.y??0,[a,o]=M({x:0,y:0});return wn(e=>{o(En(e/1e3,{amplitudeX:r,amplitudeY:i,frequency:t,phase:n}))}),a}var Fn=0;function In(){return`__behavior_${++Fn}`}function Ln(e,t,n){ze(e,t,n);for(let t of Object.keys(n))ct(e,t)}function Rn(e,t,n){Be(e,t);for(let t of n)ct(e,t)}function zn(e){let t=In(),n=e.stiffness??200,r=e.damping??20,i=e.mass??1,a=e.target(),o={x:a.x,y:a.y,vx:0,vy:0};return wn((a,s)=>{let c=Math.min(s/1e3,.05),l=e.target();o=Tn(o,{targetX:l.x,targetY:l.y,stiffness:n,damping:r,mass:i},c),Ln(e.parent,t,{x:o.x,y:o.y})}),z(()=>Rn(e.parent,t,[`x`,`y`])),null}function Bn(e){return z(pn().register((t,n)=>{e.when&&!e.when()||e.update(t,n)})),null}function Vn(e,t){I(()=>{for(let n=0;n({active:!1,id:0,x:0,y:0,vx:0,vy:0,targetX:0,targetY:0,fsmState:`idle`,fsmTimer:0,stateDuration:3e3,hunger:0,color:nr[0],texture:Un[0],size:1,dir:1,sleeping:!1,popProgress:0,popActive:!1,feedStep:0,feedTimer:0,eating:!1}))),[ar,or]=rn(Array.from({length:Zn},()=>({active:!1,x:0,y:0,vx:0,vy:0}))),[sr,cr]=rn(Array.from({length:Qn},(e,t)=>({active:!1,x:0,y:0,vx:0,vy:0,dia:4,wobblePhase:t*2.1,wobbleFreq:1.5+Math.random()*.5}))),[lr,ur]=rn(Array.from({length:$n},()=>({active:!1,parentSlot:-1,x:Wn/2,y:Gn/2,color:nr[0],offsetX:0,offsetY:0,speed:.1}))),dr=1,fr={idle:{on:{FOOD_NEARBY:`eat`}},swim:{on:{FOOD_NEARBY:`eat`,SLEEPY:`sleep`}},eat:{},sleep:{on:{WAKE:`idle`}}},pr={idle:`swim`,swim:`idle`,eat:`idle`,sleep:`idle`},mr=[800,400,600];function hr(e,t,n){ir(e,sn(e=>{switch(n===`sleep`&&(e.sleeping=!1),e.fsmState=t,e.fsmTimer=0,t){case`idle`:e.targetX=e.x,e.targetY=e.y,e.stateDuration=2e3+Math.random()*2e3;break;case`swim`:{let t=Jn+40+Math.random()*(Yn-Jn-80),n=Kn+60+Math.random()*(qn-Kn-120);e.targetX=t,e.targetY=n,e.dir=t>e.x?1:-1,e.stateDuration=3e3+Math.random()*3e3;break}case`eat`:e.feedStep=0,e.feedTimer=0,e.eating=!0,e.stateDuration=2500;break;case`sleep`:e.sleeping=!0,e.targetX=e.x,e.targetY=qn-50,e.stateDuration=5e3+Math.random()*3e3;break}}))}function gr(e,t){let n=rr[e],r=An(n.fsmState,fr,t);r.transitioned&&hr(e,r.state,n.fsmState)}function _r(e){let t=1.70158,n=e-1;return 1+(t+1)*n*n*n+t*n*n}var vr=[],yr=[],br=null;function xr(e){let[t,n]=M(!1),r=Pn({amplitude:{y:30,x:6},frequency:.08,phase:e.baseX*.01}),i=Pn({amplitude:{x:4,y:3},frequency:.24,phase:e.baseX*.03}),a=Mn({initial:`drift`,states:{drift:{on:{STARTLE:`startled`}},startled:{duration:800,onComplete:`drift`,onEnter:()=>n(!0),onExit:()=>n(!1)}}}),o=Pn({amplitude:{x:2},frequency:.6,phase:0}),s=Pn({amplitude:{x:3},frequency:.5,phase:1.2}),c=Pn({amplitude:{x:2},frequency:.7,phase:2.4}),l=()=>a.send(`STARTLE`);vr.push(e=>a.tick(e)),yr.push(t);let u=()=>e.baseX+(t()?0:r().x),d=()=>e.baseY+(t()?-10:r().y),f=()=>t()?24:30+i().x,p=()=>t()?18:24+i().y;return[(()=>{var e=Q(`ellipse`);return $(e,`fillColor`,13404415),$(e,`origin`,.5),$(e,`depth`,8),$(e,`onClick`,l),X(n=>{var r=u(),i=d(),a=f(),o=p(),s=t()?.4:.6;return r!==n.e&&(n.e=$(e,`x`,r,n.e)),i!==n.t&&(n.t=$(e,`y`,i,n.t)),a!==n.a&&(n.a=$(e,`width`,a,n.a)),o!==n.o&&(n.o=$(e,`height`,o,n.o)),s!==n.i&&(n.i=$(e,`alpha`,s,n.i)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`width`,2),$(e,`height`,16),$(e,`fillColor`,12285934),$(e,`origin`,.5),$(e,`depth`,7),$(e,`alpha`,.4),X(t=>{var n=u()-6+o().x,r=d()+p()/2+2;return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`width`,2),$(e,`height`,20),$(e,`fillColor`,12285934),$(e,`origin`,.5),$(e,`depth`,7),$(e,`alpha`,.4),X(t=>{var n=u()+s().x,r=d()+p()/2+3;return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`width`,2),$(e,`height`,16),$(e,`fillColor`,12285934),$(e,`origin`,.5),$(e,`depth`,7),$(e,`alpha`,.4),X(t=>{var n=u()+6+c().x,r=d()+p()/2+2;return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})()]}function Sr(e){let t=Pn({amplitude:{x:8},frequency:.3+e.index*.08,phase:e.index*1.2}),n=e.height,r=()=>e.x+t().x;return[(()=>{var e=Q(`rectangle`);return $(e,`y`,qn-n/2),$(e,`width`,6),$(e,`height`,n),$(e,`fillColor`,2984774),$(e,`origin`,.5),$(e,`depth`,2),$(e,`alpha`,.7),X(t=>$(e,`x`,r(),t)),e})(),(()=>{var e=Q(`rectangle`);return $(e,`y`,qn-n*.3),$(e,`width`,5),$(e,`height`,n*.6),$(e,`fillColor`,3845468),$(e,`origin`,.5),$(e,`depth`,2),$(e,`alpha`,.5),X(t=>$(e,`x`,r()+8,t)),e})()]}function Cr(){let e=fn();return br=()=>e.cameras.main.shake(120,.005),null}function wr(e){return Nt(()=>rr.map((t,n)=>{let r=()=>t.fsmState!==`idle`&&t.fsmState!==`sleep`?0:En(performance.now()/1e3,{amplitudeY:3,frequency:.5,phase:n*1.7}).y,i=()=>t.size*_r(t.popProgress),a=()=>cn.default.Math.Clamp(t.y+r(),Kn+30,qn-20),o=()=>t.eating&&t.feedStep===1;return Z(Cn,{get when(){return t.active},get children(){return[(()=>{var r=Q(`rectangle`);return $(r,`fillColor`,0),$(r,`origin`,.5),$(r,`depth`,13),$(r,`alpha`,.001),$(r,`onClick`,()=>e.onSelect(n)),X(e=>{var n=t.x,i=a(),o=40*t.size,s=28*t.size;return n!==e.e&&(e.e=$(r,`x`,n,e.e)),i!==e.t&&(e.t=$(r,`y`,i,e.t)),o!==e.a&&(e.a=$(r,`width`,o,e.a)),s!==e.o&&(e.o=$(r,`height`,s,e.o)),e},{e:void 0,t:void 0,a:void 0,o:void 0}),r})(),(()=>{var e=Q(`sprite`);return $(e,`origin`,.5),$(e,`depth`,10),X(n=>{var r=t.x,o=a(),s=t.texture,c=t.dir*i()*2,l=i()*2,u=t.sleeping?.5:1;return r!==n.e&&(n.e=$(e,`x`,r,n.e)),o!==n.t&&(n.t=$(e,`y`,o,n.t)),s!==n.a&&(n.a=$(e,`texture`,s,n.a)),c!==n.o&&(n.o=$(e,`scaleX`,c,n.o)),l!==n.i&&(n.i=$(e,`scaleY`,l,n.i)),u!==n.n&&(n.n=$(e,`alpha`,u,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e})(),(()=>{var e=Q(`ellipse`);return $(e,`fillColor`,16777215),$(e,`origin`,.5),$(e,`depth`,11),X(n=>{var r=t.x+t.dir*8*i(),s=a()-2*i(),c=5*i(),l=t.sleeping||o()?1*i():5*i();return r!==n.e&&(n.e=$(e,`x`,r,n.e)),s!==n.t&&(n.t=$(e,`y`,s,n.t)),c!==n.a&&(n.a=$(e,`width`,c,n.a)),l!==n.o&&(n.o=$(e,`height`,l,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=Q(`ellipse`);return $(e,`fillColor`,1118481),$(e,`origin`,.5),$(e,`depth`,12),X(n=>{var r=t.x+t.dir*9*i(),s=a()-2*i(),c=2.5*i(),l=t.sleeping||o()?.5*i():2.5*i();return r!==n.e&&(n.e=$(e,`x`,r,n.e)),s!==n.t&&(n.t=$(e,`y`,s,n.t)),c!==n.a&&(n.a=$(e,`width`,c,n.a)),l!==n.o&&(n.o=$(e,`height`,l,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),e})()]}})}))}function Tr(){return Nt(()=>ar.map(e=>(()=>{var t=Q(`ellipse`);return $(t,`width`,6),$(t,`height`,6),$(t,`fillColor`,14527044),$(t,`origin`,.5),$(t,`depth`,3),X(n=>{var r=e.x,i=e.y,a=e.active;return r!==n.e&&(n.e=$(t,`x`,r,n.e)),i!==n.t&&(n.t=$(t,`y`,i,n.t)),a!==n.a&&(n.a=$(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()))}function Er(){return Nt(()=>sr.map(e=>{let t=()=>En(performance.now()/1e3,{amplitudeX:3,frequency:e.wobbleFreq,phase:e.wobblePhase}).x;return(()=>{var n=Q(`ellipse`);return $(n,`fillColor`,8965358),$(n,`origin`,.5),$(n,`depth`,4),$(n,`alpha`,.6),X(r=>{var i=e.x+t(),a=e.y,o=e.dia,s=e.dia,c=e.active;return i!==r.e&&(r.e=$(n,`x`,i,r.e)),a!==r.t&&(r.t=$(n,`y`,a,r.t)),o!==r.a&&(r.a=$(n,`width`,o,r.a)),s!==r.o&&(r.o=$(n,`height`,s,r.o)),c!==r.i&&(r.i=$(n,`visible`,c,r.i)),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}))}function Dr(){return Nt(()=>lr.map(e=>Z(Cn,{get when(){return e.active},get children(){return[(()=>{var t=Q(`ellipse`);return $(t,`width`,12),$(t,`height`,7),$(t,`origin`,.5),$(t,`depth`,10),$(t,`alpha`,.7),X(n=>{var r=e.x,i=e.y,a=e.color;return r!==n.e&&(n.e=$(t,`x`,r,n.e)),i!==n.t&&(n.t=$(t,`y`,i,n.t)),a!==n.a&&(n.a=$(t,`fillColor`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Q(`ellipse`);return $(t,`width`,2),$(t,`height`,2),$(t,`fillColor`,16777215),$(t,`origin`,.5),$(t,`depth`,11),X(n=>{var r=e.x+3,i=e.y-1;return r!==n.e&&(n.e=$(t,`x`,r,n.e)),i!==n.t&&(n.t=$(t,`y`,i,n.t)),n},{e:void 0,t:void 0}),t})()]}})))}function Or(){let[e,t]=M(`title`),[n,r]=M(0),[i,a]=M(-1),[o,s]=M(!1),[c,l]=M(``),u=!1,d=0,f=()=>e()===`aquarium`;function p(){let e=rr.findIndex(e=>!e.active);if(e<0)return;let t=Math.floor(Math.random()*Un.length),n=Jn+60+Math.random()*(Yn-Jn-120),i=Kn+80+Math.random()*(qn-Kn-160);if(ir(e,{active:!0,id:dr++,x:n,y:i,vx:0,vy:0,targetX:n,targetY:i,fsmState:`idle`,fsmTimer:0,stateDuration:2e3+Math.random()*2e3,hunger:0,color:nr[t],texture:Un[t],size:.8+Math.random()*.4,dir:1,sleeping:!1,popProgress:0,popActive:!0,feedStep:0,feedTimer:0,eating:!1}),r(e=>e+1),br?.(),Math.random()<.2){let r=lr.findIndex(e=>!e.active);r>=0&&ur(r,{active:!0,parentSlot:e,x:n,y:i,color:nr[t],offsetX:(r%2==0?-1:1)*(12+r*4),offsetY:8+r*3,speed:.08+r*.02})}}let m=()=>{let e=i();if(!(e<0)){ir(e,`active`,!1);for(let t=0;t<$n;t++)lr[t].parentSlot===e&&ur(t,`active`,!1);a(-1),s(!1),r(e=>e-1)}},h=n=>{if(e()===`title`){t(`aquarium`),u||(u=!0,p(),p(),p());return}if(n.x>Wn-120&&n.y<35||i()>=0&&n.x>Wn-160&&n.y>Gn/2-100&&n.yqn||n.xYn)return;let r=ar.findIndex(e=>!e.active);r>=0&&or(r,{active:!0,x:n.x,y:n.y,vx:0,vy:18})},g=e=>{a(e),s(!0)},_=(e,t)=>{Vn(rr,(e,n)=>{let r=e.fsmTimer+t;r>=e.stateDuration?hr(n,pr[e.fsmState]??`idle`,e.fsmState):ir(n,`fsmTimer`,r)})},v=(e,t)=>{Vn(rr,(e,n)=>{let r=e.hunger+t*.003;ir(n,`hunger`,r),r>100&&e.fsmState===`swim`&&Math.random()<.001&&gr(n,`SLEEPY`)})},y=()=>{I(()=>{for(let e=0;e30){let t=ar[n];ir(e,sn(e=>{e.targetX=t.x,e.targetY=t.y,e.dir=t.x>e.x?1:-1})),gr(e,`FOOD_NEARBY`)}}}})},b=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(rr,(e,t)=>{let r=Tn({x:e.x,y:e.y,vx:e.vx,vy:e.vy},{targetX:e.targetX,targetY:e.targetY,stiffness:15,damping:8},n);ir(t,{x:cn.default.Math.Clamp(r.x,Jn+20,Yn-20),y:cn.default.Math.Clamp(r.y,Kn+30,qn-20),vx:r.vx,vy:r.vy})})},x=(e,t)=>{Vn(rr,(e,n)=>{if(!e.eating)return;let r=e.feedTimer+t;if(r>=mr[e.feedStep]){let t=e.feedStep+1;t>=3?ir(n,{eating:!1,feedStep:0,feedTimer:0}):ir(n,{feedStep:t,feedTimer:0})}else ir(n,`feedTimer`,r)})},S=(e,t)=>{Vn(rr,(e,n)=>{if(!e.popActive)return;let r=jn({progress:e.popProgress,active:!0,direction:1},{duration:400},t);ir(n,{popProgress:r.progress,popActive:r.active})})},C=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(ar,(e,t)=>{let r=Dn({x:e.x,y:e.y,vx:e.vx,vy:e.vy},{boundsY:[Kn,qn]},n);r.y>=qn-1?or(t,`active`,!1):or(t,{x:r.x,y:r.y,vx:r.vx,vy:r.vy})})},w=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(sr,(e,t)=>{let r=Dn({x:e.x,y:e.y,vx:e.vx,vy:e.vy},{boundsY:[Kn,qn]},n);r.y<=Kn+1?cr(t,`active`,!1):cr(t,{x:r.x,y:r.y,vx:r.vx,vy:r.vy})})},T=0,E=(e,t)=>{if(T-=t,T<=0){T=200+Math.random()*500;let e=sr.findIndex(e=>!e.active);e>=0&&cr(e,{active:!0,x:Jn+20+Math.random()*(Yn-Jn-40),y:qn-10,vx:0,vy:-(30+Math.random()*60),dia:3+Math.random()*4})}},D=(e,t)=>{let n=Math.min(t/1e3,.05);Vn(lr,(e,t)=>{let r=e.parentSlot,i=r>=0&&rr[r].active?rr[r]:{x:Wn/2,y:Gn/2},a=On(e.x,e.y,{targetX:i.x+e.offsetX,targetY:i.y+e.offsetY,speed:e.speed},n);ur(t,{x:a.x,y:a.y})})},O=(t,r)=>{if(!f()){rt({phase:e(),fishCount:n(),foodCount:0});return}for(let e of vr)e(r);if(d-=r,d<=0){d=500;let t=et();l(`props/f: ${t.setPropertyCalls} ${t.frameTimeMs.toFixed(1)}ms`),rt({phase:e(),fishCount:n(),foodCount:ar.filter(e=>e.active).length,bubbleCount:sr.filter(e=>e.active).length,fryCount:lr.filter(e=>e.active).length,selIdx:i(),showPanel:o(),fishPositions:rr.filter(e=>e.active).map(e=>({x:e.x,y:e.y})),fishStates:rr.filter(e=>e.active).map(e=>e.fsmState),fishHungers:rr.filter(e=>e.active).map(e=>e.hunger),fishEating:rr.filter(e=>e.active).map(e=>e.eating),jellyStartled:yr.map(e=>e())})}},k=()=>i()>=0?rr[i()]:null;return Z(_n,{width:Wn,height:Gn,backgroundColor:662062,parent:`game-container`,onPointerDown:h,get children(){return[Z(Sn,{onUpdate:O}),Z(Cn,{get when(){return e()===`title`},get children(){return[(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,240),$(e,`width`,640),$(e,`height`,480),$(e,`fillColor`,662062),$(e,`origin`,.5),$(e,`depth`,100),e})(),(()=>{var e=Q(`text`);return $(e,`x`,320),$(e,`y`,200),$(e,`text`,`Solidion Aquarium`),$(e,`fontSize`,36),$(e,`fontFamily`,`Georgia, serif`),$(e,`color`,`#4488cc`),$(e,`origin`,.5),$(e,`depth`,101),e})(),(()=>{var e=Q(`text`);return $(e,`x`,320),$(e,`y`,260),$(e,`text`,`tap to start`),$(e,`fontSize`,16),$(e,`fontFamily`,`monospace`),$(e,`color`,`#336688`),$(e,`origin`,.5),$(e,`depth`,101),e})(),(()=>{var e=Q(`ellipse`);return $(e,`x`,320),$(e,`y`,320),$(e,`width`,32),$(e,`height`,18),$(e,`fillColor`,5164484),$(e,`origin`,.5),$(e,`depth`,101),$(e,`alpha`,.6),e})(),(()=>{var e=Q(`rectangle`);return $(e,`x`,302),$(e,`y`,320),$(e,`width`,10),$(e,`height`,12),$(e,`fillColor`,5164484),$(e,`origin`,.5),$(e,`depth`,101),$(e,`alpha`,.5),e})()]}}),Z(Cn,{get when(){return f()},get children(){return Z(vn,{name:`aquarium`,get children(){return Z(xn,{assets:Hn,get fallback(){return[(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,240),$(e,`width`,640),$(e,`height`,480),$(e,`fillColor`,662062),$(e,`origin`,.5),$(e,`depth`,50),e})(),(()=>{var e=Q(`text`);return $(e,`x`,320),$(e,`y`,230),$(e,`text`,`Loading aquarium...`),$(e,`fontSize`,16),$(e,`fontFamily`,`monospace`),$(e,`color`,`#336688`),$(e,`origin`,.5),$(e,`depth`,51),e})(),(()=>{var e=Q(`ellipse`);return $(e,`x`,320),$(e,`y`,270),$(e,`width`,20),$(e,`height`,12),$(e,`fillColor`,5164484),$(e,`origin`,.5),$(e,`depth`,51),$(e,`alpha`,.5),e})()]},get children(){return[Z(Cr,{}),Z(Bn,{update:_}),Z(Bn,{update:v}),Z(Bn,{update:y}),Z(Bn,{update:b}),Z(Bn,{update:x}),Z(Bn,{update:S}),Z(Bn,{update:C}),Z(Bn,{update:w}),Z(Bn,{update:E}),Z(Bn,{update:D}),(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,240),$(e,`width`,600),$(e,`height`,420),$(e,`fillColor`,925760),$(e,`origin`,.5),$(e,`depth`,0),$(e,`alpha`,.5),e})(),(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,465),$(e,`width`,600),$(e,`height`,30),$(e,`fillColor`,9139029),$(e,`origin`,.5),$(e,`depth`,1),e})(),(()=>{var e=Q(`rectangle`);return $(e,`x`,320),$(e,`y`,30),$(e,`width`,600),$(e,`height`,2),$(e,`fillColor`,4491434),$(e,`origin`,.5),$(e,`depth`,5),$(e,`alpha`,.5),e})(),Nt(()=>[{x:80,h:40},{x:200,h:55},{x:350,h:70},{x:500,h:85},{x:580,h:60}].map((e,t)=>Z(Sr,{get x(){return e.x},get height(){return e.h},index:t}))),Z(xr,{baseX:520,baseY:150}),Z(xr,{baseX:120,baseY:200}),Z(Er,{}),Z(Tr,{}),Z(wr,{onSelect:g}),Z(Dr,{}),Z(Cn,{get when(){return f()},get children(){return[(()=>{var e=Q(`rectangle`);return $(e,`x`,580),$(e,`y`,16),$(e,`width`,100),$(e,`height`,24),$(e,`fillColor`,2250120),$(e,`origin`,.5),$(e,`depth`,20),$(e,`onClick`,()=>p()),e})(),(()=>{var e=Q(`text`);return $(e,`x`,580),$(e,`y`,16),$(e,`text`,`+ Add Fish`),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#aaccee`),$(e,`origin`,.5),$(e,`depth`,21),e})(),(()=>{var e=Q(`text`);return $(e,`x`,20),$(e,`y`,16),$(e,`fontSize`,12),$(e,`fontFamily`,`monospace`),$(e,`color`,`#668899`),$(e,`originX`,0),$(e,`originY`,.5),$(e,`depth`,20),X(t=>$(e,`text`,`Fish: ${n()}`,t)),e})(),(()=>{var e=Q(`text`);return $(e,`x`,20),$(e,`y`,470),$(e,`fontSize`,9),$(e,`fontFamily`,`monospace`),$(e,`color`,`#334455`),$(e,`originX`,0),$(e,`originY`,.5),$(e,`depth`,20),X(t=>$(e,`text`,c(),t)),e})()]}}),Nt(()=>(()=>{let e=Nn({target:()=>({x:o()&&i()>=0?Wn-80:Wn+100,y:Gn/2}),stiffness:80,damping:14,initial:{x:Wn+100,y:Gn/2}}),t=()=>e().x,n=()=>t(){var e=Q(`rectangle`);return $(e,`y`,240),$(e,`width`,140),$(e,`height`,180),$(e,`fillColor`,1122867),$(e,`origin`,.5),$(e,`depth`,30),$(e,`alpha`,.9),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`text`);return zt(e=>{r=e},e),$(e,`y`,180),$(e,`fontSize`,14),$(e,`fontFamily`,`monospace`),$(e,`color`,`#88bbdd`),$(e,`origin`,.5),$(e,`depth`,31),X(r=>{var i=t(),a=`Fish #${k()?.id??``}`,o=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`text`,a,r.t)),o!==r.a&&(r.a=$(e,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),e})(),r&&Z(zn,{parent:r,target:()=>({x:0,y:0}),stiffness:30,damping:3}),(()=>{var e=Q(`text`);return $(e,`y`,210),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#668899`),$(e,`origin`,.5),$(e,`depth`,31),X(r=>{var i=t(),a=`State: ${k()?.fsmState??``}`,o=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`text`,a,r.t)),o!==r.a&&(r.a=$(e,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=Q(`text`);return $(e,`y`,230),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#668899`),$(e,`origin`,.5),$(e,`depth`,31),X(r=>{var i=t(),a=`Hunger: ${Math.floor(k()?.hunger??0)}`,o=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`text`,a,r.t)),o!==r.a&&(r.a=$(e,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`y`,270),$(e,`width`,80),$(e,`height`,24),$(e,`fillColor`,8930372),$(e,`origin`,.5),$(e,`depth`,31),$(e,`onClick`,m),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`text`);return $(e,`y`,270),$(e,`text`,`Release`),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#ffaaaa`),$(e,`origin`,.5),$(e,`depth`,32),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`rectangle`);return $(e,`y`,300),$(e,`width`,80),$(e,`height`,24),$(e,`fillColor`,4473958),$(e,`origin`,.5),$(e,`depth`,31),$(e,`onClick`,()=>{a(-1),s(!1)}),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})(),(()=>{var e=Q(`text`);return $(e,`y`,300),$(e,`text`,`Close`),$(e,`fontSize`,11),$(e,`fontFamily`,`monospace`),$(e,`color`,`#aaaacc`),$(e,`origin`,.5),$(e,`depth`,32),X(r=>{var i=t(),a=n();return i!==r.e&&(r.e=$(e,`x`,i,r.e)),a!==r.t&&(r.t=$(e,`visible`,a,r.t)),r},{e:void 0,t:void 0}),e})()]})())]}})}})}})]}})}j(()=>{let e=Or();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file diff --git a/examples/aquarium/dist/index.html b/examples/aquarium/dist/index.html index 98bfb5a..33fadbe 100644 --- a/examples/aquarium/dist/index.html +++ b/examples/aquarium/dist/index.html @@ -35,7 +35,7 @@ } .footer a { color: #4488cc; text-decoration: none; } - +
diff --git a/examples/aquarium/vite.config.ts b/examples/aquarium/vite.config.ts index d4d0dac..94bdf5c 100644 --- a/examples/aquarium/vite.config.ts +++ b/examples/aquarium/vite.config.ts @@ -18,6 +18,7 @@ export default defineConfig({ "solidion/ecs": resolve(__dirname, "../../src/ecs/index.ts"), "solidion/core": resolve(__dirname, "../../src/core/index.ts"), "solidion/debug": resolve(__dirname, "../../src/debug/index.ts"), + "solidion/renderer": resolve(__dirname, "../../src/renderer.ts"), "solidion": resolve(__dirname, "../../src/index.ts"), "solid-js/store": resolve(rootModules, "solid-js/store/dist/store.js"), "solid-js/universal": resolve(rootModules, "solid-js/universal/dist/universal.js"), diff --git a/examples/breakout/dist/assets/index-C5iHtZ1c.js b/examples/breakout/dist/assets/index-ClY0sCA3.js similarity index 99% rename from examples/breakout/dist/assets/index-C5iHtZ1c.js rename to examples/breakout/dist/assets/index-ClY0sCA3.js index 155f106..880c47b 100644 --- a/examples/breakout/dist/assets/index-C5iHtZ1c.js +++ b/examples/breakout/dist/assets/index-ClY0sCA3.js @@ -65,4 +65,4 @@ return new `+this.key+`(); `),s=/^[ ]*(- )*(\w+)+[: ]+(.*)/,c=``,l=``,u={x:0,y:0,width:0,height:0},d=0;d{var r=n(50030),i=function(e){for(var t=e.mipmaps,n=1;n{e.exports={AtlasXML:n(89905),Canvas:n(72893),Image:n(4832),JSONArray:n(78566),JSONHash:n(39711),KTXParser:n(31403),PVRParser:n(82038),SpriteSheet:n(75549),SpriteSheetFromAtlas:n(47534),UnityYAML:n(86147)}}),80341:(e=>{e.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}}),16536:((e,t,n)=>{e.exports=new(n(83419))({initialize:function(e,t,n,r,i,a,o){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),i===void 0&&(i=0),a===void 0&&(a=0),this.name=e,this.firstgid=t|0,this.imageWidth=n|0,this.imageHeight=r|0,this.imageMargin=i|0,this.imageSpacing=a|0,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(e){return e>=this.firstgid&&e{e.exports=new(n(83419))({initialize:function(e){if(this.gids=[],e!==void 0)for(var t=0;t{var r=n(80341),i=n(87010),a=n(46177),o=n(49075);e.exports=function(e,t,n,s,c,l,u,d){n===void 0&&(n=32),s===void 0&&(s=32),c===void 0&&(c=10),l===void 0&&(l=10),d===void 0&&(d=!1);var f=null;if(Array.isArray(u))f=a(t===void 0?`map`:t,r.ARRAY_2D,u,n,s,d);else if(t!==void 0){var p=e.cache.tilemap.get(t);p?f=a(t,p.format,p.data,n,s,d):console.warn(`No map data found for key `+t)}return f===null&&(f=new i({tileWidth:n,tileHeight:s,width:c,height:l})),new o(e,f)}}),23029:((e,t,n)=>{var r=n(83419),i=n(31401),a=n(91907),o=n(62644),s=n(93232);e.exports=new r({Mixins:[i.AlphaSingle,i.Flip,i.Visible],initialize:function(e,t,n,r,i,a,o,s){this.layer=e,this.index=t,this.x=n,this.y=r,this.width=i,this.height=a,this.right,this.bottom,this.baseWidth=o===void 0?i:o,this.baseHeight=s===void 0?a:s,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(e,t){return!(ethis.right||t>this.bottom)},copy:function(e){return this.index=e.index,this.alpha=e.alpha,this.properties=o(e.properties),this.visible=e.visible,this.setFlip(e.flipX,e.flipY),this.tint=e.tint,this.rotation=e.rotation,this.collideUp=e.collideUp,this.collideDown=e.collideDown,this.collideLeft=e.collideLeft,this.collideRight=e.collideRight,this.collisionCallback=e.collisionCallback,this.collisionCallbackContext=e.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(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).x:this.x*this.baseWidth},getRight:function(e){var t=this.tilemapLayer;return t?this.getLeft(e)+this.width*t.scaleX:this.getLeft(e)+this.width},getTop:function(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(e){var t=this.tilemapLayer;return t?this.getTop(e)+this.height*t.scaleY:this.getTop(e)+this.height},getBounds:function(e,t){return t===void 0&&(t=new s),t.x=this.getLeft(e),t.y=this.getTop(e),t.width=this.getRight(e)-t.x,t.height=this.getBottom(e)-t.y,t},getCenterX:function(e){return(this.getLeft(e)+this.getRight(e))/2},getCenterY:function(e){return(this.getTop(e)+this.getBottom(e))/2},intersects:function(e,t,n,r){return!(n<=this.pixelX||r<=this.pixelY||e>=this.right||t>=this.bottom)},isInteresting:function(e,t){return e&&t?this.canCollide||this.hasInterestingFace:e?this.collides:t?this.hasInterestingFace:!1},resetCollision:function(e){return e===void 0&&(e=!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,e&&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(e,t,n,r,i){return t===void 0&&(t=e),n===void 0&&(n=e),r===void 0&&(r=e),i===void 0&&(i=!0),this.collideLeft=e,this.collideRight=t,this.collideUp=n,this.collideDown=r,this.faceLeft=e,this.faceRight=t,this.faceTop=n,this.faceBottom=r,i&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(e,t){return e===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=e,this.collisionCallbackContext=t),this},setSize:function(e,t,n,r){return e!==void 0&&(this.width=e),t!==void 0&&(this.height=t),n!==void 0&&(this.baseWidth=n),r!==void 0&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var e=this.layer.orientation;if(e===a.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(e===a.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(e===a.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(e===a.HEXAGONAL){var t=this.layer.staggerAxis,n=this.layer.staggerIndex,r=this.layer.hexSideLength,i,o;t===`y`?(o=(this.baseHeight-r)/2+r,n===`odd`?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*o):t===`x`&&(i=(this.baseWidth-r)/2+r,this.pixelX=this.x*i,n===`odd`?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=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||this.collisionCallback!==void 0}},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 e=this.layer.tilemapLayer;if(e){var t=e.gidMap[this.index];if(t)return t}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var e=this.tilemapLayer;return e?e.tilemap:null}}})}),49075:((e,t,n)=>{var r=n(84101),i=n(83419),a=n(39506),o=n(80341),s=n(95540),c=n(14977),l=n(27462),u=n(91907),d=n(36305),f=n(19133),p=n(68287),m=n(23029),h=n(81086),g=n(20442),_=n(33629);e.exports=new i({initialize:function(e,t){this.scene=e,this.tileWidth=t.tileWidth,this.tileHeight=t.tileHeight,this.width=t.width,this.height=t.height,this.orientation=t.orientation,this.renderOrder=t.renderOrder,this.format=t.format,this.version=t.version,this.properties=t.properties,this.widthInPixels=t.widthInPixels,this.heightInPixels=t.heightInPixels,this.imageCollections=t.imageCollections,this.images=t.images,this.layers=t.layers,this.tiles=t.tiles,this.tilesets=t.tilesets,this.objects=t.objects,this.currentLayerIndex=0,this.hexSideLength=t.hexSideLength;var n=this.orientation;this._convert={WorldToTileXY:h.GetWorldToTileXYFunction(n),WorldToTileX:h.GetWorldToTileXFunction(n),WorldToTileY:h.GetWorldToTileYFunction(n),TileToWorldXY:h.GetTileToWorldXYFunction(n),TileToWorldX:h.GetTileToWorldXFunction(n),TileToWorldY:h.GetTileToWorldYFunction(n),GetTileCorners:h.GetTileCornersFunction(n)}},setRenderOrder:function(e){var t=[`right-down`,`left-down`,`right-up`,`left-up`];return typeof e==`number`&&(e=t[e]),t.indexOf(e)>-1&&(this.renderOrder=e),this},addTilesetImage:function(e,t,n,i,a,s,c,l){if(e===void 0)return null;t??=e;var u=this.scene.sys.textures;if(!u.exists(t))return console.warn(`Texture key "%s" not found`,t),null;var d=u.get(t),f=this.getTilesetIndex(e);if(f===null&&this.format===o.TILED_JSON)return console.warn(`Tilemap has no tileset "%s". Its tilesets are %o`,e,this.tilesets),null;var p=this.tilesets[f];return p?((n||i)&&p.setTileSize(n,i),(a||s)&&p.setSpacing(a,s),p.setImage(d),p):(n===void 0&&(n=this.tileWidth),i===void 0&&(i=this.tileHeight),a===void 0&&(a=0),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l={x:0,y:0}),p=new _(e,c,n,i,a,s,void 0,void 0,l),p.setImage(d),this.tilesets.push(p),this.tiles=r(this),p)},copy:function(e,t,n,r,i,a,o,s){return s=this.getLayer(s),s===null?null:(h.Copy(e,t,n,r,i,a,o,s),this)},createBlankLayer:function(e,t,n,r,i,a,o,s){if(n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=this.width),a===void 0&&(a=this.height),o===void 0&&(o=this.tileWidth),s===void 0&&(s=this.tileHeight),this.getLayerIndex(e)!==null)return console.warn(`Invalid Tilemap Layer ID: `+e),null;for(var l=new c({name:e,tileWidth:o,tileHeight:s,width:i,height:a,orientation:this.orientation,hexSideLength:this.hexSideLength}),u,d=0;d-1&&this.putTileAt(t,a.x,a.y,n,a.tilemapLayer)}return r},removeTileAt:function(e,t,n,r,i){return n===void 0&&(n=!0),r===void 0&&(r=!0),i=this.getLayer(i),i===null?null:h.RemoveTileAt(e,t,n,r,i)},removeTileAtWorldXY:function(e,t,n,r,i,a){return n===void 0&&(n=!0),r===void 0&&(r=!0),a=this.getLayer(a),a===null?null:h.RemoveTileAtWorldXY(e,t,n,r,i,a)},renderDebug:function(e,t,n){return n=this.getLayer(n),n===null?null:(this.orientation===u.ORTHOGONAL&&h.RenderDebug(e,t,n),this)},renderDebugFull:function(e,t){for(var n=this.layers,r=0;r{var r=n(44603),i=n(31989);r.register(`tilemap`,function(e){var t=e===void 0?{}:e;return i(this.scene,t.key,t.tileWidth,t.tileHeight,t.width,t.height,t.data,t.insertNull)})}),46029:((e,t,n)=>{var r=n(39429),i=n(31989);r.register(`tilemap`,function(e,t,n,r,a,o,s){return e===null&&(e=void 0),t===null&&(t=void 0),n===null&&(n=void 0),r===null&&(r=void 0),a===null&&(a=void 0),i(this.scene,e,t,n,r,a,o,s)})}),20442:((e,t,n)=>{var r=n(83419),i=n(78389),a=n(31401),o=n(95643),s=n(81086),c=n(19218),l=n(26099);e.exports=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,i,c],initialize:function(e,t,n,r,i,a){o.call(this,e,`TilemapLayer`),this.isTilemap=!0,this.tilemap=t,this.layerIndex=n,this.layer=t.layers[n],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=s.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(r),this.setAlpha(this.layer.alpha),this.setPosition(i,a),this.setOrigin(0,0),this.setSize(t.tileWidth*this.layer.width,t.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(e){var t=[],n=[],r=this.tilemap;Array.isArray(e)||(e=[e]);for(var i=0;i=0&&e<4&&(this._renderOrder=e),this},calculateFacesAt:function(e,t){return s.CalculateFacesAt(e,t,this.layer),this},calculateFacesWithin:function(e,t,n,r){return s.CalculateFacesWithin(e,t,n,r,this.layer),this},createFromTiles:function(e,t,n,r,i){return s.CreateFromTiles(e,t,n,r,i,this.layer)},cull:function(e){return this.cullCallback(this.layer,e,this.culledTiles,this._renderOrder)},copy:function(e,t,n,r,i,a,o){return s.Copy(e,t,n,r,i,a,o,this.layer),this},fill:function(e,t,n,r,i,a){return s.Fill(e,t,n,r,i,a,this.layer),this},filterTiles:function(e,t,n,r,i,a,o){return s.FilterTiles(e,t,n,r,i,a,o,this.layer)},findByIndex:function(e,t,n){return s.FindByIndex(e,t,n,this.layer)},findTile:function(e,t,n,r,i,a,o){return s.FindTile(e,t,n,r,i,a,o,this.layer)},forEachTile:function(e,t,n,r,i,a,o){return s.ForEachTile(e,t,n,r,i,a,o,this.layer),this},setTint:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!1},this,t,n,r,i,a)},setTintFill:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!0},this,t,n,r,i,a)},getTileAt:function(e,t,n){return s.GetTileAt(e,t,n,this.layer)},getTileAtWorldXY:function(e,t,n,r){return s.GetTileAtWorldXY(e,t,n,r,this.layer)},getIsoTileAtWorldXY:function(e,t,n,r,i){n===void 0&&(n=!0);var a=this.tempVec;return s.IsometricWorldToTileXY(e,t,!0,a,i,this.layer,n),this.getTileAt(a.x,a.y,r)},getTilesWithin:function(e,t,n,r,i){return s.GetTilesWithin(e,t,n,r,i,this.layer)},getTilesWithinShape:function(e,t,n){return s.GetTilesWithinShape(e,t,n,this.layer)},getTilesWithinWorldXY:function(e,t,n,r,i,a){return s.GetTilesWithinWorldXY(e,t,n,r,i,a,this.layer)},hasTileAt:function(e,t){return s.HasTileAt(e,t,this.layer)},hasTileAtWorldXY:function(e,t,n){return s.HasTileAtWorldXY(e,t,n,this.layer)},putTileAt:function(e,t,n,r){return s.PutTileAt(e,t,n,r,this.layer)},putTileAtWorldXY:function(e,t,n,r,i){return s.PutTileAtWorldXY(e,t,n,r,i,this.layer)},putTilesAt:function(e,t,n,r){return s.PutTilesAt(e,t,n,r,this.layer),this},randomize:function(e,t,n,r,i){return s.Randomize(e,t,n,r,i,this.layer),this},removeTileAt:function(e,t,n,r){return s.RemoveTileAt(e,t,n,r,this.layer)},removeTileAtWorldXY:function(e,t,n,r,i){return s.RemoveTileAtWorldXY(e,t,n,r,i,this.layer)},renderDebug:function(e,t){return s.RenderDebug(e,t,this.layer),this},replaceByIndex:function(e,t,n,r,i,a){return s.ReplaceByIndex(e,t,n,r,i,a,this.layer),this},setSkipCull:function(e){return e===void 0&&(e=!0),this.skipCull=e,this},setCullPadding:function(e,t){return e===void 0&&(e=1),t===void 0&&(t=1),this.cullPaddingX=e,this.cullPaddingY=t,this},setCollision:function(e,t,n,r){return s.SetCollision(e,t,n,this.layer,r),this},setCollisionBetween:function(e,t,n,r){return s.SetCollisionBetween(e,t,n,r,this.layer),this},setCollisionByProperty:function(e,t,n){return s.SetCollisionByProperty(e,t,n,this.layer),this},setCollisionByExclusion:function(e,t,n){return s.SetCollisionByExclusion(e,t,n,this.layer),this},setCollisionFromCollisionGroup:function(e,t){return s.SetCollisionFromCollisionGroup(e,t,this.layer),this},setTileIndexCallback:function(e,t,n){return s.SetTileIndexCallback(e,t,n,this.layer),this},setTileLocationCallback:function(e,t,n,r,i,a){return s.SetTileLocationCallback(e,t,n,r,i,a,this.layer),this},shuffle:function(e,t,n,r){return s.Shuffle(e,t,n,r,this.layer),this},swapByIndex:function(e,t,n,r,i,a){return s.SwapByIndex(e,t,n,r,i,a,this.layer),this},tileToWorldX:function(e,t){return this.tilemap.tileToWorldX(e,t,this)},tileToWorldY:function(e,t){return this.tilemap.tileToWorldY(e,t,this)},tileToWorldXY:function(e,t,n,r){return this.tilemap.tileToWorldXY(e,t,n,r,this)},getTileCorners:function(e,t,n){return this.tilemap.getTileCorners(e,t,n,this)},weightedRandomize:function(e,t,n,r,i){return s.WeightedRandomize(t,n,r,i,e,this.layer),this},worldToTileX:function(e,t,n){return this.tilemap.worldToTileX(e,t,n,this)},worldToTileY:function(e,t,n){return this.tilemap.worldToTileY(e,t,n,this)},worldToTileXY:function(e,t,n,r,i){return this.tilemap.worldToTileXY(e,t,n,r,i,this)},destroy:function(e){e===void 0&&(e=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),e&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}})}),16153:((e,t,n)=>{var r=n(61340),i=new r,a=new r,o=new r;e.exports=function(e,t,n,r){var s=t.cull(n),c=s.length,l=n.alpha*t.alpha;if(!(c===0||l<=0)){var u=i,d=a,f=o;d.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),u.copyFrom(n.matrix);var p=e.currentContext,m=t.gidMap;p.save(),r?(u.multiplyWithOffset(r,-n.scrollX*t.scrollFactorX,-n.scrollY*t.scrollFactorY),d.e=t.x,d.f=t.y,u.multiply(d,f),f.copyToContext(p)):(d.e-=n.scrollX*t.scrollFactorX,d.f-=n.scrollY*t.scrollFactorY,d.copyToContext(p)),(!e.antialias||t.scaleX>1||t.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var h=0;h{var r=n(29747),i=r,a=r;i=n(99558),a=n(16153),e.exports={renderWebGL:i,renderCanvas:a}}),99558:((e,t,n)=>{var r=n(70554);e.exports=function(e,t,n){var i=t.cull(n),a=i.length,o=n.alpha*t.alpha;if(!(a===0||o<=0)){var s=t.gidMap,c=e.pipelines.set(t.pipeline,t),l=r.getTintAppendFloatAlpha,u=t.scrollFactorX,d=t.scrollFactorY,f=t.x,p=t.y,m=t.scaleX,h=t.scaleY;e.pipelines.preBatch(t);for(var g=0;g{var r=n(83419),i=n(26099);e.exports=new r({initialize:function(e,t,n,r,a,o,s,c,l){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),a===void 0&&(a=0),o===void 0&&(o=0),s===void 0&&(s={}),c===void 0&&(c={}),this.name=e,this.firstgid=t,this.tileWidth=n,this.tileHeight=r,this.tileMargin=a,this.tileSpacing=o,this.tileProperties=s,this.tileData=c,this.tileOffset=new i,l!==void 0&&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(e){return this.containsTileIndex(e)?this.tileProperties[e-this.firstgid]:null},getTileData:function(e){return this.containsTileIndex(e)?this.tileData[e-this.firstgid]:null},getTileCollisionGroup:function(e){var t=this.getTileData(e);return t&&t.objectgroup?t.objectgroup:null},containsTileIndex:function(e){return e>=this.firstgid&&en.width||t.height>n.height?this.updateTileData(t.width,t.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(e,t){return e!==void 0&&(this.tileWidth=e),t!==void 0&&(this.tileHeight=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(e,t){return e!==void 0&&(this.tileMargin=e),t!==void 0&&(this.tileSpacing=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=(t-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),a=(e-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(i%1!=0||a%1!=0)&&console.warn(`Image tile area not tile size multiple in: `+this.name),i=Math.floor(i),a=Math.floor(a),this.rows=i,this.columns=a,this.total=i*a,this.texCoordinates.length=0;for(var o=this.tileMargin+n,s=this.tileMargin+r,c=0;c{var r=n(7423);e.exports=function(e,t,n){var i=r(e,t,!0,n),a=r(e,t-1,!0,n),o=r(e,t+1,!0,n),s=r(e-1,t,!0,n),c=r(e+1,t,!0,n),l=i&&i.collides;return l&&(i.faceTop=!0,i.faceBottom=!0,i.faceLeft=!0,i.faceRight=!0),a&&a.collides&&(l&&(i.faceTop=!1),a.faceBottom=!l),o&&o.collides&&(l&&(i.faceBottom=!1),o.faceTop=!l),s&&s.collides&&(l&&(i.faceLeft=!1),s.faceRight=!l),c&&c.collides&&(l&&(i.faceRight=!1),c.faceLeft=!l),i&&!i.collides&&i.resetFaces(),i}}),42573:((e,t,n)=>{var r=n(7423),i=n(7386);e.exports=function(e,t,n,a,o){for(var s=null,c=null,l=null,u=null,d=i(e,t,n,a,null,o),f=0;f{var r=new(n(26099));e.exports=function(e,t,n,i){var a=n.tilemapLayer,o=a.cullPaddingX,s=a.cullPaddingY,c=a.tilemap.tileToWorldXY(e,t,r,i,a);return c.x>i.worldView.x+a.scaleX*n.tileWidth*(-o-.5)&&c.xi.worldView.y+a.scaleY*n.tileHeight*(-s-1)&&c.y{var r=n(42573),i=n(7386),a=n(62991),o=n(23029);e.exports=function(e,t,n,s,c,l,u,d){u===void 0&&(u=!0);var f=i(e,t,n,s,null,d),p=[];f.forEach(function(e){var t=new o(e.layer,e.index,e.x,e.y,e.width,e.height,e.baseWidth,e.baseHeight);t.copy(e),p.push(t)});for(var m=c-e,h=l-t,g=0;g{var r=n(62644),i=n(7386),a=n(27987);e.exports=function(e,t,n,o,s,c){n||={},Array.isArray(e)||(e=[e]);var l=c.tilemapLayer;o||=l.scene,s||=o.cameras.main;var u=c.width,d=c.height,f=i(0,0,u,d,null,c),p=[],m,h=function(e,t,n){for(var r=0;r{var r=n(87841),i=n(63448),a=n(56583),o=new r;e.exports=function(e,t){var n=e.tilemapLayer.tilemap,r=e.tilemapLayer,s=Math.floor(n.tileWidth*r.scaleX),c=Math.floor(n.tileHeight*r.scaleY),l=a(t.worldView.x-r.x,s,0,!0)-r.cullPaddingX,u=i(t.worldView.right-r.x,s,0,!0)+r.cullPaddingX,d=a(t.worldView.y-r.y,c,0,!0)-r.cullPaddingY,f=i(t.worldView.bottom-r.y,c,0,!0)+r.cullPaddingY;return o.setTo(l,d,u-l,f-d)}}),30003:((e,t,n)=>{var r=n(19545),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return(o.skipCull||o.scrollFactorX!==1||o.scrollFactorY!==1)&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),35137:((e,t,n)=>{var r=n(7386),i=n(42573),a=n(20576);e.exports=function(e,t,n,o,s,c,l){for(var u=l.collideIndexes.indexOf(e)!==-1,d=r(t,n,o,s,null,l),f=0;f{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).filter(e,t)}}),52692:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=!1);var i=0,a,o,s;if(n){for(o=r.height-1;o>=0;o--)for(a=r.width-1;a>=0;a--)if(s=r.data[o][a],s&&s.index===e){if(i===t)return s;i+=1}}else for(o=0;o{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).find(e,t)||null}}),97560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){r(n,i,a,o,s,c).forEach(e,t)}}),43305:((e,t,n)=>{var r=n(91907),i=n(30003),a=n(9474),o=n(14018),s=n(29747),c=n(54503);e.exports=function(e){return e===r.ORTHOGONAL?i:e===r.HEXAGONAL?a:e===r.STAGGERED?c:e===r.ISOMETRIC?o:s}}),7423:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n,i){if(r(e,t,i)){var a=i.data[t][e]||null;return a?a.index===-1?n?a:null:a:null}else return null}}),60540:((e,t,n)=>{var r=n(7423),i=new(n(26099));e.exports=function(e,t,n,a,o){return o.tilemapLayer.worldToTileXY(e,t,!0,i,a),r(i.x,i.y,n,o)}}),55826:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i){var a=i.baseTileWidth,o=i.baseTileHeight,s=i.tilemapLayer,c=0,l=0;s&&(n||=s.scene.cameras.main,c=s.x+n.scrollX*(1-s.scrollFactorX),l=s.y+n.scrollY*(1-s.scrollFactorY),a*=s.scaleX,o*=s.scaleY);var u=c+e*a,d=l+t*o;return[new r(u,d),new r(u+a,d),new r(u+a,d+o),new r(u,d+o)]}}),11758:((e,t,n)=>{var r=n(91907),i=n(27229),a=n(29747),o=n(55826);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:(r.STAGGERED,a)}}),39167:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(97281);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),62e3:((e,t,n)=>{var r=n(91907),i=n(19951),a=n(14127),o=n(29747),s=n(97202),c=n(70326);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),5984:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(28054),o=n(29650);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),7386:((e,t,n)=>{var r=n(95540);e.exports=function(e,t,n,i,a,o){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=o.width),i===void 0&&(i=o.height),a||={};var s=r(a,`isNotEmpty`,!1),c=r(a,`isColliding`,!1),l=r(a,`hasInterestingFace`,!1);e<0&&(n+=e,e=0),t<0&&(i+=t,t=0),e+n>o.width&&(n=Math.max(o.width-e,0)),t+i>o.height&&(i=Math.max(o.height-t,0));for(var u=[],d=t;d{var r=n(55738),i=n(7386),a=n(91865),o=n(29747),s=n(26099),c=n(91907),l=function(e,t){return a.RectangleToTriangle(t,e)},u=new s,d=new s,f=new s;e.exports=function(e,t,n,s){if(s.orientation!==c.ORTHOGONAL)return console.warn(`GetTilesWithinShape only works with orthogonal tilemaps`),[];if(e===void 0)return[];var p=o;e instanceof r.Circle?p=a.CircleToRectangle:e instanceof r.Rectangle?p=a.RectangleToRectangle:e instanceof r.Triangle?p=l:e instanceof r.Line&&(p=a.LineToRectangle),s.tilemapLayer.worldToTileXY(e.left,e.top,!0,d,n);var m=d.x,h=d.y;s.tilemapLayer.worldToTileXY(e.right,e.bottom,!1,f,n);var g=Math.ceil(f.x),_=Math.ceil(f.y),v=i(m,h,Math.max(g-m,1),Math.max(_-h,1),t,s),y=s.tileWidth,b=s.tileHeight;s.tilemapLayer&&(y*=s.tilemapLayer.scaleX,b*=s.tilemapLayer.scaleY);for(var x=[],S=new r.Rectangle(0,0,y,b),C=0;C{var r=n(7386),i=n(26099),a=new i,o=new i;e.exports=function(e,t,n,i,s,c,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,t,!0,a,c,l);var d=a.x,f=a.y;u(e+n,t+i,!1,o,c,l);var p=Math.ceil(o.x),m=Math.ceil(o.y);return r(d,f,p-d,m-f,s,l)}}),96113:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(10095);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),16926:((e,t,n)=>{var r=n(91907),i=n(86625),a=n(96897),o=n(29747),s=n(15108),c=n(85896);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),55762:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(51900),o=n(63288);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),45091:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n){if(r(e,t,n)){var i=n.data[t][e];return i!==null&&i.index>-1}else return!1}}),24152:((e,t,n)=>{var r=n(45091),i=new(n(26099));e.exports=function(e,t,n,a){a.tilemapLayer.worldToTileXY(e,t,!0,i,n);var o=i.x,s=i.y;return r(o,s,a)}}),90454:((e,t,n)=>{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY),c=e.hexSideLength,l,u,d,f;if(e.staggerAxis===`y`){var p=(s-c)/2+c;l=i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,p,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,p,0,!0)+a.cullPaddingY}else{var m=(o-c)/2+c;l=i(t.worldView.x-a.x,m,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,m,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,s,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,s,0,!0)+a.cullPaddingY}return{left:l,right:u,top:d,bottom:f}}}),9474:((e,t,n)=>{var r=n(90454),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),27229:((e,t,n)=>{var r=n(19951),i=n(26099),a=new i;e.exports=function(e,t,n,o){var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(s*=l.scaleX,c*=l.scaleY);var u=r(e,t,a,n,o),d=[],f=.5773502691896257,p,m;o.staggerAxis===`y`?(p=f*s,m=c/2):(p=s/2,m=f*c);for(var h=0;h<6;h++){var g=2*Math.PI*(.5-h)/6;d.push(new i(u.x+p*Math.cos(g),u.y+m*Math.sin(g)))}return d}}),19951:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),u=c.y+i.scrollY*(1-c.scrollFactorY),o*=c.scaleX,s*=c.scaleY);var d=o/2,f=s/2,p,m,h=a.staggerAxis,g=a.staggerIndex;return h===`y`?(p=l+o*e+o,m=u+1.5*t*f+f,t%2==0&&(g===`odd`?p-=d:p+=d)):h===`x`&&g===`odd`&&(p=l+1.5*e*d+d,m=u+s*e+s,e%2==0&&(g===`odd`?m-=f:m+=f)),n.set(p,m)}}),86625:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=.5773502691896257,d=-.3333333333333333,f=0,p=.6666666666666666,m=s/2,h=c/2,g,_,v,y,b;o.staggerAxis===`y`?(g=(e-m)/(u*s),_=(t-h)/h,v=u*g+d*_,y=f*g+p*_):(g=(e-m)/m,_=(t-h)/(u*c),v=d*g+u*_,y=p*g+f*_),b=-v-y;var x=Math.round(v),S=Math.round(y),C=Math.round(b),w=Math.abs(x-v),T=Math.abs(S-y),E=Math.abs(C-b);w>T&&w>E?x=-S-C:T>E&&(S=-x-C);var D,O=S;return D=o.staggerIndex===`odd`?O%2==0?S/2+x:S/2+x-.5:O%2==0?S/2+x:S/2+x+.5,i.set(D,O)}}),62991:(e=>{e.exports=function(e,t,n){return e>=0&&e=0&&t{var r=n(33528);e.exports=function(e,t,n,i){n===void 0&&(n=[]),i===void 0&&(i=0),n.length=0;var a=e.tilemapLayer,o=e.data,s=e.width,c=e.height,l=a.skipCull,u=0,d=s,f=0,p=c,m,h,g;if(i===0)for(h=f;h=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));else if(i===2)for(h=p;h>=f;h--)for(m=u;m=f;h--)for(m=d;m>=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));return a.tilesDrawn=n.length,a.tilesTotal=s*c,n}}),14127:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+(e-t)*(o/2),f=u+(e+t)*(s/2);return n.set(d,f)}}),96897:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o,s){i||=new r;var c=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(a||=u.scene.cameras.main,t-=u.y+a.scrollY*(1-u.scrollFactorY),l*=u.scaleY,e-=u.x+a.scrollX*(1-u.scrollFactorX),c*=u.scaleX);var d=c/2,f=l/2;e-=d,s||(t-=l);var p=.5*(e/d+t/f),m=.5*(-e/d+t/f);return n&&(p=Math.floor(p),m=Math.floor(m)),i.set(p,m)}}),71558:((e,t,n)=>{var r=n(23029),i=n(62991),a=n(72023),o=n(20576);e.exports=function(e,t,n,s,c){if(s===void 0&&(s=!0),!i(t,n,c))return null;var l,u=c.data[n][t],d=u&&u.collides;e instanceof r?(c.data[n][t]===null&&(c.data[n][t]=new r(c,e.index,t,n,c.tileWidth,c.tileHeight)),c.data[n][t].copy(e)):(l=e,c.data[n][t]===null?c.data[n][t]=new r(c,l,t,n,c.tileWidth,c.tileHeight):c.data[n][t].index=l);var f=c.data[n][t],p=c.collideIndexes.indexOf(f.index)!==-1;if(l=e instanceof r?e.index:e,l===-1)f.width=c.tileWidth,f.height=c.tileHeight;else{var m=c.tilemapLayer.tilemap,h=m.tiles[l][2],g=m.tilesets[h];f.width=g.tileWidth,f.height=g.tileHeight}return o(f,p),s&&d!==f.collides&&a(t,n,c),f}}),26303:((e,t,n)=>{var r=n(71558),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(t,n,!0,i,o,s),r(e,i.x,i.y,a,s)}}),14051:((e,t,n)=>{var r=n(42573),i=n(71558);e.exports=function(e,t,n,a,o){if(a===void 0&&(a=!0),!Array.isArray(e))return null;Array.isArray(e[0])||(e=[e]);for(var s=e.length,c=e[0].length,l=0;l{var r=n(7386),i=n(26546);e.exports=function(e,t,n,a,o,s){var c,l=r(e,t,n,a,{},s);if(!o)for(o=[],c=0;c{var r=n(23029),i=n(62991),a=n(72023);e.exports=function(e,t,n,o,s){if(n===void 0&&(n=!0),o===void 0&&(o=!0),!i(e,t,s))return null;var c=s.data[t][e];if(c)s.data[t][e]=n?null:new r(s,-1,e,t,s.tileWidth,s.tileHeight);else return null;return o&&c&&c.collides&&a(e,t,s),c}}),94178:((e,t,n)=>{var r=n(63557),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(e,t,!0,i,o,s),r(i.x,i.y,n,a,s)}}),15533:((e,t,n)=>{var r=n(7386),i=n(3956),a=new i(105,210,231,150),o=new i(243,134,48,200),s=new i(40,39,37,150);e.exports=function(e,t,n){t===void 0&&(t={});var i=t.tileColor===void 0?a:t.tileColor,c=t.collidingTileColor===void 0?o:t.collidingTileColor,l=t.faceColor===void 0?s:t.faceColor,u=r(0,0,n.width,n.height,null,n);e.translateCanvas(n.tilemapLayer.x,n.tilemapLayer.y),e.scaleCanvas(n.tilemapLayer.scaleX,n.tilemapLayer.scaleY);for(var d=0;d{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n,r){var i=e.data,a=e.width,o=e.height,s=e.tilemapLayer,c=Math.max(0,t.left),l=Math.min(a,t.right),u=Math.max(0,t.top),d=Math.min(o,t.bottom),f,p,m;if(n===0)for(p=u;p=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);else if(n===2)for(p=d;p>=u;p--)for(f=c;i[p]&&f=u;p--)for(f=l;i[p]&&f>=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);return s.tilesDrawn=r.length,s.tilesTotal=a*o,r}}),57068:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s){t===void 0&&(t=!0),n===void 0&&(n=!0),s===void 0&&(s=!0),Array.isArray(e)||(e=[e]);for(var c=0;c{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s,c){if(n===void 0&&(n=!0),o===void 0&&(o=!0),c===void 0&&(c=!0),!(e>t)){for(var l=e;l<=t;l++)a(l,n,s);if(c)for(var u=0;u=e&&f.index<=t&&r(f,n)}o&&i(0,0,s.width,s.height,s)}}}),75661:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0),Array.isArray(e)||(e=[e]);for(var s=0;s{var r=n(20576),i=n(42573),a=n(97022);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0);for(var s=0;s{var r=n(20576),i=n(42573);e.exports=function(e,t,n){e===void 0&&(e=!0),t===void 0&&(t=!0);for(var a=0;a0&&r(s,e)}}t&&i(0,0,n.width,n.height,n)}}),9589:(e=>{e.exports=function(e,t,n){var r=n.collideIndexes.indexOf(e);t&&r===-1?n.collideIndexes.push(e):!t&&r!==-1&&n.collideIndexes.splice(r,1)}}),20576:(e=>{e.exports=function(e,t){t?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)}}),79583:(e=>{e.exports=function(e,t,n,r){if(typeof e==`number`)r.callbacks[e]=t===null?void 0:{callback:t,callbackContext:n};else for(var i=0,a=e.length;i{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(e,t,n,i,null,s),l=0;l{var r=n(7386),i=n(33680);e.exports=function(e,t,n,a,o){var s=r(e,t,n,a,null,o),c=s.map(function(e){return e.index});i(c);for(var l=0;l{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY);return{left:i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,right:r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,top:i(t.worldView.y-a.y,s/2,0,!0)-a.cullPaddingY,bottom:r(t.worldView.bottom-a.y,s/2,0,!0)+a.cullPaddingY}}}),54503:((e,t,n)=>{var r=n(61325),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),97202:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+e*o+t%2*(o/2),f=u+s/2*t;return n.set(d,f)}}),28054:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t===void 0&&(t=i.scene.cameras.main),a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+r/2*e+r}}),15108:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,t-=l.y+a.scrollY*(1-l.scrollFactorY),c*=l.scaleY,e-=l.x+a.scrollX*(1-l.scrollFactorX),s*=l.scaleX);var u=n?Math.floor(t/(c/2)):t/(c/2),d=n?Math.floor((e+u%2*.5*s)/s):(e+u%2*.5*s)/s;return i.set(d,u)}}),51900:(e=>{e.exports=function(e,t,n,r){var i=r.baseTileHeight,a=r.tilemapLayer;return a&&(n||=a.scene.cameras.main,e-=a.y+n.scrollY*(1-a.scrollFactorY),i*=a.scaleY),t?Math.floor(e/(i/2)):e/(i/2)}}),86560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n){var r=n.baseTileWidth,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.x+t.scrollX*(1-i.scrollFactorX),r*=i.scaleX),a+e*r}}),70326:((e,t,n)=>{var r=n(97281),i=n(29650),a=n(26099);e.exports=function(e,t,n,o,s){return n||=new a(0,0),n.x=r(e,o,s),n.y=i(t,o,s),n}}),29650:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+e*r}}),77366:((e,t,n)=>{var r=n(7386),i=n(75508);e.exports=function(e,t,n,a,o,s){if(o){var c,l=r(e,t,n,a,null,s),u=0;for(c=0;c{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(e,0,t,i,n,a),i.x}}),85896:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){n===void 0&&(n=!0),i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=e/s,d=t/c;return n&&(u=Math.floor(u),d=Math.floor(d)),i.set(u,d)}}),63288:((e,t,n)=>{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(0,e,t,i,n,a),i.y}}),81086:((e,t,n)=>{e.exports={CalculateFacesAt:n(72023),CalculateFacesWithin:n(42573),CheckIsoBounds:n(33528),Copy:n(1785),CreateFromTiles:n(78419),CullBounds:n(19545),CullTiles:n(30003),Fill:n(35137),FilterTiles:n(40253),FindByIndex:n(52692),FindTile:n(66151),ForEachTile:n(97560),GetCullTilesFunction:n(43305),GetTileAt:n(7423),GetTileAtWorldXY:n(60540),GetTileCorners:n(55826),GetTileCornersFunction:n(11758),GetTilesWithin:n(7386),GetTilesWithinShape:n(91141),GetTilesWithinWorldXY:n(96523),GetTileToWorldXFunction:n(39167),GetTileToWorldXYFunction:n(62e3),GetTileToWorldYFunction:n(5984),GetWorldToTileXFunction:n(96113),GetWorldToTileXYFunction:n(16926),GetWorldToTileYFunction:n(55762),HasTileAt:n(45091),HasTileAtWorldXY:n(24152),HexagonalCullBounds:n(90454),HexagonalCullTiles:n(9474),HexagonalGetTileCorners:n(27229),HexagonalTileToWorldXY:n(19951),HexagonalWorldToTileXY:n(86625),IsInLayerBounds:n(62991),IsometricCullTiles:n(14018),IsometricTileToWorldXY:n(14127),IsometricWorldToTileXY:n(96897),PutTileAt:n(71558),PutTileAtWorldXY:n(26303),PutTilesAt:n(14051),Randomize:n(77389),RemoveTileAt:n(63557),RemoveTileAtWorldXY:n(94178),RenderDebug:n(15533),ReplaceByIndex:n(27987),RunCull:n(32483),SetCollision:n(57068),SetCollisionBetween:n(37266),SetCollisionByExclusion:n(75661),SetCollisionByProperty:n(64740),SetCollisionFromCollisionGroup:n(63307),SetLayerCollisionIndex:n(9589),SetTileCollision:n(20576),SetTileIndexCallback:n(79583),SetTileLocationCallback:n(93254),Shuffle:n(32903),StaggeredCullBounds:n(61325),StaggeredCullTiles:n(54503),StaggeredTileToWorldXY:n(97202),StaggeredTileToWorldY:n(28054),StaggeredWorldToTileXY:n(15108),StaggeredWorldToTileY:n(51900),SwapByIndex:n(86560),TileToWorldX:n(97281),TileToWorldXY:n(70326),TileToWorldY:n(29650),WeightedRandomize:n(77366),WorldToTileX:n(10095),WorldToTileXY:n(85896),WorldToTileY:n(63288)}}),91907:(e=>{e.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}}),21829:((e,t,n)=>{e.exports={ORIENTATION:n(91907)}}),62501:((e,t,n)=>{var r=n(79291),i=n(21829),a={Components:n(81086),Parsers:n(57442),Formats:n(80341),ImageCollection:n(16536),ParseToTilemap:n(31989),Tile:n(23029),Tilemap:n(49075),TilemapCreator:n(45939),TilemapFactory:n(46029),Tileset:n(33629),TilemapLayer:n(20442),Orientation:n(91907),LayerData:n(14977),MapData:n(87010),ObjectLayer:n(48700)};a=r(!1,a,i.ORIENTATION),e.exports=a}),14977:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`layer`),this.id=a(e,`id`,0),this.x=a(e,`x`,0),this.y=a(e,`y`,0),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.baseTileWidth=a(e,`baseTileWidth`,this.tileWidth),this.baseTileHeight=a(e,`baseTileHeight`,this.tileHeight),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.widthInPixels=a(e,`widthInPixels`,this.width*this.baseTileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.baseTileHeight),this.alpha=a(e,`alpha`,1),this.visible=a(e,`visible`,!0),this.properties=a(e,`properties`,[]),this.indexes=a(e,`indexes`,[]),this.collideIndexes=a(e,`collideIndexes`,[]),this.callbacks=a(e,`callbacks`,[]),this.bodies=a(e,`bodies`,[]),this.data=a(e,`data`,[]),this.tilemapLayer=a(e,`tilemapLayer`,null),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),87010:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`map`),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.infinite=a(e,`infinite`,!1),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.widthInPixels=a(e,`widthInPixels`,this.width*this.tileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.tileHeight),this.format=a(e,`format`,null),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.renderOrder=a(e,`renderOrder`,`right-down`),this.version=a(e,`version`,`1`),this.properties=a(e,`properties`,{}),this.layers=a(e,`layers`,[]),this.images=a(e,`images`,[]),this.objects=a(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=a(e,`collision`,{}),this.tilesets=a(e,`tilesets`,[]),this.imageCollections=a(e,`imageCollections`,[]),this.tiles=a(e,`tiles`,[]),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),48700:((e,t,n)=>{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=i(e,`name`,`object layer`),this.id=i(e,`id`,0),this.opacity=i(e,`opacity`,1),this.properties=i(e,`properties`,{}),this.propertyTypes=i(e,`propertytypes`,{}),this.type=i(e,`type`,`objectgroup`),this.visible=i(e,`visible`,!0),this.objects=i(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[])}})}),6641:((e,t,n)=>{var r=n(91907);e.exports=function(e){return e=e.toLowerCase(),e===`isometric`?r.ISOMETRIC:e===`staggered`?r.STAGGERED:e===`hexagonal`?r.HEXAGONAL:r.ORTHOGONAL}}),46177:((e,t,n)=>{var r=n(80341),i=n(2342),a=n(82593),o=n(46594),s=n(87021);e.exports=function(e,t,n,c,l,u){var d;switch(t){case r.ARRAY_2D:d=i(e,n,c,l,u);break;case r.CSV:d=a(e,n,c,l,u);break;case r.TILED_JSON:d=o(e,n,u);break;case r.WELTMEISTER:d=s(e,n,u);break;default:console.warn(`Unrecognized tilemap data format: `+t),d=null}return d}}),2342:((e,t,n)=>{var r=n(80341),i=n(14977),a=n(87010),o=n(23029);e.exports=function(e,t,n,s,c){for(var l=new i({tileWidth:n,tileHeight:s}),u=new a({name:e,tileWidth:n,tileHeight:s,format:r.ARRAY_2D,layers:[l]}),d=[],f=t.length,p=0,m=0;m{var r=n(80341),i=n(2342);e.exports=function(e,t,n,a,o){var s=i(e,t.trim().split(` `).map(function(e){return e.split(`,`)}),n,a,o);return s.format=r.CSV,s}}),6656:((e,t,n)=>{var r=n(14977),i=n(23029);e.exports=function(e,t){for(var n=[],a=0;a-1?new i(s,f,d,u,o.tilesize,o.tilesize):t?null:new i(s,-1,d,u,o.tilesize,o.tilesize);c.push(p)}l.push(c),c=[]}s.data=l,n.push(s)}return n}}),96483:((e,t,n)=>{var r=n(33629);e.exports=function(e){for(var t=[],n=[],i=0;i{var r=n(80341),i=n(87010),a=n(6656),o=n(96483);e.exports=function(e,t,n){if(t.layer.length===0)return console.warn(`No layers found in the Weltmeister map: `+e),null;for(var s=0,c=0,l=0;ls&&(s=t.layer[l].width),t.layer[l].height>c&&(c=t.layer[l].height);var u=new i({width:s,height:c,name:e,tileWidth:t.layer[0].tilesize,tileHeight:t.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=a(t,n),u.tilesets=o(t),u}}),52833:((e,t,n)=>{e.exports={ParseTileLayers:n(6656),ParseTilesets:n(96483),ParseWeltmeister:n(87021)}}),57442:((e,t,n)=>{e.exports={FromOrientationString:n(6641),Parse:n(46177),Parse2DArray:n(2342),ParseCSV:n(82593),Impact:n(52833),Tiled:n(96761)}}),51233:((e,t,n)=>{var r=n(79291);e.exports=function(e){for(var t,n,i,a,o,s=0;s{e.exports=function(e){for(var t=window.atob(e),n=t.length,r=Array(n/4),i=0;i>>0;return r}}),84101:((e,t,n)=>{var r=n(33629);e.exports=function(e){var t,n,i=[];for(t=0;t{var r=n(95540);e.exports=function(e,t,n){if(!t)return{i:0,layers:e.layers,name:``,opacity:1,visible:!0,x:0,y:0};var i=t.x+r(t,`startx`,0)*e.tilewidth+r(t,`offsetx`,0),a=t.y+r(t,`starty`,0)*e.tileheight+r(t,`offsety`,0);return{i:0,layers:t.layers,name:n.name+t.name+`/`,opacity:n.opacity*t.opacity,visible:n.visible&&t.visible,x:n.x+i,y:n.y+a}}}),29920:(e=>{var t=2147483648,n=1073741824,r=536870912;e.exports=function(e){var i=!!(e&t),a=!!(e&n),o=!!(e&r);e&=~(t|n|r);var s=0,c=!1;return i&&a&&o?(s=Math.PI/2,c=!0):i&&a&&!o?(s=Math.PI,c=!1):i&&!a&&o?(s=Math.PI/2,c=!1):i&&!a&&!o?(s=0,c=!0):!i&&a&&o?(s=3*Math.PI/2,c=!1):!i&&a&&!o?(s=Math.PI,c=!0):!i&&!a&&o?(s=3*Math.PI/2,c=!0):!i&&!a&&!o&&(s=0,c=!1),{gid:e,flippedHorizontal:i,flippedVertical:a,flippedAntiDiagonal:o,rotation:s,flipped:c}}}),12635:((e,t,n)=>{var r=n(95540),i=n(79677);e.exports=function(e){for(var t=[],n=[],a=i(e);a.i0;){if(a.i>=a.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}a=n.pop();continue}var o=a.layers[a.i];if(a.i++,o.type!==`imagelayer`){if(o.type===`group`){var s=i(e,o,a);n.push(a),a=s}continue}var c=r(o,`offsetx`,0)+r(o,`startx`,0),l=r(o,`offsety`,0)+r(o,`starty`,0);t.push({name:a.name+o.name,image:o.image,x:a.x+c+o.x,y:a.y+l+o.y,alpha:a.opacity*o.opacity,visible:a.visible&&o.visible,properties:r(o,`properties`,{})})}return t}}),46594:((e,t,n)=>{var r=n(51233),i=n(84101),a=n(91907),o=n(62644),s=n(80341),c=n(6641),l=n(87010),u=n(12635),d=n(22611),f=n(28200),p=n(24619);e.exports=function(e,t,n){var m=o(t),h=new l({width:m.width,height:m.height,name:e,tileWidth:m.tilewidth,tileHeight:m.tileheight,orientation:c(m.orientation),format:s.TILED_JSON,version:m.version,properties:m.properties,renderOrder:m.renderorder,infinite:m.infinite});if(h.orientation===a.HEXAGONAL)if(h.hexSideLength=m.hexsidelength,h.staggerAxis=m.staggeraxis,h.staggerIndex=m.staggerindex,h.staggerAxis===`y`){var g=(h.tileHeight-h.hexSideLength)/2;h.widthInPixels=h.tileWidth*(h.width+.5),h.heightInPixels=h.height*(h.hexSideLength+g)+g}else{var _=(h.tileWidth-h.hexSideLength)/2;h.widthInPixels=h.width*(h.hexSideLength+_)+_,h.heightInPixels=h.tileHeight*(h.height+.5)}h.layers=f(m,n),h.images=u(m);var v=p(m);return h.tilesets=v.tilesets,h.imageCollections=v.imageCollections,h.objects=d(m),h.tiles=i(h),r(h),h}}),52205:((e,t,n)=>{var r=n(18254),i=n(29920),a=function(e){return{x:e.x,y:e.y}},o=[`id`,`name`,`type`,`rotation`,`properties`,`visible`,`x`,`y`,`width`,`height`];e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var s=r(e,o);if(s.x+=t,s.y+=n,e.gid){var c=i(e.gid);s.gid=c.gid,s.flippedHorizontal=c.flippedHorizontal,s.flippedVertical=c.flippedVertical,s.flippedAntiDiagonal=c.flippedAntiDiagonal}else e.polyline?s.polyline=e.polyline.map(a):e.polygon?s.polygon=e.polygon.map(a):e.ellipse?s.ellipse=e.ellipse:e.text?s.text=e.text:e.point?s.point=!0:s.rectangle=!0;return s}}),22611:((e,t,n)=>{var r=n(95540),i=n(52205),a=n(48700),o=n(79677);e.exports=function(e){for(var t=[],n=[],s=o(e);s.i0;){if(s.i>=s.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}s=n.pop();continue}var c=s.layers[s.i];if(s.i++,c.opacity*=s.opacity,c.visible=s.visible&&c.visible,c.type!==`objectgroup`){if(c.type===`group`){var l=o(e,c,s);n.push(s),s=l}continue}c.name=s.name+c.name;for(var u=s.x+r(c,`startx`,0)+r(c,`offsetx`,0),d=s.y+r(c,`starty`,0)+r(c,`offsety`,0),f=[],p=0;p{var r=n(41868),i=n(91907),a=n(79677),o=n(6641),s=n(95540),c=n(14977),l=n(29920),u=n(23029);e.exports=function(e,t){for(var n=s(e,`infinite`,!1),d=[],f=[],p=a(e);p.i0;){if(p.i>=p.layers.length){if(f.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}p=f.pop();continue}var m=p.layers[p.i];if(p.i++,m.type!==`tilelayer`){if(m.type===`group`){var h=a(e,m,p);f.push(p),p=h}continue}if(m.compression){console.warn(`TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '`+m.name+`'`);continue}else if(m.encoding&&m.encoding===`base64`){if(m.chunks)for(var g=0;g0?(y=new u(_,v.gid,F,I,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,C[I][F]=y):(b=t?null:new u(_,-1,F,I,e.tilewidth,e.tileheight),C[I][F]=b),w++,w===k.width&&(M++,w=0)}}else{_=new c({name:p.name+m.name,id:m.id,x:p.x+s(m,`offsetx`,0)+m.x,y:p.y+s(m,`offsety`,0)+m.y,width:m.width,height:m.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:p.opacity*m.opacity,visible:p.visible&&m.visible,properties:s(m,`properties`,[]),orientation:o(e.orientation)}),_.orientation===i.HEXAGONAL&&(_.hexSideLength=e.hexsidelength,_.staggerAxis=e.staggeraxis,_.staggerIndex=e.staggerindex,_.staggerAxis===`y`?(x=(_.tileHeight-_.hexSideLength)/2,_.widthInPixels=_.tileWidth*(_.width+.5),_.heightInPixels=_.height*(_.hexSideLength+x)+x):(S=(_.tileWidth-_.hexSideLength)/2,_.widthInPixels=_.width*(_.hexSideLength+S)+S,_.heightInPixels=_.tileHeight*(_.height+.5)));for(var L=[],R=0,z=m.data.length;R0?(y=new u(_,v.gid,w,C.length,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,L.push(y)):(b=t?null:new u(_,-1,w,C.length,e.tilewidth,e.tileheight),L.push(b)),w++,w===m.width&&(C.push(L),w=0,L=[])}_.data=C,d.push(_)}return d}}),24619:((e,t,n)=>{var r=n(33629),i=n(16536),a=n(52205),o=n(57880);e.exports=function(e){for(var t=[],n=[],s=null,c,l=0;l1){var f=void 0,p=void 0;if(Array.isArray(u.tiles)){f||={},p||={};for(var m=0;m{e.exports=function(e,t){for(var n=0;n0){var a={},o={},s,c,l;if(Array.isArray(r.edgecolors))for(s=0;s{e.exports={AssignTileProperties:n(51233),Base64Decode:n(41868),BuildTilesetIndex:n(84101),CreateGroupLayer:n(79677),ParseGID:n(29920),ParseImageLayers:n(12635),ParseJSONTiled:n(46594),ParseObject:n(52205),ParseObjectLayers:n(22611),ParseTileLayers:n(28200),ParseTilesets:n(24619)}}),33385:((e,t,n)=>{var r=n(83419),i=n(37277),a=n(44594),o=n(94880),s=n(72905),c=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],e.sys.events.once(a.BOOT,this.boot,this),e.sys.events.on(a.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var e=this.systems.events;e.on(a.PRE_UPDATE,this.preUpdate,this),e.on(a.UPDATE,this.update,this),e.once(a.SHUTDOWN,this.shutdown,this)},addEvent:function(e){var t;if(e instanceof o){if(t=e,this.removeEvent(t),t.elapsed=t.startAt,t.hasDispatched=!1,t.repeatCount=t.repeat===-1||t.loop?999999999999:t.repeat,t.delay<=0&&t.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`)}else t=new o(e);return this._pendingInsertion.push(t),t},delayedCall:function(e,t,n,r){return this.addEvent({delay:e,callback:t,args:n,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t-1&&this._active.splice(i,1),r.destroy()}for(n=0;n=r.delay)){var i=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,i>=r.delay)for(;i>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),i-=r.delay,r.repeatCount--;r.elapsed=i,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var e;for(e=0;e{var r=n(83419),i=n(50792),a=n(39429),o=n(95540),s=n(44594),c=n(89809),l=new r({Extends:i,initialize:function(e,t){i.call(this),this.scene=e,this.systems=e.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 n=this.systems.events;n.on(s.PRE_UPDATE,this.preUpdate,this),n.on(s.UPDATE,this.update,this),n.once(s.SHUTDOWN,this.destroy,this),t&&this.add(t)},preUpdate:function(e,t){this.paused||(this.elapsed+=t*this.timeScale)},update:function(){if(!(this.paused||this.complete)){var e,t=this.events,n=!1,r=this.systems,i;for(e=0;e=t.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(c.COMPLETE,this)}},play:function(e){return e===void 0&&(e=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,e&&this.reset(),this},pause:function(){this.paused=!0;for(var e=this.events,t=0;t0&&(n=t[t.length-1].time);for(var r=0;r{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){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(e)},reset:function(e){if(this.delay=i(e,`delay`,0),this.repeat=i(e,`repeat`,0),this.loop=i(e,`loop`,!1),this.callback=i(e,`callback`,void 0),this.callbackScope=i(e,`callbackScope`,this),this.args=i(e,`args`,[]),this.timeScale=i(e,`timeScale`,1),this.startAt=i(e,`startAt`,0),this.paused=i(e,`paused`,!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`);return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var e=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/e}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(e){e===void 0&&(e=!1),this.elapsed=this.delay,this.hasDispatched=!e,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}})}),35945:(e=>{e.exports=`complete`}),89809:((e,t,n)=>{e.exports={COMPLETE:n(35945)}}),90291:((e,t,n)=>{e.exports={Clock:n(33385),Events:n(89809),Timeline:n(96120),TimerEvent:n(94880)}}),40382:((e,t,n)=>{var r=n(72905),i=n(83419),a=n(43491),o=n(88032),s=n(37277),c=n(44594),l=n(93109),u=n(86081),d=n(8357),f=n(43960),p=n(26012),m=new i({initialize:function(e){this.scene=e,this.events=e.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(c.BOOT,this.boot,this),this.events.on(c.START,this.start,this)},boot:function(){this.events.once(c.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(c.UPDATE,this.update,this),this.events.once(c.SHUTDOWN,this.shutdown,this)},create:function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0;n-1},existing:function(e){return this.has(e)||this.tweens.push(e.reset()),this},addCounter:function(e){var t=o(this,e);return this.tweens.push(t.reset()),t},stagger:function(e,t){return l(e,t)},setLagSmooth:function(e,t){return e===void 0&&(e=1/1e-8),t===void 0&&(t=0),this.maxLag=e,this.lagSkip=Math.min(t,this.maxLag),this},setFps:function(e){return e===void 0&&(e=240),this.gap=1e3/e,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(e){var t=Date.now()-this.prevTime;t>this.maxLag&&(this.startTime+=t-this.lagSkip),this.prevTime+=t;var n=this.prevTime-this.startTime,r=n-this.nextTime,i=n-this.time*1e3;return r>0||e?(n/=1e3,this.time=n,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):i=0,i},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(e){e===void 0&&(e=!1);var t=this.getDelta(e);if(!(t<=0)){this.processing=!0;var n,r,i=[],a=this.tweens;for(n=0;n0){for(n=0;n-1&&(r.isPendingRemove()||r.isDestroyed())&&(a.splice(s,1),r.destroy())}i.length=0}this.processing=!1}},remove:function(e){return this.processing?e.setPendingRemoveState():(r(this.tweens,e),e.setRemovedState()),this},reset:function(e){return this.existing(e),e.seek(),e.setActiveState(),this},makeActive:function(e){return this.existing(e),e.setActiveState(),this},each:function(e,t){var n,r=[null];for(n=1;n{e.exports=function(e,t,n){return e&&e.hasOwnProperty(t)?e[t]:n}}),6113:((e,t,n)=>{var r=n(62640),i=n(35355);e.exports=function(e,t){var n=r.Power0;if(typeof e==`string`)if(r.hasOwnProperty(e))n=r[e];else{var a=``;if(e.indexOf(`.`)){a=e.substring(e.indexOf(`.`)+1);var o=a.toLowerCase();o===`in`?a=`easeIn`:o===`out`?a=`easeOut`:o===`inout`&&(a=`easeInOut`)}e=i(e.substring(0,e.indexOf(`.`)+1)+a),r.hasOwnProperty(e)&&(n=r[e])}else typeof e==`function`&&(n=e);if(!t)return n;var s=t.slice(0);return s.unshift(0),function(e){return s[0]=e,n.apply(this,s)}}}),91389:((e,t,n)=>{var r=n(89318),i=n(77259),a={bezier:r,catmull:i,catmullrom:i,linear:n(28392)};e.exports=function(e){if(e===null)return null;var t=a.linear;return typeof e==`string`?a.hasOwnProperty(e)&&(t=a[e]):typeof e==`function`&&(t=e),t}}),55292:(e=>{e.exports=function(e,t,n){return e.hasOwnProperty(t)?typeof e[t]==`function`?function(n,r,i,a,o,s){return e[t](n,r,i,a,o,s)}:function(){return e[t]}:typeof n==`function`?n:function(){return n}}}),82985:((e,t,n)=>{var r=n(81076);e.exports=function(e){var t,n=[];if(e.hasOwnProperty(`props`))for(t in e.props)t.substring(0,1)!==`_`&&n.push({key:t,value:e.props[t]});else for(t in e)r.indexOf(t)===-1&&t.substring(0,1)!==`_`&&n.push({key:t,value:e[t]});return n}}),62329:((e,t,n)=>{var r=n(35154);e.exports=function(e){var t=r(e,`targets`,null);return t===null?t:(typeof t==`function`&&(t=t.call()),Array.isArray(t)||(t=[t]),t)}}),17777:((e,t,n)=>{var r=n(30976),i=n(99472);function a(e){return!!e.getActive&&typeof e.getActive==`function`}function o(e){return!!e.getStart&&typeof e.getStart==`function`}function s(e){return!!e.getEnd&&typeof e.getEnd==`function`}function c(e){return o(e)||s(e)||a(e)}var l=function(e,t){var n,u=function(e,t,n){return n},d=function(e,t,n){return n},f=null,p=typeof t;if(p===`number`)u=function(){return t};else if(Array.isArray(t))d=function(){return t[0]},u=function(){return t[t.length-1]};else if(p===`string`){var m=t.toLowerCase(),h=m.substring(0,6)===`random`,g=m.substring(0,3)===`int`;if(h||g){var _=m.indexOf(`(`),v=m.indexOf(`)`),y=m.indexOf(`,`);if(_&&v&&y){var b=parseFloat(m.substring(_+1,y)),x=parseFloat(m.substring(y+1,v));u=h?function(){return i(b,x)}:function(){return r(b,x)}}else throw Error(`invalid random() format`)}else{m=m[0];var S=parseFloat(t.substr(2));switch(m){case`+`:u=function(e,t,n){return n+S};break;case`-`:u=function(e,t,n){return n-S};break;case`*`:u=function(e,t,n){return n*S};break;case`/`:u=function(e,t,n){return n/S};break;default:u=function(){return parseFloat(t)}}}}else if(p===`function`)u=t;else if(p===`object`)if(c(t))a(t)&&(f=t.getActive),s(t)&&(u=t.getEnd),o(t)&&(d=t.getStart);else if(t.hasOwnProperty(`value`))n=l(e,t.value);else{var C=t.hasOwnProperty(`to`),w=t.hasOwnProperty(`from`),T=t.hasOwnProperty(`start`);if(C&&(w||T)){if(n=l(e,t.to),T){var E=l(e,t.start);n.getActive=E.getEnd}if(w){var D=l(e,t.from);n.getStart=D.getEnd}}}return n||={getActive:f,getEnd:u,getStart:d},n};e.exports=l}),88032:((e,t,n)=>{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(55292),u=n(35154),d=n(17777),f=n(269),p=n(86081);e.exports=function(e,t,n){if(t instanceof p)return t.parent=e,t;n=n===void 0?i:f(i,n);var m=c(t,`from`,0),h=c(t,`to`,1),g=[{value:m}],_=c(t,`delay`,n.delay),v=c(t,`easeParams`,n.easeParams),y=c(t,`ease`,n.ease),b=d(`value`,h),x=new p(e,g),S=x.add(0,`value`,b.getEnd,b.getStart,b.getActive,s(c(t,`ease`,y),c(t,`easeParams`,v)),l(t,`delay`,_),c(t,`duration`,n.duration),o(t,`yoyo`,n.yoyo),c(t,`hold`,n.hold),c(t,`repeat`,n.repeat),c(t,`repeatDelay`,n.repeatDelay),!1,!1);S.start=m,S.current=m,x.completeDelay=a(t,`completeDelay`,0),x.loop=Math.round(a(t,`loop`,0)),x.loopDelay=Math.round(a(t,`loopDelay`,0)),x.paused=o(t,`paused`,!1),x.persist=o(t,`persist`,!1),x.isNumberTween=!0,x.callbackScope=u(t,`callbackScope`,x);for(var C=r.TYPES,w=0;w{var r=n(6113),i=n(35154),a=n(36383);e.exports=function(e,t){t===void 0&&(t={});var n,o=i(t,`start`,0),s=i(t,`ease`,null),c=i(t,`grid`,null),l=i(t,`from`,0),u=l===`first`,d=l===`center`,f=l===`last`,p=typeof l==`number`,m=Array.isArray(e),h=parseFloat(m?e[0]:e),g=m?parseFloat(e[1]):0,_=Math.max(h,g);if(m&&(o+=h),c){var v=c[0],y=c[1],b=0,x=0,S=0,C=0,w=[];f?(b=v-1,x=y-1):p?(b=l%v,x=Math.floor(l/v)):d&&(b=(v-1)/2,x=(y-1)/2);for(var T=a.MIN_SAFE_INTEGER,E=0;ET&&(T=O),w[E][D]=O}}}var k=s?r(s):null;return n=c?function(e,t,n,r){var i=0,a=r%v,s=Math.floor(r/v);a>=0&&a=0&&s{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(91389),u=n(55292),d=n(82985),f=n(62329),p=n(35154),m=n(17777),h=n(269),g=n(86081);e.exports=function(e,t,n){if(t instanceof g)return t.parent=e,t;n=n===void 0?i:h(i,n);var _=f(t);!_&&n.targets&&(_=n.targets);for(var v=d(t),y=c(t,`delay`,n.delay),b=c(t,`duration`,n.duration),x=c(t,`easeParams`,n.easeParams),S=c(t,`ease`,n.ease),C=c(t,`hold`,n.hold),w=c(t,`repeat`,n.repeat),T=c(t,`repeatDelay`,n.repeatDelay),E=o(t,`yoyo`,n.yoyo),D=o(t,`flipX`,n.flipX),O=o(t,`flipY`,n.flipY),k=c(t,`interpolation`,n.interpolation),A=function(e,t,n,r){if(n===`texture`){var i=r,a=void 0;Array.isArray(r)?(i=r[0],a=r[1]):r.hasOwnProperty(`value`)?(i=r.value,Array.isArray(r.value)?(i=r.value[0],a=r.value[1]):typeof r.value==`string`&&(i=r.value)):typeof r==`string`&&(i=r),e.addFrame(t,i,a,u(r,`delay`,y),c(r,`duration`,b),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O))}else{var d=m(n,r),f=l(c(r,`interpolation`,k));e.add(t,n,d.getEnd,d.getStart,d.getActive,s(c(r,`ease`,S),c(r,`easeParams`,x)),u(r,`delay`,y),c(r,`duration`,b),o(r,`yoyo`,E),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O),f,f?r:null)}},j=new g(e,_),M=0;M{var r=n(70402),i=n(23568),a=n(57355),o=n(62329),s=n(35154),c=n(8357),l=n(43960);e.exports=function(e,t){if(t instanceof l)return t.parent=e,t;var n=new l(e);n.startDelay=s(t,`delay`,0),n.completeDelay=i(t,`completeDelay`,0),n.loop=Math.round(i(t,`loop`,s(t,`repeat`,0))),n.loopDelay=Math.round(i(t,`loopDelay`,s(t,`repeatDelay`,0))),n.paused=a(t,`paused`,!1),n.persist=a(t,`persist`,!1),n.callbackScope=s(t,`callbackScope`,n);var u,d=r.TYPES;for(u=0;u{e.exports={GetBoolean:n(57355),GetEaseFunction:n(6113),GetInterpolationFunction:n(91389),GetNewValue:n(55292),GetProps:n(82985),GetTargets:n(62329),GetValueOp:n(17777),NumberTweenBuilder:n(88032),StaggerBuilder:n(93109),TweenBuilder:n(8357)}}),73685:(e=>{e.exports=`active`}),98540:(e=>{e.exports=`complete`}),67233:(e=>{e.exports=`loop`}),2859:(e=>{e.exports=`pause`}),98336:(e=>{e.exports=`repeat`}),25764:(e=>{e.exports=`resume`}),32193:(e=>{e.exports=`start`}),84371:(e=>{e.exports=`stop`}),70766:(e=>{e.exports=`update`}),55659:(e=>{e.exports=`yoyo`}),842:((e,t,n)=>{e.exports={TWEEN_ACTIVE:n(73685),TWEEN_COMPLETE:n(98540),TWEEN_LOOP:n(67233),TWEEN_PAUSE:n(2859),TWEEN_RESUME:n(25764),TWEEN_REPEAT:n(98336),TWEEN_START:n(32193),TWEEN_STOP:n(84371),TWEEN_UPDATE:n(70766),TWEEN_YOYO:n(55659)}}),43066:((e,t,n)=>{e.exports={States:n(86353),Builders:n(30231),Events:n(842),TweenManager:n(40382),Tween:n(86081),TweenData:n(48177),TweenFrameData:n(42220),BaseTween:n(70402),TweenChain:n(43960)}}),70402:((e,t,n)=>{var r=n(83419),i=n(50792),a=n(842),o=n(86353),s=new r({Extends:i,initialize:function(e){i.call(this),this.parent=e,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=o.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(e){return this.timeScale=e,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(a.TWEEN_PAUSE,`onPause`)),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(a.TWEEN_RESUME,`onResume`)),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(a.TWEEN_COMPLETE,`onComplete`)},complete:function(e){return e===void 0&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return e===void 0&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(a.TWEEN_STOP,`onStop`),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(a.TWEEN_START,`onStart`),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,t,n){return n===void 0&&(n=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:t,params:n}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});s.TYPES=[`onActive`,`onComplete`,`onLoop`,`onPause`,`onRepeat`,`onResume`,`onStart`,`onStop`,`onUpdate`,`onYoyo`],e.exports=s}),95042:((e,t,n)=>{var r=n(83419),i=n(842),a=n(86353);e.exports=new r({initialize:function(e,t,n,r,i,a,o,s,c,l){this.tween=e,this.targetIndex=t,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=n,this.yoyo=i,this.hold=a,this.repeat=o,this.repeatDelay=s,this.repeatCounter=0,this.flipX=c,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(e){e===void 0&&(e=this.current),this.tween.targets[this.targetIndex][this.key]=e},setCreatedState:function(){this.state=a.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=a.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=a.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=a.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=a.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=a.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=a.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=a.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===a.CREATED},isDelayed:function(){return this.state===a.DELAY},isPendingRender:function(){return this.state===a.PENDING_RENDER},isPlayingForward:function(){return this.state===a.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===a.PLAYING_BACKWARD},isHolding:function(){return this.state===a.HOLD_DELAY},isRepeating:function(){return this.state===a.REPEAT_DELAY},isComplete:function(){return this.state===a.COMPLETE},setStateFromEnd:function(e){this.yoyo?this.onRepeat(e,!0,!0):this.repeatCounter>0?this.onRepeat(e,!0,!1):this.setCompleteState()},setStateFromStart:function(e){this.repeatCounter>0?this.onRepeat(e,!1):this.setCompleteState()},reset:function(){var e=this.tween,t=e.totalTargets,n=this.targetIndex,r=e.targets[n],i=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,i,0,n,t,e),this.repeatCounter=this.repeat===-1?a.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var s=o+this.repeatDelay;this.totalDuration=this.delay+o,this.repeat===-1?(this.totalDuration+=s*a.MAX,e.isInfinite=!0):this.repeat>0&&(this.totalDuration+=s*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(e,t,n){var r=this.tween,a=r.totalTargets,o=this.targetIndex,s=r.targets[o],c=this.key,l=c!==`texture`;if(this.elapsed=e,this.progress=e/this.duration,this.flipX&&s.toggleFlipX(),this.flipY&&s.toggleFlipY(),l&&(t||n)&&(this.start=this.getStartValue(s,c,this.start,o,a,r)),n){this.setPlayingBackwardState(),this.dispatchEvent(i.TWEEN_YOYO,`onYoyo`);return}this.repeatCounter--,l&&(this.end=this.getEndValue(s,c,this.start,o,a,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-e,l&&(this.current=this.start,s[c]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(i.TWEEN_REPEAT,`onRepeat`))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}})}),69902:(e=>{e.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:(e=>{e.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`.split(`.`)}),86081:((e,t,n)=>{var r=n(70402),i=n(83419),a=n(842),o=n(44603),s=n(39429),c=n(36383),l=n(86353),u=n(48177),d=n(42220),f=new i({Extends:r,initialize:function(e,t){r.call(this,e),this.targets=t,this.totalTargets=t.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(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g){var _=new u(this,e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g);return this.totalData=this.data.push(_),_},addFrame:function(e,t,n,r,i,a,o,s,c,l){var u=new d(this,e,t,n,r,i,a,o,s,c,l);return this.totalData=this.data.push(u),u},getValue:function(e){e===void 0&&(e=0);var t=null;return this.data&&(t=this.data[e].current),t},hasTarget:function(e){return this.targets&&this.targets.indexOf(e)!==-1},updateTo:function(e,t,n){if(n===void 0&&(n=!1),e!==`texture`)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.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(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=16.6),n===void 0&&(n=!1),this.isDestroyed())return console.warn(`Cannot seek destroyed Tween`,this),this;n||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`);var r=this.paused;if(this.paused=!1,e>0){for(var i=Math.floor(e/t),o=e-i*t,s=0;s0&&this.update(o)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(e){e===void 0&&(e=!1),this.duration=0,this.startDelay=c.MAX_SAFE_INTEGER;for(var t=this.data,n=0;n0?this.totalDuration=r+i+(r+o)*a:this.totalDuration=r+i},reset:function(e){return e===void 0&&(e=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=l.MAX),e||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)),this},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return this.persist?(this.setFinishedState(),!1):!0;if(this.paused||this.isFinished())return!1;if(e*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,`onStart`),e=0));var t=!1;if(this.isActive())for(var n=this.data,r=0;r{var r=n(72905),i=n(70402),a=n(83419),o=n(842),s=n(44603),c=n(39429),l=n(86353),u=new a({Extends:i,initialize:function(e){i.call(this,e),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(e){var t=this.parent.create(e);Array.isArray(t)||(t=[t]);for(var n=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;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 e=this.data,t=this.totalData,n=0;n{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g,_){r.call(this,e,t,c,l,u,d,f,p,m,h),this.key=n,this.getActiveValue=o,this.getEndValue=i,this.getStartValue=a,this.ease=s,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=_},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex],n=this.key;e&&(t[n]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(t[n]=this.getActiveValue(t,n,0))},update:function(e){var t=this.tween,n=t.totalTargets,r=this.targetIndex,a=t.targets[r],s=this.key;if(!a)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(a,s,a[s],r,n,t),this.end=this.getEndValue(a,s,this.start,r,n,t),this.current=this.start,a[s]=this.start,this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),l=this.isPlayingBackward();if(c||l){var u=this.elapsed,d=this.duration,f=0,p=!1;u+=e,u>=d?(f=u-d,u=d,p=!0):u<0&&(u=0);var m=i(u/d,0,1);this.elapsed=u,this.progress=m,this.previous=this.current,c||(m=1-m);var h=this.ease(m);this.interpolation?this.current=this.interpolation(this.interpolationData,h):this.current=this.start+(this.end-this.start)*h,a[s]=this.current,p&&(c?(t.isNumberTween&&(this.current=this.end,a[s]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(f)):(t.isNumberTween&&(this.current=this.start,a[s]=this.current),this.setStateFromStart(f))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key,a=this.current,o=this.previous;n.emit(e,n,i,r,a,o);var s=n.callbacks[t];s&&s.func.apply(n.callbackScope,[n,r,i,a,o].concat(s.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}})}),42220:((e,t,n)=>{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d){r.call(this,e,t,a,o,!1,s,c,l,u,d),this.key=`texture`,this.startTexture=null,this.endTexture=n,this.startFrame=null,this.endFrame=i,this.yoyo=c!==0},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=t.texture.key,this.startFrame=t.frame.name),e&&t.setTexture(this.startTexture,this.startFrame)},update:function(e){var t=this.tween,n=this.targetIndex,r=t.targets[n];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),s=this.isPlayingBackward();if(a||s){var c=this.elapsed,l=this.duration,u=0,d=!1;c+=e,c>=l?(u=c-l,c=l,d=!0):c<0&&(c=0);var f=i(c/l,0,1);this.elapsed=c,this.progress=f,d&&(a?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key;n.emit(e,n,i,r);var a=n.callbacks[t];a&&a.func.apply(n.callbackScope,[n,r,i].concat(a.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}})}),86353:(e=>{e.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:(e=>{function t(e){return!!e.get&&typeof e.get==`function`||!!e.set&&typeof e.set==`function`}function n(e,n,r){var i=r?e[n]:Object.getOwnPropertyDescriptor(e,n);return!r&&i.value&&typeof i.value==`object`&&(i=i.value),i&&t(i)?(i.enumerable===void 0&&(i.enumerable=!0),i.configurable===void 0&&(i.configurable=!0),i):!1}function r(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return n?(n.value&&typeof n.value==`object`&&(n=n.value),n.configurable===!1):!1}function i(e,t,i,a){for(var s in t)if(t.hasOwnProperty(s)){var c=n(t,s,i);if(c!==!1){if(r((a||e).prototype,s)){if(o.ignoreFinals)continue;throw Error(`cannot override final property '`+s+`', set Class.ignoreFinals = true to skip`)}Object.defineProperty(e.prototype,s,c)}else e.prototype[s]=t[s]}}function a(e,t){if(t){Array.isArray(t)||(t=[t]);for(var n=0;n{e.exports=function(){}}),20242:(e=>{e.exports=function(){return null}}),71146:(e=>{e.exports=function(e,t,n,r,i){if(i===void 0&&(i=e),n>0){var a=n-e.length;if(a<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.push(t),r&&r.call(i,t),t):null;for(var o=t.length-1;o>=0;)e.indexOf(t[o])!==-1&&t.splice(o,1),o--;if(o=t.length,o===0)return null;n>0&&o>a&&(t.splice(a),o=a);for(var s=0;s{e.exports=function(e,t,n,r,i,a){if(n===void 0&&(n=0),a===void 0&&(a=e),r>0){var o=r-e.length;if(o<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.splice(n,0,t),i&&i.call(a,t),t):null;for(var s=t.length-1;s>=0;)e.indexOf(t[s])!==-1&&t.pop(),s--;if(s=t.length,s===0)return null;r>0&&s>o&&(t.splice(o),s=o);for(var c=s-1;c>=0;c--){var l=t[c];e.splice(n,0,l),i&&i.call(a,l)}return t}}),66905:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=0;if(r(e,i,a))for(var s=i;s{e.exports=function(e,t,n){var r,i=[null];for(r=3;r{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a)){var o,s=[null];for(o=5;o{e.exports=function(e,t,n){if(!t.length)return NaN;if(t.length===1)return t[0];var r=1,i,a;if(n){if(et.length&&(r=t.length),n?(i=t[r-1][n],a=t[r][n],a-e<=e-i?t[r]:t[r-1]):(i=t[r-1],a=t[r],a-e<=e-i?a:i)}}),43491:(e=>{var t=function(e,n){n===void 0&&(n=[]);for(var r=0;r{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=[];if(r(e,i,a))for(var s=i;s{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),i!==-1){if(r(e,i,a))for(var o=i;o=0;o--){var s=e[o];if(!t||t&&n===void 0&&s.hasOwnProperty(t)||t&&n!==void 0&&s[t]===n)return s}return null}}),26546:(e=>{e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=e.length);var r=t+Math.floor(Math.random()*n);return e[r]===void 0?null:e[r]}}),85835:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r>i?e:(e.splice(r,1),i=e.indexOf(n),e.splice(i+1,0,t),e)}}),83371:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r{e.exports=function(e,t){var n=e.indexOf(t);if(n>0){var r=e[n-1],i=e.indexOf(r);e[n]=r,e[i]=t}return e}}),69693:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t);if(r===-1||n<0||n>=e.length)throw Error(`Supplied index out of bounds`);return r!==n&&(e.splice(r,1),e.splice(n,0,t)),t}}),40853:(e=>{e.exports=function(e,t){var n=e.indexOf(t);if(n!==-1&&n{e.exports=function(e,t,n,r){var i=[],a,o=!1;if((n||r)&&(o=!0,n||=``,r||=``),t=t;a--)o?i.push(n+a.toString()+r):i.push(a);else for(a=e;a<=t;a++)o?i.push(n+a.toString()+r):i.push(a);return i}}),593:((e,t,n)=>{var r=n(2284);e.exports=function(e,t,n){e===void 0&&(e=0),t===void 0&&(t=null),n===void 0&&(n=1),t===null&&(t=e,e=0);for(var i=[],a=Math.max(r((t-e)/(n||1)),0),o=0;o{function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e,i,a,o,s){for(a===void 0&&(a=0),o===void 0&&(o=e.length-1),s===void 0&&(s=n);o>a;){if(o-a>600){var c=o-a+1,l=i-a+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(l-c/2<0?-1:1);r(e,i,Math.max(a,Math.floor(i-l*d/c+f)),Math.min(o,Math.floor(i+(c-l)*d/c+f)),s)}var p=e[i],m=a,h=o;for(t(e,a,i),s(e[o],p)>0&&t(e,a,o);m0;)h--}s(e[a],p)===0?t(e,a,h):(h++,t(e,h,o)),h<=i&&(a=h+1),i<=h&&(o=h-1)}};e.exports=r}),88492:((e,t,n)=>{var r=n(35154),i=n(33680),a=function(e,t,n){for(var r=[],i=0;i{var r=n(19133);e.exports=function(e,t,n,i){i===void 0&&(i=e);var a;if(!Array.isArray(t))return a=e.indexOf(t),a===-1?null:(r(e,a),n&&n.call(i,t),t);for(var o=t.length-1,s=[];o>=0;){var c=t[o];a=e.indexOf(c),a!==-1&&(r(e,a),s.push(c),n&&n.call(i,c)),o--}return s}}),60248:((e,t,n)=>{var r=n(19133);e.exports=function(e,t,n,i){if(i===void 0&&(i=e),t<0||t>e.length-1)throw Error(`Index out of bounds`);var a=r(e,t);return n&&n.call(i,a),a}}),81409:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(t===void 0&&(t=0),n===void 0&&(n=e.length),a===void 0&&(a=e),r(e,t,n)){var o=n-t,s=e.splice(t,o);if(i)for(var c=0;c{var r=n(19133);e.exports=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.length),r(e,t+Math.floor(Math.random()*n))}}),42169:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t),i=e.indexOf(n);return r!==-1&&i===-1?(e[r]=n,!0):!1}}),86003:(e=>{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t,n,r){var i=e.length;if(t<0||t>=i||t>=n||n>i){if(r)throw Error(`Range Error: Values outside acceptable range`);return!1}else return!0}}),89545:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n>0&&(e.splice(n,1),e.unshift(t)),t}}),17810:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a))for(var o=i;o{e.exports=function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}}),90126:(e=>{e.exports=function(e){var t=/\D/g;return e.sort(function(e,n){return parseInt(e.replace(t,``),10)-parseInt(n.replace(t,``),10)}),e}}),19133:(e=>{e.exports=function(e,t){if(!(t>=e.length)){for(var n=e.length-1,r=e[t],i=t;i{var r=n(82264);function i(e,t){return String(e).localeCompare(t)}function a(e,t){var n=e.length;if(n<=1)return e;for(var r=Array(n),i=1;ii&&(c=i),l>i&&(l=i),u=s,d=c;;)if(u{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return e[r]=n,e[i]=t,e}}),37105:((e,t,n)=>{e.exports={Matrix:n(54915),Add:n(71146),AddAt:n(51067),BringToTop:n(66905),CountAllMatching:n(21612),Each:n(95428),EachInRange:n(36914),FindClosestInSorted:n(81957),Flatten:n(43491),GetAll:n(46710),GetFirst:n(58731),GetRandom:n(26546),MoveDown:n(70864),MoveTo:n(69693),MoveUp:n(40853),MoveAbove:n(85835),MoveBelow:n(83371),NumberArray:n(20283),NumberArrayStep:n(593),QuickSelect:n(43886),Range:n(88492),Remove:n(72905),RemoveAt:n(60248),RemoveBetween:n(81409),RemoveRandomElement:n(31856),Replace:n(42169),RotateLeft:n(86003),RotateRight:n(49498),SafeRange:n(82011),SendToBack:n(89545),SetAll:n(17810),Shuffle:n(33680),SortByDigits:n(90126),SpliceOne:n(19133),StableSort:n(19186),Swap:n(25630)}}),86922:(e=>{e.exports=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var t=e[0].length,n=1;n{var r=n(41836),i=n(86922);e.exports=function(e){var t=``;if(!i(e))return t;for(var n=0;n{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),Mt=H(),Nt=H(),Pt=H();H();function Ft(){let e=U(Pt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function It(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Lt(e,t,n){Ue(),F(()=>{e.update(t,n)}),We()}function Rt(e,t){return new Promise(n=>{let r=It(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Lt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:jt.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new jt.default.Game(o)})}function zt(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&Rt(r,e).then(t=>{n(t),Ee(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=bt(()=>he(Mt.Provider,{value:t.game,get children(){return he(Nt.Provider,{value:t.scene,get children(){return he(Pt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),L(()=>{let e=I(t);i&&i(),e&&(De(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}function Bt(e){return L(Ft().register(e.onUpdate)),null}var Vt=10;function Ht(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Ht(r,t,n);return}if(typeof e==`function`){if(n>=Vt)return;Ht(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Me(e))){let r=je(e);for(let e of r.children)Ht(e,t,n)}}}function Ut(e){let t=e.children;return M(()=>{Ht(t,!!e.when)}),t}function Wt(e){let t=e.each.map((t,n)=>e.children(t,n));return N(()=>{let n=e.each.length;for(let e=0;ej(!0)),h=P(()=>m.filter(([e])=>e()).length),g=()=>{let e=-Math.PI/2+(Math.random()-.5)*.8;f=Math.cos(e)*Xt,p=Math.sin(e)*Xt,a(`play`)},_=()=>{l(o()),d(Yt-$-2),f=p=0},v=()=>{F(()=>{t(0),r(3),a(`ready`),_();for(let[,e]of m)e(!0)})},y=()=>{let t=i();return{ready:[`BREAKOUT`,`#7fdbca`,`click to launch`],miss:[`MISS!`,`#f07167`,`click to continue`],over:[`GAME OVER`,`#f07167`,`final score: ${e()} — click to restart`],win:[`YOU WIN!`,`#4ade80`,`score: ${e()} — click to play again`]}[t]},b=e=>{let t=jt.default.Math.Clamp(e.x,qt/2+4,Gt-qt/2-4);s(t),(i()===`ready`||i()===`miss`)&&l(t)},x=()=>{let e=i();e===`ready`||e===`miss`?g():(e===`over`||e===`win`)&&v()},S=0,C=()=>{qe({phase:i(),score:e(),lives:n(),alive:h(),bx:c(),by:u()})},w=(e,s)=>{if(S-=s,S<=0&&(S=200,C()),i()!==`play`)return;let g=Math.min(s/1e3,.033),v=c()+f*g,y=u()+p*g;v-$<=4&&(v=4+$,f=Math.abs(f)),v+$>=Gt-4&&(v=Gt-4-$,f=-Math.abs(f)),y-$<=4&&(y=4+$,p=Math.abs(p));let b=o();if(p>0&&y+$>=Yt-Jt/2&&y-$<=Yt+Jt/2&&v>=b-qt/2&&v<=b+qt/2){y=Yt-Jt/2-$;let e=(v-b)/(qt/2),t=-Math.PI/2+e*.6,n=Math.sqrt(f*f+p*p);f=Math.cos(t)*n,p=Math.sin(t)*n}let x=!1;for(let e=0;ea-$t/2&&v-$o-en/2&&y-$t+on[e]),x=!0}}if(y>Kt+20){let e=n()-1;F(e<=0?()=>{r(0),a(`over`),_()}:()=>{r(e),a(`miss`),_()});return}if(h()===0){F(()=>{a(`win`),_()});return}F(()=>{l(v),d(y)})};return Ct(zt,{width:Gt,height:Kt,backgroundColor:988969,parent:`game-container`,onPointerMove:b,onPointerDown:x,get children(){return[Ct(Bt,{onUpdate:w}),(()=>{var e=wt(`rectangle`);return Q(e,`x`,320),Q(e,`y`,240),Q(e,`width`,640),Q(e,`height`,480),Q(e,`fillColor`,988969),Q(e,`origin`,.5),Q(e,`depth`,0),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`x`,320),Q(e,`y`,0),Q(e,`width`,640),Q(e,`height`,4),Q(e,`fillColor`,1981023),Q(e,`origin`,.5),Q(e,`depth`,1),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`x`,0),Q(e,`y`,240),Q(e,`width`,4),Q(e,`height`,480),Q(e,`fillColor`,1981023),Q(e,`origin`,.5),Q(e,`depth`,1),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`x`,640),Q(e,`y`,240),Q(e,`width`,4),Q(e,`height`,480),Q(e,`fillColor`,1981023),Q(e,`origin`,.5),Q(e,`depth`,1),e})(),Ct(Wt,{each:m,children:([e],t)=>{let n=Math.floor(t/Zt),r=nn+t%Zt*($t+tn)+$t/2,i=rn+n*(en+tn)+en/2;return(()=>{var t=wt(`rectangle`);return Q(t,`x`,r),Q(t,`y`,i),Q(t,`width`,54),Q(t,`height`,18),Q(t,`origin`,.5),Q(t,`depth`,2),xt(r=>{var i=an[n],a=e();return i!==r.e&&(r.e=Q(t,`fillColor`,i,r.e)),a!==r.t&&(r.t=Q(t,`visible`,a,r.t)),r},{e:void 0,t:void 0}),t})()}}),(()=>{var e=wt(`rectangle`);return Q(e,`y`,440),Q(e,`width`,100),Q(e,`height`,14),Q(e,`fillColor`,15790320),Q(e,`origin`,.5),Q(e,`depth`,3),xt(t=>Q(e,`x`,o(),t)),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`width`,10),Q(e,`height`,10),Q(e,`fillColor`,16777215),Q(e,`origin`,.5),Q(e,`depth`,4),xt(t=>{var n=c(),r=u();return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var t=wt(`text`);return Q(t,`x`,16),Q(t,`y`,460),Q(t,`fontSize`,16),Q(t,`fontFamily`,`monospace`),Q(t,`color`,`#7fdbca`),Q(t,`originX`,0),Q(t,`originY`,.5),Q(t,`depth`,5),xt(n=>Q(t,`text`,`SCORE ${e()}`,n)),t})(),(()=>{var e=wt(`text`);return Q(e,`x`,624),Q(e,`y`,460),Q(e,`fontSize`,16),Q(e,`fontFamily`,`monospace`),Q(e,`color`,`#f07167`),Q(e,`originX`,1),Q(e,`originY`,.5),Q(e,`depth`,5),xt(t=>Q(e,`text`,`♥`.repeat(n())+`♡`.repeat(Math.max(0,3-n())),t)),e})(),Ct(Ut,{get when(){return i()!==`play`},get children(){return[(()=>{var e=wt(`text`);return Q(e,`x`,320),Q(e,`y`,240),Q(e,`fontSize`,24),Q(e,`fontFamily`,`monospace`),Q(e,`origin`,.5),Q(e,`depth`,10),xt(t=>{var n=y()?y()[0]:``,r=y()?y()[1]:`#ffffff`;return n!==t.e&&(t.e=Q(e,`text`,n,t.e)),r!==t.t&&(t.t=Q(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=wt(`text`);return Q(e,`x`,320),Q(e,`y`,276),Q(e,`fontSize`,14),Q(e,`fontFamily`,`monospace`),Q(e,`color`,`#666666`),Q(e,`origin`,.5),Q(e,`depth`,10),xt(t=>Q(e,`text`,y()?y()[2]:``,t)),e})()]}})]}})}A(()=>{let e=sn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file +`}}return t}}),92598:(e=>{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),Mt=H(),Nt=H(),Pt=H();H();function Ft(){let e=U(Pt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function It(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Lt(e,t,n){Ue(),F(()=>{e.update(t,n)}),We()}function Rt(e,t){return new Promise(n=>{let r=It(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Lt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:jt.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new jt.default.Game(o)})}function zt(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&Rt(r,e).then(t=>{n(t),Ee(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=bt(()=>he(Mt.Provider,{value:t.game,get children(){return he(Nt.Provider,{value:t.scene,get children(){return he(Pt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),L(()=>{let e=I(t);i&&i(),e&&(De(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}var Bt=10;function Vt(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Vt(r,t,n);return}if(typeof e==`function`){if(n>=Bt)return;Vt(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Me(e))){let r=je(e);for(let e of r.children)Vt(e,t,n)}}}function Ht(e){return L(Ft().register(e.onUpdate)),null}function Ut(e){let t=e.children;return M(()=>{Vt(t,!!e.when)}),t}function Wt(e){let t=e.each.map((t,n)=>e.children(t,n));return N(()=>{let n=e.each.length;for(let e=0;ej(!0)),h=P(()=>m.filter(([e])=>e()).length),g=()=>{let e=-Math.PI/2+(Math.random()-.5)*.8;f=Math.cos(e)*Xt,p=Math.sin(e)*Xt,a(`play`)},_=()=>{l(o()),d(Yt-$-2),f=p=0},v=()=>{F(()=>{t(0),r(3),a(`ready`),_();for(let[,e]of m)e(!0)})},y=()=>{let t=i();return{ready:[`BREAKOUT`,`#7fdbca`,`click to launch`],miss:[`MISS!`,`#f07167`,`click to continue`],over:[`GAME OVER`,`#f07167`,`final score: ${e()} — click to restart`],win:[`YOU WIN!`,`#4ade80`,`score: ${e()} — click to play again`]}[t]},b=e=>{let t=jt.default.Math.Clamp(e.x,qt/2+4,Gt-qt/2-4);s(t),(i()===`ready`||i()===`miss`)&&l(t)},x=()=>{let e=i();e===`ready`||e===`miss`?g():(e===`over`||e===`win`)&&v()},S=0,C=()=>{qe({phase:i(),score:e(),lives:n(),alive:h(),bx:c(),by:u()})},w=(e,s)=>{if(S-=s,S<=0&&(S=200,C()),i()!==`play`)return;let g=Math.min(s/1e3,.033),v=c()+f*g,y=u()+p*g;v-$<=4&&(v=4+$,f=Math.abs(f)),v+$>=Gt-4&&(v=Gt-4-$,f=-Math.abs(f)),y-$<=4&&(y=4+$,p=Math.abs(p));let b=o();if(p>0&&y+$>=Yt-Jt/2&&y-$<=Yt+Jt/2&&v>=b-qt/2&&v<=b+qt/2){y=Yt-Jt/2-$;let e=(v-b)/(qt/2),t=-Math.PI/2+e*.6,n=Math.sqrt(f*f+p*p);f=Math.cos(t)*n,p=Math.sin(t)*n}let x=!1;for(let e=0;ea-$t/2&&v-$o-en/2&&y-$t+on[e]),x=!0}}if(y>Kt+20){let e=n()-1;F(e<=0?()=>{r(0),a(`over`),_()}:()=>{r(e),a(`miss`),_()});return}if(h()===0){F(()=>{a(`win`),_()});return}F(()=>{l(v),d(y)})};return Ct(zt,{width:Gt,height:Kt,backgroundColor:988969,parent:`game-container`,onPointerMove:b,onPointerDown:x,get children(){return[Ct(Ht,{onUpdate:w}),(()=>{var e=wt(`rectangle`);return Q(e,`x`,320),Q(e,`y`,240),Q(e,`width`,640),Q(e,`height`,480),Q(e,`fillColor`,988969),Q(e,`origin`,.5),Q(e,`depth`,0),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`x`,320),Q(e,`y`,0),Q(e,`width`,640),Q(e,`height`,4),Q(e,`fillColor`,1981023),Q(e,`origin`,.5),Q(e,`depth`,1),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`x`,0),Q(e,`y`,240),Q(e,`width`,4),Q(e,`height`,480),Q(e,`fillColor`,1981023),Q(e,`origin`,.5),Q(e,`depth`,1),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`x`,640),Q(e,`y`,240),Q(e,`width`,4),Q(e,`height`,480),Q(e,`fillColor`,1981023),Q(e,`origin`,.5),Q(e,`depth`,1),e})(),Ct(Wt,{each:m,children:([e],t)=>{let n=Math.floor(t/Zt),r=nn+t%Zt*($t+tn)+$t/2,i=rn+n*(en+tn)+en/2;return(()=>{var t=wt(`rectangle`);return Q(t,`x`,r),Q(t,`y`,i),Q(t,`width`,54),Q(t,`height`,18),Q(t,`origin`,.5),Q(t,`depth`,2),xt(r=>{var i=an[n],a=e();return i!==r.e&&(r.e=Q(t,`fillColor`,i,r.e)),a!==r.t&&(r.t=Q(t,`visible`,a,r.t)),r},{e:void 0,t:void 0}),t})()}}),(()=>{var e=wt(`rectangle`);return Q(e,`y`,440),Q(e,`width`,100),Q(e,`height`,14),Q(e,`fillColor`,15790320),Q(e,`origin`,.5),Q(e,`depth`,3),xt(t=>Q(e,`x`,o(),t)),e})(),(()=>{var e=wt(`rectangle`);return Q(e,`width`,10),Q(e,`height`,10),Q(e,`fillColor`,16777215),Q(e,`origin`,.5),Q(e,`depth`,4),xt(t=>{var n=c(),r=u();return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`y`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var t=wt(`text`);return Q(t,`x`,16),Q(t,`y`,460),Q(t,`fontSize`,16),Q(t,`fontFamily`,`monospace`),Q(t,`color`,`#7fdbca`),Q(t,`originX`,0),Q(t,`originY`,.5),Q(t,`depth`,5),xt(n=>Q(t,`text`,`SCORE ${e()}`,n)),t})(),(()=>{var e=wt(`text`);return Q(e,`x`,624),Q(e,`y`,460),Q(e,`fontSize`,16),Q(e,`fontFamily`,`monospace`),Q(e,`color`,`#f07167`),Q(e,`originX`,1),Q(e,`originY`,.5),Q(e,`depth`,5),xt(t=>Q(e,`text`,`♥`.repeat(n())+`♡`.repeat(Math.max(0,3-n())),t)),e})(),Ct(Ut,{get when(){return i()!==`play`},get children(){return[(()=>{var e=wt(`text`);return Q(e,`x`,320),Q(e,`y`,240),Q(e,`fontSize`,24),Q(e,`fontFamily`,`monospace`),Q(e,`origin`,.5),Q(e,`depth`,10),xt(t=>{var n=y()?y()[0]:``,r=y()?y()[1]:`#ffffff`;return n!==t.e&&(t.e=Q(e,`text`,n,t.e)),r!==t.t&&(t.t=Q(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=wt(`text`);return Q(e,`x`,320),Q(e,`y`,276),Q(e,`fontSize`,14),Q(e,`fontFamily`,`monospace`),Q(e,`color`,`#666666`),Q(e,`origin`,.5),Q(e,`depth`,10),xt(t=>Q(e,`text`,y()?y()[2]:``,t)),e})()]}})]}})}A(()=>{let e=sn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file diff --git a/examples/breakout/dist/index.html b/examples/breakout/dist/index.html index 19ea5a7..1371181 100644 --- a/examples/breakout/dist/index.html +++ b/examples/breakout/dist/index.html @@ -35,7 +35,7 @@ } .footer a { color: #7fdbca; text-decoration: none; } - +
diff --git a/examples/breakout/vite.config.ts b/examples/breakout/vite.config.ts index 0ef0663..dc4cb38 100644 --- a/examples/breakout/vite.config.ts +++ b/examples/breakout/vite.config.ts @@ -18,6 +18,7 @@ export default defineConfig({ "solidion/ecs": resolve(__dirname, "../../src/ecs/index.ts"), "solidion/core": resolve(__dirname, "../../src/core/index.ts"), "solidion/debug": resolve(__dirname, "../../src/debug/index.ts"), + "solidion/renderer": resolve(__dirname, "../../src/renderer.ts"), "solidion": resolve(__dirname, "../../src/index.ts"), "solid-js/universal": resolve(rootModules, "solid-js/universal/dist/universal.js"), "solid-js": resolve(rootModules, "solid-js/dist/solid.js"), diff --git a/examples/floppy-heads/dist/assets/index-BQY7vmBW.js b/examples/floppy-heads/dist/assets/index-BTNBT8dr.js similarity index 99% rename from examples/floppy-heads/dist/assets/index-BQY7vmBW.js rename to examples/floppy-heads/dist/assets/index-BTNBT8dr.js index a87e263..f36d5a3 100644 --- a/examples/floppy-heads/dist/assets/index-BQY7vmBW.js +++ b/examples/floppy-heads/dist/assets/index-BTNBT8dr.js @@ -65,4 +65,4 @@ return new `+this.key+`(); `),s=/^[ ]*(- )*(\w+)+[: ]+(.*)/,c=``,l=``,u={x:0,y:0,width:0,height:0},d=0;d{var r=n(50030),i=function(e){for(var t=e.mipmaps,n=1;n{e.exports={AtlasXML:n(89905),Canvas:n(72893),Image:n(4832),JSONArray:n(78566),JSONHash:n(39711),KTXParser:n(31403),PVRParser:n(82038),SpriteSheet:n(75549),SpriteSheetFromAtlas:n(47534),UnityYAML:n(86147)}}),80341:(e=>{e.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}}),16536:((e,t,n)=>{e.exports=new(n(83419))({initialize:function(e,t,n,r,i,a,o){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),i===void 0&&(i=0),a===void 0&&(a=0),this.name=e,this.firstgid=t|0,this.imageWidth=n|0,this.imageHeight=r|0,this.imageMargin=i|0,this.imageSpacing=a|0,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(e){return e>=this.firstgid&&e{e.exports=new(n(83419))({initialize:function(e){if(this.gids=[],e!==void 0)for(var t=0;t{var r=n(80341),i=n(87010),a=n(46177),o=n(49075);e.exports=function(e,t,n,s,c,l,u,d){n===void 0&&(n=32),s===void 0&&(s=32),c===void 0&&(c=10),l===void 0&&(l=10),d===void 0&&(d=!1);var f=null;if(Array.isArray(u))f=a(t===void 0?`map`:t,r.ARRAY_2D,u,n,s,d);else if(t!==void 0){var p=e.cache.tilemap.get(t);p?f=a(t,p.format,p.data,n,s,d):console.warn(`No map data found for key `+t)}return f===null&&(f=new i({tileWidth:n,tileHeight:s,width:c,height:l})),new o(e,f)}}),23029:((e,t,n)=>{var r=n(83419),i=n(31401),a=n(91907),o=n(62644),s=n(93232);e.exports=new r({Mixins:[i.AlphaSingle,i.Flip,i.Visible],initialize:function(e,t,n,r,i,a,o,s){this.layer=e,this.index=t,this.x=n,this.y=r,this.width=i,this.height=a,this.right,this.bottom,this.baseWidth=o===void 0?i:o,this.baseHeight=s===void 0?a:s,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(e,t){return!(ethis.right||t>this.bottom)},copy:function(e){return this.index=e.index,this.alpha=e.alpha,this.properties=o(e.properties),this.visible=e.visible,this.setFlip(e.flipX,e.flipY),this.tint=e.tint,this.rotation=e.rotation,this.collideUp=e.collideUp,this.collideDown=e.collideDown,this.collideLeft=e.collideLeft,this.collideRight=e.collideRight,this.collisionCallback=e.collisionCallback,this.collisionCallbackContext=e.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(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).x:this.x*this.baseWidth},getRight:function(e){var t=this.tilemapLayer;return t?this.getLeft(e)+this.width*t.scaleX:this.getLeft(e)+this.width},getTop:function(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(e){var t=this.tilemapLayer;return t?this.getTop(e)+this.height*t.scaleY:this.getTop(e)+this.height},getBounds:function(e,t){return t===void 0&&(t=new s),t.x=this.getLeft(e),t.y=this.getTop(e),t.width=this.getRight(e)-t.x,t.height=this.getBottom(e)-t.y,t},getCenterX:function(e){return(this.getLeft(e)+this.getRight(e))/2},getCenterY:function(e){return(this.getTop(e)+this.getBottom(e))/2},intersects:function(e,t,n,r){return!(n<=this.pixelX||r<=this.pixelY||e>=this.right||t>=this.bottom)},isInteresting:function(e,t){return e&&t?this.canCollide||this.hasInterestingFace:e?this.collides:t?this.hasInterestingFace:!1},resetCollision:function(e){return e===void 0&&(e=!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,e&&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(e,t,n,r,i){return t===void 0&&(t=e),n===void 0&&(n=e),r===void 0&&(r=e),i===void 0&&(i=!0),this.collideLeft=e,this.collideRight=t,this.collideUp=n,this.collideDown=r,this.faceLeft=e,this.faceRight=t,this.faceTop=n,this.faceBottom=r,i&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(e,t){return e===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=e,this.collisionCallbackContext=t),this},setSize:function(e,t,n,r){return e!==void 0&&(this.width=e),t!==void 0&&(this.height=t),n!==void 0&&(this.baseWidth=n),r!==void 0&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var e=this.layer.orientation;if(e===a.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(e===a.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(e===a.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(e===a.HEXAGONAL){var t=this.layer.staggerAxis,n=this.layer.staggerIndex,r=this.layer.hexSideLength,i,o;t===`y`?(o=(this.baseHeight-r)/2+r,n===`odd`?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*o):t===`x`&&(i=(this.baseWidth-r)/2+r,this.pixelX=this.x*i,n===`odd`?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=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||this.collisionCallback!==void 0}},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 e=this.layer.tilemapLayer;if(e){var t=e.gidMap[this.index];if(t)return t}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var e=this.tilemapLayer;return e?e.tilemap:null}}})}),49075:((e,t,n)=>{var r=n(84101),i=n(83419),a=n(39506),o=n(80341),s=n(95540),c=n(14977),l=n(27462),u=n(91907),d=n(36305),f=n(19133),p=n(68287),m=n(23029),h=n(81086),g=n(20442),_=n(33629);e.exports=new i({initialize:function(e,t){this.scene=e,this.tileWidth=t.tileWidth,this.tileHeight=t.tileHeight,this.width=t.width,this.height=t.height,this.orientation=t.orientation,this.renderOrder=t.renderOrder,this.format=t.format,this.version=t.version,this.properties=t.properties,this.widthInPixels=t.widthInPixels,this.heightInPixels=t.heightInPixels,this.imageCollections=t.imageCollections,this.images=t.images,this.layers=t.layers,this.tiles=t.tiles,this.tilesets=t.tilesets,this.objects=t.objects,this.currentLayerIndex=0,this.hexSideLength=t.hexSideLength;var n=this.orientation;this._convert={WorldToTileXY:h.GetWorldToTileXYFunction(n),WorldToTileX:h.GetWorldToTileXFunction(n),WorldToTileY:h.GetWorldToTileYFunction(n),TileToWorldXY:h.GetTileToWorldXYFunction(n),TileToWorldX:h.GetTileToWorldXFunction(n),TileToWorldY:h.GetTileToWorldYFunction(n),GetTileCorners:h.GetTileCornersFunction(n)}},setRenderOrder:function(e){var t=[`right-down`,`left-down`,`right-up`,`left-up`];return typeof e==`number`&&(e=t[e]),t.indexOf(e)>-1&&(this.renderOrder=e),this},addTilesetImage:function(e,t,n,i,a,s,c,l){if(e===void 0)return null;t??=e;var u=this.scene.sys.textures;if(!u.exists(t))return console.warn(`Texture key "%s" not found`,t),null;var d=u.get(t),f=this.getTilesetIndex(e);if(f===null&&this.format===o.TILED_JSON)return console.warn(`Tilemap has no tileset "%s". Its tilesets are %o`,e,this.tilesets),null;var p=this.tilesets[f];return p?((n||i)&&p.setTileSize(n,i),(a||s)&&p.setSpacing(a,s),p.setImage(d),p):(n===void 0&&(n=this.tileWidth),i===void 0&&(i=this.tileHeight),a===void 0&&(a=0),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l={x:0,y:0}),p=new _(e,c,n,i,a,s,void 0,void 0,l),p.setImage(d),this.tilesets.push(p),this.tiles=r(this),p)},copy:function(e,t,n,r,i,a,o,s){return s=this.getLayer(s),s===null?null:(h.Copy(e,t,n,r,i,a,o,s),this)},createBlankLayer:function(e,t,n,r,i,a,o,s){if(n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=this.width),a===void 0&&(a=this.height),o===void 0&&(o=this.tileWidth),s===void 0&&(s=this.tileHeight),this.getLayerIndex(e)!==null)return console.warn(`Invalid Tilemap Layer ID: `+e),null;for(var l=new c({name:e,tileWidth:o,tileHeight:s,width:i,height:a,orientation:this.orientation,hexSideLength:this.hexSideLength}),u,d=0;d-1&&this.putTileAt(t,a.x,a.y,n,a.tilemapLayer)}return r},removeTileAt:function(e,t,n,r,i){return n===void 0&&(n=!0),r===void 0&&(r=!0),i=this.getLayer(i),i===null?null:h.RemoveTileAt(e,t,n,r,i)},removeTileAtWorldXY:function(e,t,n,r,i,a){return n===void 0&&(n=!0),r===void 0&&(r=!0),a=this.getLayer(a),a===null?null:h.RemoveTileAtWorldXY(e,t,n,r,i,a)},renderDebug:function(e,t,n){return n=this.getLayer(n),n===null?null:(this.orientation===u.ORTHOGONAL&&h.RenderDebug(e,t,n),this)},renderDebugFull:function(e,t){for(var n=this.layers,r=0;r{var r=n(44603),i=n(31989);r.register(`tilemap`,function(e){var t=e===void 0?{}:e;return i(this.scene,t.key,t.tileWidth,t.tileHeight,t.width,t.height,t.data,t.insertNull)})}),46029:((e,t,n)=>{var r=n(39429),i=n(31989);r.register(`tilemap`,function(e,t,n,r,a,o,s){return e===null&&(e=void 0),t===null&&(t=void 0),n===null&&(n=void 0),r===null&&(r=void 0),a===null&&(a=void 0),i(this.scene,e,t,n,r,a,o,s)})}),20442:((e,t,n)=>{var r=n(83419),i=n(78389),a=n(31401),o=n(95643),s=n(81086),c=n(19218),l=n(26099);e.exports=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,i,c],initialize:function(e,t,n,r,i,a){o.call(this,e,`TilemapLayer`),this.isTilemap=!0,this.tilemap=t,this.layerIndex=n,this.layer=t.layers[n],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=s.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(r),this.setAlpha(this.layer.alpha),this.setPosition(i,a),this.setOrigin(0,0),this.setSize(t.tileWidth*this.layer.width,t.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(e){var t=[],n=[],r=this.tilemap;Array.isArray(e)||(e=[e]);for(var i=0;i=0&&e<4&&(this._renderOrder=e),this},calculateFacesAt:function(e,t){return s.CalculateFacesAt(e,t,this.layer),this},calculateFacesWithin:function(e,t,n,r){return s.CalculateFacesWithin(e,t,n,r,this.layer),this},createFromTiles:function(e,t,n,r,i){return s.CreateFromTiles(e,t,n,r,i,this.layer)},cull:function(e){return this.cullCallback(this.layer,e,this.culledTiles,this._renderOrder)},copy:function(e,t,n,r,i,a,o){return s.Copy(e,t,n,r,i,a,o,this.layer),this},fill:function(e,t,n,r,i,a){return s.Fill(e,t,n,r,i,a,this.layer),this},filterTiles:function(e,t,n,r,i,a,o){return s.FilterTiles(e,t,n,r,i,a,o,this.layer)},findByIndex:function(e,t,n){return s.FindByIndex(e,t,n,this.layer)},findTile:function(e,t,n,r,i,a,o){return s.FindTile(e,t,n,r,i,a,o,this.layer)},forEachTile:function(e,t,n,r,i,a,o){return s.ForEachTile(e,t,n,r,i,a,o,this.layer),this},setTint:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!1},this,t,n,r,i,a)},setTintFill:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!0},this,t,n,r,i,a)},getTileAt:function(e,t,n){return s.GetTileAt(e,t,n,this.layer)},getTileAtWorldXY:function(e,t,n,r){return s.GetTileAtWorldXY(e,t,n,r,this.layer)},getIsoTileAtWorldXY:function(e,t,n,r,i){n===void 0&&(n=!0);var a=this.tempVec;return s.IsometricWorldToTileXY(e,t,!0,a,i,this.layer,n),this.getTileAt(a.x,a.y,r)},getTilesWithin:function(e,t,n,r,i){return s.GetTilesWithin(e,t,n,r,i,this.layer)},getTilesWithinShape:function(e,t,n){return s.GetTilesWithinShape(e,t,n,this.layer)},getTilesWithinWorldXY:function(e,t,n,r,i,a){return s.GetTilesWithinWorldXY(e,t,n,r,i,a,this.layer)},hasTileAt:function(e,t){return s.HasTileAt(e,t,this.layer)},hasTileAtWorldXY:function(e,t,n){return s.HasTileAtWorldXY(e,t,n,this.layer)},putTileAt:function(e,t,n,r){return s.PutTileAt(e,t,n,r,this.layer)},putTileAtWorldXY:function(e,t,n,r,i){return s.PutTileAtWorldXY(e,t,n,r,i,this.layer)},putTilesAt:function(e,t,n,r){return s.PutTilesAt(e,t,n,r,this.layer),this},randomize:function(e,t,n,r,i){return s.Randomize(e,t,n,r,i,this.layer),this},removeTileAt:function(e,t,n,r){return s.RemoveTileAt(e,t,n,r,this.layer)},removeTileAtWorldXY:function(e,t,n,r,i){return s.RemoveTileAtWorldXY(e,t,n,r,i,this.layer)},renderDebug:function(e,t){return s.RenderDebug(e,t,this.layer),this},replaceByIndex:function(e,t,n,r,i,a){return s.ReplaceByIndex(e,t,n,r,i,a,this.layer),this},setSkipCull:function(e){return e===void 0&&(e=!0),this.skipCull=e,this},setCullPadding:function(e,t){return e===void 0&&(e=1),t===void 0&&(t=1),this.cullPaddingX=e,this.cullPaddingY=t,this},setCollision:function(e,t,n,r){return s.SetCollision(e,t,n,this.layer,r),this},setCollisionBetween:function(e,t,n,r){return s.SetCollisionBetween(e,t,n,r,this.layer),this},setCollisionByProperty:function(e,t,n){return s.SetCollisionByProperty(e,t,n,this.layer),this},setCollisionByExclusion:function(e,t,n){return s.SetCollisionByExclusion(e,t,n,this.layer),this},setCollisionFromCollisionGroup:function(e,t){return s.SetCollisionFromCollisionGroup(e,t,this.layer),this},setTileIndexCallback:function(e,t,n){return s.SetTileIndexCallback(e,t,n,this.layer),this},setTileLocationCallback:function(e,t,n,r,i,a){return s.SetTileLocationCallback(e,t,n,r,i,a,this.layer),this},shuffle:function(e,t,n,r){return s.Shuffle(e,t,n,r,this.layer),this},swapByIndex:function(e,t,n,r,i,a){return s.SwapByIndex(e,t,n,r,i,a,this.layer),this},tileToWorldX:function(e,t){return this.tilemap.tileToWorldX(e,t,this)},tileToWorldY:function(e,t){return this.tilemap.tileToWorldY(e,t,this)},tileToWorldXY:function(e,t,n,r){return this.tilemap.tileToWorldXY(e,t,n,r,this)},getTileCorners:function(e,t,n){return this.tilemap.getTileCorners(e,t,n,this)},weightedRandomize:function(e,t,n,r,i){return s.WeightedRandomize(t,n,r,i,e,this.layer),this},worldToTileX:function(e,t,n){return this.tilemap.worldToTileX(e,t,n,this)},worldToTileY:function(e,t,n){return this.tilemap.worldToTileY(e,t,n,this)},worldToTileXY:function(e,t,n,r,i){return this.tilemap.worldToTileXY(e,t,n,r,i,this)},destroy:function(e){e===void 0&&(e=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),e&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}})}),16153:((e,t,n)=>{var r=n(61340),i=new r,a=new r,o=new r;e.exports=function(e,t,n,r){var s=t.cull(n),c=s.length,l=n.alpha*t.alpha;if(!(c===0||l<=0)){var u=i,d=a,f=o;d.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),u.copyFrom(n.matrix);var p=e.currentContext,m=t.gidMap;p.save(),r?(u.multiplyWithOffset(r,-n.scrollX*t.scrollFactorX,-n.scrollY*t.scrollFactorY),d.e=t.x,d.f=t.y,u.multiply(d,f),f.copyToContext(p)):(d.e-=n.scrollX*t.scrollFactorX,d.f-=n.scrollY*t.scrollFactorY,d.copyToContext(p)),(!e.antialias||t.scaleX>1||t.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var h=0;h{var r=n(29747),i=r,a=r;i=n(99558),a=n(16153),e.exports={renderWebGL:i,renderCanvas:a}}),99558:((e,t,n)=>{var r=n(70554);e.exports=function(e,t,n){var i=t.cull(n),a=i.length,o=n.alpha*t.alpha;if(!(a===0||o<=0)){var s=t.gidMap,c=e.pipelines.set(t.pipeline,t),l=r.getTintAppendFloatAlpha,u=t.scrollFactorX,d=t.scrollFactorY,f=t.x,p=t.y,m=t.scaleX,h=t.scaleY;e.pipelines.preBatch(t);for(var g=0;g{var r=n(83419),i=n(26099);e.exports=new r({initialize:function(e,t,n,r,a,o,s,c,l){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),a===void 0&&(a=0),o===void 0&&(o=0),s===void 0&&(s={}),c===void 0&&(c={}),this.name=e,this.firstgid=t,this.tileWidth=n,this.tileHeight=r,this.tileMargin=a,this.tileSpacing=o,this.tileProperties=s,this.tileData=c,this.tileOffset=new i,l!==void 0&&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(e){return this.containsTileIndex(e)?this.tileProperties[e-this.firstgid]:null},getTileData:function(e){return this.containsTileIndex(e)?this.tileData[e-this.firstgid]:null},getTileCollisionGroup:function(e){var t=this.getTileData(e);return t&&t.objectgroup?t.objectgroup:null},containsTileIndex:function(e){return e>=this.firstgid&&en.width||t.height>n.height?this.updateTileData(t.width,t.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(e,t){return e!==void 0&&(this.tileWidth=e),t!==void 0&&(this.tileHeight=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(e,t){return e!==void 0&&(this.tileMargin=e),t!==void 0&&(this.tileSpacing=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=(t-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),a=(e-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(i%1!=0||a%1!=0)&&console.warn(`Image tile area not tile size multiple in: `+this.name),i=Math.floor(i),a=Math.floor(a),this.rows=i,this.columns=a,this.total=i*a,this.texCoordinates.length=0;for(var o=this.tileMargin+n,s=this.tileMargin+r,c=0;c{var r=n(7423);e.exports=function(e,t,n){var i=r(e,t,!0,n),a=r(e,t-1,!0,n),o=r(e,t+1,!0,n),s=r(e-1,t,!0,n),c=r(e+1,t,!0,n),l=i&&i.collides;return l&&(i.faceTop=!0,i.faceBottom=!0,i.faceLeft=!0,i.faceRight=!0),a&&a.collides&&(l&&(i.faceTop=!1),a.faceBottom=!l),o&&o.collides&&(l&&(i.faceBottom=!1),o.faceTop=!l),s&&s.collides&&(l&&(i.faceLeft=!1),s.faceRight=!l),c&&c.collides&&(l&&(i.faceRight=!1),c.faceLeft=!l),i&&!i.collides&&i.resetFaces(),i}}),42573:((e,t,n)=>{var r=n(7423),i=n(7386);e.exports=function(e,t,n,a,o){for(var s=null,c=null,l=null,u=null,d=i(e,t,n,a,null,o),f=0;f{var r=new(n(26099));e.exports=function(e,t,n,i){var a=n.tilemapLayer,o=a.cullPaddingX,s=a.cullPaddingY,c=a.tilemap.tileToWorldXY(e,t,r,i,a);return c.x>i.worldView.x+a.scaleX*n.tileWidth*(-o-.5)&&c.xi.worldView.y+a.scaleY*n.tileHeight*(-s-1)&&c.y{var r=n(42573),i=n(7386),a=n(62991),o=n(23029);e.exports=function(e,t,n,s,c,l,u,d){u===void 0&&(u=!0);var f=i(e,t,n,s,null,d),p=[];f.forEach(function(e){var t=new o(e.layer,e.index,e.x,e.y,e.width,e.height,e.baseWidth,e.baseHeight);t.copy(e),p.push(t)});for(var m=c-e,h=l-t,g=0;g{var r=n(62644),i=n(7386),a=n(27987);e.exports=function(e,t,n,o,s,c){n||={},Array.isArray(e)||(e=[e]);var l=c.tilemapLayer;o||=l.scene,s||=o.cameras.main;var u=c.width,d=c.height,f=i(0,0,u,d,null,c),p=[],m,h=function(e,t,n){for(var r=0;r{var r=n(87841),i=n(63448),a=n(56583),o=new r;e.exports=function(e,t){var n=e.tilemapLayer.tilemap,r=e.tilemapLayer,s=Math.floor(n.tileWidth*r.scaleX),c=Math.floor(n.tileHeight*r.scaleY),l=a(t.worldView.x-r.x,s,0,!0)-r.cullPaddingX,u=i(t.worldView.right-r.x,s,0,!0)+r.cullPaddingX,d=a(t.worldView.y-r.y,c,0,!0)-r.cullPaddingY,f=i(t.worldView.bottom-r.y,c,0,!0)+r.cullPaddingY;return o.setTo(l,d,u-l,f-d)}}),30003:((e,t,n)=>{var r=n(19545),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return(o.skipCull||o.scrollFactorX!==1||o.scrollFactorY!==1)&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),35137:((e,t,n)=>{var r=n(7386),i=n(42573),a=n(20576);e.exports=function(e,t,n,o,s,c,l){for(var u=l.collideIndexes.indexOf(e)!==-1,d=r(t,n,o,s,null,l),f=0;f{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).filter(e,t)}}),52692:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=!1);var i=0,a,o,s;if(n){for(o=r.height-1;o>=0;o--)for(a=r.width-1;a>=0;a--)if(s=r.data[o][a],s&&s.index===e){if(i===t)return s;i+=1}}else for(o=0;o{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).find(e,t)||null}}),97560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){r(n,i,a,o,s,c).forEach(e,t)}}),43305:((e,t,n)=>{var r=n(91907),i=n(30003),a=n(9474),o=n(14018),s=n(29747),c=n(54503);e.exports=function(e){return e===r.ORTHOGONAL?i:e===r.HEXAGONAL?a:e===r.STAGGERED?c:e===r.ISOMETRIC?o:s}}),7423:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n,i){if(r(e,t,i)){var a=i.data[t][e]||null;return a?a.index===-1?n?a:null:a:null}else return null}}),60540:((e,t,n)=>{var r=n(7423),i=new(n(26099));e.exports=function(e,t,n,a,o){return o.tilemapLayer.worldToTileXY(e,t,!0,i,a),r(i.x,i.y,n,o)}}),55826:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i){var a=i.baseTileWidth,o=i.baseTileHeight,s=i.tilemapLayer,c=0,l=0;s&&(n||=s.scene.cameras.main,c=s.x+n.scrollX*(1-s.scrollFactorX),l=s.y+n.scrollY*(1-s.scrollFactorY),a*=s.scaleX,o*=s.scaleY);var u=c+e*a,d=l+t*o;return[new r(u,d),new r(u+a,d),new r(u+a,d+o),new r(u,d+o)]}}),11758:((e,t,n)=>{var r=n(91907),i=n(27229),a=n(29747),o=n(55826);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:(r.STAGGERED,a)}}),39167:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(97281);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),62e3:((e,t,n)=>{var r=n(91907),i=n(19951),a=n(14127),o=n(29747),s=n(97202),c=n(70326);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),5984:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(28054),o=n(29650);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),7386:((e,t,n)=>{var r=n(95540);e.exports=function(e,t,n,i,a,o){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=o.width),i===void 0&&(i=o.height),a||={};var s=r(a,`isNotEmpty`,!1),c=r(a,`isColliding`,!1),l=r(a,`hasInterestingFace`,!1);e<0&&(n+=e,e=0),t<0&&(i+=t,t=0),e+n>o.width&&(n=Math.max(o.width-e,0)),t+i>o.height&&(i=Math.max(o.height-t,0));for(var u=[],d=t;d{var r=n(55738),i=n(7386),a=n(91865),o=n(29747),s=n(26099),c=n(91907),l=function(e,t){return a.RectangleToTriangle(t,e)},u=new s,d=new s,f=new s;e.exports=function(e,t,n,s){if(s.orientation!==c.ORTHOGONAL)return console.warn(`GetTilesWithinShape only works with orthogonal tilemaps`),[];if(e===void 0)return[];var p=o;e instanceof r.Circle?p=a.CircleToRectangle:e instanceof r.Rectangle?p=a.RectangleToRectangle:e instanceof r.Triangle?p=l:e instanceof r.Line&&(p=a.LineToRectangle),s.tilemapLayer.worldToTileXY(e.left,e.top,!0,d,n);var m=d.x,h=d.y;s.tilemapLayer.worldToTileXY(e.right,e.bottom,!1,f,n);var g=Math.ceil(f.x),_=Math.ceil(f.y),v=i(m,h,Math.max(g-m,1),Math.max(_-h,1),t,s),y=s.tileWidth,b=s.tileHeight;s.tilemapLayer&&(y*=s.tilemapLayer.scaleX,b*=s.tilemapLayer.scaleY);for(var x=[],S=new r.Rectangle(0,0,y,b),C=0;C{var r=n(7386),i=n(26099),a=new i,o=new i;e.exports=function(e,t,n,i,s,c,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,t,!0,a,c,l);var d=a.x,f=a.y;u(e+n,t+i,!1,o,c,l);var p=Math.ceil(o.x),m=Math.ceil(o.y);return r(d,f,p-d,m-f,s,l)}}),96113:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(10095);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),16926:((e,t,n)=>{var r=n(91907),i=n(86625),a=n(96897),o=n(29747),s=n(15108),c=n(85896);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),55762:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(51900),o=n(63288);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),45091:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n){if(r(e,t,n)){var i=n.data[t][e];return i!==null&&i.index>-1}else return!1}}),24152:((e,t,n)=>{var r=n(45091),i=new(n(26099));e.exports=function(e,t,n,a){a.tilemapLayer.worldToTileXY(e,t,!0,i,n);var o=i.x,s=i.y;return r(o,s,a)}}),90454:((e,t,n)=>{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY),c=e.hexSideLength,l,u,d,f;if(e.staggerAxis===`y`){var p=(s-c)/2+c;l=i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,p,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,p,0,!0)+a.cullPaddingY}else{var m=(o-c)/2+c;l=i(t.worldView.x-a.x,m,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,m,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,s,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,s,0,!0)+a.cullPaddingY}return{left:l,right:u,top:d,bottom:f}}}),9474:((e,t,n)=>{var r=n(90454),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),27229:((e,t,n)=>{var r=n(19951),i=n(26099),a=new i;e.exports=function(e,t,n,o){var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(s*=l.scaleX,c*=l.scaleY);var u=r(e,t,a,n,o),d=[],f=.5773502691896257,p,m;o.staggerAxis===`y`?(p=f*s,m=c/2):(p=s/2,m=f*c);for(var h=0;h<6;h++){var g=2*Math.PI*(.5-h)/6;d.push(new i(u.x+p*Math.cos(g),u.y+m*Math.sin(g)))}return d}}),19951:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),u=c.y+i.scrollY*(1-c.scrollFactorY),o*=c.scaleX,s*=c.scaleY);var d=o/2,f=s/2,p,m,h=a.staggerAxis,g=a.staggerIndex;return h===`y`?(p=l+o*e+o,m=u+1.5*t*f+f,t%2==0&&(g===`odd`?p-=d:p+=d)):h===`x`&&g===`odd`&&(p=l+1.5*e*d+d,m=u+s*e+s,e%2==0&&(g===`odd`?m-=f:m+=f)),n.set(p,m)}}),86625:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=.5773502691896257,d=-.3333333333333333,f=0,p=.6666666666666666,m=s/2,h=c/2,g,_,v,y,b;o.staggerAxis===`y`?(g=(e-m)/(u*s),_=(t-h)/h,v=u*g+d*_,y=f*g+p*_):(g=(e-m)/m,_=(t-h)/(u*c),v=d*g+u*_,y=p*g+f*_),b=-v-y;var x=Math.round(v),S=Math.round(y),C=Math.round(b),w=Math.abs(x-v),T=Math.abs(S-y),E=Math.abs(C-b);w>T&&w>E?x=-S-C:T>E&&(S=-x-C);var D,O=S;return D=o.staggerIndex===`odd`?O%2==0?S/2+x:S/2+x-.5:O%2==0?S/2+x:S/2+x+.5,i.set(D,O)}}),62991:(e=>{e.exports=function(e,t,n){return e>=0&&e=0&&t{var r=n(33528);e.exports=function(e,t,n,i){n===void 0&&(n=[]),i===void 0&&(i=0),n.length=0;var a=e.tilemapLayer,o=e.data,s=e.width,c=e.height,l=a.skipCull,u=0,d=s,f=0,p=c,m,h,g;if(i===0)for(h=f;h=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));else if(i===2)for(h=p;h>=f;h--)for(m=u;m=f;h--)for(m=d;m>=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));return a.tilesDrawn=n.length,a.tilesTotal=s*c,n}}),14127:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+(e-t)*(o/2),f=u+(e+t)*(s/2);return n.set(d,f)}}),96897:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o,s){i||=new r;var c=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(a||=u.scene.cameras.main,t-=u.y+a.scrollY*(1-u.scrollFactorY),l*=u.scaleY,e-=u.x+a.scrollX*(1-u.scrollFactorX),c*=u.scaleX);var d=c/2,f=l/2;e-=d,s||(t-=l);var p=.5*(e/d+t/f),m=.5*(-e/d+t/f);return n&&(p=Math.floor(p),m=Math.floor(m)),i.set(p,m)}}),71558:((e,t,n)=>{var r=n(23029),i=n(62991),a=n(72023),o=n(20576);e.exports=function(e,t,n,s,c){if(s===void 0&&(s=!0),!i(t,n,c))return null;var l,u=c.data[n][t],d=u&&u.collides;e instanceof r?(c.data[n][t]===null&&(c.data[n][t]=new r(c,e.index,t,n,c.tileWidth,c.tileHeight)),c.data[n][t].copy(e)):(l=e,c.data[n][t]===null?c.data[n][t]=new r(c,l,t,n,c.tileWidth,c.tileHeight):c.data[n][t].index=l);var f=c.data[n][t],p=c.collideIndexes.indexOf(f.index)!==-1;if(l=e instanceof r?e.index:e,l===-1)f.width=c.tileWidth,f.height=c.tileHeight;else{var m=c.tilemapLayer.tilemap,h=m.tiles[l][2],g=m.tilesets[h];f.width=g.tileWidth,f.height=g.tileHeight}return o(f,p),s&&d!==f.collides&&a(t,n,c),f}}),26303:((e,t,n)=>{var r=n(71558),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(t,n,!0,i,o,s),r(e,i.x,i.y,a,s)}}),14051:((e,t,n)=>{var r=n(42573),i=n(71558);e.exports=function(e,t,n,a,o){if(a===void 0&&(a=!0),!Array.isArray(e))return null;Array.isArray(e[0])||(e=[e]);for(var s=e.length,c=e[0].length,l=0;l{var r=n(7386),i=n(26546);e.exports=function(e,t,n,a,o,s){var c,l=r(e,t,n,a,{},s);if(!o)for(o=[],c=0;c{var r=n(23029),i=n(62991),a=n(72023);e.exports=function(e,t,n,o,s){if(n===void 0&&(n=!0),o===void 0&&(o=!0),!i(e,t,s))return null;var c=s.data[t][e];if(c)s.data[t][e]=n?null:new r(s,-1,e,t,s.tileWidth,s.tileHeight);else return null;return o&&c&&c.collides&&a(e,t,s),c}}),94178:((e,t,n)=>{var r=n(63557),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(e,t,!0,i,o,s),r(i.x,i.y,n,a,s)}}),15533:((e,t,n)=>{var r=n(7386),i=n(3956),a=new i(105,210,231,150),o=new i(243,134,48,200),s=new i(40,39,37,150);e.exports=function(e,t,n){t===void 0&&(t={});var i=t.tileColor===void 0?a:t.tileColor,c=t.collidingTileColor===void 0?o:t.collidingTileColor,l=t.faceColor===void 0?s:t.faceColor,u=r(0,0,n.width,n.height,null,n);e.translateCanvas(n.tilemapLayer.x,n.tilemapLayer.y),e.scaleCanvas(n.tilemapLayer.scaleX,n.tilemapLayer.scaleY);for(var d=0;d{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n,r){var i=e.data,a=e.width,o=e.height,s=e.tilemapLayer,c=Math.max(0,t.left),l=Math.min(a,t.right),u=Math.max(0,t.top),d=Math.min(o,t.bottom),f,p,m;if(n===0)for(p=u;p=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);else if(n===2)for(p=d;p>=u;p--)for(f=c;i[p]&&f=u;p--)for(f=l;i[p]&&f>=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);return s.tilesDrawn=r.length,s.tilesTotal=a*o,r}}),57068:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s){t===void 0&&(t=!0),n===void 0&&(n=!0),s===void 0&&(s=!0),Array.isArray(e)||(e=[e]);for(var c=0;c{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s,c){if(n===void 0&&(n=!0),o===void 0&&(o=!0),c===void 0&&(c=!0),!(e>t)){for(var l=e;l<=t;l++)a(l,n,s);if(c)for(var u=0;u=e&&f.index<=t&&r(f,n)}o&&i(0,0,s.width,s.height,s)}}}),75661:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0),Array.isArray(e)||(e=[e]);for(var s=0;s{var r=n(20576),i=n(42573),a=n(97022);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0);for(var s=0;s{var r=n(20576),i=n(42573);e.exports=function(e,t,n){e===void 0&&(e=!0),t===void 0&&(t=!0);for(var a=0;a0&&r(s,e)}}t&&i(0,0,n.width,n.height,n)}}),9589:(e=>{e.exports=function(e,t,n){var r=n.collideIndexes.indexOf(e);t&&r===-1?n.collideIndexes.push(e):!t&&r!==-1&&n.collideIndexes.splice(r,1)}}),20576:(e=>{e.exports=function(e,t){t?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)}}),79583:(e=>{e.exports=function(e,t,n,r){if(typeof e==`number`)r.callbacks[e]=t===null?void 0:{callback:t,callbackContext:n};else for(var i=0,a=e.length;i{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(e,t,n,i,null,s),l=0;l{var r=n(7386),i=n(33680);e.exports=function(e,t,n,a,o){var s=r(e,t,n,a,null,o),c=s.map(function(e){return e.index});i(c);for(var l=0;l{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY);return{left:i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,right:r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,top:i(t.worldView.y-a.y,s/2,0,!0)-a.cullPaddingY,bottom:r(t.worldView.bottom-a.y,s/2,0,!0)+a.cullPaddingY}}}),54503:((e,t,n)=>{var r=n(61325),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),97202:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+e*o+t%2*(o/2),f=u+s/2*t;return n.set(d,f)}}),28054:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t===void 0&&(t=i.scene.cameras.main),a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+r/2*e+r}}),15108:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,t-=l.y+a.scrollY*(1-l.scrollFactorY),c*=l.scaleY,e-=l.x+a.scrollX*(1-l.scrollFactorX),s*=l.scaleX);var u=n?Math.floor(t/(c/2)):t/(c/2),d=n?Math.floor((e+u%2*.5*s)/s):(e+u%2*.5*s)/s;return i.set(d,u)}}),51900:(e=>{e.exports=function(e,t,n,r){var i=r.baseTileHeight,a=r.tilemapLayer;return a&&(n||=a.scene.cameras.main,e-=a.y+n.scrollY*(1-a.scrollFactorY),i*=a.scaleY),t?Math.floor(e/(i/2)):e/(i/2)}}),86560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n){var r=n.baseTileWidth,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.x+t.scrollX*(1-i.scrollFactorX),r*=i.scaleX),a+e*r}}),70326:((e,t,n)=>{var r=n(97281),i=n(29650),a=n(26099);e.exports=function(e,t,n,o,s){return n||=new a(0,0),n.x=r(e,o,s),n.y=i(t,o,s),n}}),29650:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+e*r}}),77366:((e,t,n)=>{var r=n(7386),i=n(75508);e.exports=function(e,t,n,a,o,s){if(o){var c,l=r(e,t,n,a,null,s),u=0;for(c=0;c{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(e,0,t,i,n,a),i.x}}),85896:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){n===void 0&&(n=!0),i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=e/s,d=t/c;return n&&(u=Math.floor(u),d=Math.floor(d)),i.set(u,d)}}),63288:((e,t,n)=>{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(0,e,t,i,n,a),i.y}}),81086:((e,t,n)=>{e.exports={CalculateFacesAt:n(72023),CalculateFacesWithin:n(42573),CheckIsoBounds:n(33528),Copy:n(1785),CreateFromTiles:n(78419),CullBounds:n(19545),CullTiles:n(30003),Fill:n(35137),FilterTiles:n(40253),FindByIndex:n(52692),FindTile:n(66151),ForEachTile:n(97560),GetCullTilesFunction:n(43305),GetTileAt:n(7423),GetTileAtWorldXY:n(60540),GetTileCorners:n(55826),GetTileCornersFunction:n(11758),GetTilesWithin:n(7386),GetTilesWithinShape:n(91141),GetTilesWithinWorldXY:n(96523),GetTileToWorldXFunction:n(39167),GetTileToWorldXYFunction:n(62e3),GetTileToWorldYFunction:n(5984),GetWorldToTileXFunction:n(96113),GetWorldToTileXYFunction:n(16926),GetWorldToTileYFunction:n(55762),HasTileAt:n(45091),HasTileAtWorldXY:n(24152),HexagonalCullBounds:n(90454),HexagonalCullTiles:n(9474),HexagonalGetTileCorners:n(27229),HexagonalTileToWorldXY:n(19951),HexagonalWorldToTileXY:n(86625),IsInLayerBounds:n(62991),IsometricCullTiles:n(14018),IsometricTileToWorldXY:n(14127),IsometricWorldToTileXY:n(96897),PutTileAt:n(71558),PutTileAtWorldXY:n(26303),PutTilesAt:n(14051),Randomize:n(77389),RemoveTileAt:n(63557),RemoveTileAtWorldXY:n(94178),RenderDebug:n(15533),ReplaceByIndex:n(27987),RunCull:n(32483),SetCollision:n(57068),SetCollisionBetween:n(37266),SetCollisionByExclusion:n(75661),SetCollisionByProperty:n(64740),SetCollisionFromCollisionGroup:n(63307),SetLayerCollisionIndex:n(9589),SetTileCollision:n(20576),SetTileIndexCallback:n(79583),SetTileLocationCallback:n(93254),Shuffle:n(32903),StaggeredCullBounds:n(61325),StaggeredCullTiles:n(54503),StaggeredTileToWorldXY:n(97202),StaggeredTileToWorldY:n(28054),StaggeredWorldToTileXY:n(15108),StaggeredWorldToTileY:n(51900),SwapByIndex:n(86560),TileToWorldX:n(97281),TileToWorldXY:n(70326),TileToWorldY:n(29650),WeightedRandomize:n(77366),WorldToTileX:n(10095),WorldToTileXY:n(85896),WorldToTileY:n(63288)}}),91907:(e=>{e.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}}),21829:((e,t,n)=>{e.exports={ORIENTATION:n(91907)}}),62501:((e,t,n)=>{var r=n(79291),i=n(21829),a={Components:n(81086),Parsers:n(57442),Formats:n(80341),ImageCollection:n(16536),ParseToTilemap:n(31989),Tile:n(23029),Tilemap:n(49075),TilemapCreator:n(45939),TilemapFactory:n(46029),Tileset:n(33629),TilemapLayer:n(20442),Orientation:n(91907),LayerData:n(14977),MapData:n(87010),ObjectLayer:n(48700)};a=r(!1,a,i.ORIENTATION),e.exports=a}),14977:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`layer`),this.id=a(e,`id`,0),this.x=a(e,`x`,0),this.y=a(e,`y`,0),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.baseTileWidth=a(e,`baseTileWidth`,this.tileWidth),this.baseTileHeight=a(e,`baseTileHeight`,this.tileHeight),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.widthInPixels=a(e,`widthInPixels`,this.width*this.baseTileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.baseTileHeight),this.alpha=a(e,`alpha`,1),this.visible=a(e,`visible`,!0),this.properties=a(e,`properties`,[]),this.indexes=a(e,`indexes`,[]),this.collideIndexes=a(e,`collideIndexes`,[]),this.callbacks=a(e,`callbacks`,[]),this.bodies=a(e,`bodies`,[]),this.data=a(e,`data`,[]),this.tilemapLayer=a(e,`tilemapLayer`,null),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),87010:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`map`),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.infinite=a(e,`infinite`,!1),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.widthInPixels=a(e,`widthInPixels`,this.width*this.tileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.tileHeight),this.format=a(e,`format`,null),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.renderOrder=a(e,`renderOrder`,`right-down`),this.version=a(e,`version`,`1`),this.properties=a(e,`properties`,{}),this.layers=a(e,`layers`,[]),this.images=a(e,`images`,[]),this.objects=a(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=a(e,`collision`,{}),this.tilesets=a(e,`tilesets`,[]),this.imageCollections=a(e,`imageCollections`,[]),this.tiles=a(e,`tiles`,[]),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),48700:((e,t,n)=>{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=i(e,`name`,`object layer`),this.id=i(e,`id`,0),this.opacity=i(e,`opacity`,1),this.properties=i(e,`properties`,{}),this.propertyTypes=i(e,`propertytypes`,{}),this.type=i(e,`type`,`objectgroup`),this.visible=i(e,`visible`,!0),this.objects=i(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[])}})}),6641:((e,t,n)=>{var r=n(91907);e.exports=function(e){return e=e.toLowerCase(),e===`isometric`?r.ISOMETRIC:e===`staggered`?r.STAGGERED:e===`hexagonal`?r.HEXAGONAL:r.ORTHOGONAL}}),46177:((e,t,n)=>{var r=n(80341),i=n(2342),a=n(82593),o=n(46594),s=n(87021);e.exports=function(e,t,n,c,l,u){var d;switch(t){case r.ARRAY_2D:d=i(e,n,c,l,u);break;case r.CSV:d=a(e,n,c,l,u);break;case r.TILED_JSON:d=o(e,n,u);break;case r.WELTMEISTER:d=s(e,n,u);break;default:console.warn(`Unrecognized tilemap data format: `+t),d=null}return d}}),2342:((e,t,n)=>{var r=n(80341),i=n(14977),a=n(87010),o=n(23029);e.exports=function(e,t,n,s,c){for(var l=new i({tileWidth:n,tileHeight:s}),u=new a({name:e,tileWidth:n,tileHeight:s,format:r.ARRAY_2D,layers:[l]}),d=[],f=t.length,p=0,m=0;m{var r=n(80341),i=n(2342);e.exports=function(e,t,n,a,o){var s=i(e,t.trim().split(` `).map(function(e){return e.split(`,`)}),n,a,o);return s.format=r.CSV,s}}),6656:((e,t,n)=>{var r=n(14977),i=n(23029);e.exports=function(e,t){for(var n=[],a=0;a-1?new i(s,f,d,u,o.tilesize,o.tilesize):t?null:new i(s,-1,d,u,o.tilesize,o.tilesize);c.push(p)}l.push(c),c=[]}s.data=l,n.push(s)}return n}}),96483:((e,t,n)=>{var r=n(33629);e.exports=function(e){for(var t=[],n=[],i=0;i{var r=n(80341),i=n(87010),a=n(6656),o=n(96483);e.exports=function(e,t,n){if(t.layer.length===0)return console.warn(`No layers found in the Weltmeister map: `+e),null;for(var s=0,c=0,l=0;ls&&(s=t.layer[l].width),t.layer[l].height>c&&(c=t.layer[l].height);var u=new i({width:s,height:c,name:e,tileWidth:t.layer[0].tilesize,tileHeight:t.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=a(t,n),u.tilesets=o(t),u}}),52833:((e,t,n)=>{e.exports={ParseTileLayers:n(6656),ParseTilesets:n(96483),ParseWeltmeister:n(87021)}}),57442:((e,t,n)=>{e.exports={FromOrientationString:n(6641),Parse:n(46177),Parse2DArray:n(2342),ParseCSV:n(82593),Impact:n(52833),Tiled:n(96761)}}),51233:((e,t,n)=>{var r=n(79291);e.exports=function(e){for(var t,n,i,a,o,s=0;s{e.exports=function(e){for(var t=window.atob(e),n=t.length,r=Array(n/4),i=0;i>>0;return r}}),84101:((e,t,n)=>{var r=n(33629);e.exports=function(e){var t,n,i=[];for(t=0;t{var r=n(95540);e.exports=function(e,t,n){if(!t)return{i:0,layers:e.layers,name:``,opacity:1,visible:!0,x:0,y:0};var i=t.x+r(t,`startx`,0)*e.tilewidth+r(t,`offsetx`,0),a=t.y+r(t,`starty`,0)*e.tileheight+r(t,`offsety`,0);return{i:0,layers:t.layers,name:n.name+t.name+`/`,opacity:n.opacity*t.opacity,visible:n.visible&&t.visible,x:n.x+i,y:n.y+a}}}),29920:(e=>{var t=2147483648,n=1073741824,r=536870912;e.exports=function(e){var i=!!(e&t),a=!!(e&n),o=!!(e&r);e&=~(t|n|r);var s=0,c=!1;return i&&a&&o?(s=Math.PI/2,c=!0):i&&a&&!o?(s=Math.PI,c=!1):i&&!a&&o?(s=Math.PI/2,c=!1):i&&!a&&!o?(s=0,c=!0):!i&&a&&o?(s=3*Math.PI/2,c=!1):!i&&a&&!o?(s=Math.PI,c=!0):!i&&!a&&o?(s=3*Math.PI/2,c=!0):!i&&!a&&!o&&(s=0,c=!1),{gid:e,flippedHorizontal:i,flippedVertical:a,flippedAntiDiagonal:o,rotation:s,flipped:c}}}),12635:((e,t,n)=>{var r=n(95540),i=n(79677);e.exports=function(e){for(var t=[],n=[],a=i(e);a.i0;){if(a.i>=a.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}a=n.pop();continue}var o=a.layers[a.i];if(a.i++,o.type!==`imagelayer`){if(o.type===`group`){var s=i(e,o,a);n.push(a),a=s}continue}var c=r(o,`offsetx`,0)+r(o,`startx`,0),l=r(o,`offsety`,0)+r(o,`starty`,0);t.push({name:a.name+o.name,image:o.image,x:a.x+c+o.x,y:a.y+l+o.y,alpha:a.opacity*o.opacity,visible:a.visible&&o.visible,properties:r(o,`properties`,{})})}return t}}),46594:((e,t,n)=>{var r=n(51233),i=n(84101),a=n(91907),o=n(62644),s=n(80341),c=n(6641),l=n(87010),u=n(12635),d=n(22611),f=n(28200),p=n(24619);e.exports=function(e,t,n){var m=o(t),h=new l({width:m.width,height:m.height,name:e,tileWidth:m.tilewidth,tileHeight:m.tileheight,orientation:c(m.orientation),format:s.TILED_JSON,version:m.version,properties:m.properties,renderOrder:m.renderorder,infinite:m.infinite});if(h.orientation===a.HEXAGONAL)if(h.hexSideLength=m.hexsidelength,h.staggerAxis=m.staggeraxis,h.staggerIndex=m.staggerindex,h.staggerAxis===`y`){var g=(h.tileHeight-h.hexSideLength)/2;h.widthInPixels=h.tileWidth*(h.width+.5),h.heightInPixels=h.height*(h.hexSideLength+g)+g}else{var _=(h.tileWidth-h.hexSideLength)/2;h.widthInPixels=h.width*(h.hexSideLength+_)+_,h.heightInPixels=h.tileHeight*(h.height+.5)}h.layers=f(m,n),h.images=u(m);var v=p(m);return h.tilesets=v.tilesets,h.imageCollections=v.imageCollections,h.objects=d(m),h.tiles=i(h),r(h),h}}),52205:((e,t,n)=>{var r=n(18254),i=n(29920),a=function(e){return{x:e.x,y:e.y}},o=[`id`,`name`,`type`,`rotation`,`properties`,`visible`,`x`,`y`,`width`,`height`];e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var s=r(e,o);if(s.x+=t,s.y+=n,e.gid){var c=i(e.gid);s.gid=c.gid,s.flippedHorizontal=c.flippedHorizontal,s.flippedVertical=c.flippedVertical,s.flippedAntiDiagonal=c.flippedAntiDiagonal}else e.polyline?s.polyline=e.polyline.map(a):e.polygon?s.polygon=e.polygon.map(a):e.ellipse?s.ellipse=e.ellipse:e.text?s.text=e.text:e.point?s.point=!0:s.rectangle=!0;return s}}),22611:((e,t,n)=>{var r=n(95540),i=n(52205),a=n(48700),o=n(79677);e.exports=function(e){for(var t=[],n=[],s=o(e);s.i0;){if(s.i>=s.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}s=n.pop();continue}var c=s.layers[s.i];if(s.i++,c.opacity*=s.opacity,c.visible=s.visible&&c.visible,c.type!==`objectgroup`){if(c.type===`group`){var l=o(e,c,s);n.push(s),s=l}continue}c.name=s.name+c.name;for(var u=s.x+r(c,`startx`,0)+r(c,`offsetx`,0),d=s.y+r(c,`starty`,0)+r(c,`offsety`,0),f=[],p=0;p{var r=n(41868),i=n(91907),a=n(79677),o=n(6641),s=n(95540),c=n(14977),l=n(29920),u=n(23029);e.exports=function(e,t){for(var n=s(e,`infinite`,!1),d=[],f=[],p=a(e);p.i0;){if(p.i>=p.layers.length){if(f.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}p=f.pop();continue}var m=p.layers[p.i];if(p.i++,m.type!==`tilelayer`){if(m.type===`group`){var h=a(e,m,p);f.push(p),p=h}continue}if(m.compression){console.warn(`TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '`+m.name+`'`);continue}else if(m.encoding&&m.encoding===`base64`){if(m.chunks)for(var g=0;g0?(y=new u(_,v.gid,F,I,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,C[I][F]=y):(b=t?null:new u(_,-1,F,I,e.tilewidth,e.tileheight),C[I][F]=b),w++,w===k.width&&(M++,w=0)}}else{_=new c({name:p.name+m.name,id:m.id,x:p.x+s(m,`offsetx`,0)+m.x,y:p.y+s(m,`offsety`,0)+m.y,width:m.width,height:m.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:p.opacity*m.opacity,visible:p.visible&&m.visible,properties:s(m,`properties`,[]),orientation:o(e.orientation)}),_.orientation===i.HEXAGONAL&&(_.hexSideLength=e.hexsidelength,_.staggerAxis=e.staggeraxis,_.staggerIndex=e.staggerindex,_.staggerAxis===`y`?(x=(_.tileHeight-_.hexSideLength)/2,_.widthInPixels=_.tileWidth*(_.width+.5),_.heightInPixels=_.height*(_.hexSideLength+x)+x):(S=(_.tileWidth-_.hexSideLength)/2,_.widthInPixels=_.width*(_.hexSideLength+S)+S,_.heightInPixels=_.tileHeight*(_.height+.5)));for(var L=[],R=0,z=m.data.length;R0?(y=new u(_,v.gid,w,C.length,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,L.push(y)):(b=t?null:new u(_,-1,w,C.length,e.tilewidth,e.tileheight),L.push(b)),w++,w===m.width&&(C.push(L),w=0,L=[])}_.data=C,d.push(_)}return d}}),24619:((e,t,n)=>{var r=n(33629),i=n(16536),a=n(52205),o=n(57880);e.exports=function(e){for(var t=[],n=[],s=null,c,l=0;l1){var f=void 0,p=void 0;if(Array.isArray(u.tiles)){f||={},p||={};for(var m=0;m{e.exports=function(e,t){for(var n=0;n0){var a={},o={},s,c,l;if(Array.isArray(r.edgecolors))for(s=0;s{e.exports={AssignTileProperties:n(51233),Base64Decode:n(41868),BuildTilesetIndex:n(84101),CreateGroupLayer:n(79677),ParseGID:n(29920),ParseImageLayers:n(12635),ParseJSONTiled:n(46594),ParseObject:n(52205),ParseObjectLayers:n(22611),ParseTileLayers:n(28200),ParseTilesets:n(24619)}}),33385:((e,t,n)=>{var r=n(83419),i=n(37277),a=n(44594),o=n(94880),s=n(72905),c=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],e.sys.events.once(a.BOOT,this.boot,this),e.sys.events.on(a.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var e=this.systems.events;e.on(a.PRE_UPDATE,this.preUpdate,this),e.on(a.UPDATE,this.update,this),e.once(a.SHUTDOWN,this.shutdown,this)},addEvent:function(e){var t;if(e instanceof o){if(t=e,this.removeEvent(t),t.elapsed=t.startAt,t.hasDispatched=!1,t.repeatCount=t.repeat===-1||t.loop?999999999999:t.repeat,t.delay<=0&&t.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`)}else t=new o(e);return this._pendingInsertion.push(t),t},delayedCall:function(e,t,n,r){return this.addEvent({delay:e,callback:t,args:n,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t-1&&this._active.splice(i,1),r.destroy()}for(n=0;n=r.delay)){var i=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,i>=r.delay)for(;i>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),i-=r.delay,r.repeatCount--;r.elapsed=i,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var e;for(e=0;e{var r=n(83419),i=n(50792),a=n(39429),o=n(95540),s=n(44594),c=n(89809),l=new r({Extends:i,initialize:function(e,t){i.call(this),this.scene=e,this.systems=e.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 n=this.systems.events;n.on(s.PRE_UPDATE,this.preUpdate,this),n.on(s.UPDATE,this.update,this),n.once(s.SHUTDOWN,this.destroy,this),t&&this.add(t)},preUpdate:function(e,t){this.paused||(this.elapsed+=t*this.timeScale)},update:function(){if(!(this.paused||this.complete)){var e,t=this.events,n=!1,r=this.systems,i;for(e=0;e=t.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(c.COMPLETE,this)}},play:function(e){return e===void 0&&(e=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,e&&this.reset(),this},pause:function(){this.paused=!0;for(var e=this.events,t=0;t0&&(n=t[t.length-1].time);for(var r=0;r{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){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(e)},reset:function(e){if(this.delay=i(e,`delay`,0),this.repeat=i(e,`repeat`,0),this.loop=i(e,`loop`,!1),this.callback=i(e,`callback`,void 0),this.callbackScope=i(e,`callbackScope`,this),this.args=i(e,`args`,[]),this.timeScale=i(e,`timeScale`,1),this.startAt=i(e,`startAt`,0),this.paused=i(e,`paused`,!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`);return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var e=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/e}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(e){e===void 0&&(e=!1),this.elapsed=this.delay,this.hasDispatched=!e,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}})}),35945:(e=>{e.exports=`complete`}),89809:((e,t,n)=>{e.exports={COMPLETE:n(35945)}}),90291:((e,t,n)=>{e.exports={Clock:n(33385),Events:n(89809),Timeline:n(96120),TimerEvent:n(94880)}}),40382:((e,t,n)=>{var r=n(72905),i=n(83419),a=n(43491),o=n(88032),s=n(37277),c=n(44594),l=n(93109),u=n(86081),d=n(8357),f=n(43960),p=n(26012),m=new i({initialize:function(e){this.scene=e,this.events=e.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(c.BOOT,this.boot,this),this.events.on(c.START,this.start,this)},boot:function(){this.events.once(c.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(c.UPDATE,this.update,this),this.events.once(c.SHUTDOWN,this.shutdown,this)},create:function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0;n-1},existing:function(e){return this.has(e)||this.tweens.push(e.reset()),this},addCounter:function(e){var t=o(this,e);return this.tweens.push(t.reset()),t},stagger:function(e,t){return l(e,t)},setLagSmooth:function(e,t){return e===void 0&&(e=1/1e-8),t===void 0&&(t=0),this.maxLag=e,this.lagSkip=Math.min(t,this.maxLag),this},setFps:function(e){return e===void 0&&(e=240),this.gap=1e3/e,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(e){var t=Date.now()-this.prevTime;t>this.maxLag&&(this.startTime+=t-this.lagSkip),this.prevTime+=t;var n=this.prevTime-this.startTime,r=n-this.nextTime,i=n-this.time*1e3;return r>0||e?(n/=1e3,this.time=n,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):i=0,i},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(e){e===void 0&&(e=!1);var t=this.getDelta(e);if(!(t<=0)){this.processing=!0;var n,r,i=[],a=this.tweens;for(n=0;n0){for(n=0;n-1&&(r.isPendingRemove()||r.isDestroyed())&&(a.splice(s,1),r.destroy())}i.length=0}this.processing=!1}},remove:function(e){return this.processing?e.setPendingRemoveState():(r(this.tweens,e),e.setRemovedState()),this},reset:function(e){return this.existing(e),e.seek(),e.setActiveState(),this},makeActive:function(e){return this.existing(e),e.setActiveState(),this},each:function(e,t){var n,r=[null];for(n=1;n{e.exports=function(e,t,n){return e&&e.hasOwnProperty(t)?e[t]:n}}),6113:((e,t,n)=>{var r=n(62640),i=n(35355);e.exports=function(e,t){var n=r.Power0;if(typeof e==`string`)if(r.hasOwnProperty(e))n=r[e];else{var a=``;if(e.indexOf(`.`)){a=e.substring(e.indexOf(`.`)+1);var o=a.toLowerCase();o===`in`?a=`easeIn`:o===`out`?a=`easeOut`:o===`inout`&&(a=`easeInOut`)}e=i(e.substring(0,e.indexOf(`.`)+1)+a),r.hasOwnProperty(e)&&(n=r[e])}else typeof e==`function`&&(n=e);if(!t)return n;var s=t.slice(0);return s.unshift(0),function(e){return s[0]=e,n.apply(this,s)}}}),91389:((e,t,n)=>{var r=n(89318),i=n(77259),a={bezier:r,catmull:i,catmullrom:i,linear:n(28392)};e.exports=function(e){if(e===null)return null;var t=a.linear;return typeof e==`string`?a.hasOwnProperty(e)&&(t=a[e]):typeof e==`function`&&(t=e),t}}),55292:(e=>{e.exports=function(e,t,n){return e.hasOwnProperty(t)?typeof e[t]==`function`?function(n,r,i,a,o,s){return e[t](n,r,i,a,o,s)}:function(){return e[t]}:typeof n==`function`?n:function(){return n}}}),82985:((e,t,n)=>{var r=n(81076);e.exports=function(e){var t,n=[];if(e.hasOwnProperty(`props`))for(t in e.props)t.substring(0,1)!==`_`&&n.push({key:t,value:e.props[t]});else for(t in e)r.indexOf(t)===-1&&t.substring(0,1)!==`_`&&n.push({key:t,value:e[t]});return n}}),62329:((e,t,n)=>{var r=n(35154);e.exports=function(e){var t=r(e,`targets`,null);return t===null?t:(typeof t==`function`&&(t=t.call()),Array.isArray(t)||(t=[t]),t)}}),17777:((e,t,n)=>{var r=n(30976),i=n(99472);function a(e){return!!e.getActive&&typeof e.getActive==`function`}function o(e){return!!e.getStart&&typeof e.getStart==`function`}function s(e){return!!e.getEnd&&typeof e.getEnd==`function`}function c(e){return o(e)||s(e)||a(e)}var l=function(e,t){var n,u=function(e,t,n){return n},d=function(e,t,n){return n},f=null,p=typeof t;if(p===`number`)u=function(){return t};else if(Array.isArray(t))d=function(){return t[0]},u=function(){return t[t.length-1]};else if(p===`string`){var m=t.toLowerCase(),h=m.substring(0,6)===`random`,g=m.substring(0,3)===`int`;if(h||g){var _=m.indexOf(`(`),v=m.indexOf(`)`),y=m.indexOf(`,`);if(_&&v&&y){var b=parseFloat(m.substring(_+1,y)),x=parseFloat(m.substring(y+1,v));u=h?function(){return i(b,x)}:function(){return r(b,x)}}else throw Error(`invalid random() format`)}else{m=m[0];var S=parseFloat(t.substr(2));switch(m){case`+`:u=function(e,t,n){return n+S};break;case`-`:u=function(e,t,n){return n-S};break;case`*`:u=function(e,t,n){return n*S};break;case`/`:u=function(e,t,n){return n/S};break;default:u=function(){return parseFloat(t)}}}}else if(p===`function`)u=t;else if(p===`object`)if(c(t))a(t)&&(f=t.getActive),s(t)&&(u=t.getEnd),o(t)&&(d=t.getStart);else if(t.hasOwnProperty(`value`))n=l(e,t.value);else{var C=t.hasOwnProperty(`to`),w=t.hasOwnProperty(`from`),T=t.hasOwnProperty(`start`);if(C&&(w||T)){if(n=l(e,t.to),T){var E=l(e,t.start);n.getActive=E.getEnd}if(w){var D=l(e,t.from);n.getStart=D.getEnd}}}return n||={getActive:f,getEnd:u,getStart:d},n};e.exports=l}),88032:((e,t,n)=>{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(55292),u=n(35154),d=n(17777),f=n(269),p=n(86081);e.exports=function(e,t,n){if(t instanceof p)return t.parent=e,t;n=n===void 0?i:f(i,n);var m=c(t,`from`,0),h=c(t,`to`,1),g=[{value:m}],_=c(t,`delay`,n.delay),v=c(t,`easeParams`,n.easeParams),y=c(t,`ease`,n.ease),b=d(`value`,h),x=new p(e,g),S=x.add(0,`value`,b.getEnd,b.getStart,b.getActive,s(c(t,`ease`,y),c(t,`easeParams`,v)),l(t,`delay`,_),c(t,`duration`,n.duration),o(t,`yoyo`,n.yoyo),c(t,`hold`,n.hold),c(t,`repeat`,n.repeat),c(t,`repeatDelay`,n.repeatDelay),!1,!1);S.start=m,S.current=m,x.completeDelay=a(t,`completeDelay`,0),x.loop=Math.round(a(t,`loop`,0)),x.loopDelay=Math.round(a(t,`loopDelay`,0)),x.paused=o(t,`paused`,!1),x.persist=o(t,`persist`,!1),x.isNumberTween=!0,x.callbackScope=u(t,`callbackScope`,x);for(var C=r.TYPES,w=0;w{var r=n(6113),i=n(35154),a=n(36383);e.exports=function(e,t){t===void 0&&(t={});var n,o=i(t,`start`,0),s=i(t,`ease`,null),c=i(t,`grid`,null),l=i(t,`from`,0),u=l===`first`,d=l===`center`,f=l===`last`,p=typeof l==`number`,m=Array.isArray(e),h=parseFloat(m?e[0]:e),g=m?parseFloat(e[1]):0,_=Math.max(h,g);if(m&&(o+=h),c){var v=c[0],y=c[1],b=0,x=0,S=0,C=0,w=[];f?(b=v-1,x=y-1):p?(b=l%v,x=Math.floor(l/v)):d&&(b=(v-1)/2,x=(y-1)/2);for(var T=a.MIN_SAFE_INTEGER,E=0;ET&&(T=O),w[E][D]=O}}}var k=s?r(s):null;return n=c?function(e,t,n,r){var i=0,a=r%v,s=Math.floor(r/v);a>=0&&a=0&&s{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(91389),u=n(55292),d=n(82985),f=n(62329),p=n(35154),m=n(17777),h=n(269),g=n(86081);e.exports=function(e,t,n){if(t instanceof g)return t.parent=e,t;n=n===void 0?i:h(i,n);var _=f(t);!_&&n.targets&&(_=n.targets);for(var v=d(t),y=c(t,`delay`,n.delay),b=c(t,`duration`,n.duration),x=c(t,`easeParams`,n.easeParams),S=c(t,`ease`,n.ease),C=c(t,`hold`,n.hold),w=c(t,`repeat`,n.repeat),T=c(t,`repeatDelay`,n.repeatDelay),E=o(t,`yoyo`,n.yoyo),D=o(t,`flipX`,n.flipX),O=o(t,`flipY`,n.flipY),k=c(t,`interpolation`,n.interpolation),A=function(e,t,n,r){if(n===`texture`){var i=r,a=void 0;Array.isArray(r)?(i=r[0],a=r[1]):r.hasOwnProperty(`value`)?(i=r.value,Array.isArray(r.value)?(i=r.value[0],a=r.value[1]):typeof r.value==`string`&&(i=r.value)):typeof r==`string`&&(i=r),e.addFrame(t,i,a,u(r,`delay`,y),c(r,`duration`,b),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O))}else{var d=m(n,r),f=l(c(r,`interpolation`,k));e.add(t,n,d.getEnd,d.getStart,d.getActive,s(c(r,`ease`,S),c(r,`easeParams`,x)),u(r,`delay`,y),c(r,`duration`,b),o(r,`yoyo`,E),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O),f,f?r:null)}},j=new g(e,_),M=0;M{var r=n(70402),i=n(23568),a=n(57355),o=n(62329),s=n(35154),c=n(8357),l=n(43960);e.exports=function(e,t){if(t instanceof l)return t.parent=e,t;var n=new l(e);n.startDelay=s(t,`delay`,0),n.completeDelay=i(t,`completeDelay`,0),n.loop=Math.round(i(t,`loop`,s(t,`repeat`,0))),n.loopDelay=Math.round(i(t,`loopDelay`,s(t,`repeatDelay`,0))),n.paused=a(t,`paused`,!1),n.persist=a(t,`persist`,!1),n.callbackScope=s(t,`callbackScope`,n);var u,d=r.TYPES;for(u=0;u{e.exports={GetBoolean:n(57355),GetEaseFunction:n(6113),GetInterpolationFunction:n(91389),GetNewValue:n(55292),GetProps:n(82985),GetTargets:n(62329),GetValueOp:n(17777),NumberTweenBuilder:n(88032),StaggerBuilder:n(93109),TweenBuilder:n(8357)}}),73685:(e=>{e.exports=`active`}),98540:(e=>{e.exports=`complete`}),67233:(e=>{e.exports=`loop`}),2859:(e=>{e.exports=`pause`}),98336:(e=>{e.exports=`repeat`}),25764:(e=>{e.exports=`resume`}),32193:(e=>{e.exports=`start`}),84371:(e=>{e.exports=`stop`}),70766:(e=>{e.exports=`update`}),55659:(e=>{e.exports=`yoyo`}),842:((e,t,n)=>{e.exports={TWEEN_ACTIVE:n(73685),TWEEN_COMPLETE:n(98540),TWEEN_LOOP:n(67233),TWEEN_PAUSE:n(2859),TWEEN_RESUME:n(25764),TWEEN_REPEAT:n(98336),TWEEN_START:n(32193),TWEEN_STOP:n(84371),TWEEN_UPDATE:n(70766),TWEEN_YOYO:n(55659)}}),43066:((e,t,n)=>{e.exports={States:n(86353),Builders:n(30231),Events:n(842),TweenManager:n(40382),Tween:n(86081),TweenData:n(48177),TweenFrameData:n(42220),BaseTween:n(70402),TweenChain:n(43960)}}),70402:((e,t,n)=>{var r=n(83419),i=n(50792),a=n(842),o=n(86353),s=new r({Extends:i,initialize:function(e){i.call(this),this.parent=e,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=o.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(e){return this.timeScale=e,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(a.TWEEN_PAUSE,`onPause`)),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(a.TWEEN_RESUME,`onResume`)),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(a.TWEEN_COMPLETE,`onComplete`)},complete:function(e){return e===void 0&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return e===void 0&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(a.TWEEN_STOP,`onStop`),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(a.TWEEN_START,`onStart`),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,t,n){return n===void 0&&(n=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:t,params:n}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});s.TYPES=[`onActive`,`onComplete`,`onLoop`,`onPause`,`onRepeat`,`onResume`,`onStart`,`onStop`,`onUpdate`,`onYoyo`],e.exports=s}),95042:((e,t,n)=>{var r=n(83419),i=n(842),a=n(86353);e.exports=new r({initialize:function(e,t,n,r,i,a,o,s,c,l){this.tween=e,this.targetIndex=t,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=n,this.yoyo=i,this.hold=a,this.repeat=o,this.repeatDelay=s,this.repeatCounter=0,this.flipX=c,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(e){e===void 0&&(e=this.current),this.tween.targets[this.targetIndex][this.key]=e},setCreatedState:function(){this.state=a.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=a.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=a.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=a.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=a.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=a.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=a.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=a.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===a.CREATED},isDelayed:function(){return this.state===a.DELAY},isPendingRender:function(){return this.state===a.PENDING_RENDER},isPlayingForward:function(){return this.state===a.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===a.PLAYING_BACKWARD},isHolding:function(){return this.state===a.HOLD_DELAY},isRepeating:function(){return this.state===a.REPEAT_DELAY},isComplete:function(){return this.state===a.COMPLETE},setStateFromEnd:function(e){this.yoyo?this.onRepeat(e,!0,!0):this.repeatCounter>0?this.onRepeat(e,!0,!1):this.setCompleteState()},setStateFromStart:function(e){this.repeatCounter>0?this.onRepeat(e,!1):this.setCompleteState()},reset:function(){var e=this.tween,t=e.totalTargets,n=this.targetIndex,r=e.targets[n],i=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,i,0,n,t,e),this.repeatCounter=this.repeat===-1?a.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var s=o+this.repeatDelay;this.totalDuration=this.delay+o,this.repeat===-1?(this.totalDuration+=s*a.MAX,e.isInfinite=!0):this.repeat>0&&(this.totalDuration+=s*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(e,t,n){var r=this.tween,a=r.totalTargets,o=this.targetIndex,s=r.targets[o],c=this.key,l=c!==`texture`;if(this.elapsed=e,this.progress=e/this.duration,this.flipX&&s.toggleFlipX(),this.flipY&&s.toggleFlipY(),l&&(t||n)&&(this.start=this.getStartValue(s,c,this.start,o,a,r)),n){this.setPlayingBackwardState(),this.dispatchEvent(i.TWEEN_YOYO,`onYoyo`);return}this.repeatCounter--,l&&(this.end=this.getEndValue(s,c,this.start,o,a,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-e,l&&(this.current=this.start,s[c]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(i.TWEEN_REPEAT,`onRepeat`))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}})}),69902:(e=>{e.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:(e=>{e.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`.split(`.`)}),86081:((e,t,n)=>{var r=n(70402),i=n(83419),a=n(842),o=n(44603),s=n(39429),c=n(36383),l=n(86353),u=n(48177),d=n(42220),f=new i({Extends:r,initialize:function(e,t){r.call(this,e),this.targets=t,this.totalTargets=t.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(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g){var _=new u(this,e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g);return this.totalData=this.data.push(_),_},addFrame:function(e,t,n,r,i,a,o,s,c,l){var u=new d(this,e,t,n,r,i,a,o,s,c,l);return this.totalData=this.data.push(u),u},getValue:function(e){e===void 0&&(e=0);var t=null;return this.data&&(t=this.data[e].current),t},hasTarget:function(e){return this.targets&&this.targets.indexOf(e)!==-1},updateTo:function(e,t,n){if(n===void 0&&(n=!1),e!==`texture`)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.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(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=16.6),n===void 0&&(n=!1),this.isDestroyed())return console.warn(`Cannot seek destroyed Tween`,this),this;n||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`);var r=this.paused;if(this.paused=!1,e>0){for(var i=Math.floor(e/t),o=e-i*t,s=0;s0&&this.update(o)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(e){e===void 0&&(e=!1),this.duration=0,this.startDelay=c.MAX_SAFE_INTEGER;for(var t=this.data,n=0;n0?this.totalDuration=r+i+(r+o)*a:this.totalDuration=r+i},reset:function(e){return e===void 0&&(e=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=l.MAX),e||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)),this},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return this.persist?(this.setFinishedState(),!1):!0;if(this.paused||this.isFinished())return!1;if(e*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,`onStart`),e=0));var t=!1;if(this.isActive())for(var n=this.data,r=0;r{var r=n(72905),i=n(70402),a=n(83419),o=n(842),s=n(44603),c=n(39429),l=n(86353),u=new a({Extends:i,initialize:function(e){i.call(this,e),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(e){var t=this.parent.create(e);Array.isArray(t)||(t=[t]);for(var n=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;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 e=this.data,t=this.totalData,n=0;n{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g,_){r.call(this,e,t,c,l,u,d,f,p,m,h),this.key=n,this.getActiveValue=o,this.getEndValue=i,this.getStartValue=a,this.ease=s,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=_},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex],n=this.key;e&&(t[n]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(t[n]=this.getActiveValue(t,n,0))},update:function(e){var t=this.tween,n=t.totalTargets,r=this.targetIndex,a=t.targets[r],s=this.key;if(!a)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(a,s,a[s],r,n,t),this.end=this.getEndValue(a,s,this.start,r,n,t),this.current=this.start,a[s]=this.start,this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),l=this.isPlayingBackward();if(c||l){var u=this.elapsed,d=this.duration,f=0,p=!1;u+=e,u>=d?(f=u-d,u=d,p=!0):u<0&&(u=0);var m=i(u/d,0,1);this.elapsed=u,this.progress=m,this.previous=this.current,c||(m=1-m);var h=this.ease(m);this.interpolation?this.current=this.interpolation(this.interpolationData,h):this.current=this.start+(this.end-this.start)*h,a[s]=this.current,p&&(c?(t.isNumberTween&&(this.current=this.end,a[s]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(f)):(t.isNumberTween&&(this.current=this.start,a[s]=this.current),this.setStateFromStart(f))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key,a=this.current,o=this.previous;n.emit(e,n,i,r,a,o);var s=n.callbacks[t];s&&s.func.apply(n.callbackScope,[n,r,i,a,o].concat(s.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}})}),42220:((e,t,n)=>{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d){r.call(this,e,t,a,o,!1,s,c,l,u,d),this.key=`texture`,this.startTexture=null,this.endTexture=n,this.startFrame=null,this.endFrame=i,this.yoyo=c!==0},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=t.texture.key,this.startFrame=t.frame.name),e&&t.setTexture(this.startTexture,this.startFrame)},update:function(e){var t=this.tween,n=this.targetIndex,r=t.targets[n];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),s=this.isPlayingBackward();if(a||s){var c=this.elapsed,l=this.duration,u=0,d=!1;c+=e,c>=l?(u=c-l,c=l,d=!0):c<0&&(c=0);var f=i(c/l,0,1);this.elapsed=c,this.progress=f,d&&(a?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key;n.emit(e,n,i,r);var a=n.callbacks[t];a&&a.func.apply(n.callbackScope,[n,r,i].concat(a.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}})}),86353:(e=>{e.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:(e=>{function t(e){return!!e.get&&typeof e.get==`function`||!!e.set&&typeof e.set==`function`}function n(e,n,r){var i=r?e[n]:Object.getOwnPropertyDescriptor(e,n);return!r&&i.value&&typeof i.value==`object`&&(i=i.value),i&&t(i)?(i.enumerable===void 0&&(i.enumerable=!0),i.configurable===void 0&&(i.configurable=!0),i):!1}function r(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return n?(n.value&&typeof n.value==`object`&&(n=n.value),n.configurable===!1):!1}function i(e,t,i,a){for(var s in t)if(t.hasOwnProperty(s)){var c=n(t,s,i);if(c!==!1){if(r((a||e).prototype,s)){if(o.ignoreFinals)continue;throw Error(`cannot override final property '`+s+`', set Class.ignoreFinals = true to skip`)}Object.defineProperty(e.prototype,s,c)}else e.prototype[s]=t[s]}}function a(e,t){if(t){Array.isArray(t)||(t=[t]);for(var n=0;n{e.exports=function(){}}),20242:(e=>{e.exports=function(){return null}}),71146:(e=>{e.exports=function(e,t,n,r,i){if(i===void 0&&(i=e),n>0){var a=n-e.length;if(a<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.push(t),r&&r.call(i,t),t):null;for(var o=t.length-1;o>=0;)e.indexOf(t[o])!==-1&&t.splice(o,1),o--;if(o=t.length,o===0)return null;n>0&&o>a&&(t.splice(a),o=a);for(var s=0;s{e.exports=function(e,t,n,r,i,a){if(n===void 0&&(n=0),a===void 0&&(a=e),r>0){var o=r-e.length;if(o<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.splice(n,0,t),i&&i.call(a,t),t):null;for(var s=t.length-1;s>=0;)e.indexOf(t[s])!==-1&&t.pop(),s--;if(s=t.length,s===0)return null;r>0&&s>o&&(t.splice(o),s=o);for(var c=s-1;c>=0;c--){var l=t[c];e.splice(n,0,l),i&&i.call(a,l)}return t}}),66905:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=0;if(r(e,i,a))for(var s=i;s{e.exports=function(e,t,n){var r,i=[null];for(r=3;r{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a)){var o,s=[null];for(o=5;o{e.exports=function(e,t,n){if(!t.length)return NaN;if(t.length===1)return t[0];var r=1,i,a;if(n){if(et.length&&(r=t.length),n?(i=t[r-1][n],a=t[r][n],a-e<=e-i?t[r]:t[r-1]):(i=t[r-1],a=t[r],a-e<=e-i?a:i)}}),43491:(e=>{var t=function(e,n){n===void 0&&(n=[]);for(var r=0;r{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=[];if(r(e,i,a))for(var s=i;s{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),i!==-1){if(r(e,i,a))for(var o=i;o=0;o--){var s=e[o];if(!t||t&&n===void 0&&s.hasOwnProperty(t)||t&&n!==void 0&&s[t]===n)return s}return null}}),26546:(e=>{e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=e.length);var r=t+Math.floor(Math.random()*n);return e[r]===void 0?null:e[r]}}),85835:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r>i?e:(e.splice(r,1),i=e.indexOf(n),e.splice(i+1,0,t),e)}}),83371:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r{e.exports=function(e,t){var n=e.indexOf(t);if(n>0){var r=e[n-1],i=e.indexOf(r);e[n]=r,e[i]=t}return e}}),69693:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t);if(r===-1||n<0||n>=e.length)throw Error(`Supplied index out of bounds`);return r!==n&&(e.splice(r,1),e.splice(n,0,t)),t}}),40853:(e=>{e.exports=function(e,t){var n=e.indexOf(t);if(n!==-1&&n{e.exports=function(e,t,n,r){var i=[],a,o=!1;if((n||r)&&(o=!0,n||=``,r||=``),t=t;a--)o?i.push(n+a.toString()+r):i.push(a);else for(a=e;a<=t;a++)o?i.push(n+a.toString()+r):i.push(a);return i}}),593:((e,t,n)=>{var r=n(2284);e.exports=function(e,t,n){e===void 0&&(e=0),t===void 0&&(t=null),n===void 0&&(n=1),t===null&&(t=e,e=0);for(var i=[],a=Math.max(r((t-e)/(n||1)),0),o=0;o{function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e,i,a,o,s){for(a===void 0&&(a=0),o===void 0&&(o=e.length-1),s===void 0&&(s=n);o>a;){if(o-a>600){var c=o-a+1,l=i-a+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(l-c/2<0?-1:1);r(e,i,Math.max(a,Math.floor(i-l*d/c+f)),Math.min(o,Math.floor(i+(c-l)*d/c+f)),s)}var p=e[i],m=a,h=o;for(t(e,a,i),s(e[o],p)>0&&t(e,a,o);m0;)h--}s(e[a],p)===0?t(e,a,h):(h++,t(e,h,o)),h<=i&&(a=h+1),i<=h&&(o=h-1)}};e.exports=r}),88492:((e,t,n)=>{var r=n(35154),i=n(33680),a=function(e,t,n){for(var r=[],i=0;i{var r=n(19133);e.exports=function(e,t,n,i){i===void 0&&(i=e);var a;if(!Array.isArray(t))return a=e.indexOf(t),a===-1?null:(r(e,a),n&&n.call(i,t),t);for(var o=t.length-1,s=[];o>=0;){var c=t[o];a=e.indexOf(c),a!==-1&&(r(e,a),s.push(c),n&&n.call(i,c)),o--}return s}}),60248:((e,t,n)=>{var r=n(19133);e.exports=function(e,t,n,i){if(i===void 0&&(i=e),t<0||t>e.length-1)throw Error(`Index out of bounds`);var a=r(e,t);return n&&n.call(i,a),a}}),81409:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(t===void 0&&(t=0),n===void 0&&(n=e.length),a===void 0&&(a=e),r(e,t,n)){var o=n-t,s=e.splice(t,o);if(i)for(var c=0;c{var r=n(19133);e.exports=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.length),r(e,t+Math.floor(Math.random()*n))}}),42169:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t),i=e.indexOf(n);return r!==-1&&i===-1?(e[r]=n,!0):!1}}),86003:(e=>{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t,n,r){var i=e.length;if(t<0||t>=i||t>=n||n>i){if(r)throw Error(`Range Error: Values outside acceptable range`);return!1}else return!0}}),89545:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n>0&&(e.splice(n,1),e.unshift(t)),t}}),17810:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a))for(var o=i;o{e.exports=function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}}),90126:(e=>{e.exports=function(e){var t=/\D/g;return e.sort(function(e,n){return parseInt(e.replace(t,``),10)-parseInt(n.replace(t,``),10)}),e}}),19133:(e=>{e.exports=function(e,t){if(!(t>=e.length)){for(var n=e.length-1,r=e[t],i=t;i{var r=n(82264);function i(e,t){return String(e).localeCompare(t)}function a(e,t){var n=e.length;if(n<=1)return e;for(var r=Array(n),i=1;ii&&(c=i),l>i&&(l=i),u=s,d=c;;)if(u{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return e[r]=n,e[i]=t,e}}),37105:((e,t,n)=>{e.exports={Matrix:n(54915),Add:n(71146),AddAt:n(51067),BringToTop:n(66905),CountAllMatching:n(21612),Each:n(95428),EachInRange:n(36914),FindClosestInSorted:n(81957),Flatten:n(43491),GetAll:n(46710),GetFirst:n(58731),GetRandom:n(26546),MoveDown:n(70864),MoveTo:n(69693),MoveUp:n(40853),MoveAbove:n(85835),MoveBelow:n(83371),NumberArray:n(20283),NumberArrayStep:n(593),QuickSelect:n(43886),Range:n(88492),Remove:n(72905),RemoveAt:n(60248),RemoveBetween:n(81409),RemoveRandomElement:n(31856),Replace:n(42169),RotateLeft:n(86003),RotateRight:n(49498),SafeRange:n(82011),SendToBack:n(89545),SetAll:n(17810),Shuffle:n(33680),SortByDigits:n(90126),SpliceOne:n(19133),StableSort:n(19186),Swap:n(25630)}}),86922:(e=>{e.exports=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var t=e[0].length,n=1;n{var r=n(41836),i=n(86922);e.exports=function(e){var t=``;if(!i(e))return t;for(var n=0;n{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),kt=V(),At=V(),jt=V();V();function Mt(){let e=H(jt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function Nt(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Pt(e,t,n){Be(),P(()=>{e.update(t,n)}),Ve()}function Ft(e,t){return new Promise(n=>{let r=Nt(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Pt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:Ot.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new Ot.default.Game(o)})}function It(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&Ft(r,e).then(t=>{n(t),Ce(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=_t(()=>fe(kt.Provider,{value:t.game,get children(){return fe(At.Provider,{value:t.scene,get children(){return fe(jt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),I(()=>{let e=F(t);i&&i(),e&&(we(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}function Lt(e){return I(Mt().register(e.onUpdate)),null}var Rt=10;function zt(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)zt(r,t,n);return}if(typeof e==`function`){if(n>=Rt)return;zt(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),ke(e))){let r=Oe(e);for(let e of r.children)zt(e,t,n)}}}function Bt(e){let t=e.children;return M(()=>{zt(t,!!e.when)}),t}He();var Vt=400,Ht=600,Ut=80,Wt=36,Gt=38,Kt=900,qt=-280,Jt=500,Yt=52,Xt=150,Zt=160,Qt=Vt+Yt,$t=200,en=4,tn=Ht-60,nn=1710638;function rn(){let[e,t]=j(0),[n,r]=j(0),[i,a]=j(`ready`),[o,s]=j(Ht/2.5),[c,l]=j(0),u=0,d=Array.from({length:en},()=>({x:-100,gapY:300,scored:!1,active:!1})),f=d.map(()=>j({x:-100,gapY:300,active:!1})),p=Qt;function m(e){let t=d[e];f[e][1]({x:t.x,gapY:t.gapY,active:t.active})}function h(){for(let e=0;e!e.active);if(e===-1)return;let t=d[e],n=80+Xt/2,r=tn-20-Xt/2;t.gapY=n+Math.random()*(r-n),t.x=p,t.scored=!1,t.active=!0,m(e),p+=$t}function _(e,t,n){let r=t*Math.PI/180;return{x:Ut+n*Math.sin(r),y:e+n*Math.cos(r)}}let v=()=>{if(i()!==`dead`){if(i()===`ready`){a(`play`),h();for(let e=0;e{P(()=>{a(`dead`),e()>n()&&r(e())})},b=()=>{P(()=>{t(0),s(Ht/2.5),l(0),u=0,a(`ready`),h()})},x=()=>{i()===`dead`?b():v()},S=e=>{e.code===`Space`&&(e.preventDefault(),i()===`dead`?b():v())};document.addEventListener(`keydown`,S),I(()=>document.removeEventListener(`keydown`,S));let C=0,w=()=>{We({phase:i(),score:e(),best:n(),diskY:o(),activeHeads:d.filter(e=>e.active).length})},T=(e,n)=>{C-=n,C<=0&&(C=200,w());let r=i();if(r===`ready`){let e=performance.now()/1e3;s(Ht/2.5+Math.sin(e*2.5)*8),l(0);return}if(r===`dead`)return;let a=Math.min(n/1e3,.033);u=Math.min(u+Kt*a,Jt);let f=o()+u*a,p=Ot.default.Math.Clamp(u*.08,-25,70),h=c(),_=u>0?3:8,v=h+(p-h)*Math.min(_*a,1);if(f=tn){f=tn-Gt/2,y(),P(()=>{s(f),l(v)});return}let b=Zt*a;for(let e=0;ee+1));let r=Ut-Wt/2+4,i=Ut+Wt/2-4,a=f-Gt/2+4,o=f+Gt/2-4,c=n.x-Yt/2,u=n.x+Yt/2,p=n.gapY-Xt/2,h=n.gapY+Xt/2;if(i>c&&rh)){y(),P(()=>{s(f),l(v)});return}m(e)}P(()=>{s(f),l(v)})},E=()=>{let t=i();return t===`ready`?[`FLOPPY HEADS`,`#e0e0ff`,`click or press space to flap`]:t===`dead`?[`EJECT!`,`#ff6666`,`score: ${e()} \u2014 click to retry`]:null},D=()=>{let e=i();return e===`ready`?n()>0?`best: ${n()}`:``:e===`dead`?`best: ${n()}`:``};return bt(It,{width:Vt,height:Ht,backgroundColor:nn,parent:`game-container`,onPointerDown:x,get children(){return[bt(Lt,{onUpdate:T}),(()=>{var e=xt(`rectangle`);return $(e,`x`,200),$(e,`y`,300),$(e,`width`,400),$(e,`height`,600),$(e,`fillColor`,1710638),$(e,`origin`,.5),$(e,`depth`,0),e})(),(()=>{var e=xt(`rectangle`);return $(e,`x`,200),$(e,`y`,570),$(e,`width`,400),$(e,`height`,60),$(e,`fillColor`,2763326),$(e,`origin`,.5),$(e,`depth`,6),e})(),(()=>{var e=xt(`rectangle`);return $(e,`x`,200),$(e,`y`,540),$(e,`width`,400),$(e,`height`,3),$(e,`fillColor`,4868718),$(e,`origin`,.5),$(e,`depth`,7),e})(),yt(()=>f.map(([e])=>{let t=()=>e().gapY-Xt/2,n=()=>e().gapY+Xt/2;return[(()=>{var n=xt(`rectangle`);return $(n,`width`,52),$(n,`height`,600),$(n,`fillColor`,6710920),$(n,`originX`,.5),$(n,`originY`,1),$(n,`depth`,3),vt(r=>{var i=e().x,a=t();return i!==r.e&&(r.e=$(n,`x`,i,r.e)),a!==r.t&&(r.t=$(n,`y`,a,r.t)),r},{e:void 0,t:void 0}),n})(),(()=>{var n=xt(`rectangle`);return $(n,`width`,60),$(n,`height`,16),$(n,`fillColor`,11184844),$(n,`originX`,.5),$(n,`originY`,1),$(n,`depth`,4),vt(r=>{var i=e().x,a=t();return i!==r.e&&(r.e=$(n,`x`,i,r.e)),a!==r.t&&(r.t=$(n,`y`,a,r.t)),r},{e:void 0,t:void 0}),n})(),(()=>{var t=xt(`rectangle`);return $(t,`width`,52),$(t,`height`,600),$(t,`fillColor`,6710920),$(t,`originX`,.5),$(t,`originY`,0),$(t,`depth`,3),vt(r=>{var i=e().x,a=n();return i!==r.e&&(r.e=$(t,`x`,i,r.e)),a!==r.t&&(r.t=$(t,`y`,a,r.t)),r},{e:void 0,t:void 0}),t})(),(()=>{var t=xt(`rectangle`);return $(t,`width`,60),$(t,`height`,16),$(t,`fillColor`,11184844),$(t,`originX`,.5),$(t,`originY`,0),$(t,`depth`,4),vt(r=>{var i=e().x,a=n();return i!==r.e&&(r.e=$(t,`x`,i,r.e)),a!==r.t&&(r.t=$(t,`y`,a,r.t)),r},{e:void 0,t:void 0}),t})()]})),(()=>{var e=xt(`rectangle`);return $(e,`width`,36),$(e,`height`,38),$(e,`fillColor`,8947882),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),0).x,r=_(o(),c(),0).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=xt(`rectangle`);return $(e,`width`,30),$(e,`height`,8),$(e,`fillColor`,5592439),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),-Gt/2+4).x,r=_(o(),c(),-Gt/2+4).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=xt(`rectangle`);return $(e,`width`,28),$(e,`height`,14),$(e,`fillColor`,3368618),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),4).x,r=_(o(),c(),4).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=xt(`rectangle`);return $(e,`width`,8),$(e,`height`,8),$(e,`fillColor`,4473958),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),Gt/2-8).x,r=_(o(),c(),Gt/2-8).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),bt(Bt,{get when(){return i()===`play`},get children(){var t=xt(`text`);return $(t,`x`,200),$(t,`y`,50),$(t,`fontSize`,48),$(t,`fontFamily`,`monospace`),$(t,`color`,`#e0e0ff`),$(t,`origin`,.5),$(t,`depth`,10),vt(n=>$(t,`text`,`${e()}`,n)),t}}),bt(Bt,{get when(){return i()!==`play`},get children(){return[(()=>{var e=xt(`text`);return $(e,`x`,200),$(e,`y`,260),$(e,`fontSize`,28),$(e,`fontFamily`,`monospace`),$(e,`origin`,.5),$(e,`depth`,10),vt(t=>{var n=E()?E()[0]:``,r=E()?E()[1]:`#ffffff`;return n!==t.e&&(t.e=$(e,`text`,n,t.e)),r!==t.t&&(t.t=$(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=xt(`text`);return $(e,`x`,200),$(e,`y`,310),$(e,`fontSize`,14),$(e,`fontFamily`,`monospace`),$(e,`color`,`#8888aa`),$(e,`origin`,.5),$(e,`depth`,10),vt(t=>$(e,`text`,E()?E()[2]:``,t)),e})(),(()=>{var e=xt(`text`);return $(e,`x`,200),$(e,`y`,340),$(e,`fontSize`,14),$(e,`fontFamily`,`monospace`),$(e,`color`,`#6a6a8a`),$(e,`origin`,.5),$(e,`depth`,10),vt(t=>$(e,`text`,D(),t)),e})()]}})]}})}A(()=>{let e=rn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file +`}}return t}}),92598:(e=>{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),kt=V(),At=V(),jt=V();V();function Mt(){let e=H(jt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function Nt(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Pt(e,t,n){Be(),P(()=>{e.update(t,n)}),Ve()}function Ft(e,t){return new Promise(n=>{let r=Nt(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Pt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:Ot.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new Ot.default.Game(o)})}function It(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&Ft(r,e).then(t=>{n(t),Ce(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=_t(()=>fe(kt.Provider,{value:t.game,get children(){return fe(At.Provider,{value:t.scene,get children(){return fe(jt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),I(()=>{let e=F(t);i&&i(),e&&(we(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}var Lt=10;function Rt(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Rt(r,t,n);return}if(typeof e==`function`){if(n>=Lt)return;Rt(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),ke(e))){let r=Oe(e);for(let e of r.children)Rt(e,t,n)}}}function zt(e){return I(Mt().register(e.onUpdate)),null}function Bt(e){let t=e.children;return M(()=>{Rt(t,!!e.when)}),t}He();var Vt=400,Ht=600,Ut=80,Wt=36,Gt=38,Kt=900,qt=-280,Jt=500,Yt=52,Xt=150,Zt=160,Qt=Vt+Yt,$t=200,en=4,tn=Ht-60,nn=1710638;function rn(){let[e,t]=j(0),[n,r]=j(0),[i,a]=j(`ready`),[o,s]=j(Ht/2.5),[c,l]=j(0),u=0,d=Array.from({length:en},()=>({x:-100,gapY:300,scored:!1,active:!1})),f=d.map(()=>j({x:-100,gapY:300,active:!1})),p=Qt;function m(e){let t=d[e];f[e][1]({x:t.x,gapY:t.gapY,active:t.active})}function h(){for(let e=0;e!e.active);if(e===-1)return;let t=d[e],n=80+Xt/2,r=tn-20-Xt/2;t.gapY=n+Math.random()*(r-n),t.x=p,t.scored=!1,t.active=!0,m(e),p+=$t}function _(e,t,n){let r=t*Math.PI/180;return{x:Ut+n*Math.sin(r),y:e+n*Math.cos(r)}}let v=()=>{if(i()!==`dead`){if(i()===`ready`){a(`play`),h();for(let e=0;e{P(()=>{a(`dead`),e()>n()&&r(e())})},b=()=>{P(()=>{t(0),s(Ht/2.5),l(0),u=0,a(`ready`),h()})},x=()=>{i()===`dead`?b():v()},S=e=>{e.code===`Space`&&(e.preventDefault(),i()===`dead`?b():v())};document.addEventListener(`keydown`,S),I(()=>document.removeEventListener(`keydown`,S));let C=0,w=()=>{We({phase:i(),score:e(),best:n(),diskY:o(),activeHeads:d.filter(e=>e.active).length})},T=(e,n)=>{C-=n,C<=0&&(C=200,w());let r=i();if(r===`ready`){let e=performance.now()/1e3;s(Ht/2.5+Math.sin(e*2.5)*8),l(0);return}if(r===`dead`)return;let a=Math.min(n/1e3,.033);u=Math.min(u+Kt*a,Jt);let f=o()+u*a,p=Ot.default.Math.Clamp(u*.08,-25,70),h=c(),_=u>0?3:8,v=h+(p-h)*Math.min(_*a,1);if(f=tn){f=tn-Gt/2,y(),P(()=>{s(f),l(v)});return}let b=Zt*a;for(let e=0;ee+1));let r=Ut-Wt/2+4,i=Ut+Wt/2-4,a=f-Gt/2+4,o=f+Gt/2-4,c=n.x-Yt/2,u=n.x+Yt/2,p=n.gapY-Xt/2,h=n.gapY+Xt/2;if(i>c&&rh)){y(),P(()=>{s(f),l(v)});return}m(e)}P(()=>{s(f),l(v)})},E=()=>{let t=i();return t===`ready`?[`FLOPPY HEADS`,`#e0e0ff`,`click or press space to flap`]:t===`dead`?[`EJECT!`,`#ff6666`,`score: ${e()} \u2014 click to retry`]:null},D=()=>{let e=i();return e===`ready`?n()>0?`best: ${n()}`:``:e===`dead`?`best: ${n()}`:``};return bt(It,{width:Vt,height:Ht,backgroundColor:nn,parent:`game-container`,onPointerDown:x,get children(){return[bt(zt,{onUpdate:T}),(()=>{var e=xt(`rectangle`);return $(e,`x`,200),$(e,`y`,300),$(e,`width`,400),$(e,`height`,600),$(e,`fillColor`,1710638),$(e,`origin`,.5),$(e,`depth`,0),e})(),(()=>{var e=xt(`rectangle`);return $(e,`x`,200),$(e,`y`,570),$(e,`width`,400),$(e,`height`,60),$(e,`fillColor`,2763326),$(e,`origin`,.5),$(e,`depth`,6),e})(),(()=>{var e=xt(`rectangle`);return $(e,`x`,200),$(e,`y`,540),$(e,`width`,400),$(e,`height`,3),$(e,`fillColor`,4868718),$(e,`origin`,.5),$(e,`depth`,7),e})(),yt(()=>f.map(([e])=>{let t=()=>e().gapY-Xt/2,n=()=>e().gapY+Xt/2;return[(()=>{var n=xt(`rectangle`);return $(n,`width`,52),$(n,`height`,600),$(n,`fillColor`,6710920),$(n,`originX`,.5),$(n,`originY`,1),$(n,`depth`,3),vt(r=>{var i=e().x,a=t();return i!==r.e&&(r.e=$(n,`x`,i,r.e)),a!==r.t&&(r.t=$(n,`y`,a,r.t)),r},{e:void 0,t:void 0}),n})(),(()=>{var n=xt(`rectangle`);return $(n,`width`,60),$(n,`height`,16),$(n,`fillColor`,11184844),$(n,`originX`,.5),$(n,`originY`,1),$(n,`depth`,4),vt(r=>{var i=e().x,a=t();return i!==r.e&&(r.e=$(n,`x`,i,r.e)),a!==r.t&&(r.t=$(n,`y`,a,r.t)),r},{e:void 0,t:void 0}),n})(),(()=>{var t=xt(`rectangle`);return $(t,`width`,52),$(t,`height`,600),$(t,`fillColor`,6710920),$(t,`originX`,.5),$(t,`originY`,0),$(t,`depth`,3),vt(r=>{var i=e().x,a=n();return i!==r.e&&(r.e=$(t,`x`,i,r.e)),a!==r.t&&(r.t=$(t,`y`,a,r.t)),r},{e:void 0,t:void 0}),t})(),(()=>{var t=xt(`rectangle`);return $(t,`width`,60),$(t,`height`,16),$(t,`fillColor`,11184844),$(t,`originX`,.5),$(t,`originY`,0),$(t,`depth`,4),vt(r=>{var i=e().x,a=n();return i!==r.e&&(r.e=$(t,`x`,i,r.e)),a!==r.t&&(r.t=$(t,`y`,a,r.t)),r},{e:void 0,t:void 0}),t})()]})),(()=>{var e=xt(`rectangle`);return $(e,`width`,36),$(e,`height`,38),$(e,`fillColor`,8947882),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),0).x,r=_(o(),c(),0).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=xt(`rectangle`);return $(e,`width`,30),$(e,`height`,8),$(e,`fillColor`,5592439),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),-Gt/2+4).x,r=_(o(),c(),-Gt/2+4).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=xt(`rectangle`);return $(e,`width`,28),$(e,`height`,14),$(e,`fillColor`,3368618),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),4).x,r=_(o(),c(),4).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=xt(`rectangle`);return $(e,`width`,8),$(e,`height`,8),$(e,`fillColor`,4473958),$(e,`origin`,.5),$(e,`depth`,5),vt(t=>{var n=_(o(),c(),Gt/2-8).x,r=_(o(),c(),Gt/2-8).y,i=c();return n!==t.e&&(t.e=$(e,`x`,n,t.e)),r!==t.t&&(t.t=$(e,`y`,r,t.t)),i!==t.a&&(t.a=$(e,`angle`,i,t.a)),t},{e:void 0,t:void 0,a:void 0}),e})(),bt(Bt,{get when(){return i()===`play`},get children(){var t=xt(`text`);return $(t,`x`,200),$(t,`y`,50),$(t,`fontSize`,48),$(t,`fontFamily`,`monospace`),$(t,`color`,`#e0e0ff`),$(t,`origin`,.5),$(t,`depth`,10),vt(n=>$(t,`text`,`${e()}`,n)),t}}),bt(Bt,{get when(){return i()!==`play`},get children(){return[(()=>{var e=xt(`text`);return $(e,`x`,200),$(e,`y`,260),$(e,`fontSize`,28),$(e,`fontFamily`,`monospace`),$(e,`origin`,.5),$(e,`depth`,10),vt(t=>{var n=E()?E()[0]:``,r=E()?E()[1]:`#ffffff`;return n!==t.e&&(t.e=$(e,`text`,n,t.e)),r!==t.t&&(t.t=$(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=xt(`text`);return $(e,`x`,200),$(e,`y`,310),$(e,`fontSize`,14),$(e,`fontFamily`,`monospace`),$(e,`color`,`#8888aa`),$(e,`origin`,.5),$(e,`depth`,10),vt(t=>$(e,`text`,E()?E()[2]:``,t)),e})(),(()=>{var e=xt(`text`);return $(e,`x`,200),$(e,`y`,340),$(e,`fontSize`,14),$(e,`fontFamily`,`monospace`),$(e,`color`,`#6a6a8a`),$(e,`origin`,.5),$(e,`depth`,10),vt(t=>$(e,`text`,D(),t)),e})()]}})]}})}A(()=>{let e=rn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file diff --git a/examples/floppy-heads/dist/index.html b/examples/floppy-heads/dist/index.html index 2cb84a6..1607da2 100644 --- a/examples/floppy-heads/dist/index.html +++ b/examples/floppy-heads/dist/index.html @@ -35,7 +35,7 @@ } .footer a { color: #7fdbca; text-decoration: none; } - +
diff --git a/examples/floppy-heads/vite.config.ts b/examples/floppy-heads/vite.config.ts index 3bf83b7..d0cd3b5 100644 --- a/examples/floppy-heads/vite.config.ts +++ b/examples/floppy-heads/vite.config.ts @@ -18,6 +18,7 @@ export default defineConfig({ "solidion/ecs": resolve(__dirname, "../../src/ecs/index.ts"), "solidion/core": resolve(__dirname, "../../src/core/index.ts"), "solidion/debug": resolve(__dirname, "../../src/debug/index.ts"), + "solidion/renderer": resolve(__dirname, "../../src/renderer.ts"), "solidion": resolve(__dirname, "../../src/index.ts"), // Deduplicate solid-js: ensure both example and library code use the // same instance, AND use the browser build (not server/SSR). diff --git a/examples/nadion-defense/dist/assets/index-BtiCr2mZ.js b/examples/nadion-defense/dist/assets/index-DirEFGQ8.js similarity index 99% rename from examples/nadion-defense/dist/assets/index-BtiCr2mZ.js rename to examples/nadion-defense/dist/assets/index-DirEFGQ8.js index d0d6e21..95ad6a8 100644 --- a/examples/nadion-defense/dist/assets/index-BtiCr2mZ.js +++ b/examples/nadion-defense/dist/assets/index-DirEFGQ8.js @@ -65,4 +65,4 @@ return new `+this.key+`(); `),s=/^[ ]*(- )*(\w+)+[: ]+(.*)/,c=``,l=``,u={x:0,y:0,width:0,height:0},d=0;d{var r=n(50030),i=function(e){for(var t=e.mipmaps,n=1;n{e.exports={AtlasXML:n(89905),Canvas:n(72893),Image:n(4832),JSONArray:n(78566),JSONHash:n(39711),KTXParser:n(31403),PVRParser:n(82038),SpriteSheet:n(75549),SpriteSheetFromAtlas:n(47534),UnityYAML:n(86147)}}),80341:(e=>{e.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}}),16536:((e,t,n)=>{e.exports=new(n(83419))({initialize:function(e,t,n,r,i,a,o){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),i===void 0&&(i=0),a===void 0&&(a=0),this.name=e,this.firstgid=t|0,this.imageWidth=n|0,this.imageHeight=r|0,this.imageMargin=i|0,this.imageSpacing=a|0,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(e){return e>=this.firstgid&&e{e.exports=new(n(83419))({initialize:function(e){if(this.gids=[],e!==void 0)for(var t=0;t{var r=n(80341),i=n(87010),a=n(46177),o=n(49075);e.exports=function(e,t,n,s,c,l,u,d){n===void 0&&(n=32),s===void 0&&(s=32),c===void 0&&(c=10),l===void 0&&(l=10),d===void 0&&(d=!1);var f=null;if(Array.isArray(u))f=a(t===void 0?`map`:t,r.ARRAY_2D,u,n,s,d);else if(t!==void 0){var p=e.cache.tilemap.get(t);p?f=a(t,p.format,p.data,n,s,d):console.warn(`No map data found for key `+t)}return f===null&&(f=new i({tileWidth:n,tileHeight:s,width:c,height:l})),new o(e,f)}}),23029:((e,t,n)=>{var r=n(83419),i=n(31401),a=n(91907),o=n(62644),s=n(93232);e.exports=new r({Mixins:[i.AlphaSingle,i.Flip,i.Visible],initialize:function(e,t,n,r,i,a,o,s){this.layer=e,this.index=t,this.x=n,this.y=r,this.width=i,this.height=a,this.right,this.bottom,this.baseWidth=o===void 0?i:o,this.baseHeight=s===void 0?a:s,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(e,t){return!(ethis.right||t>this.bottom)},copy:function(e){return this.index=e.index,this.alpha=e.alpha,this.properties=o(e.properties),this.visible=e.visible,this.setFlip(e.flipX,e.flipY),this.tint=e.tint,this.rotation=e.rotation,this.collideUp=e.collideUp,this.collideDown=e.collideDown,this.collideLeft=e.collideLeft,this.collideRight=e.collideRight,this.collisionCallback=e.collisionCallback,this.collisionCallbackContext=e.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(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).x:this.x*this.baseWidth},getRight:function(e){var t=this.tilemapLayer;return t?this.getLeft(e)+this.width*t.scaleX:this.getLeft(e)+this.width},getTop:function(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(e){var t=this.tilemapLayer;return t?this.getTop(e)+this.height*t.scaleY:this.getTop(e)+this.height},getBounds:function(e,t){return t===void 0&&(t=new s),t.x=this.getLeft(e),t.y=this.getTop(e),t.width=this.getRight(e)-t.x,t.height=this.getBottom(e)-t.y,t},getCenterX:function(e){return(this.getLeft(e)+this.getRight(e))/2},getCenterY:function(e){return(this.getTop(e)+this.getBottom(e))/2},intersects:function(e,t,n,r){return!(n<=this.pixelX||r<=this.pixelY||e>=this.right||t>=this.bottom)},isInteresting:function(e,t){return e&&t?this.canCollide||this.hasInterestingFace:e?this.collides:t?this.hasInterestingFace:!1},resetCollision:function(e){return e===void 0&&(e=!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,e&&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(e,t,n,r,i){return t===void 0&&(t=e),n===void 0&&(n=e),r===void 0&&(r=e),i===void 0&&(i=!0),this.collideLeft=e,this.collideRight=t,this.collideUp=n,this.collideDown=r,this.faceLeft=e,this.faceRight=t,this.faceTop=n,this.faceBottom=r,i&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(e,t){return e===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=e,this.collisionCallbackContext=t),this},setSize:function(e,t,n,r){return e!==void 0&&(this.width=e),t!==void 0&&(this.height=t),n!==void 0&&(this.baseWidth=n),r!==void 0&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var e=this.layer.orientation;if(e===a.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(e===a.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(e===a.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(e===a.HEXAGONAL){var t=this.layer.staggerAxis,n=this.layer.staggerIndex,r=this.layer.hexSideLength,i,o;t===`y`?(o=(this.baseHeight-r)/2+r,n===`odd`?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*o):t===`x`&&(i=(this.baseWidth-r)/2+r,this.pixelX=this.x*i,n===`odd`?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=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||this.collisionCallback!==void 0}},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 e=this.layer.tilemapLayer;if(e){var t=e.gidMap[this.index];if(t)return t}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var e=this.tilemapLayer;return e?e.tilemap:null}}})}),49075:((e,t,n)=>{var r=n(84101),i=n(83419),a=n(39506),o=n(80341),s=n(95540),c=n(14977),l=n(27462),u=n(91907),d=n(36305),f=n(19133),p=n(68287),m=n(23029),h=n(81086),g=n(20442),_=n(33629);e.exports=new i({initialize:function(e,t){this.scene=e,this.tileWidth=t.tileWidth,this.tileHeight=t.tileHeight,this.width=t.width,this.height=t.height,this.orientation=t.orientation,this.renderOrder=t.renderOrder,this.format=t.format,this.version=t.version,this.properties=t.properties,this.widthInPixels=t.widthInPixels,this.heightInPixels=t.heightInPixels,this.imageCollections=t.imageCollections,this.images=t.images,this.layers=t.layers,this.tiles=t.tiles,this.tilesets=t.tilesets,this.objects=t.objects,this.currentLayerIndex=0,this.hexSideLength=t.hexSideLength;var n=this.orientation;this._convert={WorldToTileXY:h.GetWorldToTileXYFunction(n),WorldToTileX:h.GetWorldToTileXFunction(n),WorldToTileY:h.GetWorldToTileYFunction(n),TileToWorldXY:h.GetTileToWorldXYFunction(n),TileToWorldX:h.GetTileToWorldXFunction(n),TileToWorldY:h.GetTileToWorldYFunction(n),GetTileCorners:h.GetTileCornersFunction(n)}},setRenderOrder:function(e){var t=[`right-down`,`left-down`,`right-up`,`left-up`];return typeof e==`number`&&(e=t[e]),t.indexOf(e)>-1&&(this.renderOrder=e),this},addTilesetImage:function(e,t,n,i,a,s,c,l){if(e===void 0)return null;t??=e;var u=this.scene.sys.textures;if(!u.exists(t))return console.warn(`Texture key "%s" not found`,t),null;var d=u.get(t),f=this.getTilesetIndex(e);if(f===null&&this.format===o.TILED_JSON)return console.warn(`Tilemap has no tileset "%s". Its tilesets are %o`,e,this.tilesets),null;var p=this.tilesets[f];return p?((n||i)&&p.setTileSize(n,i),(a||s)&&p.setSpacing(a,s),p.setImage(d),p):(n===void 0&&(n=this.tileWidth),i===void 0&&(i=this.tileHeight),a===void 0&&(a=0),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l={x:0,y:0}),p=new _(e,c,n,i,a,s,void 0,void 0,l),p.setImage(d),this.tilesets.push(p),this.tiles=r(this),p)},copy:function(e,t,n,r,i,a,o,s){return s=this.getLayer(s),s===null?null:(h.Copy(e,t,n,r,i,a,o,s),this)},createBlankLayer:function(e,t,n,r,i,a,o,s){if(n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=this.width),a===void 0&&(a=this.height),o===void 0&&(o=this.tileWidth),s===void 0&&(s=this.tileHeight),this.getLayerIndex(e)!==null)return console.warn(`Invalid Tilemap Layer ID: `+e),null;for(var l=new c({name:e,tileWidth:o,tileHeight:s,width:i,height:a,orientation:this.orientation,hexSideLength:this.hexSideLength}),u,d=0;d-1&&this.putTileAt(t,a.x,a.y,n,a.tilemapLayer)}return r},removeTileAt:function(e,t,n,r,i){return n===void 0&&(n=!0),r===void 0&&(r=!0),i=this.getLayer(i),i===null?null:h.RemoveTileAt(e,t,n,r,i)},removeTileAtWorldXY:function(e,t,n,r,i,a){return n===void 0&&(n=!0),r===void 0&&(r=!0),a=this.getLayer(a),a===null?null:h.RemoveTileAtWorldXY(e,t,n,r,i,a)},renderDebug:function(e,t,n){return n=this.getLayer(n),n===null?null:(this.orientation===u.ORTHOGONAL&&h.RenderDebug(e,t,n),this)},renderDebugFull:function(e,t){for(var n=this.layers,r=0;r{var r=n(44603),i=n(31989);r.register(`tilemap`,function(e){var t=e===void 0?{}:e;return i(this.scene,t.key,t.tileWidth,t.tileHeight,t.width,t.height,t.data,t.insertNull)})}),46029:((e,t,n)=>{var r=n(39429),i=n(31989);r.register(`tilemap`,function(e,t,n,r,a,o,s){return e===null&&(e=void 0),t===null&&(t=void 0),n===null&&(n=void 0),r===null&&(r=void 0),a===null&&(a=void 0),i(this.scene,e,t,n,r,a,o,s)})}),20442:((e,t,n)=>{var r=n(83419),i=n(78389),a=n(31401),o=n(95643),s=n(81086),c=n(19218),l=n(26099);e.exports=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,i,c],initialize:function(e,t,n,r,i,a){o.call(this,e,`TilemapLayer`),this.isTilemap=!0,this.tilemap=t,this.layerIndex=n,this.layer=t.layers[n],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=s.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(r),this.setAlpha(this.layer.alpha),this.setPosition(i,a),this.setOrigin(0,0),this.setSize(t.tileWidth*this.layer.width,t.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(e){var t=[],n=[],r=this.tilemap;Array.isArray(e)||(e=[e]);for(var i=0;i=0&&e<4&&(this._renderOrder=e),this},calculateFacesAt:function(e,t){return s.CalculateFacesAt(e,t,this.layer),this},calculateFacesWithin:function(e,t,n,r){return s.CalculateFacesWithin(e,t,n,r,this.layer),this},createFromTiles:function(e,t,n,r,i){return s.CreateFromTiles(e,t,n,r,i,this.layer)},cull:function(e){return this.cullCallback(this.layer,e,this.culledTiles,this._renderOrder)},copy:function(e,t,n,r,i,a,o){return s.Copy(e,t,n,r,i,a,o,this.layer),this},fill:function(e,t,n,r,i,a){return s.Fill(e,t,n,r,i,a,this.layer),this},filterTiles:function(e,t,n,r,i,a,o){return s.FilterTiles(e,t,n,r,i,a,o,this.layer)},findByIndex:function(e,t,n){return s.FindByIndex(e,t,n,this.layer)},findTile:function(e,t,n,r,i,a,o){return s.FindTile(e,t,n,r,i,a,o,this.layer)},forEachTile:function(e,t,n,r,i,a,o){return s.ForEachTile(e,t,n,r,i,a,o,this.layer),this},setTint:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!1},this,t,n,r,i,a)},setTintFill:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!0},this,t,n,r,i,a)},getTileAt:function(e,t,n){return s.GetTileAt(e,t,n,this.layer)},getTileAtWorldXY:function(e,t,n,r){return s.GetTileAtWorldXY(e,t,n,r,this.layer)},getIsoTileAtWorldXY:function(e,t,n,r,i){n===void 0&&(n=!0);var a=this.tempVec;return s.IsometricWorldToTileXY(e,t,!0,a,i,this.layer,n),this.getTileAt(a.x,a.y,r)},getTilesWithin:function(e,t,n,r,i){return s.GetTilesWithin(e,t,n,r,i,this.layer)},getTilesWithinShape:function(e,t,n){return s.GetTilesWithinShape(e,t,n,this.layer)},getTilesWithinWorldXY:function(e,t,n,r,i,a){return s.GetTilesWithinWorldXY(e,t,n,r,i,a,this.layer)},hasTileAt:function(e,t){return s.HasTileAt(e,t,this.layer)},hasTileAtWorldXY:function(e,t,n){return s.HasTileAtWorldXY(e,t,n,this.layer)},putTileAt:function(e,t,n,r){return s.PutTileAt(e,t,n,r,this.layer)},putTileAtWorldXY:function(e,t,n,r,i){return s.PutTileAtWorldXY(e,t,n,r,i,this.layer)},putTilesAt:function(e,t,n,r){return s.PutTilesAt(e,t,n,r,this.layer),this},randomize:function(e,t,n,r,i){return s.Randomize(e,t,n,r,i,this.layer),this},removeTileAt:function(e,t,n,r){return s.RemoveTileAt(e,t,n,r,this.layer)},removeTileAtWorldXY:function(e,t,n,r,i){return s.RemoveTileAtWorldXY(e,t,n,r,i,this.layer)},renderDebug:function(e,t){return s.RenderDebug(e,t,this.layer),this},replaceByIndex:function(e,t,n,r,i,a){return s.ReplaceByIndex(e,t,n,r,i,a,this.layer),this},setSkipCull:function(e){return e===void 0&&(e=!0),this.skipCull=e,this},setCullPadding:function(e,t){return e===void 0&&(e=1),t===void 0&&(t=1),this.cullPaddingX=e,this.cullPaddingY=t,this},setCollision:function(e,t,n,r){return s.SetCollision(e,t,n,this.layer,r),this},setCollisionBetween:function(e,t,n,r){return s.SetCollisionBetween(e,t,n,r,this.layer),this},setCollisionByProperty:function(e,t,n){return s.SetCollisionByProperty(e,t,n,this.layer),this},setCollisionByExclusion:function(e,t,n){return s.SetCollisionByExclusion(e,t,n,this.layer),this},setCollisionFromCollisionGroup:function(e,t){return s.SetCollisionFromCollisionGroup(e,t,this.layer),this},setTileIndexCallback:function(e,t,n){return s.SetTileIndexCallback(e,t,n,this.layer),this},setTileLocationCallback:function(e,t,n,r,i,a){return s.SetTileLocationCallback(e,t,n,r,i,a,this.layer),this},shuffle:function(e,t,n,r){return s.Shuffle(e,t,n,r,this.layer),this},swapByIndex:function(e,t,n,r,i,a){return s.SwapByIndex(e,t,n,r,i,a,this.layer),this},tileToWorldX:function(e,t){return this.tilemap.tileToWorldX(e,t,this)},tileToWorldY:function(e,t){return this.tilemap.tileToWorldY(e,t,this)},tileToWorldXY:function(e,t,n,r){return this.tilemap.tileToWorldXY(e,t,n,r,this)},getTileCorners:function(e,t,n){return this.tilemap.getTileCorners(e,t,n,this)},weightedRandomize:function(e,t,n,r,i){return s.WeightedRandomize(t,n,r,i,e,this.layer),this},worldToTileX:function(e,t,n){return this.tilemap.worldToTileX(e,t,n,this)},worldToTileY:function(e,t,n){return this.tilemap.worldToTileY(e,t,n,this)},worldToTileXY:function(e,t,n,r,i){return this.tilemap.worldToTileXY(e,t,n,r,i,this)},destroy:function(e){e===void 0&&(e=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),e&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}})}),16153:((e,t,n)=>{var r=n(61340),i=new r,a=new r,o=new r;e.exports=function(e,t,n,r){var s=t.cull(n),c=s.length,l=n.alpha*t.alpha;if(!(c===0||l<=0)){var u=i,d=a,f=o;d.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),u.copyFrom(n.matrix);var p=e.currentContext,m=t.gidMap;p.save(),r?(u.multiplyWithOffset(r,-n.scrollX*t.scrollFactorX,-n.scrollY*t.scrollFactorY),d.e=t.x,d.f=t.y,u.multiply(d,f),f.copyToContext(p)):(d.e-=n.scrollX*t.scrollFactorX,d.f-=n.scrollY*t.scrollFactorY,d.copyToContext(p)),(!e.antialias||t.scaleX>1||t.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var h=0;h{var r=n(29747),i=r,a=r;i=n(99558),a=n(16153),e.exports={renderWebGL:i,renderCanvas:a}}),99558:((e,t,n)=>{var r=n(70554);e.exports=function(e,t,n){var i=t.cull(n),a=i.length,o=n.alpha*t.alpha;if(!(a===0||o<=0)){var s=t.gidMap,c=e.pipelines.set(t.pipeline,t),l=r.getTintAppendFloatAlpha,u=t.scrollFactorX,d=t.scrollFactorY,f=t.x,p=t.y,m=t.scaleX,h=t.scaleY;e.pipelines.preBatch(t);for(var g=0;g{var r=n(83419),i=n(26099);e.exports=new r({initialize:function(e,t,n,r,a,o,s,c,l){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),a===void 0&&(a=0),o===void 0&&(o=0),s===void 0&&(s={}),c===void 0&&(c={}),this.name=e,this.firstgid=t,this.tileWidth=n,this.tileHeight=r,this.tileMargin=a,this.tileSpacing=o,this.tileProperties=s,this.tileData=c,this.tileOffset=new i,l!==void 0&&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(e){return this.containsTileIndex(e)?this.tileProperties[e-this.firstgid]:null},getTileData:function(e){return this.containsTileIndex(e)?this.tileData[e-this.firstgid]:null},getTileCollisionGroup:function(e){var t=this.getTileData(e);return t&&t.objectgroup?t.objectgroup:null},containsTileIndex:function(e){return e>=this.firstgid&&en.width||t.height>n.height?this.updateTileData(t.width,t.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(e,t){return e!==void 0&&(this.tileWidth=e),t!==void 0&&(this.tileHeight=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(e,t){return e!==void 0&&(this.tileMargin=e),t!==void 0&&(this.tileSpacing=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=(t-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),a=(e-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(i%1!=0||a%1!=0)&&console.warn(`Image tile area not tile size multiple in: `+this.name),i=Math.floor(i),a=Math.floor(a),this.rows=i,this.columns=a,this.total=i*a,this.texCoordinates.length=0;for(var o=this.tileMargin+n,s=this.tileMargin+r,c=0;c{var r=n(7423);e.exports=function(e,t,n){var i=r(e,t,!0,n),a=r(e,t-1,!0,n),o=r(e,t+1,!0,n),s=r(e-1,t,!0,n),c=r(e+1,t,!0,n),l=i&&i.collides;return l&&(i.faceTop=!0,i.faceBottom=!0,i.faceLeft=!0,i.faceRight=!0),a&&a.collides&&(l&&(i.faceTop=!1),a.faceBottom=!l),o&&o.collides&&(l&&(i.faceBottom=!1),o.faceTop=!l),s&&s.collides&&(l&&(i.faceLeft=!1),s.faceRight=!l),c&&c.collides&&(l&&(i.faceRight=!1),c.faceLeft=!l),i&&!i.collides&&i.resetFaces(),i}}),42573:((e,t,n)=>{var r=n(7423),i=n(7386);e.exports=function(e,t,n,a,o){for(var s=null,c=null,l=null,u=null,d=i(e,t,n,a,null,o),f=0;f{var r=new(n(26099));e.exports=function(e,t,n,i){var a=n.tilemapLayer,o=a.cullPaddingX,s=a.cullPaddingY,c=a.tilemap.tileToWorldXY(e,t,r,i,a);return c.x>i.worldView.x+a.scaleX*n.tileWidth*(-o-.5)&&c.xi.worldView.y+a.scaleY*n.tileHeight*(-s-1)&&c.y{var r=n(42573),i=n(7386),a=n(62991),o=n(23029);e.exports=function(e,t,n,s,c,l,u,d){u===void 0&&(u=!0);var f=i(e,t,n,s,null,d),p=[];f.forEach(function(e){var t=new o(e.layer,e.index,e.x,e.y,e.width,e.height,e.baseWidth,e.baseHeight);t.copy(e),p.push(t)});for(var m=c-e,h=l-t,g=0;g{var r=n(62644),i=n(7386),a=n(27987);e.exports=function(e,t,n,o,s,c){n||={},Array.isArray(e)||(e=[e]);var l=c.tilemapLayer;o||=l.scene,s||=o.cameras.main;var u=c.width,d=c.height,f=i(0,0,u,d,null,c),p=[],m,h=function(e,t,n){for(var r=0;r{var r=n(87841),i=n(63448),a=n(56583),o=new r;e.exports=function(e,t){var n=e.tilemapLayer.tilemap,r=e.tilemapLayer,s=Math.floor(n.tileWidth*r.scaleX),c=Math.floor(n.tileHeight*r.scaleY),l=a(t.worldView.x-r.x,s,0,!0)-r.cullPaddingX,u=i(t.worldView.right-r.x,s,0,!0)+r.cullPaddingX,d=a(t.worldView.y-r.y,c,0,!0)-r.cullPaddingY,f=i(t.worldView.bottom-r.y,c,0,!0)+r.cullPaddingY;return o.setTo(l,d,u-l,f-d)}}),30003:((e,t,n)=>{var r=n(19545),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return(o.skipCull||o.scrollFactorX!==1||o.scrollFactorY!==1)&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),35137:((e,t,n)=>{var r=n(7386),i=n(42573),a=n(20576);e.exports=function(e,t,n,o,s,c,l){for(var u=l.collideIndexes.indexOf(e)!==-1,d=r(t,n,o,s,null,l),f=0;f{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).filter(e,t)}}),52692:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=!1);var i=0,a,o,s;if(n){for(o=r.height-1;o>=0;o--)for(a=r.width-1;a>=0;a--)if(s=r.data[o][a],s&&s.index===e){if(i===t)return s;i+=1}}else for(o=0;o{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).find(e,t)||null}}),97560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){r(n,i,a,o,s,c).forEach(e,t)}}),43305:((e,t,n)=>{var r=n(91907),i=n(30003),a=n(9474),o=n(14018),s=n(29747),c=n(54503);e.exports=function(e){return e===r.ORTHOGONAL?i:e===r.HEXAGONAL?a:e===r.STAGGERED?c:e===r.ISOMETRIC?o:s}}),7423:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n,i){if(r(e,t,i)){var a=i.data[t][e]||null;return a?a.index===-1?n?a:null:a:null}else return null}}),60540:((e,t,n)=>{var r=n(7423),i=new(n(26099));e.exports=function(e,t,n,a,o){return o.tilemapLayer.worldToTileXY(e,t,!0,i,a),r(i.x,i.y,n,o)}}),55826:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i){var a=i.baseTileWidth,o=i.baseTileHeight,s=i.tilemapLayer,c=0,l=0;s&&(n||=s.scene.cameras.main,c=s.x+n.scrollX*(1-s.scrollFactorX),l=s.y+n.scrollY*(1-s.scrollFactorY),a*=s.scaleX,o*=s.scaleY);var u=c+e*a,d=l+t*o;return[new r(u,d),new r(u+a,d),new r(u+a,d+o),new r(u,d+o)]}}),11758:((e,t,n)=>{var r=n(91907),i=n(27229),a=n(29747),o=n(55826);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:(r.STAGGERED,a)}}),39167:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(97281);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),62e3:((e,t,n)=>{var r=n(91907),i=n(19951),a=n(14127),o=n(29747),s=n(97202),c=n(70326);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),5984:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(28054),o=n(29650);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),7386:((e,t,n)=>{var r=n(95540);e.exports=function(e,t,n,i,a,o){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=o.width),i===void 0&&(i=o.height),a||={};var s=r(a,`isNotEmpty`,!1),c=r(a,`isColliding`,!1),l=r(a,`hasInterestingFace`,!1);e<0&&(n+=e,e=0),t<0&&(i+=t,t=0),e+n>o.width&&(n=Math.max(o.width-e,0)),t+i>o.height&&(i=Math.max(o.height-t,0));for(var u=[],d=t;d{var r=n(55738),i=n(7386),a=n(91865),o=n(29747),s=n(26099),c=n(91907),l=function(e,t){return a.RectangleToTriangle(t,e)},u=new s,d=new s,f=new s;e.exports=function(e,t,n,s){if(s.orientation!==c.ORTHOGONAL)return console.warn(`GetTilesWithinShape only works with orthogonal tilemaps`),[];if(e===void 0)return[];var p=o;e instanceof r.Circle?p=a.CircleToRectangle:e instanceof r.Rectangle?p=a.RectangleToRectangle:e instanceof r.Triangle?p=l:e instanceof r.Line&&(p=a.LineToRectangle),s.tilemapLayer.worldToTileXY(e.left,e.top,!0,d,n);var m=d.x,h=d.y;s.tilemapLayer.worldToTileXY(e.right,e.bottom,!1,f,n);var g=Math.ceil(f.x),_=Math.ceil(f.y),v=i(m,h,Math.max(g-m,1),Math.max(_-h,1),t,s),y=s.tileWidth,b=s.tileHeight;s.tilemapLayer&&(y*=s.tilemapLayer.scaleX,b*=s.tilemapLayer.scaleY);for(var x=[],S=new r.Rectangle(0,0,y,b),C=0;C{var r=n(7386),i=n(26099),a=new i,o=new i;e.exports=function(e,t,n,i,s,c,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,t,!0,a,c,l);var d=a.x,f=a.y;u(e+n,t+i,!1,o,c,l);var p=Math.ceil(o.x),m=Math.ceil(o.y);return r(d,f,p-d,m-f,s,l)}}),96113:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(10095);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),16926:((e,t,n)=>{var r=n(91907),i=n(86625),a=n(96897),o=n(29747),s=n(15108),c=n(85896);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),55762:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(51900),o=n(63288);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),45091:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n){if(r(e,t,n)){var i=n.data[t][e];return i!==null&&i.index>-1}else return!1}}),24152:((e,t,n)=>{var r=n(45091),i=new(n(26099));e.exports=function(e,t,n,a){a.tilemapLayer.worldToTileXY(e,t,!0,i,n);var o=i.x,s=i.y;return r(o,s,a)}}),90454:((e,t,n)=>{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY),c=e.hexSideLength,l,u,d,f;if(e.staggerAxis===`y`){var p=(s-c)/2+c;l=i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,p,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,p,0,!0)+a.cullPaddingY}else{var m=(o-c)/2+c;l=i(t.worldView.x-a.x,m,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,m,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,s,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,s,0,!0)+a.cullPaddingY}return{left:l,right:u,top:d,bottom:f}}}),9474:((e,t,n)=>{var r=n(90454),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),27229:((e,t,n)=>{var r=n(19951),i=n(26099),a=new i;e.exports=function(e,t,n,o){var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(s*=l.scaleX,c*=l.scaleY);var u=r(e,t,a,n,o),d=[],f=.5773502691896257,p,m;o.staggerAxis===`y`?(p=f*s,m=c/2):(p=s/2,m=f*c);for(var h=0;h<6;h++){var g=2*Math.PI*(.5-h)/6;d.push(new i(u.x+p*Math.cos(g),u.y+m*Math.sin(g)))}return d}}),19951:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),u=c.y+i.scrollY*(1-c.scrollFactorY),o*=c.scaleX,s*=c.scaleY);var d=o/2,f=s/2,p,m,h=a.staggerAxis,g=a.staggerIndex;return h===`y`?(p=l+o*e+o,m=u+1.5*t*f+f,t%2==0&&(g===`odd`?p-=d:p+=d)):h===`x`&&g===`odd`&&(p=l+1.5*e*d+d,m=u+s*e+s,e%2==0&&(g===`odd`?m-=f:m+=f)),n.set(p,m)}}),86625:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=.5773502691896257,d=-.3333333333333333,f=0,p=.6666666666666666,m=s/2,h=c/2,g,_,v,y,b;o.staggerAxis===`y`?(g=(e-m)/(u*s),_=(t-h)/h,v=u*g+d*_,y=f*g+p*_):(g=(e-m)/m,_=(t-h)/(u*c),v=d*g+u*_,y=p*g+f*_),b=-v-y;var x=Math.round(v),S=Math.round(y),C=Math.round(b),w=Math.abs(x-v),T=Math.abs(S-y),E=Math.abs(C-b);w>T&&w>E?x=-S-C:T>E&&(S=-x-C);var D,O=S;return D=o.staggerIndex===`odd`?O%2==0?S/2+x:S/2+x-.5:O%2==0?S/2+x:S/2+x+.5,i.set(D,O)}}),62991:(e=>{e.exports=function(e,t,n){return e>=0&&e=0&&t{var r=n(33528);e.exports=function(e,t,n,i){n===void 0&&(n=[]),i===void 0&&(i=0),n.length=0;var a=e.tilemapLayer,o=e.data,s=e.width,c=e.height,l=a.skipCull,u=0,d=s,f=0,p=c,m,h,g;if(i===0)for(h=f;h=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));else if(i===2)for(h=p;h>=f;h--)for(m=u;m=f;h--)for(m=d;m>=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));return a.tilesDrawn=n.length,a.tilesTotal=s*c,n}}),14127:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+(e-t)*(o/2),f=u+(e+t)*(s/2);return n.set(d,f)}}),96897:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o,s){i||=new r;var c=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(a||=u.scene.cameras.main,t-=u.y+a.scrollY*(1-u.scrollFactorY),l*=u.scaleY,e-=u.x+a.scrollX*(1-u.scrollFactorX),c*=u.scaleX);var d=c/2,f=l/2;e-=d,s||(t-=l);var p=.5*(e/d+t/f),m=.5*(-e/d+t/f);return n&&(p=Math.floor(p),m=Math.floor(m)),i.set(p,m)}}),71558:((e,t,n)=>{var r=n(23029),i=n(62991),a=n(72023),o=n(20576);e.exports=function(e,t,n,s,c){if(s===void 0&&(s=!0),!i(t,n,c))return null;var l,u=c.data[n][t],d=u&&u.collides;e instanceof r?(c.data[n][t]===null&&(c.data[n][t]=new r(c,e.index,t,n,c.tileWidth,c.tileHeight)),c.data[n][t].copy(e)):(l=e,c.data[n][t]===null?c.data[n][t]=new r(c,l,t,n,c.tileWidth,c.tileHeight):c.data[n][t].index=l);var f=c.data[n][t],p=c.collideIndexes.indexOf(f.index)!==-1;if(l=e instanceof r?e.index:e,l===-1)f.width=c.tileWidth,f.height=c.tileHeight;else{var m=c.tilemapLayer.tilemap,h=m.tiles[l][2],g=m.tilesets[h];f.width=g.tileWidth,f.height=g.tileHeight}return o(f,p),s&&d!==f.collides&&a(t,n,c),f}}),26303:((e,t,n)=>{var r=n(71558),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(t,n,!0,i,o,s),r(e,i.x,i.y,a,s)}}),14051:((e,t,n)=>{var r=n(42573),i=n(71558);e.exports=function(e,t,n,a,o){if(a===void 0&&(a=!0),!Array.isArray(e))return null;Array.isArray(e[0])||(e=[e]);for(var s=e.length,c=e[0].length,l=0;l{var r=n(7386),i=n(26546);e.exports=function(e,t,n,a,o,s){var c,l=r(e,t,n,a,{},s);if(!o)for(o=[],c=0;c{var r=n(23029),i=n(62991),a=n(72023);e.exports=function(e,t,n,o,s){if(n===void 0&&(n=!0),o===void 0&&(o=!0),!i(e,t,s))return null;var c=s.data[t][e];if(c)s.data[t][e]=n?null:new r(s,-1,e,t,s.tileWidth,s.tileHeight);else return null;return o&&c&&c.collides&&a(e,t,s),c}}),94178:((e,t,n)=>{var r=n(63557),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(e,t,!0,i,o,s),r(i.x,i.y,n,a,s)}}),15533:((e,t,n)=>{var r=n(7386),i=n(3956),a=new i(105,210,231,150),o=new i(243,134,48,200),s=new i(40,39,37,150);e.exports=function(e,t,n){t===void 0&&(t={});var i=t.tileColor===void 0?a:t.tileColor,c=t.collidingTileColor===void 0?o:t.collidingTileColor,l=t.faceColor===void 0?s:t.faceColor,u=r(0,0,n.width,n.height,null,n);e.translateCanvas(n.tilemapLayer.x,n.tilemapLayer.y),e.scaleCanvas(n.tilemapLayer.scaleX,n.tilemapLayer.scaleY);for(var d=0;d{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n,r){var i=e.data,a=e.width,o=e.height,s=e.tilemapLayer,c=Math.max(0,t.left),l=Math.min(a,t.right),u=Math.max(0,t.top),d=Math.min(o,t.bottom),f,p,m;if(n===0)for(p=u;p=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);else if(n===2)for(p=d;p>=u;p--)for(f=c;i[p]&&f=u;p--)for(f=l;i[p]&&f>=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);return s.tilesDrawn=r.length,s.tilesTotal=a*o,r}}),57068:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s){t===void 0&&(t=!0),n===void 0&&(n=!0),s===void 0&&(s=!0),Array.isArray(e)||(e=[e]);for(var c=0;c{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s,c){if(n===void 0&&(n=!0),o===void 0&&(o=!0),c===void 0&&(c=!0),!(e>t)){for(var l=e;l<=t;l++)a(l,n,s);if(c)for(var u=0;u=e&&f.index<=t&&r(f,n)}o&&i(0,0,s.width,s.height,s)}}}),75661:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0),Array.isArray(e)||(e=[e]);for(var s=0;s{var r=n(20576),i=n(42573),a=n(97022);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0);for(var s=0;s{var r=n(20576),i=n(42573);e.exports=function(e,t,n){e===void 0&&(e=!0),t===void 0&&(t=!0);for(var a=0;a0&&r(s,e)}}t&&i(0,0,n.width,n.height,n)}}),9589:(e=>{e.exports=function(e,t,n){var r=n.collideIndexes.indexOf(e);t&&r===-1?n.collideIndexes.push(e):!t&&r!==-1&&n.collideIndexes.splice(r,1)}}),20576:(e=>{e.exports=function(e,t){t?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)}}),79583:(e=>{e.exports=function(e,t,n,r){if(typeof e==`number`)r.callbacks[e]=t===null?void 0:{callback:t,callbackContext:n};else for(var i=0,a=e.length;i{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(e,t,n,i,null,s),l=0;l{var r=n(7386),i=n(33680);e.exports=function(e,t,n,a,o){var s=r(e,t,n,a,null,o),c=s.map(function(e){return e.index});i(c);for(var l=0;l{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY);return{left:i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,right:r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,top:i(t.worldView.y-a.y,s/2,0,!0)-a.cullPaddingY,bottom:r(t.worldView.bottom-a.y,s/2,0,!0)+a.cullPaddingY}}}),54503:((e,t,n)=>{var r=n(61325),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),97202:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+e*o+t%2*(o/2),f=u+s/2*t;return n.set(d,f)}}),28054:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t===void 0&&(t=i.scene.cameras.main),a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+r/2*e+r}}),15108:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,t-=l.y+a.scrollY*(1-l.scrollFactorY),c*=l.scaleY,e-=l.x+a.scrollX*(1-l.scrollFactorX),s*=l.scaleX);var u=n?Math.floor(t/(c/2)):t/(c/2),d=n?Math.floor((e+u%2*.5*s)/s):(e+u%2*.5*s)/s;return i.set(d,u)}}),51900:(e=>{e.exports=function(e,t,n,r){var i=r.baseTileHeight,a=r.tilemapLayer;return a&&(n||=a.scene.cameras.main,e-=a.y+n.scrollY*(1-a.scrollFactorY),i*=a.scaleY),t?Math.floor(e/(i/2)):e/(i/2)}}),86560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n){var r=n.baseTileWidth,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.x+t.scrollX*(1-i.scrollFactorX),r*=i.scaleX),a+e*r}}),70326:((e,t,n)=>{var r=n(97281),i=n(29650),a=n(26099);e.exports=function(e,t,n,o,s){return n||=new a(0,0),n.x=r(e,o,s),n.y=i(t,o,s),n}}),29650:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+e*r}}),77366:((e,t,n)=>{var r=n(7386),i=n(75508);e.exports=function(e,t,n,a,o,s){if(o){var c,l=r(e,t,n,a,null,s),u=0;for(c=0;c{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(e,0,t,i,n,a),i.x}}),85896:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){n===void 0&&(n=!0),i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=e/s,d=t/c;return n&&(u=Math.floor(u),d=Math.floor(d)),i.set(u,d)}}),63288:((e,t,n)=>{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(0,e,t,i,n,a),i.y}}),81086:((e,t,n)=>{e.exports={CalculateFacesAt:n(72023),CalculateFacesWithin:n(42573),CheckIsoBounds:n(33528),Copy:n(1785),CreateFromTiles:n(78419),CullBounds:n(19545),CullTiles:n(30003),Fill:n(35137),FilterTiles:n(40253),FindByIndex:n(52692),FindTile:n(66151),ForEachTile:n(97560),GetCullTilesFunction:n(43305),GetTileAt:n(7423),GetTileAtWorldXY:n(60540),GetTileCorners:n(55826),GetTileCornersFunction:n(11758),GetTilesWithin:n(7386),GetTilesWithinShape:n(91141),GetTilesWithinWorldXY:n(96523),GetTileToWorldXFunction:n(39167),GetTileToWorldXYFunction:n(62e3),GetTileToWorldYFunction:n(5984),GetWorldToTileXFunction:n(96113),GetWorldToTileXYFunction:n(16926),GetWorldToTileYFunction:n(55762),HasTileAt:n(45091),HasTileAtWorldXY:n(24152),HexagonalCullBounds:n(90454),HexagonalCullTiles:n(9474),HexagonalGetTileCorners:n(27229),HexagonalTileToWorldXY:n(19951),HexagonalWorldToTileXY:n(86625),IsInLayerBounds:n(62991),IsometricCullTiles:n(14018),IsometricTileToWorldXY:n(14127),IsometricWorldToTileXY:n(96897),PutTileAt:n(71558),PutTileAtWorldXY:n(26303),PutTilesAt:n(14051),Randomize:n(77389),RemoveTileAt:n(63557),RemoveTileAtWorldXY:n(94178),RenderDebug:n(15533),ReplaceByIndex:n(27987),RunCull:n(32483),SetCollision:n(57068),SetCollisionBetween:n(37266),SetCollisionByExclusion:n(75661),SetCollisionByProperty:n(64740),SetCollisionFromCollisionGroup:n(63307),SetLayerCollisionIndex:n(9589),SetTileCollision:n(20576),SetTileIndexCallback:n(79583),SetTileLocationCallback:n(93254),Shuffle:n(32903),StaggeredCullBounds:n(61325),StaggeredCullTiles:n(54503),StaggeredTileToWorldXY:n(97202),StaggeredTileToWorldY:n(28054),StaggeredWorldToTileXY:n(15108),StaggeredWorldToTileY:n(51900),SwapByIndex:n(86560),TileToWorldX:n(97281),TileToWorldXY:n(70326),TileToWorldY:n(29650),WeightedRandomize:n(77366),WorldToTileX:n(10095),WorldToTileXY:n(85896),WorldToTileY:n(63288)}}),91907:(e=>{e.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}}),21829:((e,t,n)=>{e.exports={ORIENTATION:n(91907)}}),62501:((e,t,n)=>{var r=n(79291),i=n(21829),a={Components:n(81086),Parsers:n(57442),Formats:n(80341),ImageCollection:n(16536),ParseToTilemap:n(31989),Tile:n(23029),Tilemap:n(49075),TilemapCreator:n(45939),TilemapFactory:n(46029),Tileset:n(33629),TilemapLayer:n(20442),Orientation:n(91907),LayerData:n(14977),MapData:n(87010),ObjectLayer:n(48700)};a=r(!1,a,i.ORIENTATION),e.exports=a}),14977:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`layer`),this.id=a(e,`id`,0),this.x=a(e,`x`,0),this.y=a(e,`y`,0),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.baseTileWidth=a(e,`baseTileWidth`,this.tileWidth),this.baseTileHeight=a(e,`baseTileHeight`,this.tileHeight),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.widthInPixels=a(e,`widthInPixels`,this.width*this.baseTileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.baseTileHeight),this.alpha=a(e,`alpha`,1),this.visible=a(e,`visible`,!0),this.properties=a(e,`properties`,[]),this.indexes=a(e,`indexes`,[]),this.collideIndexes=a(e,`collideIndexes`,[]),this.callbacks=a(e,`callbacks`,[]),this.bodies=a(e,`bodies`,[]),this.data=a(e,`data`,[]),this.tilemapLayer=a(e,`tilemapLayer`,null),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),87010:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`map`),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.infinite=a(e,`infinite`,!1),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.widthInPixels=a(e,`widthInPixels`,this.width*this.tileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.tileHeight),this.format=a(e,`format`,null),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.renderOrder=a(e,`renderOrder`,`right-down`),this.version=a(e,`version`,`1`),this.properties=a(e,`properties`,{}),this.layers=a(e,`layers`,[]),this.images=a(e,`images`,[]),this.objects=a(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=a(e,`collision`,{}),this.tilesets=a(e,`tilesets`,[]),this.imageCollections=a(e,`imageCollections`,[]),this.tiles=a(e,`tiles`,[]),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),48700:((e,t,n)=>{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=i(e,`name`,`object layer`),this.id=i(e,`id`,0),this.opacity=i(e,`opacity`,1),this.properties=i(e,`properties`,{}),this.propertyTypes=i(e,`propertytypes`,{}),this.type=i(e,`type`,`objectgroup`),this.visible=i(e,`visible`,!0),this.objects=i(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[])}})}),6641:((e,t,n)=>{var r=n(91907);e.exports=function(e){return e=e.toLowerCase(),e===`isometric`?r.ISOMETRIC:e===`staggered`?r.STAGGERED:e===`hexagonal`?r.HEXAGONAL:r.ORTHOGONAL}}),46177:((e,t,n)=>{var r=n(80341),i=n(2342),a=n(82593),o=n(46594),s=n(87021);e.exports=function(e,t,n,c,l,u){var d;switch(t){case r.ARRAY_2D:d=i(e,n,c,l,u);break;case r.CSV:d=a(e,n,c,l,u);break;case r.TILED_JSON:d=o(e,n,u);break;case r.WELTMEISTER:d=s(e,n,u);break;default:console.warn(`Unrecognized tilemap data format: `+t),d=null}return d}}),2342:((e,t,n)=>{var r=n(80341),i=n(14977),a=n(87010),o=n(23029);e.exports=function(e,t,n,s,c){for(var l=new i({tileWidth:n,tileHeight:s}),u=new a({name:e,tileWidth:n,tileHeight:s,format:r.ARRAY_2D,layers:[l]}),d=[],f=t.length,p=0,m=0;m{var r=n(80341),i=n(2342);e.exports=function(e,t,n,a,o){var s=i(e,t.trim().split(` `).map(function(e){return e.split(`,`)}),n,a,o);return s.format=r.CSV,s}}),6656:((e,t,n)=>{var r=n(14977),i=n(23029);e.exports=function(e,t){for(var n=[],a=0;a-1?new i(s,f,d,u,o.tilesize,o.tilesize):t?null:new i(s,-1,d,u,o.tilesize,o.tilesize);c.push(p)}l.push(c),c=[]}s.data=l,n.push(s)}return n}}),96483:((e,t,n)=>{var r=n(33629);e.exports=function(e){for(var t=[],n=[],i=0;i{var r=n(80341),i=n(87010),a=n(6656),o=n(96483);e.exports=function(e,t,n){if(t.layer.length===0)return console.warn(`No layers found in the Weltmeister map: `+e),null;for(var s=0,c=0,l=0;ls&&(s=t.layer[l].width),t.layer[l].height>c&&(c=t.layer[l].height);var u=new i({width:s,height:c,name:e,tileWidth:t.layer[0].tilesize,tileHeight:t.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=a(t,n),u.tilesets=o(t),u}}),52833:((e,t,n)=>{e.exports={ParseTileLayers:n(6656),ParseTilesets:n(96483),ParseWeltmeister:n(87021)}}),57442:((e,t,n)=>{e.exports={FromOrientationString:n(6641),Parse:n(46177),Parse2DArray:n(2342),ParseCSV:n(82593),Impact:n(52833),Tiled:n(96761)}}),51233:((e,t,n)=>{var r=n(79291);e.exports=function(e){for(var t,n,i,a,o,s=0;s{e.exports=function(e){for(var t=window.atob(e),n=t.length,r=Array(n/4),i=0;i>>0;return r}}),84101:((e,t,n)=>{var r=n(33629);e.exports=function(e){var t,n,i=[];for(t=0;t{var r=n(95540);e.exports=function(e,t,n){if(!t)return{i:0,layers:e.layers,name:``,opacity:1,visible:!0,x:0,y:0};var i=t.x+r(t,`startx`,0)*e.tilewidth+r(t,`offsetx`,0),a=t.y+r(t,`starty`,0)*e.tileheight+r(t,`offsety`,0);return{i:0,layers:t.layers,name:n.name+t.name+`/`,opacity:n.opacity*t.opacity,visible:n.visible&&t.visible,x:n.x+i,y:n.y+a}}}),29920:(e=>{var t=2147483648,n=1073741824,r=536870912;e.exports=function(e){var i=!!(e&t),a=!!(e&n),o=!!(e&r);e&=~(t|n|r);var s=0,c=!1;return i&&a&&o?(s=Math.PI/2,c=!0):i&&a&&!o?(s=Math.PI,c=!1):i&&!a&&o?(s=Math.PI/2,c=!1):i&&!a&&!o?(s=0,c=!0):!i&&a&&o?(s=3*Math.PI/2,c=!1):!i&&a&&!o?(s=Math.PI,c=!0):!i&&!a&&o?(s=3*Math.PI/2,c=!0):!i&&!a&&!o&&(s=0,c=!1),{gid:e,flippedHorizontal:i,flippedVertical:a,flippedAntiDiagonal:o,rotation:s,flipped:c}}}),12635:((e,t,n)=>{var r=n(95540),i=n(79677);e.exports=function(e){for(var t=[],n=[],a=i(e);a.i0;){if(a.i>=a.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}a=n.pop();continue}var o=a.layers[a.i];if(a.i++,o.type!==`imagelayer`){if(o.type===`group`){var s=i(e,o,a);n.push(a),a=s}continue}var c=r(o,`offsetx`,0)+r(o,`startx`,0),l=r(o,`offsety`,0)+r(o,`starty`,0);t.push({name:a.name+o.name,image:o.image,x:a.x+c+o.x,y:a.y+l+o.y,alpha:a.opacity*o.opacity,visible:a.visible&&o.visible,properties:r(o,`properties`,{})})}return t}}),46594:((e,t,n)=>{var r=n(51233),i=n(84101),a=n(91907),o=n(62644),s=n(80341),c=n(6641),l=n(87010),u=n(12635),d=n(22611),f=n(28200),p=n(24619);e.exports=function(e,t,n){var m=o(t),h=new l({width:m.width,height:m.height,name:e,tileWidth:m.tilewidth,tileHeight:m.tileheight,orientation:c(m.orientation),format:s.TILED_JSON,version:m.version,properties:m.properties,renderOrder:m.renderorder,infinite:m.infinite});if(h.orientation===a.HEXAGONAL)if(h.hexSideLength=m.hexsidelength,h.staggerAxis=m.staggeraxis,h.staggerIndex=m.staggerindex,h.staggerAxis===`y`){var g=(h.tileHeight-h.hexSideLength)/2;h.widthInPixels=h.tileWidth*(h.width+.5),h.heightInPixels=h.height*(h.hexSideLength+g)+g}else{var _=(h.tileWidth-h.hexSideLength)/2;h.widthInPixels=h.width*(h.hexSideLength+_)+_,h.heightInPixels=h.tileHeight*(h.height+.5)}h.layers=f(m,n),h.images=u(m);var v=p(m);return h.tilesets=v.tilesets,h.imageCollections=v.imageCollections,h.objects=d(m),h.tiles=i(h),r(h),h}}),52205:((e,t,n)=>{var r=n(18254),i=n(29920),a=function(e){return{x:e.x,y:e.y}},o=[`id`,`name`,`type`,`rotation`,`properties`,`visible`,`x`,`y`,`width`,`height`];e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var s=r(e,o);if(s.x+=t,s.y+=n,e.gid){var c=i(e.gid);s.gid=c.gid,s.flippedHorizontal=c.flippedHorizontal,s.flippedVertical=c.flippedVertical,s.flippedAntiDiagonal=c.flippedAntiDiagonal}else e.polyline?s.polyline=e.polyline.map(a):e.polygon?s.polygon=e.polygon.map(a):e.ellipse?s.ellipse=e.ellipse:e.text?s.text=e.text:e.point?s.point=!0:s.rectangle=!0;return s}}),22611:((e,t,n)=>{var r=n(95540),i=n(52205),a=n(48700),o=n(79677);e.exports=function(e){for(var t=[],n=[],s=o(e);s.i0;){if(s.i>=s.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}s=n.pop();continue}var c=s.layers[s.i];if(s.i++,c.opacity*=s.opacity,c.visible=s.visible&&c.visible,c.type!==`objectgroup`){if(c.type===`group`){var l=o(e,c,s);n.push(s),s=l}continue}c.name=s.name+c.name;for(var u=s.x+r(c,`startx`,0)+r(c,`offsetx`,0),d=s.y+r(c,`starty`,0)+r(c,`offsety`,0),f=[],p=0;p{var r=n(41868),i=n(91907),a=n(79677),o=n(6641),s=n(95540),c=n(14977),l=n(29920),u=n(23029);e.exports=function(e,t){for(var n=s(e,`infinite`,!1),d=[],f=[],p=a(e);p.i0;){if(p.i>=p.layers.length){if(f.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}p=f.pop();continue}var m=p.layers[p.i];if(p.i++,m.type!==`tilelayer`){if(m.type===`group`){var h=a(e,m,p);f.push(p),p=h}continue}if(m.compression){console.warn(`TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '`+m.name+`'`);continue}else if(m.encoding&&m.encoding===`base64`){if(m.chunks)for(var g=0;g0?(y=new u(_,v.gid,F,I,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,C[I][F]=y):(b=t?null:new u(_,-1,F,I,e.tilewidth,e.tileheight),C[I][F]=b),w++,w===k.width&&(M++,w=0)}}else{_=new c({name:p.name+m.name,id:m.id,x:p.x+s(m,`offsetx`,0)+m.x,y:p.y+s(m,`offsety`,0)+m.y,width:m.width,height:m.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:p.opacity*m.opacity,visible:p.visible&&m.visible,properties:s(m,`properties`,[]),orientation:o(e.orientation)}),_.orientation===i.HEXAGONAL&&(_.hexSideLength=e.hexsidelength,_.staggerAxis=e.staggeraxis,_.staggerIndex=e.staggerindex,_.staggerAxis===`y`?(x=(_.tileHeight-_.hexSideLength)/2,_.widthInPixels=_.tileWidth*(_.width+.5),_.heightInPixels=_.height*(_.hexSideLength+x)+x):(S=(_.tileWidth-_.hexSideLength)/2,_.widthInPixels=_.width*(_.hexSideLength+S)+S,_.heightInPixels=_.tileHeight*(_.height+.5)));for(var L=[],R=0,z=m.data.length;R0?(y=new u(_,v.gid,w,C.length,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,L.push(y)):(b=t?null:new u(_,-1,w,C.length,e.tilewidth,e.tileheight),L.push(b)),w++,w===m.width&&(C.push(L),w=0,L=[])}_.data=C,d.push(_)}return d}}),24619:((e,t,n)=>{var r=n(33629),i=n(16536),a=n(52205),o=n(57880);e.exports=function(e){for(var t=[],n=[],s=null,c,l=0;l1){var f=void 0,p=void 0;if(Array.isArray(u.tiles)){f||={},p||={};for(var m=0;m{e.exports=function(e,t){for(var n=0;n0){var a={},o={},s,c,l;if(Array.isArray(r.edgecolors))for(s=0;s{e.exports={AssignTileProperties:n(51233),Base64Decode:n(41868),BuildTilesetIndex:n(84101),CreateGroupLayer:n(79677),ParseGID:n(29920),ParseImageLayers:n(12635),ParseJSONTiled:n(46594),ParseObject:n(52205),ParseObjectLayers:n(22611),ParseTileLayers:n(28200),ParseTilesets:n(24619)}}),33385:((e,t,n)=>{var r=n(83419),i=n(37277),a=n(44594),o=n(94880),s=n(72905),c=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],e.sys.events.once(a.BOOT,this.boot,this),e.sys.events.on(a.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var e=this.systems.events;e.on(a.PRE_UPDATE,this.preUpdate,this),e.on(a.UPDATE,this.update,this),e.once(a.SHUTDOWN,this.shutdown,this)},addEvent:function(e){var t;if(e instanceof o){if(t=e,this.removeEvent(t),t.elapsed=t.startAt,t.hasDispatched=!1,t.repeatCount=t.repeat===-1||t.loop?999999999999:t.repeat,t.delay<=0&&t.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`)}else t=new o(e);return this._pendingInsertion.push(t),t},delayedCall:function(e,t,n,r){return this.addEvent({delay:e,callback:t,args:n,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t-1&&this._active.splice(i,1),r.destroy()}for(n=0;n=r.delay)){var i=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,i>=r.delay)for(;i>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),i-=r.delay,r.repeatCount--;r.elapsed=i,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var e;for(e=0;e{var r=n(83419),i=n(50792),a=n(39429),o=n(95540),s=n(44594),c=n(89809),l=new r({Extends:i,initialize:function(e,t){i.call(this),this.scene=e,this.systems=e.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 n=this.systems.events;n.on(s.PRE_UPDATE,this.preUpdate,this),n.on(s.UPDATE,this.update,this),n.once(s.SHUTDOWN,this.destroy,this),t&&this.add(t)},preUpdate:function(e,t){this.paused||(this.elapsed+=t*this.timeScale)},update:function(){if(!(this.paused||this.complete)){var e,t=this.events,n=!1,r=this.systems,i;for(e=0;e=t.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(c.COMPLETE,this)}},play:function(e){return e===void 0&&(e=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,e&&this.reset(),this},pause:function(){this.paused=!0;for(var e=this.events,t=0;t0&&(n=t[t.length-1].time);for(var r=0;r{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){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(e)},reset:function(e){if(this.delay=i(e,`delay`,0),this.repeat=i(e,`repeat`,0),this.loop=i(e,`loop`,!1),this.callback=i(e,`callback`,void 0),this.callbackScope=i(e,`callbackScope`,this),this.args=i(e,`args`,[]),this.timeScale=i(e,`timeScale`,1),this.startAt=i(e,`startAt`,0),this.paused=i(e,`paused`,!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`);return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var e=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/e}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(e){e===void 0&&(e=!1),this.elapsed=this.delay,this.hasDispatched=!e,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}})}),35945:(e=>{e.exports=`complete`}),89809:((e,t,n)=>{e.exports={COMPLETE:n(35945)}}),90291:((e,t,n)=>{e.exports={Clock:n(33385),Events:n(89809),Timeline:n(96120),TimerEvent:n(94880)}}),40382:((e,t,n)=>{var r=n(72905),i=n(83419),a=n(43491),o=n(88032),s=n(37277),c=n(44594),l=n(93109),u=n(86081),d=n(8357),f=n(43960),p=n(26012),m=new i({initialize:function(e){this.scene=e,this.events=e.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(c.BOOT,this.boot,this),this.events.on(c.START,this.start,this)},boot:function(){this.events.once(c.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(c.UPDATE,this.update,this),this.events.once(c.SHUTDOWN,this.shutdown,this)},create:function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0;n-1},existing:function(e){return this.has(e)||this.tweens.push(e.reset()),this},addCounter:function(e){var t=o(this,e);return this.tweens.push(t.reset()),t},stagger:function(e,t){return l(e,t)},setLagSmooth:function(e,t){return e===void 0&&(e=1/1e-8),t===void 0&&(t=0),this.maxLag=e,this.lagSkip=Math.min(t,this.maxLag),this},setFps:function(e){return e===void 0&&(e=240),this.gap=1e3/e,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(e){var t=Date.now()-this.prevTime;t>this.maxLag&&(this.startTime+=t-this.lagSkip),this.prevTime+=t;var n=this.prevTime-this.startTime,r=n-this.nextTime,i=n-this.time*1e3;return r>0||e?(n/=1e3,this.time=n,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):i=0,i},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(e){e===void 0&&(e=!1);var t=this.getDelta(e);if(!(t<=0)){this.processing=!0;var n,r,i=[],a=this.tweens;for(n=0;n0){for(n=0;n-1&&(r.isPendingRemove()||r.isDestroyed())&&(a.splice(s,1),r.destroy())}i.length=0}this.processing=!1}},remove:function(e){return this.processing?e.setPendingRemoveState():(r(this.tweens,e),e.setRemovedState()),this},reset:function(e){return this.existing(e),e.seek(),e.setActiveState(),this},makeActive:function(e){return this.existing(e),e.setActiveState(),this},each:function(e,t){var n,r=[null];for(n=1;n{e.exports=function(e,t,n){return e&&e.hasOwnProperty(t)?e[t]:n}}),6113:((e,t,n)=>{var r=n(62640),i=n(35355);e.exports=function(e,t){var n=r.Power0;if(typeof e==`string`)if(r.hasOwnProperty(e))n=r[e];else{var a=``;if(e.indexOf(`.`)){a=e.substring(e.indexOf(`.`)+1);var o=a.toLowerCase();o===`in`?a=`easeIn`:o===`out`?a=`easeOut`:o===`inout`&&(a=`easeInOut`)}e=i(e.substring(0,e.indexOf(`.`)+1)+a),r.hasOwnProperty(e)&&(n=r[e])}else typeof e==`function`&&(n=e);if(!t)return n;var s=t.slice(0);return s.unshift(0),function(e){return s[0]=e,n.apply(this,s)}}}),91389:((e,t,n)=>{var r=n(89318),i=n(77259),a={bezier:r,catmull:i,catmullrom:i,linear:n(28392)};e.exports=function(e){if(e===null)return null;var t=a.linear;return typeof e==`string`?a.hasOwnProperty(e)&&(t=a[e]):typeof e==`function`&&(t=e),t}}),55292:(e=>{e.exports=function(e,t,n){return e.hasOwnProperty(t)?typeof e[t]==`function`?function(n,r,i,a,o,s){return e[t](n,r,i,a,o,s)}:function(){return e[t]}:typeof n==`function`?n:function(){return n}}}),82985:((e,t,n)=>{var r=n(81076);e.exports=function(e){var t,n=[];if(e.hasOwnProperty(`props`))for(t in e.props)t.substring(0,1)!==`_`&&n.push({key:t,value:e.props[t]});else for(t in e)r.indexOf(t)===-1&&t.substring(0,1)!==`_`&&n.push({key:t,value:e[t]});return n}}),62329:((e,t,n)=>{var r=n(35154);e.exports=function(e){var t=r(e,`targets`,null);return t===null?t:(typeof t==`function`&&(t=t.call()),Array.isArray(t)||(t=[t]),t)}}),17777:((e,t,n)=>{var r=n(30976),i=n(99472);function a(e){return!!e.getActive&&typeof e.getActive==`function`}function o(e){return!!e.getStart&&typeof e.getStart==`function`}function s(e){return!!e.getEnd&&typeof e.getEnd==`function`}function c(e){return o(e)||s(e)||a(e)}var l=function(e,t){var n,u=function(e,t,n){return n},d=function(e,t,n){return n},f=null,p=typeof t;if(p===`number`)u=function(){return t};else if(Array.isArray(t))d=function(){return t[0]},u=function(){return t[t.length-1]};else if(p===`string`){var m=t.toLowerCase(),h=m.substring(0,6)===`random`,g=m.substring(0,3)===`int`;if(h||g){var _=m.indexOf(`(`),v=m.indexOf(`)`),y=m.indexOf(`,`);if(_&&v&&y){var b=parseFloat(m.substring(_+1,y)),x=parseFloat(m.substring(y+1,v));u=h?function(){return i(b,x)}:function(){return r(b,x)}}else throw Error(`invalid random() format`)}else{m=m[0];var S=parseFloat(t.substr(2));switch(m){case`+`:u=function(e,t,n){return n+S};break;case`-`:u=function(e,t,n){return n-S};break;case`*`:u=function(e,t,n){return n*S};break;case`/`:u=function(e,t,n){return n/S};break;default:u=function(){return parseFloat(t)}}}}else if(p===`function`)u=t;else if(p===`object`)if(c(t))a(t)&&(f=t.getActive),s(t)&&(u=t.getEnd),o(t)&&(d=t.getStart);else if(t.hasOwnProperty(`value`))n=l(e,t.value);else{var C=t.hasOwnProperty(`to`),w=t.hasOwnProperty(`from`),T=t.hasOwnProperty(`start`);if(C&&(w||T)){if(n=l(e,t.to),T){var E=l(e,t.start);n.getActive=E.getEnd}if(w){var D=l(e,t.from);n.getStart=D.getEnd}}}return n||={getActive:f,getEnd:u,getStart:d},n};e.exports=l}),88032:((e,t,n)=>{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(55292),u=n(35154),d=n(17777),f=n(269),p=n(86081);e.exports=function(e,t,n){if(t instanceof p)return t.parent=e,t;n=n===void 0?i:f(i,n);var m=c(t,`from`,0),h=c(t,`to`,1),g=[{value:m}],_=c(t,`delay`,n.delay),v=c(t,`easeParams`,n.easeParams),y=c(t,`ease`,n.ease),b=d(`value`,h),x=new p(e,g),S=x.add(0,`value`,b.getEnd,b.getStart,b.getActive,s(c(t,`ease`,y),c(t,`easeParams`,v)),l(t,`delay`,_),c(t,`duration`,n.duration),o(t,`yoyo`,n.yoyo),c(t,`hold`,n.hold),c(t,`repeat`,n.repeat),c(t,`repeatDelay`,n.repeatDelay),!1,!1);S.start=m,S.current=m,x.completeDelay=a(t,`completeDelay`,0),x.loop=Math.round(a(t,`loop`,0)),x.loopDelay=Math.round(a(t,`loopDelay`,0)),x.paused=o(t,`paused`,!1),x.persist=o(t,`persist`,!1),x.isNumberTween=!0,x.callbackScope=u(t,`callbackScope`,x);for(var C=r.TYPES,w=0;w{var r=n(6113),i=n(35154),a=n(36383);e.exports=function(e,t){t===void 0&&(t={});var n,o=i(t,`start`,0),s=i(t,`ease`,null),c=i(t,`grid`,null),l=i(t,`from`,0),u=l===`first`,d=l===`center`,f=l===`last`,p=typeof l==`number`,m=Array.isArray(e),h=parseFloat(m?e[0]:e),g=m?parseFloat(e[1]):0,_=Math.max(h,g);if(m&&(o+=h),c){var v=c[0],y=c[1],b=0,x=0,S=0,C=0,w=[];f?(b=v-1,x=y-1):p?(b=l%v,x=Math.floor(l/v)):d&&(b=(v-1)/2,x=(y-1)/2);for(var T=a.MIN_SAFE_INTEGER,E=0;ET&&(T=O),w[E][D]=O}}}var k=s?r(s):null;return n=c?function(e,t,n,r){var i=0,a=r%v,s=Math.floor(r/v);a>=0&&a=0&&s{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(91389),u=n(55292),d=n(82985),f=n(62329),p=n(35154),m=n(17777),h=n(269),g=n(86081);e.exports=function(e,t,n){if(t instanceof g)return t.parent=e,t;n=n===void 0?i:h(i,n);var _=f(t);!_&&n.targets&&(_=n.targets);for(var v=d(t),y=c(t,`delay`,n.delay),b=c(t,`duration`,n.duration),x=c(t,`easeParams`,n.easeParams),S=c(t,`ease`,n.ease),C=c(t,`hold`,n.hold),w=c(t,`repeat`,n.repeat),T=c(t,`repeatDelay`,n.repeatDelay),E=o(t,`yoyo`,n.yoyo),D=o(t,`flipX`,n.flipX),O=o(t,`flipY`,n.flipY),k=c(t,`interpolation`,n.interpolation),A=function(e,t,n,r){if(n===`texture`){var i=r,a=void 0;Array.isArray(r)?(i=r[0],a=r[1]):r.hasOwnProperty(`value`)?(i=r.value,Array.isArray(r.value)?(i=r.value[0],a=r.value[1]):typeof r.value==`string`&&(i=r.value)):typeof r==`string`&&(i=r),e.addFrame(t,i,a,u(r,`delay`,y),c(r,`duration`,b),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O))}else{var d=m(n,r),f=l(c(r,`interpolation`,k));e.add(t,n,d.getEnd,d.getStart,d.getActive,s(c(r,`ease`,S),c(r,`easeParams`,x)),u(r,`delay`,y),c(r,`duration`,b),o(r,`yoyo`,E),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O),f,f?r:null)}},j=new g(e,_),M=0;M{var r=n(70402),i=n(23568),a=n(57355),o=n(62329),s=n(35154),c=n(8357),l=n(43960);e.exports=function(e,t){if(t instanceof l)return t.parent=e,t;var n=new l(e);n.startDelay=s(t,`delay`,0),n.completeDelay=i(t,`completeDelay`,0),n.loop=Math.round(i(t,`loop`,s(t,`repeat`,0))),n.loopDelay=Math.round(i(t,`loopDelay`,s(t,`repeatDelay`,0))),n.paused=a(t,`paused`,!1),n.persist=a(t,`persist`,!1),n.callbackScope=s(t,`callbackScope`,n);var u,d=r.TYPES;for(u=0;u{e.exports={GetBoolean:n(57355),GetEaseFunction:n(6113),GetInterpolationFunction:n(91389),GetNewValue:n(55292),GetProps:n(82985),GetTargets:n(62329),GetValueOp:n(17777),NumberTweenBuilder:n(88032),StaggerBuilder:n(93109),TweenBuilder:n(8357)}}),73685:(e=>{e.exports=`active`}),98540:(e=>{e.exports=`complete`}),67233:(e=>{e.exports=`loop`}),2859:(e=>{e.exports=`pause`}),98336:(e=>{e.exports=`repeat`}),25764:(e=>{e.exports=`resume`}),32193:(e=>{e.exports=`start`}),84371:(e=>{e.exports=`stop`}),70766:(e=>{e.exports=`update`}),55659:(e=>{e.exports=`yoyo`}),842:((e,t,n)=>{e.exports={TWEEN_ACTIVE:n(73685),TWEEN_COMPLETE:n(98540),TWEEN_LOOP:n(67233),TWEEN_PAUSE:n(2859),TWEEN_RESUME:n(25764),TWEEN_REPEAT:n(98336),TWEEN_START:n(32193),TWEEN_STOP:n(84371),TWEEN_UPDATE:n(70766),TWEEN_YOYO:n(55659)}}),43066:((e,t,n)=>{e.exports={States:n(86353),Builders:n(30231),Events:n(842),TweenManager:n(40382),Tween:n(86081),TweenData:n(48177),TweenFrameData:n(42220),BaseTween:n(70402),TweenChain:n(43960)}}),70402:((e,t,n)=>{var r=n(83419),i=n(50792),a=n(842),o=n(86353),s=new r({Extends:i,initialize:function(e){i.call(this),this.parent=e,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=o.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(e){return this.timeScale=e,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(a.TWEEN_PAUSE,`onPause`)),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(a.TWEEN_RESUME,`onResume`)),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(a.TWEEN_COMPLETE,`onComplete`)},complete:function(e){return e===void 0&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return e===void 0&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(a.TWEEN_STOP,`onStop`),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(a.TWEEN_START,`onStart`),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,t,n){return n===void 0&&(n=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:t,params:n}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});s.TYPES=[`onActive`,`onComplete`,`onLoop`,`onPause`,`onRepeat`,`onResume`,`onStart`,`onStop`,`onUpdate`,`onYoyo`],e.exports=s}),95042:((e,t,n)=>{var r=n(83419),i=n(842),a=n(86353);e.exports=new r({initialize:function(e,t,n,r,i,a,o,s,c,l){this.tween=e,this.targetIndex=t,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=n,this.yoyo=i,this.hold=a,this.repeat=o,this.repeatDelay=s,this.repeatCounter=0,this.flipX=c,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(e){e===void 0&&(e=this.current),this.tween.targets[this.targetIndex][this.key]=e},setCreatedState:function(){this.state=a.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=a.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=a.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=a.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=a.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=a.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=a.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=a.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===a.CREATED},isDelayed:function(){return this.state===a.DELAY},isPendingRender:function(){return this.state===a.PENDING_RENDER},isPlayingForward:function(){return this.state===a.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===a.PLAYING_BACKWARD},isHolding:function(){return this.state===a.HOLD_DELAY},isRepeating:function(){return this.state===a.REPEAT_DELAY},isComplete:function(){return this.state===a.COMPLETE},setStateFromEnd:function(e){this.yoyo?this.onRepeat(e,!0,!0):this.repeatCounter>0?this.onRepeat(e,!0,!1):this.setCompleteState()},setStateFromStart:function(e){this.repeatCounter>0?this.onRepeat(e,!1):this.setCompleteState()},reset:function(){var e=this.tween,t=e.totalTargets,n=this.targetIndex,r=e.targets[n],i=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,i,0,n,t,e),this.repeatCounter=this.repeat===-1?a.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var s=o+this.repeatDelay;this.totalDuration=this.delay+o,this.repeat===-1?(this.totalDuration+=s*a.MAX,e.isInfinite=!0):this.repeat>0&&(this.totalDuration+=s*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(e,t,n){var r=this.tween,a=r.totalTargets,o=this.targetIndex,s=r.targets[o],c=this.key,l=c!==`texture`;if(this.elapsed=e,this.progress=e/this.duration,this.flipX&&s.toggleFlipX(),this.flipY&&s.toggleFlipY(),l&&(t||n)&&(this.start=this.getStartValue(s,c,this.start,o,a,r)),n){this.setPlayingBackwardState(),this.dispatchEvent(i.TWEEN_YOYO,`onYoyo`);return}this.repeatCounter--,l&&(this.end=this.getEndValue(s,c,this.start,o,a,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-e,l&&(this.current=this.start,s[c]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(i.TWEEN_REPEAT,`onRepeat`))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}})}),69902:(e=>{e.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:(e=>{e.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`.split(`.`)}),86081:((e,t,n)=>{var r=n(70402),i=n(83419),a=n(842),o=n(44603),s=n(39429),c=n(36383),l=n(86353),u=n(48177),d=n(42220),f=new i({Extends:r,initialize:function(e,t){r.call(this,e),this.targets=t,this.totalTargets=t.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(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g){var _=new u(this,e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g);return this.totalData=this.data.push(_),_},addFrame:function(e,t,n,r,i,a,o,s,c,l){var u=new d(this,e,t,n,r,i,a,o,s,c,l);return this.totalData=this.data.push(u),u},getValue:function(e){e===void 0&&(e=0);var t=null;return this.data&&(t=this.data[e].current),t},hasTarget:function(e){return this.targets&&this.targets.indexOf(e)!==-1},updateTo:function(e,t,n){if(n===void 0&&(n=!1),e!==`texture`)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.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(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=16.6),n===void 0&&(n=!1),this.isDestroyed())return console.warn(`Cannot seek destroyed Tween`,this),this;n||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`);var r=this.paused;if(this.paused=!1,e>0){for(var i=Math.floor(e/t),o=e-i*t,s=0;s0&&this.update(o)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(e){e===void 0&&(e=!1),this.duration=0,this.startDelay=c.MAX_SAFE_INTEGER;for(var t=this.data,n=0;n0?this.totalDuration=r+i+(r+o)*a:this.totalDuration=r+i},reset:function(e){return e===void 0&&(e=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=l.MAX),e||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)),this},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return this.persist?(this.setFinishedState(),!1):!0;if(this.paused||this.isFinished())return!1;if(e*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,`onStart`),e=0));var t=!1;if(this.isActive())for(var n=this.data,r=0;r{var r=n(72905),i=n(70402),a=n(83419),o=n(842),s=n(44603),c=n(39429),l=n(86353),u=new a({Extends:i,initialize:function(e){i.call(this,e),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(e){var t=this.parent.create(e);Array.isArray(t)||(t=[t]);for(var n=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;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 e=this.data,t=this.totalData,n=0;n{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g,_){r.call(this,e,t,c,l,u,d,f,p,m,h),this.key=n,this.getActiveValue=o,this.getEndValue=i,this.getStartValue=a,this.ease=s,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=_},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex],n=this.key;e&&(t[n]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(t[n]=this.getActiveValue(t,n,0))},update:function(e){var t=this.tween,n=t.totalTargets,r=this.targetIndex,a=t.targets[r],s=this.key;if(!a)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(a,s,a[s],r,n,t),this.end=this.getEndValue(a,s,this.start,r,n,t),this.current=this.start,a[s]=this.start,this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),l=this.isPlayingBackward();if(c||l){var u=this.elapsed,d=this.duration,f=0,p=!1;u+=e,u>=d?(f=u-d,u=d,p=!0):u<0&&(u=0);var m=i(u/d,0,1);this.elapsed=u,this.progress=m,this.previous=this.current,c||(m=1-m);var h=this.ease(m);this.interpolation?this.current=this.interpolation(this.interpolationData,h):this.current=this.start+(this.end-this.start)*h,a[s]=this.current,p&&(c?(t.isNumberTween&&(this.current=this.end,a[s]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(f)):(t.isNumberTween&&(this.current=this.start,a[s]=this.current),this.setStateFromStart(f))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key,a=this.current,o=this.previous;n.emit(e,n,i,r,a,o);var s=n.callbacks[t];s&&s.func.apply(n.callbackScope,[n,r,i,a,o].concat(s.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}})}),42220:((e,t,n)=>{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d){r.call(this,e,t,a,o,!1,s,c,l,u,d),this.key=`texture`,this.startTexture=null,this.endTexture=n,this.startFrame=null,this.endFrame=i,this.yoyo=c!==0},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=t.texture.key,this.startFrame=t.frame.name),e&&t.setTexture(this.startTexture,this.startFrame)},update:function(e){var t=this.tween,n=this.targetIndex,r=t.targets[n];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),s=this.isPlayingBackward();if(a||s){var c=this.elapsed,l=this.duration,u=0,d=!1;c+=e,c>=l?(u=c-l,c=l,d=!0):c<0&&(c=0);var f=i(c/l,0,1);this.elapsed=c,this.progress=f,d&&(a?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key;n.emit(e,n,i,r);var a=n.callbacks[t];a&&a.func.apply(n.callbackScope,[n,r,i].concat(a.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}})}),86353:(e=>{e.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:(e=>{function t(e){return!!e.get&&typeof e.get==`function`||!!e.set&&typeof e.set==`function`}function n(e,n,r){var i=r?e[n]:Object.getOwnPropertyDescriptor(e,n);return!r&&i.value&&typeof i.value==`object`&&(i=i.value),i&&t(i)?(i.enumerable===void 0&&(i.enumerable=!0),i.configurable===void 0&&(i.configurable=!0),i):!1}function r(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return n?(n.value&&typeof n.value==`object`&&(n=n.value),n.configurable===!1):!1}function i(e,t,i,a){for(var s in t)if(t.hasOwnProperty(s)){var c=n(t,s,i);if(c!==!1){if(r((a||e).prototype,s)){if(o.ignoreFinals)continue;throw Error(`cannot override final property '`+s+`', set Class.ignoreFinals = true to skip`)}Object.defineProperty(e.prototype,s,c)}else e.prototype[s]=t[s]}}function a(e,t){if(t){Array.isArray(t)||(t=[t]);for(var n=0;n{e.exports=function(){}}),20242:(e=>{e.exports=function(){return null}}),71146:(e=>{e.exports=function(e,t,n,r,i){if(i===void 0&&(i=e),n>0){var a=n-e.length;if(a<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.push(t),r&&r.call(i,t),t):null;for(var o=t.length-1;o>=0;)e.indexOf(t[o])!==-1&&t.splice(o,1),o--;if(o=t.length,o===0)return null;n>0&&o>a&&(t.splice(a),o=a);for(var s=0;s{e.exports=function(e,t,n,r,i,a){if(n===void 0&&(n=0),a===void 0&&(a=e),r>0){var o=r-e.length;if(o<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.splice(n,0,t),i&&i.call(a,t),t):null;for(var s=t.length-1;s>=0;)e.indexOf(t[s])!==-1&&t.pop(),s--;if(s=t.length,s===0)return null;r>0&&s>o&&(t.splice(o),s=o);for(var c=s-1;c>=0;c--){var l=t[c];e.splice(n,0,l),i&&i.call(a,l)}return t}}),66905:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=0;if(r(e,i,a))for(var s=i;s{e.exports=function(e,t,n){var r,i=[null];for(r=3;r{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a)){var o,s=[null];for(o=5;o{e.exports=function(e,t,n){if(!t.length)return NaN;if(t.length===1)return t[0];var r=1,i,a;if(n){if(et.length&&(r=t.length),n?(i=t[r-1][n],a=t[r][n],a-e<=e-i?t[r]:t[r-1]):(i=t[r-1],a=t[r],a-e<=e-i?a:i)}}),43491:(e=>{var t=function(e,n){n===void 0&&(n=[]);for(var r=0;r{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=[];if(r(e,i,a))for(var s=i;s{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),i!==-1){if(r(e,i,a))for(var o=i;o=0;o--){var s=e[o];if(!t||t&&n===void 0&&s.hasOwnProperty(t)||t&&n!==void 0&&s[t]===n)return s}return null}}),26546:(e=>{e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=e.length);var r=t+Math.floor(Math.random()*n);return e[r]===void 0?null:e[r]}}),85835:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r>i?e:(e.splice(r,1),i=e.indexOf(n),e.splice(i+1,0,t),e)}}),83371:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r{e.exports=function(e,t){var n=e.indexOf(t);if(n>0){var r=e[n-1],i=e.indexOf(r);e[n]=r,e[i]=t}return e}}),69693:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t);if(r===-1||n<0||n>=e.length)throw Error(`Supplied index out of bounds`);return r!==n&&(e.splice(r,1),e.splice(n,0,t)),t}}),40853:(e=>{e.exports=function(e,t){var n=e.indexOf(t);if(n!==-1&&n{e.exports=function(e,t,n,r){var i=[],a,o=!1;if((n||r)&&(o=!0,n||=``,r||=``),t=t;a--)o?i.push(n+a.toString()+r):i.push(a);else for(a=e;a<=t;a++)o?i.push(n+a.toString()+r):i.push(a);return i}}),593:((e,t,n)=>{var r=n(2284);e.exports=function(e,t,n){e===void 0&&(e=0),t===void 0&&(t=null),n===void 0&&(n=1),t===null&&(t=e,e=0);for(var i=[],a=Math.max(r((t-e)/(n||1)),0),o=0;o{function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e,i,a,o,s){for(a===void 0&&(a=0),o===void 0&&(o=e.length-1),s===void 0&&(s=n);o>a;){if(o-a>600){var c=o-a+1,l=i-a+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(l-c/2<0?-1:1);r(e,i,Math.max(a,Math.floor(i-l*d/c+f)),Math.min(o,Math.floor(i+(c-l)*d/c+f)),s)}var p=e[i],m=a,h=o;for(t(e,a,i),s(e[o],p)>0&&t(e,a,o);m0;)h--}s(e[a],p)===0?t(e,a,h):(h++,t(e,h,o)),h<=i&&(a=h+1),i<=h&&(o=h-1)}};e.exports=r}),88492:((e,t,n)=>{var r=n(35154),i=n(33680),a=function(e,t,n){for(var r=[],i=0;i{var r=n(19133);e.exports=function(e,t,n,i){i===void 0&&(i=e);var a;if(!Array.isArray(t))return a=e.indexOf(t),a===-1?null:(r(e,a),n&&n.call(i,t),t);for(var o=t.length-1,s=[];o>=0;){var c=t[o];a=e.indexOf(c),a!==-1&&(r(e,a),s.push(c),n&&n.call(i,c)),o--}return s}}),60248:((e,t,n)=>{var r=n(19133);e.exports=function(e,t,n,i){if(i===void 0&&(i=e),t<0||t>e.length-1)throw Error(`Index out of bounds`);var a=r(e,t);return n&&n.call(i,a),a}}),81409:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(t===void 0&&(t=0),n===void 0&&(n=e.length),a===void 0&&(a=e),r(e,t,n)){var o=n-t,s=e.splice(t,o);if(i)for(var c=0;c{var r=n(19133);e.exports=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.length),r(e,t+Math.floor(Math.random()*n))}}),42169:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t),i=e.indexOf(n);return r!==-1&&i===-1?(e[r]=n,!0):!1}}),86003:(e=>{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t,n,r){var i=e.length;if(t<0||t>=i||t>=n||n>i){if(r)throw Error(`Range Error: Values outside acceptable range`);return!1}else return!0}}),89545:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n>0&&(e.splice(n,1),e.unshift(t)),t}}),17810:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a))for(var o=i;o{e.exports=function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}}),90126:(e=>{e.exports=function(e){var t=/\D/g;return e.sort(function(e,n){return parseInt(e.replace(t,``),10)-parseInt(n.replace(t,``),10)}),e}}),19133:(e=>{e.exports=function(e,t){if(!(t>=e.length)){for(var n=e.length-1,r=e[t],i=t;i{var r=n(82264);function i(e,t){return String(e).localeCompare(t)}function a(e,t){var n=e.length;if(n<=1)return e;for(var r=Array(n),i=1;ii&&(c=i),l>i&&(l=i),u=s,d=c;;)if(u{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return e[r]=n,e[i]=t,e}}),37105:((e,t,n)=>{e.exports={Matrix:n(54915),Add:n(71146),AddAt:n(51067),BringToTop:n(66905),CountAllMatching:n(21612),Each:n(95428),EachInRange:n(36914),FindClosestInSorted:n(81957),Flatten:n(43491),GetAll:n(46710),GetFirst:n(58731),GetRandom:n(26546),MoveDown:n(70864),MoveTo:n(69693),MoveUp:n(40853),MoveAbove:n(85835),MoveBelow:n(83371),NumberArray:n(20283),NumberArrayStep:n(593),QuickSelect:n(43886),Range:n(88492),Remove:n(72905),RemoveAt:n(60248),RemoveBetween:n(81409),RemoveRandomElement:n(31856),Replace:n(42169),RotateLeft:n(86003),RotateRight:n(49498),SafeRange:n(82011),SendToBack:n(89545),SetAll:n(17810),Shuffle:n(33680),SortByDigits:n(90126),SpliceOne:n(19133),StableSort:n(19186),Swap:n(25630)}}),86922:(e=>{e.exports=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var t=e[0].length,n=1;n{var r=n(41836),i=n(86922);e.exports=function(e){var t=``;if(!i(e))return t;for(var n=0;n{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),Mt=H(),Nt=H(),Pt=H();H();function Ft(){let e=U(Nt);if(!e)throw Error(`Solidion: useScene() must be used within a component.`);return e}function It(){let e=U(Pt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function Lt(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Rt(e,t,n){Ge(),F(()=>{e.update(t,n)}),Ke()}function zt(e,t){return new Promise(n=>{let r=Lt(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Rt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:jt.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new jt.default.Game(o)})}function Bt(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&zt(r,e).then(t=>{n(t),Oe(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=St(()=>_e(Mt.Provider,{value:t.game,get children(){return _e(Nt.Provider,{value:t.scene,get children(){return _e(Pt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),L(()=>{let e=I(t);i&&i(),e&&(ke(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}function Vt(e){return L(It().register(e.onUpdate)),null}var Ht=10;function Ut(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Ut(r,t,n);return}if(typeof e==`function`){if(n>=Ht)return;Ut(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Pe(e))){let r=Ne(e);for(let e of r.children)Ut(e,t,n)}}}function Wt(e){let t=e.children;return M(()=>{Ut(t,!!e.when)}),t}function Gt(e){let t=e.each.map((t,n)=>e.children(t,n));return N(()=>{let n=e.each.length;for(let e=0;e{var t=Z(`rectangle`);return Q(t,`origin`,.5),X(n=>{var r=e.x,i=e.y,a=e.w,o=e.h,s=e.color,c=e.depth;return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`depth`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})(),(()=>{var t=Z(`ellipse`);return Q(t,`origin`,.5),X(n=>{var r=e.x-e.w/2,i=e.y,a=e.h,o=e.h,s=e.color,c=e.depth;return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`depth`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})(),(()=>{var t=Z(`ellipse`);return Q(t,`origin`,.5),X(n=>{var r=e.x+e.w/2,i=e.y,a=e.h,o=e.h,s=e.color,c=e.depth;return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`depth`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()]}function Wn(e){return Ct(()=>e.segments.map(t=>{if(t.h<=0)return null;let n=t.y+t.h/2;return[(()=>{var r=Z(`rectangle`);return Q(r,`y`,n),Q(r,`width`,20),Q(r,`origin`,.5),Q(r,`depth`,1),X(n=>{var i=e.centerX,a=t.h,o=t.color;return i!==n.e&&(n.e=Q(r,`x`,i,n.e)),a!==n.t&&(n.t=Q(r,`height`,a,n.t)),o!==n.a&&(n.a=Q(r,`fillColor`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),r})(),(()=>{var n=Z(`ellipse`);return Q(n,`width`,20),Q(n,`height`,20),Q(n,`origin`,.5),Q(n,`depth`,1),X(r=>{var i=e.centerX,a=t.y,o=t.color;return i!==r.e&&(r.e=Q(n,`x`,i,r.e)),a!==r.t&&(r.t=Q(n,`y`,a,r.t)),o!==r.a&&(r.a=Q(n,`fillColor`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),n})(),(()=>{var n=Z(`ellipse`);return Q(n,`width`,20),Q(n,`height`,20),Q(n,`origin`,.5),Q(n,`depth`,1),X(r=>{var i=e.centerX,a=t.y+t.h,o=t.color;return i!==r.e&&(r.e=Q(n,`x`,i,r.e)),a!==r.t&&(r.t=Q(n,`y`,a,r.t)),o!==r.a&&(r.a=Q(n,`fillColor`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),n})()]}))}function Gn(){let[e,t]=j(0),[n,r]=j(3),[i,a]=j(1),[o,s]=j(`ready`),[c,l]=j(Kt/2),u=!1,d=!1,f=0,p=0,m=0,h=1,g=hn,_=Array.from({length:cn*sn},()=>j(!0)),v=P(()=>_.filter(([e])=>e()).length),y=Array.from({length:cn*sn},(e,t)=>{let n=Math.floor(t/sn),r=fn+t%sn*(ln+dn)+ln/2,i=pn+n*(un+dn)+un/2;return{x:j(r),y:j(i)}});function b(e,t){return[fn+t*(ln+dn)+ln/2+p,pn+e*(un+dn)+un/2+m]}function x(){for(let e=0;e({hp:4,visible:j(!0),outerAlpha:j(.6),innerAlpha:j(.3)}));function C(e){let t=S[e];t.hp--,t.hp<=0?t.visible[1](!1):(t.outerAlpha[1](.15*t.hp),t.innerAlpha[1](.08*t.hp))}function w(){for(let e of S)e.hp=4,e.visible[1](!0),e.outerAlpha[1](.6),e.innerAlpha[1](.3)}let T=Array.from({length:24},()=>({x:j(-50),y:j(-50),visible:j(!1),glowVisible:j(!1),coreColor:j(16777198),coreW:j(gn),coreH:j(_n),vy:0,active:!1,isPlayer:!0,rawX:-50,rawY:-50}));function E(e,t,n,r){let i=T.find(e=>!e.active);i&&(i.rawX=e,i.rawY=t,i.vy=n,i.active=!0,i.isPlayer=r,i.x[1](e),i.y[1](t),i.visible[1](!0),r?(i.coreColor[1](16777198),i.coreW[1](gn),i.coreH[1](_n),i.glowVisible[1](!0)):(i.coreColor[1]($.green),i.coreW[1](vn),i.coreH[1](yn),i.glowVisible[1](!1)))}function D(e){e.active=!1,e.visible[1](!1),e.glowVisible[1](!1),e.rawX=-50,e.rawY=-50,e.x[1](-50),e.y[1](-50)}function O(){for(let e of T)D(e)}function k(){p=0,m=0,h=1,g=hn+(i()-1)*8;for(let[,e]of _)e(!0);x()}function A(){F(()=>{t(0),r(3),a(1),l(Kt/2),k(),w(),O(),s(`play`)})}function M(){F(()=>{a(e=>e+1),k(),w(),O(),s(`play`)})}function N(){let e=n()-1;F(e<=0?()=>{r(0),s(`dead`),O()}:()=>{r(e),O(),l(Kt/2)})}let I=()=>{let t=o();if(t===`ready`)return[`NADION DEFENSE`,`#ff9900`,`← → MOVE SPACE FIRE`];if(t===`dead`)return[`ARRAY OFFLINE`,`#cc4444`,`FINAL SCORE ${e()} \u2014 SPACE TO RETRY`];if(t===`win`)return[`SECTOR CLEAR`,`#44cc88`,`SCORE ${e()} \u2014 SPACE FOR NEXT WAVE`]};function L(){let e=Ft().input.keyboard;return e.on(`keydown-LEFT`,()=>{u=!0}),e.on(`keyup-LEFT`,()=>{u=!1}),e.on(`keydown-RIGHT`,()=>{d=!0}),e.on(`keyup-RIGHT`,()=>{d=!1}),e.on(`keydown-A`,()=>{u=!0}),e.on(`keyup-A`,()=>{u=!1}),e.on(`keydown-D`,()=>{d=!0}),e.on(`keyup-D`,()=>{d=!1}),e.on(`keydown-SPACE`,()=>{let e=o();if(e===`ready`){A();return}if(e===`dead`){A();return}if(e===`win`){M();return}let t=performance.now();t-f{let e=o();if(e===`ready`){A();return}if(e===`dead`){A();return}if(e===`win`){M();return}let t=performance.now();t-f{Ye({phase:o(),score:e(),lives:n(),wave:i(),alive:v(),playerX:c(),shieldHps:S.map(e=>e.hp),activeBolts:T.filter(e=>e.active).length})},V=(e,n)=>{if(z-=n,z<=0&&(z=200,B()),o()!==`play`)return;let a=Math.min(n/1e3,.033),f=c();u&&(f-=on*a),d&&(f+=on*a),f=jt.default.Math.Clamp(f,Qt+nn/2,$t-nn/2),l(f);let y=sn,w=-1;for(let e=0;ew&&(w=e));if(w>=0){let e=fn+y*(ln+dn)+p,t=fn+w*(ln+dn)+ln+p;p+=h*g*a,t+h*g*a>$t-4?(h=-1,m+=mn):e+h*g*a=0;e--)for(let t=0;t=an-rn){F(()=>{r(0),s(`dead`),O()});return}}for(let e=0;e=0;t--)if(_[t*sn+e][0]()){if(Math.random()qt+20){D(e);continue}if(e.y[1](e.rawY),e.isPlayer)for(let n=0;na-ln/2&&e.rawXo-un/2&&e.rawYe+kn[n]),D(e);break}}if(!e.active)break}else{if(e.rawX>f-nn/2&&e.rawXan-rn/2&&e.rawYn-Tn/2&&e.rawXDn-En/2&&e.rawY{s(`win`),O()})};jn/2;let H=Xt/2,U=Kt-Xt/2;return wt(Bt,{width:Kt,height:qt,get backgroundColor(){return $.bg},parent:`game-container`,onPointerDown:R,config:{input:{keyboard:!0}},get children(){return[wt(Vt,{onUpdate:V}),wt(L,{}),(()=>{var e=Z(`rectangle`);return Q(e,`x`,320),Q(e,`y`,270),Q(e,`width`,640),Q(e,`height`,540),Q(e,`origin`,.5),Q(e,`depth`,0),X(t=>Q(e,`fillColor`,$.bg,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,35),Q(e,`y`,21),Q(e,`width`,70),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.lavender,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,0),Q(e,`y`,21),Q(e,`width`,42),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.lavender,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,605),Q(e,`y`,21),Q(e,`width`,70),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.amber,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,640),Q(e,`y`,21),Q(e,`width`,42),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.amber,t)),e})(),wt(Wn,{centerX:H,segments:Bn}),wt(Wn,{centerX:U,segments:Vn}),wt(Un,{x:Nn+14,y:Fn,w:28,h:An,get color(){return $.orange},depth:1}),wt(Un,{x:290,y:Fn,w:14,h:An,get color(){return $.lavender},depth:1}),wt(Un,{x:350,y:Fn,w:14,h:An,get color(){return $.peach},depth:1}),wt(Un,{x:Pn-14,y:Fn,w:28,h:An,get color(){return $.lavender},depth:1}),(()=>{var e=Z(`rectangle`);return Q(e,`x`,35),Q(e,`y`,533),Q(e,`width`,70),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.purple,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,0),Q(e,`y`,533),Q(e,`width`,14),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.purple,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,605),Q(e,`y`,533),Q(e,`width`,70),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.orange,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,640),Q(e,`y`,533),Q(e,`width`,14),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.orange,t)),e})(),wt(Un,{x:Nn+Ln/2,y:In,w:Ln,h:An,get color(){return $.amber},depth:1}),wt(Gt,{each:_,children:([e],t)=>{let n=Math.floor(t/sn),r=y[t];return[(()=>{var t=Z(`rectangle`);return Q(t,`width`,32),Q(t,`height`,18),Q(t,`origin`,.5),Q(t,`depth`,3),X(i=>{var a=r.x[0](),o=r.y[0](),s=On[n],c=e();return a!==i.e&&(i.e=Q(t,`x`,a,i.e)),o!==i.t&&(i.t=Q(t,`y`,o,i.t)),s!==i.a&&(i.a=Q(t,`fillColor`,s,i.a)),c!==i.o&&(i.o=Q(t,`visible`,c,i.o)),i},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`width`,4),Q(t,`height`,12),Q(t,`fillColor`,0),Q(t,`origin`,.5),Q(t,`depth`,4),X(n=>{var i=r.x[0]()-ln/2+2,a=r.y[0](),o=e();return i!==n.e&&(n.e=Q(t,`x`,i,n.e)),a!==n.t&&(n.t=Q(t,`y`,a,n.t)),o!==n.a&&(n.a=Q(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`width`,4),Q(t,`height`,12),Q(t,`fillColor`,0),Q(t,`origin`,.5),Q(t,`depth`,4),X(n=>{var i=r.x[0]()+ln/2-2,a=r.y[0](),o=e();return i!==n.e&&(n.e=Q(t,`x`,i,n.e)),a!==n.t&&(n.t=Q(t,`y`,a,n.t)),o!==n.a&&(n.a=Q(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`width`,22),Q(t,`height`,3),Q(t,`fillColor`,16777215),Q(t,`origin`,.5),Q(t,`depth`,4),Q(t,`alpha`,.25),X(n=>{var i=r.x[0](),a=r.y[0]()-un/2+3,o=e();return i!==n.e&&(n.e=Q(t,`x`,i,n.e)),a!==n.t&&(n.t=Q(t,`y`,a,n.t)),o!==n.a&&(n.a=Q(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}}),Ct(()=>S.map((e,t)=>{let n=Qt+Hn*(t+1);return[(()=>{var t=Z(`rectangle`);return Q(t,`x`,n),Q(t,`y`,454),Q(t,`width`,48),Q(t,`height`,20),Q(t,`origin`,.5),Q(t,`depth`,2),X(n=>{var r=$.blue,i=e.outerAlpha[0](),a=e.visible[0]();return r!==n.e&&(n.e=Q(t,`fillColor`,r,n.e)),i!==n.t&&(n.t=Q(t,`alpha`,i,n.t)),a!==n.a&&(n.a=Q(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`x`,n),Q(t,`y`,454),Q(t,`width`,42),Q(t,`height`,14),Q(t,`origin`,.5),Q(t,`depth`,2),X(n=>{var r=$.blueLight,i=e.innerAlpha[0](),a=e.visible[0]();return r!==n.e&&(n.e=Q(t,`fillColor`,r,n.e)),i!==n.t&&(n.t=Q(t,`alpha`,i,n.t)),a!==n.a&&(n.a=Q(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]})),(()=>{var e=Z(`rectangle`);return Q(e,`y`,504),Q(e,`width`,52),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c(),r=$.orange;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,495),Q(e,`width`,16),Q(e,`height`,6),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c(),r=$.gold;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,492),Q(e,`width`,4),Q(e,`height`,4),Q(e,`fillColor`,16777215),Q(e,`origin`,.5),Q(e,`depth`,6),X(t=>Q(e,`x`,c(),t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,504),Q(e,`width`,4),Q(e,`height`,18),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c()-nn/2+2,r=$.amber;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,504),Q(e,`width`,4),Q(e,`height`,18),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c()+nn/2-2,r=$.amber;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),Ct(()=>T.map(e=>[(()=>{var t=Z(`rectangle`);return Q(t,`width`,6),Q(t,`height`,20),Q(t,`origin`,.5),Q(t,`depth`,7),Q(t,`alpha`,.45),X(n=>{var r=e.x[0](),i=e.y[0](),a=$.orange,o=e.glowVisible[0]();return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`fillColor`,a,n.a)),o!==n.o&&(n.o=Q(t,`visible`,o,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`origin`,.5),Q(t,`depth`,8),X(n=>{var r=e.x[0](),i=e.y[0](),a=e.coreW[0](),o=e.coreH[0](),s=e.coreColor[0](),c=e.visible[0]();return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`visible`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()])),(()=>{var t=Z(`text`);return Q(t,`x`,200),Q(t,`y`,35),Q(t,`fontSize`,14),Q(t,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(t,`color`,`#ff9900`),Q(t,`origin`,.5),Q(t,`depth`,10),X(n=>Q(t,`text`,`SCORE ${String(e()).padStart(6,`0`)}`,n)),t})(),(()=>{var e=Z(`text`);return Q(e,`x`,320),Q(e,`y`,35),Q(e,`fontSize`,12),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`color`,`#cc99cc`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>Q(e,`text`,`SEC ${i()}`,t)),e})(),(()=>{var e=Z(`text`);return Q(e,`x`,440),Q(e,`y`,35),Q(e,`fontSize`,14),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`color`,`#ff9900`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>Q(e,`text`,`ARRAYS ${`■ `.repeat(n())}`,t)),e})(),wt(Wt,{get when(){return o()!==`play`},get children(){return[(()=>{var e=Z(`rectangle`);return Q(e,`x`,320),Q(e,`y`,270),Q(e,`width`,324),Q(e,`height`,124),Q(e,`origin`,.5),Q(e,`depth`,8),Q(e,`alpha`,.5),X(t=>Q(e,`fillColor`,$.orange,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,320),Q(e,`y`,270),Q(e,`width`,320),Q(e,`height`,120),Q(e,`fillColor`,0),Q(e,`origin`,.5),Q(e,`depth`,9),Q(e,`alpha`,.85),e})(),(()=>{var e=Z(`text`);return Q(e,`x`,320),Q(e,`y`,252),Q(e,`fontSize`,26),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>{var n=I()?I()[0]:``,r=I()?I()[1]:`#ffffff`;return n!==t.e&&(t.e=Q(e,`text`,n,t.e)),r!==t.t&&(t.t=Q(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`text`);return Q(e,`x`,320),Q(e,`y`,288),Q(e,`fontSize`,13),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`color`,`#cc99cc`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>Q(e,`text`,I()?I()[2]:``,t)),e})()]}})]}})}A(()=>{let e=Gn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file +`}}return t}}),92598:(e=>{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),Mt=H(),Nt=H(),Pt=H();H();function Ft(){let e=U(Nt);if(!e)throw Error(`Solidion: useScene() must be used within a component.`);return e}function It(){let e=U(Pt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function Lt(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Rt(e,t,n){Ge(),F(()=>{e.update(t,n)}),Ke()}function zt(e,t){return new Promise(n=>{let r=Lt(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Rt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:jt.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new jt.default.Game(o)})}function Bt(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&zt(r,e).then(t=>{n(t),Oe(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=St(()=>_e(Mt.Provider,{value:t.game,get children(){return _e(Nt.Provider,{value:t.scene,get children(){return _e(Pt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),L(()=>{let e=I(t);i&&i(),e&&(ke(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}var Vt=10;function Ht(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Ht(r,t,n);return}if(typeof e==`function`){if(n>=Vt)return;Ht(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Pe(e))){let r=Ne(e);for(let e of r.children)Ht(e,t,n)}}}function Ut(e){return L(It().register(e.onUpdate)),null}function Wt(e){let t=e.children;return M(()=>{Ht(t,!!e.when)}),t}function Gt(e){let t=e.each.map((t,n)=>e.children(t,n));return N(()=>{let n=e.each.length;for(let e=0;e{var t=Z(`rectangle`);return Q(t,`origin`,.5),X(n=>{var r=e.x,i=e.y,a=e.w,o=e.h,s=e.color,c=e.depth;return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`depth`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})(),(()=>{var t=Z(`ellipse`);return Q(t,`origin`,.5),X(n=>{var r=e.x-e.w/2,i=e.y,a=e.h,o=e.h,s=e.color,c=e.depth;return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`depth`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})(),(()=>{var t=Z(`ellipse`);return Q(t,`origin`,.5),X(n=>{var r=e.x+e.w/2,i=e.y,a=e.h,o=e.h,s=e.color,c=e.depth;return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`depth`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()]}function Wn(e){return Ct(()=>e.segments.map(t=>{if(t.h<=0)return null;let n=t.y+t.h/2;return[(()=>{var r=Z(`rectangle`);return Q(r,`y`,n),Q(r,`width`,20),Q(r,`origin`,.5),Q(r,`depth`,1),X(n=>{var i=e.centerX,a=t.h,o=t.color;return i!==n.e&&(n.e=Q(r,`x`,i,n.e)),a!==n.t&&(n.t=Q(r,`height`,a,n.t)),o!==n.a&&(n.a=Q(r,`fillColor`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),r})(),(()=>{var n=Z(`ellipse`);return Q(n,`width`,20),Q(n,`height`,20),Q(n,`origin`,.5),Q(n,`depth`,1),X(r=>{var i=e.centerX,a=t.y,o=t.color;return i!==r.e&&(r.e=Q(n,`x`,i,r.e)),a!==r.t&&(r.t=Q(n,`y`,a,r.t)),o!==r.a&&(r.a=Q(n,`fillColor`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),n})(),(()=>{var n=Z(`ellipse`);return Q(n,`width`,20),Q(n,`height`,20),Q(n,`origin`,.5),Q(n,`depth`,1),X(r=>{var i=e.centerX,a=t.y+t.h,o=t.color;return i!==r.e&&(r.e=Q(n,`x`,i,r.e)),a!==r.t&&(r.t=Q(n,`y`,a,r.t)),o!==r.a&&(r.a=Q(n,`fillColor`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),n})()]}))}function Gn(){let[e,t]=j(0),[n,r]=j(3),[i,a]=j(1),[o,s]=j(`ready`),[c,l]=j(Kt/2),u=!1,d=!1,f=0,p=0,m=0,h=1,g=hn,_=Array.from({length:cn*sn},()=>j(!0)),v=P(()=>_.filter(([e])=>e()).length),y=Array.from({length:cn*sn},(e,t)=>{let n=Math.floor(t/sn),r=fn+t%sn*(ln+dn)+ln/2,i=pn+n*(un+dn)+un/2;return{x:j(r),y:j(i)}});function b(e,t){return[fn+t*(ln+dn)+ln/2+p,pn+e*(un+dn)+un/2+m]}function x(){for(let e=0;e({hp:4,visible:j(!0),outerAlpha:j(.6),innerAlpha:j(.3)}));function C(e){let t=S[e];t.hp--,t.hp<=0?t.visible[1](!1):(t.outerAlpha[1](.15*t.hp),t.innerAlpha[1](.08*t.hp))}function w(){for(let e of S)e.hp=4,e.visible[1](!0),e.outerAlpha[1](.6),e.innerAlpha[1](.3)}let T=Array.from({length:24},()=>({x:j(-50),y:j(-50),visible:j(!1),glowVisible:j(!1),coreColor:j(16777198),coreW:j(gn),coreH:j(_n),vy:0,active:!1,isPlayer:!0,rawX:-50,rawY:-50}));function E(e,t,n,r){let i=T.find(e=>!e.active);i&&(i.rawX=e,i.rawY=t,i.vy=n,i.active=!0,i.isPlayer=r,i.x[1](e),i.y[1](t),i.visible[1](!0),r?(i.coreColor[1](16777198),i.coreW[1](gn),i.coreH[1](_n),i.glowVisible[1](!0)):(i.coreColor[1]($.green),i.coreW[1](vn),i.coreH[1](yn),i.glowVisible[1](!1)))}function D(e){e.active=!1,e.visible[1](!1),e.glowVisible[1](!1),e.rawX=-50,e.rawY=-50,e.x[1](-50),e.y[1](-50)}function O(){for(let e of T)D(e)}function k(){p=0,m=0,h=1,g=hn+(i()-1)*8;for(let[,e]of _)e(!0);x()}function A(){F(()=>{t(0),r(3),a(1),l(Kt/2),k(),w(),O(),s(`play`)})}function M(){F(()=>{a(e=>e+1),k(),w(),O(),s(`play`)})}function N(){let e=n()-1;F(e<=0?()=>{r(0),s(`dead`),O()}:()=>{r(e),O(),l(Kt/2)})}let I=()=>{let t=o();if(t===`ready`)return[`NADION DEFENSE`,`#ff9900`,`← → MOVE SPACE FIRE`];if(t===`dead`)return[`ARRAY OFFLINE`,`#cc4444`,`FINAL SCORE ${e()} \u2014 SPACE TO RETRY`];if(t===`win`)return[`SECTOR CLEAR`,`#44cc88`,`SCORE ${e()} \u2014 SPACE FOR NEXT WAVE`]};function L(){let e=Ft().input.keyboard;return e.on(`keydown-LEFT`,()=>{u=!0}),e.on(`keyup-LEFT`,()=>{u=!1}),e.on(`keydown-RIGHT`,()=>{d=!0}),e.on(`keyup-RIGHT`,()=>{d=!1}),e.on(`keydown-A`,()=>{u=!0}),e.on(`keyup-A`,()=>{u=!1}),e.on(`keydown-D`,()=>{d=!0}),e.on(`keyup-D`,()=>{d=!1}),e.on(`keydown-SPACE`,()=>{let e=o();if(e===`ready`){A();return}if(e===`dead`){A();return}if(e===`win`){M();return}let t=performance.now();t-f{let e=o();if(e===`ready`){A();return}if(e===`dead`){A();return}if(e===`win`){M();return}let t=performance.now();t-f{Ye({phase:o(),score:e(),lives:n(),wave:i(),alive:v(),playerX:c(),shieldHps:S.map(e=>e.hp),activeBolts:T.filter(e=>e.active).length})},V=(e,n)=>{if(z-=n,z<=0&&(z=200,B()),o()!==`play`)return;let a=Math.min(n/1e3,.033),f=c();u&&(f-=on*a),d&&(f+=on*a),f=jt.default.Math.Clamp(f,Qt+nn/2,$t-nn/2),l(f);let y=sn,w=-1;for(let e=0;ew&&(w=e));if(w>=0){let e=fn+y*(ln+dn)+p,t=fn+w*(ln+dn)+ln+p;p+=h*g*a,t+h*g*a>$t-4?(h=-1,m+=mn):e+h*g*a=0;e--)for(let t=0;t=an-rn){F(()=>{r(0),s(`dead`),O()});return}}for(let e=0;e=0;t--)if(_[t*sn+e][0]()){if(Math.random()qt+20){D(e);continue}if(e.y[1](e.rawY),e.isPlayer)for(let n=0;na-ln/2&&e.rawXo-un/2&&e.rawYe+kn[n]),D(e);break}}if(!e.active)break}else{if(e.rawX>f-nn/2&&e.rawXan-rn/2&&e.rawYn-Tn/2&&e.rawXDn-En/2&&e.rawY{s(`win`),O()})};jn/2;let H=Xt/2,U=Kt-Xt/2;return wt(Bt,{width:Kt,height:qt,get backgroundColor(){return $.bg},parent:`game-container`,onPointerDown:R,config:{input:{keyboard:!0}},get children(){return[wt(Ut,{onUpdate:V}),wt(L,{}),(()=>{var e=Z(`rectangle`);return Q(e,`x`,320),Q(e,`y`,270),Q(e,`width`,640),Q(e,`height`,540),Q(e,`origin`,.5),Q(e,`depth`,0),X(t=>Q(e,`fillColor`,$.bg,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,35),Q(e,`y`,21),Q(e,`width`,70),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.lavender,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,0),Q(e,`y`,21),Q(e,`width`,42),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.lavender,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,605),Q(e,`y`,21),Q(e,`width`,70),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.amber,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,640),Q(e,`y`,21),Q(e,`width`,42),Q(e,`height`,42),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.amber,t)),e})(),wt(Wn,{centerX:H,segments:Bn}),wt(Wn,{centerX:U,segments:Vn}),wt(Un,{x:Nn+14,y:Fn,w:28,h:An,get color(){return $.orange},depth:1}),wt(Un,{x:290,y:Fn,w:14,h:An,get color(){return $.lavender},depth:1}),wt(Un,{x:350,y:Fn,w:14,h:An,get color(){return $.peach},depth:1}),wt(Un,{x:Pn-14,y:Fn,w:28,h:An,get color(){return $.lavender},depth:1}),(()=>{var e=Z(`rectangle`);return Q(e,`x`,35),Q(e,`y`,533),Q(e,`width`,70),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.purple,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,0),Q(e,`y`,533),Q(e,`width`,14),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.purple,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,605),Q(e,`y`,533),Q(e,`width`,70),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.orange,t)),e})(),(()=>{var e=Z(`ellipse`);return Q(e,`x`,640),Q(e,`y`,533),Q(e,`width`,14),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,1),X(t=>Q(e,`fillColor`,$.orange,t)),e})(),wt(Un,{x:Nn+Ln/2,y:In,w:Ln,h:An,get color(){return $.amber},depth:1}),wt(Gt,{each:_,children:([e],t)=>{let n=Math.floor(t/sn),r=y[t];return[(()=>{var t=Z(`rectangle`);return Q(t,`width`,32),Q(t,`height`,18),Q(t,`origin`,.5),Q(t,`depth`,3),X(i=>{var a=r.x[0](),o=r.y[0](),s=On[n],c=e();return a!==i.e&&(i.e=Q(t,`x`,a,i.e)),o!==i.t&&(i.t=Q(t,`y`,o,i.t)),s!==i.a&&(i.a=Q(t,`fillColor`,s,i.a)),c!==i.o&&(i.o=Q(t,`visible`,c,i.o)),i},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`width`,4),Q(t,`height`,12),Q(t,`fillColor`,0),Q(t,`origin`,.5),Q(t,`depth`,4),X(n=>{var i=r.x[0]()-ln/2+2,a=r.y[0](),o=e();return i!==n.e&&(n.e=Q(t,`x`,i,n.e)),a!==n.t&&(n.t=Q(t,`y`,a,n.t)),o!==n.a&&(n.a=Q(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`width`,4),Q(t,`height`,12),Q(t,`fillColor`,0),Q(t,`origin`,.5),Q(t,`depth`,4),X(n=>{var i=r.x[0]()+ln/2-2,a=r.y[0](),o=e();return i!==n.e&&(n.e=Q(t,`x`,i,n.e)),a!==n.t&&(n.t=Q(t,`y`,a,n.t)),o!==n.a&&(n.a=Q(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`width`,22),Q(t,`height`,3),Q(t,`fillColor`,16777215),Q(t,`origin`,.5),Q(t,`depth`,4),Q(t,`alpha`,.25),X(n=>{var i=r.x[0](),a=r.y[0]()-un/2+3,o=e();return i!==n.e&&(n.e=Q(t,`x`,i,n.e)),a!==n.t&&(n.t=Q(t,`y`,a,n.t)),o!==n.a&&(n.a=Q(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}}),Ct(()=>S.map((e,t)=>{let n=Qt+Hn*(t+1);return[(()=>{var t=Z(`rectangle`);return Q(t,`x`,n),Q(t,`y`,454),Q(t,`width`,48),Q(t,`height`,20),Q(t,`origin`,.5),Q(t,`depth`,2),X(n=>{var r=$.blue,i=e.outerAlpha[0](),a=e.visible[0]();return r!==n.e&&(n.e=Q(t,`fillColor`,r,n.e)),i!==n.t&&(n.t=Q(t,`alpha`,i,n.t)),a!==n.a&&(n.a=Q(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`x`,n),Q(t,`y`,454),Q(t,`width`,42),Q(t,`height`,14),Q(t,`origin`,.5),Q(t,`depth`,2),X(n=>{var r=$.blueLight,i=e.innerAlpha[0](),a=e.visible[0]();return r!==n.e&&(n.e=Q(t,`fillColor`,r,n.e)),i!==n.t&&(n.t=Q(t,`alpha`,i,n.t)),a!==n.a&&(n.a=Q(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]})),(()=>{var e=Z(`rectangle`);return Q(e,`y`,504),Q(e,`width`,52),Q(e,`height`,14),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c(),r=$.orange;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,495),Q(e,`width`,16),Q(e,`height`,6),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c(),r=$.gold;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,492),Q(e,`width`,4),Q(e,`height`,4),Q(e,`fillColor`,16777215),Q(e,`origin`,.5),Q(e,`depth`,6),X(t=>Q(e,`x`,c(),t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,504),Q(e,`width`,4),Q(e,`height`,18),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c()-nn/2+2,r=$.amber;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`y`,504),Q(e,`width`,4),Q(e,`height`,18),Q(e,`origin`,.5),Q(e,`depth`,5),X(t=>{var n=c()+nn/2-2,r=$.amber;return n!==t.e&&(t.e=Q(e,`x`,n,t.e)),r!==t.t&&(t.t=Q(e,`fillColor`,r,t.t)),t},{e:void 0,t:void 0}),e})(),Ct(()=>T.map(e=>[(()=>{var t=Z(`rectangle`);return Q(t,`width`,6),Q(t,`height`,20),Q(t,`origin`,.5),Q(t,`depth`,7),Q(t,`alpha`,.45),X(n=>{var r=e.x[0](),i=e.y[0](),a=$.orange,o=e.glowVisible[0]();return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`fillColor`,a,n.a)),o!==n.o&&(n.o=Q(t,`visible`,o,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=Z(`rectangle`);return Q(t,`origin`,.5),Q(t,`depth`,8),X(n=>{var r=e.x[0](),i=e.y[0](),a=e.coreW[0](),o=e.coreH[0](),s=e.coreColor[0](),c=e.visible[0]();return r!==n.e&&(n.e=Q(t,`x`,r,n.e)),i!==n.t&&(n.t=Q(t,`y`,i,n.t)),a!==n.a&&(n.a=Q(t,`width`,a,n.a)),o!==n.o&&(n.o=Q(t,`height`,o,n.o)),s!==n.i&&(n.i=Q(t,`fillColor`,s,n.i)),c!==n.n&&(n.n=Q(t,`visible`,c,n.n)),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()])),(()=>{var t=Z(`text`);return Q(t,`x`,200),Q(t,`y`,35),Q(t,`fontSize`,14),Q(t,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(t,`color`,`#ff9900`),Q(t,`origin`,.5),Q(t,`depth`,10),X(n=>Q(t,`text`,`SCORE ${String(e()).padStart(6,`0`)}`,n)),t})(),(()=>{var e=Z(`text`);return Q(e,`x`,320),Q(e,`y`,35),Q(e,`fontSize`,12),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`color`,`#cc99cc`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>Q(e,`text`,`SEC ${i()}`,t)),e})(),(()=>{var e=Z(`text`);return Q(e,`x`,440),Q(e,`y`,35),Q(e,`fontSize`,14),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`color`,`#ff9900`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>Q(e,`text`,`ARRAYS ${`■ `.repeat(n())}`,t)),e})(),wt(Wt,{get when(){return o()!==`play`},get children(){return[(()=>{var e=Z(`rectangle`);return Q(e,`x`,320),Q(e,`y`,270),Q(e,`width`,324),Q(e,`height`,124),Q(e,`origin`,.5),Q(e,`depth`,8),Q(e,`alpha`,.5),X(t=>Q(e,`fillColor`,$.orange,t)),e})(),(()=>{var e=Z(`rectangle`);return Q(e,`x`,320),Q(e,`y`,270),Q(e,`width`,320),Q(e,`height`,120),Q(e,`fillColor`,0),Q(e,`origin`,.5),Q(e,`depth`,9),Q(e,`alpha`,.85),e})(),(()=>{var e=Z(`text`);return Q(e,`x`,320),Q(e,`y`,252),Q(e,`fontSize`,26),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>{var n=I()?I()[0]:``,r=I()?I()[1]:`#ffffff`;return n!==t.e&&(t.e=Q(e,`text`,n,t.e)),r!==t.t&&(t.t=Q(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=Z(`text`);return Q(e,`x`,320),Q(e,`y`,288),Q(e,`fontSize`,13),Q(e,`fontFamily`,`'Arial Narrow', 'Helvetica Neue', Arial, sans-serif`),Q(e,`color`,`#cc99cc`),Q(e,`origin`,.5),Q(e,`depth`,10),X(t=>Q(e,`text`,I()?I()[2]:``,t)),e})()]}})]}})}A(()=>{let e=Gn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file diff --git a/examples/nadion-defense/dist/index.html b/examples/nadion-defense/dist/index.html index bc91daa..c209dc2 100644 --- a/examples/nadion-defense/dist/index.html +++ b/examples/nadion-defense/dist/index.html @@ -35,7 +35,7 @@ } .footer a { color: #ff9944; text-decoration: none; } - +
diff --git a/examples/nadion-defense/vite.config.ts b/examples/nadion-defense/vite.config.ts index 3bf83b7..d0cd3b5 100644 --- a/examples/nadion-defense/vite.config.ts +++ b/examples/nadion-defense/vite.config.ts @@ -18,6 +18,7 @@ export default defineConfig({ "solidion/ecs": resolve(__dirname, "../../src/ecs/index.ts"), "solidion/core": resolve(__dirname, "../../src/core/index.ts"), "solidion/debug": resolve(__dirname, "../../src/debug/index.ts"), + "solidion/renderer": resolve(__dirname, "../../src/renderer.ts"), "solidion": resolve(__dirname, "../../src/index.ts"), // Deduplicate solid-js: ensure both example and library code use the // same instance, AND use the browser build (not server/SSR). diff --git a/examples/null-pow/dist/assets/index-157JVz5-.js b/examples/null-pow/dist/assets/index-yj2HKat-.js similarity index 99% rename from examples/null-pow/dist/assets/index-157JVz5-.js rename to examples/null-pow/dist/assets/index-yj2HKat-.js index 180dfa5..2ee3b89 100644 --- a/examples/null-pow/dist/assets/index-157JVz5-.js +++ b/examples/null-pow/dist/assets/index-yj2HKat-.js @@ -65,4 +65,4 @@ return new `+this.key+`(); `),s=/^[ ]*(- )*(\w+)+[: ]+(.*)/,c=``,l=``,u={x:0,y:0,width:0,height:0},d=0;d{var r=n(50030),i=function(e){for(var t=e.mipmaps,n=1;n{e.exports={AtlasXML:n(89905),Canvas:n(72893),Image:n(4832),JSONArray:n(78566),JSONHash:n(39711),KTXParser:n(31403),PVRParser:n(82038),SpriteSheet:n(75549),SpriteSheetFromAtlas:n(47534),UnityYAML:n(86147)}}),80341:(e=>{e.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}}),16536:((e,t,n)=>{e.exports=new(n(83419))({initialize:function(e,t,n,r,i,a,o){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),i===void 0&&(i=0),a===void 0&&(a=0),this.name=e,this.firstgid=t|0,this.imageWidth=n|0,this.imageHeight=r|0,this.imageMargin=i|0,this.imageSpacing=a|0,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(e){return e>=this.firstgid&&e{e.exports=new(n(83419))({initialize:function(e){if(this.gids=[],e!==void 0)for(var t=0;t{var r=n(80341),i=n(87010),a=n(46177),o=n(49075);e.exports=function(e,t,n,s,c,l,u,d){n===void 0&&(n=32),s===void 0&&(s=32),c===void 0&&(c=10),l===void 0&&(l=10),d===void 0&&(d=!1);var f=null;if(Array.isArray(u))f=a(t===void 0?`map`:t,r.ARRAY_2D,u,n,s,d);else if(t!==void 0){var p=e.cache.tilemap.get(t);p?f=a(t,p.format,p.data,n,s,d):console.warn(`No map data found for key `+t)}return f===null&&(f=new i({tileWidth:n,tileHeight:s,width:c,height:l})),new o(e,f)}}),23029:((e,t,n)=>{var r=n(83419),i=n(31401),a=n(91907),o=n(62644),s=n(93232);e.exports=new r({Mixins:[i.AlphaSingle,i.Flip,i.Visible],initialize:function(e,t,n,r,i,a,o,s){this.layer=e,this.index=t,this.x=n,this.y=r,this.width=i,this.height=a,this.right,this.bottom,this.baseWidth=o===void 0?i:o,this.baseHeight=s===void 0?a:s,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(e,t){return!(ethis.right||t>this.bottom)},copy:function(e){return this.index=e.index,this.alpha=e.alpha,this.properties=o(e.properties),this.visible=e.visible,this.setFlip(e.flipX,e.flipY),this.tint=e.tint,this.rotation=e.rotation,this.collideUp=e.collideUp,this.collideDown=e.collideDown,this.collideLeft=e.collideLeft,this.collideRight=e.collideRight,this.collisionCallback=e.collisionCallback,this.collisionCallbackContext=e.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(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).x:this.x*this.baseWidth},getRight:function(e){var t=this.tilemapLayer;return t?this.getLeft(e)+this.width*t.scaleX:this.getLeft(e)+this.width},getTop:function(e){var t=this.tilemapLayer;return t?t.tileToWorldXY(this.x,this.y,void 0,e).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(e){var t=this.tilemapLayer;return t?this.getTop(e)+this.height*t.scaleY:this.getTop(e)+this.height},getBounds:function(e,t){return t===void 0&&(t=new s),t.x=this.getLeft(e),t.y=this.getTop(e),t.width=this.getRight(e)-t.x,t.height=this.getBottom(e)-t.y,t},getCenterX:function(e){return(this.getLeft(e)+this.getRight(e))/2},getCenterY:function(e){return(this.getTop(e)+this.getBottom(e))/2},intersects:function(e,t,n,r){return!(n<=this.pixelX||r<=this.pixelY||e>=this.right||t>=this.bottom)},isInteresting:function(e,t){return e&&t?this.canCollide||this.hasInterestingFace:e?this.collides:t?this.hasInterestingFace:!1},resetCollision:function(e){return e===void 0&&(e=!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,e&&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(e,t,n,r,i){return t===void 0&&(t=e),n===void 0&&(n=e),r===void 0&&(r=e),i===void 0&&(i=!0),this.collideLeft=e,this.collideRight=t,this.collideUp=n,this.collideDown=r,this.faceLeft=e,this.faceRight=t,this.faceTop=n,this.faceBottom=r,i&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(e,t){return e===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=e,this.collisionCallbackContext=t),this},setSize:function(e,t,n,r){return e!==void 0&&(this.width=e),t!==void 0&&(this.height=t),n!==void 0&&(this.baseWidth=n),r!==void 0&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var e=this.layer.orientation;if(e===a.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(e===a.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(e===a.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(e===a.HEXAGONAL){var t=this.layer.staggerAxis,n=this.layer.staggerIndex,r=this.layer.hexSideLength,i,o;t===`y`?(o=(this.baseHeight-r)/2+r,n===`odd`?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*o):t===`x`&&(i=(this.baseWidth-r)/2+r,this.pixelX=this.x*i,n===`odd`?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=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||this.collisionCallback!==void 0}},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 e=this.layer.tilemapLayer;if(e){var t=e.gidMap[this.index];if(t)return t}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var e=this.tilemapLayer;return e?e.tilemap:null}}})}),49075:((e,t,n)=>{var r=n(84101),i=n(83419),a=n(39506),o=n(80341),s=n(95540),c=n(14977),l=n(27462),u=n(91907),d=n(36305),f=n(19133),p=n(68287),m=n(23029),h=n(81086),g=n(20442),_=n(33629);e.exports=new i({initialize:function(e,t){this.scene=e,this.tileWidth=t.tileWidth,this.tileHeight=t.tileHeight,this.width=t.width,this.height=t.height,this.orientation=t.orientation,this.renderOrder=t.renderOrder,this.format=t.format,this.version=t.version,this.properties=t.properties,this.widthInPixels=t.widthInPixels,this.heightInPixels=t.heightInPixels,this.imageCollections=t.imageCollections,this.images=t.images,this.layers=t.layers,this.tiles=t.tiles,this.tilesets=t.tilesets,this.objects=t.objects,this.currentLayerIndex=0,this.hexSideLength=t.hexSideLength;var n=this.orientation;this._convert={WorldToTileXY:h.GetWorldToTileXYFunction(n),WorldToTileX:h.GetWorldToTileXFunction(n),WorldToTileY:h.GetWorldToTileYFunction(n),TileToWorldXY:h.GetTileToWorldXYFunction(n),TileToWorldX:h.GetTileToWorldXFunction(n),TileToWorldY:h.GetTileToWorldYFunction(n),GetTileCorners:h.GetTileCornersFunction(n)}},setRenderOrder:function(e){var t=[`right-down`,`left-down`,`right-up`,`left-up`];return typeof e==`number`&&(e=t[e]),t.indexOf(e)>-1&&(this.renderOrder=e),this},addTilesetImage:function(e,t,n,i,a,s,c,l){if(e===void 0)return null;t??=e;var u=this.scene.sys.textures;if(!u.exists(t))return console.warn(`Texture key "%s" not found`,t),null;var d=u.get(t),f=this.getTilesetIndex(e);if(f===null&&this.format===o.TILED_JSON)return console.warn(`Tilemap has no tileset "%s". Its tilesets are %o`,e,this.tilesets),null;var p=this.tilesets[f];return p?((n||i)&&p.setTileSize(n,i),(a||s)&&p.setSpacing(a,s),p.setImage(d),p):(n===void 0&&(n=this.tileWidth),i===void 0&&(i=this.tileHeight),a===void 0&&(a=0),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l={x:0,y:0}),p=new _(e,c,n,i,a,s,void 0,void 0,l),p.setImage(d),this.tilesets.push(p),this.tiles=r(this),p)},copy:function(e,t,n,r,i,a,o,s){return s=this.getLayer(s),s===null?null:(h.Copy(e,t,n,r,i,a,o,s),this)},createBlankLayer:function(e,t,n,r,i,a,o,s){if(n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=this.width),a===void 0&&(a=this.height),o===void 0&&(o=this.tileWidth),s===void 0&&(s=this.tileHeight),this.getLayerIndex(e)!==null)return console.warn(`Invalid Tilemap Layer ID: `+e),null;for(var l=new c({name:e,tileWidth:o,tileHeight:s,width:i,height:a,orientation:this.orientation,hexSideLength:this.hexSideLength}),u,d=0;d-1&&this.putTileAt(t,a.x,a.y,n,a.tilemapLayer)}return r},removeTileAt:function(e,t,n,r,i){return n===void 0&&(n=!0),r===void 0&&(r=!0),i=this.getLayer(i),i===null?null:h.RemoveTileAt(e,t,n,r,i)},removeTileAtWorldXY:function(e,t,n,r,i,a){return n===void 0&&(n=!0),r===void 0&&(r=!0),a=this.getLayer(a),a===null?null:h.RemoveTileAtWorldXY(e,t,n,r,i,a)},renderDebug:function(e,t,n){return n=this.getLayer(n),n===null?null:(this.orientation===u.ORTHOGONAL&&h.RenderDebug(e,t,n),this)},renderDebugFull:function(e,t){for(var n=this.layers,r=0;r{var r=n(44603),i=n(31989);r.register(`tilemap`,function(e){var t=e===void 0?{}:e;return i(this.scene,t.key,t.tileWidth,t.tileHeight,t.width,t.height,t.data,t.insertNull)})}),46029:((e,t,n)=>{var r=n(39429),i=n(31989);r.register(`tilemap`,function(e,t,n,r,a,o,s){return e===null&&(e=void 0),t===null&&(t=void 0),n===null&&(n=void 0),r===null&&(r=void 0),a===null&&(a=void 0),i(this.scene,e,t,n,r,a,o,s)})}),20442:((e,t,n)=>{var r=n(83419),i=n(78389),a=n(31401),o=n(95643),s=n(81086),c=n(19218),l=n(26099);e.exports=new r({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,i,c],initialize:function(e,t,n,r,i,a){o.call(this,e,`TilemapLayer`),this.isTilemap=!0,this.tilemap=t,this.layerIndex=n,this.layer=t.layers[n],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=s.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(r),this.setAlpha(this.layer.alpha),this.setPosition(i,a),this.setOrigin(0,0),this.setSize(t.tileWidth*this.layer.width,t.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(e){var t=[],n=[],r=this.tilemap;Array.isArray(e)||(e=[e]);for(var i=0;i=0&&e<4&&(this._renderOrder=e),this},calculateFacesAt:function(e,t){return s.CalculateFacesAt(e,t,this.layer),this},calculateFacesWithin:function(e,t,n,r){return s.CalculateFacesWithin(e,t,n,r,this.layer),this},createFromTiles:function(e,t,n,r,i){return s.CreateFromTiles(e,t,n,r,i,this.layer)},cull:function(e){return this.cullCallback(this.layer,e,this.culledTiles,this._renderOrder)},copy:function(e,t,n,r,i,a,o){return s.Copy(e,t,n,r,i,a,o,this.layer),this},fill:function(e,t,n,r,i,a){return s.Fill(e,t,n,r,i,a,this.layer),this},filterTiles:function(e,t,n,r,i,a,o){return s.FilterTiles(e,t,n,r,i,a,o,this.layer)},findByIndex:function(e,t,n){return s.FindByIndex(e,t,n,this.layer)},findTile:function(e,t,n,r,i,a,o){return s.FindTile(e,t,n,r,i,a,o,this.layer)},forEachTile:function(e,t,n,r,i,a,o){return s.ForEachTile(e,t,n,r,i,a,o,this.layer),this},setTint:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!1},this,t,n,r,i,a)},setTintFill:function(e,t,n,r,i,a){return e===void 0&&(e=16777215),this.forEachTile(function(t){t.tint=e,t.tintFill=!0},this,t,n,r,i,a)},getTileAt:function(e,t,n){return s.GetTileAt(e,t,n,this.layer)},getTileAtWorldXY:function(e,t,n,r){return s.GetTileAtWorldXY(e,t,n,r,this.layer)},getIsoTileAtWorldXY:function(e,t,n,r,i){n===void 0&&(n=!0);var a=this.tempVec;return s.IsometricWorldToTileXY(e,t,!0,a,i,this.layer,n),this.getTileAt(a.x,a.y,r)},getTilesWithin:function(e,t,n,r,i){return s.GetTilesWithin(e,t,n,r,i,this.layer)},getTilesWithinShape:function(e,t,n){return s.GetTilesWithinShape(e,t,n,this.layer)},getTilesWithinWorldXY:function(e,t,n,r,i,a){return s.GetTilesWithinWorldXY(e,t,n,r,i,a,this.layer)},hasTileAt:function(e,t){return s.HasTileAt(e,t,this.layer)},hasTileAtWorldXY:function(e,t,n){return s.HasTileAtWorldXY(e,t,n,this.layer)},putTileAt:function(e,t,n,r){return s.PutTileAt(e,t,n,r,this.layer)},putTileAtWorldXY:function(e,t,n,r,i){return s.PutTileAtWorldXY(e,t,n,r,i,this.layer)},putTilesAt:function(e,t,n,r){return s.PutTilesAt(e,t,n,r,this.layer),this},randomize:function(e,t,n,r,i){return s.Randomize(e,t,n,r,i,this.layer),this},removeTileAt:function(e,t,n,r){return s.RemoveTileAt(e,t,n,r,this.layer)},removeTileAtWorldXY:function(e,t,n,r,i){return s.RemoveTileAtWorldXY(e,t,n,r,i,this.layer)},renderDebug:function(e,t){return s.RenderDebug(e,t,this.layer),this},replaceByIndex:function(e,t,n,r,i,a){return s.ReplaceByIndex(e,t,n,r,i,a,this.layer),this},setSkipCull:function(e){return e===void 0&&(e=!0),this.skipCull=e,this},setCullPadding:function(e,t){return e===void 0&&(e=1),t===void 0&&(t=1),this.cullPaddingX=e,this.cullPaddingY=t,this},setCollision:function(e,t,n,r){return s.SetCollision(e,t,n,this.layer,r),this},setCollisionBetween:function(e,t,n,r){return s.SetCollisionBetween(e,t,n,r,this.layer),this},setCollisionByProperty:function(e,t,n){return s.SetCollisionByProperty(e,t,n,this.layer),this},setCollisionByExclusion:function(e,t,n){return s.SetCollisionByExclusion(e,t,n,this.layer),this},setCollisionFromCollisionGroup:function(e,t){return s.SetCollisionFromCollisionGroup(e,t,this.layer),this},setTileIndexCallback:function(e,t,n){return s.SetTileIndexCallback(e,t,n,this.layer),this},setTileLocationCallback:function(e,t,n,r,i,a){return s.SetTileLocationCallback(e,t,n,r,i,a,this.layer),this},shuffle:function(e,t,n,r){return s.Shuffle(e,t,n,r,this.layer),this},swapByIndex:function(e,t,n,r,i,a){return s.SwapByIndex(e,t,n,r,i,a,this.layer),this},tileToWorldX:function(e,t){return this.tilemap.tileToWorldX(e,t,this)},tileToWorldY:function(e,t){return this.tilemap.tileToWorldY(e,t,this)},tileToWorldXY:function(e,t,n,r){return this.tilemap.tileToWorldXY(e,t,n,r,this)},getTileCorners:function(e,t,n){return this.tilemap.getTileCorners(e,t,n,this)},weightedRandomize:function(e,t,n,r,i){return s.WeightedRandomize(t,n,r,i,e,this.layer),this},worldToTileX:function(e,t,n){return this.tilemap.worldToTileX(e,t,n,this)},worldToTileY:function(e,t,n){return this.tilemap.worldToTileY(e,t,n,this)},worldToTileXY:function(e,t,n,r,i){return this.tilemap.worldToTileXY(e,t,n,r,i,this)},destroy:function(e){e===void 0&&(e=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),e&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}})}),16153:((e,t,n)=>{var r=n(61340),i=new r,a=new r,o=new r;e.exports=function(e,t,n,r){var s=t.cull(n),c=s.length,l=n.alpha*t.alpha;if(!(c===0||l<=0)){var u=i,d=a,f=o;d.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),u.copyFrom(n.matrix);var p=e.currentContext,m=t.gidMap;p.save(),r?(u.multiplyWithOffset(r,-n.scrollX*t.scrollFactorX,-n.scrollY*t.scrollFactorY),d.e=t.x,d.f=t.y,u.multiply(d,f),f.copyToContext(p)):(d.e-=n.scrollX*t.scrollFactorX,d.f-=n.scrollY*t.scrollFactorY,d.copyToContext(p)),(!e.antialias||t.scaleX>1||t.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var h=0;h{var r=n(29747),i=r,a=r;i=n(99558),a=n(16153),e.exports={renderWebGL:i,renderCanvas:a}}),99558:((e,t,n)=>{var r=n(70554);e.exports=function(e,t,n){var i=t.cull(n),a=i.length,o=n.alpha*t.alpha;if(!(a===0||o<=0)){var s=t.gidMap,c=e.pipelines.set(t.pipeline,t),l=r.getTintAppendFloatAlpha,u=t.scrollFactorX,d=t.scrollFactorY,f=t.x,p=t.y,m=t.scaleX,h=t.scaleY;e.pipelines.preBatch(t);for(var g=0;g{var r=n(83419),i=n(26099);e.exports=new r({initialize:function(e,t,n,r,a,o,s,c,l){(n===void 0||n<=0)&&(n=32),(r===void 0||r<=0)&&(r=32),a===void 0&&(a=0),o===void 0&&(o=0),s===void 0&&(s={}),c===void 0&&(c={}),this.name=e,this.firstgid=t,this.tileWidth=n,this.tileHeight=r,this.tileMargin=a,this.tileSpacing=o,this.tileProperties=s,this.tileData=c,this.tileOffset=new i,l!==void 0&&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(e){return this.containsTileIndex(e)?this.tileProperties[e-this.firstgid]:null},getTileData:function(e){return this.containsTileIndex(e)?this.tileData[e-this.firstgid]:null},getTileCollisionGroup:function(e){var t=this.getTileData(e);return t&&t.objectgroup?t.objectgroup:null},containsTileIndex:function(e){return e>=this.firstgid&&en.width||t.height>n.height?this.updateTileData(t.width,t.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(e,t){return e!==void 0&&(this.tileWidth=e),t!==void 0&&(this.tileHeight=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(e,t){return e!==void 0&&(this.tileMargin=e),t!==void 0&&(this.tileSpacing=t),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=(t-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),a=(e-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(i%1!=0||a%1!=0)&&console.warn(`Image tile area not tile size multiple in: `+this.name),i=Math.floor(i),a=Math.floor(a),this.rows=i,this.columns=a,this.total=i*a,this.texCoordinates.length=0;for(var o=this.tileMargin+n,s=this.tileMargin+r,c=0;c{var r=n(7423);e.exports=function(e,t,n){var i=r(e,t,!0,n),a=r(e,t-1,!0,n),o=r(e,t+1,!0,n),s=r(e-1,t,!0,n),c=r(e+1,t,!0,n),l=i&&i.collides;return l&&(i.faceTop=!0,i.faceBottom=!0,i.faceLeft=!0,i.faceRight=!0),a&&a.collides&&(l&&(i.faceTop=!1),a.faceBottom=!l),o&&o.collides&&(l&&(i.faceBottom=!1),o.faceTop=!l),s&&s.collides&&(l&&(i.faceLeft=!1),s.faceRight=!l),c&&c.collides&&(l&&(i.faceRight=!1),c.faceLeft=!l),i&&!i.collides&&i.resetFaces(),i}}),42573:((e,t,n)=>{var r=n(7423),i=n(7386);e.exports=function(e,t,n,a,o){for(var s=null,c=null,l=null,u=null,d=i(e,t,n,a,null,o),f=0;f{var r=new(n(26099));e.exports=function(e,t,n,i){var a=n.tilemapLayer,o=a.cullPaddingX,s=a.cullPaddingY,c=a.tilemap.tileToWorldXY(e,t,r,i,a);return c.x>i.worldView.x+a.scaleX*n.tileWidth*(-o-.5)&&c.xi.worldView.y+a.scaleY*n.tileHeight*(-s-1)&&c.y{var r=n(42573),i=n(7386),a=n(62991),o=n(23029);e.exports=function(e,t,n,s,c,l,u,d){u===void 0&&(u=!0);var f=i(e,t,n,s,null,d),p=[];f.forEach(function(e){var t=new o(e.layer,e.index,e.x,e.y,e.width,e.height,e.baseWidth,e.baseHeight);t.copy(e),p.push(t)});for(var m=c-e,h=l-t,g=0;g{var r=n(62644),i=n(7386),a=n(27987);e.exports=function(e,t,n,o,s,c){n||={},Array.isArray(e)||(e=[e]);var l=c.tilemapLayer;o||=l.scene,s||=o.cameras.main;var u=c.width,d=c.height,f=i(0,0,u,d,null,c),p=[],m,h=function(e,t,n){for(var r=0;r{var r=n(87841),i=n(63448),a=n(56583),o=new r;e.exports=function(e,t){var n=e.tilemapLayer.tilemap,r=e.tilemapLayer,s=Math.floor(n.tileWidth*r.scaleX),c=Math.floor(n.tileHeight*r.scaleY),l=a(t.worldView.x-r.x,s,0,!0)-r.cullPaddingX,u=i(t.worldView.right-r.x,s,0,!0)+r.cullPaddingX,d=a(t.worldView.y-r.y,c,0,!0)-r.cullPaddingY,f=i(t.worldView.bottom-r.y,c,0,!0)+r.cullPaddingY;return o.setTo(l,d,u-l,f-d)}}),30003:((e,t,n)=>{var r=n(19545),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return(o.skipCull||o.scrollFactorX!==1||o.scrollFactorY!==1)&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),35137:((e,t,n)=>{var r=n(7386),i=n(42573),a=n(20576);e.exports=function(e,t,n,o,s,c,l){for(var u=l.collideIndexes.indexOf(e)!==-1,d=r(t,n,o,s,null,l),f=0;f{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).filter(e,t)}}),52692:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=!1);var i=0,a,o,s;if(n){for(o=r.height-1;o>=0;o--)for(a=r.width-1;a>=0;a--)if(s=r.data[o][a],s&&s.index===e){if(i===t)return s;i+=1}}else for(o=0;o{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){return r(n,i,a,o,s,c).find(e,t)||null}}),97560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s,c){r(n,i,a,o,s,c).forEach(e,t)}}),43305:((e,t,n)=>{var r=n(91907),i=n(30003),a=n(9474),o=n(14018),s=n(29747),c=n(54503);e.exports=function(e){return e===r.ORTHOGONAL?i:e===r.HEXAGONAL?a:e===r.STAGGERED?c:e===r.ISOMETRIC?o:s}}),7423:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n,i){if(r(e,t,i)){var a=i.data[t][e]||null;return a?a.index===-1?n?a:null:a:null}else return null}}),60540:((e,t,n)=>{var r=n(7423),i=new(n(26099));e.exports=function(e,t,n,a,o){return o.tilemapLayer.worldToTileXY(e,t,!0,i,a),r(i.x,i.y,n,o)}}),55826:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i){var a=i.baseTileWidth,o=i.baseTileHeight,s=i.tilemapLayer,c=0,l=0;s&&(n||=s.scene.cameras.main,c=s.x+n.scrollX*(1-s.scrollFactorX),l=s.y+n.scrollY*(1-s.scrollFactorY),a*=s.scaleX,o*=s.scaleY);var u=c+e*a,d=l+t*o;return[new r(u,d),new r(u+a,d),new r(u+a,d+o),new r(u,d+o)]}}),11758:((e,t,n)=>{var r=n(91907),i=n(27229),a=n(29747),o=n(55826);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:(r.STAGGERED,a)}}),39167:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(97281);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),62e3:((e,t,n)=>{var r=n(91907),i=n(19951),a=n(14127),o=n(29747),s=n(97202),c=n(70326);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),5984:((e,t,n)=>{var r=n(91907),i=n(29747),a=n(28054),o=n(29650);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),7386:((e,t,n)=>{var r=n(95540);e.exports=function(e,t,n,i,a,o){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=o.width),i===void 0&&(i=o.height),a||={};var s=r(a,`isNotEmpty`,!1),c=r(a,`isColliding`,!1),l=r(a,`hasInterestingFace`,!1);e<0&&(n+=e,e=0),t<0&&(i+=t,t=0),e+n>o.width&&(n=Math.max(o.width-e,0)),t+i>o.height&&(i=Math.max(o.height-t,0));for(var u=[],d=t;d{var r=n(55738),i=n(7386),a=n(91865),o=n(29747),s=n(26099),c=n(91907),l=function(e,t){return a.RectangleToTriangle(t,e)},u=new s,d=new s,f=new s;e.exports=function(e,t,n,s){if(s.orientation!==c.ORTHOGONAL)return console.warn(`GetTilesWithinShape only works with orthogonal tilemaps`),[];if(e===void 0)return[];var p=o;e instanceof r.Circle?p=a.CircleToRectangle:e instanceof r.Rectangle?p=a.RectangleToRectangle:e instanceof r.Triangle?p=l:e instanceof r.Line&&(p=a.LineToRectangle),s.tilemapLayer.worldToTileXY(e.left,e.top,!0,d,n);var m=d.x,h=d.y;s.tilemapLayer.worldToTileXY(e.right,e.bottom,!1,f,n);var g=Math.ceil(f.x),_=Math.ceil(f.y),v=i(m,h,Math.max(g-m,1),Math.max(_-h,1),t,s),y=s.tileWidth,b=s.tileHeight;s.tilemapLayer&&(y*=s.tilemapLayer.scaleX,b*=s.tilemapLayer.scaleY);for(var x=[],S=new r.Rectangle(0,0,y,b),C=0;C{var r=n(7386),i=n(26099),a=new i,o=new i;e.exports=function(e,t,n,i,s,c,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,t,!0,a,c,l);var d=a.x,f=a.y;u(e+n,t+i,!1,o,c,l);var p=Math.ceil(o.x),m=Math.ceil(o.y);return r(d,f,p-d,m-f,s,l)}}),96113:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(10095);e.exports=function(e){return e===r.ORTHOGONAL?a:i}}),16926:((e,t,n)=>{var r=n(91907),i=n(86625),a=n(96897),o=n(29747),s=n(15108),c=n(85896);e.exports=function(e){return e===r.ORTHOGONAL?c:e===r.ISOMETRIC?a:e===r.HEXAGONAL?i:e===r.STAGGERED?s:o}}),55762:((e,t,n)=>{var r=n(91907),i=n(20242),a=n(51900),o=n(63288);e.exports=function(e){return e===r.ORTHOGONAL?o:e===r.STAGGERED?a:i}}),45091:((e,t,n)=>{var r=n(62991);e.exports=function(e,t,n){if(r(e,t,n)){var i=n.data[t][e];return i!==null&&i.index>-1}else return!1}}),24152:((e,t,n)=>{var r=n(45091),i=new(n(26099));e.exports=function(e,t,n,a){a.tilemapLayer.worldToTileXY(e,t,!0,i,n);var o=i.x,s=i.y;return r(o,s,a)}}),90454:((e,t,n)=>{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY),c=e.hexSideLength,l,u,d,f;if(e.staggerAxis===`y`){var p=(s-c)/2+c;l=i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,p,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,p,0,!0)+a.cullPaddingY}else{var m=(o-c)/2+c;l=i(t.worldView.x-a.x,m,0,!0)-a.cullPaddingX,u=r(t.worldView.right-a.x,m,0,!0)+a.cullPaddingX,d=i(t.worldView.y-a.y,s,0,!0)-a.cullPaddingY,f=r(t.worldView.bottom-a.y,s,0,!0)+a.cullPaddingY}return{left:l,right:u,top:d,bottom:f}}}),9474:((e,t,n)=>{var r=n(90454),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),27229:((e,t,n)=>{var r=n(19951),i=n(26099),a=new i;e.exports=function(e,t,n,o){var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(s*=l.scaleX,c*=l.scaleY);var u=r(e,t,a,n,o),d=[],f=.5773502691896257,p,m;o.staggerAxis===`y`?(p=f*s,m=c/2):(p=s/2,m=f*c);for(var h=0;h<6;h++){var g=2*Math.PI*(.5-h)/6;d.push(new i(u.x+p*Math.cos(g),u.y+m*Math.sin(g)))}return d}}),19951:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),u=c.y+i.scrollY*(1-c.scrollFactorY),o*=c.scaleX,s*=c.scaleY);var d=o/2,f=s/2,p,m,h=a.staggerAxis,g=a.staggerIndex;return h===`y`?(p=l+o*e+o,m=u+1.5*t*f+f,t%2==0&&(g===`odd`?p-=d:p+=d)):h===`x`&&g===`odd`&&(p=l+1.5*e*d+d,m=u+s*e+s,e%2==0&&(g===`odd`?m-=f:m+=f)),n.set(p,m)}}),86625:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=.5773502691896257,d=-.3333333333333333,f=0,p=.6666666666666666,m=s/2,h=c/2,g,_,v,y,b;o.staggerAxis===`y`?(g=(e-m)/(u*s),_=(t-h)/h,v=u*g+d*_,y=f*g+p*_):(g=(e-m)/m,_=(t-h)/(u*c),v=d*g+u*_,y=p*g+f*_),b=-v-y;var x=Math.round(v),S=Math.round(y),C=Math.round(b),w=Math.abs(x-v),T=Math.abs(S-y),E=Math.abs(C-b);w>T&&w>E?x=-S-C:T>E&&(S=-x-C);var D,O=S;return D=o.staggerIndex===`odd`?O%2==0?S/2+x:S/2+x-.5:O%2==0?S/2+x:S/2+x+.5,i.set(D,O)}}),62991:(e=>{e.exports=function(e,t,n){return e>=0&&e=0&&t{var r=n(33528);e.exports=function(e,t,n,i){n===void 0&&(n=[]),i===void 0&&(i=0),n.length=0;var a=e.tilemapLayer,o=e.data,s=e.width,c=e.height,l=a.skipCull,u=0,d=s,f=0,p=c,m,h,g;if(i===0)for(h=f;h=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));else if(i===2)for(h=p;h>=f;h--)for(m=u;m=f;h--)for(m=d;m>=u;m--)g=o[h][m],!(!g||g.index===-1||!g.visible||g.alpha===0)&&(!l&&!r(m,h,e,t)||n.push(g));return a.tilesDrawn=n.length,a.tilesTotal=s*c,n}}),14127:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+(e-t)*(o/2),f=u+(e+t)*(s/2);return n.set(d,f)}}),96897:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o,s){i||=new r;var c=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(a||=u.scene.cameras.main,t-=u.y+a.scrollY*(1-u.scrollFactorY),l*=u.scaleY,e-=u.x+a.scrollX*(1-u.scrollFactorX),c*=u.scaleX);var d=c/2,f=l/2;e-=d,s||(t-=l);var p=.5*(e/d+t/f),m=.5*(-e/d+t/f);return n&&(p=Math.floor(p),m=Math.floor(m)),i.set(p,m)}}),71558:((e,t,n)=>{var r=n(23029),i=n(62991),a=n(72023),o=n(20576);e.exports=function(e,t,n,s,c){if(s===void 0&&(s=!0),!i(t,n,c))return null;var l,u=c.data[n][t],d=u&&u.collides;e instanceof r?(c.data[n][t]===null&&(c.data[n][t]=new r(c,e.index,t,n,c.tileWidth,c.tileHeight)),c.data[n][t].copy(e)):(l=e,c.data[n][t]===null?c.data[n][t]=new r(c,l,t,n,c.tileWidth,c.tileHeight):c.data[n][t].index=l);var f=c.data[n][t],p=c.collideIndexes.indexOf(f.index)!==-1;if(l=e instanceof r?e.index:e,l===-1)f.width=c.tileWidth,f.height=c.tileHeight;else{var m=c.tilemapLayer.tilemap,h=m.tiles[l][2],g=m.tilesets[h];f.width=g.tileWidth,f.height=g.tileHeight}return o(f,p),s&&d!==f.collides&&a(t,n,c),f}}),26303:((e,t,n)=>{var r=n(71558),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(t,n,!0,i,o,s),r(e,i.x,i.y,a,s)}}),14051:((e,t,n)=>{var r=n(42573),i=n(71558);e.exports=function(e,t,n,a,o){if(a===void 0&&(a=!0),!Array.isArray(e))return null;Array.isArray(e[0])||(e=[e]);for(var s=e.length,c=e[0].length,l=0;l{var r=n(7386),i=n(26546);e.exports=function(e,t,n,a,o,s){var c,l=r(e,t,n,a,{},s);if(!o)for(o=[],c=0;c{var r=n(23029),i=n(62991),a=n(72023);e.exports=function(e,t,n,o,s){if(n===void 0&&(n=!0),o===void 0&&(o=!0),!i(e,t,s))return null;var c=s.data[t][e];if(c)s.data[t][e]=n?null:new r(s,-1,e,t,s.tileWidth,s.tileHeight);else return null;return o&&c&&c.collides&&a(e,t,s),c}}),94178:((e,t,n)=>{var r=n(63557),i=new(n(26099));e.exports=function(e,t,n,a,o,s){return s.tilemapLayer.worldToTileXY(e,t,!0,i,o,s),r(i.x,i.y,n,a,s)}}),15533:((e,t,n)=>{var r=n(7386),i=n(3956),a=new i(105,210,231,150),o=new i(243,134,48,200),s=new i(40,39,37,150);e.exports=function(e,t,n){t===void 0&&(t={});var i=t.tileColor===void 0?a:t.tileColor,c=t.collidingTileColor===void 0?o:t.collidingTileColor,l=t.faceColor===void 0?s:t.faceColor,u=r(0,0,n.width,n.height,null,n);e.translateCanvas(n.tilemapLayer.x,n.tilemapLayer.y),e.scaleCanvas(n.tilemapLayer.scaleX,n.tilemapLayer.scaleY);for(var d=0;d{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n,r){var i=e.data,a=e.width,o=e.height,s=e.tilemapLayer,c=Math.max(0,t.left),l=Math.min(a,t.right),u=Math.max(0,t.top),d=Math.min(o,t.bottom),f,p,m;if(n===0)for(p=u;p=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);else if(n===2)for(p=d;p>=u;p--)for(f=c;i[p]&&f=u;p--)for(f=l;i[p]&&f>=c;f--)m=i[p][f],!(!m||m.index===-1||!m.visible||m.alpha===0)&&r.push(m);return s.tilesDrawn=r.length,s.tilesTotal=a*o,r}}),57068:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s){t===void 0&&(t=!0),n===void 0&&(n=!0),s===void 0&&(s=!0),Array.isArray(e)||(e=[e]);for(var c=0;c{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o,s,c){if(n===void 0&&(n=!0),o===void 0&&(o=!0),c===void 0&&(c=!0),!(e>t)){for(var l=e;l<=t;l++)a(l,n,s);if(c)for(var u=0;u=e&&f.index<=t&&r(f,n)}o&&i(0,0,s.width,s.height,s)}}}),75661:((e,t,n)=>{var r=n(20576),i=n(42573),a=n(9589);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0),Array.isArray(e)||(e=[e]);for(var s=0;s{var r=n(20576),i=n(42573),a=n(97022);e.exports=function(e,t,n,o){t===void 0&&(t=!0),n===void 0&&(n=!0);for(var s=0;s{var r=n(20576),i=n(42573);e.exports=function(e,t,n){e===void 0&&(e=!0),t===void 0&&(t=!0);for(var a=0;a0&&r(s,e)}}t&&i(0,0,n.width,n.height,n)}}),9589:(e=>{e.exports=function(e,t,n){var r=n.collideIndexes.indexOf(e);t&&r===-1?n.collideIndexes.push(e):!t&&r!==-1&&n.collideIndexes.splice(r,1)}}),20576:(e=>{e.exports=function(e,t){t?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)}}),79583:(e=>{e.exports=function(e,t,n,r){if(typeof e==`number`)r.callbacks[e]=t===null?void 0:{callback:t,callbackContext:n};else for(var i=0,a=e.length;i{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(e,t,n,i,null,s),l=0;l{var r=n(7386),i=n(33680);e.exports=function(e,t,n,a,o){var s=r(e,t,n,a,null,o),c=s.map(function(e){return e.index});i(c);for(var l=0;l{var r=n(63448),i=n(56583);e.exports=function(e,t){var n=e.tilemapLayer.tilemap,a=e.tilemapLayer,o=Math.floor(n.tileWidth*a.scaleX),s=Math.floor(n.tileHeight*a.scaleY);return{left:i(t.worldView.x-a.x,o,0,!0)-a.cullPaddingX,right:r(t.worldView.right-a.x,o,0,!0)+a.cullPaddingX,top:i(t.worldView.y-a.y,s/2,0,!0)-a.cullPaddingY,bottom:r(t.worldView.bottom-a.y,s/2,0,!0)+a.cullPaddingY}}}),54503:((e,t,n)=>{var r=n(61325),i=n(32483);e.exports=function(e,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=0),n.length=0;var o=e.tilemapLayer,s=r(e,t);return o.skipCull&&o.scrollFactorX===1&&o.scrollFactorY===1&&(s.left=0,s.right=e.width,s.top=0,s.bottom=e.height),i(e,s,a,n),n}}),97202:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a){n||=new r;var o=a.baseTileWidth,s=a.baseTileHeight,c=a.tilemapLayer,l=0,u=0;c&&(i||=c.scene.cameras.main,l=c.x+i.scrollX*(1-c.scrollFactorX),o*=c.scaleX,u=c.y+i.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var d=l+e*o+t%2*(o/2),f=u+s/2*t;return n.set(d,f)}}),28054:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t===void 0&&(t=i.scene.cameras.main),a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+r/2*e+r}}),15108:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,t-=l.y+a.scrollY*(1-l.scrollFactorY),c*=l.scaleY,e-=l.x+a.scrollX*(1-l.scrollFactorX),s*=l.scaleX);var u=n?Math.floor(t/(c/2)):t/(c/2),d=n?Math.floor((e+u%2*.5*s)/s):(e+u%2*.5*s)/s;return i.set(d,u)}}),51900:(e=>{e.exports=function(e,t,n,r){var i=r.baseTileHeight,a=r.tilemapLayer;return a&&(n||=a.scene.cameras.main,e-=a.y+n.scrollY*(1-a.scrollFactorY),i*=a.scaleY),t?Math.floor(e/(i/2)):e/(i/2)}}),86560:((e,t,n)=>{var r=n(7386);e.exports=function(e,t,n,i,a,o,s){for(var c=r(n,i,a,o,null,s),l=0;l{e.exports=function(e,t,n){var r=n.baseTileWidth,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.x+t.scrollX*(1-i.scrollFactorX),r*=i.scaleX),a+e*r}}),70326:((e,t,n)=>{var r=n(97281),i=n(29650),a=n(26099);e.exports=function(e,t,n,o,s){return n||=new a(0,0),n.x=r(e,o,s),n.y=i(t,o,s),n}}),29650:(e=>{e.exports=function(e,t,n){var r=n.baseTileHeight,i=n.tilemapLayer,a=0;return i&&(t||=i.scene.cameras.main,a=i.y+t.scrollY*(1-i.scrollFactorY),r*=i.scaleY),a+e*r}}),77366:((e,t,n)=>{var r=n(7386),i=n(75508);e.exports=function(e,t,n,a,o,s){if(o){var c,l=r(e,t,n,a,null,s),u=0;for(c=0;c{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(e,0,t,i,n,a),i.x}}),85896:((e,t,n)=>{var r=n(26099);e.exports=function(e,t,n,i,a,o){n===void 0&&(n=!0),i||=new r;var s=o.baseTileWidth,c=o.baseTileHeight,l=o.tilemapLayer;l&&(a||=l.scene.cameras.main,e-=l.x+a.scrollX*(1-l.scrollFactorX),t-=l.y+a.scrollY*(1-l.scrollFactorY),s*=l.scaleX,c*=l.scaleY);var u=e/s,d=t/c;return n&&(u=Math.floor(u),d=Math.floor(d)),i.set(u,d)}}),63288:((e,t,n)=>{var r=n(85896),i=new(n(26099));e.exports=function(e,t,n,a){return r(0,e,t,i,n,a),i.y}}),81086:((e,t,n)=>{e.exports={CalculateFacesAt:n(72023),CalculateFacesWithin:n(42573),CheckIsoBounds:n(33528),Copy:n(1785),CreateFromTiles:n(78419),CullBounds:n(19545),CullTiles:n(30003),Fill:n(35137),FilterTiles:n(40253),FindByIndex:n(52692),FindTile:n(66151),ForEachTile:n(97560),GetCullTilesFunction:n(43305),GetTileAt:n(7423),GetTileAtWorldXY:n(60540),GetTileCorners:n(55826),GetTileCornersFunction:n(11758),GetTilesWithin:n(7386),GetTilesWithinShape:n(91141),GetTilesWithinWorldXY:n(96523),GetTileToWorldXFunction:n(39167),GetTileToWorldXYFunction:n(62e3),GetTileToWorldYFunction:n(5984),GetWorldToTileXFunction:n(96113),GetWorldToTileXYFunction:n(16926),GetWorldToTileYFunction:n(55762),HasTileAt:n(45091),HasTileAtWorldXY:n(24152),HexagonalCullBounds:n(90454),HexagonalCullTiles:n(9474),HexagonalGetTileCorners:n(27229),HexagonalTileToWorldXY:n(19951),HexagonalWorldToTileXY:n(86625),IsInLayerBounds:n(62991),IsometricCullTiles:n(14018),IsometricTileToWorldXY:n(14127),IsometricWorldToTileXY:n(96897),PutTileAt:n(71558),PutTileAtWorldXY:n(26303),PutTilesAt:n(14051),Randomize:n(77389),RemoveTileAt:n(63557),RemoveTileAtWorldXY:n(94178),RenderDebug:n(15533),ReplaceByIndex:n(27987),RunCull:n(32483),SetCollision:n(57068),SetCollisionBetween:n(37266),SetCollisionByExclusion:n(75661),SetCollisionByProperty:n(64740),SetCollisionFromCollisionGroup:n(63307),SetLayerCollisionIndex:n(9589),SetTileCollision:n(20576),SetTileIndexCallback:n(79583),SetTileLocationCallback:n(93254),Shuffle:n(32903),StaggeredCullBounds:n(61325),StaggeredCullTiles:n(54503),StaggeredTileToWorldXY:n(97202),StaggeredTileToWorldY:n(28054),StaggeredWorldToTileXY:n(15108),StaggeredWorldToTileY:n(51900),SwapByIndex:n(86560),TileToWorldX:n(97281),TileToWorldXY:n(70326),TileToWorldY:n(29650),WeightedRandomize:n(77366),WorldToTileX:n(10095),WorldToTileXY:n(85896),WorldToTileY:n(63288)}}),91907:(e=>{e.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}}),21829:((e,t,n)=>{e.exports={ORIENTATION:n(91907)}}),62501:((e,t,n)=>{var r=n(79291),i=n(21829),a={Components:n(81086),Parsers:n(57442),Formats:n(80341),ImageCollection:n(16536),ParseToTilemap:n(31989),Tile:n(23029),Tilemap:n(49075),TilemapCreator:n(45939),TilemapFactory:n(46029),Tileset:n(33629),TilemapLayer:n(20442),Orientation:n(91907),LayerData:n(14977),MapData:n(87010),ObjectLayer:n(48700)};a=r(!1,a,i.ORIENTATION),e.exports=a}),14977:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`layer`),this.id=a(e,`id`,0),this.x=a(e,`x`,0),this.y=a(e,`y`,0),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.baseTileWidth=a(e,`baseTileWidth`,this.tileWidth),this.baseTileHeight=a(e,`baseTileHeight`,this.tileHeight),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.widthInPixels=a(e,`widthInPixels`,this.width*this.baseTileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.baseTileHeight),this.alpha=a(e,`alpha`,1),this.visible=a(e,`visible`,!0),this.properties=a(e,`properties`,[]),this.indexes=a(e,`indexes`,[]),this.collideIndexes=a(e,`collideIndexes`,[]),this.callbacks=a(e,`callbacks`,[]),this.bodies=a(e,`bodies`,[]),this.data=a(e,`data`,[]),this.tilemapLayer=a(e,`tilemapLayer`,null),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),87010:((e,t,n)=>{var r=n(83419),i=n(91907),a=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=a(e,`name`,`map`),this.width=a(e,`width`,0),this.height=a(e,`height`,0),this.infinite=a(e,`infinite`,!1),this.tileWidth=a(e,`tileWidth`,0),this.tileHeight=a(e,`tileHeight`,0),this.widthInPixels=a(e,`widthInPixels`,this.width*this.tileWidth),this.heightInPixels=a(e,`heightInPixels`,this.height*this.tileHeight),this.format=a(e,`format`,null),this.orientation=a(e,`orientation`,i.ORTHOGONAL),this.renderOrder=a(e,`renderOrder`,`right-down`),this.version=a(e,`version`,`1`),this.properties=a(e,`properties`,{}),this.layers=a(e,`layers`,[]),this.images=a(e,`images`,[]),this.objects=a(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=a(e,`collision`,{}),this.tilesets=a(e,`tilesets`,[]),this.imageCollections=a(e,`imageCollections`,[]),this.tiles=a(e,`tiles`,[]),this.hexSideLength=a(e,`hexSideLength`,0),this.staggerAxis=a(e,`staggerAxis`,`y`),this.staggerIndex=a(e,`staggerIndex`,`odd`)}})}),48700:((e,t,n)=>{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){e===void 0&&(e={}),this.name=i(e,`name`,`object layer`),this.id=i(e,`id`,0),this.opacity=i(e,`opacity`,1),this.properties=i(e,`properties`,{}),this.propertyTypes=i(e,`propertytypes`,{}),this.type=i(e,`type`,`objectgroup`),this.visible=i(e,`visible`,!0),this.objects=i(e,`objects`,[]),Array.isArray(this.objects)||(this.objects=[])}})}),6641:((e,t,n)=>{var r=n(91907);e.exports=function(e){return e=e.toLowerCase(),e===`isometric`?r.ISOMETRIC:e===`staggered`?r.STAGGERED:e===`hexagonal`?r.HEXAGONAL:r.ORTHOGONAL}}),46177:((e,t,n)=>{var r=n(80341),i=n(2342),a=n(82593),o=n(46594),s=n(87021);e.exports=function(e,t,n,c,l,u){var d;switch(t){case r.ARRAY_2D:d=i(e,n,c,l,u);break;case r.CSV:d=a(e,n,c,l,u);break;case r.TILED_JSON:d=o(e,n,u);break;case r.WELTMEISTER:d=s(e,n,u);break;default:console.warn(`Unrecognized tilemap data format: `+t),d=null}return d}}),2342:((e,t,n)=>{var r=n(80341),i=n(14977),a=n(87010),o=n(23029);e.exports=function(e,t,n,s,c){for(var l=new i({tileWidth:n,tileHeight:s}),u=new a({name:e,tileWidth:n,tileHeight:s,format:r.ARRAY_2D,layers:[l]}),d=[],f=t.length,p=0,m=0;m{var r=n(80341),i=n(2342);e.exports=function(e,t,n,a,o){var s=i(e,t.trim().split(` `).map(function(e){return e.split(`,`)}),n,a,o);return s.format=r.CSV,s}}),6656:((e,t,n)=>{var r=n(14977),i=n(23029);e.exports=function(e,t){for(var n=[],a=0;a-1?new i(s,f,d,u,o.tilesize,o.tilesize):t?null:new i(s,-1,d,u,o.tilesize,o.tilesize);c.push(p)}l.push(c),c=[]}s.data=l,n.push(s)}return n}}),96483:((e,t,n)=>{var r=n(33629);e.exports=function(e){for(var t=[],n=[],i=0;i{var r=n(80341),i=n(87010),a=n(6656),o=n(96483);e.exports=function(e,t,n){if(t.layer.length===0)return console.warn(`No layers found in the Weltmeister map: `+e),null;for(var s=0,c=0,l=0;ls&&(s=t.layer[l].width),t.layer[l].height>c&&(c=t.layer[l].height);var u=new i({width:s,height:c,name:e,tileWidth:t.layer[0].tilesize,tileHeight:t.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=a(t,n),u.tilesets=o(t),u}}),52833:((e,t,n)=>{e.exports={ParseTileLayers:n(6656),ParseTilesets:n(96483),ParseWeltmeister:n(87021)}}),57442:((e,t,n)=>{e.exports={FromOrientationString:n(6641),Parse:n(46177),Parse2DArray:n(2342),ParseCSV:n(82593),Impact:n(52833),Tiled:n(96761)}}),51233:((e,t,n)=>{var r=n(79291);e.exports=function(e){for(var t,n,i,a,o,s=0;s{e.exports=function(e){for(var t=window.atob(e),n=t.length,r=Array(n/4),i=0;i>>0;return r}}),84101:((e,t,n)=>{var r=n(33629);e.exports=function(e){var t,n,i=[];for(t=0;t{var r=n(95540);e.exports=function(e,t,n){if(!t)return{i:0,layers:e.layers,name:``,opacity:1,visible:!0,x:0,y:0};var i=t.x+r(t,`startx`,0)*e.tilewidth+r(t,`offsetx`,0),a=t.y+r(t,`starty`,0)*e.tileheight+r(t,`offsety`,0);return{i:0,layers:t.layers,name:n.name+t.name+`/`,opacity:n.opacity*t.opacity,visible:n.visible&&t.visible,x:n.x+i,y:n.y+a}}}),29920:(e=>{var t=2147483648,n=1073741824,r=536870912;e.exports=function(e){var i=!!(e&t),a=!!(e&n),o=!!(e&r);e&=~(t|n|r);var s=0,c=!1;return i&&a&&o?(s=Math.PI/2,c=!0):i&&a&&!o?(s=Math.PI,c=!1):i&&!a&&o?(s=Math.PI/2,c=!1):i&&!a&&!o?(s=0,c=!0):!i&&a&&o?(s=3*Math.PI/2,c=!1):!i&&a&&!o?(s=Math.PI,c=!0):!i&&!a&&o?(s=3*Math.PI/2,c=!0):!i&&!a&&!o&&(s=0,c=!1),{gid:e,flippedHorizontal:i,flippedVertical:a,flippedAntiDiagonal:o,rotation:s,flipped:c}}}),12635:((e,t,n)=>{var r=n(95540),i=n(79677);e.exports=function(e){for(var t=[],n=[],a=i(e);a.i0;){if(a.i>=a.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}a=n.pop();continue}var o=a.layers[a.i];if(a.i++,o.type!==`imagelayer`){if(o.type===`group`){var s=i(e,o,a);n.push(a),a=s}continue}var c=r(o,`offsetx`,0)+r(o,`startx`,0),l=r(o,`offsety`,0)+r(o,`starty`,0);t.push({name:a.name+o.name,image:o.image,x:a.x+c+o.x,y:a.y+l+o.y,alpha:a.opacity*o.opacity,visible:a.visible&&o.visible,properties:r(o,`properties`,{})})}return t}}),46594:((e,t,n)=>{var r=n(51233),i=n(84101),a=n(91907),o=n(62644),s=n(80341),c=n(6641),l=n(87010),u=n(12635),d=n(22611),f=n(28200),p=n(24619);e.exports=function(e,t,n){var m=o(t),h=new l({width:m.width,height:m.height,name:e,tileWidth:m.tilewidth,tileHeight:m.tileheight,orientation:c(m.orientation),format:s.TILED_JSON,version:m.version,properties:m.properties,renderOrder:m.renderorder,infinite:m.infinite});if(h.orientation===a.HEXAGONAL)if(h.hexSideLength=m.hexsidelength,h.staggerAxis=m.staggeraxis,h.staggerIndex=m.staggerindex,h.staggerAxis===`y`){var g=(h.tileHeight-h.hexSideLength)/2;h.widthInPixels=h.tileWidth*(h.width+.5),h.heightInPixels=h.height*(h.hexSideLength+g)+g}else{var _=(h.tileWidth-h.hexSideLength)/2;h.widthInPixels=h.width*(h.hexSideLength+_)+_,h.heightInPixels=h.tileHeight*(h.height+.5)}h.layers=f(m,n),h.images=u(m);var v=p(m);return h.tilesets=v.tilesets,h.imageCollections=v.imageCollections,h.objects=d(m),h.tiles=i(h),r(h),h}}),52205:((e,t,n)=>{var r=n(18254),i=n(29920),a=function(e){return{x:e.x,y:e.y}},o=[`id`,`name`,`type`,`rotation`,`properties`,`visible`,`x`,`y`,`width`,`height`];e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var s=r(e,o);if(s.x+=t,s.y+=n,e.gid){var c=i(e.gid);s.gid=c.gid,s.flippedHorizontal=c.flippedHorizontal,s.flippedVertical=c.flippedVertical,s.flippedAntiDiagonal=c.flippedAntiDiagonal}else e.polyline?s.polyline=e.polyline.map(a):e.polygon?s.polygon=e.polygon.map(a):e.ellipse?s.ellipse=e.ellipse:e.text?s.text=e.text:e.point?s.point=!0:s.rectangle=!0;return s}}),22611:((e,t,n)=>{var r=n(95540),i=n(52205),a=n(48700),o=n(79677);e.exports=function(e){for(var t=[],n=[],s=o(e);s.i0;){if(s.i>=s.layers.length){if(n.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}s=n.pop();continue}var c=s.layers[s.i];if(s.i++,c.opacity*=s.opacity,c.visible=s.visible&&c.visible,c.type!==`objectgroup`){if(c.type===`group`){var l=o(e,c,s);n.push(s),s=l}continue}c.name=s.name+c.name;for(var u=s.x+r(c,`startx`,0)+r(c,`offsetx`,0),d=s.y+r(c,`starty`,0)+r(c,`offsety`,0),f=[],p=0;p{var r=n(41868),i=n(91907),a=n(79677),o=n(6641),s=n(95540),c=n(14977),l=n(29920),u=n(23029);e.exports=function(e,t){for(var n=s(e,`infinite`,!1),d=[],f=[],p=a(e);p.i0;){if(p.i>=p.layers.length){if(f.length<1){console.warn(`TilemapParser.parseTiledJSON - Invalid layer group hierarchy`);break}p=f.pop();continue}var m=p.layers[p.i];if(p.i++,m.type!==`tilelayer`){if(m.type===`group`){var h=a(e,m,p);f.push(p),p=h}continue}if(m.compression){console.warn(`TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '`+m.name+`'`);continue}else if(m.encoding&&m.encoding===`base64`){if(m.chunks)for(var g=0;g0?(y=new u(_,v.gid,F,I,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,C[I][F]=y):(b=t?null:new u(_,-1,F,I,e.tilewidth,e.tileheight),C[I][F]=b),w++,w===k.width&&(M++,w=0)}}else{_=new c({name:p.name+m.name,id:m.id,x:p.x+s(m,`offsetx`,0)+m.x,y:p.y+s(m,`offsety`,0)+m.y,width:m.width,height:m.height,tileWidth:e.tilewidth,tileHeight:e.tileheight,alpha:p.opacity*m.opacity,visible:p.visible&&m.visible,properties:s(m,`properties`,[]),orientation:o(e.orientation)}),_.orientation===i.HEXAGONAL&&(_.hexSideLength=e.hexsidelength,_.staggerAxis=e.staggeraxis,_.staggerIndex=e.staggerindex,_.staggerAxis===`y`?(x=(_.tileHeight-_.hexSideLength)/2,_.widthInPixels=_.tileWidth*(_.width+.5),_.heightInPixels=_.height*(_.hexSideLength+x)+x):(S=(_.tileWidth-_.hexSideLength)/2,_.widthInPixels=_.width*(_.hexSideLength+S)+S,_.heightInPixels=_.tileHeight*(_.height+.5)));for(var L=[],R=0,z=m.data.length;R0?(y=new u(_,v.gid,w,C.length,e.tilewidth,e.tileheight),y.rotation=v.rotation,y.flipX=v.flipped,L.push(y)):(b=t?null:new u(_,-1,w,C.length,e.tilewidth,e.tileheight),L.push(b)),w++,w===m.width&&(C.push(L),w=0,L=[])}_.data=C,d.push(_)}return d}}),24619:((e,t,n)=>{var r=n(33629),i=n(16536),a=n(52205),o=n(57880);e.exports=function(e){for(var t=[],n=[],s=null,c,l=0;l1){var f=void 0,p=void 0;if(Array.isArray(u.tiles)){f||={},p||={};for(var m=0;m{e.exports=function(e,t){for(var n=0;n0){var a={},o={},s,c,l;if(Array.isArray(r.edgecolors))for(s=0;s{e.exports={AssignTileProperties:n(51233),Base64Decode:n(41868),BuildTilesetIndex:n(84101),CreateGroupLayer:n(79677),ParseGID:n(29920),ParseImageLayers:n(12635),ParseJSONTiled:n(46594),ParseObject:n(52205),ParseObjectLayers:n(22611),ParseTileLayers:n(28200),ParseTilesets:n(24619)}}),33385:((e,t,n)=>{var r=n(83419),i=n(37277),a=n(44594),o=n(94880),s=n(72905),c=new r({initialize:function(e){this.scene=e,this.systems=e.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],e.sys.events.once(a.BOOT,this.boot,this),e.sys.events.on(a.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var e=this.systems.events;e.on(a.PRE_UPDATE,this.preUpdate,this),e.on(a.UPDATE,this.update,this),e.once(a.SHUTDOWN,this.shutdown,this)},addEvent:function(e){var t;if(e instanceof o){if(t=e,this.removeEvent(t),t.elapsed=t.startAt,t.hasDispatched=!1,t.repeatCount=t.repeat===-1||t.loop?999999999999:t.repeat,t.delay<=0&&t.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`)}else t=new o(e);return this._pendingInsertion.push(t),t},delayedCall:function(e,t,n,r){return this.addEvent({delay:e,callback:t,args:n,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(e){Array.isArray(e)||(e=[e]);for(var t=0;t-1&&this._active.splice(i,1),r.destroy()}for(n=0;n=r.delay)){var i=r.elapsed-r.delay;if(r.elapsed=r.delay,!r.hasDispatched&&r.callback&&(r.hasDispatched=!0,r.callback.apply(r.callbackScope,r.args)),r.repeatCount>0){if(r.repeatCount--,i>=r.delay)for(;i>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),i-=r.delay,r.repeatCount--;r.elapsed=i,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var e;for(e=0;e{var r=n(83419),i=n(50792),a=n(39429),o=n(95540),s=n(44594),c=n(89809),l=new r({Extends:i,initialize:function(e,t){i.call(this),this.scene=e,this.systems=e.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 n=this.systems.events;n.on(s.PRE_UPDATE,this.preUpdate,this),n.on(s.UPDATE,this.update,this),n.once(s.SHUTDOWN,this.destroy,this),t&&this.add(t)},preUpdate:function(e,t){this.paused||(this.elapsed+=t*this.timeScale)},update:function(){if(!(this.paused||this.complete)){var e,t=this.events,n=!1,r=this.systems,i;for(e=0;e=t.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(c.COMPLETE,this)}},play:function(e){return e===void 0&&(e=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,e&&this.reset(),this},pause:function(){this.paused=!0;for(var e=this.events,t=0;t0&&(n=t[t.length-1].time);for(var r=0;r{var r=n(83419),i=n(95540);e.exports=new r({initialize:function(e){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(e)},reset:function(e){if(this.delay=i(e,`delay`,0),this.repeat=i(e,`repeat`,0),this.loop=i(e,`loop`,!1),this.callback=i(e,`callback`,void 0),this.callbackScope=i(e,`callbackScope`,this),this.args=i(e,`args`,[]),this.timeScale=i(e,`timeScale`,1),this.startAt=i(e,`startAt`,0),this.paused=i(e,`paused`,!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw Error(`TimerEvent infinite loop created via zero delay`);return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var e=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/e}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(e){e===void 0&&(e=!1),this.elapsed=this.delay,this.hasDispatched=!e,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}})}),35945:(e=>{e.exports=`complete`}),89809:((e,t,n)=>{e.exports={COMPLETE:n(35945)}}),90291:((e,t,n)=>{e.exports={Clock:n(33385),Events:n(89809),Timeline:n(96120),TimerEvent:n(94880)}}),40382:((e,t,n)=>{var r=n(72905),i=n(83419),a=n(43491),o=n(88032),s=n(37277),c=n(44594),l=n(93109),u=n(86081),d=n(8357),f=n(43960),p=n(26012),m=new i({initialize:function(e){this.scene=e,this.events=e.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(c.BOOT,this.boot,this),this.events.on(c.START,this.start,this)},boot:function(){this.events.once(c.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(c.UPDATE,this.update,this),this.events.once(c.SHUTDOWN,this.shutdown,this)},create:function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0;n-1},existing:function(e){return this.has(e)||this.tweens.push(e.reset()),this},addCounter:function(e){var t=o(this,e);return this.tweens.push(t.reset()),t},stagger:function(e,t){return l(e,t)},setLagSmooth:function(e,t){return e===void 0&&(e=1/1e-8),t===void 0&&(t=0),this.maxLag=e,this.lagSkip=Math.min(t,this.maxLag),this},setFps:function(e){return e===void 0&&(e=240),this.gap=1e3/e,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(e){var t=Date.now()-this.prevTime;t>this.maxLag&&(this.startTime+=t-this.lagSkip),this.prevTime+=t;var n=this.prevTime-this.startTime,r=n-this.nextTime,i=n-this.time*1e3;return r>0||e?(n/=1e3,this.time=n,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):i=0,i},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(e){e===void 0&&(e=!1);var t=this.getDelta(e);if(!(t<=0)){this.processing=!0;var n,r,i=[],a=this.tweens;for(n=0;n0){for(n=0;n-1&&(r.isPendingRemove()||r.isDestroyed())&&(a.splice(s,1),r.destroy())}i.length=0}this.processing=!1}},remove:function(e){return this.processing?e.setPendingRemoveState():(r(this.tweens,e),e.setRemovedState()),this},reset:function(e){return this.existing(e),e.seek(),e.setActiveState(),this},makeActive:function(e){return this.existing(e),e.setActiveState(),this},each:function(e,t){var n,r=[null];for(n=1;n{e.exports=function(e,t,n){return e&&e.hasOwnProperty(t)?e[t]:n}}),6113:((e,t,n)=>{var r=n(62640),i=n(35355);e.exports=function(e,t){var n=r.Power0;if(typeof e==`string`)if(r.hasOwnProperty(e))n=r[e];else{var a=``;if(e.indexOf(`.`)){a=e.substring(e.indexOf(`.`)+1);var o=a.toLowerCase();o===`in`?a=`easeIn`:o===`out`?a=`easeOut`:o===`inout`&&(a=`easeInOut`)}e=i(e.substring(0,e.indexOf(`.`)+1)+a),r.hasOwnProperty(e)&&(n=r[e])}else typeof e==`function`&&(n=e);if(!t)return n;var s=t.slice(0);return s.unshift(0),function(e){return s[0]=e,n.apply(this,s)}}}),91389:((e,t,n)=>{var r=n(89318),i=n(77259),a={bezier:r,catmull:i,catmullrom:i,linear:n(28392)};e.exports=function(e){if(e===null)return null;var t=a.linear;return typeof e==`string`?a.hasOwnProperty(e)&&(t=a[e]):typeof e==`function`&&(t=e),t}}),55292:(e=>{e.exports=function(e,t,n){return e.hasOwnProperty(t)?typeof e[t]==`function`?function(n,r,i,a,o,s){return e[t](n,r,i,a,o,s)}:function(){return e[t]}:typeof n==`function`?n:function(){return n}}}),82985:((e,t,n)=>{var r=n(81076);e.exports=function(e){var t,n=[];if(e.hasOwnProperty(`props`))for(t in e.props)t.substring(0,1)!==`_`&&n.push({key:t,value:e.props[t]});else for(t in e)r.indexOf(t)===-1&&t.substring(0,1)!==`_`&&n.push({key:t,value:e[t]});return n}}),62329:((e,t,n)=>{var r=n(35154);e.exports=function(e){var t=r(e,`targets`,null);return t===null?t:(typeof t==`function`&&(t=t.call()),Array.isArray(t)||(t=[t]),t)}}),17777:((e,t,n)=>{var r=n(30976),i=n(99472);function a(e){return!!e.getActive&&typeof e.getActive==`function`}function o(e){return!!e.getStart&&typeof e.getStart==`function`}function s(e){return!!e.getEnd&&typeof e.getEnd==`function`}function c(e){return o(e)||s(e)||a(e)}var l=function(e,t){var n,u=function(e,t,n){return n},d=function(e,t,n){return n},f=null,p=typeof t;if(p===`number`)u=function(){return t};else if(Array.isArray(t))d=function(){return t[0]},u=function(){return t[t.length-1]};else if(p===`string`){var m=t.toLowerCase(),h=m.substring(0,6)===`random`,g=m.substring(0,3)===`int`;if(h||g){var _=m.indexOf(`(`),v=m.indexOf(`)`),y=m.indexOf(`,`);if(_&&v&&y){var b=parseFloat(m.substring(_+1,y)),x=parseFloat(m.substring(y+1,v));u=h?function(){return i(b,x)}:function(){return r(b,x)}}else throw Error(`invalid random() format`)}else{m=m[0];var S=parseFloat(t.substr(2));switch(m){case`+`:u=function(e,t,n){return n+S};break;case`-`:u=function(e,t,n){return n-S};break;case`*`:u=function(e,t,n){return n*S};break;case`/`:u=function(e,t,n){return n/S};break;default:u=function(){return parseFloat(t)}}}}else if(p===`function`)u=t;else if(p===`object`)if(c(t))a(t)&&(f=t.getActive),s(t)&&(u=t.getEnd),o(t)&&(d=t.getStart);else if(t.hasOwnProperty(`value`))n=l(e,t.value);else{var C=t.hasOwnProperty(`to`),w=t.hasOwnProperty(`from`),T=t.hasOwnProperty(`start`);if(C&&(w||T)){if(n=l(e,t.to),T){var E=l(e,t.start);n.getActive=E.getEnd}if(w){var D=l(e,t.from);n.getStart=D.getEnd}}}return n||={getActive:f,getEnd:u,getStart:d},n};e.exports=l}),88032:((e,t,n)=>{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(55292),u=n(35154),d=n(17777),f=n(269),p=n(86081);e.exports=function(e,t,n){if(t instanceof p)return t.parent=e,t;n=n===void 0?i:f(i,n);var m=c(t,`from`,0),h=c(t,`to`,1),g=[{value:m}],_=c(t,`delay`,n.delay),v=c(t,`easeParams`,n.easeParams),y=c(t,`ease`,n.ease),b=d(`value`,h),x=new p(e,g),S=x.add(0,`value`,b.getEnd,b.getStart,b.getActive,s(c(t,`ease`,y),c(t,`easeParams`,v)),l(t,`delay`,_),c(t,`duration`,n.duration),o(t,`yoyo`,n.yoyo),c(t,`hold`,n.hold),c(t,`repeat`,n.repeat),c(t,`repeatDelay`,n.repeatDelay),!1,!1);S.start=m,S.current=m,x.completeDelay=a(t,`completeDelay`,0),x.loop=Math.round(a(t,`loop`,0)),x.loopDelay=Math.round(a(t,`loopDelay`,0)),x.paused=o(t,`paused`,!1),x.persist=o(t,`persist`,!1),x.isNumberTween=!0,x.callbackScope=u(t,`callbackScope`,x);for(var C=r.TYPES,w=0;w{var r=n(6113),i=n(35154),a=n(36383);e.exports=function(e,t){t===void 0&&(t={});var n,o=i(t,`start`,0),s=i(t,`ease`,null),c=i(t,`grid`,null),l=i(t,`from`,0),u=l===`first`,d=l===`center`,f=l===`last`,p=typeof l==`number`,m=Array.isArray(e),h=parseFloat(m?e[0]:e),g=m?parseFloat(e[1]):0,_=Math.max(h,g);if(m&&(o+=h),c){var v=c[0],y=c[1],b=0,x=0,S=0,C=0,w=[];f?(b=v-1,x=y-1):p?(b=l%v,x=Math.floor(l/v)):d&&(b=(v-1)/2,x=(y-1)/2);for(var T=a.MIN_SAFE_INTEGER,E=0;ET&&(T=O),w[E][D]=O}}}var k=s?r(s):null;return n=c?function(e,t,n,r){var i=0,a=r%v,s=Math.floor(r/v);a>=0&&a=0&&s{var r=n(70402),i=n(69902),a=n(23568),o=n(57355),s=n(6113),c=n(95540),l=n(91389),u=n(55292),d=n(82985),f=n(62329),p=n(35154),m=n(17777),h=n(269),g=n(86081);e.exports=function(e,t,n){if(t instanceof g)return t.parent=e,t;n=n===void 0?i:h(i,n);var _=f(t);!_&&n.targets&&(_=n.targets);for(var v=d(t),y=c(t,`delay`,n.delay),b=c(t,`duration`,n.duration),x=c(t,`easeParams`,n.easeParams),S=c(t,`ease`,n.ease),C=c(t,`hold`,n.hold),w=c(t,`repeat`,n.repeat),T=c(t,`repeatDelay`,n.repeatDelay),E=o(t,`yoyo`,n.yoyo),D=o(t,`flipX`,n.flipX),O=o(t,`flipY`,n.flipY),k=c(t,`interpolation`,n.interpolation),A=function(e,t,n,r){if(n===`texture`){var i=r,a=void 0;Array.isArray(r)?(i=r[0],a=r[1]):r.hasOwnProperty(`value`)?(i=r.value,Array.isArray(r.value)?(i=r.value[0],a=r.value[1]):typeof r.value==`string`&&(i=r.value)):typeof r==`string`&&(i=r),e.addFrame(t,i,a,u(r,`delay`,y),c(r,`duration`,b),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O))}else{var d=m(n,r),f=l(c(r,`interpolation`,k));e.add(t,n,d.getEnd,d.getStart,d.getActive,s(c(r,`ease`,S),c(r,`easeParams`,x)),u(r,`delay`,y),c(r,`duration`,b),o(r,`yoyo`,E),c(r,`hold`,C),c(r,`repeat`,w),c(r,`repeatDelay`,T),o(r,`flipX`,D),o(r,`flipY`,O),f,f?r:null)}},j=new g(e,_),M=0;M{var r=n(70402),i=n(23568),a=n(57355),o=n(62329),s=n(35154),c=n(8357),l=n(43960);e.exports=function(e,t){if(t instanceof l)return t.parent=e,t;var n=new l(e);n.startDelay=s(t,`delay`,0),n.completeDelay=i(t,`completeDelay`,0),n.loop=Math.round(i(t,`loop`,s(t,`repeat`,0))),n.loopDelay=Math.round(i(t,`loopDelay`,s(t,`repeatDelay`,0))),n.paused=a(t,`paused`,!1),n.persist=a(t,`persist`,!1),n.callbackScope=s(t,`callbackScope`,n);var u,d=r.TYPES;for(u=0;u{e.exports={GetBoolean:n(57355),GetEaseFunction:n(6113),GetInterpolationFunction:n(91389),GetNewValue:n(55292),GetProps:n(82985),GetTargets:n(62329),GetValueOp:n(17777),NumberTweenBuilder:n(88032),StaggerBuilder:n(93109),TweenBuilder:n(8357)}}),73685:(e=>{e.exports=`active`}),98540:(e=>{e.exports=`complete`}),67233:(e=>{e.exports=`loop`}),2859:(e=>{e.exports=`pause`}),98336:(e=>{e.exports=`repeat`}),25764:(e=>{e.exports=`resume`}),32193:(e=>{e.exports=`start`}),84371:(e=>{e.exports=`stop`}),70766:(e=>{e.exports=`update`}),55659:(e=>{e.exports=`yoyo`}),842:((e,t,n)=>{e.exports={TWEEN_ACTIVE:n(73685),TWEEN_COMPLETE:n(98540),TWEEN_LOOP:n(67233),TWEEN_PAUSE:n(2859),TWEEN_RESUME:n(25764),TWEEN_REPEAT:n(98336),TWEEN_START:n(32193),TWEEN_STOP:n(84371),TWEEN_UPDATE:n(70766),TWEEN_YOYO:n(55659)}}),43066:((e,t,n)=>{e.exports={States:n(86353),Builders:n(30231),Events:n(842),TweenManager:n(40382),Tween:n(86081),TweenData:n(48177),TweenFrameData:n(42220),BaseTween:n(70402),TweenChain:n(43960)}}),70402:((e,t,n)=>{var r=n(83419),i=n(50792),a=n(842),o=n(86353),s=new r({Extends:i,initialize:function(e){i.call(this),this.parent=e,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=o.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(e){return this.timeScale=e,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(a.TWEEN_PAUSE,`onPause`)),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(a.TWEEN_RESUME,`onResume`)),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(a.TWEEN_COMPLETE,`onComplete`)},complete:function(e){return e===void 0&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return e===void 0&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(a.TWEEN_STOP,`onStop`),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(a.TWEEN_START,`onStart`),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,t,n){return n===void 0&&(n=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:t,params:n}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});s.TYPES=[`onActive`,`onComplete`,`onLoop`,`onPause`,`onRepeat`,`onResume`,`onStart`,`onStop`,`onUpdate`,`onYoyo`],e.exports=s}),95042:((e,t,n)=>{var r=n(83419),i=n(842),a=n(86353);e.exports=new r({initialize:function(e,t,n,r,i,a,o,s,c,l){this.tween=e,this.targetIndex=t,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=n,this.yoyo=i,this.hold=a,this.repeat=o,this.repeatDelay=s,this.repeatCounter=0,this.flipX=c,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(e){e===void 0&&(e=this.current),this.tween.targets[this.targetIndex][this.key]=e},setCreatedState:function(){this.state=a.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=a.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=a.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=a.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=a.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=a.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=a.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=a.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===a.CREATED},isDelayed:function(){return this.state===a.DELAY},isPendingRender:function(){return this.state===a.PENDING_RENDER},isPlayingForward:function(){return this.state===a.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===a.PLAYING_BACKWARD},isHolding:function(){return this.state===a.HOLD_DELAY},isRepeating:function(){return this.state===a.REPEAT_DELAY},isComplete:function(){return this.state===a.COMPLETE},setStateFromEnd:function(e){this.yoyo?this.onRepeat(e,!0,!0):this.repeatCounter>0?this.onRepeat(e,!0,!1):this.setCompleteState()},setStateFromStart:function(e){this.repeatCounter>0?this.onRepeat(e,!1):this.setCompleteState()},reset:function(){var e=this.tween,t=e.totalTargets,n=this.targetIndex,r=e.targets[n],i=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,i,0,n,t,e),this.repeatCounter=this.repeat===-1?a.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var s=o+this.repeatDelay;this.totalDuration=this.delay+o,this.repeat===-1?(this.totalDuration+=s*a.MAX,e.isInfinite=!0):this.repeat>0&&(this.totalDuration+=s*this.repeat),this.totalDuration>e.duration&&(e.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(e,t,n){var r=this.tween,a=r.totalTargets,o=this.targetIndex,s=r.targets[o],c=this.key,l=c!==`texture`;if(this.elapsed=e,this.progress=e/this.duration,this.flipX&&s.toggleFlipX(),this.flipY&&s.toggleFlipY(),l&&(t||n)&&(this.start=this.getStartValue(s,c,this.start,o,a,r)),n){this.setPlayingBackwardState(),this.dispatchEvent(i.TWEEN_YOYO,`onYoyo`);return}this.repeatCounter--,l&&(this.end=this.getEndValue(s,c,this.start,o,a,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-e,l&&(this.current=this.start,s[c]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(i.TWEEN_REPEAT,`onRepeat`))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}})}),69902:(e=>{e.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:(e=>{e.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`.split(`.`)}),86081:((e,t,n)=>{var r=n(70402),i=n(83419),a=n(842),o=n(44603),s=n(39429),c=n(36383),l=n(86353),u=n(48177),d=n(42220),f=new i({Extends:r,initialize:function(e,t){r.call(this,e),this.targets=t,this.totalTargets=t.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(e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g){var _=new u(this,e,t,n,r,i,a,o,s,c,l,d,f,p,m,h,g);return this.totalData=this.data.push(_),_},addFrame:function(e,t,n,r,i,a,o,s,c,l){var u=new d(this,e,t,n,r,i,a,o,s,c,l);return this.totalData=this.data.push(u),u},getValue:function(e){e===void 0&&(e=0);var t=null;return this.data&&(t=this.data[e].current),t},hasTarget:function(e){return this.targets&&this.targets.indexOf(e)!==-1},updateTo:function(e,t,n){if(n===void 0&&(n=!1),e!==`texture`)for(var r=0;r0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,r.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(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=16.6),n===void 0&&(n=!1),this.isDestroyed())return console.warn(`Cannot seek destroyed Tween`,this),this;n||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`);var r=this.paused;if(this.paused=!1,e>0){for(var i=Math.floor(e/t),o=e-i*t,s=0;s0&&this.update(o)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(e){e===void 0&&(e=!1),this.duration=0,this.startDelay=c.MAX_SAFE_INTEGER;for(var t=this.data,n=0;n0?this.totalDuration=r+i+(r+o)*a:this.totalDuration=r+i},reset:function(e){return e===void 0&&(e=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=l.MAX),e||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,`onActive`)),this},update:function(e){if(this.isPendingRemove()||this.isDestroyed())return this.persist?(this.setFinishedState(),!1):!0;if(this.paused||this.isFinished())return!1;if(e*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(e),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(e),!1;this.hasStarted||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,`onStart`),e=0));var t=!1;if(this.isActive())for(var n=this.data,r=0;r{var r=n(72905),i=n(70402),a=n(83419),o=n(842),s=n(44603),c=n(39429),l=n(86353),u=new a({Extends:i,initialize:function(e){i.call(this,e),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(e){var t=this.parent.create(e);Array.isArray(t)||(t=[t]);for(var n=this.data,r=0;r0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,`onLoop`));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;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 e=this.data,t=this.totalData,n=0;n{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g,_){r.call(this,e,t,c,l,u,d,f,p,m,h),this.key=n,this.getActiveValue=o,this.getEndValue=i,this.getStartValue=a,this.ease=s,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=g,this.interpolationData=_},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex],n=this.key;e&&(t[n]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(t[n]=this.getActiveValue(t,n,0))},update:function(e){var t=this.tween,n=t.totalTargets,r=this.targetIndex,a=t.targets[r],s=this.key;if(!a)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(a,s,a[s],r,n,t),this.end=this.getEndValue(a,s,this.start,r,n,t),this.current=this.start,a[s]=this.start,this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),l=this.isPlayingBackward();if(c||l){var u=this.elapsed,d=this.duration,f=0,p=!1;u+=e,u>=d?(f=u-d,u=d,p=!0):u<0&&(u=0);var m=i(u/d,0,1);this.elapsed=u,this.progress=m,this.previous=this.current,c||(m=1-m);var h=this.ease(m);this.interpolation?this.current=this.interpolation(this.interpolationData,h):this.current=this.start+(this.end-this.start)*h,a[s]=this.current,p&&(c?(t.isNumberTween&&(this.current=this.end,a[s]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(f)):(t.isNumberTween&&(this.current=this.start,a[s]=this.current),this.setStateFromStart(f))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key,a=this.current,o=this.previous;n.emit(e,n,i,r,a,o);var s=n.callbacks[t];s&&s.func.apply(n.callbackScope,[n,r,i,a,o].concat(s.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}})}),42220:((e,t,n)=>{var r=n(95042),i=n(45319),a=n(83419),o=n(842);e.exports=new a({Extends:r,initialize:function(e,t,n,i,a,o,s,c,l,u,d){r.call(this,e,t,a,o,!1,s,c,l,u,d),this.key=`texture`,this.startTexture=null,this.endTexture=n,this.startFrame=null,this.endFrame=i,this.yoyo=c!==0},reset:function(e){r.prototype.reset.call(this);var t=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=t.texture.key,this.startFrame=t.frame.name),e&&t.setTexture(this.startTexture,this.startFrame)},update:function(e){var t=this.tween,n=this.targetIndex,r=t.targets[n];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,`onRepeat`)):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var a=this.isPlayingForward(),s=this.isPlayingBackward();if(a||s){var c=this.elapsed,l=this.duration,u=0,d=!1;c+=e,c>=l?(u=c-l,c=l,d=!0):c<0&&(c=0);var f=i(c/l,0,1);this.elapsed=c,this.progress=f,d&&(a?(r.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(r.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,`onUpdate`)}return!this.isComplete()},dispatchEvent:function(e,t){var n=this.tween;if(!n.isSeeking){var r=n.targets[this.targetIndex],i=this.key;n.emit(e,n,i,r);var a=n.callbacks[t];a&&a.func.apply(n.callbackScope,[n,r,i].concat(a.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}})}),86353:(e=>{e.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:(e=>{function t(e){return!!e.get&&typeof e.get==`function`||!!e.set&&typeof e.set==`function`}function n(e,n,r){var i=r?e[n]:Object.getOwnPropertyDescriptor(e,n);return!r&&i.value&&typeof i.value==`object`&&(i=i.value),i&&t(i)?(i.enumerable===void 0&&(i.enumerable=!0),i.configurable===void 0&&(i.configurable=!0),i):!1}function r(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return n?(n.value&&typeof n.value==`object`&&(n=n.value),n.configurable===!1):!1}function i(e,t,i,a){for(var s in t)if(t.hasOwnProperty(s)){var c=n(t,s,i);if(c!==!1){if(r((a||e).prototype,s)){if(o.ignoreFinals)continue;throw Error(`cannot override final property '`+s+`', set Class.ignoreFinals = true to skip`)}Object.defineProperty(e.prototype,s,c)}else e.prototype[s]=t[s]}}function a(e,t){if(t){Array.isArray(t)||(t=[t]);for(var n=0;n{e.exports=function(){}}),20242:(e=>{e.exports=function(){return null}}),71146:(e=>{e.exports=function(e,t,n,r,i){if(i===void 0&&(i=e),n>0){var a=n-e.length;if(a<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.push(t),r&&r.call(i,t),t):null;for(var o=t.length-1;o>=0;)e.indexOf(t[o])!==-1&&t.splice(o,1),o--;if(o=t.length,o===0)return null;n>0&&o>a&&(t.splice(a),o=a);for(var s=0;s{e.exports=function(e,t,n,r,i,a){if(n===void 0&&(n=0),a===void 0&&(a=e),r>0){var o=r-e.length;if(o<=0)return null}if(!Array.isArray(t))return e.indexOf(t)===-1?(e.splice(n,0,t),i&&i.call(a,t),t):null;for(var s=t.length-1;s>=0;)e.indexOf(t[s])!==-1&&t.pop(),s--;if(s=t.length,s===0)return null;r>0&&s>o&&(t.splice(o),s=o);for(var c=s-1;c>=0;c--){var l=t[c];e.splice(n,0,l),i&&i.call(a,l)}return t}}),66905:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=0;if(r(e,i,a))for(var s=i;s{e.exports=function(e,t,n){var r,i=[null];for(r=3;r{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a)){var o,s=[null];for(o=5;o{e.exports=function(e,t,n){if(!t.length)return NaN;if(t.length===1)return t[0];var r=1,i,a;if(n){if(et.length&&(r=t.length),n?(i=t[r-1][n],a=t[r][n],a-e<=e-i?t[r]:t[r-1]):(i=t[r-1],a=t[r],a-e<=e-i?a:i)}}),43491:(e=>{var t=function(e,n){n===void 0&&(n=[]);for(var r=0;r{var r=n(82011);e.exports=function(e,t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=e.length);var o=[];if(r(e,i,a))for(var s=i;s{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),i!==-1){if(r(e,i,a))for(var o=i;o=0;o--){var s=e[o];if(!t||t&&n===void 0&&s.hasOwnProperty(t)||t&&n!==void 0&&s[t]===n)return s}return null}}),26546:(e=>{e.exports=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=e.length);var r=t+Math.floor(Math.random()*n);return e[r]===void 0?null:e[r]}}),85835:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r>i?e:(e.splice(r,1),i=e.indexOf(n),e.splice(i+1,0,t),e)}}),83371:(e=>{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return r{e.exports=function(e,t){var n=e.indexOf(t);if(n>0){var r=e[n-1],i=e.indexOf(r);e[n]=r,e[i]=t}return e}}),69693:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t);if(r===-1||n<0||n>=e.length)throw Error(`Supplied index out of bounds`);return r!==n&&(e.splice(r,1),e.splice(n,0,t)),t}}),40853:(e=>{e.exports=function(e,t){var n=e.indexOf(t);if(n!==-1&&n{e.exports=function(e,t,n,r){var i=[],a,o=!1;if((n||r)&&(o=!0,n||=``,r||=``),t=t;a--)o?i.push(n+a.toString()+r):i.push(a);else for(a=e;a<=t;a++)o?i.push(n+a.toString()+r):i.push(a);return i}}),593:((e,t,n)=>{var r=n(2284);e.exports=function(e,t,n){e===void 0&&(e=0),t===void 0&&(t=null),n===void 0&&(n=1),t===null&&(t=e,e=0);for(var i=[],a=Math.max(r((t-e)/(n||1)),0),o=0;o{function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e,i,a,o,s){for(a===void 0&&(a=0),o===void 0&&(o=e.length-1),s===void 0&&(s=n);o>a;){if(o-a>600){var c=o-a+1,l=i-a+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(l-c/2<0?-1:1);r(e,i,Math.max(a,Math.floor(i-l*d/c+f)),Math.min(o,Math.floor(i+(c-l)*d/c+f)),s)}var p=e[i],m=a,h=o;for(t(e,a,i),s(e[o],p)>0&&t(e,a,o);m0;)h--}s(e[a],p)===0?t(e,a,h):(h++,t(e,h,o)),h<=i&&(a=h+1),i<=h&&(o=h-1)}};e.exports=r}),88492:((e,t,n)=>{var r=n(35154),i=n(33680),a=function(e,t,n){for(var r=[],i=0;i{var r=n(19133);e.exports=function(e,t,n,i){i===void 0&&(i=e);var a;if(!Array.isArray(t))return a=e.indexOf(t),a===-1?null:(r(e,a),n&&n.call(i,t),t);for(var o=t.length-1,s=[];o>=0;){var c=t[o];a=e.indexOf(c),a!==-1&&(r(e,a),s.push(c),n&&n.call(i,c)),o--}return s}}),60248:((e,t,n)=>{var r=n(19133);e.exports=function(e,t,n,i){if(i===void 0&&(i=e),t<0||t>e.length-1)throw Error(`Index out of bounds`);var a=r(e,t);return n&&n.call(i,a),a}}),81409:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(t===void 0&&(t=0),n===void 0&&(n=e.length),a===void 0&&(a=e),r(e,t,n)){var o=n-t,s=e.splice(t,o);if(i)for(var c=0;c{var r=n(19133);e.exports=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=e.length),r(e,t+Math.floor(Math.random()*n))}}),42169:(e=>{e.exports=function(e,t,n){var r=e.indexOf(t),i=e.indexOf(n);return r!==-1&&i===-1?(e[r]=n,!0):!1}}),86003:(e=>{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t){t===void 0&&(t=1);for(var n=null,r=0;r{e.exports=function(e,t,n,r){var i=e.length;if(t<0||t>=i||t>=n||n>i){if(r)throw Error(`Range Error: Values outside acceptable range`);return!1}else return!0}}),89545:(e=>{e.exports=function(e,t){var n=e.indexOf(t);return n!==-1&&n>0&&(e.splice(n,1),e.unshift(t)),t}}),17810:((e,t,n)=>{var r=n(82011);e.exports=function(e,t,n,i,a){if(i===void 0&&(i=0),a===void 0&&(a=e.length),r(e,i,a))for(var o=i;o{e.exports=function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}}),90126:(e=>{e.exports=function(e){var t=/\D/g;return e.sort(function(e,n){return parseInt(e.replace(t,``),10)-parseInt(n.replace(t,``),10)}),e}}),19133:(e=>{e.exports=function(e,t){if(!(t>=e.length)){for(var n=e.length-1,r=e[t],i=t;i{var r=n(82264);function i(e,t){return String(e).localeCompare(t)}function a(e,t){var n=e.length;if(n<=1)return e;for(var r=Array(n),i=1;ii&&(c=i),l>i&&(l=i),u=s,d=c;;)if(u{e.exports=function(e,t,n){if(t===n)return e;var r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)throw Error(`Supplied items must be elements of the same array`);return e[r]=n,e[i]=t,e}}),37105:((e,t,n)=>{e.exports={Matrix:n(54915),Add:n(71146),AddAt:n(51067),BringToTop:n(66905),CountAllMatching:n(21612),Each:n(95428),EachInRange:n(36914),FindClosestInSorted:n(81957),Flatten:n(43491),GetAll:n(46710),GetFirst:n(58731),GetRandom:n(26546),MoveDown:n(70864),MoveTo:n(69693),MoveUp:n(40853),MoveAbove:n(85835),MoveBelow:n(83371),NumberArray:n(20283),NumberArrayStep:n(593),QuickSelect:n(43886),Range:n(88492),Remove:n(72905),RemoveAt:n(60248),RemoveBetween:n(81409),RemoveRandomElement:n(31856),Replace:n(42169),RotateLeft:n(86003),RotateRight:n(49498),SafeRange:n(82011),SendToBack:n(89545),SetAll:n(17810),Shuffle:n(33680),SortByDigits:n(90126),SpliceOne:n(19133),StableSort:n(19186),Swap:n(25630)}}),86922:(e=>{e.exports=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var t=e[0].length,n=1;n{var r=n(41836),i=n(86922);e.exports=function(e){var t=``;if(!i(e))return t;for(var n=0;n{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),jt=V(),Mt=V(),Nt=V();V();function Pt(){let e=H(Mt);if(!e)throw Error(`Solidion: useScene() must be used within a component.`);return e}function Ft(){let e=H(Nt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function It(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Lt(e,t,n){We(),P(()=>{e.update(t,n)}),Ge()}function Rt(e,t){return new Promise(n=>{let r=It(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Lt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:At.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new At.default.Game(o)})}function zt(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&Rt(r,e).then(t=>{n(t),De(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=xt(()=>ge(jt.Provider,{value:t.game,get children(){return ge(Mt.Provider,{value:t.scene,get children(){return ge(Nt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),I(()=>{let e=F(t);i&&i(),e&&(Oe(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}function Bt(e){return I(Ft().register(e.onUpdate)),null}var Vt=10;function Ht(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Ht(r,t,n);return}if(typeof e==`function`){if(n>=Vt)return;Ht(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Ne(e))){let r=Me(e);for(let e of r.children)Ht(e,t,n)}}}function Ut(e){let t=e.children;return M(()=>{Ht(t,!!e.when)}),t}function Wt(e){I(Ft().register(e))}function Gt(e){let t=e.mode??`all`;Wt(()=>{let n=e.sources(),r=e.targets();if(n.length===0||r.length===0)return;let i=e.threshold,a=i*i;if(t===`nearest`)for(let t of n){let n=e.getPosition(t),i=null,o=1/0;for(let t of r){let r=e.getPosition(t),s=r.x-n.x,c=r.y-n.y,l=s*s+c*c;l=Yt?!0:n<0||n>=Jt?!1:!e[n][t]}function ln(e){return e<0?Yt-1:e>=Yt?0:e}function un(e,t){return[e*Kt+Kt/2,t*Kt+Kt/2+Qt]}function dn(e,t,n,r){return(e-n)**2+(t-r)**2}function fn(e){let t=()=>e.frightened?an:on[0].color,n=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`rectangle`);return Z(n,`width`,18),Z(n,`height`,18),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,18),Z(t,`height`,3),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x,i=e.y-7,a=e.frightened?1118634:10031377,o=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`fillColor`,a,n.a)),o!==n.o&&(n.o=Z(t,`visible`,o,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-4,i=e.y-1,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+4,i=e.y-1,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x-4+Q[n()]*1,a=e.y-1+$[n()]*1,o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x+4+Q[n()]*1,a=e.y-1+$[n()]*1,o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})()]}function pn(e){let t=()=>e.frightened?an:on[1].color,n=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`ellipse`);return Z(n,`width`,18),Z(n,`height`,18),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-3,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+3,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x-3+Q[n()],a=e.y-2+$[n()],o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x+3+Q[n()],a=e.y-2+$[n()],o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,16746666),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+5,i=e.y+3,a=e.visible&&!e.frightened;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function mn(e){let t=()=>e.frightened?an:on[2].color,n=()=>e.frightened?1118634:3368652,r=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`rectangle`);return Z(n,`width`,20),Z(n,`height`,14),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,10),Z(t,`height`,10),Z(t,`origin`,.5),Z(t,`depth`,5),Y(r=>{var i=e.x-Q[e.dir]*8,a=e.y-$[e.dir]*8,o=n(),s=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(t,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,16763904),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-4,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,16763904),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+4,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,2),Z(t,`height`,4),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x-4+Q[r()],a=e.y-2+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,2),Z(t,`height`,4),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x+4+Q[r()],a=e.y-2+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function hn(e){let t=()=>e.frightened?an:on[3].color,n=()=>Math.sin(e.time/200)*2,r=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`rectangle`);return Z(n,`width`,16),Z(n,`height`,16),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,8),Z(t,`height`,4),Z(t,`origin`,.5),Z(t,`depth`,5),Y(r=>{var i=e.x+6+n(),a=e.y-7,o=e.frightened?1118634:16755200,s=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(t,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,6),Z(t,`origin`,.5),Z(t,`depth`,5),Y(r=>{var i=e.x-7-n(),a=e.y+5,o=e.frightened?1118634:16772710,s=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(t,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,4),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-3,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+4,i=e.y-1,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x-3+Q[r()],a=e.y-2+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x+4+Q[r()],a=e.y-1+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function gn(e){return[(()=>{var t=X(`rectangle`);return Z(t,`width`,14),Z(t,`height`,14),Z(t,`fillColor`,56746),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x,i=e.y,a=e.dir*90;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`angle`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,6),Z(t,`height`,6),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var r=e.x+Q[e.dir]*5,i=e.y+$[e.dir]*5;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),n},{e:void 0,t:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,4),Z(t,`height`,10),Z(t,`fillColor`,34918),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-Q[e.dir]*6,i=e.y-$[e.dir]*6,a=e.dir*90;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`angle`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function _n(e){let t=Pt().input.keyboard;return t.on(`keydown-LEFT`,e.onLeft),t.on(`keydown-RIGHT`,e.onRight),t.on(`keydown-UP`,e.onUp),t.on(`keydown-DOWN`,e.onDown),t.on(`keydown-SPACE`,e.onSpace),null}function vn(){let e=sn(),[t,n]=j(0),[r,i]=j(3),[a,o]=j(`ready`),[s,c]=j(!1),[l,u]=j(0),[d,f]=j(0),[p,m]=j(0),h=Array.from({length:4},()=>({x:j(0),y:j(0),dir:j(0),frightened:j(!1),visible:j(!0)})),[g,_]=j(0),v=[];for(let t=0;t{let e=0;for(let t=0;t0&&e++;return e}),b=e.playerStart[0],x=e.playerStart[1],S=0,C=0,w=0,T={lerpC:b,lerpR:x},E=[],D=[10,11],O=0,k=0,A=[[`scatter`,7e3],[`chase`,2e4],[`scatter`,7e3],[`chase`,2e4],[`scatter`,5e3],[`chase`,2e4],[`scatter`,5e3],[`chase`,1/0]],M=0,F=!1;for(let t=0;t<4;t++){let n=e.ghostHome[t]??[10,11];E.push({col:n[0],row:n[1],dir:3,progress:0,mode:`scatter`,homeCol:n[0],homeRow:n[1],startDelay:t*3e3,lerpC:n[0],lerpR:n[1]})}let I=()=>{let e=a();return e===`ready`?[`NULL POW!`,`#00ddaa`,`ARROW KEYS TO MOVE — SPACE TO START`]:e===`dead`?[`NullPointerException`,`#ff3333`,`score: ${t()} — SPACE to retry`]:e===`win`?[`GARBAGE COLLECTED!`,`#00ff88`,`score: ${t()} — all data recovered`]:null};function L(t,n,r){let i=-1,a=1/0,o=(t.dir+2)%4;for(let s=0;s<4;s++){if(s===o)continue;let c=ln(t.col+Q[s]),l=t.row+$[s];if(!cn(e.walls,c,l)||qt[l]?.[c]===`-`&&t.mode!==`eaten`&&t.row<=9)continue;let u=dn(c,l,n,r);u{n(0),i(3),B(),z(),o(`play`)})}function H(){c(!0);let e=r()-1;if(e<=0)P(()=>{i(0),o(`dead`)});else{P(()=>{i(e)}),z(),setTimeout(()=>{c(!1)},800);return}setTimeout(()=>c(!1),1200)}function U(t){if(t.dir=(t.dir+2)%4,t.progress>0&&(t.progress=1-t.progress),!cn(e.walls,ln(t.col+Q[t.dir]),t.row+$[t.dir])){t.progress=0;for(let n=0;n<4;n++)if(cn(e.walls,ln(t.col+Q[n]),t.row+$[n])){t.dir=n;break}}}function W(){F=!0,M=nn;for(let e of E)e.mode!==`eaten`&&(e.mode=`frightened`,U(e))}function G(){return Gt({sources:()=>E,targets:()=>[T],getPosition:e=>({x:e.lerpC,y:e.lerpR}),threshold:.8,mode:`all`,onOverlap:e=>{e.mode===`frightened`?(e.mode=`eaten`,n(e=>e+200)):e.mode!==`eaten`&&H()}}),null}let ee=0,K=()=>{Je({phase:a(),score:t(),lives:r(),totalDots:y(),playerCol:b,playerRow:x,playerDir:S,ghostModes:E.map(e=>e.mode),frightActive:F})},te=(t,r)=>{if(ee-=r,ee<=0&&(ee=200,K()),a()!==`play`)return;let i=Math.min(r/1e3,.05);if(!F){O+=r;let[,e]=A[k];if(O>=e&&k=1){if(--w,b=ln(b+Q[S]),x+=$[S],x>=0&&x=0&&be+10)):e===2&&(v[x][b][1](0),n(e=>e+50),W())}let t=ln(b+Q[C]),r=x+$[C];cn(e.walls,t,r)&&(S=C);let i=ln(b+Q[S]),a=x+$[S];cn(e.walls,i,a)||(w=0)}let s=b+Q[S]*w,c=x+$[S]*w;T.lerpC=s,T.lerpR=c;let[l,d]=un(s,c);u(l),f(d),m(S);for(let t=0;t0){n.startDelay-=r,n.lerpC=n.col,n.lerpR=n.row;let[e,i]=un(n.col,n.row);h[t].x[1](e),h[t].y[1](i),h[t].dir[1](n.dir),h[t].frightened[1](n.mode===`frightened`);continue}let a=n.mode===`frightened`?tn:n.mode===`eaten`?$t*2:en;if(n.progress+=a*i,n.progress>=1){--n.progress;let r=ln(n.col+Q[n.dir]),i=n.row+$[n.dir];cn(e.walls,r,i)?(n.col=r,n.row=i):n.progress=0;let a;if(n.mode===`chase`)a=R(n,t);else if(n.mode===`scatter`)a=on[t].scatterTarget;else if(n.mode===`eaten`){if(a=[D[0],D[1]],n.col===D[0]&&n.row===D[1]){let[e]=A[k];n.mode=F?`frightened`:e,n.mode===`chase`?a=R(n,t):n.mode===`scatter`&&(a=on[t].scatterTarget)}}else{let t=(n.dir+2)%4,r=[0,1,2,3].filter(r=>{if(r===t)return!1;let i=ln(n.col+Q[r]),a=n.row+$[r];return cn(e.walls,i,a)});r.length>0?n.dir=r[Math.floor(Math.random()*r.length)]:cn(e.walls,ln(n.col+Q[t]),n.row+$[t])&&(n.dir=t),a=[n.col+Q[n.dir],n.row+$[n.dir]]}n.mode!==`frightened`&&(n.dir=L(n,a[0],a[1]));let o=ln(n.col+Q[n.dir]),s=n.row+$[n.dir];cn(e.walls,o,s)||(n.progress=0)}n.lerpC=n.col+Q[n.dir]*n.progress,n.lerpR=n.row+$[n.dir]*n.progress;let[o,s]=un(n.lerpC,n.lerpR);h[t].x[1](o),h[t].y[1](s),h[t].dir[1](n.dir),h[t].frightened[1](n.mode===`frightened`),t===3&&_(performance.now())}y()===0&&P(()=>{o(`win`)})},ne=[];for(let t=0;t0){let[r,i]=un(n,t);re.push({r:t,c:n,px:r,py:i,type:e.dots[t][n]})}return Ct(zt,{width:Xt,height:Zt,backgroundColor:rn,parent:`game-container`,get children(){return[Ct(Bt,{onUpdate:te}),Ct(G,{}),Ct(_n,{onLeft:()=>{C=2},onRight:()=>{C=0},onUp:()=>{C=3},onDown:()=>{C=1},onSpace:()=>{let e=a();(e===`ready`||e===`dead`||e===`win`)&&V()}}),(()=>{var e=X(`rectangle`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2),Z(e,`width`,Xt),Z(e,`height`,Zt),Z(e,`fillColor`,0),Z(e,`origin`,.5),Z(e,`depth`,0),e})(),St(()=>ne.map(e=>(()=>{var t=X(`rectangle`);return Z(t,`width`,23),Z(t,`height`,23),Z(t,`fillColor`,2245802),Z(t,`origin`,.5),Z(t,`depth`,1),Y(n=>{var r=e.px,i=e.py;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),n},{e:void 0,t:void 0}),t})())),St(()=>re.map(e=>e.type===1?(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,8947848),Z(t,`origin`,.5),Z(t,`depth`,2),Y(n=>{var r=e.px,i=e.py,a=v[e.r][e.c][0]()>0;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})():(()=>{var t=X(`ellipse`);return Z(t,`width`,10),Z(t,`height`,10),Z(t,`fillColor`,16763904),Z(t,`origin`,.5),Z(t,`depth`,2),Y(n=>{var r=e.px,i=e.py,a=v[e.r][e.c][0]()>0;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})())),Ct(gn,{get x(){return l()},get y(){return d()},get dir(){return p()}}),Ct(fn,{get x(){return h[0].x[0]()},get y(){return h[0].y[0]()},get dir(){return h[0].dir[0]()},get frightened(){return h[0].frightened[0]()},get visible(){return h[0].visible[0]()}}),Ct(pn,{get x(){return h[1].x[0]()},get y(){return h[1].y[0]()},get dir(){return h[1].dir[0]()},get frightened(){return h[1].frightened[0]()},get visible(){return h[1].visible[0]()}}),Ct(mn,{get x(){return h[2].x[0]()},get y(){return h[2].y[0]()},get dir(){return h[2].dir[0]()},get frightened(){return h[2].frightened[0]()},get visible(){return h[2].visible[0]()}}),Ct(hn,{get x(){return h[3].x[0]()},get y(){return h[3].y[0]()},get dir(){return h[3].dir[0]()},get frightened(){return h[3].frightened[0]()},get visible(){return h[3].visible[0]()},get time(){return g()}}),(()=>{var e=X(`text`);return Z(e,`x`,8),Z(e,`y`,16),Z(e,`fontSize`,16),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#00ddaa`),Z(e,`originX`,0),Z(e,`originY`,.5),Z(e,`depth`,10),Y(n=>Z(e,`text`,`*ptr → ${t()}`,n)),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt-8),Z(e,`y`,16),Z(e,`fontSize`,16),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#00ddaa`),Z(e,`originX`,1),Z(e,`originY`,.5),Z(e,`depth`,10),Y(t=>Z(e,`text`,`ptr `.repeat(r()),t)),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,16),Z(e,`text`,`NULL POW!`),Z(e,`fontSize`,14),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#444444`),Z(e,`origin`,.5),Z(e,`depth`,10),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2-10),Z(e,`text`,`ガッ!`),Z(e,`fontSize`,36),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#ff3333`),Z(e,`origin`,.5),Z(e,`depth`,11),Y(t=>Z(e,`visible`,s(),t)),e})(),Ct(Ut,{get when(){return a()!==`play`},get children(){return[(()=>{var e=X(`rectangle`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2),Z(e,`width`,280),Z(e,`height`,100),Z(e,`fillColor`,0),Z(e,`origin`,.5),Z(e,`depth`,9),Z(e,`alpha`,.9),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2-14),Z(e,`fontSize`,22),Z(e,`fontFamily`,`monospace`),Z(e,`origin`,.5),Z(e,`depth`,10),Y(t=>{var n=I()?I()[0]:``,r=I()?I()[1]:`#ffffff`;return n!==t.e&&(t.e=Z(e,`text`,n,t.e)),r!==t.t&&(t.t=Z(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2+14),Z(e,`fontSize`,12),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#666666`),Z(e,`origin`,.5),Z(e,`depth`,10),Y(t=>Z(e,`text`,I()?I()[2]:``,t)),e})()]}})]}})}A(()=>{let e=vn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file +`}}return t}}),92598:(e=>{e.exports=function(e){return e.reverse()}}),21224:(e=>{e.exports=function(e){for(var t=0;t{var r=n(37829);e.exports=function(e){return r(e,180)}}),44657:((e,t,n)=>{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86922),i=n(2429);e.exports=function(e,t){if(t===void 0&&(t=90),!r(e))return null;if(typeof t!=`string`&&(t=(t%360+360)%360),t===90||t===-270||t===`rotateLeft`)e=i(e),e.reverse();else if(t===-90||t===270||t===`rotateRight`)e.reverse(),e=i(e);else if(Math.abs(t)===180||t===`rotate180`){for(var n=0;n{var r=n(37829);e.exports=function(e,t){t===void 0&&(t=1);for(var n=0;n{var r=n(86003),i=n(49498);e.exports=function(e,t,n){if(t===void 0&&(t=0),n===void 0&&(n=0),n!==0&&(n<0?r(e,Math.abs(n)):i(e,n)),t!==0)for(var a=0;a{e.exports=function(e){for(var t=e.length,n=e[0].length,r=Array(n),i=0;i-1;a--)r[i][a]=e[a][i]}return r}}),54915:((e,t,n)=>{e.exports={CheckMatrix:n(86922),MatrixToString:n(63362),ReverseColumns:n(92598),ReverseRows:n(21224),Rotate180:n(98717),RotateLeft:n(44657),RotateMatrix:n(37829),RotateRight:n(92632),Translate:n(69512),TransposeMatrix:n(2429)}}),71334:(e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;e.exports=function(e,n){for(var r=new Uint8Array(e),i=r.length,a=n?`data:`+n+`;base64,`:``,o=0;o>2],a+=t[(r[o]&3)<<4|r[o+1]>>4],a+=t[(r[o+1]&15)<<2|r[o+2]>>6],a+=t[r[o+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a}}),53134:(e=>{for(var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=new Uint8Array(256),r=0;r>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}}),65839:((e,t,n)=>{e.exports={ArrayBufferToBase64:n(71334),Base64ToArrayBuffer:n(53134)}}),91799:((e,t,n)=>{e.exports={Array:n(37105),Base64:n(65839),Objects:n(1183),String:n(31749),NOOP:n(29747),NULL:n(20242)}}),41786:(e=>{e.exports=function(e){var t={};for(var n in e)Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}}),62644:(e=>{var t=function(e){var n,r,i;if(typeof e!=`object`||!e)return e;for(i in n=Array.isArray(e)?[]:{},e)r=e[i],n[i]=t(r);return n};e.exports=t}),79291:((e,t,n)=>{var r=n(41212),i=function(){var e,t,n,a,o,s,c=arguments[0]||{},l=1,u=arguments.length,d=!1;for(typeof c==`boolean`&&(d=c,c=arguments[1]||{},l=2),u===l&&(c=this,--l);l{var r=n(75508),i=n(35154);e.exports=function(e,t,n){var a=i(e,t,null);if(a===null)return n;if(Array.isArray(a))return r.RND.pick(a);if(typeof a==`object`){if(a.hasOwnProperty(`randInt`))return r.RND.integerInRange(a.randInt[0],a.randInt[1]);if(a.hasOwnProperty(`randFloat`))return r.RND.realInRange(a.randFloat[0],a.randFloat[1])}else if(typeof a==`function`)return a(t);return a}}),95540:(e=>{e.exports=function(e,t,n){var r=typeof e;return!e||r===`number`||r===`string`?n:e.hasOwnProperty(t)&&e[t]!==void 0?e[t]:n}}),82840:((e,t,n)=>{var r=n(35154),i=n(45319);e.exports=function(e,t,n,a,o){return o===void 0&&(o=n),i(r(e,t,o),n,a)}}),35154:(e=>{e.exports=function(e,t,n,r){if(!e&&!r||typeof e==`number`)return n;if(e&&e.hasOwnProperty(t))return e[t];if(r&&r.hasOwnProperty(t))return r[t];if(t.indexOf(`.`)!==-1){for(var i=t.split(`.`),a=e,o=r,s=n,c=n,l=!0,u=!0,d=0;d{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){for(var n=0;n{e.exports=function(e,t){return e.hasOwnProperty(t)}}),41212:(e=>{e.exports=function(e){if(!e||typeof e!=`object`||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,`isPrototypeOf`))return!1}catch{return!1}return!0}}),46975:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)||(n[i]=t[i]);return n}}),269:((e,t,n)=>{var r=n(41786);e.exports=function(e,t){var n=r(e);for(var i in t)n.hasOwnProperty(i)&&(n[i]=t[i]);return n}}),18254:((e,t,n)=>{var r=n(97022);e.exports=function(e,t){for(var n={},i=0;i{e.exports=function(e,t,n){if(!e||typeof e==`number`)return!1;if(e.hasOwnProperty(t))return e[t]=n,!0;if(t.indexOf(`.`)!==-1){for(var r=t.split(`.`),i=e,a=e,o=0;o{e.exports={Clone:n(41786),DeepCopy:n(62644),Extend:n(79291),GetAdvancedValue:n(23568),GetFastValue:n(95540),GetMinMaxValue:n(82840),GetValue:n(35154),HasAll:n(69036),HasAny:n(1985),HasValue:n(97022),IsPlainObject:n(41212),Merge:n(46975),MergeRight:n(269),Pick:n(18254),SetValue:n(61622)}}),27902:(e=>{e.exports=function(e,t){return e.replace(/%([0-9]+)/g,function(e,n){return t[Number(n)-1]})}}),41836:(e=>{e.exports=function(e,t,n,r){t===void 0&&(t=0),n===void 0&&(n=` `),r===void 0&&(r=3),e=e.toString();var i=0;if(t+1>=e.length)switch(r){case 1:e=Array(t+1-e.length).join(n)+e;break;case 3:var a=Math.ceil((i=t-e.length)/2),o=i-a;e=Array(o+1).join(n)+e+Array(a+1).join(n);break;default:e+=Array(t+1-e.length).join(n);break}return e}}),33628:(e=>{e.exports=function(e,t){return t===0?e.slice(1):e.slice(0,t)+e.slice(t+1)}}),27671:(e=>{e.exports=function(e){return e.split(``).reverse().join(``)}}),45650:(e=>{e.exports=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}),35355:(e=>{e.exports=function(e){return e&&e[0].toUpperCase()+e.slice(1)}}),31749:((e,t,n)=>{e.exports={Format:n(27902),Pad:n(41836),RemoveAt:n(33628),Reverse:n(27671),UppercaseFirst:n(35355),UUID:n(45650)}})},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}return n.g=(function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}})(),n(85454)})())}))()),jt=V(),Mt=V(),Nt=V();V();function Pt(){let e=H(Mt);if(!e)throw Error(`Solidion: useScene() must be used within a component.`);return e}function Ft(){let e=H(Nt);if(!e)throw Error(`Solidion: useFrameManager() must be used within a component.`);return e}function It(){let e=new Set;return{register(t){return e.add(t),()=>e.delete(t)},update(t,n){for(let r of e)r(t,n)}}}function Lt(e,t,n){We(),P(()=>{e.update(t,n)}),Ge()}function Rt(e,t){return new Promise(n=>{let r=It(),i={key:`__solidion_default`,active:!0,create(){n({game:s,scene:this,frameManager:r})},update(e,t){Lt(r,e,t)}},a=t.backgroundColor===void 0?`#000000`:typeof t.backgroundColor==`number`?`#${t.backgroundColor.toString(16).padStart(6,`0`)}`:t.backgroundColor,o={type:At.default.AUTO,width:t.width??800,height:t.height??600,backgroundColor:a,parent:e,scene:i,banner:!1,...t.physics?{physics:t.physics}:{},...t.scale?{scale:t.scale}:{},...t.config??{}},s=new At.default.Game(o)})}function zt(e){let[t,n]=j(null),r,i;return typeof document<`u`&&(r=document.createElement(`div`),r.style.display=`inline-block`,e.parent&&(typeof e.parent==`string`?document.getElementById(e.parent):e.parent)?.appendChild(r)),r&&Rt(r,e).then(t=>{n(t),De(t.scene);let r=t.scene.input;e.onPointerMove&&r.on(`pointermove`,e.onPointerMove),e.onPointerDown&&r.on(`pointerdown`,e.onPointerDown),e.onPointerUp&&r.on(`pointerup`,e.onPointerUp),i=xt(()=>ge(jt.Provider,{value:t.game,get children(){return ge(Mt.Provider,{value:t.scene,get children(){return ge(Nt.Provider,{value:t.frameManager,get children(){return e.children}})}})}}),t.scene.add.container(0,0))}),I(()=>{let e=F(t);i&&i(),e&&(Oe(),e.game.destroy(!0)),r&&r.parentNode&&r.parentNode.removeChild(r)}),r??null}var Bt=10;function Vt(e,t,n=0){if(e!=null){if(Array.isArray(e)){for(let r of e)Vt(r,t,n);return}if(typeof e==`function`){if(n>=Bt)return;Vt(e(),t,n+1);return}if(e&&typeof e.setVisible==`function`&&(e.setVisible(t),e.input&&(e.input.enabled=t),Ne(e))){let r=Me(e);for(let e of r.children)Vt(e,t,n)}}}function Ht(e){return I(Ft().register(e.onUpdate)),null}function Ut(e){let t=e.children;return M(()=>{Vt(t,!!e.when)}),t}function Wt(e){I(Ft().register(e))}function Gt(e){let t=e.mode??`all`;Wt(()=>{let n=e.sources(),r=e.targets();if(n.length===0||r.length===0)return;let i=e.threshold,a=i*i;if(t===`nearest`)for(let t of n){let n=e.getPosition(t),i=null,o=1/0;for(let t of r){let r=e.getPosition(t),s=r.x-n.x,c=r.y-n.y,l=s*s+c*c;l=Yt?!0:n<0||n>=Jt?!1:!e[n][t]}function ln(e){return e<0?Yt-1:e>=Yt?0:e}function un(e,t){return[e*Kt+Kt/2,t*Kt+Kt/2+Qt]}function dn(e,t,n,r){return(e-n)**2+(t-r)**2}function fn(e){let t=()=>e.frightened?an:on[0].color,n=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`rectangle`);return Z(n,`width`,18),Z(n,`height`,18),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,18),Z(t,`height`,3),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x,i=e.y-7,a=e.frightened?1118634:10031377,o=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`fillColor`,a,n.a)),o!==n.o&&(n.o=Z(t,`visible`,o,n.o)),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-4,i=e.y-1,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+4,i=e.y-1,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x-4+Q[n()]*1,a=e.y-1+$[n()]*1,o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x+4+Q[n()]*1,a=e.y-1+$[n()]*1,o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})()]}function pn(e){let t=()=>e.frightened?an:on[1].color,n=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`ellipse`);return Z(n,`width`,18),Z(n,`height`,18),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-3,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+3,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x-3+Q[n()],a=e.y-2+$[n()],o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(r=>{var i=e.x+3+Q[n()],a=e.y-2+$[n()],o=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`visible`,o,r.a)),r},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,16746666),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+5,i=e.y+3,a=e.visible&&!e.frightened;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function mn(e){let t=()=>e.frightened?an:on[2].color,n=()=>e.frightened?1118634:3368652,r=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`rectangle`);return Z(n,`width`,20),Z(n,`height`,14),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,10),Z(t,`height`,10),Z(t,`origin`,.5),Z(t,`depth`,5),Y(r=>{var i=e.x-Q[e.dir]*8,a=e.y-$[e.dir]*8,o=n(),s=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(t,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,16763904),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-4,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,16763904),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+4,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,2),Z(t,`height`,4),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x-4+Q[r()],a=e.y-2+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,2),Z(t,`height`,4),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x+4+Q[r()],a=e.y-2+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function hn(e){let t=()=>e.frightened?an:on[3].color,n=()=>Math.sin(e.time/200)*2,r=()=>e.frightened?0:e.dir;return[(()=>{var n=X(`rectangle`);return Z(n,`width`,16),Z(n,`height`,16),Z(n,`origin`,.5),Z(n,`depth`,5),Y(r=>{var i=e.x,a=e.y,o=t(),s=e.visible;return i!==r.e&&(r.e=Z(n,`x`,i,r.e)),a!==r.t&&(r.t=Z(n,`y`,a,r.t)),o!==r.a&&(r.a=Z(n,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(n,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,8),Z(t,`height`,4),Z(t,`origin`,.5),Z(t,`depth`,5),Y(r=>{var i=e.x+6+n(),a=e.y-7,o=e.frightened?1118634:16755200,s=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(t,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,6),Z(t,`origin`,.5),Z(t,`depth`,5),Y(r=>{var i=e.x-7-n(),a=e.y+5,o=e.frightened?1118634:16772710,s=e.visible;return i!==r.e&&(r.e=Z(t,`x`,i,r.e)),a!==r.t&&(r.t=Z(t,`y`,a,r.t)),o!==r.a&&(r.a=Z(t,`fillColor`,o,r.a)),s!==r.o&&(r.o=Z(t,`visible`,s,r.o)),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,5),Z(t,`height`,4),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-3,i=e.y-2,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,5),Z(t,`height`,5),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x+4,i=e.y-1,a=e.visible;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x-3+Q[r()],a=e.y-2+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`ellipse`);return Z(t,`width`,3),Z(t,`height`,3),Z(t,`fillColor`,0),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var i=e.x+4+Q[r()],a=e.y-1+$[r()],o=e.visible;return i!==n.e&&(n.e=Z(t,`x`,i,n.e)),a!==n.t&&(n.t=Z(t,`y`,a,n.t)),o!==n.a&&(n.a=Z(t,`visible`,o,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function gn(e){return[(()=>{var t=X(`rectangle`);return Z(t,`width`,14),Z(t,`height`,14),Z(t,`fillColor`,56746),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x,i=e.y,a=e.dir*90;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`angle`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,6),Z(t,`height`,6),Z(t,`fillColor`,16777215),Z(t,`origin`,.5),Z(t,`depth`,7),Y(n=>{var r=e.x+Q[e.dir]*5,i=e.y+$[e.dir]*5;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),n},{e:void 0,t:void 0}),t})(),(()=>{var t=X(`rectangle`);return Z(t,`width`,4),Z(t,`height`,10),Z(t,`fillColor`,34918),Z(t,`origin`,.5),Z(t,`depth`,6),Y(n=>{var r=e.x-Q[e.dir]*6,i=e.y-$[e.dir]*6,a=e.dir*90;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`angle`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})()]}function _n(e){let t=Pt().input.keyboard;return t.on(`keydown-LEFT`,e.onLeft),t.on(`keydown-RIGHT`,e.onRight),t.on(`keydown-UP`,e.onUp),t.on(`keydown-DOWN`,e.onDown),t.on(`keydown-SPACE`,e.onSpace),null}function vn(){let e=sn(),[t,n]=j(0),[r,i]=j(3),[a,o]=j(`ready`),[s,c]=j(!1),[l,u]=j(0),[d,f]=j(0),[p,m]=j(0),h=Array.from({length:4},()=>({x:j(0),y:j(0),dir:j(0),frightened:j(!1),visible:j(!0)})),[g,_]=j(0),v=[];for(let t=0;t{let e=0;for(let t=0;t0&&e++;return e}),b=e.playerStart[0],x=e.playerStart[1],S=0,C=0,w=0,T={lerpC:b,lerpR:x},E=[],D=[10,11],O=0,k=0,A=[[`scatter`,7e3],[`chase`,2e4],[`scatter`,7e3],[`chase`,2e4],[`scatter`,5e3],[`chase`,2e4],[`scatter`,5e3],[`chase`,1/0]],M=0,F=!1;for(let t=0;t<4;t++){let n=e.ghostHome[t]??[10,11];E.push({col:n[0],row:n[1],dir:3,progress:0,mode:`scatter`,homeCol:n[0],homeRow:n[1],startDelay:t*3e3,lerpC:n[0],lerpR:n[1]})}let I=()=>{let e=a();return e===`ready`?[`NULL POW!`,`#00ddaa`,`ARROW KEYS TO MOVE — SPACE TO START`]:e===`dead`?[`NullPointerException`,`#ff3333`,`score: ${t()} — SPACE to retry`]:e===`win`?[`GARBAGE COLLECTED!`,`#00ff88`,`score: ${t()} — all data recovered`]:null};function L(t,n,r){let i=-1,a=1/0,o=(t.dir+2)%4;for(let s=0;s<4;s++){if(s===o)continue;let c=ln(t.col+Q[s]),l=t.row+$[s];if(!cn(e.walls,c,l)||qt[l]?.[c]===`-`&&t.mode!==`eaten`&&t.row<=9)continue;let u=dn(c,l,n,r);u{n(0),i(3),B(),z(),o(`play`)})}function H(){c(!0);let e=r()-1;if(e<=0)P(()=>{i(0),o(`dead`)});else{P(()=>{i(e)}),z(),setTimeout(()=>{c(!1)},800);return}setTimeout(()=>c(!1),1200)}function U(t){if(t.dir=(t.dir+2)%4,t.progress>0&&(t.progress=1-t.progress),!cn(e.walls,ln(t.col+Q[t.dir]),t.row+$[t.dir])){t.progress=0;for(let n=0;n<4;n++)if(cn(e.walls,ln(t.col+Q[n]),t.row+$[n])){t.dir=n;break}}}function W(){F=!0,M=nn;for(let e of E)e.mode!==`eaten`&&(e.mode=`frightened`,U(e))}function G(){return Gt({sources:()=>E,targets:()=>[T],getPosition:e=>({x:e.lerpC,y:e.lerpR}),threshold:.8,mode:`all`,onOverlap:e=>{e.mode===`frightened`?(e.mode=`eaten`,n(e=>e+200)):e.mode!==`eaten`&&H()}}),null}let ee=0,K=()=>{Je({phase:a(),score:t(),lives:r(),totalDots:y(),playerCol:b,playerRow:x,playerDir:S,ghostModes:E.map(e=>e.mode),frightActive:F})},te=(t,r)=>{if(ee-=r,ee<=0&&(ee=200,K()),a()!==`play`)return;let i=Math.min(r/1e3,.05);if(!F){O+=r;let[,e]=A[k];if(O>=e&&k=1){if(--w,b=ln(b+Q[S]),x+=$[S],x>=0&&x=0&&be+10)):e===2&&(v[x][b][1](0),n(e=>e+50),W())}let t=ln(b+Q[C]),r=x+$[C];cn(e.walls,t,r)&&(S=C);let i=ln(b+Q[S]),a=x+$[S];cn(e.walls,i,a)||(w=0)}let s=b+Q[S]*w,c=x+$[S]*w;T.lerpC=s,T.lerpR=c;let[l,d]=un(s,c);u(l),f(d),m(S);for(let t=0;t0){n.startDelay-=r,n.lerpC=n.col,n.lerpR=n.row;let[e,i]=un(n.col,n.row);h[t].x[1](e),h[t].y[1](i),h[t].dir[1](n.dir),h[t].frightened[1](n.mode===`frightened`);continue}let a=n.mode===`frightened`?tn:n.mode===`eaten`?$t*2:en;if(n.progress+=a*i,n.progress>=1){--n.progress;let r=ln(n.col+Q[n.dir]),i=n.row+$[n.dir];cn(e.walls,r,i)?(n.col=r,n.row=i):n.progress=0;let a;if(n.mode===`chase`)a=R(n,t);else if(n.mode===`scatter`)a=on[t].scatterTarget;else if(n.mode===`eaten`){if(a=[D[0],D[1]],n.col===D[0]&&n.row===D[1]){let[e]=A[k];n.mode=F?`frightened`:e,n.mode===`chase`?a=R(n,t):n.mode===`scatter`&&(a=on[t].scatterTarget)}}else{let t=(n.dir+2)%4,r=[0,1,2,3].filter(r=>{if(r===t)return!1;let i=ln(n.col+Q[r]),a=n.row+$[r];return cn(e.walls,i,a)});r.length>0?n.dir=r[Math.floor(Math.random()*r.length)]:cn(e.walls,ln(n.col+Q[t]),n.row+$[t])&&(n.dir=t),a=[n.col+Q[n.dir],n.row+$[n.dir]]}n.mode!==`frightened`&&(n.dir=L(n,a[0],a[1]));let o=ln(n.col+Q[n.dir]),s=n.row+$[n.dir];cn(e.walls,o,s)||(n.progress=0)}n.lerpC=n.col+Q[n.dir]*n.progress,n.lerpR=n.row+$[n.dir]*n.progress;let[o,s]=un(n.lerpC,n.lerpR);h[t].x[1](o),h[t].y[1](s),h[t].dir[1](n.dir),h[t].frightened[1](n.mode===`frightened`),t===3&&_(performance.now())}y()===0&&P(()=>{o(`win`)})},ne=[];for(let t=0;t0){let[r,i]=un(n,t);re.push({r:t,c:n,px:r,py:i,type:e.dots[t][n]})}return Ct(zt,{width:Xt,height:Zt,backgroundColor:rn,parent:`game-container`,get children(){return[Ct(Ht,{onUpdate:te}),Ct(G,{}),Ct(_n,{onLeft:()=>{C=2},onRight:()=>{C=0},onUp:()=>{C=3},onDown:()=>{C=1},onSpace:()=>{let e=a();(e===`ready`||e===`dead`||e===`win`)&&V()}}),(()=>{var e=X(`rectangle`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2),Z(e,`width`,Xt),Z(e,`height`,Zt),Z(e,`fillColor`,0),Z(e,`origin`,.5),Z(e,`depth`,0),e})(),St(()=>ne.map(e=>(()=>{var t=X(`rectangle`);return Z(t,`width`,23),Z(t,`height`,23),Z(t,`fillColor`,2245802),Z(t,`origin`,.5),Z(t,`depth`,1),Y(n=>{var r=e.px,i=e.py;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),n},{e:void 0,t:void 0}),t})())),St(()=>re.map(e=>e.type===1?(()=>{var t=X(`ellipse`);return Z(t,`width`,4),Z(t,`height`,4),Z(t,`fillColor`,8947848),Z(t,`origin`,.5),Z(t,`depth`,2),Y(n=>{var r=e.px,i=e.py,a=v[e.r][e.c][0]()>0;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})():(()=>{var t=X(`ellipse`);return Z(t,`width`,10),Z(t,`height`,10),Z(t,`fillColor`,16763904),Z(t,`origin`,.5),Z(t,`depth`,2),Y(n=>{var r=e.px,i=e.py,a=v[e.r][e.c][0]()>0;return r!==n.e&&(n.e=Z(t,`x`,r,n.e)),i!==n.t&&(n.t=Z(t,`y`,i,n.t)),a!==n.a&&(n.a=Z(t,`visible`,a,n.a)),n},{e:void 0,t:void 0,a:void 0}),t})())),Ct(gn,{get x(){return l()},get y(){return d()},get dir(){return p()}}),Ct(fn,{get x(){return h[0].x[0]()},get y(){return h[0].y[0]()},get dir(){return h[0].dir[0]()},get frightened(){return h[0].frightened[0]()},get visible(){return h[0].visible[0]()}}),Ct(pn,{get x(){return h[1].x[0]()},get y(){return h[1].y[0]()},get dir(){return h[1].dir[0]()},get frightened(){return h[1].frightened[0]()},get visible(){return h[1].visible[0]()}}),Ct(mn,{get x(){return h[2].x[0]()},get y(){return h[2].y[0]()},get dir(){return h[2].dir[0]()},get frightened(){return h[2].frightened[0]()},get visible(){return h[2].visible[0]()}}),Ct(hn,{get x(){return h[3].x[0]()},get y(){return h[3].y[0]()},get dir(){return h[3].dir[0]()},get frightened(){return h[3].frightened[0]()},get visible(){return h[3].visible[0]()},get time(){return g()}}),(()=>{var e=X(`text`);return Z(e,`x`,8),Z(e,`y`,16),Z(e,`fontSize`,16),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#00ddaa`),Z(e,`originX`,0),Z(e,`originY`,.5),Z(e,`depth`,10),Y(n=>Z(e,`text`,`*ptr → ${t()}`,n)),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt-8),Z(e,`y`,16),Z(e,`fontSize`,16),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#00ddaa`),Z(e,`originX`,1),Z(e,`originY`,.5),Z(e,`depth`,10),Y(t=>Z(e,`text`,`ptr `.repeat(r()),t)),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,16),Z(e,`text`,`NULL POW!`),Z(e,`fontSize`,14),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#444444`),Z(e,`origin`,.5),Z(e,`depth`,10),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2-10),Z(e,`text`,`ガッ!`),Z(e,`fontSize`,36),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#ff3333`),Z(e,`origin`,.5),Z(e,`depth`,11),Y(t=>Z(e,`visible`,s(),t)),e})(),Ct(Ut,{get when(){return a()!==`play`},get children(){return[(()=>{var e=X(`rectangle`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2),Z(e,`width`,280),Z(e,`height`,100),Z(e,`fillColor`,0),Z(e,`origin`,.5),Z(e,`depth`,9),Z(e,`alpha`,.9),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2-14),Z(e,`fontSize`,22),Z(e,`fontFamily`,`monospace`),Z(e,`origin`,.5),Z(e,`depth`,10),Y(t=>{var n=I()?I()[0]:``,r=I()?I()[1]:`#ffffff`;return n!==t.e&&(t.e=Z(e,`text`,n,t.e)),r!==t.t&&(t.t=Z(e,`color`,r,t.t)),t},{e:void 0,t:void 0}),e})(),(()=>{var e=X(`text`);return Z(e,`x`,Xt/2),Z(e,`y`,Zt/2+14),Z(e,`fontSize`,12),Z(e,`fontFamily`,`monospace`),Z(e,`color`,`#666666`),Z(e,`origin`,.5),Z(e,`depth`,10),Y(t=>Z(e,`text`,I()?I()[2]:``,t)),e})()]}})]}})}A(()=>{let e=vn();e instanceof HTMLElement&&document.getElementById(`game-container`)?.appendChild(e)}); \ No newline at end of file diff --git a/examples/null-pow/dist/index.html b/examples/null-pow/dist/index.html index 3aa6f8d..1deaa64 100644 --- a/examples/null-pow/dist/index.html +++ b/examples/null-pow/dist/index.html @@ -35,7 +35,7 @@ } .footer a { color: #00cc88; text-decoration: none; } - +
diff --git a/examples/null-pow/vite.config.ts b/examples/null-pow/vite.config.ts index 3bf83b7..d0cd3b5 100644 --- a/examples/null-pow/vite.config.ts +++ b/examples/null-pow/vite.config.ts @@ -18,6 +18,7 @@ export default defineConfig({ "solidion/ecs": resolve(__dirname, "../../src/ecs/index.ts"), "solidion/core": resolve(__dirname, "../../src/core/index.ts"), "solidion/debug": resolve(__dirname, "../../src/debug/index.ts"), + "solidion/renderer": resolve(__dirname, "../../src/renderer.ts"), "solidion": resolve(__dirname, "../../src/index.ts"), // Deduplicate solid-js: ensure both example and library code use the // same instance, AND use the browser build (not server/SSR). diff --git a/package.json b/package.json index 73cd0cf..2fe5df2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ }, "./debug": { "import": "./src/debug/index.ts" + }, + "./renderer": { + "import": "./src/renderer.ts" } }, "scripts": { diff --git a/site/src/content/docs/guides/behaviors.md b/site/src/content/docs/guides/behaviors.md index 4d0ca8f..9032d63 100644 --- a/site/src/content/docs/guides/behaviors.md +++ b/site/src/content/docs/guides/behaviors.md @@ -5,6 +5,10 @@ description: Declarative behavior components for composition Behaviors (L1c layer) provide declarative composition for common game patterns. They can be used as JSX children of game objects. +```tsx +import { SpringBehavior, OscillateBehavior, FollowBehavior, VelocityBehavior } from "solidion"; +``` + ## SpringBehavior Attach spring physics to a game object property. diff --git a/site/src/content/docs/guides/components.md b/site/src/content/docs/guides/components.md index 3b92e63..a072b8a 100644 --- a/site/src/content/docs/guides/components.md +++ b/site/src/content/docs/guides/components.md @@ -5,6 +5,10 @@ description: Built-in Solidion components Solidion provides high-level components for managing Phaser's game lifecycle. +```tsx +import { Game, Scene, Preload, Overlay, GameLoop, Show, For, Index } from "solidion"; +``` + ## Game The root component that creates a Phaser game instance. diff --git a/site/src/content/docs/guides/ecs.md b/site/src/content/docs/guides/ecs.md new file mode 100644 index 0000000..91f55a8 --- /dev/null +++ b/site/src/content/docs/guides/ecs.md @@ -0,0 +1,84 @@ +--- +title: ECS (Entity Component System) +description: Data-driven pattern for bulk entity processing +--- + +The ECS pattern (`solidion/ecs`) is for games with many entities of the same type — 10+ fish, 30+ bullets, etc. It combines SolidJS `createStore` with pure step functions and declarative `System` components. + +```tsx +import { System, forActive, createSystemFactory } from "solidion/ecs"; +import { + springStep, velocityStep, followStep, + oscillationStep, fsmStep, fsmSend, + tweenStep, tweenLerp, +} from "solidion/ecs"; +``` + +## When to use ECS vs Hooks + +| Pattern | When | +|---------|------| +| **Hooks** (`useSpring`, `useStateMachine`, ...) | Few entities (1–5), unique complex behavior per entity | +| **ECS** (`System` + step functions) | Many entities (10+), shared behavior definitions, single store | + +## Pure Step Functions + +Step functions are the same algorithms used inside `useSpring`, `useOscillation`, etc., extracted as pure functions for bulk processing. They take current state + config + delta time, and return the next state. + +```tsx +import { springStep, type SpringState, type SpringConfig } from "solidion/ecs"; + +// Advance a spring by delta seconds +const next: SpringState = springStep( + { x: 0, y: 0, vx: 0, vy: 0 }, + { targetX: 100, targetY: 200, stiffness: 120, damping: 14 }, + 1 / 60, +); +``` + +Available step functions: + +| Function | Description | +|----------|-------------| +| `springStep` | Damped spring simulation | +| `oscillationStep` | Sine-wave oscillation | +| `velocityStep` | Velocity + acceleration + bounds/bounce | +| `followStep` | Exponential decay toward a target | +| `fsmStep` / `fsmSend` | Finite state machine transitions | +| `tweenStep` / `tweenLerp` | Tween interpolation | + +## System Component + +`System` registers a per-frame callback. Place it inside `` or `` — JSX child order determines execution order. + +```tsx +const [store, setStore] = createStore({ fish: [...] }); + + + phase() === "play"} + update={(time, delta) => { + forActive(store.fish, (f, i) => { + const next = springStep(f, f.config, delta / 1000); + setStore("fish", i, next); + }); + }} + /> + +``` + +## forActive + +Helper to iterate only active entities in a store array: + +```tsx +forActive(store.entities, (entity, index) => { + // Only called for entities where entity.active !== false + const next = velocityStep(entity, entity.config, delta / 1000); + setStore("entities", index, next); +}); +``` + +## Full Example + +See [examples/aquarium/](https://github.com/penta2himajin/solidion/tree/main/examples/aquarium) for a complete hybrid ECS + hooks demo with fish, food, bubbles, and more. diff --git a/site/src/content/docs/guides/hooks.md b/site/src/content/docs/guides/hooks.md index efbb1eb..1530737 100644 --- a/site/src/content/docs/guides/hooks.md +++ b/site/src/content/docs/guides/hooks.md @@ -5,6 +5,11 @@ description: Solidion hooks for animations, state machines, and more Solidion provides hooks (L1a layer) that integrate Phaser features with SolidJS reactivity. +```tsx +import { useTween, useStateMachine, useSequence, useOverlap } from "solidion"; // L1a +import { useSpring, useFollow, useOscillation, useVelocity } from "solidion"; // L1b +``` + ## useTween Animate properties with Phaser tweens, controlled reactively. diff --git a/site/src/content/docs/ja/guides/behaviors.md b/site/src/content/docs/ja/guides/behaviors.md index 42eaf6f..bff817c 100644 --- a/site/src/content/docs/ja/guides/behaviors.md +++ b/site/src/content/docs/ja/guides/behaviors.md @@ -5,6 +5,10 @@ description: コンポジション用の宣言的Behaviorコンポーネント Behaviors(L1cレイヤー)は一般的なゲームパターンのための宣言的なコンポジションを提供します。ゲームオブジェクトのJSX子要素として使用できます。 +```tsx +import { SpringBehavior, OscillateBehavior, FollowBehavior, VelocityBehavior } from "solidion"; +``` + ## SpringBehavior ゲームオブジェクトのプロパティにスプリング物理を付与します。 diff --git a/site/src/content/docs/ja/guides/components.md b/site/src/content/docs/ja/guides/components.md index 57bae6e..dbbc494 100644 --- a/site/src/content/docs/ja/guides/components.md +++ b/site/src/content/docs/ja/guides/components.md @@ -5,6 +5,10 @@ description: Solidionの組み込みコンポーネント SolidionはPhaserのゲームライフサイクルを管理するための高レベルコンポーネントを提供します。 +```tsx +import { Game, Scene, Preload, Overlay, GameLoop, Show, For, Index } from "solidion"; +``` + ## Game Phaserゲームインスタンスを作成するルートコンポーネントです。 diff --git a/site/src/content/docs/ja/guides/ecs.md b/site/src/content/docs/ja/guides/ecs.md new file mode 100644 index 0000000..8d6671f --- /dev/null +++ b/site/src/content/docs/ja/guides/ecs.md @@ -0,0 +1,84 @@ +--- +title: ECS(Entity Component System) +description: 大量エンティティ処理のためのデータ駆動パターン +--- + +ECSパターン(`solidion/ecs`)は、同じ種類のエンティティが大量にあるゲーム向けです — 10匹以上の魚、30発以上の弾丸など。SolidJSの`createStore`と純粋なステップ関数、宣言的な`System`コンポーネントを組み合わせます。 + +```tsx +import { System, forActive, createSystemFactory } from "solidion/ecs"; +import { + springStep, velocityStep, followStep, + oscillationStep, fsmStep, fsmSend, + tweenStep, tweenLerp, +} from "solidion/ecs"; +``` + +## ECS vs Hooksの使い分け + +| パターン | 使用場面 | +|---------|---------| +| **Hooks**(`useSpring`、`useStateMachine`など) | 少数のエンティティ(1〜5)、エンティティごとに固有の複雑な動作 | +| **ECS**(`System` + ステップ関数) | 多数のエンティティ(10+)、共通の動作定義、単一ストア | + +## 純粋ステップ関数 + +ステップ関数は`useSpring`や`useOscillation`などの内部で使われているアルゴリズムと同じものを、バルク処理用の純粋関数として抽出したものです。現在の状態 + 設定 + デルタ時間を受け取り、次の状態を返します。 + +```tsx +import { springStep, type SpringState, type SpringConfig } from "solidion/ecs"; + +// スプリングをdelta秒分進める +const next: SpringState = springStep( + { x: 0, y: 0, vx: 0, vy: 0 }, + { targetX: 100, targetY: 200, stiffness: 120, damping: 14 }, + 1 / 60, +); +``` + +利用可能なステップ関数: + +| 関数 | 説明 | +|------|------| +| `springStep` | 減衰スプリングシミュレーション | +| `oscillationStep` | サイン波オシレーション | +| `velocityStep` | 速度 + 加速度 + 境界/バウンス | +| `followStep` | ターゲットへの指数関数的減衰 | +| `fsmStep` / `fsmSend` | 有限ステートマシン遷移 | +| `tweenStep` / `tweenLerp` | トゥイーン補間 | + +## Systemコンポーネント + +`System`はフレームごとのコールバックを登録します。``または``内に配置してください — JSXの子要素の順序が実行順序を決定します。 + +```tsx +const [store, setStore] = createStore({ fish: [...] }); + + + phase() === "play"} + update={(time, delta) => { + forActive(store.fish, (f, i) => { + const next = springStep(f, f.config, delta / 1000); + setStore("fish", i, next); + }); + }} + /> + +``` + +## forActive + +ストア配列内のアクティブなエンティティのみを反復するヘルパー: + +```tsx +forActive(store.entities, (entity, index) => { + // entity.active !== false のエンティティのみ呼ばれる + const next = velocityStep(entity, entity.config, delta / 1000); + setStore("entities", index, next); +}); +``` + +## 完全な例 + +[examples/aquarium/](https://github.com/penta2himajin/solidion/tree/main/examples/aquarium)でECS + hooksのハイブリッドデモ(魚、餌、泡など)の完全な例をご覧ください。 diff --git a/site/src/content/docs/ja/guides/hooks.md b/site/src/content/docs/ja/guides/hooks.md index b178fd5..1b1b581 100644 --- a/site/src/content/docs/ja/guides/hooks.md +++ b/site/src/content/docs/ja/guides/hooks.md @@ -5,6 +5,11 @@ description: アニメーション、ステートマシンなどのSolidion hook SolidionはPhaserの機能をSolidJSのリアクティビティと統合するhooks(L1aレイヤー)を提供します。 +```tsx +import { useTween, useStateMachine, useSequence, useOverlap } from "solidion"; // L1a +import { useSpring, useFollow, useOscillation, useVelocity } from "solidion"; // L1b +``` + ## useTween Phaserトゥイーンでプロパティをアニメーション、リアクティブに制御します。 From a8c8f33d67fae300f768e255fc36167954c8f1c8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Mar 2026 02:12:08 +0000 Subject: [PATCH 2/2] Add ECS guide to sidebar navigation https://claude.ai/code/session_013XHS9XjPJ3tkMikyjVXNUC --- site/astro.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/site/astro.config.mjs b/site/astro.config.mjs index 6d8c33e..d966355 100644 --- a/site/astro.config.mjs +++ b/site/astro.config.mjs @@ -40,6 +40,7 @@ export default defineConfig({ { slug: "guides/components" }, { slug: "guides/hooks" }, { slug: "guides/behaviors" }, + { slug: "guides/ecs" }, ], }, {