diff options
Diffstat (limited to '2026')
310 files changed, 11168 insertions, 1511 deletions
diff --git a/2026/framing/dist/game_lib-a509343dd3244dc8.js b/2026/framing/dist/game_lib-756716c85f227e5e.js index 51c21fe..51c21fe 100644 --- a/2026/framing/dist/game_lib-a509343dd3244dc8.js +++ b/2026/framing/dist/game_lib-756716c85f227e5e.js diff --git a/2026/framing/dist/game_lib-a509343dd3244dc8_bg.wasm b/2026/framing/dist/game_lib-756716c85f227e5e_bg.wasm Binary files differindex e109adf..ef0aad6 100644 --- a/2026/framing/dist/game_lib-a509343dd3244dc8_bg.wasm +++ b/2026/framing/dist/game_lib-756716c85f227e5e_bg.wasm diff --git a/2026/framing/dist/index.html b/2026/framing/dist/index.html index ae8ba12..8c53213 100644 --- a/2026/framing/dist/index.html +++ b/2026/framing/dist/index.html @@ -6,8 +6,8 @@ <meta charset="UTF-8"> <script type="module"> -import init, * as bindings from '/framing/dist/game_lib-a509343dd3244dc8.js'; -const wasm = await init({ module_or_path: '/framing/dist/game_lib-a509343dd3244dc8_bg.wasm' }); +import init, * as bindings from '/framing/dist/game_lib-756716c85f227e5e.js'; +const wasm = await init({ module_or_path: '/framing/dist/game_lib-756716c85f227e5e_bg.wasm' }); window.wasmBindings = bindings; @@ -23,7 +23,7 @@ dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}})); <link rel="icon" href="data:;base64,iVBORw0KGgo="> <link rel="stylesheet" href="/framing/dist/index-1e3cd2ca0ba4d1ec.css" integrity="sha384-1q3UDTmLdOyf9/QxW+Imap//HWhTWNfvn7j2iwuUap3HSD6IOGG7pDS9VJMk7nKv"/> <title>TODO TITLE</title> - <link rel="modulepreload" href="/framing/dist/game_lib-a509343dd3244dc8.js" crossorigin="anonymous" integrity="sha384-kETWGSRk6mu21Pl7hsEBpB7eWp9Jg8dJ0WfMsHTslM4gPgB1ny4BccJxZQiG/rOL"><link rel="modulepreload" href="/framing/dist/snippets/game_lib-09da6449fcb9d06e/src/bindings.js" crossorigin="anonymous" integrity="sha384-OqSoI1U/qGAdOIY23X7G4HXgi2h6nb8jbT8RiF1LDHgJg7UPDyGz1ZQ/rgmUg4ue"><link rel="modulepreload" href="/framing/dist/snippets/teleia-727bf4351691f1c8/src/helpers.js" crossorigin="anonymous" integrity="sha384-HhtEY2WfGmhyPUSRWKZvqsRxYsdT/DLEdFUqWyDZt6G6lrNHmE1zMlw4BJ3RycRd"><link rel="preload" href="/framing/dist/game_lib-a509343dd3244dc8_bg.wasm" crossorigin="anonymous" integrity="sha384-mznY6+bfU5XIP79YSpHzuNd37ePGUT6ozIc4RfEodpnBunxBglkgO6wq31LV8Ddq" as="fetch" type="application/wasm"></head> + <link rel="modulepreload" href="/framing/dist/game_lib-756716c85f227e5e.js" crossorigin="anonymous" integrity="sha384-kETWGSRk6mu21Pl7hsEBpB7eWp9Jg8dJ0WfMsHTslM4gPgB1ny4BccJxZQiG/rOL"><link rel="modulepreload" href="/framing/dist/snippets/teleia-727bf4351691f1c8/src/helpers.js" crossorigin="anonymous" integrity="sha384-HhtEY2WfGmhyPUSRWKZvqsRxYsdT/DLEdFUqWyDZt6G6lrNHmE1zMlw4BJ3RycRd"><link rel="modulepreload" href="/framing/dist/snippets/game_lib-09da6449fcb9d06e/src/bindings.js" crossorigin="anonymous" integrity="sha384-OqSoI1U/qGAdOIY23X7G4HXgi2h6nb8jbT8RiF1LDHgJg7UPDyGz1ZQ/rgmUg4ue"><link rel="preload" href="/framing/dist/game_lib-756716c85f227e5e_bg.wasm" crossorigin="anonymous" integrity="sha384-iM/1P6P3lvXgnPMw0tt4ocjj6nBFBjHbULHKLD27+v172BszheW1lu2oltfrpEnw" as="fetch" type="application/wasm"></head> <body> <script type="module"> window.addEventListener("TrunkApplicationStarted", async (event) => { diff --git a/2026/games_submissions/cammymoop/LICENSE.md b/2026/games_submissions/cammymoop/LICENSE.md deleted file mode 100644 index ba42d61..0000000 --- a/2026/games_submissions/cammymoop/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Cammymoop, Cammymoop Games - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/2026/games_submissions/cammymoop/assets/arrow_icon.png b/2026/games_submissions/cammymoop/assets/arrow_icon.png Binary files differdeleted file mode 100644 index 8710491..0000000 --- a/2026/games_submissions/cammymoop/assets/arrow_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/background.ase b/2026/games_submissions/cammymoop/assets/background.ase Binary files differdeleted file mode 100644 index 331372e..0000000 --- a/2026/games_submissions/cammymoop/assets/background.ase +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/background.png b/2026/games_submissions/cammymoop/assets/background.png Binary files differdeleted file mode 100644 index 2571201..0000000 --- a/2026/games_submissions/cammymoop/assets/background.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/bomb_gnome.ase b/2026/games_submissions/cammymoop/assets/bomb_gnome.ase Binary files differdeleted file mode 100644 index c599499..0000000 --- a/2026/games_submissions/cammymoop/assets/bomb_gnome.ase +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/bomb_gnome.png b/2026/games_submissions/cammymoop/assets/bomb_gnome.png Binary files differdeleted file mode 100644 index 0fe6731..0000000 --- a/2026/games_submissions/cammymoop/assets/bomb_gnome.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/boom_icon.png b/2026/games_submissions/cammymoop/assets/boom_icon.png Binary files differdeleted file mode 100644 index 0d85429..0000000 --- a/2026/games_submissions/cammymoop/assets/boom_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/boom_icon1.png b/2026/games_submissions/cammymoop/assets/boom_icon1.png Binary files differdeleted file mode 100644 index 86cdec1..0000000 --- a/2026/games_submissions/cammymoop/assets/boom_icon1.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/boom_icon2.png b/2026/games_submissions/cammymoop/assets/boom_icon2.png Binary files differdeleted file mode 100644 index b2d2b9c..0000000 --- a/2026/games_submissions/cammymoop/assets/boom_icon2.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/dice.ase b/2026/games_submissions/cammymoop/assets/dice.ase Binary files differdeleted file mode 100644 index 3f51c58..0000000 --- a/2026/games_submissions/cammymoop/assets/dice.ase +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/dice_6.png b/2026/games_submissions/cammymoop/assets/dice_6.png Binary files differdeleted file mode 100644 index ed2c319..0000000 --- a/2026/games_submissions/cammymoop/assets/dice_6.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/dice_icon.png b/2026/games_submissions/cammymoop/assets/dice_icon.png Binary files differdeleted file mode 100644 index e1fb6a3..0000000 --- a/2026/games_submissions/cammymoop/assets/dice_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/dices.png b/2026/games_submissions/cammymoop/assets/dices.png Binary files differdeleted file mode 100644 index 7921e58..0000000 --- a/2026/games_submissions/cammymoop/assets/dices.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/equal_icon.png b/2026/games_submissions/cammymoop/assets/equal_icon.png Binary files differdeleted file mode 100644 index 012fd4b..0000000 --- a/2026/games_submissions/cammymoop/assets/equal_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/explosion.ase b/2026/games_submissions/cammymoop/assets/explosion.ase Binary files differdeleted file mode 100644 index f9ca536..0000000 --- a/2026/games_submissions/cammymoop/assets/explosion.ase +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/explosion.png b/2026/games_submissions/cammymoop/assets/explosion.png Binary files differdeleted file mode 100644 index dac7828..0000000 --- a/2026/games_submissions/cammymoop/assets/explosion.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/gob_small.ase b/2026/games_submissions/cammymoop/assets/gob_small.ase Binary files differdeleted file mode 100644 index a5fe0f5..0000000 --- a/2026/games_submissions/cammymoop/assets/gob_small.ase +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/gob_small.png b/2026/games_submissions/cammymoop/assets/gob_small.png Binary files differdeleted file mode 100644 index c94354a..0000000 --- a/2026/games_submissions/cammymoop/assets/gob_small.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/gob_small_pieces.png b/2026/games_submissions/cammymoop/assets/gob_small_pieces.png Binary files differdeleted file mode 100644 index eac616b..0000000 --- a/2026/games_submissions/cammymoop/assets/gob_small_pieces.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/goblin.png b/2026/games_submissions/cammymoop/assets/goblin.png Binary files differdeleted file mode 100644 index e7f3822..0000000 --- a/2026/games_submissions/cammymoop/assets/goblin.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/greater_icon.png b/2026/games_submissions/cammymoop/assets/greater_icon.png Binary files differdeleted file mode 100644 index 0ac1251..0000000 --- a/2026/games_submissions/cammymoop/assets/greater_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/guard_break_icon.png b/2026/games_submissions/cammymoop/assets/guard_break_icon.png Binary files differdeleted file mode 100644 index 0dbc3da..0000000 --- a/2026/games_submissions/cammymoop/assets/guard_break_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/image.png b/2026/games_submissions/cammymoop/assets/image.png Binary files differdeleted file mode 100644 index 62407b7..0000000 --- a/2026/games_submissions/cammymoop/assets/image.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/less_icon.png b/2026/games_submissions/cammymoop/assets/less_icon.png Binary files differdeleted file mode 100644 index f063b3a..0000000 --- a/2026/games_submissions/cammymoop/assets/less_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/number_icons.png b/2026/games_submissions/cammymoop/assets/number_icons.png Binary files differdeleted file mode 100644 index e714c8a..0000000 --- a/2026/games_submissions/cammymoop/assets/number_icons.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/ohno.png b/2026/games_submissions/cammymoop/assets/ohno.png Binary files differdeleted file mode 100644 index 210bbdb..0000000 --- a/2026/games_submissions/cammymoop/assets/ohno.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/red_circle.png b/2026/games_submissions/cammymoop/assets/red_circle.png Binary files differdeleted file mode 100644 index 3eca92a..0000000 --- a/2026/games_submissions/cammymoop/assets/red_circle.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/reroll.png b/2026/games_submissions/cammymoop/assets/reroll.png Binary files differdeleted file mode 100644 index 95c2d0c..0000000 --- a/2026/games_submissions/cammymoop/assets/reroll.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/boom.wav b/2026/games_submissions/cammymoop/assets/sfx/boom.wav Binary files differdeleted file mode 100644 index b1faed0..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/boom.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/crack.wav b/2026/games_submissions/cammymoop/assets/sfx/crack.wav Binary files differdeleted file mode 100644 index 191da72..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/crack.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/fwoof.wav b/2026/games_submissions/cammymoop/assets/sfx/fwoof.wav Binary files differdeleted file mode 100644 index 12d62cb..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/fwoof.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt1.wav b/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt1.wav Binary files differdeleted file mode 100644 index 3850ca3..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt1.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt2.wav b/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt2.wav Binary files differdeleted file mode 100644 index 7160578..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt2.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt3.wav b/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt3.wav Binary files differdeleted file mode 100644 index 0fdf5b0..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/gnome_grunt3.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/gob1.wav b/2026/games_submissions/cammymoop/assets/sfx/gob1.wav Binary files differdeleted file mode 100644 index ae2e547..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/gob1.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/gob2.wav b/2026/games_submissions/cammymoop/assets/sfx/gob2.wav Binary files differdeleted file mode 100644 index 19088ad..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/gob2.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/gob_grunt.wav b/2026/games_submissions/cammymoop/assets/sfx/gob_grunt.wav Binary files differdeleted file mode 100644 index 1115010..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/gob_grunt.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/hoo.wav b/2026/games_submissions/cammymoop/assets/sfx/hoo.wav Binary files differdeleted file mode 100644 index d726329..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/hoo.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/land.wav b/2026/games_submissions/cammymoop/assets/sfx/land.wav Binary files differdeleted file mode 100644 index 0b4070d..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/land.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/laugh1.wav b/2026/games_submissions/cammymoop/assets/sfx/laugh1.wav Binary files differdeleted file mode 100644 index 1a5224b..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/laugh1.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/laugh2.wav b/2026/games_submissions/cammymoop/assets/sfx/laugh2.wav Binary files differdeleted file mode 100644 index 60eb4d7..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/laugh2.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/sfx/punch.wav b/2026/games_submissions/cammymoop/assets/sfx/punch.wav Binary files differdeleted file mode 100644 index b53cf61..0000000 --- a/2026/games_submissions/cammymoop/assets/sfx/punch.wav +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/skull_icon.png b/2026/games_submissions/cammymoop/assets/skull_icon.png Binary files differdeleted file mode 100644 index 95f9fa3..0000000 --- a/2026/games_submissions/cammymoop/assets/skull_icon.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/stopwatch.ase b/2026/games_submissions/cammymoop/assets/stopwatch.ase Binary files differdeleted file mode 100644 index 6b03dfd..0000000 --- a/2026/games_submissions/cammymoop/assets/stopwatch.ase +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/stopwatch_frame.png b/2026/games_submissions/cammymoop/assets/stopwatch_frame.png Binary files differdeleted file mode 100644 index c6cbaee..0000000 --- a/2026/games_submissions/cammymoop/assets/stopwatch_frame.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/stopwatch_numbers.png b/2026/games_submissions/cammymoop/assets/stopwatch_numbers.png Binary files differdeleted file mode 100644 index 96e82d8..0000000 --- a/2026/games_submissions/cammymoop/assets/stopwatch_numbers.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/target_arrow.png b/2026/games_submissions/cammymoop/assets/target_arrow.png Binary files differdeleted file mode 100644 index 8ffcab3..0000000 --- a/2026/games_submissions/cammymoop/assets/target_arrow.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/assets/yes.png b/2026/games_submissions/cammymoop/assets/yes.png Binary files differdeleted file mode 100644 index 2355676..0000000 --- a/2026/games_submissions/cammymoop/assets/yes.png +++ /dev/null diff --git a/2026/games_submissions/cammymoop/index.html b/2026/games_submissions/cammymoop/index.html deleted file mode 100644 index 9c79b61..0000000 --- a/2026/games_submissions/cammymoop/index.html +++ /dev/null @@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> - -<head> - <script>const M = {}</script> - - <script src="/lib/phaser.min.js"></script> - <script type="module" src="/js/goblin.js"></script> - <script type="module" src="/js/hints.js"></script> - <script type="module" src="/js/stopwatch.js"></script> - <script type="module" src="/js/dice_game.js"></script> -</head> - -<body style="margin: 0"> - <div id="game-container" style="margin: auto"></div> - <script type="module" src="/js/micro.js"></script> -</body> - -</html> diff --git a/2026/games_submissions/cammymoop/js/dice_game.js b/2026/games_submissions/cammymoop/js/dice_game.js deleted file mode 100644 index c040140..0000000 --- a/2026/games_submissions/cammymoop/js/dice_game.js +++ /dev/null @@ -1,621 +0,0 @@ - -function randOffset(size) { - return Math.round((Math.random() - 0.5) * 2 * size); -} - -function smoothRandOffset(size) { - return (Math.random() - 0.5) * 2 * size; -} - -M.Ease = Phaser.Math.Easing; - -const ROLL_TOTAL = 290; -const ROLL_ONCE = 60; - -const battles = [ - // difficulty tier 0 - [ - [3, "Goblin", "Goblin"], - [2, "BombGnome", "Goblin"], - [2, "BombGnome", "BombGnome"], - ], - // difficulty tier 1 - [ - [3, "Goblin", "Goblin", "BombGnome"], - [2, "Goblin", "Goblin"], - [1, "Goblin"], - [4, "ShieldGoblin"], - ], - // difficulty tier 2 - [ - [4, "ShieldGoblin", "ShieldGoblin"], - [7, "Goblin", "Goblin", "Goblin", "Goblin"], - [3, "ShieldGoblin", "BombGnome"], - [3, "Goblin", "BombGnome", "Goblin", "Goblin"], - [1, "BombGnome", "BombGnome", "BombGnome", "Goblin"], - ], - // difficulty tier 3 - [ - [2, "ShieldGoblin", "BombGnome"], - [3, "ShieldGoblin", "BombGnome", "BombGnome", "ShieldGoblin"], - [7, "Goblin", "Goblin", "Goblin", "ShieldGoblin", "Goblin"], - [7, "ShieldGoblin", "ShieldGoblin", "ShieldGoblin"], - ], - // difficulty tier 4 - [ - [3, "ShieldGoblin", "Goblin", "BombGnome"], - [6, "Goblin", "Goblin", "Goblin", "ShieldGoblin", "Goblin"], - [7, "ShieldGoblin", "ShieldGoblin", "ShieldGoblin"], - ], - // difficulty tier 5 - [ - [10, "ShieldGoblin", "ShieldGoblin", "ShieldGoblin", "ShieldGoblin", "ShieldGoblin"], - [8, "ShieldGoblin", "ShieldGoblin", "ShieldGoblin", "ShieldGoblin", "BombGnome"], - ], - -]; -const maxTier = battles.length - 1; - -const battleBags = [[],[],[],[],[], []]; - -const timerTimes = [12, 14, 16, 14, 10, 14]; - -function arrShuffle(inArr) { - return inArr.map((v) => ({v: v, r: Math.random()})).sort((a, b) => a.r - b.r).map(({v}) => v); -} - -function getBattle(tier) { - tier = Math.min(battles.length - 1, tier); - if (battleBags[tier].length < 1) { - battleBags[tier] = arrShuffle([...battles[tier]]); - } - return [...battleBags[tier].pop()]; -} - -const enemyTypes = { - "Goblin": (s) => new M.Goblin(s), - "ShieldGoblin": (s) => new M.Goblin(s, true), - "BombGnome": (s) => new M.BombGnome(s), -}; - -M.DiceGame = class extends Phaser.Scene -{ - create(data) - { - this.finished = false; - this.victory = false; - this.usedGrace = false; - - this.difficultyVal = data.difficulty; - this.tier = Math.min(maxTier, this.difficultyVal); - - this.battle = getBattle(this.tier); - this.timeLimit = timerTimes[Math.min(timerTimes.length - 1, this.tier)] - // make it a bit easier for now - this.timeLimit = Math.ceil(this.timeLimit * 1.4); - - M.gameStarted(); - - this.diceIsActive = false; - - this.justClickedLMB = false; - this.LMBWasClicked = false; - - this.bg = this.add.image(-30, -22, 'background').setOrigin(0, 0); - - this.stopwatch = new M.Stopwatch(this, this.timeLimit, new M.Vec2(26, 26)); - this.stopwatch.depth = 5; - - this.circle = this.add.image(-6000, 0, "red_circle"); - this.targetArrow = this.add.image(-6000, 0, "target_arrow"); - this.targetArrow.setOrigin(1, 0.5); - this.targetArrow.depth = 2; - - this.allEnemies = []; - - const enemySpacing = 50; - const enemyYOffset = -12; - const startOffset = ((this.battle.length - 2) / 2) * enemySpacing; - for (let i = 1; i < this.battle.length; i++) { - const newEnemy = enemyTypes[this.battle[i]](this); - const xOffset = ((i - 1) * enemySpacing) - startOffset; - newEnemy.setHomePos(this.screenCenterPos().add(new M.Vec2( - xOffset, enemyYOffset + ((i % 2) * 6) - ))); - newEnemy.addToDisplayUpdate(); - this.allEnemies.push(newEnemy); - } - - this.reroll = this.add.image(220, 132, "reroll"); - this.reroll.depth = 1; - - this.numDice = this.battle[0]; - this.allDice = []; - this.rollDice(this.numDice); - } - - screenCenterPos() { - const h_center = this.game.scale.gameSize.width / 2; - const v_center = this.game.scale.gameSize.height / 2; - return new M.Vec2(h_center, v_center); - } - - update(t, dt) { - let pickableDice = 0; - for (let dice of this.allDice) { - if (dice.throwing) { - this.updateThrownDice(dice, dt); - } else if (dice.rolling) { - dice.roll_timer += dt; - dice.roll_anim_timer += dt; - - if (dice.roll_anim_timer > ROLL_ONCE) { - dice.roll_anim_timer = 0; - let rand_side = Math.floor(Math.random() * 5); - let cur_side = parseInt(dice.frame.name); - if (rand_side >= cur_side) { - rand_side += 1; - } - dice.setFrame(rand_side); - } - - const progress = dice.roll_timer / dice.total_roll_time; - - const elevation = Math.sin(progress * Math.PI) * 38; - const rollVec = dice.roll_target_pos.clone().subtract(dice.roll_from_pos); - dice.setPosVec(dice.roll_from_pos); - dice.addPosVec(rollVec.scale(progress)); - dice.addPosVec(M.Vec2.UP.clone().scale(elevation)); - - if (dice.roll_timer >= dice.total_roll_time) { - this.sound.play('land_sfx'); - dice.total_roll_time = ROLL_TOTAL; - dice.rolling = false; - pickableDice += 1; - dice.setPosVec(dice.roll_target_pos); - this.setupRolledDice(dice); - } - } else { - pickableDice += 1; - } - } - - const activePointer = this.input.activePointer; - activePointer.updateWorldPoint(this.cameras.default); - const pVec = new M.Vec2(activePointer.worldX, activePointer.worldY); - - const clicked = activePointer.primaryDown - this.justClickedLMB = !this.LMBWasClicked && clicked - this.LMBWasClicked = clicked - - let closestEnemy = null; - let closestDice = null; - let minDist = 0; - for (let dice of this.allDice) { - if (dice.rolling) { - continue; - } - let pointerDist = pVec.distance(dice.getPosVec()); - if (pointerDist > 49 || (!dice.emphasis && pointerDist > 45)) { - continue; - } else if (!closestDice || pointerDist < minDist) { - minDist = pointerDist; - closestDice = dice; - } - } - for (let enemy of this.allEnemies) { - if (!enemy.alive) { - continue; - } - let pointerDist = pVec.distance(enemy.getPosVec()); - if (pointerDist > 49) { - continue; - } else if (!closestEnemy || pointerDist < minDist) { - minDist = pointerDist; - closestEnemy = enemy; - } - } - - if (this.isOverReroll(pVec)) { - closestDice = null; - closestEnemy = null; - if (this.justClickedLMB && pickableDice > 0) { - this.rerollUnused(); - } - } - - // If close enough to click dice or enemy and any dice is already selected, only consider enemy - if (closestDice && closestEnemy && this.diceIsActive) { - closestDice = null; - } - - let clickedDice = false; - this.changeEmphasisDice(closestDice); - if (this.justClickedLMB) { - if (closestDice && (!closestEnemy || !this.diceIsActive)) { - clickedDice = true; - this.changeActiveDice(closestDice); - } - } - for (let enemy of this.allEnemies) { - if (closestEnemy && enemy === closestEnemy) { - enemy.showHint(); - } else { - enemy.hideHint(); - } - } - - if (closestEnemy && this.diceIsActive && !clickedDice) { - const activeDice = this.getActiveDice(); - let diceToTargetVec = closestEnemy.getPosVec().subtract(activeDice.getPosVec()); - - this.targetArrow.setPosVec(closestEnemy.getPosVec()); - this.targetArrow.rotation = diceToTargetVec.angle(); - if (this.justClickedLMB) { - const activeDiceVal = this.getDiceVal(activeDice); - this.throwDice(activeDice, closestEnemy); - //closestEnemy.attack(activeDiceVal); - //this.removeDice(activeDice); - } - } else { - this.targetArrow.x = -6000 - } - - if (!this.finished) { - let aliveEnemies = this.aliveEnemiesCount(); - if (aliveEnemies < 1) { - this.nowFinished(true); - } else if (this.unusedDiceNum() < 1) { - this.nowFinished(false); - } - } - } - - aliveEnemiesCount() { - let aliveEnemies = 0; - for (let e of this.allEnemies) { - if (e.alive) { - aliveEnemies += 1; - } - } - return aliveEnemies; - } - - aliveEnemyNames() { - let names = []; - for (let e of this.allEnemies) { - if (e.alive) { - names.push(e.enemyName); - } - } - return names; - } - - nowFinished(won, fromTimer = false) { - if (this.finished) { - return; - } - this.victory = won; - if (!won) { - battleBags[this.tier].push([...this.battle]); - battleBags[this.teir] = arrShuffle(battleBags[this.tier]); - } - this.finished = true; - const timeLeft = this.stopwatch.getTimeLeft(); - - const waitForText = Math.min(timeLeft, 200); - if (waitForText <= 0) { - this.showEndText(won); - } else { - setTimeout( () => this.showEndText(won), waitForText); - } - - if (fromTimer) { - setTimeout(() => this.timeUp(), 300); - } else { - const continueDelay = Math.max(Math.min(2200, timeLeft), 300); - setTimeout(() => this.timeUp(), continueDelay); - } - } - - showEndText(won) { - const c = this.screenCenterPos(); - if (won) { - this.add.image(c.x, c.y, "yes"); - } else { - this.add.image(c.x, c.y, "ohno"); - } - } - - getDiceVal(dice) { - return parseInt(dice.frame.name) + 1; - } - - setupRolledDice(dice) { - dice.tint = 0xdddddd; - dice.emphasis = false; - dice.activeDice = false; - if (this.stopwatch.getTimeLeft() < 3500 && !this.usedGrace) { - this.grace(dice); - } - } - - grace(dice) { - const unusedCount = this.unusedDiceNum(); - const enemyNames = this.aliveEnemyNames(); - let rolledNumbers = []; - for (let otherDice of this.allDice) { - if (otherDice === dice || otherDice.throwing) { - continue; - } - rolledNumbers.push(this.getDiceVal(otherDice)); - } - if (enemyNames.length < 1) { - return; - } - if (enemyNames.includes("BombGnome")) { - if (enemyNames.length > unusedCount) { - this.usedGrace = true; - this.setDiceTo(dice, 6); - } else if (unusedCount === 1) { - this.usedGrace = true; - this.setDiceTo(dice, 2); - } - } else { - if (enemyNames.includes("ShieldGoblin")) { - this.usedGrace = true; - this.setDiceTo(dice, 3); - } else if (unusedCount === 1) { - this.usedGrace = true; - this.setDiceTo(dice, Math.floor(Math.random() * 4) + 3); - } else if (unusedCount - rolledNumbers.length === 1) { - let greaterThanTwo = false; - for (let rolledNum of rolledNumbers) { - if (rolledNum > 2) { - greaterThanTwo = true; - } - } - if (!greaterThanTwo) { - this.usedGrace = true; - this.setDiceTo(dice, 3); - } - } - } - - if (this.usedGrace) { - console.log("halleluyah"); - } - } - - setDiceTo(dice, toNum) { - dice.setFrame(toNum - 1); - } - - throwDice(dice, atEnemy) { - if (!atEnemy || !atEnemy.alive) { - return; - } - if (dice.activeDice) { - this.clearDiceActive(dice); - } - atEnemy.preattack(this.getDiceVal(dice)); - dice.throwing = true; - dice.throwingAt = atEnemy; - dice.throwFrom = dice.getPosVec(); - dice.throwTo = atEnemy.getPosVec(); - dice.throwTimer = 0; - dice.throwTotalTime = 80; - } - - updateThrownDice(dice, dt) { - dice.throwTimer += dt; - if (dice.throwTimer > dice.throwTotalTime) { - this.finishThrownDice(dice); - } else { - const progress = dice.throwTimer / dice.throwTotalTime; - dice.scale = Math.max(0.1, 1 - progress); - const delta = dice.throwTo.clone().subtract(dice.throwFrom); - dice.setPosVec(dice.throwFrom); - dice.addPosVec(delta.scale(M.Ease.Cubic.Out(progress))); - } - } - - finishThrownDice(dice) { - dice.throwingAt.attack(this.getDiceVal(dice)); - this.removeDice(dice); - } - - removeDice(dice) { - const diceIndex = this.allDice.indexOf(dice); - if (diceIndex < 0) { - return; - } - this.clearDiceActive(dice); - this.allDice.splice(diceIndex, 1); - dice.destroy(); - this.numDice = this.allDice.length; - } - - setDiceEmphasis(dice) { - if (dice.emphasis) { - return; - } - dice.emphasis = true; - dice.clearTint(); - dice.y -= 4; - } - clearDiceEmphasis(dice) { - if (!dice.emphasis) { - return; - } - dice.emphasis = false; - dice.y += 4; - if (!dice.activeDice) { - dice.tint = 0xdddddd; - } - } - - isOverReroll(pointerPos) { - const relPointer = pointerPos.clone().subtract(this.reroll.getPosVec()); - if (Math.abs(relPointer.x) * 2 > this.reroll.width) { - return false; - } else if (Math.abs(relPointer.y) * 2 > this.reroll.height) { - return false; - } - return true; - } - - setDiceActive(dice) { - dice.activeDice = true; - dice.clearTint(); - this.circle.setPosVec(dice.getPosVec()); - if (dice.emphasis) { - this.circle.y += 4; - } - } - clearDiceActive(dice) { - dice.activeDice = false; - this.circle.x = -6000; - this.diceIsActive = false; - } - - changeEmphasisDice(newEmphasis) { - for (let dice of this.allDice) { - if (dice === newEmphasis) { - this.setDiceEmphasis(dice); - } else if (dice.emphasis) { - this.clearDiceEmphasis(dice); - } - } - } - - changeActiveDice(newActiveDice) { - for (let dice of this.allDice) { - if (dice !== newActiveDice) { - this.clearDiceActive(dice); - } - } - this.diceIsActive = true; - this.setDiceActive(newActiveDice); - } - - enemyExploded(explodingEnemy) { - this.sound.play('boom_sfx'); - const enemyIndex = this.allEnemies.indexOf(explodingEnemy); - if (enemyIndex === -1) { - console.log("exploding enemy not found in allEnemies"); - return; - } - if (enemyIndex > 0) { - const leftEnemy = this.allEnemies[enemyIndex - 1]; - if (!leftEnemy.gone) { - leftEnemy.attack(8); - } - } - if (enemyIndex < this.allEnemies.length - 1) { - const rightEnemy = this.allEnemies[enemyIndex + 1]; - if (!rightEnemy.gone) { - rightEnemy.attack(8); - } - } - } - - preExplode(explodingEnemy) { - const enemyIndex = this.allEnemies.indexOf(explodingEnemy); - if (enemyIndex === -1) { - console.log("pre-exploding enemy not found in allEnemies"); - return; - } - if (enemyIndex > 0) { - const leftEnemy = this.allEnemies[enemyIndex - 1]; - if (leftEnemy.alive) { - leftEnemy.preattack(8); - } - } - if (enemyIndex < this.allEnemies.length - 1) { - const rightEnemy = this.allEnemies[enemyIndex + 1]; - if (rightEnemy.alive) { - rightEnemy.preattack(8); - } - } - } - - getActiveDice() { - if (!this.diceIsActive || this.allDice.length === 0) { - return null; - } - for (let dice of this.allDice) { - if (dice.activeDice) { - return dice; - } - } - return null; - } - - clearUnusedDice() { - const oldDice = this.allDice; - this.allDice = []; - for (let dice of oldDice) { - if (dice.throwing) { - this.allDice.push(dice); - continue; - } - if (dice.activeDice) { - this.clearDiceActive(dice); - } - dice.destroy(); - } - } - - unusedDiceNum() { - let num = 0; - for (let dice of this.allDice) { - if (!dice.throwing) { - num += 1; - } - } - return num; - } - - rerollUnused() { - let unusedNum = this.unusedDiceNum(); - this.clearUnusedDice(); - this.rollDice(unusedNum); - } - - rollDice(num) { - this.sound.play('fwoof_sfx'); - let diceSpacing = 52; - if (num > 1) { - diceSpacing = Math.min(diceSpacing, Math.round(154 / (num - 1))); - } - const center = this.screenCenterPos(); - for (let i = 0; i < num; i++) { - const xPos = Math.round(center.x - ((num - 1) * diceSpacing * 0.5) + (i * diceSpacing) - 10); - const dice = this.add.sprite(xPos, center.y + 52, 'dices'); - this.allDice.push(dice); - - dice.addPosVec(new M.Vec2(randOffset(3), randOffset(11))); - dice.roll_target_pos = dice.getPosVec(); - dice.addPosVec(new M.Vec2(randOffset(16), 30)); - dice.roll_from_pos = dice.getPosVec(); - - dice.rolling = true; - dice.roll_anim_timer = 0; - dice.roll_timer = 0; - dice.total_roll_time = ROLL_TOTAL + Math.random() * 400; - } - } - - timeUp() { - let difficulty = this.difficultyVal - if (battleBags[this.tier].length < 1) { - difficulty += 1; - M.gameDifficulty = difficulty - } - M.gameEnd(this.victory); - this.scene.switch("wait"); - this.scene.stop(); - //this.scene.restart({difficulty: difficulty}); - } -} diff --git a/2026/games_submissions/cammymoop/js/goblin.js b/2026/games_submissions/cammymoop/js/goblin.js deleted file mode 100644 index 2514cdf..0000000 --- a/2026/games_submissions/cammymoop/js/goblin.js +++ /dev/null @@ -1,521 +0,0 @@ - -M.Enemy = class extends Phaser.GameObjects.Container -{ - constructor(scene) { - super(scene); - this.sprites = {} - this.spriteNames = []; - this.homePos = M.Vec2.ZERO; - this.hint = null; - this.alive = true; - this.gone = false; - this.deathAnimating = false; - } - - setHomePos(newHomePos) { - this.setPosVec(newHomePos); - this.homePos = new M.Vec2(newHomePos.x, newHomePos.y); - } - - addToDisplayUpdate() { - this.addToDisplayList(); - this.addToUpdateList(); - } - - setupHint(height, hintData) { - this.addHintData(hintData); - this.hint.y = -height; - } - - addHintData(hintData) { - if (this.hint) { - this.remove(this.hint); - this.hint.destroy(); - } - this.hint = new M.Hint(this.scene); - this.add(this.hint); - this.hint.setup(hintData); - } - - hideHint() { - if (this.hint) { - this.hint.visible = false; - } - } - - showHint() { - if (this.hint) { - this.hint.visible = true; - } - } - - removeSprite(spriteName) { - if (!this.sprites[spriteName]) { - return; - } - if (this.exists(this.sprites[spriteName])) { - this.sprites[spriteName].destroy(); - this.remove(this.sprites[spriteName]); - } - const nameIndex = this.spriteNames.indexOf(spriteName); - if (nameIndex >= 0) { - this.spriteNames.splice(nameIndex, 1); - } - delete this.sprites[spriteName]; - } - - addSprite(spriteName, pos, textureKey, frameIdx) { - if (!pos) { - pos = {x: 0, y: 0}; - } - if (this.sprites[spriteName]) { - removeSprite(spriteName); - } - if (!this.spriteNames.includes(spriteName)) { - this.spriteNames.push(spriteName); - } - const spr = new Phaser.GameObjects.Sprite(this.scene, pos.x, pos.y, textureKey, frameIdx); - this.sprites[spriteName] = spr; - this.add(spr); - } - - tintSprites(newTint) { - for (let spName of this.spriteNames) { - this.sprites[spName].setTint(newTint); - } - } - - resetSpritesTint() { - for (let spName of this.spriteNames) { - this.sprites[spName].clearTint(); - } - } - - preUpdate (t, dt) { - super.preUpdate(t, dt); - } - - attack(diceValue) { - console.log("base enemy attacked: " + diceValue); - } - -} - -M.Goblin = class extends M.Enemy -{ - constructor(scene, withShield = false) { - super(scene); - this.baseAnimInterval = 160; - this.anim_interval = this.baseAnimInterval; - this.anim_timer = 0; - - this.current_animation = 1; - this.anim_state = { side: -1 } - - this.head_shift = 1; - - this.dyingTint = Phaser.Display.Color.IntegerToColor(0x003300); - - this.addSprite("body", M.Vec2.ZERO, "gob_small", 0); - this.addSprite("shield", M.Vec2.ZERO, "gob_small", 2); - this.addSprite("head", M.Vec2.ZERO, "gob_small", 4); - - this.shieldBreaking = false; - this.shielded = withShield; - if (!this.shielded) { - this.enemyName = "Goblin"; - this.sprites.shield.visible = false; - } else { - this.enemyName = "ShieldGoblin"; - } - - this.refreshHint(); - this.hideHint(); - } - - refreshHint() { - if (this.shielded) { - this.setupHint(20, [["less", "4", "", "arrow", "", "guard_break"]]); - } else { - this.setupHint(20, [["greater", "2", "", "arrow", "", "skull"]]); - } - } - - preUpdate (t, dt) { - - this.anim_timer += dt; - this.animProcess(dt); - if (this.anim_timer > this.anim_interval) { - this.anim_timer = 0; - this.animUpdate(); - } - } - - changeAnim(animNumber) { - this.current_animation = animNumber; - this.resetAnim(); - } - - resetAnim() { - this.sprites.head.y = 0; - this.anim_interval = this.baseAnimInterval; - switch (this.current_animation) { - case 1: - this.sprites.head.setFrame(4); - this.sprites.body.setFrame(0); - this.sendToBack(this.sprites.body); - break; - case 2: - this.sprites.head.setFrame(5); - this.sprites.head.scaleX = 1; - this.sprites.head.x = 0; - this.sprites.body.setFrame(1); - this.bringToTop(this.sprites.body); - this.anim_state.death_timer = 0; - this.anim_state.death_total_time = 400; - break; - case 3: // laugh - this.sprites.head.setFrame(4); - this.sprites.head.x = 0; - this.anim_interval = 60; - this.anim_timer = 30; - this.anim_state.anim_timer = 0; - this.anim_state.anim_total_time = 600; - break; - case 4: // shield break - this.sprites.head.setFrame(5); - this.bringToTop(this.sprites.body); - this.anim_state.anim_timer = 0; - this.anim_state.anim_total_time = 280; - break; - } - } - - animProcess (dt) { - switch (this.current_animation) { - case 2: - this.anim_state.death_timer += dt; - const progress = this.anim_state.death_timer / this.anim_state.death_total_time; - const tintProgress = Math.min(1, progress * 2.2); - - let tintColor = this.dyingTint; - if (tintProgress < 1) { - const colorWhite = Phaser.Display.Color.IntegerToColor(0xffffff); - tintColor = Phaser.Display.Color.Interpolate.ColorWithColor( - colorWhite, this.dyingTint, 1, tintProgress - ); - } - this.tintSprites(tintColor.color); - - const scaleProgress = Math.max(0, (M.Ease.Cubic.In(progress) * 1.5) - 0.5); - for (let spName of this.spriteNames) { - this.sprites[spName].scaleY = 1 - scaleProgress; - } - - if (progress >= 1) { - this.finishDie(); - } - break; - case 3: - this.anim_state.anim_timer += dt; - if (this.anim_state.anim_timer > this.anim_state.anim_total_time) { - this.changeAnim(1); - } - break; - case 4: - this.anim_state.anim_timer += dt; - if (this.anim_state.anim_timer > this.anim_state.anim_total_time) { - this.changeAnim(1); - } - break; - } - } - - animUpdate () { - const head = this.sprites.head; - switch (this.current_animation) { - case 1: - this.anim_state.side *= -1; - head.x = this.head_shift * this.anim_state.side; - if (Math.random() < 0.05) { - head.scaleX *= -1; - if (Math.random() < 0.7) { - const pitchScale = Math.random() * 0.3 + 0.9 - this.scene.sound.play('gob2_sfx', {pitch: pitchScale}); - } - } - break; - case 3: - if (head.y === 0) { - head.y = 1; - } else { - head.y = 0; - } - break; - } - } - - attack(diceValue) { - if (this.shielded) { - if (diceValue <= 3 || diceValue > 6) { - this.scene.sound.play('crack_sfx'); - this.breakShield(); - - if (Math.random() < 0.2) { - this.scene.sound.play('gob_grunt_sfx'); - } - } else { - const laughNum = Math.floor(Math.random() * 2 + 1); - this.scene.sound.play('laugh' + laughNum + '_sfx'); - this.changeAnim(3); // laugh - } - } else { - if (diceValue <= 2) { - const laughNum = Math.floor(Math.random() * 2 + 1); - this.scene.sound.play('laugh' + laughNum + '_sfx'); - this.changeAnim(3); // laugh - } else { - this.scene.sound.play('punch_sfx'); - if (Math.random() < 0.75) { - this.scene.sound.play('gob_grunt_sfx'); - } else { - this.scene.sound.play('gob1_sfx'); - } - this.startDie(); - } - } - } - - preattack(diceValue) { - if (this.shielded && !this.shieldBreaking) { - if (diceValue <= 3 || diceValue > 6) { - this.shieldBreaking = true; - } - } else { - if (diceValue > 2) { - this.alive = false; - } - } - } - - breakShield() { - this.enemyName = "Goblin"; - this.shielded = false; - this.sprites.shield.visible = false; - this.refreshHint(); - this.changeAnim(4); - } - - startDie() { - this.alive = false; - this.gone = true; - this.deathAnimating = true; - this.changeAnim(2); - } - - finishDie() { - this.deathAnimating = false; - this.removeFromDisplayList(); - this.removeFromUpdateList(); - } -} - -M.BombGnome = class extends M.Enemy -{ - constructor(scene) { - super(scene); - this.enemyName = "BombGnome"; - - this.anim_interval = 320; - this.anim_timer = 0; - this.total_time = 0; - - this.current_animation = 1; - this.anim_state = {}; - - this.arm_speed = 200 + Math.random() * 20; - this.arm_angle_delta = (Math.PI / 6); - this.snap = Math.PI / 64; - - this.addSprite("body", M.Vec2.ZERO, "bomb_gnome", 0); - this.addSprite("arm", M.Vec2.ZERO, "bomb_gnome", 2); - this.addSprite("bomb", M.Vec2.ZERO, "bomb_gnome", 4); - this.addSprite("head", M.Vec2.ZERO, "bomb_gnome", 6); - - this.dyingTint = Phaser.Display.Color.IntegerToColor(0x330000); - - this.setupHint(26, [ - ["greater", "1", "", "arrow", "", "skull", ""], - ["equal", "6", "", "arrow", "", "skull", "boom"], - ]); - this.hideHint(); - } - - preUpdate (t, dt) { - this.total_time += dt; - this.animProcess(dt); - - this.anim_timer += dt; - if (this.anim_timer > this.anim_interval) { - this.anim_timer = 0; - this.animInterval(); - } - } - - animProcess (dt) { - let progress - let tintProgress - switch (this.current_animation) { - case 1: - const arm = this.sprites.arm - const smoothAngle = this.arm_angle_delta * ( - Math.cos(this.total_time / this.arm_speed) / 2 - 0.5 - ); - arm.rotation = Math.round(smoothAngle / this.snap) * this.snap; - break; - case 2: - this.anim_state.death_timer += dt; - progress = this.anim_state.death_timer / this.anim_state.death_total_time; - - tintProgress = Math.min(1, progress * 2.2); - this.setDeathTint(tintProgress); - - this.setDeathScale(progress, 0.5); - - if (progress >= 1) { - this.finishDie(); - } - break; - case 3: - this.anim_state.death_timer += dt; - progress = this.anim_state.death_timer / this.anim_state.death_total_time; - - tintProgress = Math.min(1, progress * 4.2); - this.setDeathTint(tintProgress); - - this.setDeathScale(progress, 1.2); - - const boomThreshold = 0.45; - if (this.spriteNames.includes("boom")) { - if (progress < boomThreshold) { - const boomScaleProg = M.Ease.Back.Out(Math.min(1, progress * 3.0)); - this.sprites.boom.scale = 0.75 + boomScaleProg * 0.25 - } else { - this.removeSprite("boom"); - } - } - - if (progress >= 1) { - this.finishDie(); - } - break; - } - } - - setDeathTint(tintProgress) { - let tintColor = this.dyingTint; - if (tintProgress < 1) { - const colorWhite = Phaser.Display.Color.IntegerToColor(0xffffff); - tintColor = Phaser.Display.Color.Interpolate.ColorWithColor( - colorWhite, this.dyingTint, 1, tintProgress - ); - } - this.tintSprites(tintColor.color); - if (this.spriteNames.includes("boom")) { - this.sprites.boom.clearTint(); - } - } - - setDeathScale(deathProgress, shrinkOffset) { - const clampedAdjusted = Math.max(0, Math.min(1, (deathProgress * (1 + shrinkOffset)) - 0.5)) - const scaleProgress = M.Ease.Cubic.In(clampedAdjusted); - for (let spName of this.spriteNames) { - this.sprites[spName].scaleY = 1 - scaleProgress; - } - } - - animInterval () { - switch (this.current_animation) { - case 1: - const head = this.sprites.head; - head.y = head.y > 0 ? 0 : 1; - break; - } - } - - changeAnim(animNumber) { - this.current_animation = animNumber; - this.resetAnim(); - } - - resetAnim() { - this.sprites.arm.rotation = 0; - switch (this.current_animation) { - case 1: - this.sprites.body.setFrame(0); - this.sprites.arm.setFrame(2); - this.sprites.head.setFrame(6); - break; - case 2: - this.sprites.body.setFrame(1); - this.sprites.arm.setFrame(3); - this.sprites.head.setFrame(7); - - this.anim_state.death_timer = 0; - this.anim_state.death_total_time = 600; - break; - case 3: - this.addSprite("boom", M.Vec2.ZERO, "explosion"); - this.sprites.boom.scale = 0.75; - - this.sprites.body.setFrame(1); - this.sprites.arm.setFrame(3); - this.sprites.bomb.visible = false; - this.sprites.head.setFrame(7); - - this.anim_state.death_timer = 0; - this.anim_state.death_total_time = 900; - break; - } - } - - attack(diceValue) { - if (diceValue <= 1) { - this.scene.sound.play('hoo_sfx'); - } else if (diceValue >= 6) { - this.startDie(true); - } else { - this.scene.sound.play('punch_sfx'); - this.startDie(false); - } - } - - preattack(diceValue) { - if (diceValue > 1) { - this.alive = false; - if (diceValue >= 6) { - this.scene.preExplode(this); - } - } - } - - startDie(exploding) { - this.alive = false; - this.gone = true; - this.deathAnimating = true; - this.changeAnim(exploding ? 3 : 2); - if (exploding) { - setTimeout(() => this.scene.enemyExploded(this), 150); - //this.scene.enemyExploded(this); - } else { - const gruntNum = Math.floor(Math.random() * 3 + 1); - this.scene.sound.play('gnome_grunt' + gruntNum + '_sfx'); - } - } - - finishDie() { - this.deathAnimating = false; - this.removeFromDisplayList(); - this.removeFromUpdateList(); - } -} diff --git a/2026/games_submissions/cammymoop/js/hints.js b/2026/games_submissions/cammymoop/js/hints.js deleted file mode 100644 index 250c080..0000000 --- a/2026/games_submissions/cammymoop/js/hints.js +++ /dev/null @@ -1,83 +0,0 @@ - -const nums = ['1', '2', '3', '4', '5', '6']; -const shortNames = []; - -M.Hint = class extends Phaser.GameObjects.Container -{ - constructor(scene) { - super(scene); - this.rows = []; - this.allImgs = []; - this.maxWidth = 0; - } - - setupExample() { - this.addToDisplayList(); - this.addRow(["equal", "5", "", "arrow", "", "skull", "dice"]); - this.addRow(["greater", "2", "", "arrow", "", "skull"]); - this.build(); - } - - setup(hintData) { - this.addToDisplayList(); - this.rows = []; - for (let row of hintData) { - this.addRow(row); - } - this.build(); - } - - addRow(contents) { - this.rows.push(contents); - } - - clearRows() { - this.rows = []; - } - - clearImgs() { - for (let img of this.allImgs) { - img.destroy(); - } - this.allImgs = []; - } - - build() { - this.clearImgs(); - - for (let i = 0; i < this.rows.length; i++) { - // Place rows in reverse order from bottom to top, moving coords upward so the end result is in order - const row = this.rows[this.rows.length - 1 - i]; - if (row.length < 1) { - continue; - } - const row_width = row.length * 8; - for (let j = 0; j < row.length; j++) { - if (row[j] === '') { - continue; - } - const charImg = this.getImageForKey(row[j]); - this.allImgs.push(charImg); - this.add(charImg); - charImg.x = (8 * j) - (row_width/2); - charImg.y = -i * 10; - } - } - } - - getImageForKey(charKey) { - if (nums.includes(charKey)) { - return this.newImage("number_icons", parseInt(charKey) - 1); - } else { - return this.newImage(charKey + "_icon"); - } - } - - newImage(texKey, frame = '') { - if (frame !== '') { - return new Phaser.GameObjects.Image(this.scene, 0, 0, texKey, frame); - } else { - return new Phaser.GameObjects.Image(this.scene, 0, 0, texKey); - } - } -}; diff --git a/2026/games_submissions/cammymoop/js/micro.js b/2026/games_submissions/cammymoop/js/micro.js deleted file mode 100644 index 0fb6b35..0000000 --- a/2026/games_submissions/cammymoop/js/micro.js +++ /dev/null @@ -1,157 +0,0 @@ - -M.Vec2 = Phaser.Math.Vector2; - -// Extend Phaser game objects for vector usage -Phaser.GameObjects.GameObject.prototype.setPosVec = function (newPos) { - this.x = newPos.x; - this.y = newPos.y; -}; - -Phaser.GameObjects.GameObject.prototype.addPosVec = function (newPos) { - this.x += newPos.x; - this.y += newPos.y; -}; - -Phaser.GameObjects.GameObject.prototype.getPosVec = function () { - return new M.Vec2(this.x, this.y); -}; - -M.WaitScene = class extends Phaser.Scene -{ - preload() - { - //this.load.image('image', 'assets/image.png'); - this.load.image('background', 'assets/background.png'); - this.load.image('goblin', 'assets/goblin.png'); - - this.load.image('explosion', 'assets/explosion.png'); - - this.load.image('red_circle', 'assets/red_circle.png'); - this.load.image('target_arrow', 'assets/target_arrow.png'); - this.load.image('reroll', 'assets/reroll.png'); - - this.load.image('yes', 'assets/yes.png'); - this.load.image('ohno', 'assets/ohno.png'); - - this.load.image('stopwatch_frame', 'assets/stopwatch_frame.png'); - this.load.spritesheet('stopwatch_numbers', 'assets/stopwatch_numbers.png', { - "frameWidth": 12, "frameHeight": 14, - }); - - this.load.image('arrow_icon', 'assets/arrow_icon.png'); - this.load.image('boom_icon', 'assets/boom_icon.png'); - this.load.image('dice_icon', 'assets/dice_icon.png'); - this.load.image('equal_icon', 'assets/equal_icon.png'); - this.load.image('greater_icon', 'assets/greater_icon.png'); - this.load.image('guard_break_icon', 'assets/guard_break_icon.png'); - this.load.image('less_icon', 'assets/less_icon.png'); - this.load.image('skull_icon', 'assets/skull_icon.png'); - this.load.spritesheet('number_icons', 'assets/number_icons.png', { - "frameWidth": 8, "frameHeight": 8, - }); - - this.load.spritesheet('gob_small', 'assets/gob_small.png', { - "frameWidth": 48, "frameHeight": 46, - }); - this.load.spritesheet('bomb_gnome', 'assets/bomb_gnome.png', { - "frameWidth": 42, "frameHeight": 50, - }); - - this.load.spritesheet('dices', 'assets/dices.png', { - "frameWidth": 30, "frameHeight": 30, - }); - - this.load.audio('boom_sfx', 'assets/sfx/boom.wav'); - this.load.audio('fwoof_sfx', 'assets/sfx/fwoof.wav'); - this.load.audio('land_sfx', 'assets/sfx/land.wav'); - this.load.audio('punch_sfx', 'assets/sfx/punch.wav'); - this.load.audio('crack_sfx', 'assets/sfx/crack.wav'); - - this.load.audio('laugh1_sfx', 'assets/sfx/laugh1.wav'); - this.load.audio('laugh2_sfx', 'assets/sfx/laugh2.wav'); - this.load.audio('hoo_sfx', 'assets/sfx/hoo.wav'); - - this.load.audio('gnome_grunt1_sfx', 'assets/sfx/gnome_grunt1.wav'); - this.load.audio('gnome_grunt2_sfx', 'assets/sfx/gnome_grunt2.wav'); - this.load.audio('gnome_grunt3_sfx', 'assets/sfx/gnome_grunt3.wav'); - - this.load.audio('gob1_sfx', 'assets/sfx/gob1.wav'); - this.load.audio('gob2_sfx', 'assets/sfx/gob2.wav'); - this.load.audio('gob_grunt_sfx', 'assets/sfx/gob_grunt.wav'); - } - - create() - { - this.difficulty = M.gameDifficulty; - this.textures.get("bomb_gnome").setFilter(Phaser.Textures.FilterMode.Nearest); - this.textures.get("dices").setFilter(Phaser.Textures.FilterMode.Nearest); - - Phaser.Display.Canvas.CanvasInterpolation.setCrisp(this.game.canvas); - window.parent.postMessage({op: "ready"}); - } - - update(t, dt) - { - if (M.standalone && this.input.activePointer.primaryDown) { - this.startDiceGame(); - } - } - - timeToStart(difficulty) { - this.difficulty = difficulty; - this.startDiceGame(); - } - - startDiceGame() - { - const data = { difficulty: this.difficulty }; - this.scene.switch("play", data); - this.scene.stop(); - } -} - -M.gameDifficulty = 0; - -M.waitingScene = new M.WaitScene("wait"); -M.gameScene = new M.DiceGame({key: "play", active: false}); - -M.gameStarted = function () { - window.parent.postMessage({op: "started", verb: "Defeat!"}); -}; - -M.gameEnd = function (won) { - window.parent.postMessage({op: "done", win: won}); -}; - -M.handleMessage = function (msgData) { - if (!msgData) { - return; - } - if (msgData.op == "start") { - waitingScene.timeToStart(msgData.difficulty); - } -} -window.addEventListener("message", M.handleMessage); - -const config = { - scale: { - mode: Phaser.Scale.FIT, - autoCenter: Phaser.Scale.CENTER_HORIZONTALLY, - }, - type: Phaser.AUTO, - parent: 'game-container', - width: 240, - height: 160, - backgroundColor: '#304858', - scene: [ - M.waitingScene, M.gameScene, - ], - smoothPixelArt: true, - //antialias: false, - //antialiasGL: true, -}; - -M.standalone = window.self === window.top - -const game = new Phaser.Game(config); -M.game = game; diff --git a/2026/games_submissions/cammymoop/js/stopwatch.js b/2026/games_submissions/cammymoop/js/stopwatch.js deleted file mode 100644 index 4578ee9..0000000 --- a/2026/games_submissions/cammymoop/js/stopwatch.js +++ /dev/null @@ -1,59 +0,0 @@ - -M.Stopwatch = class extends Phaser.GameObjects.Container -{ - constructor(scene, totalSeconds, pos) { - super(scene); - this.setPosVec(pos); - - this.elapsed = 0; - this.totalSeconds = totalSeconds; - - this.frame = new Phaser.GameObjects.Image(scene, 0, -3, 'stopwatch_frame'); - this.add(this.frame); - this.tens = new Phaser.GameObjects.Image(scene, 0, 0, 'stopwatch_numbers', 0); - this.add(this.tens); - this.tens.setOrigin(1, 0.5); - this.ones = new Phaser.GameObjects.Image(scene, 0, 0, 'stopwatch_numbers', 0); - this.add(this.ones); - this.ones.setOrigin(0, 0.5); - - this.addToDisplayList(); - this.addToUpdateList(); - this.showNumber(totalSeconds - 1); - } - - pause() { - this.removeFromUpdateList(); - } - - resume() { - this.addToUpdateList(); - } - - getTimeLeft() { - return this.totalSeconds * 1000 - this.elapsed; - } - - setupHint(height, hintData) { - this.addHintData(hintData); - this.hint.y = -height; - } - - preUpdate (t, dt) { - this.elapsed += dt; - - const dispSeconds = Math.max(0, Math.floor(this.totalSeconds - (this.elapsed / 1000))); - this.showNumber(dispSeconds); - - if (this.elapsed / 1000 > this.totalSeconds) { - this.scene.nowFinished(false, true); - this.pause(); - } - } - - showNumber(dispNumber) { - const num = Math.round(dispNumber) % 100; - this.tens.setFrame(Math.floor(num / 10)); - this.ones.setFrame(num % 10); - } -}; diff --git a/2026/games_submissions/cammymoop/lib/LICENSE.md b/2026/games_submissions/cammymoop/lib/LICENSE.md deleted file mode 100644 index 33aa21b..0000000 --- a/2026/games_submissions/cammymoop/lib/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2026 Richard Davey, Phaser Studio Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/2026/games_submissions/cammymoop/lib/phaser.min.js b/2026/games_submissions/cammymoop/lib/phaser.min.js deleted file mode 100644 index 348523f..0000000 --- a/2026/games_submissions/cammymoop/lib/phaser.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,()=>(()=>{var t={50792(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,r,n,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,n||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s<n;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,r=this._events[e];return r?r.fn?1:r.length:0},o.prototype.emit=function(t,e,r,s,n,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,s),!0;case 5:return u.fn.call(u.context,e,r,s,n),!0;case 6:return u.fn.call(u.context,e,r,s,n,a),!0}for(l=1,h=new Array(d-1);l<d;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var c,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,s);break;default:if(!h)for(c=1,h=new Array(d-1);c<d;c++)h[c-1]=arguments[c];u[l].fn.apply(u[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return n(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return n(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,r,s){var n=i?i+t:t;if(!this._events[n])return this;if(!e)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==e||s&&!o.once||r&&o.context!==r||a(this,n);else{for(var h=0,l=[],u=o.length;h<u;h++)(o[h].fn!==e||s&&!o[h].once||r&&o[h].context!==r)&&l.push(o[h]);l.length?this._events[n]=1===l.length?l[0]:l:a(this,n)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o},93300(t,e,i){var r=i(10312);t.exports=function(t,e){Array.isArray(t)||(t=[t]),e||(e={});for(var i=void 0===e.threshold?.5:e.threshold,s=void 0===e.blurRadius?2:e.blurRadius,n=void 0===e.blurSteps?4:e.blurSteps,a=void 0===e.blurQuality?0:e.blurQuality,o=void 0===e.blendAmount?1:e.blendAmount,h=void 0===e.blendMode?r.ADD:e.blendMode,l=[],u=0;u<t.length;u++){var d=t[u];d.enableFilters&&d.enableFilters();var c=(e.useInternal?d.filters.internal:d.filters.external).addParallelFilters(),f=c.top.addThreshold(i,1),p=c.top.addBlur(a,s,s,1,16777215,n);c.blend.blendMode=h,c.blend.amount=o,l.push({item:d,parallelFilters:c,threshold:f,blur:p})}return l}},56704(t,e,i){var r=i(16438),s=i(10312),n=i(41337),a=i(95643),o=i(45650);t.exports=function(t,e){e||(e={}),Array.isArray(t)||(t=[t]);var i=t[0],h=i.scene,l=void 0===e.direction?.5:e.direction%(2*Math.PI),u=void 0===e.scale?2:e.scale,d=(e.radius||.5)/u,c=e.width||i.width||128,f=e.height||i.height||128,p={x:0,y:0};l<0&&(l+=2*Math.PI),l>3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var g=[],m=0;m<t.length;m++){var v=t[m],y={origin:0,width:c,height:f,config:{offset:-d,repeatMode:3,shapeMode:0,direction:l,length:u,start:p,bands:e.bands||[{interpolation:2,colorStart:16777215,colorEnd:[1,1,1,0],size:d},{colorStart:[1,1,1,0],size:1-d}]}},x=h.make.gradient(y,!1);if(e.displacementMap){var T=e.displacement||.1;x.enableFilters().filters.internal.addDisplacement(e.displacementMap,T,T)}for(var w=o(),b=h.textures;b.exists(w);)w=o();var S=b.addDynamicTexture(w,x.width,x.height),C=h.tweens.add({targets:x,offset:1+d,repeat:-1,yoyo:!!e.yoyo,ease:e.ease,duration:e.duration||2e3,repeatDelay:e.repeatDelay||0,onUpdate:function(){S.clear().draw(x).render()}});v instanceof a&&v.enableFilters();var E,A,_=e.useExternal?v.filters.external:v.filters.internal,M=e.colorFactor||[1.15,.85,.85,1];e.reveal?E=_.addBlend(w,s.MULTIPLY,1,M):(E=(A=_.addParallelFilters()).top.addBlend(w,s.MULTIPLY,1,M),A.blend.blendMode=s.ADD);var R=function(){C.destroy(),S.destroy()};v instanceof a?v.on(n,R):v.on(r,R),g.push({item:v,dynamicTexture:S,gradient:x,tween:C,parallelFilters:A,blendFilter:E})}return g}},245(t,e,i){var r=i(95643),s=i(93232),n=i(94591);t.exports=function(t,e){Array.isArray(t)||(t=[t]),e||(e={});for(var i=void 0===e.aspectRatio?1:e.aspectRatio,a=e.padding||0,o=t[0].scene,h=[],l=0;l<t.length;l++){var u,d=t[l],c=e.region;switch(c||(c=e.useInternal&&d._sizeComponent?new s(0,0,d.width,d.height):new s(0,0,o.scale.width,o.scale.height)),e.shape){case"ellipse":u=o.add.ellipse(0,0,i,1,16777215);break;case"square":u=o.add.rectangle(0,0,1,1,16777215);break;case"rectangle":u=o.add.rectangle(0,0,i,1,16777215);break;default:u=o.add.circle(0,0,1,16777215)}o.children.remove(u),a&&(c=new s(c.x+a,c.y+a,c.width-2*a,c.height-2*a)),n(u,e.scaleMode,c),e.blurRadius>0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof r&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var r=i(38829);t.exports=function(t,e,i,s){for(var n=t[0],a=1;a<t.length;a++){var o=t[a];r(o,n,e,i,s),n=o}return t}},80318(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"angle",e,i,s,n)}},60757(t){t.exports=function(t,e,i){for(var r=0;r<t.length;r++){var s=t[r];e.call(i,s)}return t}},94591(t,e,i){var r=i(87841),s=i(95540);t.exports=function(t,e,i,n){if(Array.isArray(t)||(t=[t]),void 0===e&&(e=0),!i){var a=t[0].scene;i=new r(0,0,a.scale.width,a.scale.height)}n||(n={});for(var o=0;o<t.length;o++){var h=t[o],l=s(n,"width",s(h,"width",1)),u=s(n,"height",s(h,"height",1)),d=s(n,"originX",s(h,"originX",.5)),c=s(n,"originY",s(h,"originY",.5));h.x=i.x+i.width*d,h.y=i.y+i.height*c;var f=i.width/l,p=i.height/u;switch(e){case-1:h.setScale(Math.min(f,p));break;case 0:h.setScale(f,p);break;case 1:h.setScale(Math.max(f,p))}}return h}},69927(t){t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=i;r<t.length;r++){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},32265(t){t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=t.length-1;r>=i;r--){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},94420(t,e,i){var r=i(11879),s=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",s.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),g=0,m=0,v=h*u,y=l*d;o.setPosition(f,p),o.setSize(u,d);for(var x=0;x<t.length;x++)if(r(t[x],o,c),i&&-1===h)o.x+=u;else if(a&&-1===l)o.y+=d;else if(a&&!i){if(m+=d,o.y+=d,m===y&&(m=0,g+=u,o.y=p,o.x+=u,g===v))break}else if(g+=u,o.x+=u,g===v&&(g=0,m+=d,o.x=f,o.y+=d,m===y))break;return t}},41721(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"alpha",e,i,s,n)}},67285(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"x",e,i,s,n)}},9074(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"x",e,s,a,o),r(t,"y",i,n,a,o)}},75222(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"y",e,i,s,n)}},22983(t){t.exports=function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=6.28);for(var s=i,n=(r-i)/t.length,a=e.x,o=e.y,h=e.radius,l=0;l<t.length;l++)t[l].x=a+h*Math.cos(s),t[l].y=o+h*Math.sin(s),s+=n;return t}},95253(t){t.exports=function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=6.28);for(var s=i,n=(r-i)/t.length,a=e.width/2,o=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+a*Math.cos(s),t[h].y=e.y+o*Math.sin(s),s+=n;return t}},88505(t,e,i){var r=i(15258),s=i(26708);t.exports=function(t,e,i){var n;n=i?s(e,i,t.length):r(e,t.length);for(var a=0;a<t.length;a++){var o=t[a],h=n[a];o.x=h.x,o.y=h.y}return t}},41346(t,e,i){var r=i(14649),s=i(86003),n=i(49498);t.exports=function(t,e,i){void 0===i&&(i=0);var a=r(e,!1,t.length);i>0?s(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o<t.length;o++)t[o].x=a[o].x,t[o].y=a[o].y;return t}},11575(t,e,i){var r=i(84993);t.exports=function(t,e,i){var s=r({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),n=r({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),a=r({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);s.pop(),n.pop(),a.pop();for(var o=(s=s.concat(n,a)).length/t.length,h=0,l=0;l<t.length;l++){var u=t[l],d=s[Math.floor(h)];u.x=d.x,u.y=d.y,h+=o}return t}},29953(t){t.exports=function(t,e,i){for(var r=0;r<t.length;r++){var s=t[r];s.anims&&s.anims.play(e,i)}return t}},66979(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a<h;a++)t[a][e]+=i+o*r,o++;else for(a=s;a>=0;a--)t[a][e]+=i+o*r,o++;return t}},43967(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a<h;a++)t[a][e]=i+o*r,o++;else for(a=s;a>=0;a--)t[a][e]=i+o*r,o++;return t}},88926(t,e,i){var r=i(28176);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},33286(t,e,i){var r=i(24820);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},96e3(t,e,i){var r=i(65822);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},28789(t,e,i){var r=i(26597);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},97154(t,e,i){var r=i(90260);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},20510(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"rotation",e,i,s,n)}},91051(t,e,i){var r=i(1163),s=i(20339);t.exports=function(t,e,i){for(var n=e.x,a=e.y,o=0;o<t.length;o++){var h=t[o];r(h,n,a,i,Math.max(1,s(h.x,h.y,n,a)))}return t}},76332(t,e,i){var r=i(1163);t.exports=function(t,e,i,s){var n=e.x,a=e.y;if(0===s)return t;for(var o=0;o<t.length;o++)r(t[o],n,a,i,s);return t}},61619(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"scaleX",e,i,s,n)}},94868(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"scaleX",e,s,a,o),r(t,"scaleY",i,n,a,o)}},95532(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"scaleY",e,i,s,n)}},8689(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"alpha",e,i,s,n)}},2645(t,e,i){var r=i(43967);t.exports=function(t,e,i,s){return r(t,"blendMode",e,0,i,s)}},32372(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"depth",e,i,s,n)}},85373(t){t.exports=function(t,e,i){for(var r=0;r<t.length;r++)t[r].setInteractive(e,i);return t}},81583(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"originX",e,s,a,o),r(t,"originY",i,n,a,o),t.forEach(function(t){t.updateDisplayOrigin()}),t}},79939(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"rotation",e,i,s,n)}},2699(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"scaleX",e,s,a,o),r(t,"scaleY",i,n,a,o)}},98739(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scaleX",e,i,s,n)}},98476(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scaleY",e,i,s,n)}},6207(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"scrollFactorX",e,s,a,o),r(t,"scrollFactorY",i,n,a,o)}},6607(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scrollFactorX",e,i,s,n)}},72248(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scrollFactorY",e,i,s,n)}},14036(t){t.exports=function(t,e,i,r,s){for(var n=0;n<t.length;n++)t[n].setTint(e,i,r,s);return t}},50159(t,e,i){var r=i(43967);t.exports=function(t,e,i,s){return r(t,"visible",e,0,i,s)}},77597(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"x",e,i,s,n)}},83194(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"x",e,s,a,o),r(t,"y",i,n,a,o)}},67678(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"y",e,i,s,n)}},35850(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){var a,o;void 0===s&&(s=0),void 0===n&&(n=new r);var h=t.length;if(1===h)a=t[0].x,o=t[0].y,t[0].x=e,t[0].y=i;else{var l=1,u=0;0===s&&(u=h-1,l=h-2),a=t[u].x,o=t[u].y,t[u].x=e,t[u].y=i;for(var d=0;d<h;d++)if(!(l>=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===s?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var r=i(33680);t.exports=function(t){return r(t)}},21837(t,e,i){var r=i(7602);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a<t.length;a++)t[a][e]+=r(a*o,i,s);else for(a=0;a<t.length;a++)t[a][e]=r(a*o,i,s);return t}},21910(t,e,i){var r=i(54261);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a<t.length;a++)t[a][e]+=r(a*o,i,s);else for(a=0;a<t.length;a++)t[a][e]=r(a*o,i,s);return t}},62054(t){t.exports=function(t,e,i,r,s){if(void 0===s&&(s=!1),0===t.length)return t;if(1===t.length)return s?t[0][e]+=(r+i)/2:t[0][e]=(r+i)/2,t;var n,a=Math.abs(r-i)/(t.length-1);if(s)for(n=0;n<t.length;n++)t[n][e]+=n*a+i;else for(n=0;n<t.length;n++)t[n][e]=n*a+i;return t}},79815(t){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},39665(t,e,i){var r=i(15994);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s<t.length;s++){var n=t[s];n.x=r(n.x,e.left-i,e.right+i),n.y=r(n.y,e.top-i,e.bottom+i)}return t}},61061(t,e,i){t.exports={AddEffectBloom:i(93300),AddEffectShine:i(56704),AddMaskShape:i(245),AlignTo:i(11517),Angle:i(80318),Call:i(60757),FitToRegion:i(94591),GetFirst:i(69927),GetLast:i(32265),GridAlign:i(94420),IncAlpha:i(41721),IncX:i(67285),IncXY:i(9074),IncY:i(75222),PlaceOnCircle:i(22983),PlaceOnEllipse:i(95253),PlaceOnLine:i(88505),PlaceOnRectangle:i(41346),PlaceOnTriangle:i(11575),PlayAnimation:i(29953),PropertyValueInc:i(66979),PropertyValueSet:i(43967),RandomCircle:i(88926),RandomEllipse:i(33286),RandomLine:i(96e3),RandomRectangle:i(28789),RandomTriangle:i(97154),Rotate:i(20510),RotateAround:i(91051),RotateAroundDistance:i(76332),ScaleX:i(61619),ScaleXY:i(94868),ScaleY:i(95532),SetAlpha:i(8689),SetBlendMode:i(2645),SetDepth:i(32372),SetHitArea:i(85373),SetOrigin:i(81583),SetRotation:i(79939),SetScale:i(2699),SetScaleX:i(98739),SetScaleY:i(98476),SetScrollFactor:i(6207),SetScrollFactorX:i(6607),SetScrollFactorY:i(72248),SetTint:i(14036),SetVisible:i(50159),SetX:i(77597),SetXY:i(83194),SetY:i(67678),ShiftPosition:i(35850),Shuffle:i(8628),SmootherStep:i(21910),SmoothStep:i(21837),Spread:i(62054),ToggleVisible:i(79815),WrapInRectangle:i(39665)}},42099(t,e,i){var r=i(45319),s=i(83419),n=i(74943),a=i(81957),o=i(41138),h=i(35154),l=i(90126),u=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showBeforeDelay=h(i,"showBeforeDelay",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.randomFrame=h(i,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(n.PAUSE_ALL,this.pause,this),this.manager.on(n.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,r){null===i&&null===r?(t.frameRate=24,t.duration=24/e*1e3):i&&null===r?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=r,t.duration=e/r*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var r=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=r.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t<this.frames.length},getFirstTick:function(t){t.accumulator=0,t.nextTick=t.frameRate===t.currentAnim.frameRate&&t.currentFrame.duration||t.msPerFrame},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i,r){void 0===r&&(r=!0);var s,n,a,u,d=[],c=1;if("string"==typeof e){if(u=e,!t.exists(u))return console.warn('Texture "%s" not found',u),d;var f=t.get(u).getFrameNames();r&&l(f),e=[],f.forEach(function(t){e.push({key:u,frame:t})})}if(!Array.isArray(e)||0===e.length)return d;for(a=0;a<e.length;a++){var p=e[a],g=h(p,"key",i);if(g){var m=h(p,"frame",0),v=t.getFrame(g,m);v?((n=new o(g,m,c,v)).duration=h(p,"duration",0),n.isFirst=!s,s&&(s.nextFrame=n,n.prevFrame=s),d.push(n),s=n,c++):console.warn('Texture "%s" not found',g)}}if(d.length>0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var y=1/(d.length-1);for(a=0;a<d.length;a++)d[a].progress=a*y}return d},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.frameRate===t.currentAnim.frameRate&&t.currentFrame.duration||t.msPerFrame},getFrameByProgress:function(t){return t=r(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t.yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),r=0;r<e;r++)(t=this.frames[r]).index=r+1,t.isFirst=!1,t.isLast=!1,t.progress=r*i,0===r?(t.isFirst=!0,1===e?(t.isLast=!0,t.nextFrame=t,t.prevFrame=t):(t.isLast=!1,t.prevFrame=this.frames[e-1],t.nextFrame=this.frames[r+1])):r===e-1&&e>1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[r-1],t.nextFrame=this.frames[r+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=u},41138(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s){void 0===s&&(s=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=r,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=s},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=r},60848(t,e,i){var r=i(42099),s=i(83419),n=i(90330),a=i(50792),o=i(74943),h=i(8443),l=i(95540),u=i(35154),d=i(36383),c=i(20283),f=i(41836),p=new s({Extends:a,initialize:function(t){a.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new n,this.mixes=new n,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var r=this.anims,s=this.mixes,n="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;if(r.has(n)&&r.has(a)){var o=s.get(n);o||(o={}),o[a]=i,s.set(n,o)}return this},removeMix:function(t,e){var i=this.mixes,r="string"==typeof t?t:t.key,s=i.get(r);if(s)if(e){var n="string"==typeof e?e:e.key;s.hasOwnProperty(n)&&delete s[n]}else e||i.delete(r);return this},getMix:function(t,e){var i=this.mixes,r="string"==typeof t?t:t.key,s="string"==typeof e?e:e.key,n=i.get(r);return n&&n.hasOwnProperty(s)?n[s]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(o.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var r=[],s=this.game.cache.json.get(t);if(!s)return console.warn("No Aseprite data found for: "+t),r;var n=this,a=u(s,"meta",null),o=u(s,"frames",null);a&&o&&u(a,"frameTags",[]).forEach(function(s){var a=[],h=l(s,"name",null),u=l(s,"from",0),c=l(s,"to",0),f=l(s,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,g=u;g<=c;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=n.create(T),x&&r.push(x)}});return r},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new r(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var r=0;r<t.anims.length;r++)i.push(this.create(t.anims[r]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i=u(e,"prefix",""),r=u(e,"start",0),s=u(e,"end",0),n=u(e,"suffix",""),a=u(e,"zeroPad",0),o=u(e,"outputArray",[]),h=u(e,"frames",!1);if(!this.textureManager.exists(t))return console.warn('Texture "%s" not found',t),o;var l,d=this.textureManager.get(t);if(!d)return o;if(e)for(h||(h=c(r,s)),l=0;l<h.length;l++){var p=i+f(h[l],a,"0",1)+n;d.has(p)?o.push({key:t,frame:p}):console.warn('Frame "%s" not found in texture "%s"',p,t)}else for(h=d.getFrameNames(),l=0;l<h.length;l++)o.push({key:t,frame:h[l]});return o},generateFrameNumbers:function(t,e){var i=u(e,"start",0),r=u(e,"end",-1),s=u(e,"first",!1),n=u(e,"outputArray",[]),a=u(e,"frames",!1);if(!this.textureManager.exists(t))return console.warn('Texture "%s" not found',t),n;var o=this.textureManager.get(t);if(!o)return n;s&&o.has(s)&&n.push({key:t,frame:s}),a||(-1===r&&(r=o.frameTotal-2),a=c(i,r));for(var h=0;h<a.length;h++){var l=a[h];o.has(l)?n.push({key:t,frame:l}):console.warn('Frame "%s" not found in texture "%s"',l,t)}return n},get:function(t){return this.anims.get(t)},getAnimsFromTexture:function(t){for(var e=this.textureManager.get(t).key,i=this.anims.getArray(),r=[],s=0;s<i.length;s++)for(var n=i[s],a=n.frames,o=0;o<a.length;o++)if(a[o].textureKey===e){r.push(n.key);break}return r},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(o.PAUSE_ALL)),this},play:function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)e[i].anims.play(t);return this},staggerPlay:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=!0),Array.isArray(e)||(e=[e]);var s=e.length;r||s--;for(var n=0;n<e.length;n++){var a=i<0?Math.abs(i)*(s-n):i*n;e[n].anims.playAfterDelay(t,a)}return this},remove:function(t){var e=this.get(t);return e&&(this.emit(o.REMOVE_ANIMATION,t,e),this.anims.delete(t),this.removeMix(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(o.RESUME_ALL)),this},toJSON:function(t){var e={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==t&&""!==t?e.anims.push(this.anims.get(t).toJSON()):this.anims.each(function(t,i){e.anims.push(i.toJSON())}),e},destroy:function(){this.anims.clear(),this.mixes.clear(),this.textureManager=null,this.game=null}});t.exports=p},9674(t,e,i){var r=i(42099),s=i(30976),n=i(83419),a=i(90330),o=i(74943),h=i(95540),l=new n({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.randomFrame=!1,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showBeforeDelay=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i];this.nextAnim?this.nextAnimsQueue.push(r):this.nextAnim=r}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(t){this.isPlaying&&this.stop();var e=this.animationManager,i="string"==typeof t?t:h(t,"key",null),r=this.exists(i)?this.get(i):e.get(i);if(r){this.currentAnim=r;var n=r.getTotalFrames(),a=h(t,"frameRate",r.frameRate),o=h(t,"duration",r.duration);r.calculateDuration(this,n,o,a),this.delay=h(t,"delay",r.delay),this.repeat=h(t,"repeat",r.repeat),this.repeatDelay=h(t,"repeatDelay",r.repeatDelay),this.yoyo=h(t,"yoyo",r.yoyo),this.showBeforeDelay=h(t,"showBeforeDelay",r.showBeforeDelay),this.showOnStart=h(t,"showOnStart",r.showOnStart),this.hideOnComplete=h(t,"hideOnComplete",r.hideOnComplete),this.skipMissedFrames=h(t,"skipMissedFrames",r.skipMissedFrames),this.randomFrame=h(t,"randomFrame",r.randomFrame),this.timeScale=h(t,"timeScale",this.timeScale);var l=h(t,"startFrame",0);l>n&&(l=0),this.randomFrame&&(l=s(0,n-1));var u=r.frames[l];0!==l||this.forward||(u=r.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return r;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var r=this.currentFrame,s=this.parent,n=r.textureFrame;s.emit(t,i,r,s,n),e&&s.emit(e+i.key,i,r,s,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):r},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var r=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),r++}while(this.isPlaying&&this.accumulator>this.nextTick&&r<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new r(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var r=i(83419),s=i(90330),n=i(50792),a=i(24736),o=new r({initialize:function(){this.entries=new s,this.events=new n},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},24047(t,e,i){var r=i(2161),s=i(83419),n=i(8443),a=new s({initialize:function(t){this.game=t,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.tilemap=new r,this.xml=new r,this.atlas=new r,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new r),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=a},51464(t){t.exports="add"},59261(t){t.exports="remove"},24736(t,e,i){t.exports={ADD:i(51464),REMOVE:i(59261)}},83388(t,e,i){t.exports={BaseCache:i(2161),CacheManager:i(24047),Events:i(24736)}},71911(t,e,i){var r=i(83419),s=i(39506),n=i(50792),a=i(19715),o=i(87841),h=i(88509),l=i(61340),u=i(59715),d=i(80333),c=i(26099),f=new r({Extends:n,Mixins:[h,u],initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),n.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new o,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=r,this._bounds=new o,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.matrixCombined=new l,this.matrixExternal=new l,this.transparent=!0,this.backgroundColor=d("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,r/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0,this.forceComposite=!1,this.renderRoundPixels=!0},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var r=.5*this.width,s=.5*this.height;return i.x=t-r,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],r=e[1],s=e[2],n=e[3],a=i*n-r*s;if(!a)return t;var o=this.scrollX,h=this.scrollY,l=this.width,u=this.height,d=this.y,c=d+u,f=this.x,p=f+l,g=this.culledObjects,m=t.length;a=1/a,g.length=0;for(var v=0;v<m;++v){var y=t[v];if(y.hasOwnProperty("width")&&!y.parentContainer){var x=y.width,T=y.height,w=y.x-o*y.scrollFactorX-x*y.originX,b=y.y-h*y.scrollFactorY-T*y.originY;(w+x)*i+(b+T)*s>f&&w*i+b*s<p&&(w+x)*r+(b+T)*n>d&&w*r+b*n<c&&g.push(y)}else g.push(y)}return g},getWorldPoint:function(t,e,i){void 0===i&&(i=new c);var r=this.matrixCombined.matrix,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5],u=s*o-n*a;if(!u)return i.x=t,i.y=e,i;var d=o*(u=1/u),f=-n*u,p=-a*u,g=s*u,m=(a*l-o*h)*u,v=(n*h-s*l)*u;return i.x=t*d+e*p+m,i.y=t*f+e*g+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i];Array.isArray(r)?this.ignore(r):r.isParent?this.ignore(r.getChildren()):r.cameraFilter|=e}return this},clampX:function(t){var e=this._bounds,i=this.displayWidth,r=e.x+(i-this.width)/2,s=Math.max(r,r+e.width-i);return t<r?t=r:t>s&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,r=e.y+(i-this.height)/2,s=Math.max(r,r+e.height-i);return t<r?t=r:t>s&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,r,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,r),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var r=i(71911),s=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new d(0,0,t,e),this._follow){var i=this.width/2,r=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-r}s(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,r,s,n){return this.fadeEffect.start(!1,t,e,i,r,!0,s,n)},fadeOut:function(t,e,i,r,s,n){return this.fadeEffect.start(!0,t,e,i,r,!0,s,n)},fadeFrom:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!1,t,e,i,r,s,n,a)},fade:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!0,t,e,i,r,s,n,a)},flash:function(t,e,i,r,s,n,a){return this.flashEffect.start(t,e,i,r,s,n,a)},shake:function(t,e,i,r,s){return this.shakeEffect.start(t,e,i,r,s)},pan:function(t,e,i,r,s,n,a){return this.panEffect.start(t,e,i,r,s,n,a)},rotateTo:function(t,e,i,r,s,n,a){return this.rotateToEffect.start(t,e,i,r,s,n,a)},zoomTo:function(t,e,i,r,s,n){return this.zoomEffect.start(t,e,i,r,s,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,r=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&s(c,this.midPoint.x,this.midPoint.y);var g=!1;if(d&&!this.panEffect.isRunning){var m=this.lerp,v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;c?(v<c.x?f=u(f,f-(c.x-v),m.x):v>c.right&&(f=u(f,f+(v-c.right),m.x)),y<c.y?p=u(p,p-(c.y-y),m.y):y>c.bottom&&(p=u(p,p+(y-c.bottom),m.y))):(f=u(f,v-o,m.x),p=u(p,y-h,m.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+r;this.midPoint.set(x,T);var w=t/n,b=e/a,S=x-w/2,C=T-b/2;this.worldView.setTo(S,C,w,b);var E=this.matrix,A=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,h),E.scale(n,a),E.rotate(this.rotation),E.translate(-f-o,-p-h)):(E.applyITRS(o,h,this.rotation,n,a),E.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(E,this.matrixCombined),g&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,r,s){switch(r){case"padding":var n=e.padding;e.padding=s;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[r]=s-e.padding;case"width":case"height":return i[r]=s+2*e.padding;default:return i[r]=s}}});return i.padding=t||0,i},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,r,s,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===r&&(r=i),void 0===s&&(s=0),void 0===a&&(a=s),this._follow=t,this.roundPixels=e,i=n(i,0,1),r=n(r,0,1),this.lerp.set(i,r),this.followOffset.set(s,a);var o=this.width/2,h=this.height/2,l=t.x-s,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var r=i(38058),s=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new r(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,s,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=!1),void 0===a&&(a="");var o=new r(t,e,i,s);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),n&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var r=!1,s=0;s<t.length;s++){var n=t[s];n&&n.id===e&&(r=!0)}if(!r)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,r=0;r<i.length;r++){var s=i[r];(!t||t&&s.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.scale.width,i=this.scene.sys.scale.height,r=0;r<t.length;r++){var s=t[r],a=n(s,"x",0),o=n(s,"y",0),h=n(s,"width",e),l=n(s,"height",i),u=this.add(a,o,h,l);u.name=n(s,"name",""),u.zoom=n(s,"zoom",1),u.rotation=n(s,"rotation",0),u.scrollX=n(s,"scrollX",0),u.scrollY=n(s,"scrollY",0),u.roundPixels=n(s,"roundPixels",!1),u.visible=n(s,"visible",!0);var d=n(s,"backgroundColor",!1);d&&u.setBackgroundColor(d);var c=n(s,"bounds",null);if(c){var f=n(c,"x",0),p=n(c,"y",0),g=n(c,"width",e),m=n(c,"height",i);u.setBounds(f,p,g,m)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,r=t.y,s=[],n=0;n<e.length;n++){var a=e[n];a.visible&&a.inputEnabled&&o(a,i,r)&&s.unshift(a)}return s},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,r=this.cameras,s=0;s<t.length;s++){var n=r.indexOf(t[s]);-1!==n&&(e?r[n].destroy():r[n].renderList=[],r.splice(n,1),i++)}return!this.main&&r[0]&&(this.main=r[0]),i},render:function(t,e){for(var i=this.scene,r=this.cameras,s=0;s<r.length;s++){var n=r[s];if(n.visible&&n.alpha>0){n.preRender();var a=this.getVisibleChildren(e.getChildren(),n);t.render(i,a,n)}}},getVisibleChildren:function(t,e){return t.filter(function(t){return t.willRender(e)})},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},onResize:function(t,e,i,r,s){for(var n=0;n<this.cameras.length;n++){var a=this.cameras[n];0===a._x&&0===a._y&&a._width===r&&a._height===s&&a.setSize(e.width,e.height)}},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off(l.UPDATE,this.update,this),e.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.systems.events.off(l.START,this.start,this),this.systems.events.off(l.DESTROY,this.destroy,this),this.systems.game.scale.off(h.RESIZE,this.onResize,this),this.scene=null,this.systems=null}});a.register("CameraManager",u,"cameras"),t.exports=u},5020(t,e,i){var r=i(45319),s=i(83419),n=i(19715),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,r,s,a,o,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),!a&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=r,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h;var l=t?n.FADE_OUT_START:n.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,r,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:(this.alpha=this.direction?1:0,this.effectComplete()))},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(){return this.isRunning||this.isComplete},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?n.FADE_OUT_COMPLETE:n.FADE_IN_COMPLETE;this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},10662(t,e,i){var r=i(45319),s=i(83419),n=i(19715),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,r,s,a,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===r&&(r=255),void 0===s&&(s=!1),void 0===a&&(a=null),void 0===o&&(o=this.camera.scene),!s&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=r,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=o,this.camera.emit(n.FLASH_START,this.camera,this,t,e,i,r)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this._alpha*(1-this.progress):this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(){return this.isRunning},effectComplete:function(){this.alpha=this._alpha,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(n.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},20359(t,e,i){var r=i(45319),s=i(83419),n=i(62640),a=i(19715),o=i(26099),h=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new o,this.current=new o,this.destination=new o,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,r,s,o,h){void 0===i&&(i=1e3),void 0===r&&(r=n.Linear),void 0===s&&(s=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof r&&n.hasOwnProperty(r)?this.ease=n[r]:"function"==typeof r&&(this.ease=r),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.camera.emit(a.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=r(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed<this.duration){var n=this.ease(i);s.getScroll(this.destination.x,this.destination.y,this.current);var a=this.source.x+(this.current.x-this.source.x)*n,o=this.source.y+(this.current.y-this.source.y)*n;s.setScroll(a,o),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,a,o)}else s.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,s.scrollX,s.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.PAN_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=h},34208(t,e,i){var r=i(45319),s=i(83419),n=i(19715),a=i(62640),o=i(86554),h=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,r,s,h,l){void 0===i&&(i=1e3),void 0===r&&(r=a.Linear),void 0===s&&(s=!1),void 0===h&&(h=null),void 0===l&&(l=this.camera.scene),void 0===e&&(e=!1);var u=this.camera;if(!s&&this.isRunning)return u;if(this.shortestPath=e,this.isRunning=!0,this.duration=i,this.progress=0,this.source=u.rotation,this.destination=t,"string"==typeof r&&a.hasOwnProperty(r)?this.ease=a[r]:"function"==typeof r&&(this.ease=r),this._elapsed=0,this._onUpdate=h,this._onUpdateScope=l,this.shortestPath){var d=o(this.destination-this.source);this.destination=this.source+d,this.clockwise=d>=0}else this.clockwise=this.destination>=this.source;return this.camera.emit(n.ROTATE_START,this.camera,this,i,this.destination),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=r(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed<this.duration){var n=this.ease(i),a=this.source+n*(this.destination-this.source);s.rotation=a,this.current=a,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,a)}else s.rotation=this.destination,this.current=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(n.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=h},30330(t,e,i){var r=i(45319),s=i(83419),n=i(19715),a=i(26099),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,r,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===r&&(r=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=r,this._onUpdateScope=s,this.camera.emit(n.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,s=this.camera.width,n=this.camera.height,a=this.camera.zoom;this._offsetX=(Math.random()*i.x*s*2-i.x*s)*a,this._offsetY=(Math.random()*i.y*n*2-i.y*n)*a,this.camera.roundPixels&&(this._offsetX=Math.round(this._offsetX),this._offsetY=Math.round(this._offsetY))}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(n.SHAKE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=o},45641(t,e,i){var r=i(45319),s=i(83419),n=i(62640),a=i(19715),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,r,s,o){void 0===e&&(e=1e3),void 0===i&&(i=n.Linear),void 0===r&&(r=!1),void 0===s&&(s=null),void 0===o&&(o=this.camera.scene);var h=this.camera;return!r&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&n.hasOwnProperty(i)?this.ease=n[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=s,this._onUpdateScope=o,this.camera.emit(a.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=r(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},20052(t,e,i){t.exports={Fade:i(5020),Flash:i(10662),Pan:i(20359),Shake:i(30330),RotateTo:i(34208),Zoom:i(45641)}},16438(t){t.exports="cameradestroy"},32726(t){t.exports="camerafadeincomplete"},87807(t){t.exports="camerafadeinstart"},45917(t){t.exports="camerafadeoutcomplete"},95666(t){t.exports="camerafadeoutstart"},47056(t){t.exports="cameraflashcomplete"},91261(t){t.exports="cameraflashstart"},45047(t){t.exports="followupdate"},81927(t){t.exports="camerapancomplete"},74264(t){t.exports="camerapanstart"},54419(t){t.exports="postrender"},79330(t){t.exports="prerender"},93183(t){t.exports="camerarotatecomplete"},80112(t){t.exports="camerarotatestart"},62252(t){t.exports="camerashakecomplete"},86017(t){t.exports="camerashakestart"},539(t){t.exports="camerazoomcomplete"},51892(t){t.exports="camerazoomstart"},19715(t,e,i){t.exports={DESTROY:i(16438),FADE_IN_COMPLETE:i(32726),FADE_IN_START:i(87807),FADE_OUT_COMPLETE:i(45917),FADE_OUT_START:i(95666),FLASH_COMPLETE:i(47056),FLASH_START:i(91261),FOLLOW_UPDATE:i(45047),PAN_COMPLETE:i(81927),PAN_START:i(74264),POST_RENDER:i(54419),PRE_RENDER:i(79330),ROTATE_COMPLETE:i(93183),ROTATE_START:i(80112),SHAKE_COMPLETE:i(62252),SHAKE_START:i(86017),ZOOM_COMPLETE:i(539),ZOOM_START:i(51892)}},87969(t,e,i){t.exports={Camera:i(38058),BaseCamera:i(71911),CameraManager:i(32743),Effects:i(20052),Events:i(19715)}},63091(t,e,i){var r=i(83419),s=i(35154),n=new r({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.minZoom=s(t,"minZoom",.001),this.maxZoom=s(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<this.minZoom&&(e.zoom=this.minZoom)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed,e.zoom>this.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},58818(t,e,i){var r=i(83419),s=i(35154),n=new r({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.minZoom=s(t,"minZoom",.001),this.maxZoom=s(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=s(t,"acceleration.x",0),this.accelY=s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=s(t,"drag.x",0),this.dragY=s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var r=s(t,"maxSpeed",null);"number"==typeof r?(this.maxSpeedX=r,this.maxSpeedY=r):(this.maxSpeedX=s(t,"maxSpeed.x",0),this.maxSpeedY=s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<this.minZoom?e.zoom=this.minZoom:e.zoom>this.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=n},38865(t,e,i){t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638(t,e,i){t.exports={Controls:i(38865),Scene2D:i(87969)}},8054(t,e,i){var r={VERSION:"4.1.0",LOG_VERSION:"v401",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=r},69547(t,e,i){var r=i(83419),s=i(8054),n=i(42363),a=i(82264),o=i(95540),h=i(35154),l=i(41212),u=i(29747),d=i(75508),c=i(80333),f=new r({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",s.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io/"+s.LOG_VERSION),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",a.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#000814","#001d3d","#003566"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var i=h(t,"render",null);this.autoMobileTextures=h(i,"autoMobileTextures",!0,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.mipmapRegeneration=h(i,"mipmapRegeneration",!1,t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!1,t),this.selfShadow=h(i,"selfShadow",!1,t),this.pathDetailThreshold=h(i,"pathDetailThreshold",1,t),this.pixelArt=h(i,"pixelArt",!1,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.smoothPixelArt=h(i,"smoothPixelArt",!1,t),this.smoothPixelArt&&(this.antialias=!0,this.antialiasGL=!0,this.pixelArt=!1),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.skipUnreadyShaders=h(i,"skipUnreadyShaders",!1,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",16384,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t),this.renderNodes=h(i,"renderNodes",{},t);var r=h(t,"backgroundColor",0);this.backgroundColor=c(r),this.transparent&&(this.backgroundColor=c(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderMaxRetries=h(t,"loader.maxRetries",2),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowQuality=h(t,"filters.glow.quality",10),this.glowDistance=h(t,"filters.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=h(t,"plugins",null),p=n.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:l(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},86054(t,e,i){var r=i(20623),s=i(27919),n=i(8054),a=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===n.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==n.HEADLESS)if(e.renderType===n.AUTO&&(e.renderType=a.webGL?n.WEBGL:n.CANVAS),e.renderType===n.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==n.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||s.disableSmoothing();var o,h,l=t.scale.baseSize,u=l.width,d=l.height;(e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=d):t.canvas=s.create(t,u,d,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||r.setCrisp(t.canvas),e.renderType!==n.HEADLESS)&&(o=i(68627),h=i(74797),e.renderType===n.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},96391(t,e,i){var r=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===r.CANVAS?i="Canvas":e.renderType===r.HEADLESS&&(i="Headless");var s,n=e.audio,a=t.device.audio;if(s=a.webAudio&&!n.disableWebAudio?"Web Audio":n.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var o="color: "+e.bannerTextColor+";",h=Array.isArray(e.bannerBackgroundColor)?e.bannerBackgroundColor:[e.bannerBackgroundColor];1===h.length&&(h=[h[0],h[0]]),o+=' background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC"), '+("linear-gradient(to bottom, "+h.join(", ")+")")+";",o+=" background-repeat: no-repeat;",o+=" background-position: 4px center, 0 0;";var l="%c",u=[null,o+=" padding: 2px 6px 2px 24px;"];u.push("background: transparent"),e.gameTitle&&(l=l.concat(e.gameTitle),e.gameVersion&&(l=l.concat(" v"+e.gameVersion)),e.hidePhaser||(l=l.concat(" / "))),e.hidePhaser||(l=l.concat("Phaser v"+r.VERSION+" ("+i+" | "+s+")")),l=l.concat("%c "+e.gameURL),u[0]=l,console.log.apply(console,u)}}}},50127(t,e,i){var r=i(40366),s=i(60848),n=i(24047),a=i(27919),o=i(83419),h=i(69547),l=i(83719),u=i(86054),d=i(45893),c=i(96391),f=i(82264),p=i(57264),g=i(50792),m=i(8443),v=i(7003),y=i(37277),x=i(77332),T=i(76531),w=i(60903),b=i(69442),S=i(17130),C=i(65898),E=i(51085),A=i(14747),_=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new S(this),this.cache=new n(this),this.registry=new d(this,new g),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new C(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),c(this),r(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(m.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(m.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),E(this);var t=this.events;t.on(m.HIDDEN,this.onHidden,this),t.on(m.VISIBLE,this.onVisible,this),t.on(m.BLUR,this.onBlur,this),t.on(m.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e);var r=this.renderer;r.preRender(),i.emit(m.PRE_RENDER,r,t,e),this.scene.render(r),r.postRender(),i.emit(m.POST_RENDER,r,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(m.PRE_STEP,t,e),i.emit(m.STEP,t,e),this.scene.update(t,e),i.emit(m.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(m.PRE_RENDER,null,t,e),i.emit(m.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(m.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(m.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(m.RESUME,this.loop.pauseDuration)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(m.RESUME,0)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(m.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},65898(t,e,i){var r=i(83419),s=i(35154),n=i(29747),a=i(43092),o=new r({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this.fpsLimit=s(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=n,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this.pauseDuration=0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.pauseDuration=this.time-this._pauseTime,this.startTime+=this.pauseDuration},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t;var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target)},smoothDelta:function(t){var e=this.deltaIndex,i=this.deltaHistory,r=this.deltaSmoothingMax;(this._coolDown>0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=r&&(this.deltaIndex=0);for(var s=0,n=0;n<r;n++)s+=i[n];return s/=r},updateFPS:function(t){this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0},stepLimitFPS:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta+=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta%=this._limitRate),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=o},51085(t,e,i){var r=i(8443);t.exports=function(t){var e,i=t.events;if(void 0!==document.hidden)e="visibilitychange";else{["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})}e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(r.HIDDEN):i.emit(r.VISIBLE)},!1),window.onblur=function(){i.emit(r.BLUR)},window.onfocus=function(){i.emit(r.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217(t){t.exports="blur"},47548(t){t.exports="boot"},19814(t){t.exports="contextlost"},68446(t){t.exports="destroy"},41700(t){t.exports="focus"},25432(t){t.exports="hidden"},65942(t){t.exports="pause"},59211(t){t.exports="postrender"},47789(t){t.exports="poststep"},39066(t){t.exports="prerender"},460(t){t.exports="prestep"},16175(t){t.exports="ready"},42331(t){t.exports="resume"},11966(t){t.exports="step"},32969(t){t.exports="systemready"},94830(t){t.exports="visible"},8443(t,e,i){t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857(t,e,i){t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},46728(t,e,i){var r=i(83419),s=i(36316),n=i(80021),a=i(26099),o=new r({Extends:n,initialize:function(t,e,i,r){n.call(this,"CubicBezierCurve"),Array.isArray(t)&&(r=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=r},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,r=this.p1,n=this.p2,o=this.p3;return e.set(s(t,i.x,r.x,n.x,o.x),s(t,i.y,r.y,n.y,o.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var r=1;r<i.length;r++)t.lineTo(i[r].x,i[r].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});o.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),r=new a(e[2],e[3]),s=new a(e[4],e[5]),n=new a(e[6],e[7]);return new o(i,r,s,n)},t.exports=o},80021(t,e,i){var r=i(83419),s=i(19217),n=i(87841),a=i(26099),o=new r({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new n),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var r=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(r),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],r=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var n=1;n<=t;n++)s+=(e=this.getPoint(n/t,this._tmpVec2B)).distance(r),i.push(s),r.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++)i.push(this.getPoint(r/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new a),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var r=0;r<=t;r++){var s=this.getUtoTmapping(r/t,null,t);i.push(this.getPoint(s))}return i},getStartPoint:function(t){return void 0===t&&(t=new a),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new a);var i=1e-4,r=t-i,s=t+i;return r<0&&(r=0),s>1&&(s=1),this.getPoint(r,this._tmpVec2A),this.getPoint(s,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var r,s=this.getLengths(i),n=0,a=s.length;r=e?Math.min(e,s[a-1]):t*s[a-1];for(var o,h=0,l=a-1;h<=l;)if((o=s[n=Math.floor(h+(l-h)/2)]-r)<0)h=n+1;else{if(!(o>0)){l=n;break}l=n-1}if(s[n=l]===r)return n/(a-1);var u=s[n];return(n+(r-u)/(s[n+1]-u))/(a-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=o},73825(t,e,i){var r=i(83419),s=i(80021),n=i(39506),a=i(35154),o=i(43396),h=i(26099),l=new r({Extends:s,initialize:function(t,e,i,r,o,l,u,d){if("object"==typeof t){var c=t;t=a(c,"x",0),e=a(c,"y",0),i=a(c,"xRadius",0),r=a(c,"yRadius",i),o=a(c,"startAngle",0),l=a(c,"endAngle",360),u=a(c,"clockwise",!1),d=a(c,"rotation",0)}else void 0===r&&(r=i),void 0===o&&(o=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===d&&(d=0);s.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=r,this._startAngle=n(o),this._endAngle=n(l),this._clockwise=u,this._rotation=n(d)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,r=this._endAngle-this._startAngle,s=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=s?0:i),this._clockwise&&!s&&(r===i?r=-i:r-=i);var n=this._startAngle+t*r,a=this.p0.x+this._xRadius*Math.cos(n),o=this.p0.y+this._yRadius*Math.sin(n);if(0!==this._rotation){var l=Math.cos(this._rotation),u=Math.sin(this._rotation),d=a-this.p0.x,c=o-this.p0.y;a=d*l-c*u+this.p0.x,o=d*u+c*l+this.p0.y}return e.set(a,o)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=t/2,this},setHeight:function(t){return this.yRadius=t/2,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return o(this._startAngle)},set:function(t){this._startAngle=n(t)}},endAngle:{get:function(){return o(this._endAngle)},set:function(t){this._endAngle=n(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},angle:{get:function(){return o(this._rotation)},set:function(t){this._rotation=n(t)}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:o(this._startAngle),endAngle:o(this._endAngle),clockwise:this._clockwise,rotation:o(this._rotation)}}});l.fromJSON=function(t){return new l(t)},t.exports=l},33951(t,e,i){var r=i(83419),s=i(80021),n=i(19217),a=i(87841),o=i(26099),h=new r({Extends:s,initialize:function(t,e){s.call(this,"LineCurve"),Array.isArray(t)&&(e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new a),n([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new o),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new o),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var r;if(e){var s=this.getLengths(i),n=s[s.length-1];r=Math.min(e,n)/n}else r=t;return r},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),r=new o(e[2],e[3]);return new h(i,r)},t.exports=h},14744(t,e,i){var r=i(83419),s=i(80021),n=i(32112),a=i(26099),o=new r({Extends:s,initialize:function(t,e,i){s.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,r=this.p1,s=this.p2;return e.set(n(t,i.x,r.x,s.x),n(t,i.y,r.y,s.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var r=1;r<i.length;r++)t.lineTo(i[r].x,i[r].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});o.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),r=new a(e[2],e[3]),s=new a(e[4],e[5]);return new o(i,r,s)},t.exports=o},42534(t,e,i){var r=i(87842),s=i(83419),n=i(80021),a=i(26099),o=new s({Extends:n,initialize:function(t){void 0===t&&(t=[]),n.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;e<t.length;e++){var i=new a;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new a(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.points,s=(i.length-1)*t,n=Math.floor(s),o=s-n,h=i[0===n?n:n-1],l=i[n],u=i[n>i.length-2?i.length-1:n+1],d=i[n>i.length-3?i.length-1:n+2];return e.set(r(o,h.x,l.x,u.x,d.x),r(o,h.y,l.y,u.y,d.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});o.fromJSON=function(t){return new o(t.points)},t.exports=o},25410(t,e,i){t.exports={Path:i(46669),MoveTo:i(68618),CubicBezier:i(46728),Curve:i(80021),Ellipse:i(73825),Line:i(33951),QuadraticBezier:i(14744),Spline:i(42534)}},68618(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=n},46669(t,e,i){var r=i(83419),s=i(46728),n=i(73825),a=i(39429),o=i(33951),h=i(68618),l=i(14744),u=i(87841),d=i(42534),c=i(26099),f=i(36383),p=new r({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new c,this._tmpVec2A=new c,this._tmpVec2B=new c,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new o(e,t)),this},cubicBezierTo:function(t,e,i,r,n,a){var o,h,l,u=this.getEndPoint();return t instanceof c?(o=t,h=e,l=i):(o=new c(i,r),h=new c(n,a),l=new c(t,e)),this.add(new s(u,o,h,l))},quadraticBezierTo:function(t,e,i,r){var s,n,a=this.getEndPoint();return t instanceof c?(s=t,n=e):(s=new c(i,r),n=new c(t,e)),this.add(new l(a,s,n))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var r=this.curves[i];r.active&&r.draw(t,e)}return t},ellipseTo:function(t,e,i,r,s,a){var o=new n(0,0,t,e,i,r,s,a),h=this.getEndPoint(this._tmpVec2A),l=o.getStartPoint(this._tmpVec2B);return h.subtract(l),o.x=h.x,o.y=h.y,this.add(o)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(o.fromJSON(i));break;case"EllipseCurve":this.add(n.fromJSON(i));break;case"SplineCurve":this.add(d.fromJSON(i));break;case"CubicBezierCurve":this.add(s.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new u),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new u,r=f.MIN_SAFE_INTEGER,s=f.MIN_SAFE_INTEGER,n=0;n<this.curves.length;n++){var a=this.curves[n];a.active&&(a.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),r=Math.max(r,i.right),s=Math.max(s,i.bottom))}return t.right=r,t.bottom=s,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getCurveAt:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),r=0;r<i.length;){if(i[r]>=e)return this.curves[r];r++}return null},getEndPoint:function(t){return void 0===t&&(t=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s<r.length;){if(r[s]>=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getPointAt(h,e)}s++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,r=[],s=0;s<this.curves.length;s++){var n=this.curves[s];if(n.active)for(var a=n.getResolution(t),o=n.getPoints(a,e),h=0;h<o.length;h++){var l=o[h];i&&i.equals(l)||(r.push(l),i=l)}}return this.autoClose&&r.length>1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},getRandomPoint:function(t){return void 0===t&&(t=new c),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new c);for(var i=t*this.getLength(),r=this.getCurveLengths(),s=0;s<r.length;){if(r[s]>=i){var n=r[s]-i,a=this.curves[s],o=a.getLength(),h=0===o?0:1-n/o;return a.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof c?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new o([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new d(t))},moveTo:function(t,e){return t instanceof c?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});a.register("path",function(t,e){return new p(t,e)}),t.exports=p},45893(t,e,i){var r=i(83419),s=i(24882),n=new r({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(s.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],r=0;r<t.length;r++)i.push(e[t[r]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,r=this.list,n=this.events,a=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return r[t]},set:function(e){if(!i._frozen){var o=r[t];r[t]=e,n.emit(s.CHANGE_DATA,a,t,e,o),n.emit(s.CHANGE_DATA_KEY+t,a,e,o)}}}),r[t]=e,n.emit(s.SET_DATA,a,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],r=1;r<arguments.length;r++)i.push(arguments[r]);for(var s in this.list)i[1]=s,i[2]=this.list[s],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(s.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(s.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(s.CHANGE_DATA),this.events.off(s.SET_DATA),this.events.off(s.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=n},63646(t,e,i){var r=i(83419),s=i(45893),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});n.register("DataManagerPlugin",o,"data"),t.exports=o},10700(t){t.exports="changedata"},93608(t){t.exports="changedata-"},60883(t){t.exports="destroy"},69780(t){t.exports="removedata"},22166(t){t.exports="setdata"},24882(t,e,i){t.exports={CHANGE_DATA:i(10700),CHANGE_DATA_KEY:i(93608),DESTROY:i(60883),REMOVE_DATA:i(69780),SET_DATA:i(22166)}},44965(t,e,i){t.exports={DataManager:i(45893),DataManagerPlugin:i(63646),Events:i(24882)}},7098(t,e,i){var r=i(84148),s={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return s;s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var r=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(r||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(r)};if(s.ogg=i('ogg; codecs="vorbis"'),s.opus=i('ogg; codecs="opus"',"opus"),s.mp3=i("mpeg"),s.wav=i("wav"),s.m4a=i("x-m4a"),s.aac=i("aac"),s.flac=i("flac","x-flac"),s.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(r.edge)s.dolby=!0;else if(r.safari&&r.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var n=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===n&&a>=11||n>10)&&(s.dolby=!0)}}}catch(t){}return s}()},84148(t,e,i){var r,s=i(25892),n={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(r=navigator.userAgent,/Edg\/\d+/.test(r)?(n.edge=!0,n.es2019=!0):/OPR/.test(r)?(n.opera=!0,n.es2019=!0):/Chrome\/(\d+)/.test(r)&&!s.windowsPhone?(n.chrome=!0,n.chromeVersion=parseInt(RegExp.$1,10),n.es2019=n.chromeVersion>69):/Firefox\D+(\d+)/.test(r)?(n.firefox=!0,n.firefoxVersion=parseInt(RegExp.$1,10),n.es2019=n.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(r)&&s.iOS?(n.mobileSafari=!0,n.es2019=!0):/MSIE (\d+\.\d+);/.test(r)?(n.ie=!0,n.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(r)&&!s.windowsPhone?(n.safari=!0,n.safariVersion=parseInt(RegExp.$1,10),n.es2019=n.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(r)&&(n.ie=!0,n.trident=!0,n.tridentVersion=parseInt(RegExp.$1,10),n.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(r)&&(n.silk=!0),n)},89289(t,e,i){var r,s,n,a=i(27919),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(n=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(n,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=r+"/wCKxvRF"+s},n.src=r+"AP804Oa6"+s,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),r=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),r}()),o)},89357(t,e,i){var r=i(25892),s=i(84148),n=i(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=n.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=n.create2D(this),r=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=r.data instanceof Uint8ClampedArray,n.remove(t),n.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(s.ie||s.firefox||s.chrome)&&(a.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},91639(t){var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",r="FullScreen",s=["request"+i,"request"+r,"webkitRequest"+i,"webkitRequest"+r,"msRequest"+i,"msRequest"+r,"mozRequest"+r,"mozRequest"+i];for(t=0;t<s.length;t++)if(document.documentElement[s[t]]){e.available=!0,e.request=s[t];break}var n=["cancel"+r,"exit"+i,"webkitCancel"+r,"webkitExit"+i,"msCancel"+r,"msExit"+i,"mozCancel"+r,"mozExit"+i];if(e.available)for(t=0;t<n.length;t++)if(document[n[t]]){e.cancel=n[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(e.keyboard=!0),Object.defineProperty(e,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),e}()},31784(t,e,i){var r=i(84148),s={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll")),s)},25892(t){var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267(t,e,i){var r=i(95540),s={h264:!1,hls:!1,mov:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return s;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(s.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(s.h264=!0,s.mp4=!0),t.canPlayType('video/quicktime4; codecs="avc1.42E01E"').replace(i,"")&&(s.mov=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(s.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(s.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(s.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(s.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),s.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i,n=r(t[e],"url",t[e]);if(0===n.indexOf("blob:"))return{url:n,type:""};if(i=0===n.indexOf("data:")?n.split(",")[0].match(/\/(.*?);/):n.match(/\.([a-zA-Z0-9]+)($|\?)/),i=r(t[e],"type",i?i[1]:"").toLowerCase(),s[i])return{url:n,type:i}}return null},s}()},82264(t,e,i){t.exports={os:i(25892),browser:i(84148),features:i(89357),input:i(31784),audio:i(7098),video:i(43267),fullscreen:i(91639),canvasFeatures:i(89289)}},34664(t,e,i){var r=i(79980),s=i(28915),n=i(83419),a=i(40987),o=i(13699),h=new n({initialize:function(t){t||(t={}),this.isColorBand=!0,this.colorStart=new a,this.colorEnd=new a,this.start=t.start||0,this.middle=void 0===t.middle?.5:t.middle,this.end=1,void 0!==t.end?this.end=t.end:void 0!==t.size&&(this.end=this.start+t.size),this.interpolation=t.interpolation||0,this.colorSpace=t.colorSpace||0,this.setColors(t.colorStart,t.colorEnd)},setColors:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=t),"number"==typeof t?a.IntegerToColor(t,this.colorStart):"string"==typeof t?a.HexStringToColor(t,this.colorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.colorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof a&&this.colorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?a.IntegerToColor(e,this.colorEnd):"string"==typeof e?a.HexStringToColor(e,this.colorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.colorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof a&&this.colorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},getColor:function(t){var e=Math.log(.5)/Math.log(this.middle);switch(t=Math.pow(t,e),t=Math.min(Math.max(0,t),1),this.interpolation){case 1:(t*=2)<1?t=.5*Math.sqrt(1- --t*t):(t=1-t,t=1-.5*Math.sqrt(1-t*t));break;case 2:t=r.InOut(t);break;case 3:t=r.Out(t);break;case 4:t=r.In(t)}var i=0;2===this.colorSpace?i=1:3===this.colorSpace&&(i=-1);var n=o.ColorWithColor(this.colorStart,this.colorEnd,1,t,0!==this.colorSpace,i);return n.a=s(this.colorStart.alpha,this.colorEnd.alpha,t),n}});t.exports=h},89422(t,e,i){var r=i(83419),s=new Float32Array(20),n=new r({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,r=-.5*(i-1);return this.multiply([i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),s=.213,n=.715,a=.072;return this.multiply([s+.787*i+r*-s,n+i*-n+r*-n,a+i*-a+.928*r,0,0,s+i*-s+.143*r,n+i*(1-n)+.14*r,a+i*-a+-.283*r,0,0,s+i*-s+-.787*r,n+i*-n+r*n,a+.928*i+r*a,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(n.BLACK_WHITE,t)},black:function(t){return this.multiply(n.BLACK,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,r=-.5*(i-1);return this.multiply([i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(n.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(n.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(n.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(n.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(n.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(n.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(n.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(n.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(n.POLAROID,t)},alphaToBrightness:function(t){return void 0===t&&(t=!1),this.multiply(n.ALPHA_TO_BRIGHTNESS,t)},alphaToBrightnessInverse:function(t){return void 0===t&&(t=!1),this.multiply(n.ALPHA_TO_BRIGHTNESS_INVERSE,t)},brightnessToAlpha:function(t){return void 0===t&&(t=!1),this.multiply(n.BRIGHTNESS_TO_ALPHA,t)},brightnessToAlphaInverse:function(t){return void 0===t&&(t=!1),this.multiply(n.BRIGHTNESS_TO_ALPHA_INVERSE,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(n.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,r=s;return r.set(i),i.set([r[0]*t[0]+r[1]*t[5]+r[2]*t[10]+r[3]*t[15],r[0]*t[1]+r[1]*t[6]+r[2]*t[11]+r[3]*t[16],r[0]*t[2]+r[1]*t[7]+r[2]*t[12]+r[3]*t[17],r[0]*t[3]+r[1]*t[8]+r[2]*t[13]+r[3]*t[18],r[0]*t[4]+r[1]*t[9]+r[2]*t[14]+r[3]*t[19]+r[4],r[5]*t[0]+r[6]*t[5]+r[7]*t[10]+r[8]*t[15],r[5]*t[1]+r[6]*t[6]+r[7]*t[11]+r[8]*t[16],r[5]*t[2]+r[6]*t[7]+r[7]*t[12]+r[8]*t[17],r[5]*t[3]+r[6]*t[8]+r[7]*t[13]+r[8]*t[18],r[5]*t[4]+r[6]*t[9]+r[7]*t[14]+r[8]*t[19]+r[9],r[10]*t[0]+r[11]*t[5]+r[12]*t[10]+r[13]*t[15],r[10]*t[1]+r[11]*t[6]+r[12]*t[11]+r[13]*t[16],r[10]*t[2]+r[11]*t[7]+r[12]*t[12]+r[13]*t[17],r[10]*t[3]+r[11]*t[8]+r[12]*t[13]+r[13]*t[18],r[10]*t[4]+r[11]*t[9]+r[12]*t[14]+r[13]*t[19]+r[14],r[15]*t[0]+r[16]*t[5]+r[17]*t[10]+r[18]*t[15],r[15]*t[1]+r[16]*t[6]+r[17]*t[11]+r[18]*t[16],r[15]*t[2]+r[16]*t[7]+r[17]*t[12]+r[18]*t[17],r[15]*t[3]+r[16]*t[8]+r[17]*t[13]+r[18]*t[18],r[15]*t[4]+r[16]*t[9]+r[17]*t[14]+r[18]*t[19]+r[19]]),this._dirty=!0,this}});n.BLACK=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0],n.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],n.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],n.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],n.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],n.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],n.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],n.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],n.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],n.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],n.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],n.ALPHA_TO_BRIGHTNESS=[0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,255],n.ALPHA_TO_BRIGHTNESS_INVERSE=[0,0,0,-1,255,0,0,0,-1,255,0,0,0,-1,255,0,0,0,0,255],n.BRIGHTNESS_TO_ALPHA=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,.3,.6,.1,0,0],n.BRIGHTNESS_TO_ALPHA_INVERSE=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,-.3,-.6,-.1,0,255],n.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=n},73043(t,e,i){var r=i(28915),s=i(70554),n=i(83419),a=i(45650),o=i(34664),h=s.getTintFromFloats,l=new n({initialize:function(t,e,i){void 0===i&&(i=!0),this.scene=t,this.bands=[],this.gpuEncode=i,this.dataTexture=null,this.glTexture=null,this.dataTextureFirstBand=0,this.bandTreeDepth=0,this.dataTextureResolution=[0,0],this.setBands(e)},setBands:function(t,e){this.bands.length=0,Array.isArray(t)||(t=[t]);for(var i=0,r=0;r<t.length;r++){var s=t[r];if(s.isColorBand)this.bands.push(s),i=s.end;else{void 0===s.start&&(s=Object.assign({start:i},s));var n=new o(s);this.bands.push(n),i=n.end}}return!1!==e&&this.gpuEncode&&this.encode(),this},encode:function(){var t=this.bands.length,e=Math.ceil(Math.log2(t));this.bandTreeDepth=e;var i=Math.pow(2,e)-1,r=(8+4*i+12*t)/4,s=1;r>4096&&(s=Math.ceil(r/4096),r=4096),this.dataTextureResolution[0]=r,this.dataTextureResolution[1]=s;var n=new ArrayBuffer(r*s*4),o=new Uint32Array(n),l=new Uint8Array(n),u=0,d=65536;o[u++]=Math.round(this.bands[0].start*d),o[u++]=Math.round(this.bands[this.bands.length-1].end*d);for(var c=0;c<=e;c++)for(var f=Math.pow(2,c),p=1;p<f;p+=2){var g=Math.floor(i*p/f),m=this.bands[Math.min(g,t-1)];o[u++]=Math.round(m.end*d)}this.dataTextureFirstBand=u;for(var v=0;v<t;v++){var y=(m=this.bands[v]).colorStart,x=m.colorEnd;o[u++]=h(y.blueGL,y.greenGL,y.redGL,y.alphaGL),o[u++]=h(x.blueGL,x.greenGL,x.redGL,x.alphaGL);var T=255*m.colorSpace,w=m.interpolation,b=m.middle/2;o[u++]=d*(T+w+b)}if(this.glTexture){var S=this.glTexture;S.update(l,r,s,S.flipY,S.wrapS,S.wrapT,S.minFilter,S.magFilter,S.format)}else{var C=this.scene.renderer.createUint8ArrayTexture(l,r,s,!1,!1);this.glTexture=C;for(var E=a();this.scene.textures.exists(E);)E=a();this.dataTexture=this.scene.textures.addGLTexture(E,C)}},fixFit:function(t,e,i,r){var s=this.bands;if(0===s.length)return this;void 0===i&&(i=!0),void 0===r&&(r=!0),void 0!==t&&(s[0].start=t),void 0!==e&&(s[s.length-1].end=e);for(var n=0;n<s.length-1;n++){var a=s[n],o=s[n+1];o.start=a.end,o.start>o.end&&(o.end=o.start)}return i&&(this.bands=s.filter(function(t){return t.start<t.end})),r&&this.encode(),this},splitBand:function(t,e,i,s){if(0===e)return this;void 0===e&&(e=2),void 0===s&&(s=!0);var n=0;if("number"==typeof t)n=t,t=this.bands[t];else if(-1===(n=this.bands.indexOf(t)))return this;if(!t)return this;this.bands.splice(n,1);for(var a=0;a<e;a++){var h=a/e,l=(a+1)/e;i&&(h=a/(e-1),l=(a+1)/(e-1));var u=t.getColor(h),d=t.getColor(l);i&&(d=u);var c=new o({colorStart:[u.r/255,u.g/255,u.b/255,u.a/255],colorEnd:[d.r/255,d.g/255,d.b/255,d.a/255],start:r(t.start,t.end,h),end:r(t.start,t.end,l),middle:t.middle,interpolation:t.interpolation,colorSpace:t.colorSpace});this.bands.splice(n++,0,c)}return s&&this.encode(),this},getColor:function(t){for(var e,i=0;i<this.bands.length;i++){var r=this.bands[i];if(r.start<=t&&r.end>=t){e=r;break}}return e?(t=(t-e.start)/(e.end-e.start),e.getColor(t)):{r:0,g:0,b:0,a:0,color:0}},destroy:function(){this.scene=null,this.dataTexture&&this.dataTexture.destroy()}});t.exports=l},51767(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=s,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var r=this._rgb;return r[0]===t&&r[1]===e&&r[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=n},60461(t){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312(t,e,i){var r=i(62235),s=i(35893),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46768(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},35827(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},46871(t,e,i){var r=i(66786),s=i(35893),n=i(7702);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i,n(e)+a),t}},5198(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},11879(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(54312),s[r.BOTTOM_LEFT]=i(46768),s[r.BOTTOM_RIGHT]=i(35827),s[r.CENTER]=i(46871),s[r.LEFT_CENTER]=i(5198),s[r.RIGHT_CENTER]=i(80503),s[r.TOP_CENTER]=i(89698),s[r.TOP_LEFT]=i(922),s[r.TOP_RIGHT]=i(21373),s[r.LEFT_BOTTOM]=s[r.BOTTOM_LEFT],s[r.LEFT_TOP]=s[r.TOP_LEFT],s[r.RIGHT_BOTTOM]=s[r.BOTTOM_RIGHT],s[r.RIGHT_TOP]=s[r.TOP_RIGHT];t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},80503(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},89698(t,e,i){var r=i(35893),s=i(17717),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},922(t,e,i){var r=i(26541),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},21373(t,e,i){var r=i(54380),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},91660(t,e,i){t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926(t,e,i){var r=i(60461),s=i(79291),n={In:i(91660),To:i(16694)};n=s(!1,n,r),t.exports=n},21578(t,e,i){var r=i(62235),s=i(35893),n=i(88417),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},10210(t,e,i){var r=i(62235),s=i(26541),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)-i),a(t,r(e)+o),t}},82341(t,e,i){var r=i(62235),s=i(54380),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i),a(t,r(e)+o),t}},87958(t,e,i){var r=i(62235),s=i(26541),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},40080(t,e,i){var r=i(7702),s=i(26541),n=i(20786),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)-i),n(t,r(e)+o),t}},88466(t,e,i){var r=i(26541),s=i(17717),n=i(40136),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)-i),a(t,s(e)-o),t}},38829(t,e,i){var r=i(60461),s=[];s[r.BOTTOM_CENTER]=i(21578),s[r.BOTTOM_LEFT]=i(10210),s[r.BOTTOM_RIGHT]=i(82341),s[r.LEFT_BOTTOM]=i(87958),s[r.LEFT_CENTER]=i(40080),s[r.LEFT_TOP]=i(88466),s[r.RIGHT_BOTTOM]=i(19211),s[r.RIGHT_CENTER]=i(34609),s[r.RIGHT_TOP]=i(48741),s[r.TOP_CENTER]=i(49440),s[r.TOP_LEFT]=i(81288),s[r.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,r,n){return s[i](t,e,r,n)}},19211(t,e,i){var r=i(62235),s=i(54380),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},34609(t,e,i){var r=i(7702),s=i(54380),n=i(20786),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,s(e)+i),n(t,r(e)+o),t}},48741(t,e,i){var r=i(54380),s=i(17717),n=i(385),a=i(66737);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i),a(t,s(e)-o),t}},49440(t,e,i){var r=i(35893),s=i(17717),n=i(86327),a=i(88417);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},81288(t,e,i){var r=i(26541),s=i(17717),n=i(86327),a=i(385);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)-i),n(t,s(e)-o),t}},61323(t,e,i){var r=i(54380),s=i(17717),n=i(86327),a=i(40136);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),a(t,r(e)+i),n(t,s(e)-o),t}},16694(t,e,i){t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786(t,e,i){var r=i(88417),s=i(20786);t.exports=function(t,e,i){return r(t,e),s(t,i)}},62235(t){t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873(t,e,i){var r=i(62235),s=i(26541),n=i(54380),a=i(17717),o=i(87841);t.exports=function(t,e){void 0===e&&(e=new o);var i=s(t),h=a(t);return e.x=i,e.y=h,e.width=n(t)-i,e.height=r(t)-h,e}},35893(t){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702(t){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541(t){t.exports=function(t){return t.x-t.width*t.originX}},87431(t){t.exports=function(t){return t.width*t.originX}},46928(t){t.exports=function(t){return t.height*t.originY}},54380(t){t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717(t){t.exports=function(t){return t.y-t.height*t.originY}},86327(t){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417(t){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786(t){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385(t){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136(t){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737(t){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724(t,e,i){t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623(t){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919(t,e,i){var r,s,n,a=i(8054),o=i(68703),h=[],l=!1;t.exports=(n=function(){var t=0;return h.forEach(function(e){e.parent&&t++}),t},{create2D:function(t,e,i){return r(t,e,i,a.CANVAS)},create:r=function(t,e,i,r,n){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===r&&(r=a.CANVAS),void 0===n&&(n=!1);var d=s(r);return null===d?(d={parent:t,canvas:document.createElement("canvas"),type:r},r===a.CANVAS&&h.push(d),u=d.canvas):(d.parent=t,u=d.canvas),n&&(d.parent=u),u.width=e,u.height=i,l&&r===a.CANVAS&&o.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return r(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-n()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach(function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)})},total:n})},68703(t){var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var r=e[i]+"mageSmoothingEnabled";if(r in t)return r}return null},isEnabled:function(t){return null!==i?t[i]:null}}},65208(t){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},91610(t){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},26253(t,e,i){t.exports={CanvasInterpolation:i(20623),CanvasPool:i(27919),Smoothing:i(68703),TouchAction:i(65208),UserSelect:i(91610)}},40987(t,e,i){var r=i(83419),s=i(37589),n=i(1e3),a=i(7537),o=i(87837),h=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,r)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,r,s){return void 0===r&&(r=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=r,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,r){return void 0===r&&(r=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=r,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return a(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,r=this.b,a=this.a;return this._color=s(e,i,r),this._color32=n(e,i,r,a),this._rgba="rgba("+e+","+i+","+r+","+a/255+")",t&&o(e,i,r,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return o(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),r=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,r,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,r=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),r=Math.max(0,Math.min(255,r-Math.round(-t/100*255))),this.setTo(e,i,r)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,a(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,a(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,a(this._h,this._s,t,this)}}});t.exports=h},92728(t,e,i){var r=i(37589);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],s=255,n=255,a=0,o=0;for(e=0;e<=s;e++)i.push({r:n,g:e,b:o,color:r(n,e,o)});for(a=255,e=s;e>=0;e--)i.push({r:e,g:a,b:o,color:r(e,a,o)});for(n=0,e=0;e<=s;e++,a--)i.push({r:n,g:a,b:e,color:r(n,a,e)});for(a=0,o=255,e=0;e<=s;e++,o--,n++)i.push({r:n,g:a,b:o,color:r(n,a,o)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e<t;e++)h.push(i[Math.floor(l)]),l+=u;return h}},91588(t){t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957(t){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589(t){t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3(t){t.exports=function(t,e,i,r){return r<<24|t<<16|e<<8|i}},62183(t,e,i){var r=i(40987),s=i(89528);t.exports=function(t,e,i,n){n||(n=new r);var a=i,o=i,h=i;if(0!==e){var l=i<.5?i*(1+e):i+e-i*e,u=2*i-l;a=s(u,l,t+1/3),o=s(u,l,t),h=s(u,l,t-1/3)}return n.setGLTo(a,o,h,1)}},27939(t,e,i){var r=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(r(s/359,t,e));return i}},7537(t,e,i){var r=i(37589);function s(t,e,i,r){var s=(t+6*e)%6,n=Math.min(s,4-s,1);return Math.round(255*(r-r*i*Math.max(0,n)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var a=s(5,t,e,i),o=s(3,t,e,i),h=s(1,t,e,i);return n?n.setTo?n.setTo(a,o,h,n.alpha,!0):(n.r=a,n.g=o,n.b=h,n.color=r(a,o,h),n):{r:a,g:o,b:h,color:r(a,o,h)}}},70238(t,e,i){var r=i(40987);t.exports=function(t,e){e||(e=new r),t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,r){return e+e+i+i+r+r});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),n=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(s,n,a)}return e}},89528(t){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100(t,e,i){var r=i(40987),s=i(90664);t.exports=function(t,e){var i=s(t);return e?e.setTo(i.r,i.g,i.b,i.a):new r(i.r,i.g,i.b,i.a)}},90664(t){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699(t,e,i){var r=i(28915),s=i(37589),n=i(7537),a=function(t,e,i,n,a,o,h,l){void 0===h&&(h=100),void 0===l&&(l=0);var u=l/h,d=r(t,n,u),c=r(e,a,u),f=r(i,o,u);return{r:d,g:c,b:f,a:255,color:s(d,c,f)}},o=function(t,e,i,s,a,o,h,l,u){if(void 0===u&&(u=0),0===u){var d=t-s;d>.5?t-=1:d<-.5&&(t+=1)}else u>0?t>s&&(t-=1):t<s&&(t+=1);var c=l/h,f=r(t,s,c),p=r(e,a,c),g=r(i,o,c);return n(f,p,g)};t.exports={RGBWithRGB:a,HSVWithHSV:o,ColorWithRGB:function(t,e,i,r,s,n){return void 0===s&&(s=100),void 0===n&&(n=0),a(t.r,t.g,t.b,e,i,r,s,n)},ColorWithColor:function(t,e,i,r,s,n){return void 0===i&&(i=100),void 0===r&&(r=0),s?o(t.h,t.s,t.v,e.h,e.s,e.v,i,r,n):a(t.r,t.g,t.b,e.r,e.g,e.b,i,r)}}},68957(t,e,i){var r=i(40987);t.exports=function(t,e){return e?e.setTo(t.r,t.g,t.b,t.a):new r(t.r,t.g,t.b,t.a)}},87388(t,e,i){var r=i(40987);t.exports=function(t,e){e||(e=new r);var i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),n=parseInt(i[2],10),a=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,n,a,255*o)}return e}},87837(t){t.exports=function(t,e,i,r){void 0===r&&(r={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),n=Math.max(t,e,i),a=n-s,o=0,h=0===n?0:a/n,l=n;return n!==s&&(n===t?o=(e-i)/a+(e<i?6:0):n===e?o=(i-t)/a+2:n===i&&(o=(t-e)/a+4),o/=6),r.hasOwnProperty("_h")?(r._h=o,r._s=h,r._v=l):(r.h=o,r.s=h,r.v=l),r}},75723(t,e,i){var r=i(62957);t.exports=function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n="#"),"#"===n?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+r(s)+r(t)+r(e)+r(i)}},85386(t,e,i){var r=i(30976),s=i(40987);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(r(t,e),r(t,e),r(t,e))}},80333(t,e,i){var r=i(70238),s=i(30100),n=i(68957),a=i(87388);t.exports=function(t,e){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?a(t,e):r(t,e);case"number":return s(t,e);case"object":return n(t,e)}}},3956(t,e,i){var r=i(40987);r.ColorSpectrum=i(92728),r.ColorToRGBA=i(91588),r.ComponentToHex=i(62957),r.GetColor=i(37589),r.GetColor32=i(1e3),r.HexStringToColor=i(70238),r.HSLToColor=i(62183),r.HSVColorWheel=i(27939),r.HSVToRGB=i(7537),r.HueToComponent=i(89528),r.IntegerToColor=i(30100),r.IntegerToRGB=i(90664),r.Interpolate=i(13699),r.ObjectToColor=i(68957),r.RandomRGB=i(85386),r.RGBStringToColor=i(87388),r.RGBToHSV=i(87837),r.RGBToString=i(75723),r.ValueToColor=i(80333),t.exports=r},27460(t,e,i){t.exports={Align:i(71926),BaseShader:i(73894),Bounds:i(58724),Canvas:i(26253),Color:i(3956),ColorBand:i(34664),ColorMatrix:i(89422),ColorRamp:i(73043),Masks:i(69781),RGB:i(51767)}},80661(t,e,i){var r=new(i(83419))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){return this.geometryMask=t,this},preRenderCanvas:function(t,e,i){var r=this.geometryMask;t.currentContext.save(),r.renderCanvas(t,r,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=r},69781(t,e,i){t.exports={GeometryMask:i(80661)}},73894(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){void 0===i&&(i={}),this.key=t,this.glsl=e,this.metadata=i}});t.exports=r},40366(t){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},83719(t,e,i){var r=i(40366);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,r(i,e.parent)}}},57264(t,e,i){var r=i(25892);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?r.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},57811(t){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},r=document.createElement("div");return r.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(r),i.w=90===e?r.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:r.offsetHeight,document.documentElement.removeChild(r),r=null,90!==Math.abs(window.orientation)?i.h:i.w}},45818(t,e,i){var r=i(13560);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return s&&"string"==typeof s.type?s.type:"string"==typeof s?s:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?r.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?r.ORIENTATION.LANDSCAPE:void 0:e>t?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE}},74403(t){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836(t){t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846(t){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092(t,e,i){var r=i(83419),s=i(29747),n=new r({initialize:function(){this.isRunning=!1,this.callback=s,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=n},84902(t,e,i){var r={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=r},47565(t,e,i){var r=i(83419),s=i(50792),n=i(37277),a=new r({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});n.register("EventEmitter",a,"events"),t.exports=a},93055(t,e,i){t.exports={EventEmitter:i(47565)}},10189(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterBarrel"),this.amount=e}});t.exports=n},16762(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n){void 0===e&&(e="__WHITE"),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=[1,1,1,1]),s.call(this,t,"FilterBlend"),this.glTexture,this.blendMode=i,this.amount=r,this.color=n,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=n},37597(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterBlocky"),this.size={x:4,y:4},this.offset={x:0,y:0},e&&(void 0!==e.size&&("number"==typeof e.size?(this.size.x=e.size,this.size.y=e.size):(this.size.x=e.size.x,this.size.y=e.size.y)),void 0!==e.offset&&("number"==typeof e.offset?(this.offset.x=e.offset,this.offset.y=e.offset):(this.offset.x=e.offset.x,this.offset.y=e.offset.y)))}});t.exports=n},88344(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o){void 0===e&&(e=0),void 0===i&&(i=2),void 0===r&&(r=2),void 0===n&&(n=1),void 0===o&&(o=4),s.call(this,t,"FilterBlur"),this.quality=e,this.x=i,this.y=r,this.strength=n,this.glcolor=[1,1,1],null!=a&&(this.color=a),this.steps=o},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.quality,i=0===e?1.333:1===e?3.2307692308:5.176470588235294,r=this.steps*this.strength*i,s=Math.ceil(this.x*r),n=Math.ceil(this.y*r);return this.currentPadding.setTo(-s,-n,2*s,2*n),this.currentPadding}});t.exports=n},47564(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===r&&(r=.2),void 0===n&&(n=!1),void 0===a&&(a=1),void 0===o&&(o=1),void 0===h&&(h=1),s.call(this,t,"FilterBokeh"),this.radius=e,this.amount=i,this.contrast=r,this.isTiltShift=n,this.blurX=a,this.blurY=o,this.strength=h},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=Math.ceil(this.camera.height*this.radius*.021426096060426905);return this.currentPadding.setTo(-e,-e,2*e,2*e),this.currentPadding}});t.exports=n},77011(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t){s.call(this,t,"FilterColorMatrix"),this.colorMatrix=new n},destroy:function(){this.colorMatrix=null,s.prototype.destroy.call(this)}});t.exports=a},95200(t,e,i){var r=i(83419),s=i(13045),n=i(89422),a=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterCombineColorMatrix"),this.glTexture,this.colorMatrixSelf=new n,this.colorMatrixTransfer=new n,this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],this.setTexture(e||"__WHITE")},setTexture:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},setupAlphaTransfer:function(t,e,i,r,s,n){var a=this.colorMatrixSelf,o=this.colorMatrixTransfer;a.reset(),o.reset(),this.additions=[1,1,1,0],this.multiplications=[0,0,0,1],t||a.black(),e||o.black(),s?a.brightnessToAlphaInverse(!0):i&&a.brightnessToAlpha(!0),n?o.brightnessToAlphaInverse(!0):r&&o.brightnessToAlpha(!0)},destroy:function(){this.colorMatrixSelf=null,this.colorMatrixTransfer=null,s.prototype.destroy.call(this)}});t.exports=a},13045(t,e,i){var r=i(83419),s=i(87841),n=new r({initialize:function(t,e){this.active=!0,this.camera=t,this.renderNode=e,this.paddingOverride=new s,this.currentPadding=new s,this.allowBaseDraw=!0,this.ignoreDestroy=!1},getPadding:function(){return this.paddingOverride||this.currentPadding},getPaddingCeil:function(){var t=this.getPadding(),e=new s(Math.ceil(t.x),Math.ceil(t.y),Math.ceil(t.width),Math.ceil(t.height));return this.currentPadding.setTo(e.x,e.y,e.width,e.height),e},setPaddingOverride:function(t,e,i,r){return null===t?(this.paddingOverride=null,this):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.paddingOverride=new s(t,e,i-t,r-e),this)},setActive:function(t){return this.active=t,this},destroy:function(){this.active=!1,this.renderNode=null,this.camera=null}});t.exports=n},16898(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===r&&(r=.005),s.call(this,t,"FilterDisplacement"),this.x=i,this.y=r,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=Math.ceil(e.width*this.x*.5),r=Math.ceil(e.height*this.y*.5);return this.currentPadding.setTo(-i,-r,2*i,2*r),this.currentPadding}});t.exports=n},42652(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===i&&(i=4),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===o&&(o=t.scene.sys.game.config.glowQuality),void 0===h&&(h=t.scene.sys.game.config.glowDistance),s.call(this,t,"FilterGlow"),this.outerStrength=i,this.innerStrength=r,this.scale=n,this.knockout=a,this._quality=Math.max(Math.round(o),1),this._distance=Math.max(Math.round(h),1),this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},distance:{get:function(){return this._distance}},quality:{get:function(){return this._quality}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.currentPadding,i=Math.ceil(this.distance*this.scale);return e.left=-i,e.top=-i,e.right=i,e.bottom=i,e}});t.exports=n},43927(t,e,i){var r=i(83419),s=i(13045),n=i(73043),a=new r({Extends:s,initialize:function(t,e){e||(e={});var i=t.scene;s.call(this,t,"FilterGradientMap");var r=e.ramp;r||(r={colorStart:0,colorEnd:16777215}),r instanceof n||(r=new n(i,r,!0)),this.ramp=r,this.dither=!!e.dither,this.color=[0,0,0,0],e.color&&(this.color[0]=e.color[0]||0,this.color[1]=e.color[1]||0,this.color[2]=e.color[2]||0,this.color[3]=e.color[3]||0),this.colorFactor=[.3,.6,.1,0],e.colorFactor&&(this.colorFactor[0]=e.colorFactor[0]||0,this.colorFactor[1]=e.colorFactor[1]||0,this.colorFactor[2]=e.colorFactor[2]||0,this.colorFactor[3]=e.colorFactor[3]||0),this.unpremultiply=void 0===e.unpremultiply||e.unpremultiply,this.alpha=void 0===e.alpha?1:e.alpha}});t.exports=a},84714(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(61340),o=new r({Extends:s,initialize:function(t,e){s.call(this,t,"FilterImageLight"),this.normalGlTexture,this.environmentGlTexture,this.viewMatrix=new n,this.modelRotation=e.modelRotation||0,this.modelRotationSource=e.modelRotationSource||null,this.bulge=e.bulge||0,this.colorFactor=e.colorFactor||[1,1,1],this._tempMatrix=new a,this._tempParentMatrix=new a,this.setEnvironmentMap(e.environmentMap||"__WHITE"),this.setNormalMap(e.normalMap||"__NORMAL"),e.viewMatrix&&this.viewMatrix.set(e.viewMatrix)},setEnvironmentMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.environmentGlTexture=e.glTexture),this},setNormalMap:function(t){var e=t instanceof Phaser.Textures.Texture?t:this.camera.scene.sys.textures.getFrame(t);return e&&(this.normalGlTexture=e.glTexture),this},setNormalMapFromGameObject:function(t){var e=t.texture.dataSource[0];return e&&(this.normalGlTexture=e.glTexture),this},getModelRotation:function(){return this.modelRotationSource?"function"==typeof this.modelRotationSource?this.modelRotationSource():this.modelRotationSource.hasTransformComponent?this.modelRotationSource.getWorldTransformMatrix(this._tempMatrix,this._tempParentMatrix).rotationNormalized:this.modelRotation:this.modelRotation}});t.exports=o},51890(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterKey"),this.color=[1,1,1,1],void 0!==e.color&&this.setColor(e.color),void 0!==e.alpha&&this.setAlpha(e.alpha),this.isolate=!1,void 0!==e.isolate&&(this.isolate=e.isolate),this.threshold=.0625,void 0!==e.threshold&&(this.threshold=e.threshold),this.feather=0,void 0!==e.feather&&(this.feather=e.feather)},setAlpha:function(t){return this.color[3]=t,this},setColor:function(t){var e=this.color[3];if("number"==typeof t){var i=n.IntegerToRGB(t);this.color=[i.r/255,i.g/255,i.b/255,e]}else if("string"==typeof t){var r=n.HexStringToColor(t);this.color=[r.redGL,r.greenGL,r.blueGL,e]}else Array.isArray(t)?this.color=[t[0],t[1],t[2],e]:t instanceof n&&(this.color=[t.redGL,t.greenGL,t.blueGL,e]);return this}});t.exports=a},97797(t,e,i){var r=i(83419),s=i(45650),n=i(13045),a=new r({Extends:n,initialize:function(t,e,i,r,s,a){void 0===e&&(e="__WHITE"),void 0===i&&(i=!1),void 0===a&&(a=1),n.call(this,t,"FilterMask"),this.glTexture,this._dynamicTexture=null,this.maskGameObject=null,this.invert=i,this.autoUpdate=!0,this.needsUpdate=!1,this.viewTransform=s||"world",this.viewCamera=r,this.scaleFactor=a,"string"==typeof e?this.setTexture(e):this.setGameObject(e)},updateDynamicTexture:function(t,e){var i=this.scaleFactor,r=t*i,n=e*i,a=this.maskGameObject;if(a){if(this._dynamicTexture)this._dynamicTexture.width!==r||this._dynamicTexture.height!==n?this._dynamicTexture.setSize(r,n,!1):this._dynamicTexture.clear();else{var o=this.camera.scene.sys.textures;this._dynamicTexture=o.addDynamicTexture(s(),r,n,!1)}this.glTexture=this._dynamicTexture.get().glTexture;var h=this.viewCamera||a.scene.renderer.currentViewCamera;this._dynamicTexture.capture(a,{transform:this.viewTransform,camera:h}),this._dynamicTexture.render(),this.needsUpdate=!1}},setGameObject:function(t){return this.maskGameObject=t,this.needsUpdate=!0,this},setTexture:function(t){var e=this.camera.scene.sys.textures.getFrame(t);return e&&(this.maskGameObject=null,this.glTexture=e.glTexture),this},destroy:function(){this._dynamicTexture&&this._dynamicTexture.destroy(),this.maskGameObject=null,this._dynamicTexture=null,n.prototype.destroy.call(this)}});t.exports=a},37911(t,e,i){var r=i(83419),s=i(13045),n=i(37867),a=i(25836),o=new r({Extends:s,initialize:function(t,e){e=e||{},s.call(this,t,"FilterNormalTools"),this._rotation=0,this.viewMatrix=new n,this.setRotation(e.rotation||0),this.rotationSource=e.rotationSource||null,this.facingPower=e.facingPower||1,this.outputRatio=e.outputRatio||!1,this.ratioVector=new a(0,0,1),e.ratioVector&&this.ratioVector.set(e.ratioVector[0],e.ratioVector[1],e.ratioVector[2]),this.ratioRadius=e.ratioRadius||1},getRotation:function(){if(this.rotationSource){if("function"==typeof this.rotationSource)return this.rotationSource();if(this.rotationSource.hasTransformComponent)return this.rotationSource.getWorldTransformMatrix().rotationNormalized}return this._rotation},setRotation:function(t){return this.viewMatrix.identity().rotateZ(t),this._rotation=t,this},updateRotation:function(){if(this.rotationSource){var t=this.getRotation();this.viewMatrix.identity().rotateZ(t),this._rotation=t}return this}});t.exports=o},6379(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),s.call(this,t,"FilterPanoramaBlur"),this.radius=e.radius||1,this.samplesX=e.samplesX||32,this.samplesY=e.samplesY||16,this.power=e.power||1}});t.exports=n},2195(t,e,i){var r=i(83419),s=i(53427),n=i(13045),a=i(16762),o=new r({Extends:n,initialize:function(t){n.call(this,t,"FilterParallelFilters"),this.top=new s(t),this.bottom=new s(t),this.blend=new a(t)}});s.prototype.addParallelFilters=function(){return this.add(new o(this.camera))},t.exports=o},29861(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e=1),s.call(this,t,"FilterPixelate"),this.amount=e}});t.exports=n},14366(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e){e||(e={}),s.call(this,t,"FilterQuantize"),this.steps=[8,8,8,8],e.steps&&(this.steps[0]=e.steps[0],this.steps[1]=e.steps[1],this.steps[2]=e.steps[2],this.steps[3]=e.steps[3]),this.gamma=[1,1,1,1],e.gamma&&(this.gamma[0]=e.gamma[0],this.gamma[1]=e.gamma[1],this.gamma[2]=e.gamma[2],this.gamma[3]=e.gamma[3]),this.offset=[0,0,0,0],e.offset&&(this.offset[0]=e.offset[0],this.offset[1]=e.offset[1],this.offset[2]=e.offset[2],this.offset[3]=e.offset[3]),this.mode=e.mode||0,this.dither=!!e.dither}});t.exports=n},63785(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i){void 0===i&&(i=null),s.call(this,t,"FilterSampler"),this.allowBaseDraw=!1,this.callback=e,this.region=i}});t.exports=n},62229(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r,n,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=.1),void 0===n&&(n=1),void 0===o&&(o=6),void 0===h&&(h=1),s.call(this,t,"FilterShadow"),this.x=e,this.y=i,this.decay=r,this.power=n,this.glcolor=[0,0,0,1],this.samples=o,this.intensity=h,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},getPadding:function(){var t=this.paddingOverride;if(t)return this.currentPadding.setTo(t.x,t.y,t.width,t.height),t;var e=this.camera,i=this.decay*this.intensity,r=Math.ceil(Math.abs(this.x)*e.width*i),s=Math.ceil(Math.abs(this.y)*e.height*i);return this.currentPadding.setTo(-r,-s,2*r,2*s),this.currentPadding}});t.exports=n},99534(t,e,i){var r=i(83419),s=i(13045),n=new r({Extends:s,initialize:function(t,e,i,r){s.call(this,t,"FilterThreshold"),this.edge1=[.5,.5,.5,.5],this.edge2=[.5,.5,.5,.5],this.invert=[!1,!1,!1,!1],this.setEdge(e,i),this.setInvert(r)},setEdge:function(t,e){void 0===t&&(t=.5),"number"==typeof t&&(t=[t,t,t,t]),this.edge1[0]=t[0],this.edge1[1]=t[1],this.edge1[2]=t[2],this.edge1[3]=t[3],void 0===e&&(e=t),"number"==typeof e&&(e=[e,e,e,e]),this.edge2[0]=e[0],this.edge2[1]=e[1],this.edge2[2]=e[2],this.edge2[3]=e[3];for(var i=0;i<4;i++)if(this.edge1[i]>this.edge2[i]){var r=this.edge1[i];this.edge1[i]=this.edge2[i],this.edge2[i]=r}return this},setInvert:function(t){return void 0===t&&(t=!1),"boolean"==typeof t&&(t=[t,t,t,t]),this.invert[0]=t[0],this.invert[1]=t[1],this.invert[2]=t[2],this.invert[3]=t[3],this}});t.exports=n},20263(t,e,i){var r=i(83419),s=i(13045),n=i(40987),a=new r({Extends:s,initialize:function(t,e,i,r,a,o,h){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===r&&(r=.5),void 0===a&&(a=.5),void 0===o&&(o=0),void 0===h&&(h=0),s.call(this,t,"FilterVignette"),this.x=e,this.y=i,this.radius=r,this.strength=a,this.color=new n,this.blendMode=h,this.setColor(o)},setColor:function(t){return"number"==typeof t?n.IntegerToColor(t,this.color):"string"==typeof t?n.HexStringToColor(t,this.color):t.setTo?this.color.setTo(t.red,t.green,t.blue,t.alpha):t?this.color.setTo(t.r||0,t.g||0,t.b||0,t.a||255):this.color.setTo(0,0,0,255),this}});t.exports=a},90002(t,e,i){var r=i(83419),s=i(13045),n=i(79237),a=new r({Extends:s,initialize:function(t,e,i,r,n,a){void 0===e&&(e=.1),s.call(this,t,"FilterWipe"),this.progress=0,this.wipeWidth=e,this.direction=i||0,this.axis=r||0,this.reveal=n||0,this.wipeTexture=null,this.setTexture(a)},setWipeWidth:function(t){return void 0===t&&(t=.1),this.wipeWidth=t,this},setLeftToRight:function(){return this.direction=0,this.axis=0,this},setRightToLeft:function(){return this.direction=1,this.axis=0,this},setTopToBottom:function(){return this.direction=1,this.axis=1,this},setBottomToTop:function(){return this.direction=0,this.axis=1,this},setWipeEffect:function(){return this.reveal=0,this.progress=0,this},setRevealEffect:function(){return this.setTexture(),this.reveal=1,this.progress=0,this},setTexture:function(t){return void 0===t&&(t="__DEFAULT"),this.wipeTexture=t instanceof n?t:this.camera.scene.sys.textures.get(t)||this.camera.scene.sys.textures.get("__DEFAULT"),this},setProgress:function(t){return this.progress=t,this}});t.exports=a},11889(t,e,i){var r={Controller:i(13045),Barrel:i(10189),Blend:i(16762),Blocky:i(37597),Blur:i(88344),Bokeh:i(47564),ColorMatrix:i(77011),CombineColorMatrix:i(95200),Displacement:i(16898),Glow:i(42652),GradientMap:i(43927),ImageLight:i(84714),Key:i(51890),Mask:i(97797),NormalTools:i(37911),PanoramaBlur:i(6379),ParallelFilters:i(2195),Pixelate:i(29861),Quantize:i(14366),Sampler:i(63785),Shadow:i(62229),Threshold:i(99534),Vignette:i(20263),Wipe:i(90002)};t.exports=r},25305(t,e,i){var r=i(10312),s=i(23568);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var n=s(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=s(n,"x",1),e.scaleY=s(n,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var o=s(i,"angle",null);null!==o&&(e.angle=o),e.alpha=s(i,"alpha",1);var h=s(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=s(h,"x",.5),u=s(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=s(i,"blendMode",r.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059(t,e,i){var r=i(23568);t.exports=function(t,e){var i=r(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var s=t.anims,n=r(i,"key",void 0);if(n){var a=r(i,"startFrame",void 0),o=r(i,"delay",0),h=r(i,"repeat",0),l=r(i,"repeatDelay",0),u=r(i,"yoyo",!1),d=r(i,"play",!1),c=r(i,"delayedPlay",0),f={key:n,delay:o,repeat:h,repeatDelay:l,yoyo:u,startFrame:a};d?s.play(f):c>0?s.playAfterDelay(f,c):s.load(f)}}return t}},8050(t,e,i){var r=i(83419),s=i(73162),n=i(37277),a=i(51708),o=i(44594),h=i(19186),l=new r({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.events.once(o.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(a.ADDED_TO_SCENE,t,this.scene),this.events.emit(o.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(a.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e]&&t[e].destroy(!0);t.length=0,this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});n.register("DisplayList",l,"displayList"),t.exports=l},95643(t,e,i){var r=i(83419),s=i(31401),n=i(53774),a=i(45893),o=i(50792),h=i(51708),l=i(44594),u=new r({Extends:o,Mixins:[s.Filters,s.RenderSteps],initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.vertexRoundMode="safeAuto",this.input=null,this.body=null,this.ignoreDestroy=!1,this.isDestroyed=!1,this.addRenderStep&&this.addRenderStep(this.renderWebGL),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.disable(this,t),this},removeInteractive:function(t){return void 0===t&&(t=!1),this.scene.sys.input.clear(this),t&&this.scene.sys.input.resetCursor(),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||u.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},willRoundVertices:function(t,e){switch(this.vertexRoundMode){case"safe":return e;case"safeAuto":return e&&t.roundPixels;case"full":return!0;case"fullAuto":return t.roundPixels;default:return!1}},setVertexRoundMode:function(t){return this.vertexRoundMode=t,this},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(h.ADDED_TO_SCENE,this,this.scene),t.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(h.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},getDisplayList:function(){var t=null;return this.parentContainer?t=this.parentContainer.list:this.displayList&&(t=this.displayList.list),t},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.isDestroyed=!0,this.preDestroy&&this.preDestroy.call(this),this.emit(h.DESTROY,this,t),this.removeAllListeners(),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.filterCamera&&(this.filterCamera.destroy(),this.filterCamera=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,t.exports=u},44603(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectCreator",a,"make"),t.exports=a},39429(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(n.DESTROY,this.destroy,this)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectFactory",a,"add"),t.exports=a},91296(t,e,i){var r=i(61340),s=new r,n=new r,a=new r,o=new r,h={camera:s,sprite:n,calc:a,cameraExternal:o};t.exports=function(t,e,i,r){return r?o.loadIdentity():o.copyFrom(e.matrixExternal),s.copyWithScrollFactorFrom(r?e.matrix:e.matrixCombined,e.scrollX,e.scrollY,t.scrollFactorX,t.scrollFactorY),a.copyFrom(s),i&&a.multiply(i),n.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),a.multiply(n),h}},45027(t,e,i){var r=i(83419),s=i(25774),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){s.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,r=i.length,s=0;s<r;s++){var n=i[s];n.active&&n.preUpdate.call(n,t,e)}},shutdown:function(){for(var t=this._active.length;t--;)this._active[t].destroy(!0);for(t=this._pending.length;t--;)this._pending[t].destroy(!0);for(t=this._destroy.length;t--;)this._destroy[t].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var e=this.systems.events;e.off(a.PRE_UPDATE,this.update,this),e.off(a.UPDATE,this.sceneUpdate,this),e.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});n.register("UpdateList",o,"updateList"),t.exports=o},3217(t){var e={frame:null,uvSource:null},i={quad:new Float32Array(8)};t.exports=function(t,r,s,n,a,o,h,l,u){e.frame=s.frame,e.uvSource=a;var d=n.x-s.displayOriginX+o,c=n.y-s.displayOriginY+h,f=d+n.w,p=c+n.h,g=l.a,m=l.b,v=l.c,y=l.d,x=l.e,T=l.f,w=d*g+c*v+x,b=d*m+c*y+T,S=d*g+p*v+x,C=d*m+p*y+T,E=f*g+p*v+x,A=f*m+p*y+T,_=f*g+c*v+x,M=f*m+c*y+T;i.quad[0]=w,i.quad[1]=b,i.quad[2]=S,i.quad[3]=C,i.quad[4]=E,i.quad[5]=A,i.quad[6]=_,i.quad[7]=M,r.run(t,s,void 0,0,e,i,u)}},53048(t){t.exports=function(t,e,i,r){if(void 0===i&&(i=!1),void 0===r)return r={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var s,n,a,o=t.text,h=o.length,l=t.maxWidth,u=t.wordWrapCharCode,d=Number.MAX_VALUE,c=Number.MAX_VALUE,f=0,p=0,g=t.fontData.chars,m=t.fontData.lineHeight,v=t.letterSpacing,y=t.lineSpacing,x=0,T=0,w=0,b=null,S=t._align,C=0,E=0,A=t.fontSize/t.fontData.size,_=A*t.scaleX,M=A*t.scaleY,R=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,I=0,N=[],B=[],k=null,U=function(t,e){for(var i=0,r=0;r<t.length;r++){var s=t.charCodeAt(r),n=e.chars[s];n&&(i+=n.xAdvance)}return i*_};if(l>0){a=o.split("\n");var z=[];for(s=0;s<a.length;s++){var Y=a[s],X="",W="",G="",V="";for(n=0;n<Y.length;n++){if(w=Y.charCodeAt(n),X+=Y[n],w===u||n===Y.length-1)U(V=G+X,t.fontData)<=l?G=V:(W=W.slice(0,-1),W+=(W?"\n":"")+G,G=X),X=""}W=W.slice(0,-1),W+=(W?"\n":"")+G,z.push(W)}o=z.join("\n"),r.wrappedText=o,h=o.length}var H=0;for(s=0;s<h;s++)if(10!==(w=o.charCodeAt(s))){if(b=g[w]){if(C=x,E=T,null!==R){var j=b.kerning[P];C+=void 0!==j?j:0}d>C&&(d=C),c>E&&(c=E);var q=C+b.xAdvance,K=E+m;f<q&&(f=q),p<K&&(p=K);var Z=b.xOffset+b.xAdvance+(void 0!==j?j:0);w===u?null!==k&&(N.push({word:k.word,i:k.i,x:k.x*_,y:k.y*M,w:k.w*_,h:k.h*M}),k=null):(null===k&&(k={word:"",i:H,x:x,y:T,w:0,h:m}),k.word=k.word.concat(o[s]),k.w+=Z),B.push({i:H,idx:s,char:o[s],code:w,x:(b.xOffset+C)*A,y:(b.yOffset+T)*A,w:b.width*A,h:b.height*A,t:T*A,r:q*A,b:m*A,line:D,glyph:b}),x+=b.xAdvance+v+(void 0!==j?j:0),R=b,P=w,I=q*A,H++}}else null!==k&&(N.push({word:k.word,i:k.i,x:k.x*_,y:k.y*M,w:k.w*_,h:k.h*M}),k=null),R=null,O[D]=I,I>F&&(F=I),I<L&&(L=I),I=0,x=0,T=(m+y)*++D;if(null!==k&&N.push({word:k.word,i:k.i,x:k.x*_,y:k.y*M,w:k.w*_,h:k.h*M}),O[D]=I,I>F&&(F=I),I<L&&(L=I),S>0)for(var Q=0;Q<B.length;Q++){var J=B[Q];if(1===S){var $=(F-O[J.line])/2;J.x+=$,J.r+=$}else if(2===S){var tt=F-O[J.line];J.x+=tt,J.r+=tt}}var et=r.local,it=r.global;return a=r.lines,et.x=d*A,et.y=c*A,et.width=f*A,et.height=p*A,it.x=t.x-t._displayOriginX+d*_,it.y=t.y-t._displayOriginY+c*M,it.width=f*_,it.height=p*M,a.shortest=L,a.longest=F,a.lengths=O,e&&(et.x=Math.ceil(et.x),et.y=Math.ceil(et.y),et.width=Math.ceil(et.width),et.height=Math.ceil(et.height),it.x=Math.ceil(it.x),it.y=Math.ceil(it.y),it.width=Math.ceil(it.width),it.height=Math.ceil(it.height),a.shortest=Math.ceil(L),a.longest=Math.ceil(F)),i&&(t._displayOriginX=t.originX*et.width,t._displayOriginY=t.originY*et.height,it.x=t.x-t._displayOriginX*t.scaleX,it.y=t.y-t._displayOriginY*t.scaleY,e&&(it.x=Math.ceil(it.x),it.y=Math.ceil(it.y))),r.words=N,r.characters=B,r.lines.height=m,r.scale=A,r.scaleX=t.scaleX,r.scaleY=t.scaleY,r}},61327(t,e,i){var r=i(21859);t.exports=function(t,e,i,s,n,a,o){var h=t.sys.textures.get(i),l=h.get(s),u=t.sys.cache.xml.get(n);if(l&&u){var d=r(u,l,a,o,h);return t.sys.cache.bitmapFont.add(e,{data:d,texture:i,frame:s,fromAtlas:!0}),!0}return!1}},6925(t,e,i){var r=i(35154);t.exports=function(t,e){var i=e.width,s=e.height,n=Math.floor(i/2),a=Math.floor(s/2),o=r(e,"chars","");if(""!==o){var h=r(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,d=l.cutY,c=l.source.width,f=l.source.height,p=r(e,"offset.x",0),g=r(e,"offset.y",0),m=r(e,"spacing.x",0),v=r(e,"spacing.y",0),y=r(e,"lineSpacing",0),x=r(e,"charsPerRow",null);null===x&&(x=c/i)>o.length&&(x=o.length);for(var T=p,w=g,b={retroFont:!0,font:h,size:i,lineHeight:s+y,chars:{}},S=0,C=0;C<o.length;C++){var E=o.charCodeAt(C),A=(u+T)/c,_=1-(d+w)/f,M=(u+T+i)/c,R=1-(d+w+s)/f;b.chars[E]={x:T,y:w,width:i,height:s,centerX:n,centerY:a,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{},u0:A,v0:_,u1:M,v1:R},++S===x?(S=0,T=p,w+=s+v):T+=i+m}return{data:b,frame:null,texture:h}}}},21859(t){function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,r,s,n){void 0===r&&(r=0),void 0===s&&(s=0);var a=i.cutX,o=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,d={},c=t.getElementsByTagName("info")[0],f=t.getElementsByTagName("common")[0];d.font=c.getAttribute("face"),d.size=e(c,"size"),d.lineHeight=e(f,"lineHeight")+s,d.chars={};var p=t.getElementsByTagName("char"),g=void 0!==i&&i.trimmed;if(g)var m=i.data.spriteSourceSize.x,v=i.data.spriteSourceSize.y;for(var y=0;y<p.length;y++){var x=p[y],T=e(x,"id"),w=String.fromCharCode(T),b=e(x,"x"),S=e(x,"y"),C=e(x,"width"),E=e(x,"height");g&&(b-=m,S-=v);var A=(a+b)/h,_=1-(o+S)/l,M=(a+b+C)/h,R=1-(o+S+E)/l;d.chars[T]={x:b,y:S,width:C,height:E,centerX:Math.floor(C/2),centerY:Math.floor(E/2),xOffset:e(x,"xoffset"),yOffset:e(x,"yoffset"),xAdvance:e(x,"xadvance")+r,data:{},kerning:{},u0:A,v0:_,u1:M,v1:R},n&&0!==C&&0!==E&&n.add(w,u,b+i.data.cut.x,S+i.data.cut.y,C,E)}var P=t.getElementsByTagName("kerning");for(y=0;y<P.length;y++){var O=P[y],L=e(O,"first"),F=e(O,"second"),D=e(O,"amount");d.chars[F].kerning[L]=D}return d}},196(t,e,i){var r=i(87662),s=i(79291),n={Parse:i(6925)};n=s(!1,n,r),t.exports=n},87662(t){t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638(t,e,i){var r=i(22186),s=i(83419),n=i(12310),a=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,a,o){r.call(this,t,e,i,s,n,a,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=a},86741(t,e,i){var r=i(20926);t.exports=function(t,e,i,s){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&r(t,o,e,i,s)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,d=e.fontData.chars,c=e.fontData.lineHeight,f=e._letterSpacing,p=0,g=0,m=0,v=null,y=0,x=0,T=0,w=0,b=0,S=0,C=null,E=0,A=e.frame.source.image,_=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var I=e._bounds.lines;1===L?D=(I.longest-I.lengths[0])/2:2===L&&(D=I.longest-I.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);var N=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(o.beginPath(),o.rect(0,0,e.cropWidth,e.cropHeight),o.clip());for(var B=0;B<a;B++)if(P=O,R=0,10!==(m=n.charCodeAt(B))){if(v=d[m]){if(y=_+v.x,x=M+v.y,T=v.width,w=v.height,b=v.xOffset+p-e.scrollX,S=v.yOffset+g-e.scrollY,null!==C){var k=v.kerning[E];b+=void 0!==k?k:0}if(l){u.index=B,u.charCode=m,u.x=b,u.y=S,u.scale=P,u.rotation=R,u.data=v.data;var U=l(u);b=U.x,S=U.y,P=U.scale,R=U.rotation}b*=P,S*=P,b+=D,p+=v.xAdvance+f+(void 0!==k?k:0),C=v,E=m,0!==T&&0!==w&&32!==m&&(N&&(b=Math.round(b),S=Math.round(S)),o.save(),o.translate(b,S),o.rotate(R),o.scale(P,P),o.drawImage(A,y,x,T,w,0,0,T,w),o.restore())}}else F++,1===L?D=(I.longest-I.lengths[F])/2:2===L&&(D=I.longest-I.lengths[F]),p=0,g+=c,C=null;o.restore()}}},11164(t,e,i){var r=i(2638),s=i(25305),n=i(44603),a=i(23568);n.register("dynamicBitmapText",function(t,e){void 0===t&&(t={});var i=a(t,"font",""),n=a(t,"text",""),o=a(t,"size",!1),h=new r(this.scene,0,0,i,n,o);return void 0!==e&&(t.add=e),s(this.scene,h,t),h})},72566(t,e,i){var r=i(2638);i(39429).register("dynamicBitmapText",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},12310(t,e,i){var r=i(29747),s=r,n=r;s=i(73482),n=i(86741),t.exports={renderWebGL:s,renderCanvas:n}},73482(t,e,i){var r=i(91296),s=i(84322),n=i(61340),a=i(70554),o=new n,h={frame:null,uvSource:null},l={tintEffect:s.MULTIPLY,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0};t.exports=function(t,e,i,n){var u=e.text,d=u.length;if(0!==d){var c=i.camera;c.addToRenderList(e);var f=i,p=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,g=r(e,c,n,!i.useCanvas),m=g.sprite,v=g.calc,y=o,x=e.cropWidth>0||e.cropHeight>0;x&&((f=i.getClone()).setScissorEnable(!0),f.setScissorBox(v.tx,v.ty,e.cropWidth*v.scaleX,e.cropHeight*v.scaleY),f.use()),h.frame=e.frame;var T,w,b=s.MULTIPLY,S=a.getTintAppendFloatAlpha(e.tintTopLeft,e._alphaTL),C=a.getTintAppendFloatAlpha(e.tintTopRight,e._alphaTR),E=a.getTintAppendFloatAlpha(e.tintBottomLeft,e._alphaBL),A=a.getTintAppendFloatAlpha(e.tintBottomRight,e._alphaBR),_=0,M=0,R=0,P=0,O=e.letterSpacing,L=0,F=0,D=e.scrollX,I=e.scrollY,N=e.fontData,B=N.chars,k=N.lineHeight,U=e.fontSize/N.size,z=0,Y=e._align,X=0,W=0,G=e.getTextBounds(!1);e.maxWidth>0&&(d=(u=G.wrappedText).length);var V=e._bounds.lines;1===Y?W=(V.longest-V.lengths[0])/2:2===Y&&(W=V.longest-V.lengths[0]);for(var H=e.displayCallback,j=e.callbackData,q=0;q<d;q++)if(10!==(R=u.charCodeAt(q))){if(T=B[R]){h.uvSource=T,L=T.width,F=T.height;var K=T.xOffset+_-D,Z=T.yOffset+M-I;if(null!==w){var Q=T.kerning[P]||0;K+=Q,_+=Q}if(_+=T.xAdvance+O,w=T,P=R,0!==L&&0!==F&&32!==R){if(U=e.fontSize/e.fontData.size,z=0,H){j.color=0,j.tintMode=b,j.tint.topLeft=S,j.tint.topRight=C,j.tint.bottomLeft=E,j.tint.bottomRight=A,j.index=q,j.charCode=R,j.x=K,j.y=Z,j.scale=U,j.rotation=z,j.data=T.data;var J=H(j);K=J.x,Z=J.y,U=J.scale,z=J.rotation,J.color?(S=J.color,C=J.color,E=J.color,A=J.color):(S=J.tint.topLeft,C=J.tint.topRight,E=J.tint.bottomLeft,A=J.tint.bottomRight),b=J.tintMode,S=a.getTintAppendFloatAlpha(S,e._alphaTL),C=a.getTintAppendFloatAlpha(C,e._alphaTR),E=a.getTintAppendFloatAlpha(E,e._alphaBL),A=a.getTintAppendFloatAlpha(A,e._alphaBR)}l.tintEffect=b,l.tintTopLeft=S,l.tintTopRight=C,l.tintBottomLeft=E,l.tintBottomRight=A,K*=U,Z*=U,K-=e.displayOriginX,Z-=e.displayOriginY,K+=W,y.applyITRS(K,Z,z,U,U),v.multiply(y,m);var $=L,tt=F,et=m.e,it=m.f,rt=tt*m.c+m.e,st=tt*m.d+m.f,nt=$*m.a+tt*m.c+m.e,at=$*m.b+tt*m.d+m.f,ot=$*m.a+m.e,ht=$*m.b+m.f;p.run(f,e,void 0,0,h,{quad:[et,it,rt,st,nt,at,ot,ht]},l)}}}else X++,1===Y?W=(V.longest-V.lengths[X])/2:2===Y&&(W=V.longest-V.lengths[X]),_=0,M+=k,w=null;x&&i.use()}}},22186(t,e,i){var r=i(70972),s=i(83419),n=i(45319),a=i(31401),o=i(95643),h=i(53048),l=i(61327),u=i(21859),d=i(87841),c=i(18658),f=i(84322),p=new s({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.Texture,a.Tint,a.Transform,a.Visible,c],initialize:function(t,e,i,r,s,n,a){void 0===s&&(s=""),void 0===a&&(a=0),o.call(this,t,"BitmapText"),this.font=r;var l=this.scene.sys.cache.bitmapFont.get(r);l||console.warn("Invalid BitmapText key: "+r),this.fontData=l.data,this._text="",this._fontSize=n||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=a,this._bounds=h(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initRenderNodes(this._defaultRenderNodesMap),this.setText(s)},_defaultRenderNodesMap:{get:function(){return r}},setLeftAlign:function(){return this._align=p.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=p.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=p.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setLineSpacing:function(t){return void 0===t&&(t=0),this.lineSpacing=t,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=r,this},setCharacterTint:function(t,e,i,r,s,a,o){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=f.MULTIPLY),void 0===r&&(r=-1),void 0===s&&(s=r,a=r,o=r);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,d=t;d<l;d++){var c=u[d];if(-1===r)u[d]=null;else{var p=i;c?(c.tintEffect=p,c.tintTL=r,c.tintTR=s,c.tintBL=a,c.tintBR=o):u[d]={tintEffect:p,tintTL:r,tintTR:s,tintBL:a,tintBR:o}}}return this},setWordTint:function(t,e,i,r,s,n,a){void 0===e&&(e=1);for(var o=this.getTextBounds().words,h="number"==typeof t,l=0,u=0;u<o.length;u++){var d=o[u];if((h&&u===t||!h&&d.word===t)&&(this.setCharacterTint(d.i,d.word.length,i,r,s,n,a),++l===e))return this}return this},getTextBounds:function(t){var e=this._bounds;return(this._dirty||t||this.scaleX!==e.scaleX||this.scaleY!==e.scaleY)&&(h(this,t,!0,e),this._dirty=!1),e},getCharacterAt:function(t,e,i){for(var r=this.getLocalPoint(t,e,null,i),s=this.getTextBounds().characters,n=new d,a=0;a<s.length;a++){var o=s[a];if(n.setTo(o.x,o.t,o.r-o.x,o.b),n.contains(r.x,r.y))return o}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(t,e,i){void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align);var r=this.scene.sys.cache.bitmapFont.get(t);return r&&(this.font=t,this.fontData=r.data,this._fontSize=e,this._align=i,this.fromAtlas=!0===r.fromAtlas,this.setTexture(r.texture,r.frame),h(this,!1,!0,this._bounds)),this},setMaxWidth:function(t,e){return this._maxWidth=t,this._dirty=!0,void 0!==e&&(this.wordWrapCharCode=e),this},setDisplaySize:function(t,e){this.setScale(1,1),this.getTextBounds(!1);var i=t/this.width,r=e/this.height;return this.setScale(i,r),this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},lineSpacing:{set:function(t){this._lineSpacing=t,this._dirty=!0},get:function(){return this._lineSpacing}},maxWidth:{set:function(t){this._maxWidth=t,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},displayWidth:{set:function(t){this.setScaleX(1),this.getTextBounds(!1);var e=t/this.width;this.setScaleX(e)},get:function(){return this.width}},displayHeight:{set:function(t){this.setScaleY(1),this.getTextBounds(!1);var e=t/this.height;this.setScaleY(e)},get:function(){return this.height}},toJSON:function(){var t=a.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineSpacing:this.lineSpacing,align:this.align};return t.data=e,t},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});p.ALIGN_LEFT=0,p.ALIGN_CENTER=1,p.ALIGN_RIGHT=2,p.ParseFromAtlas=l,p.ParseXMLBitmapFont=u,t.exports=p},37289(t,e,i){var r=i(20926);t.exports=function(t,e,i,s){var n=e._text,a=n.length,o=t.currentContext;if(0!==a&&r(t,o,e,i,s)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,d=e._letterSpacing,c=e._lineSpacing,f=0,p=0,g=0,m=null,v=0,y=0,x=0,T=0,w=0,b=0,S=null,C=0,E=h.source.image,A=h.cutX,_=h.cutY,M=e._fontSize/e.fontData.size,R=e._align,P=0,O=0,L=e.getTextBounds(!1);e.maxWidth>0&&(a=(n=L.wrappedText).length);var F=e._bounds.lines;1===R?O=(F.longest-F.lengths[0])/2:2===R&&(O=F.longest-F.lengths[0]),o.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I<a;I++)if(10!==(g=n.charCodeAt(I))){if(m=l[g]){if(v=A+m.x,y=_+m.y,x=m.width,T=m.height,w=m.xOffset+f,b=m.yOffset+p,null!==S){var N=m.kerning[C];w+=void 0!==N?N:0}w*=M,b*=M,w+=O,f+=m.xAdvance+d+(void 0!==N?N:0),S=m,C=g,0!==x&&0!==T&&32!==g&&(D&&(w=Math.round(w),b=Math.round(b)),o.save(),o.translate(w,b),o.scale(M,M),o.drawImage(E,v,y,x,T,0,0,x,T),o.restore())}}else P++,1===R?O=(F.longest-F.lengths[P])/2:2===R&&(O=F.longest-F.lengths[P]),f=0,p+=u+c,S=null;o.restore()}}},57336(t,e,i){var r=i(22186),s=i(25305),n=i(44603),a=i(23568),o=i(35154);n.register("bitmapText",function(t,e){void 0===t&&(t={});var i=o(t,"font",""),n=a(t,"text",""),h=a(t,"size",!1),l=o(t,"align",0),u=new r(this.scene,0,0,i,n,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u})},34914(t,e,i){var r=i(22186);i(39429).register("bitmapText",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},18658(t,e,i){var r=i(29747),s=r,n=r;s=i(33590),n=i(37289),t.exports={renderWebGL:s,renderCanvas:n}},33590(t,e,i){var r=i(3217),s=i(91296),n=i(70554),a={tintEffect:0,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0},o={tintEffect:0,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0};t.exports=function(t,e,i,h){if(0!==e._text.length){var l=i.camera;l.addToRenderList(e);var u=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,d=s(e,l,h,!i.useCanvas).calc,c=e.charColors,f=n.getTintAppendFloatAlpha;a.tintEffect=e.tintMode,a.tintTopLeft=f(e.tintTopLeft,e._alphaTL),a.tintTopRight=f(e.tintTopRight,e._alphaTR),a.tintBottomLeft=f(e.tintBottomLeft,e._alphaBL),a.tintBottomRight=f(e.tintBottomRight,e._alphaBR);var p,g,m,v=e.getTextBounds(!1).characters,y=e.dropShadowX,x=e.dropShadowY;if(0!==y||0!==x){var T=e.dropShadowColor,w=e.dropShadowAlpha;for(o.tintEffect=1,o.tintTopLeft=f(T,w*e._alphaTL),o.tintTopRight=f(T,w*e._alphaTR),o.tintBottomLeft=f(T,w*e._alphaBL),o.tintBottomRight=f(T,w*e._alphaBR),p=0;p<v.length;p++)m=(g=v[p]).glyph,32!==g.code&&0!==m.width&&0!==m.height&&r(i,u,e,g,m,y,x,d,o)}for(p=0;p<v.length;p++)if(m=(g=v[p]).glyph,32!==g.code&&0!==m.width&&0!==m.height)if(c[g.i]){var b=c[g.i];o.tintEffect=b.tintEffect,o.tintTopLeft=f(b.tintTL,e._alphaTL),o.tintTopRight=f(b.tintTR,e._alphaTR),o.tintBottomLeft=f(b.tintBL,e._alphaBL),o.tintBottomRight=f(b.tintBR,e._alphaBR),r(i,u,e,g,m,0,0,d,o)}else r(i,u,e,g,m,0,0,d,a)}}},6107(t,e,i){var r=i(48011),s=i(46590),n=i(98682),a=i(83419),o=i(31401),h=i(4327),l=i(95643),u=i(73162),d=new a({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Lighting,o.Mask,o.RenderNodes,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,r],initialize:function(t,e,i,r,s){l.call(this,t,"Blitter"),this.setTexture(r,s),this.setPosition(e,i),this.initRenderNodes(this._defaultRenderNodesMap),this.children=new u,this.renderList=[],this.dirty=!1},_defaultRenderNodesMap:{get:function(){return n}},create:function(t,e,i,r,n){void 0===r&&(r=!0),void 0===n&&(n=this.children.length),void 0===i?i=this.frame:i instanceof h||(i=this.texture.get(i));var a=new s(this,t,e,i,r);return this.children.addAt(a,n,!1),this.dirty=!0,a},createFromCallback:function(t,e,i,r){for(var s=this.createMultiple(e,i,r),n=0;n<s.length;n++){var a=s[n];t.call(this,a,n)}return s},createMultiple:function(t,e,i){void 0===e&&(e=this.frame.name),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);var r=[],s=this;return e.forEach(function(e){for(var n=0;n<t;n++)r.push(s.create(0,0,e,i))}),r},childCanRender:function(t){return t.visible&&t.alpha>0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=d},72396(t){t.exports=function(t,e,i,r){var s=e.getRenderList();if(0!==s.length){var n=t.currentContext,a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e),n.globalCompositeOperation=t.blendModes[e.blendMode],n.imageSmoothingEnabled=!e.frame.source.scaleMode;var o=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;n.save(),r&&r.copyToContext(n);for(var l=i.roundPixels,u=0;u<s.length;u++){var d=s[u],c=d.flipX||d.flipY,f=d.frame,p=f.canvasData,g=f.x,m=f.y,v=1,y=1,x=d.alpha*a;0!==x&&(n.globalAlpha=x,c?(d.flipX&&(v=-1,g-=p.width),d.flipY&&(y=-1,m-=p.height),p.width>0&&p.height>0&&(n.save(),n.translate(d.x+o,d.y+h),n.scale(v,y),n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g,m,p.width,p.height),n.restore())):(l&&(g=Math.round(g),m=Math.round(m)),p.width>0&&p.height>0&&n.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+d.x+o,m+d.y+h,p.width,p.height)))}n.restore()}}}},9403(t,e,i){var r=i(6107),s=i(25305),n=i(44603),a=i(23568);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),o=new r(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,o,t),o})},12709(t,e,i){var r=i(6107);i(39429).register("blitter",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},48011(t,e,i){var r=i(29747),s=r,n=r;s=i(99485),n=i(72396),t.exports={renderWebGL:s,renderCanvas:n}},99485(t,e,i){var r=i(61340),s=i(70554),n=new r,a={quad:new Float32Array(8)},o={},h={};t.exports=function(t,e,i,r){var l=e.getRenderList(),u=i.camera,d=e.alpha;if(0!==l.length&&0!==d){u.addToRenderList(e);var c=n.copyWithScrollFactorFrom(u.getViewMatrix(!i.useCanvas),u.scrollX,u.scrollY,e.scrollFactorX,e.scrollFactorY);r&&c.multiply(r);for(var f=e.x,p=e.y,g=e.customRenderNodes,m=e.defaultRenderNodes,v=0;v<l.length;v++){var y=l[v],x=y.frame,T=y.alpha*d;if(0!==T){var w=x.width,b=x.height,S=f+y.x+x.x,C=p+y.y+x.y;y.flipX&&(w*=-1,S+=x.width),y.flipY&&(b*=-1,C+=x.height),c.setQuad(S,C,S+w,C+b,a.quad),o.frame=x,o.uvSource=x;var E=s.getTintAppendFloatAlpha(y.tint,T);h.tintTopLeft=E,h.tintBottomLeft=E,h.tintTopRight=E,h.tintBottomRight=E,(g.Submitter||m.Submitter).run(i,e,r,0,o,a,h,void 0,0)}}}}},46590(t,e,i){var r=i(83419),s=i(4327),n=new r({initialize:function(t,e,i,r,s){this.parent=t,this.x=e,this.y=i,this.frame=r,this.data={},this.tint=16777215,this._visible=s,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof s&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=n},43451(t,e,i){var r=i(87774),s=i(30529),n=i(83419),a=i(31401),o=i(95643),h=i(36683),l=new n({Extends:o,Mixins:[a.BlendMode,a.Depth,a.RenderNodes,a.Visible,h],initialize:function(t,e){o.call(this,t,"CaptureFrame");var i=t.renderer;this.drawingContext=new r(i,{width:i.width,height:i.height}),this.captureTexture=t.sys.textures.addGLTexture(e,this.drawingContext.texture),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},setAlpha:function(t){return this},setScrollFactor:function(t,e){return this}});t.exports=l},23675(t,e,i){var r=i(44603),s=i(23568),n=i(43451);r.register("captureFrame",function(t,e){void 0===t&&(t={});var i=s(t,"depth",0),r=s(t,"key",null),a=s(t,"visible",!0),o=new n(this.scene,r);return void 0!==e&&(t.add=e),o.setDepth(i).setVisible(a),t.add&&this.scene.sys.displayList.add(o),o})},20421(t,e,i){var r=i(43451);i(39429).register("captureFrame",function(t){return this.displayList.add(new r(this.scene,t))})},36683(t,e,i){var r=i(29747),s=r,n=r;s=i(82237),t.exports={renderWebGL:s,renderCanvas:n}},82237(t){var e=!1;t.exports=function(t,i,r){if(r.useCanvas)e||(e=!0,console.warn("CaptureFrame: Cannot capture from main canvas. Activate `forceComposite` on the camera to use this feature. This warning will now mute."));else{r.camera.addToRenderList(i);var s=r.width,n=r.height,a=i.customRenderNodes,o=i.defaultRenderNodes;i.drawingContext.resize(s,n),i.drawingContext.use(),(a.BatchHandler||o.BatchHandler).batch(i.drawingContext,r.texture,0,n,0,0,s,n,s,0,0,0,1,1,!1,4294967295,4294967295,4294967295,4294967295,{}),i.drawingContext.release()}}},16005(t,e,i){var r=i(45319),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=r(t,0,1),this._alphaTR=r(e,0,1),this._alphaBL=r(i,0,1),this._alphaBR=r(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=r(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=r(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=r(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=r(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},88509(t,e,i){var r=i(45319),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=r(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},90065(t,e,i){var r=i(10312),s={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=r[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},94215(t){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683(t){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,r){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,r,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},89272(t,e,i){var r=i(37105),s={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this},setToTop:function(){var t=this.getDisplayList();return t&&r.BringToTop(t,this),this},setToBack:function(){var t=this.getDisplayList();return t&&r.SendToBack(t,this),this},setAbove:function(t){var e=this.getDisplayList();return e&&t&&r.MoveAbove(e,this,t),this},setBelow:function(t){var e=this.getDisplayList();return e&&t&&r.MoveBelow(e,this,t),this}};t.exports=s},3248(t){var e={timeElapsed:0,timeElapsedResetPeriod:36e5,timePaused:!1,setTimerResetPeriod:function(t){return this.timeElapsedResetPeriod=t,this},setTimerPaused:function(t){return this.timePaused=!!t,this},resetTimer:function(t){return void 0===t&&(t=0),this.timeElapsed=t,this},updateTimer:function(t,e){return this.timePaused||(this.timeElapsed+=e,this.timeElapsed>=this.timeElapsedResetPeriod&&(this.timeElapsed-=this.timeElapsedResetPeriod)),this}};t.exports=e},53427(t,e,i){var r=i(83419),s=i(10189),n=i(16762),a=i(37597),o=i(88344),h=i(47564),l=i(77011),u=i(95200),d=i(16898),c=i(42652),f=i(43927),p=i(84714),g=i(51890),m=i(97797),v=i(37911),y=i(6379),x=i(29861),T=i(14366),w=i(63785),b=i(62229),S=i(99534),C=i(20263),E=i(90002),A=new r({initialize:function(t){this.camera=t,this.list=[]},clear:function(){for(var t=0;t<this.list.length;t++){var e=this.list[t];e.ignoreDestroy||e.destroy()}return this.list.length=0,this},add:function(t,e){return void 0===e?this.list.push(t):this.list.splice(e,0,t),t},remove:function(t,e){var i=this.list.indexOf(t);return-1!==i&&(this.list.splice(i,1),t.ignoreDestroy&&!e||t.destroy()),this},getActive:function(){return this.list.filter(_)},addBarrel:function(t){return this.add(new s(this.camera,t))},addBlend:function(t,e,i,r){return this.add(new n(this.camera,t,e,i,r))},addBlocky:function(t){return this.add(new a(this.camera,t))},addBlur:function(t,e,i,r,s,n){return this.add(new o(this.camera,t,e,i,r,s,n))},addBokeh:function(t,e,i){return this.add(new h(this.camera,t,e,i))},addColorMatrix:function(){return this.add(new l(this.camera))},addCombineColorMatrix:function(t){return this.add(new u(this.camera,t))},addDisplacement:function(t,e,i){return this.add(new d(this.camera,t,e,i))},addGlow:function(t,e,i,r,s,n,a){return this.add(new c(this.camera,t,e,i,r,s,n,a))},addGradientMap:function(t){return this.add(new f(this.camera,t))},addImageLight:function(t){return this.add(new p(this.camera,t))},addKey:function(t){return this.add(new g(this.camera,t))},addMask:function(t,e,i,r,s){return this.add(new m(this.camera,t,e,i,r,s))},addNormalTools:function(t){return this.add(new v(this.camera,t))},addPanoramaBlur:function(t){return this.add(new y(this.camera,t))},addPixelate:function(t){return this.add(new x(this.camera,t))},addQuantize:function(t){return this.add(new T(this.camera,t))},addSampler:function(t,e){return this.add(new w(this.camera,t,e))},addShadow:function(t,e,i,r,s,n,a){return this.add(new b(this.camera,t,e,i,r,s,n,a))},addThreshold:function(t,e,i){return this.add(new S(this.camera,t,e,i))},addTiltShift:function(t,e,i,r,s,n){return this.add(new h(this.camera,t,e,i,!0,r,s,n))},addVignette:function(t,e,i,r,s,n){return this.add(new C(this.camera,t,e,i,r,s,n))},addWipe:function(t,e,i,r,s){return this.add(new E(this.camera,t,e,i,r,s))},destroy:function(){this.clear(),this.camera=null}});function _(t){return t.active}t.exports=A},43102(t,e,i){var r=null,s=i(26099),n=i(61340),a={};a={filterCamera:null,filters:{get:function(){return this.filterCamera?this.filterCamera.filters:null}},renderFilters:!0,maxFilterSize:null,filtersAutoFocus:!0,filtersFocusContext:!1,filtersForceComposite:!1,_filtersMatrix:null,_filtersViewMatrix:null,willRenderFilters:function(){return this.renderFilters&&this.filters&&(this.filters.internal.getActive().length>0||this.filters.external.getActive().length>0||this.filtersForceComposite)},enableFilters:function(){if(this.filterCamera||!this.scene.renderer.gl)return this;var t=this.scene;if(r||(r=i(38058)),this.filterCamera=new r(0,0,1,1).setScene(t,!1),this.filterCamera.isObjectInversion=!0,t.game.config.roundPixels&&(this.filterCamera.roundPixels=!0),!this.maxFilterSize){var e=t.renderer.getMaxTextureSize();this.maxFilterSize=new s(e,e)}return this._filtersMatrix=new n,this._filtersViewMatrix=new n,this.getBounds&&void 0!==this.width&&void 0!==this.height&&0!==this.width&&0!==this.height||(this.filtersFocusContext=!0),this.addRenderStep(this.renderWebGLFilters,0),this},renderWebGLFilters:function(t,e,i,r,s){if(e.willRenderFilters()){var n=i.camera,a=e.filtersAutoFocus,o=e.filtersFocusContext;a&&(o?e.focusFiltersOnCamera(n):e.focusFilters());var h=e.filterCamera;h.preRender();var l=h.roundPixels;if(h.roundPixels=e.willRoundVertices(h,e.rotation%(2*Math.PI)==0&&(e.scaleX,1===e.scaleY)),a&&o){var u=e.parentContainer;if(u){var d=u.getWorldTransformMatrix();h.matrix.multiply(d)}}var c=e._filtersMatrix,f=e._filtersViewMatrix.copyWithScrollFactorFrom(n.getViewMatrix(!i.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY);if(r&&f.multiply(r),o)c.loadIdentity();else{if("Layer"===e.type)c.loadIdentity();else{var p=e.flipX?-1:1,g=e.flipY?-1:1;c.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g)}var m=h.width,v=h.height;c.translate(-m*h.originX,-v*h.originY),f.multiply(c,c)}var y=e.scrollFactorX,x=e.scrollFactorY;e.scrollFactorX=1,e.scrollFactorY=1,t.cameraRenderNode.run(i,[e],h,c,!0,s+1),e.scrollFactorX=y,e.scrollFactorY=x,h.roundPixels=l;for(var T=h.renderList.length,w=0;w<T;w++)n.addToRenderList(h.renderList[w])}else e.renderWebGLStep(t,e,i,r,s+1)},focusFilters:function(){var t=this.x,e=this.y,i=this.originX,r=this.originY,s=this.width,n=this.height;if("Layer"===this.type||isNaN(t)||isNaN(e)||isNaN(s)||isNaN(n)||isNaN(i)||isNaN(r)||0===s||0===n)return this.filtersFocusContext=!0,this;var a=this.rotation,o=this.scaleX,h=this.scaleY;this.flipX&&(o*=-1,i=1-i),this.flipY&&(h*=-1,r=1-r);var l=t+s*(.5-i),u=e+n*(.5-r);return this.setFilterSize(s,n),this.filterCamera.centerOn(l,u).setRotation(-a).setOrigin(i,r).setZoom(1/o,1/h),this},focusFiltersOnCamera:function(t){var e=t.width,i=t.height,r=t.scrollX,s=t.scrollY,n=t.rotation,a=t.zoomX,o=t.zoomY;return this.setFilterSize(e,i),this.filterCamera.setScroll(r,s),this.filterCamera.setRotation(n),this.filterCamera.setZoom(a,o),this},focusFiltersOverride:function(t,e,i,r){var s=this.filterCamera;void 0===i&&(i=s.width),void 0===r&&(r=s.height),void 0===t&&(t=i/2),void 0===e&&(e=r/2);var n=this.x,a=this.y;this.setFilterSize(i,r),s.setScroll(n-t,a-e);var o=t/i,h=e/r;return s.setOrigin(o,h),this.filtersAutoFocus=!1,this},setFilterSize:function(t,e){t=Math.max(1,Math.min(Math.ceil(t),this.maxFilterSize.x)),e=Math.max(1,Math.min(Math.ceil(e),this.maxFilterSize.y));var i=this.filterCamera;return i?(i.setSize(t,e),this):this},setFiltersAutoFocus:function(t){return this.filtersAutoFocus=t,this},setFiltersFocusContext:function(t){return this.filtersFocusContext=t,this},setFiltersForceComposite:function(t){return this.filtersForceComposite=t,this},setRenderFilters:function(t){return this.renderFilters=t,this}},t.exports=a},54434(t){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},8004(t,e,i){var r=i(87841),s=i(11520),n=i(26099),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t,e){return void 0===t&&(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new n),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,s,n,a,o,h,l;if(void 0===t&&(t=new r),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,n=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,n=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,a,h),t.y=Math.min(i,n,o,l),t.width=Math.max(e,s,a,h)-t.x,t.height=Math.max(i,n,o,l)-t.y,t}};t.exports=a},73629(t){var e={lighting:!1,selfShadow:{enabled:null,penumbra:.5,diffuseFlatThreshold:1/3},setLighting:function(t){return this.lighting=t,this},setSelfShadow:function(t,e,i){return void 0!==t&&(this.selfShadow.enabled=null===t?this.scene.sys.game.config.selfShadow:t),void 0!==e&&(this.selfShadow.penumbra=e),void 0!==i&&(this.selfShadow.diffuseFlatThreshold=i),this}};t.exports=e},8573(t,e,i){var r=i(8054),s=i(80661),n={mask:null,setMask:function(t){return this.scene.renderer.type===r.WEBGL?(console.warn("Phaser.GameObjects.Components.Mask.setMask: This method is not supported in WebGL. Create a Mask filter instead."),this):(this.mask=t,this)},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new s(this.scene,t)}};t.exports=n},27387(t){var e={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=e},37640(t,e,i){var r=i(39506),s=i(57355),n=i(35154),a=i(86353),o=i(26099),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=n(t,"from",0),t.to=n(t,"to",1);var h=s(t,"positionOnPath",!1);this.rotateToPath=s(t,"rotateToPath",!1),this.pathRotationOffset=n(t,"rotationOffset",0);var l=n(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+r(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t&&t.data){var e=t.data[0],i=this.pathDelta,s=this.pathVector;if(i.copy(s).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,s),i.add(s),s.add(this.pathOffset),void this.setPosition(s.x,s.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),s),i.add(s),s.add(this.pathOffset);var n=this.x,o=this.y;this.setPosition(s.x,s.y);var h=this.x-n,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+r(this.pathRotationOffset))}}};t.exports=h},68680(t,e,i){var r=i(62644),s={customRenderNodes:null,defaultRenderNodes:null,renderNodeData:null,initRenderNodes:function(t){this.customRenderNodes={},this.defaultRenderNodes={},this.renderNodeData={};var e=this.scene.sys.renderer;if(e){var i=e.renderNodes;if(i&&t){var r=this.defaultRenderNodes;t.each(function(t,e){r[t]=i.getNode(e)})}}},setRenderNodeRole:function(t,e,i,s){var n=this.scene.sys.renderer;if(!n)return this;var a=n.renderNodes;if(!a)return this;if(null!==e){if("string"==typeof e&&(e=a.getNode(e)),!e)return this;this.customRenderNodes[t]=e,this.renderNodeData[e.name]=i?s?r(i):i:{}}else{var o=this.customRenderNodes[t];o&&(delete this.renderNodeData[o.name],delete this.customRenderNodes[t])}return this},setRenderNodeData:function(t,e,i){var r=t;"string"!=typeof t&&(r=t.name);var s=this.renderNodeData[r];return void 0===i?delete s[e]:s[e]=i,this}};t.exports=s},86038(t){var e={};e={_renderSteps:null,renderWebGLStep:function(t,e,i,r,s,n,a){void 0===s&&(s=0);var o=e._renderSteps[s];o&&(n?void 0===a&&(a=0):(n=[e],a=0),o(t,e,i,r,s,n,a))},addRenderStep:function(t,e){return this._renderSteps||(this._renderSteps=[]),void 0===e?(this._renderSteps.push(t),this):(this._renderSteps.splice(e,0,t),this)}},t.exports=e},80227(t){var e={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=e},16736(t){var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},37726(t,e,i){var r=i(4327),s={texture:null,frame:null,isCropped:!1,setTexture:function(t,e,i,r){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e,i,r)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof r?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=s},79812(t,e,i){var r=i(4327),s={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,r){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,r,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof r?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=s},27472(t,e,i){var r=i(84322),s={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintMode:r.MULTIPLY,clearTint:function(){return this.setTint(16777215),this.setTintMode(r.MULTIPLY),this},setTint:function(t,e,i,r){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,r=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=r,this},setTintMode:function(t){return this.tintMode=t,this},setTintFill:function(){console.error("`setTintFill(color)` is removed as of Phaser 4. Use setTint(color).setTintMode(Phaser.TintModes.FILL)` instead.")},tint:{get:function(){return this.tintTopLeft},set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintMode!==r.MULTIPLY||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};t.exports=s},53774(t){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},16901(t,e,i){var r=i(36383),s=i(61340),n=i(85955),a=i(86554),o=i(30954),h=i(26099),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return o(this._rotation*r.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*r.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.z=i,this.w=r,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*r,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);var r=!1;for(e||(e=new s,r=!0),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return r&&e.destroy(),t},getLocalPoint:function(t,e,i,r){i||(i=new h),r||(r=this.scene.sys.cameras.main);var s=r.scrollX,a=r.scrollY,o=t+s*this.scrollFactorX-s,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):n(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getWorldPoint:function(t,e,i){if(void 0===t&&(t=new h),!this.parentContainer)return t.x=this.x,t.y=this.y,t;var r=this.getWorldTransformMatrix(e,i);return t.x=r.tx,t.y=r.ty,t},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},61340(t,e,i){var r=i(83419),s=i(36383),n=i(26099),a=new r({initialize:function(t,e,i,r,s,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===s&&(s=0),void 0===n&&(n=0),this.matrix=new Float32Array([t,e,i,r,s,n,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],r=t[2],n=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):r||n?s.PI_OVER_2-(n>0?Math.acos(-r/this.scaleY):-Math.acos(r/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3];return r[0]=s*i+a*e,r[1]=n*i+o*e,r[2]=s*-e+a*i,r[3]=n*-e+o*i,this},multiply:function(t,e){var i=this.matrix,r=t.matrix,s=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=r[0],d=r[1],c=r[2],f=r[3],p=r[4],g=r[5],m=void 0===e?i:e.matrix;return m[0]=u*s+d*a,m[1]=u*n+d*o,m[2]=c*s+f*a,m[3]=c*n+f*o,m[4]=p*s+g*a+h,m[5]=p*n+g*o+l,m},multiplyWithOffset:function(t,e,i){var r=this.matrix,s=t.matrix,n=r[0],a=r[1],o=r[2],h=r[3],l=e*n+i*o+r[4],u=e*a+i*h+r[5],d=s[0],c=s[1],f=s[2],p=s[3],g=s[4],m=s[5];return r[0]=d*n+c*o,r[1]=d*a+c*h,r[2]=f*n+p*o,r[3]=f*a+p*h,r[4]=g*n+m*o+l,r[5]=g*a+m*h+u,this},transform:function(t,e,i,r,s,n){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],d=a[4],c=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=i*o+r*l,a[3]=i*h+r*u,a[4]=s*o+n*l+d,a[5]=s*h+n*u+c,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var r=this.matrix,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5];return i.x=t*s+e*a+h,i.y=t*n+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=e*s-i*r;return t[0]=s/o,t[1]=-i/o,t[2]=-r/o,t[3]=e/o,t[4]=(r*a-s*n)/o,t[5]=-(e*a-i*n)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyWithScrollFactorFrom:function(t,e,i,r,s){var n=this.matrix;n[0]=t.a,n[1]=t.b,n[2]=t.c,n[3]=t.d;var a=e*(1-r),o=i*(1-s);return n[4]=t.a*a+t.c*o+t.e,n[5]=t.b*a+t.d*o+t.f,this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this.a,this.b,this.c,this.d,this.e,this.f),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,r,s,n){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a[4]=s,a[5]=n,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],r=e[1],s=e[2],n=e[3],a=i*n-r*s;if(t.translateX=e[4],t.translateY=e[5],i||r){var o=Math.sqrt(i*i+r*r);t.rotation=r>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(s||n){var h=Math.sqrt(s*s+n*n);t.rotation=.5*Math.PI-(n>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,r,s){var n=this.matrix,a=Math.sin(i),o=Math.cos(i);return n[4]=t,n[5]=e,n[0]=o*r,n[1]=a*r,n[2]=-a*s,n[3]=o*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new n);var r=this.matrix,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=1/(s*h+o*-a);return i.x=h*d*t+-o*d*e+(u*o-l*h)*d,i.y=s*d*e+-a*d*t+(-u*s+l*a)*d,i},setQuad:function(t,e,i,r,s){void 0===s&&(s=this.quad);var n=this.matrix,a=n[0],o=n[1],h=n[2],l=n[3],u=n[4],d=n[5];return s[0]=t*a+e*h+u,s[1]=t*o+e*l+d,s[2]=t*a+r*h+u,s[3]=t*o+r*l+d,s[4]=i*a+r*h+u,s[5]=i*o+r*l+d,s[6]=i*a+e*h+u,s[7]=i*o+e*l+d,s},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var r=this.getX(t,e);return i&&(r=Math.floor(r+.5)),r},getYRound:function(t,e,i){var r=this.getY(t,e);return i&&(r=Math.floor(r+.5)),r},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},59715(t){var e={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=e},31401(t,e,i){t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),ElapseTimer:i(3248),FilterList:i(53427),Filters:i(43102),Flip:i(54434),GetBounds:i(8004),Lighting:i(73629),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),RenderNodes:i(68680),RenderSteps:i(86038),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559(t,e,i){var r=i(37105),s=i(10312),n=i(83419),a=i(31401),o=i(51708),h=i(95643),l=i(87841),u=i(29959),d=i(36899),c=i(26099),f=i(93595),p=new a.TransformMatrix,g=new n({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,u],initialize:function(t,e,i,r){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.setBlendMode(s.SKIP_CHECK),r&&this.add(r)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,r=new l,s=!1;t.setEmpty();for(var n=0;n<i.length;n++){var a=i[n];a.getBounds&&(a.getBounds(r),s?d(r,t,t):(t.setTo(r.x,r.y,r.width,r.height),s=!0))}}return t},addHandler:function(t){t.once(o.DESTROY,this.onChildDestroyed,this),this.exclusive&&(t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this,t.removeFromDisplayList(),t.addedToScene())},removeHandler:function(t){t.off(o.DESTROY,this.remove,this),this.exclusive&&(t.parentContainer=null,t.removedFromScene(),t.addToDisplayList())},pointToContainer:function(t,e){void 0===e&&(e=new c),this.parentContainer?this.parentContainer.pointToContainer(t,e):(e.x=t.x,e.y=t.y);var i=p;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(p,this.localTransform)},add:function(t){if(Array.isArray(t))t.forEach(function(t){if(t&&t instanceof f)throw new Error("Tried to add a Layer to a Container: this is not allowed")});else if(t&&t instanceof f)throw new Error("Tried to add a Layer to a Container: this is not allowed");return r.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return r.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),r.StableSort(this.list,e),this):this},getByName:function(t){return r.GetFirst(this.list,"name",t)},getRandom:function(t,e){return r.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return r.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return r.GetAll(this.list,t,e,i,s)},count:function(t,e,i,s){return r.CountAllMatching(this.list,t,e,i,s)},swap:function(t,e){return r.Swap(this.list,t,e),this},moveTo:function(t,e){return r.MoveTo(this.list,t,e),this},moveAbove:function(t,e){return r.MoveAbove(this.list,t,e),this},moveBelow:function(t,e){return r.MoveBelow(this.list,t,e),this},remove:function(t,e){var i=r.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s++)i[s].destroy()}return this},removeAt:function(t,e){var i=r.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var s=r.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var n=0;n<s.length;n++)s[n].destroy();return this},removeAll:function(t){var e=this.list;if(t){for(var i=0;i<e.length;i++)e[i]&&e[i].scene&&(e[i].off(o.DESTROY,this.onChildDestroyed,this),e[i].destroy());this.list=[]}else r.RemoveBetween(e,0,e.length,this.removeHandler,this);return this},bringToTop:function(t){return r.BringToTop(this.list,t),this},sendToBack:function(t){return r.SendToBack(this.list,t),this},moveUp:function(t){return r.MoveUp(this.list,t),this},moveDown:function(t){return r.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(t,e,i){return r.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,r=[null],s=this.list.slice(),n=s.length;for(i=2;i<arguments.length;i++)r.push(arguments[i]);for(i=0;i<n;i++)r[0]=s[i],t.apply(e,r);return this},iterate:function(t,e){var i,r=[null];for(i=2;i<arguments.length;i++)r.push(arguments[i]);for(i=0;i<this.list.length;i++)r[0]=this.list[i],t.apply(e,r);return this},setScrollFactor:function(t,e,i){return void 0===e&&(e=t),void 0===i&&(i=!1),this.scrollFactorX=t,this.scrollFactorY=e,i&&(r.SetAll(this.list,"scrollFactorX",t),r.SetAll(this.list,"scrollFactorY",e)),this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.list=[]},onChildDestroyed:function(t){r.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=g},53584(t){t.exports=function(t,e,i,r){i.addToRenderList(e);var s=e.list;if(0!==s.length){var n=e.localTransform;r?(n.loadIdentity(),n.multiply(r),n.translate(e.x,e.y),n.rotate(e.rotation),n.scale(e.scaleX,e.scaleY)):n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u<s.length;u++){var d=s[u];if(d.willRender(i)){var c=d.alpha,f=d.scrollFactorX,p=d.scrollFactorY;a||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode),d.setScrollFactor(f*h,p*l),d.setAlpha(c*o),d.renderCanvas(t,d,i,n),d.setAlpha(c),d.setScrollFactor(f,p)}}e.mask&&e.mask.postRenderCanvas(t)}}},77143(t,e,i){var r=i(25305),s=i(31559),n=i(44603),a=i(23568),o=i(95540);n.register("container",function(t,e){void 0===t&&(t={});var i=a(t,"x",0),n=a(t,"y",0),h=o(t,"children",null),l=new s(this.scene,i,n,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},24961(t,e,i){var r=i(31559);i(39429).register("container",function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))})},29959(t,e,i){var r=i(29747),s=r,n=r;s=i(72249),n=i(53584),t.exports={renderWebGL:s,renderCanvas:n}},72249(t,e,i){var r=i(8054);t.exports=function(t,e,i,s,n,a,o){var h=i.camera;h.addToRenderList(e);var l=e.list,u=l.length;if(0!==u){var d=i,c=e.localTransform;s?(c.loadIdentity(),c.multiply(s),c.translate(e.x,e.y),c.rotate(e.rotation),c.scale(e.scaleX,e.scaleY)):c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var f=-1!==e.blendMode;f||0===d.blendMode||((d=d.getClone()).setBlendMode(0),d.use());for(var p=d,g=e.alpha,m=e.scrollFactorX,v=e.scrollFactorY,y=0;y<u;y++){var x=l[y];if(x.willRender(h)){var T,w,b,S;if(void 0!==x.alphaTopLeft)T=x.alphaTopLeft,w=x.alphaTopRight,b=x.alphaBottomLeft,S=x.alphaBottomRight;else{var C=x.alpha;T=C,w=C,b=C,S=C}var E=x.scrollFactorX,A=x.scrollFactorY;f||x.blendMode===p.blendMode||x.blendMode===r.BlendModes.SKIP_CHECK||((p=d.getClone()).setBlendMode(x.blendMode),p.use()),x.setScrollFactor&&x.setScrollFactor(E*m,A*v),x.setAlpha&&x.setAlpha(T*g,w*g,b*g,S*g),x.renderWebGLStep(t,x,p,c,void 0,l,y),x.setAlpha&&x.setAlpha(T,w,b,S),x.setScrollFactor&&x.setScrollFactor(E,A)}}p!==i&&p.release()}}},47407(t){t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069(t,e,i){var r=i(83419),s=i(31401),n=i(441),a=i(95643),o=i(41212),h=i(35846),l=i(44594),u=i(61369),d=new r({Extends:a,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,n],initialize:function(t,e,i,r,s,n){if(a.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,!this.parent)throw new Error("No DOM Container set in game config");this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof r?"#"===r[0]?this.setElement(r.substr(1),s,n):this.createElement(r,s,n):r&&this.setElement(r,s,n),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.addEventListener(t[e],this.handler,!1)}return this},removeListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.removeEventListener(t[e],this.handler)}return this},dispatchNativeEvent:function(t){this.emit(t.type,t)},createElement:function(t,e,i){return this.setElement(document.createElement(t),e,i)},setElement:function(t,e,i){var r;if(this.removeElement(),"string"==typeof t?("#"===t[0]&&(t=t.substr(1)),r=document.getElementById(t)):"object"==typeof t&&1===t.nodeType&&(r=t),!r)return this;if(this.node=r,e&&o(e))for(var s in e)r.style[s]=e[s];else"string"==typeof e&&(r.style=e);return r.style.zIndex="0",r.style.display="inline",r.style.position="absolute",r.phaser=this,this.parent.appendChild(r),i&&(r.innerText=i),this.updateSize()},createFromCache:function(t,e){var i=this.cache.get(t);return i&&this.createFromHTML(i,e),this},createFromHTML:function(t,e){void 0===e&&(e="div"),this.removeElement();var i=document.createElement(e);return this.node=i,i.style.zIndex="0",i.style.display="inline",i.style.position="absolute",i.phaser=this,this.parent.appendChild(i),i.innerHTML=t,this.updateSize()},removeElement:function(){return this.node&&(h(this.node),this.node=null),this},updateSize:function(){var t=this.node;return this.width=t.clientWidth,this.height=t.clientHeight,this.displayWidth=this.width*this.scaleX,this.displayHeight=this.height*this.scaleY,this},getChildByProperty:function(t,e){if(this.node)for(var i=this.node.querySelectorAll("*"),r=0;r<i.length;r++)if(i[r][t]===e)return i[r];return null},getChildByID:function(t){return this.getChildByProperty("id",t)},getChildByName:function(t){return this.getChildByProperty("name",t)},setClassName:function(t){return this.node&&(this.node.className=t,this.updateSize()),this},setText:function(t){return this.node&&(this.node.innerText=t,this.updateSize()),this},setHTML:function(t){return this.node&&(this.node.innerHTML=t,this.updateSize()),this},preRender:function(){var t=this.parentContainer,e=this.node;e&&t&&!t.willRender()&&(e.style.display="none")},willRender:function(){return!0},preDestroy:function(){this.removeElement(),this.scene.sys.events.off(l.SLEEP,this.handleSceneEvent,this),this.scene.sys.events.off(l.WAKE,this.handleSceneEvent,this),this.scene.sys.events.off(l.PRE_RENDER,this.preRender,this)}});t.exports=d},49381(t,e,i){var r=i(47407),s=i(95643),n=i(61340),a=new n,o=new n,h=new n;t.exports=function(t,e,i,n){if(e.node){i.camera&&(i=i.camera);var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||s.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var d=e.parentContainer,c=i.alpha*e.alpha;d&&(c*=d.alpha);var f=a,p=o,g=h,m=e.width*e.originX,v=e.height*e.originY,y="0%",x="0%";f.copyWithScrollFactorFrom(i.matrix,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),n?(f.multiply(n),m*=e.scaleX,v*=e.scaleY):(y=100*e.originX+"%",x=100*e.originY+"%"),f.translate(-m,-v),p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),f.multiply(p,g),e.transformOnly||(l.display="block",l.opacity=c,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=r[e._blendMode]),l.transform=g.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},2611(t,e,i){var r=i(3069);i(39429).register("dom",function(t,e,i,s,n){var a=new r(this.scene,t,e,i,s,n);return this.displayList.add(a),a})},441(t,e,i){var r=i(29747),s=r,n=r;s=i(49381),n=i(49381),t.exports={renderWebGL:s,renderCanvas:n}},62980(t){t.exports="addedtoscene"},41337(t){t.exports="destroy"},44947(t){t.exports="removedfromscene"},49358(t){t.exports="complete"},35163(t){t.exports="created"},97249(t){t.exports="error"},19483(t){t.exports="locked"},56059(t){t.exports="loop"},26772(t){t.exports="metadata"},64437(t){t.exports="playing"},83411(t){t.exports="play"},75780(t){t.exports="seeked"},67799(t){t.exports="seeking"},63500(t){t.exports="stalled"},55541(t){t.exports="stop"},53208(t){t.exports="textureready"},4992(t){t.exports="unlocked"},12(t){t.exports="unsupported"},51708(t,e,i){t.exports={ADDED_TO_SCENE:i(62980),DESTROY:i(41337),REMOVED_FROM_SCENE:i(44947),VIDEO_COMPLETE:i(49358),VIDEO_CREATED:i(35163),VIDEO_ERROR:i(97249),VIDEO_LOCKED:i(19483),VIDEO_LOOP:i(56059),VIDEO_METADATA:i(26772),VIDEO_PLAY:i(83411),VIDEO_PLAYING:i(64437),VIDEO_SEEKED:i(75780),VIDEO_SEEKING:i(67799),VIDEO_STALLED:i(63500),VIDEO_STOP:i(55541),VIDEO_TEXTURE:i(53208),VIDEO_UNLOCKED:i(4992),VIDEO_UNSUPPORTED:i(12)}},42421(t,e,i){var r=i(83419),s=i(31401),n=i(95643),a=i(64993),o=new r({Extends:n,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.Origin,s.ScrollFactor,s.Size,s.Texture,s.Tint,s.Transform,s.Visible,a],initialize:function(t){n.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=o},70217(){},56315(t,e,i){var r=i(42421);i(39429).register("extern",function(){var t=new r(this.scene);return this.displayList.add(t),t})},64993(t,e,i){var r=i(29747),s=r,n=r;s=i(80287),n=i(70217),t.exports={renderWebGL:s,renderCanvas:n}},80287(t,e,i){var r=i(91296);t.exports=function(t,e,i,s,n,a,o){t.renderNodes.getNode("YieldContext").run(i);var h=r(e,i.camera,s,!i.useCanvas).calc;e.render.call(e,t,i,h,a,o),t.renderNodes.getNode("RebindContext").run(i)}},34637(t,e,i){var r=i(73043),s=i(26099),n=i(41509),a=i(68589),o=i(83419),h=i(20071),l=new o({Extends:h,initialize:function(t,e,i,o,l,u){e||(e={});var d={name:"gradient",fragmentSource:n,shaderAdditions:[{name:"RAMP_0",tags:"RAMP",additions:{fragmentHeader:a}}],initialUniforms:{uRampTexture:0},setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};if(h.call(this,t,d,i,o,l,u),this.type="Gradient",this.ramp=new r(this.scene,e.bands||{colorStart:0,colorEnd:16777215}),this.offset=e.offset||0,this.repeatMode=e.repeatMode||0,this.shapeMode=e.shapeMode||0,this.start=new s(0,0),e.start&&this.start.copy(e.start),this.shape=new s(1,0),e.shape)this.shape.copy(e.shape);else{var c=void 0===e.length?1:e.length,f=e.direction||0;this.shape.setTo(c*Math.cos(f),c*Math.sin(f))}this.dither=!!e.dither,this.setTextures([this.ramp.dataTexture])},_setupUniforms:function(t,e){t("uRampResolution",this.ramp.dataTextureResolution),t("uRampBandStart",this.ramp.dataTextureFirstBand),t("uOffset",this.offset),t("uRepeatMode",this.repeatMode),t("uShapeMode",this.shapeMode),t("uStart",[this.start.x,1-this.start.y]),t("uShape",[this.shape.x,-this.shape.y]),t("uDither",this.dither)},_updateShaderConfig:function(t,e,i){var r=e.ramp.bandTreeDepth,s=i.programManager.getAdditionsByTag("RAMP")[0];s.name="RAMP_"+r,s.additions.fragmentHeader=a.replace("#define BAND_TREE_DEPTH 0.0","#define BAND_TREE_DEPTH "+r+".0")},preDestroy:function(){this.ramp.destroy(),h.prototype.preDestroy.call(this)}});t.exports=l},26353(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(34637);s.register("gradient",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},69315(t,e,i){var r=i(34637);i(39429).register("gradient",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},85592(t){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},43831(t,e,i){var r=i(71911),s=i(83419),n=i(85592),a=i(31401),o=i(8497),h=i(95643),l=i(87891),u=i(95540),d=i(35154),c=i(36383),f=i(84503),p=new s({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Lighting,a.Mask,a.RenderNodes,a.Transform,a.Visible,a.ScrollFactor,f],initialize:function(t,e){var i=d(e,"x",0),r=d(e,"y",0);h.call(this,t,"Graphics"),this.setPosition(i,r),this.initRenderNodes(this._defaultRenderNodesMap),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.pathDetailThreshold=-1,this.lineStyle(1,0,0),this.fillStyle(0,0),this.setDefaultStyles(e)},_defaultRenderNodesMap:{get:function(){return l}},setDefaultStyles:function(t){return d(t,"lineStyle",null)&&(this.defaultStrokeWidth=d(t,"lineStyle.width",1),this.defaultStrokeColor=d(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=d(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),d(t,"fillStyle",null)&&(this.defaultFillColor=d(t,"fillStyle.color",16777215),this.defaultFillAlpha=d(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(n.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(n.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,r,s,a,o,h){return void 0===s&&(s=1),void 0===a&&(a=s),void 0===o&&(o=s),void 0===h&&(h=s),this.commandBuffer.push(n.GRADIENT_FILL_STYLE,s,a,o,h,t,e,i,r),this},lineGradientStyle:function(t,e,i,r,s,a){return void 0===a&&(a=1),this.commandBuffer.push(n.GRADIENT_LINE_STYLE,t,a,e,i,r,s),this},beginPath:function(){return this.commandBuffer.push(n.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(n.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(n.FILL_PATH),this},fill:function(){return this.commandBuffer.push(n.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(n.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(n.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.TAU),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.TAU),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,r){return this.commandBuffer.push(n.FILL_RECT,t,e,i,r),this},strokeRect:function(t,e,i,r){var s=this._lineWidth/2,n=t-s,a=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+r),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+r),this.strokePath(),this.beginPath(),this.moveTo(n,e),this.lineTo(a+i,e),this.strokePath(),this.beginPath(),this.moveTo(n,e+r),this.lineTo(a+i,e+r),this.strokePath(),this},fillRoundedRect:function(t,e,i,r,s){void 0===s&&(s=20);var n=s,a=s,o=s,h=s;"number"!=typeof s&&(n=u(s,"tl",20),a=u(s,"tr",20),o=u(s,"bl",20),h=u(s,"br",20));var l=n>=0,d=a>=0,f=o>=0,p=h>=0;return n=Math.abs(n),a=Math.abs(a),o=Math.abs(o),h=Math.abs(h),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),d?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),p?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),f?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),l?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,r,s){void 0===s&&(s=20);var n=s,a=s,o=s,h=s,l=Math.min(i,r)/2;"number"!=typeof s&&(n=u(s,"tl",20),a=u(s,"tr",20),o=u(s,"bl",20),h=u(s,"br",20));var d=n>=0,f=a>=0,p=o>=0,g=h>=0;return n=Math.min(Math.abs(n),l),a=Math.min(Math.abs(a),l),o=Math.min(Math.abs(o),l),h=Math.min(Math.abs(h),l),this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-a,e),this.moveTo(t+i-a,e),f?this.arc(t+i-a,e+a,a,-c.PI_OVER_2,0):this.arc(t+i,e,a,Math.PI,c.PI_OVER_2,!0),this.lineTo(t+i,e+r-h),this.moveTo(t+i,e+r-h),g?this.arc(t+i-h,e+r-h,h,0,c.PI_OVER_2):this.arc(t+i,e+r,h,-c.PI_OVER_2,Math.PI,!0),this.lineTo(t+o,e+r),this.moveTo(t+o,e+r),p?this.arc(t+o,e+r-o,o,c.PI_OVER_2,Math.PI):this.arc(t,e+r,o,0,-c.PI_OVER_2,!0),this.lineTo(t,e+n),this.moveTo(t,e+n),d?this.arc(t+n,e+n,n,-Math.PI,-c.PI_OVER_2):this.arc(t,e,n,c.PI_OVER_2,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(n.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.FILL_TRIANGLE,t,e,i,r,s,a),this},strokeTriangle:function(t,e,i,r,s,a){return this.commandBuffer.push(n.STROKE_TRIANGLE,t,e,i,r,s,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,r){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,r),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(n.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(n.MOVE_TO,t,e),this},strokePoints:function(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===r&&(r=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s<r;s++)this.lineTo(t[s].x,t[s].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.strokePath(),this},fillPoints:function(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===r&&(r=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s<r;s++)this.lineTo(t[s].x,t[s].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,r,s){void 0===s&&(s=32);var n=new o(t,e,i,r).getPoints(s);return this.strokePoints(n,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,r,s){void 0===s&&(s=32);var n=new o(t,e,i,r).getPoints(s);return this.fillPoints(n,!0)},arc:function(t,e,i,r,s,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(n.ARC,t,e,i,r,s,a,o),this},slice:function(t,e,i,r,s,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(n.BEGIN_PATH),this.commandBuffer.push(n.MOVE_TO,t,e),this.commandBuffer.push(n.ARC,t,e,i,r,s,a,o),this.commandBuffer.push(n.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(n.SAVE),this},restore:function(){return this.commandBuffer.push(n.RESTORE),this},translateCanvas:function(t,e){return this.commandBuffer.push(n.TRANSLATE,t,e),this},scaleCanvas:function(t,e){return this.commandBuffer.push(n.SCALE,t,e),this},rotateCanvas:function(t){return this.commandBuffer.push(n.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var r,s,n=this.scene.sys,a=n.game.renderer;void 0===e&&(e=n.scale.width),void 0===i&&(i=n.scale.height),p.TargetCamera.setScene(this.scene),p.TargetCamera.setViewport(0,0,e,i),p.TargetCamera.scrollX=this.x,p.TargetCamera.scrollY=this.y;var o={willReadFrequently:!0};if("string"==typeof t)if(n.textures.exists(t)){var h=(r=n.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(s=h.getContext("2d",o))}else s=(r=n.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",o);else t instanceof HTMLCanvasElement&&(s=t.getContext("2d",o));return s&&(this.renderCanvas(a,this,p.TargetCamera,null,s,!1),r&&r.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});p.TargetCamera=new r,t.exports=p},32768(t,e,i){var r=i(85592),s=i(20926);t.exports=function(t,e,i,n,a,o){var h=e.commandBuffer,l=h.length,u=a||t.currentContext;if(0!==l&&s(t,u,e,i,n)){i.addToRenderList(e);var d=1,c=1,f=0,p=0,g=1,m=0,v=0,y=0;u.beginPath();for(var x=0;x<l;++x){switch(h[x]){case r.ARC:u.arc(h[x+1],h[x+2],h[x+3],h[x+4],h[x+5],h[x+6]),x+=7;break;case r.LINE_STYLE:g=h[x+1],f=h[x+2],d=h[x+3],m=(16711680&f)>>>16,v=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+m+","+v+","+y+","+d+")",u.lineWidth=g,x+=3;break;case r.FILL_STYLE:p=h[x+1],c=h[x+2],m=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+m+","+v+","+y+","+c+")",x+=2;break;case r.BEGIN_PATH:u.beginPath();break;case r.CLOSE_PATH:u.closePath();break;case r.FILL_PATH:o||u.fill();break;case r.STROKE_PATH:o||u.stroke();break;case r.FILL_RECT:o?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case r.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.fill(),x+=6;break;case r.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),o||u.stroke(),x+=6;break;case r.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case r.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case r.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case r.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case r.SAVE:u.save();break;case r.RESTORE:u.restore();break;case r.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case r.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case r.ROTATE:u.rotate(h[x+1]),x+=1;break;case r.GRADIENT_FILL_STYLE:x+=5;break;case r.GRADIENT_LINE_STYLE:x+=6}}u.restore()}}},87079(t,e,i){var r=i(44603),s=i(43831);r.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},1201(t,e,i){var r=i(43831);i(39429).register("graphics",function(t){return this.displayList.add(new r(this.scene,t))})},84503(t,e,i){var r=i(29747),s=r,n=r;s=i(77545),n=i(32768),n=i(32768),t.exports={renderWebGL:s,renderCanvas:n}},77545(t,e,i){var r=i(85592),s=i(91296),n=i(70554),a=i(61340),o=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.points[0]=new o(t,e,i),this.addPoint=function(t,e,i){var r=this.points[this.points.length-1];r.x===t&&r.y===e||this.points.push(new o(t,e,i))}},l=[],u=new a,d=new a,c={TL:0,TR:0,BL:0,BR:0},f={TL:0,TR:0,BL:0,BR:0},p=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){if(0!==e.commandBuffer.length){var o=e.customRenderNodes,g=e.defaultRenderNodes,m=o.Submitter||g.Submitter,v=e.lighting,y=i,x=y.camera;x.addToRenderList(e);for(var T=s(e,x,a,!i.useCanvas).calc,w=u.loadIdentity(),b=e.commandBuffer,S=e.alpha,C=Math.max(e.pathDetailThreshold,t.config.pathDetailThreshold,0),E=1,A=0,_=0,M=0,R=2*Math.PI,P=[],O=0,L=!0,F=null,D=n.getTintAppendFloatAlpha,I=0;I<b.length;I++)switch(b[I]){case r.BEGIN_PATH:P.length=0,F=null,L=!0;break;case r.CLOSE_PATH:L=!1,F&&F.points.length&&F.points.push(F.points[0]);break;case r.FILL_PATH:for(T.multiply(w,d),O=0;O<P.length;O++)(o.FillPath||g.FillPath).run(y,d,m,P[O].points,c.TL,c.TR,c.BL,C,v);break;case r.STROKE_PATH:for(T.multiply(w,d),O=0;O<P.length;O++)(o.StrokePath||g.StrokePath).run(y,m,P[O].points,E,L,d,f.TL,f.TR,f.BL,f.BR,C,v);break;case r.LINE_STYLE:E=b[++I];var N=D(b[++I],b[++I]*S);f.TL=N,f.TR=N,f.BL=N,f.BR=N;break;case r.FILL_STYLE:var B=D(b[++I],b[++I]*S);c.TL=B,c.TR=B,c.BL=B,c.BR=B;break;case r.GRADIENT_FILL_STYLE:var k=b[++I]*S,U=b[++I]*S,z=b[++I]*S,Y=b[++I]*S;c.TL=D(b[++I],k),c.TR=D(b[++I],U),c.BL=D(b[++I],z),c.BR=D(b[++I],Y);break;case r.GRADIENT_LINE_STYLE:E=b[++I];var X=b[++I]*S;f.TL=D(b[++I],X),f.TR=D(b[++I],X),f.BL=D(b[++I],X),f.BR=D(b[++I],X);break;case r.ARC:var W=0,G=b[++I],V=b[++I],H=b[++I],j=b[++I],q=b[++I],K=b[++I],Z=b[++I];for(q-=j,K?q<-R?q=-R:q>0&&(q=q%R-R):q>R?q=R:q<0&&(q=R+q%R),null===F&&(F=new h(G+Math.cos(j)*H,V+Math.sin(j)*H,E),P.push(F),W+=.01);W<1+Z;)M=q*W+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,F.addPoint(A,_,E),W+=.01;M=q+j,A=G+Math.cos(M)*H,_=V+Math.sin(M)*H,F.addPoint(A,_,E);break;case r.FILL_RECT:T.multiply(w,d),(o.FillRect||g.FillRect).run(y,d,m,b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,c.BR,v);break;case r.FILL_TRIANGLE:T.multiply(w,d),(o.FillTri||g.FillTri).run(y,d,m,b[++I],b[++I],b[++I],b[++I],b[++I],b[++I],c.TL,c.TR,c.BL,v);break;case r.STROKE_TRIANGLE:T.multiply(w,d),p[0].x=b[++I],p[0].y=b[++I],p[0].width=E,p[1].x=b[++I],p[1].y=b[++I],p[1].width=E,p[2].x=b[++I],p[2].y=b[++I],p[2].width=E,p[3].x=p[0].x,p[3].y=p[0].y,p[3].width=E,(o.StrokePath||g.StrokePath).run(y,m,p,E,!1,d,f.TL,f.TR,f.BL,f.BR,v);break;case r.LINE_TO:G=b[++I],V=b[++I],null!==F?F.addPoint(G,V,E):(F=new h(G,V,E),P.push(F));break;case r.MOVE_TO:F=new h(b[++I],b[++I],E),P.push(F);break;case r.SAVE:l.push(w.copyToArray());break;case r.RESTORE:w.copyFromArray(l.pop());break;case r.TRANSLATE:G=b[++I],V=b[++I],w.translate(G,V);break;case r.SCALE:G=b[++I],V=b[++I],w.scale(G,V);break;case r.ROTATE:w.rotate(b[++I])}}}},26479(t,e,i){var r=i(61061),s=i(83419),n=i(51708),a=i(50792),o=i(46710),h=i(95540),l=i(35154),u=i(97022),d=i(41212),c=i(88492),f=i(68287),p=new s({Extends:a,initialize:function(t,e,i){a.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?d(e[0])&&(i=e,e=null):d(e)&&(i=e,e=null),this.scene=t,this.children=new Set,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",f),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,r,s,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===r&&(r=this.defaultFrame),void 0===s&&(s=!0),void 0===n&&(n=!0),this.isFull())return null;var a=new this.classType(this.scene,t,e,i,r);return a.addToDisplayList(this.scene.sys.displayList),a.addToUpdateList(),a.visible=s,a.setActive(n),this.add(a),a},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i<t.length;i++){var r=this.createFromConfig(t[i]);e=e.concat(r)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=h(t,"classType",this.classType);var e=h(t,"key",void 0),i=h(t,"frame",null),s=h(t,"visible",!0),n=h(t,"active",!0),a=[];if(void 0===e)return a;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var o=h(t,"repeat",0),d=h(t,"randomKey",!1),f=h(t,"randomFrame",!1),p=h(t,"yoyo",!1),g=h(t,"quantity",!1),m=h(t,"frameQuantity",1),v=h(t,"max",0),y=c(e,i,{max:v,qty:g||m,random:d,randomB:f,repeat:o,yoyo:p});t.createCallback&&(this.createCallback=t.createCallback),t.removeCallback&&(this.removeCallback=t.removeCallback),t.internalCreateCallback&&(this.internalCreateCallback=t.internalCreateCallback),t.internalRemoveCallback&&(this.internalRemoveCallback=t.internalRemoveCallback);for(var x=0;x<y.length;x++){var T=this.create(0,0,y[x].a,y[x].b,s,n);if(!T)break;a.push(T)}if(u(t,"setXY")){var w=l(t,"setXY.x",0),b=l(t,"setXY.y",0),S=l(t,"setXY.stepX",0),C=l(t,"setXY.stepY",0);r.SetXY(a,w,b,S,C)}if(u(t,"setRotation")){var E=l(t,"setRotation.value",0),A=l(t,"setRotation.step",0);r.SetRotation(a,E,A)}if(u(t,"setScale")){var _=l(t,"setScale.x",1),M=l(t,"setScale.y",_),R=l(t,"setScale.stepX",0),P=l(t,"setScale.stepY",0);r.SetScale(a,_,M,R,P)}if(u(t,"setOrigin")){var O=l(t,"setOrigin.x",.5),L=l(t,"setOrigin.y",O),F=l(t,"setOrigin.stepX",0),D=l(t,"setOrigin.stepY",0);r.SetOrigin(a,O,L,F,D)}if(u(t,"setAlpha")){var I=l(t,"setAlpha.value",1),N=l(t,"setAlpha.step",0);r.SetAlpha(a,I,N)}if(u(t,"setDepth")){var B=l(t,"setDepth.value",0),k=l(t,"setDepth.step",0);r.SetDepth(a,B,k)}if(u(t,"setScrollFactor")){var U=l(t,"setScrollFactor.x",1),z=l(t,"setScrollFactor.y",U),Y=l(t,"setScrollFactor.stepX",0),X=l(t,"setScrollFactor.stepY",0);r.SetScrollFactor(a,U,z,Y,X)}var W=h(t,"hitArea",null),G=h(t,"hitAreaCallback",null);W&&r.SetHitArea(a,W,G);var V=h(t,"gridAlign",!1);return V&&r.GridAlign(a,V),this.createMultipleCallback&&this.createMultipleCallback.call(this,a),a},preUpdate:function(t,e){this.runChildUpdate&&0!==this.children.size&&this.children.forEach(function(i){i.active&&i.update(t,e)})},add:function(t,e){return void 0===e&&(e=!1),this.isFull()||(this.children.add(t),this.internalCreateCallback&&this.internalCreateCallback.call(this,t),this.createCallback&&this.createCallback.call(this,t),e&&(t.addToDisplayList(this.scene.sys.displayList),t.addToUpdateList()),t.on(n.DESTROY,this.remove,this)),this},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.has(t)?(this.children.delete(t),this.internalRemoveCallback&&this.internalRemoveCallback.call(this,t),this.removeCallback&&this.removeCallback.call(this,t),t.off(n.DESTROY,this.remove,this),i?t.destroy():e&&(t.removeFromDisplayList(),t.removeFromUpdateList()),this):this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.children;return i.forEach(function(i){i.off(n.DESTROY,this.remove,this),e?i.destroy():t&&(i.removeFromDisplayList(),i.removeFromUpdateList())},this),i.clear(),this},contains:function(t){return this.children.has(t)},getChildren:function(){return Array.from(this.children)},getLength:function(){return this.children.size},getMatching:function(t,e,i,r){return o(Array.from(this.children),t,e,i,r)},getFirst:function(t,e,i,r,s,n,a){return this.getHandler(!0,1,t,e,i,r,s,n,a)},getFirstNth:function(t,e,i,r,s,n,a,o){return this.getHandler(!0,t,e,i,r,s,n,a,o)},getLast:function(t,e,i,r,s,n,a){return this.getHandler(!1,1,t,e,i,r,s,n,a)},getLastNth:function(t,e,i,r,s,n,a,o){return this.getHandler(!1,t,e,i,r,s,n,a,o)},getHandler:function(t,e,i,r,s,n,a,o,h){var l,u;void 0===i&&(i=!1),void 0===r&&(r=!1);var d=0,c=Array.from(this.children);if(t)for(u=0;u<c.length;u++)if((l=c[u]).active===i){if(++d===e)break}else l=null;else for(u=c.length-1;u>=0;u--)if((l=c[u]).active===i){if(++d===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof n&&(l.y=n),l):r?this.create(s,n,a,o,h):null},get:function(t,e,i,r,s){return this.getFirst(!1,!0,t,e,i,r,s)},getFirstAlive:function(t,e,i,r,s,n){return this.getFirst(!0,t,e,i,r,s,n)},getFirstDead:function(t,e,i,r,s,n){return this.getFirst(!1,t,e,i,r,s,n)},playAnimation:function(t,e){return r.PlayAnimation(Array.from(this.children),t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);var e=0;return this.children.forEach(function(i){i.active===t&&e++}),e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,s,n){return r.PropertyValueSet(Array.from(this.children),t,e,i,s,n),this},propertyValueInc:function(t,e,i,s,n){return r.PropertyValueInc(Array.from(this.children),t,e,i,s,n),this},setX:function(t,e){return r.SetX(Array.from(this.children),t,e),this},setY:function(t,e){return r.SetY(Array.from(this.children),t,e),this},setXY:function(t,e,i,s){return r.SetXY(Array.from(this.children),t,e,i,s),this},incX:function(t,e){return r.IncX(Array.from(this.children),t,e),this},incY:function(t,e){return r.IncY(Array.from(this.children),t,e),this},incXY:function(t,e,i,s){return r.IncXY(Array.from(this.children),t,e,i,s),this},shiftPosition:function(t,e,i){return r.ShiftPosition(Array.from(this.children),t,e,i),this},angle:function(t,e){return r.Angle(Array.from(this.children),t,e),this},rotate:function(t,e){return r.Rotate(Array.from(this.children),t,e),this},rotateAround:function(t,e){return r.RotateAround(Array.from(this.children),t,e),this},rotateAroundDistance:function(t,e,i){return r.RotateAroundDistance(Array.from(this.children),t,e,i),this},setAlpha:function(t,e){return r.SetAlpha(Array.from(this.children),t,e),this},setTint:function(t,e,i,s){return r.SetTint(Array.from(this.children),t,e,i,s),this},setOrigin:function(t,e,i,s){return r.SetOrigin(Array.from(this.children),t,e,i,s),this},scaleX:function(t,e){return r.ScaleX(Array.from(this.children),t,e),this},scaleY:function(t,e){return r.ScaleY(Array.from(this.children),t,e),this},scaleXY:function(t,e,i,s){return r.ScaleXY(Array.from(this.children),t,e,i,s),this},setDepth:function(t,e){return r.SetDepth(Array.from(this.children),t,e),this},setBlendMode:function(t){return r.SetBlendMode(Array.from(this.children),t),this},setHitArea:function(t,e){return r.SetHitArea(Array.from(this.children),t,e),this},shuffle:function(){return r.Shuffle(Array.from(this.children)),this},kill:function(t){this.children.has(t)&&t.setActive(!1)},killAndHide:function(t){this.children.has(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return r.SetVisible(Array.from(this.children),t,e,i),this},toggleVisible:function(){return r.ToggleVisible(Array.from(this.children)),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(n.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=p},94975(t,e,i){var r=i(44603),s=i(26479);r.register("group",function(t){return new s(this.scene,null,t)})},3385(t,e,i){var r=i(26479);i(39429).register("group",function(t,e){return this.updateList.add(new r(this.scene,t,e))})},88571(t,e,i){var r=i(40939),s=i(83419),n=i(31401),a=i(95643),o=i(59819),h=new s({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s){a.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=h},40652(t){t.exports=function(t,e,i,r){i.addToRenderList(e),t.batchSprite(e,e.frame,i,r)}},82459(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(88571);s.register("image",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},2117(t,e,i){var r=i(88571);i(39429).register("image",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},59819(t,e,i){var r=i(29747),s=r,n=r;s=i(99517),n=i(40652),t.exports={renderWebGL:s,renderCanvas:n}},99517(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}},77856(t,e,i){var r={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Stamp:i(14727),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),Stamp:i(85326),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),Stamp:i(31479),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};r.CaptureFrame=i(43451),r.Gradient=i(34637),r.Noise=i(35387),r.NoiseCell2D=i(51513),r.NoiseCell3D=i(15686),r.NoiseCell4D=i(41946),r.NoiseSimplex2D=i(1792),r.NoiseSimplex3D=i(51098),r.Shader=i(20071),r.NineSlice=i(28103),r.PointLight=i(80321),r.SpriteGPULayer=i(76573),r.Factories.CaptureFrame=i(20421),r.Factories.Gradient=i(69315),r.Factories.Noise=i(34757),r.Factories.NoiseCell2D=i(26590),r.Factories.NoiseCell3D=i(89918),r.Factories.NoiseCell4D=i(65874),r.Factories.NoiseSimplex2D=i(80308),r.Factories.NoiseSimplex3D=i(73810),r.Factories.Shader=i(74177),r.Factories.NineSlice=i(47521),r.Factories.PointLight=i(71255),r.Factories.SpriteGPULayer=i(96019),r.Creators.CaptureFrame=i(23675),r.Creators.Gradient=i(26353),r.Creators.Noise=i(39931),r.Creators.NoiseCell2D=i(98292),r.Creators.NoiseCell3D=i(97044),r.Creators.NoiseCell4D=i(20136),r.Creators.NoiseSimplex2D=i(51754),r.Creators.NoiseSimplex3D=i(71112),r.Creators.Shader=i(54935),r.Creators.NineSlice=i(28279),r.Creators.PointLight=i(39829),r.Creators.SpriteGPULayer=i(16193),r.Light=i(41432),r.LightsManager=i(61356),r.LightsPlugin=i(88992),t.exports=r},93595(t,e,i){var r=i(10312),s=i(83419),n=i(31401),a=i(50792),o=i(95643),h=i(51708),l=i(73162),u=i(33963),d=i(44594),c=i(19186),f=new s({Extends:l,Mixins:[a,o,n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Visible,u],initialize:function(t,e){l.call(this,t),a.call(this),o.call(this,t,"Layer"),this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),e&&this.add(e),this.addRenderStep&&this.addRenderStep(this.renderWebGL),t.sys.queueDepthSort()},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(h.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(h.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(c(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(t){if(this.scene&&!this.ignoreDestroy){o.prototype.destroy.call(this,t);for(var e=this.list;e.length;)e[0].destroy(t);this.list=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},2956(t){t.exports=function(t,e,i){var r=e.list;if(0!==r.length){e.depthSort();var s=-1!==e.blendMode;s||t.setBlendMode(0);var n=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var a=0;a<r.length;a++){var o=r[a];if(o.willRender(i)){var h=o.alpha;s||o.blendMode===t.currentBlendMode||t.setBlendMode(o.blendMode),o.setAlpha(h*n),o.renderCanvas(t,o,i),o.setAlpha(h)}}e.mask&&e.mask.postRenderCanvas(t)}}},25179(t,e,i){var r=i(25305),s=i(93595),n=i(44603),a=i(23568);n.register("layer",function(t,e){void 0===t&&(t={});var i=a(t,"children",null),n=new s(this.scene,i);return void 0!==e&&(t.add=e),r(this.scene,n,t),n})},20005(t,e,i){var r=i(93595);i(39429).register("layer",function(t){return this.displayList.add(new r(this.scene,t))})},33963(t,e,i){var r=i(29747),s=r,n=r;s=i(15869),n=i(2956),t.exports={renderWebGL:s,renderCanvas:n}},15869(t,e,i){var r=i(8054);t.exports=function(t,e,i,s,n,a,o){var h=e.list,l=h.length;if(0!==l){var u=i,d=u.camera;e.depthSort();var c=e.blendMode!==r.BlendModes.SKIP_CHECK;c||0===u.blendMode||((u=u.getClone()).setBlendMode(0),u.use());for(var f=e.alpha,p=0;p<l;p++){var g=h[p];if(g.willRender(d)){var m,v,y,x;if(void 0!==g.alphaTopLeft)m=g.alphaTopLeft,v=g.alphaTopRight,y=g.alphaBottomLeft,x=g.alphaBottomRight;else{var T=g.alpha;m=T,v=T,y=T,x=T}c||g.blendMode===u.blendMode||g.blendMode===r.BlendModes.SKIP_CHECK||((u=u.getClone()).setBlendMode(g.blendMode),u.use()),g.setAlpha(m*f,v*f,y*f,x*f),g.renderWebGLStep(t,g,u,void 0,void 0,h,p),g.setAlpha(m,v,y,x)}}u!==i&&u.release()}}},41432(t,e,i){var r=i(96503),s=i(83419),n=i(31401),a=i(51767),o=i(70554),h=new s({Extends:r,Mixins:[n.Origin,n.ScrollFactor,n.Visible],initialize:function(t,e,i,s,n,o,h,l){r.call(this,t,e,i),this.color=new a(s,n,o),this.intensity=h,this.z=void 0===l?.1*i:l,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},zNormal:{get:function(){return this.z/this.radius},set:function(t){this.z=t*this.radius}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=o.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this},setZ:function(t){return this.z=t,this},setZNormal:function(t){return this.z=t*this.radius,this}});h.RENDER_MASK=15,t.exports=h},61356(t,e,i){var r=i(81491),s=i(83419),n=i(20339),a=i(41432),o=i(80321),h=i(51767),l=i(19133),u=i(19186),d=i(70554),c=new s({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,r,s,n){return this.systems.displayList.add(new o(this.scene,t,e,i,r,s,n))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,s=[],a=0;a<e.length;a++){var o=e[a];o.willRender(t)&&r(o,i)&&s.push({light:o,distance:n(o.x,o.y,i.centerX,i.centerY)})}return s.length>this.maxLights&&(u(s,this.sortByDistance),s=s.slice(0,this.maxLights)),this.visibleLights=s.length,s},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=d.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===r&&(r=16777215),void 0===s&&(s=1),void 0===n&&(n=.1*i);var o=d.getFloatsFromUintRGB(r),h=new a(t,e,i,o[0],o[1],o[2],s,n);return this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=c},88992(t,e,i){var r=i(83419),s=i(61356),n=i(37277),a=i(44594),o=new r({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(a.BOOT,this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on(a.SHUTDOWN,this.shutdown,this),t.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});n.register("LightsPlugin",o,"lights"),t.exports=o},28103(t,e,i){var r=i(30529),s=i(83419),n=i(31401),a=i(95643),o=i(78023),h=i(84322),l=i(82513),u=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,r,s,n,o,u,d,c,f,p,g){a.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tileX=p||!1,this.tileY=g||!1,this._repeatCountX=1,this._repeatCountY=1,this.tint=16777215,this.tintMode=h.MULTIPLY;var m=t.textures.getFrame(r,s);this.is3Slice=!c&&!f,m&&m.scale9&&(this.is3Slice=m.is3Slice);for(var v=this.is3Slice?18:54,y=0;y<v;y++)this.vertices.push(new l);this.setPosition(e,i),this.setTexture(r,s),this.setSlices(n,o,u,d,c,f,!1),this.updateDisplayOrigin(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setSlices:function(t,e,i,r,s,n,a){void 0===i&&(i=10),void 0===r&&(r=10),void 0===s&&(s=0),void 0===n&&(n=0),void 0===a&&(a=!1);var o=this.frame,h=!1;if(this.is3Slice&&a&&0!==s&&0!==n&&(h=!0),h)console.warn("Cannot change 9 slice to 3 slice");else{if(o&&o.scale9&&!a){var l=o.data.scale9Borders,u=l.x,d=l.y;i=u,r=o.width-l.w-u,s=d,n=o.height-l.h-d,void 0===t&&(t=o.width),void 0===e&&(e=o.height)}else void 0===t&&(t=256),void 0===e&&(e=256);this._width=t,this._height=e,this.leftWidth=i,this.rightWidth=r,this.topHeight=s,this.bottomHeight=n,this.is3Slice&&(e=o.height,this._height=e,this.topHeight=e,this.bottomHeight=0),this.updateVertices(),this.updateUVs()}return this},updateUVs:function(){var t=this.leftWidth,e=this.rightWidth,i=this.topHeight,r=this.bottomHeight,s=this.frame.width,n=this.frame.height,a=t/s,o=1-e/s,h=i/n,l=1-r/n,u=0;if(this.is3Slice)this._updateUVRow(u,a,o,0,h);else{u=this._updateUVRow(u,a,o,0,h);for(var d=0;d<this._repeatCountY;d++)u=this._updateUVRow(u,a,o,h,l);this._updateUVRow(u,a,o,l,1)}},_updateUVRow:function(t,e,i,r,s){this.updateQuadUVs(t,0,r,e,s),t+=6;for(var n=0;n<this._repeatCountX;n++)this.updateQuadUVs(t,e,r,i,s),t+=6;return this.updateQuadUVs(t,i,r,1,s),t+=6},updateVertices:function(){var t=this.leftWidth,e=this.rightWidth,i=this.topHeight,r=this.bottomHeight,s=this.width,n=this.height,a=this.frame,o=this.tileX?this._calcRepeatCount(s-t-e,a.width-t-e):1,h=this.tileY&&!this.is3Slice?this._calcRepeatCount(n-i-r,a.height-i-r):1,l=this._rebuildVertexArray(o,h),u=-.5,d=t/s-.5,c=.5-e/s,f=.5,p=.5-i/n,g=(c-d)/o,m=0;if(this.is3Slice)this._updateVertexRow(m,u,d,c,f,.5,p,g);else{var v=r/n-.5,y=(p-v)/h;m=this._updateVertexRow(m,u,d,c,f,.5,p,g);for(var x=0;x<h;x++){var T=p-x*y,w=p-(x+1)*y;m=this._updateVertexRow(m,u,d,c,f,T,w,g)}this._updateVertexRow(m,u,d,c,f,v,-.5,g)}l&&this.updateUVs()},_calcRepeatCount:function(t,e){return e>0?Math.max(1,Math.floor(t/e)):1},_rebuildVertexArray:function(t,e){if(t===this._repeatCountX&&e===this._repeatCountY)return!1;this._repeatCountX=t,this._repeatCountY=e;var i=(t+2)*(this.is3Slice?1:e+2)*6,r=this.vertices;if(r.length!==i){r.length=0;for(var s=0;s<i;s++)r.push(new l)}return!0},_updateVertexRow:function(t,e,i,r,s,n,a,o){this.updateQuad(t,e,n,i,a),t+=6;for(var h=0;h<this._repeatCountX;h++)this.updateQuad(t,i+h*o,n,i+(h+1)*o,a),t+=6;return this.updateQuad(t,r,n,s,a),t+=6},updateQuad:function(t,e,i,r,s){var n=this.width,a=this.height,o=this.originX,h=this.originY,l=this.vertices;l[t+0].resize(e,i,n,a,o,h),l[t+1].resize(e,s,n,a,o,h),l[t+2].resize(r,i,n,a,o,h),l[t+3].resize(e,s,n,a,o,h),l[t+4].resize(r,s,n,a,o,h),l[t+5].resize(r,i,n,a,o,h)},updateQuadUVs:function(t,e,i,r,s){var n=this.vertices,a=this.frame,o=a.u0,h=a.v0,l=a.u1,u=a.v1;if(0!==o||1!==l){var d=l-o;e=o+e*d,r=o+r*d}if(0!==h||1!==u){var c=u-h;i=h+i*c,s=h+s*c}n[t+0].setUVs(e,i),n[t+1].setUVs(e,s),n[t+2].setUVs(r,i),n[t+3].setUVs(e,s),n[t+4].setUVs(r,s),n[t+5].setUVs(r,i)},clearTint:function(){return this.setTint(16777215),this.setTintMode(),this},setTint:function(t){return void 0===t&&(t=16777215),this.tint=t,this},setTintMode:function(t){return void 0===t&&(t=h.MULTIPLY),this.tintMode=t,this},isTinted:{get:function(){return 16777215!==this.tint||this.tintMode!==h.MULTIPLY}},width:{get:function(){return this._width},set:function(t){this._width=Math.max(t,this.leftWidth+this.rightWidth),this.updateVertices()}},height:{get:function(){return this._height},set:function(t){this.is3Slice||(this._height=Math.max(t,this.topHeight+this.bottomHeight),this.updateVertices())}},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},originX:{get:function(){return this._originX},set:function(t){this._originX=t,this.updateVertices()}},originY:{get:function(){return this._originY},set:function(t){this._originY=t,this.updateVertices()}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this._originX=t,this._originY=e,this.updateVertices(),this.updateDisplayOrigin()},setSizeToFrame:function(){if(this.is3Slice){var t=this.frame.height;this._height=t,this.topHeight=t,this.bottomHeight=0}return this.updateUVs(),this},preDestroy:function(){this.vertices=[]}});t.exports=u},28279(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(35154),o=i(28103);s.register("nineslice",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),h=a(t,"width",256),l=a(t,"height",256),u=a(t,"leftWidth",10),d=a(t,"rightWidth",10),c=a(t,"topHeight",0),f=a(t,"bottomHeight",0),p=a(t,"tileX",!1),g=a(t,"tileY",!1),m=new o(this.scene,0,0,i,s,h,l,u,d,c,f,p,g);return void 0!==e&&(t.add=e),r(this.scene,m,t),m})},47521(t,e,i){var r=i(28103);i(39429).register("nineslice",function(t,e,i,s,n,a,o,h,l,u,d,c){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h,l,u,d,c))})},78023(t,e,i){var r=i(29747),s=r,n=r;s=i(52230),t.exports={renderWebGL:s,renderCanvas:n}},82513(t,e,i){var r=i(83419),s=i(26099),n=new r({Extends:s,initialize:function(t,e,i,r){s.call(this,t,e),this.vx=0,this.vy=0,this.u=i,this.v=r},setUVs:function(t,e){return this.u=t,this.v=e,this},resize:function(t,e,i,r,s,n){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*r,s<.5?this.vx+=i*(.5-s):s>.5&&(this.vx-=i*(s-.5)),n<.5?this.vy+=r*(.5-n):n>.5&&(this.vy-=r*(n-.5)),this}});t.exports=n},52230(t,e,i){var r=i(91296),s=i(70554),n={multiTexturing:!0};t.exports=function(t,e,i,a){var o=e.vertices,h=o.length;if(0!==h){var l=i.camera;l.addToRenderList(e);for(var u,d,c,f=e.alpha,p=e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler,g=r(e,l,a,!i.useCanvas).calc,m=s.getTintAppendFloatAlpha(e.tint,f),v=e.frame.source.glTexture,y=e.tintMode,x=0;x<h;x+=6)d=o[x+1],c=o[x+2],u=g.setQuad(d.vx,d.vy,c.vx,c.vy),p.batch(i,v,u[0],u[1],u[2],u[3],u[6],u[7],u[4],u[5],d.u,d.v,c.u-d.u,c.v-d.v,y,m,m,m,m,n)}}},35387(t,e,i){var r=i(83419),s=i(20071),n=i(40987),a=i(16421),o=new r({Extends:s,initialize:function(t,e,i,r,o,h){e||(e={});var l={name:"noise",fragmentSource:a,setupUniforms:this._setupUniforms};s.call(this,t,l,i,r,o,h),this.type="Noise",this.noiseOffset=[0,0],e.noiseOffset&&(this.noiseOffset=e.noiseOffset),this.noisePower=void 0===e.noisePower?1:e.noisePower,this.noiseColorStart=new n(0,0,0),this.noiseColorEnd=new n(255,255,255),void 0===e.noiseColorStart&&void 0===e.noiseColorEnd||this.setNoiseColor(e.noiseColorStart,e.noiseColorEnd),this.noiseRandomChannels=!!e.noiseRandomChannels,this.noiseRandomNormal=!!e.noiseRandomNormal},setNoiseColor:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=16777215),"number"==typeof t?n.IntegerToColor(t,this.noiseColorStart):"string"==typeof t?n.HexStringToColor(t,this.noiseColorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof n&&this.noiseColorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?n.IntegerToColor(e,this.noiseColorEnd):"string"==typeof e?n.HexStringToColor(e,this.noiseColorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof n&&this.noiseColorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},_setupUniforms:function(t){t("uOffset",this.noiseOffset),t("uColorStart",this.noiseColorStart.gl),t("uColorEnd",this.noiseColorEnd.gl),t("uPower",this.noisePower);var e=0;this.noiseRandomChannels&&(e=1),this.noiseRandomNormal&&(e=2),t("uMode",e)}});t.exports=o},39931(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(35387);s.register("noise",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},34757(t,e,i){var r=i(35387);i(39429).register("noise",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},51513(t,e,i){var r=i(83419),s=i(20071),n=i(40987),a=i(17205),o=new r({Extends:s,initialize:function(t,e,i,r,o,h){e||(e={});var l={name:"noiseCell2D",fragmentSource:a,shaderAdditions:[{name:"MODE_DISTANCE",tags:["MODE"],additions:{fragmentMode:"#define MODE_DISTANCE"}},{name:"ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!e.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};s.call(this,t,l,i,r,o,h),this.type="NoiseCell2D",this.noiseCells=[32,32],e.noiseCells&&(this.noiseCells=e.noiseCells),this.noiseWrap=[this.noiseCells[0],this.noiseCells[1]],e.noiseWrap&&(this.noiseWrap=e.noiseWrap),this.noiseOffset=[0,0],e.noiseOffset&&(this.noiseOffset=e.noiseOffset),this.noiseVariation=[1,1],e.noiseVariation&&(this.noiseVariation=e.noiseVariation),this.noiseIterations=1,e.noiseIterations&&(this.noiseIterations=e.noiseIterations),this.noiseMode=0,e.noiseMode&&(this.noiseMode=e.noiseMode),this.noiseSmoothing=1,e.noiseSmoothing&&(this.noiseSmoothing=e.noiseSmoothing),this.noiseNormalMap=!!e.noiseNormalMap,this.noiseNormalScale=1,void 0!==e.noiseNormalScale&&(this.noiseNormalScale=e.noiseNormalScale),this.noiseColorStart=new n(0,0,0),this.noiseColorEnd=new n(255,255,255),void 0===e.noiseColorStart&&void 0===e.noiseColorEnd||this.setNoiseColor(e.noiseColorStart,e.noiseColorEnd),this.noiseSeed=[1,2,3,4,5,6,7,8],e.noiseSeed&&(this.noiseSeed=e.noiseSeed),e.randomizeNoiseSeed&&this.randomizeNoiseSeed(),this.keepAwake=!0},setNoiseColor:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=16777215),"number"==typeof t?n.IntegerToColor(t,this.noiseColorStart):"string"==typeof t?n.HexStringToColor(t,this.noiseColorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof n&&this.noiseColorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?n.IntegerToColor(e,this.noiseColorEnd):"string"==typeof e?n.HexStringToColor(e,this.noiseColorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof n&&this.noiseColorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},randomizeNoiseSeed:function(){for(var t=this.noiseSeed.length,e=0;e<t;e++)this.noiseSeed[e]=Math.random();return this},wrapNoise:function(){for(var t=this.noiseWrap.length,e=0;e<t;e++)this.noiseWrap[e]=this.noiseCells[e];return this},_setupUniforms:function(t){if(this.keepAwake){var e=Math.sin(this.scene.time.now)/4096/256;t("uCellOffset",[this.noiseOffset[0]+e,this.noiseOffset[1]+e])}else t("uCellOffset",this.noiseOffset);t("uSeedX",this.noiseSeed.slice(0,2)),t("uSeedY",this.noiseSeed.slice(2,4)),t("uCells",this.noiseCells),t("uVariation",this.noiseVariation),t("uWrap",this.noiseWrap),t("uSmoothing",this.noiseSmoothing),t("uNormalScale",this.noiseNormalScale),t("uColorStart",this.noiseColorStart.gl),t("uColorEnd",this.noiseColorEnd.gl)},_updateShaderConfig:function(t,e,i){var r=Math.max(1,Math.floor(e.noiseIterations)),s=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];s.name="ITERATION_COUNT_"+r,s.additions.fragmentIterations="#define ITERATION_COUNT "+r+".0";var n="MODE_DISTANCE";switch(e.noiseMode){case 1:n="MODE_INDEX";break;case 2:n="MODE_DISTANCE_SMOOTH"}var a=i.programManager.getAdditionsByTag("MODE")[0];a.name=n,a.additions.fragmentMode="#define "+n,i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!e.noiseNormalMap}});t.exports=o},98292(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(51513);s.register("noisecell2d",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},26590(t,e,i){var r=i(51513);i(39429).register("noisecell2d",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},15686(t,e,i){var r=i(83419),s=i(20071),n=i(40987),a=i(79814),o=new r({Extends:s,initialize:function(t,e,i,r,o,h){e||(e={});var l={name:"noiseCell3D",fragmentSource:a,shaderAdditions:[{name:"MODE_DISTANCE",tags:["MODE"],additions:{fragmentMode:"#define MODE_DISTANCE"}},{name:"ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!e.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};s.call(this,t,l,i,r,o,h),this.type="NoiseCell3D",this.noiseCells=[32,32,32],e.noiseCells&&(this.noiseCells=e.noiseCells),this.noiseWrap=[this.noiseCells[0],this.noiseCells[1],this.noiseCells[2]],e.noiseWrap&&(this.noiseWrap=e.noiseWrap),this.noiseOffset=[0,0,0],e.noiseOffset&&(this.noiseOffset=e.noiseOffset),this.noiseVariation=[1,1,1],e.noiseVariation&&(this.noiseVariation=e.noiseVariation),this.noiseIterations=1,e.noiseIterations&&(this.noiseIterations=e.noiseIterations),this.noiseMode=0,e.noiseMode&&(this.noiseMode=e.noiseMode),this.noiseSmoothing=1,e.noiseSmoothing&&(this.noiseSmoothing=e.noiseSmoothing),this.noiseNormalMap=!!e.noiseNormalMap,this.noiseNormalScale=1,void 0!==e.noiseNormalScale&&(this.noiseNormalScale=e.noiseNormalScale),this.noiseColorStart=new n(0,0,0),this.noiseColorEnd=new n(255,255,255),void 0===e.noiseColorStart&&void 0===e.noiseColorEnd||this.setNoiseColor(e.noiseColorStart,e.noiseColorEnd),this.noiseSeed=[1,2,3,4,5,6,7,8,9,10,11,12],e.noiseSeed&&(this.noiseSeed=e.noiseSeed),e.randomizeNoiseSeed&&this.randomizeNoiseSeed(),this.keepAwake=!0},setNoiseColor:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=16777215),"number"==typeof t?n.IntegerToColor(t,this.noiseColorStart):"string"==typeof t?n.HexStringToColor(t,this.noiseColorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof n&&this.noiseColorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?n.IntegerToColor(e,this.noiseColorEnd):"string"==typeof e?n.HexStringToColor(e,this.noiseColorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof n&&this.noiseColorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},randomizeNoiseSeed:function(){for(var t=this.noiseSeed.length,e=0;e<t;e++)this.noiseSeed[e]=Math.random();return this},wrapNoise:function(){for(var t=this.noiseWrap.length,e=0;e<t;e++)this.noiseWrap[e]=this.noiseCells[e];return this},_setupUniforms:function(t){if(this.keepAwake){var e=Math.sin(this.scene.time.now)/4096/256;t("uCellOffset",[this.noiseOffset[0]+e,this.noiseOffset[1]+e,this.noiseOffset[2]+e])}else t("uCellOffset",this.noiseOffset);t("uSeedX",this.noiseSeed.slice(0,3)),t("uSeedY",this.noiseSeed.slice(3,6)),t("uSeedZ",this.noiseSeed.slice(6,9)),t("uCells",this.noiseCells),t("uVariation",this.noiseVariation),t("uWrap",this.noiseWrap),t("uSmoothing",this.noiseSmoothing),t("uNormalScale",this.noiseNormalScale),t("uColorStart",this.noiseColorStart.gl),t("uColorEnd",this.noiseColorEnd.gl)},_updateShaderConfig:function(t,e,i){var r=Math.max(1,Math.floor(e.noiseIterations)),s=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];s.name="ITERATION_COUNT_"+r,s.additions.fragmentIterations="#define ITERATION_COUNT "+r+".0";var n="MODE_DISTANCE";switch(e.noiseMode){case 1:n="MODE_INDEX";break;case 2:n="MODE_DISTANCE_SMOOTH"}var a=i.programManager.getAdditionsByTag("MODE")[0];a.name=n,a.additions.fragmentMode="#define "+n,i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!e.noiseNormalMap}});t.exports=o},97044(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(15686);s.register("noisecell3d",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},89918(t,e,i){var r=i(15686);i(39429).register("noisecell3d",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},41946(t,e,i){var r=i(83419),s=i(20071),n=i(40987),a=i(99595),o=new r({Extends:s,initialize:function(t,e,i,r,o,h){e||(e={});var l={name:"noiseCell4D",fragmentSource:a,shaderAdditions:[{name:"MODE_DISTANCE",tags:["MODE"],additions:{fragmentMode:"#define MODE_DISTANCE"}},{name:"ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!e.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};s.call(this,t,l,i,r,o,h),this.type="NoiseCell4D",this.noiseCells=[32,32,32,32],e.noiseCells&&(this.noiseCells=e.noiseCells),this.noiseWrap=[this.noiseCells[0],this.noiseCells[1],this.noiseCells[2],this.noiseCells[3]],e.noiseWrap&&(this.noiseWrap=e.noiseWrap),this.noiseOffset=[0,0,0,0],e.noiseOffset&&(this.noiseOffset=e.noiseOffset),this.noiseVariation=[1,1,1,1],e.noiseVariation&&(this.noiseVariation=e.noiseVariation),this.noiseIterations=1,e.noiseIterations&&(this.noiseIterations=e.noiseIterations),this.noiseMode=0,e.noiseMode&&(this.noiseMode=e.noiseMode),this.noiseSmoothing=1,e.noiseSmoothing&&(this.noiseSmoothing=e.noiseSmoothing),this.noiseNormalMap=!!e.noiseNormalMap,this.noiseNormalScale=1,void 0!==e.noiseNormalScale&&(this.noiseNormalScale=e.noiseNormalScale),this.noiseColorStart=new n(0,0,0),this.noiseColorEnd=new n(255,255,255),void 0===e.noiseColorStart&&void 0===e.noiseColorEnd||this.setNoiseColor(e.noiseColorStart,e.noiseColorEnd),this.noiseSeed=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],e.noiseSeed&&(this.noiseSeed=e.noiseSeed),e.randomizeNoiseSeed&&this.randomizeNoiseSeed(),this.keepAwake=!0},setNoiseColor:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=16777215),"number"==typeof t?n.IntegerToColor(t,this.noiseColorStart):"string"==typeof t?n.HexStringToColor(t,this.noiseColorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof n&&this.noiseColorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?n.IntegerToColor(e,this.noiseColorEnd):"string"==typeof e?n.HexStringToColor(e,this.noiseColorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof n&&this.noiseColorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},randomizeNoiseSeed:function(){for(var t=this.noiseSeed.length,e=0;e<t;e++)this.noiseSeed[e]=Math.random();return this},wrapNoise:function(){for(var t=this.noiseWrap.length,e=0;e<t;e++)this.noiseWrap[e]=this.noiseCells[e];return this},_setupUniforms:function(t){if(this.keepAwake){var e=Math.sin(this.scene.time.now)/4096/256;t("uCellOffset",[this.noiseOffset[0]+e,this.noiseOffset[1]+e,this.noiseOffset[2]+e,this.noiseOffset[3]+e])}else t("uCellOffset",this.noiseOffset);t("uSeedX",this.noiseSeed.slice(0,4)),t("uSeedY",this.noiseSeed.slice(4,8)),t("uSeedZ",this.noiseSeed.slice(8,12)),t("uSeedW",this.noiseSeed.slice(12,16)),t("uCells",this.noiseCells),t("uVariation",this.noiseVariation),t("uWrap",this.noiseWrap),t("uSmoothing",this.noiseSmoothing),t("uNormalScale",this.noiseNormalScale),t("uColorStart",this.noiseColorStart.gl),t("uColorEnd",this.noiseColorEnd.gl)},_updateShaderConfig:function(t,e,i){var r=Math.max(1,Math.floor(e.noiseIterations)),s=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];s.name="ITERATION_COUNT_"+r,s.additions.fragmentIterations="#define ITERATION_COUNT "+r+".0";var n="MODE_DISTANCE";switch(e.noiseMode){case 1:n="MODE_INDEX";break;case 2:n="MODE_DISTANCE_SMOOTH"}var a=i.programManager.getAdditionsByTag("MODE")[0];a.name=n,a.additions.fragmentMode="#define "+n,i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!e.noiseNormalMap}});t.exports=o},20136(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(41946);s.register("noisecell4d",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},65874(t,e,i){var r=i(41946);i(39429).register("noisecell4d",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},1792(t,e,i){var r=i(83419),s=i(20071),n=i(40987),a=i(83587),o=new r({Extends:s,initialize:function(t,e,i,r,o,h){e||(e={});var l={name:"noiseSimplex2D",fragmentSource:a,shaderAdditions:[{name:"ITERATION_COUNT_1_WARP_ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0\n#define WARP_ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!e.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};s.call(this,t,l,i,r,o,h),this.type="NoiseSimplex2D",this.noiseCells=e.noiseCells||[32,32],this.noisePeriod=[this.noiseCells[0],this.noiseCells[1]],e.noisePeriod&&(this.noisePeriod=e.noisePeriod),this.noiseOffset=[0,0],e.noiseOffset&&(this.noiseOffset=e.noiseOffset),this.noiseFlow=e.noiseFlow||0,this.noiseWarpAmount=e.noiseWarpAmount||0,this.noiseIterations=e.noiseIterations||1,this.noiseWarpIterations=e.noiseWarpIterations||1,this.noiseDetailPower=e.noiseDetailPower||2,this.noiseFlowPower=e.noiseFlowPower||2,this.noiseContributionPower=e.noiseContributionPower||2,this.noiseWarpDetailPower=e.noiseWarpDetailPower||2,this.noiseWarpFlowPower=e.noiseWarpFlowPower||2,this.noiseWarpContributionPower=e.noiseWarpContributionPower||2,this.noiseNormalMap=!!e.noiseNormalMap,this.noiseNormalScale=1,void 0!==e.noiseNormalScale&&(this.noiseNormalScale=e.noiseNormalScale),this.noiseValueFactor=void 0===e.noiseValueFactor?.5:e.noiseValueFactor,this.noiseValueAdd=void 0===e.noiseValueAdd?.5:e.noiseValueAdd,this.noiseValuePower=void 0===e.noiseValuePower?1:e.noiseValuePower,this.noiseColorStart=new n(0,0,0),this.noiseColorEnd=new n(255,255,255),void 0===e.noiseColorStart&&void 0===e.noiseColorEnd||this.setNoiseColor(e.noiseColorStart,e.noiseColorEnd),this.noiseSeed=e.noiseSeed||[1,2]},setNoiseColor:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=16777215),"number"==typeof t?n.IntegerToColor(t,this.noiseColorStart):"string"==typeof t?n.HexStringToColor(t,this.noiseColorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof n&&this.noiseColorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?n.IntegerToColor(e,this.noiseColorEnd):"string"==typeof e?n.HexStringToColor(e,this.noiseColorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof n&&this.noiseColorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},randomizeNoiseSeed:function(){for(var t=this.noiseSeed.length,e=0;e<t;e++)this.noiseSeed[e]=Math.random();return this},wrapNoise:function(){for(var t=this.noisePeriod.length,e=0;e<t;e++)this.noisePeriod[e]=this.noiseCells[e];return this},_setupUniforms:function(t){t("uCells",this.noiseCells),t("uPeriod",this.noisePeriod),t("uOffset",this.noiseOffset),t("uFlow",this.noiseFlow),t("uDetailPower",this.noiseDetailPower),t("uFlowPower",this.noiseFlowPower),t("uContributionPower",this.noiseContributionPower),t("uWarpDetailPower",this.noiseWarpDetailPower),t("uWarpFlowPower",this.noiseWarpFlowPower),t("uWarpContributionPower",this.noiseWarpContributionPower),t("uWarpAmount",this.noiseWarpAmount),t("uNormalScale",this.noiseNormalScale),t("uValueFactor",this.noiseValueFactor),t("uValueAdd",this.noiseValueAdd),t("uValuePower",this.noiseValuePower),t("uColorStart",this.noiseColorStart.gl),t("uColorEnd",this.noiseColorEnd.gl),t("uSeed",this.noiseSeed)},_updateShaderConfig:function(t,e,i){var r=Math.max(1,Math.floor(e.noiseIterations)),s=Math.max(1,Math.floor(e.noiseWarpIterations)),n=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];n.name="ITERATION_COUNT_"+r+"_WARP_ITERATION_COUNT_"+s,n.additions.fragmentIterations="#define ITERATION_COUNT "+r+".0\n#define WARP_ITERATION_COUNT "+s+".0",i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!e.noiseNormalMap}});t.exports=o},51754(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(1792);s.register("noisesimplex2d",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},80308(t,e,i){var r=i(1792);i(39429).register("noisesimplex2d",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},51098(t,e,i){var r=i(83419),s=i(20071),n=i(40987),a=i(13460),o=new r({Extends:s,initialize:function(t,e,i,r,o,h){e||(e={});var l={name:"noiseSimplex3D",fragmentSource:a,shaderAdditions:[{name:"ITERATION_COUNT_1_WARP_ITERATION_COUNT_1",tags:["ITERATION_COUNT"],additions:{fragmentIterations:"#define ITERATION_COUNT 1.0\n#define WARP_ITERATION_COUNT 1.0"}},{name:"NORMALMAP",tags:["NORMALMAP"],additions:{fragmentNormalMap:"#define NORMAL_MAP\n#extension GL_OES_standard_derivatives : enable"},disable:!e.noiseNormalMap}],setupUniforms:this._setupUniforms,updateShaderConfig:this._updateShaderConfig};s.call(this,t,l,i,r,o,h),this.type="NoiseSimplex3D",this.noiseCells=e.noiseCells||[32,32,32],this.noisePeriod=[this.noiseCells[0],this.noiseCells[1],this.noiseCells[2]],e.noisePeriod&&(this.noisePeriod=e.noisePeriod),this.noiseOffset=[0,0,0],e.noiseOffset&&(this.noiseOffset=e.noiseOffset),this.noiseFlow=e.noiseFlow||0,this.noiseWarpAmount=e.noiseWarpAmount||0,this.noiseIterations=e.noiseIterations||1,this.noiseWarpIterations=e.noiseWarpIterations||1,this.noiseDetailPower=e.noiseDetailPower||2,this.noiseFlowPower=e.noiseFlowPower||2,this.noiseContributionPower=e.noiseContributionPower||2,this.noiseWarpDetailPower=e.noiseWarpDetailPower||2,this.noiseWarpFlowPower=e.noiseWarpFlowPower||2,this.noiseWarpContributionPower=e.noiseWarpContributionPower||2,this.noiseNormalMap=!!e.noiseNormalMap,this.noiseNormalScale=1,void 0!==e.noiseNormalScale&&(this.noiseNormalScale=e.noiseNormalScale),this.noiseValueFactor=void 0===e.noiseValueFactor?.5:e.noiseValueFactor,this.noiseValueAdd=void 0===e.noiseValueAdd?.5:e.noiseValueAdd,this.noiseValuePower=void 0===e.noiseValuePower?1:e.noiseValuePower,this.noiseColorStart=new n(0,0,0),this.noiseColorEnd=new n(255,255,255),void 0===e.noiseColorStart&&void 0===e.noiseColorEnd||this.setNoiseColor(e.noiseColorStart,e.noiseColorEnd),this.noiseSeed=e.noiseSeed||[1,2,3]},setNoiseColor:function(t,e){var i;return void 0===t&&(t=0),void 0===e&&(e=16777215),"number"==typeof t?n.IntegerToColor(t,this.noiseColorStart):"string"==typeof t?n.HexStringToColor(t,this.noiseColorStart):Array.isArray(t)?(i=void 0===t[3]?1:t[3],this.noiseColorStart.setGLTo(t[0],t[1],t[2],i)):t instanceof n&&this.noiseColorStart.setTo(t.red,t.green,t.blue,t.alpha),"number"==typeof e?n.IntegerToColor(e,this.noiseColorEnd):"string"==typeof e?n.HexStringToColor(e,this.noiseColorEnd):Array.isArray(e)?(i=void 0===e[3]?1:e[3],this.noiseColorEnd.setGLTo(e[0],e[1],e[2],i)):e instanceof n&&this.noiseColorEnd.setTo(e.red,e.green,e.blue,e.alpha),this},randomizeNoiseSeed:function(){for(var t=this.noiseSeed.length,e=0;e<t;e++)this.noiseSeed[e]=Math.random();return this},wrapNoise:function(){for(var t=this.noisePeriod.length,e=0;e<t;e++)this.noisePeriod[e]=this.noiseCells[e];return this},_setupUniforms:function(t){t("uCells",this.noiseCells),t("uPeriod",this.noisePeriod),t("uOffset",this.noiseOffset),t("uFlow",this.noiseFlow),t("uDetailPower",this.noiseDetailPower),t("uFlowPower",this.noiseFlowPower),t("uContributionPower",this.noiseContributionPower),t("uWarpDetailPower",this.noiseWarpDetailPower),t("uWarpFlowPower",this.noiseWarpFlowPower),t("uWarpContributionPower",this.noiseWarpContributionPower),t("uWarpAmount",this.noiseWarpAmount),t("uNormalScale",this.noiseNormalScale),t("uValueFactor",this.noiseValueFactor),t("uValueAdd",this.noiseValueAdd),t("uValuePower",this.noiseValuePower),t("uColorStart",this.noiseColorStart.gl),t("uColorEnd",this.noiseColorEnd.gl),t("uSeed",this.noiseSeed)},_updateShaderConfig:function(t,e,i){var r=Math.max(1,Math.floor(e.noiseIterations)),s=Math.max(1,Math.floor(e.noiseWarpIterations)),n=i.programManager.getAdditionsByTag("ITERATION_COUNT")[0];n.name="ITERATION_COUNT_"+r+"_WARP_ITERATION_COUNT_"+s,n.additions.fragmentIterations="#define ITERATION_COUNT "+r+".0\n#define WARP_ITERATION_COUNT "+s+".0",i.programManager.getAdditionsByTag("NORMALMAP")[0].disable=!e.noiseNormalMap}});t.exports=o},71112(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(51098);s.register("noisesimplex3d",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},73810(t,e,i){var r=i(51098);i(39429).register("noisesimplex3d",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,s,n))})},76472(t,e,i){var r=i(83419),s=i(44777),n=i(37589),a=i(6113),o=i(91389),h=i(90664),l=new r({Extends:s,initialize:function(t){s.call(this,t,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return null===this.propertyValue?0:9},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,r=this.defaultUpdate;if(9===this.method){this.start=t[0],this.ease=a("Linear"),this.interpolation=o("linear"),i=this.easedValueEmit,r=this.easeValueUpdate,e=t[0],this.active=!0,this.r.length=0,this.g.length=0,this.b.length=0;for(var s=0;s<t.length;s++){var n=h(t[s]);this.r.push(n.r),this.g.push(n.g),this.b.push(n.b)}}return this.onEmit=i,this.onUpdate=r,this.current=e,this},setEase:function(t){this.easeName=t,this.ease=a(t)},easedValueEmit:function(){return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var r=this.ease(i),s=this.interpolation(this.r,r),a=this.interpolation(this.g,r),o=this.interpolation(this.b,r),h=n(s,a,o);return this.current=h,h}});t.exports=l},44777(t,e,i){var r=i(30976),s=i(45319),n=i(83419),a=i(99472),o=i(6113),h=i(95540),l=i(91389),u=i(77720),d=i(15994),c=new n({initialize:function(t,e,i){void 0===i&&(i=!1),this.propertyKey=t,this.propertyValue=e,this.defaultValue=e,this.steps=0,this.counter=0,this.yoyo=!1,this.direction=0,this.start=0,this.current=0,this.end=0,this.ease=null,this.interpolation=null,this.emitOnly=i,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=h(t,this.propertyKey,this.defaultValue),this.method=this.getMethod(),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return JSON.stringify(this.propertyValue)},onChange:function(t){var e;switch(this.method){case 1:case 3:case 8:e=t;break;case 2:this.propertyValue.indexOf(t)>=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=s(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,r=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit,e=this.defaultValue;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var s=this.has(t,"ease")?t.ease:"Linear";this.ease=o(s,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,r=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,r=this.proxyUpdate,e=this.defaultValue;break;case 9:this.start=t.values;var a=this.has(t,"ease")?t.ease:"Linear";this.ease=o(a,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,r=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=r,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(){return this.defaultValue},defaultUpdate:function(t,e,i,r){return r},proxyEmit:function(t,e,i){var r=this._onEmit(t,e,i);return this.current=r,r},proxyUpdate:function(t,e,i,r){var s=this._onUpdate(t,e,i,r);return this.current=s,s},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=a(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,r=(this.end-this.start)/this.steps;this.yoyo?(0===this.direction?(i+=r)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=r)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=d(i+r,this.start,this.end);return this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var r,s=t.data[e],n=this.ease(i);return r=this.interpolation?this.interpolation(this.start,n):(s.max-s.min)*n+s.min,this.current=r,r},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=c},24502(t,e,i){var r=i(83419),s=i(95540),n=i(20286),a=new r({Extends:n,initialize:function(t,e,i,r,a){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),r=s(o,"epsilon",100),a=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=100),void 0===a&&(a=50);n.call(this,t,e,!0),this._gravity=a,this._power=i*a,this._epsilon=r*r},update:function(t,e){var i=this.x-t.x,r=this.y-t.y,s=i*i+r*r;if(0!==s){var n=Math.sqrt(s);s<this._epsilon&&(s=this._epsilon);var a=this._power*e/(s*n)*100;t.velocityX+=i*a,t.velocityY+=r*a}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=a},56480(t,e,i){var r=i(9674),s=i(45319),n=i(83419),a=i(39506),o=i(87841),h=i(11520),l=i(26099),u=new n({initialize:function(t){this.emitter=t,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new l,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.holdCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1},x:{min:0,max:0},y:{min:0,max:0},accelerationX:{min:0,max:0},accelerationY:{min:0,max:0},maxVelocityX:{min:0,max:0},maxVelocityY:{min:0,max:0},moveToX:{min:0,max:0},moveToY:{min:0,max:0},bounce:{min:0,max:0}},this.isCropped=!1,this.scene=t.scene,this.anims=null,this.emitter.anims.length>0&&(this.anims=new r(this)),this.bounds=new o},emit:function(t,e,i,r,s,n){return this.emitter.emit(t,e,i,r,s,n)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,r=i.ops,s=i.getAnim();if(s?this.anims.play(s):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=r.x.onEmit(this,"x"):r.x.steps>0?this.x+=t+r.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=r.y.onEmit(this,"y"):r.y.steps>0?this.y+=e+r.y.onEmit(this,"y"):this.y+=e,this.life=r.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=r.delay.onEmit(this,"delay"),this.holdCurrent=r.hold.onEmit(this,"hold"),this.scaleX=r.scaleX.onEmit(this,"scaleX"),this.scaleY=r.scaleY.active?r.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=r.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var n=r.speedX.onEmit(this,"speedX"),o=r.speedY.active?r.speedY.onEmit(this,"speedY"):n;if(i.radial){var h=a(r.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(n),this.velocityY=Math.sin(h)*Math.abs(o)}else if(i.moveTo){var l=r.moveToX.onEmit(this,"moveToX"),u=r.moveToY.onEmit(this,"moveToY"),d=this.life/1e3;this.velocityX=(l-this.x)/d,this.velocityY=(u-this.y)/d}else this.velocityX=n,this.velocityY=o;return i.acceleration&&(this.accelerationX=r.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=r.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=r.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=r.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=r.bounce.onEmit(this,"bounce"),this.alpha=r.alpha.onEmit(this,"alpha"),r.color.active?this.tint=r.color.onEmit(this,"tint"):this.tint=r.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims&&this.anims.update(0,t);var r=this.emitter,n=r.ops,o=1-this.lifeCurrent/this.life;if(this.lifeT=o,this.x=n.x.onUpdate(this,"x",o,this.x),this.y=n.y.onUpdate(this,"y",o,this.y),r.moveTo){var h=n.moveToX.onUpdate(this,"moveToX",o,r.moveToX),l=n.moveToY.onUpdate(this,"moveToY",o,r.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(r,t,e,i,o),this.scaleX=n.scaleX.onUpdate(this,"scaleX",o,this.scaleX),n.scaleY.active?this.scaleY=n.scaleY.onUpdate(this,"scaleY",o,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",o,this.angle),this.rotation=a(this.angle),r.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=s(n.alpha.onUpdate(this,"alpha",o,this.alpha),0,1),n.color.active?this.tint=n.color.onUpdate(this,"color",o,this.tint):this.tint=n.tint.onUpdate(this,"tint",o,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,r,n){var a=t.ops,o=this.velocityX,h=this.velocityY,l=a.accelerationX.onUpdate(this,"accelerationX",n,this.accelerationX),u=a.accelerationY.onUpdate(this,"accelerationY",n,this.accelerationY),d=a.maxVelocityX.onUpdate(this,"maxVelocityX",n,this.maxVelocityX),c=a.maxVelocityY.onUpdate(this,"maxVelocityY",n,this.maxVelocityY);this.bounce=a.bounce.onUpdate(this,"bounce",n,this.bounce),o+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,o=s(o,-d,d),h=s(h,-c,c),this.velocityX=o,this.velocityY=h,this.x+=o*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;f<r.length;f++){var p=r[f];p.active&&p.update(this,e,i,n)}},setSizeToFrame:function(){},getBounds:function(t){void 0===t&&(t=this.emitter.getWorldTransformMatrix());var e=Math.abs(t.scaleX)*this.scaleX,i=Math.abs(t.scaleY)*this.scaleY,r=this.x,s=this.y,n=this.rotation,a=this.frame.width*e/2,o=this.frame.height*i/2,u=this.bounds,d=new l(r-a,s-o),c=new l(r+a,s-o),f=new l(r-a,s+o),p=new l(r+a,s+o);return 0!==n&&(h(d,r,s,n),h(c,r,s,n),h(f,r,s,n),h(p,r,s,n)),t.transformPoint(d.x,d.y,d),t.transformPoint(c.x,c.y,c),t.transformPoint(f.x,f.y,f),t.transformPoint(p.x,p.y,p),u.x=Math.min(d.x,c.x,f.x,p.x),u.y=Math.min(d.y,c.y,f.y,p.y),u.width=Math.max(d.x,c.x,f.x,p.x)-u.x,u.height=Math.max(d.y,c.y,f.y,p.y)-u.y,u},destroy:function(){this.anims&&this.anims.destroy(),this.anims=null,this.emitter=null,this.texture=null,this.frame=null,this.scene=null}});t.exports=u},69601(t,e,i){var r=i(83419),s=i(20286),n=i(87841),a=new r({Extends:s,initialize:function(t,e,i,r,a,o,h,l){void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),void 0===l&&(l=!0),s.call(this,t,e,!0),this.bounds=new n(t,e,i,r),this.collideLeft=a,this.collideRight=o,this.collideTop=h,this.collideBottom=l},update:function(t){var e=this.bounds,i=-t.bounce,r=t.worldPosition;r.x<e.x&&this.collideLeft?(t.x+=e.x-r.x,t.velocityX*=i):r.x>e.right&&this.collideRight&&(t.x-=r.x-e.right,t.velocityX*=i),r.y<e.y&&this.collideTop?(t.y+=e.y-r.y,t.velocityY*=i):r.y>e.bottom&&this.collideBottom&&(t.y-=r.y-e.bottom,t.velocityY*=i)}});t.exports=a},31600(t,e,i){var r=i(68668),s=i(83419),n=i(31401),a=i(53774),o=i(43459),h=i(26388),l=i(19909),u=i(76472),d=i(44777),c=i(20696),f=i(95643),p=i(95540),g=i(26546),m=i(24502),v=i(69036),y=i(1985),x=i(97022),T=i(86091),w=i(73162),b=i(20074),S=i(269),C=i(56480),E=i(69601),A=i(68875),_=i(87841),M=i(59996),R=i(72905),P=i(90668),O=i(19186),L=i(84322),F=i(61340),D=i(26099),I=i(15994),N=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintMode","timeScale","trackVisible","visible"],B=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],k=new s({Extends:f,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Lighting,n.Mask,n.RenderNodes,n.ScrollFactor,n.Texture,n.Transform,n.Visible,P],initialize:function(t,e,i,r,s){f.call(this,t,"ParticleEmitter"),this.particleClass=C,this.config=null,this.ops={accelerationX:new d("accelerationX",0),accelerationY:new d("accelerationY",0),alpha:new d("alpha",1),angle:new d("angle",{min:0,max:360},!0),bounce:new d("bounce",0),color:new u("color"),delay:new d("delay",0,!0),hold:new d("hold",0,!0),lifespan:new d("lifespan",1e3,!0),maxVelocityX:new d("maxVelocityX",1e4),maxVelocityY:new d("maxVelocityY",1e4),moveToX:new d("moveToX",0),moveToY:new d("moveToY",0),quantity:new d("quantity",1,!0),rotate:new d("rotate",0),scaleX:new d("scaleX",1),scaleY:new d("scaleY",1),speedX:new d("speedX",0,!0),speedY:new d("speedY",0,!0),tint:new d("tint",16777215),x:new d("x",0),y:new d("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new D,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new F,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new w(this),this.tintMode=L.MULTIPLY,this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.setTexture(r),s&&this.setConfig(s)},_defaultRenderNodesMap:{get:function(){return r}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;this.config=t;var e=0,i="",r=this.ops;for(e=0;e<B.length;e++)r[i=B[e]].loadConfig(t);for(e=0;e<N.length;e++)x(t,i=N[e])&&(this[i]=p(t,i));if(this.acceleration=0!==this.accelerationX||0!==this.accelerationY,this.moveTo=v(t,["moveToX","moveToY"]),x(t,"speed")&&(r.speedX.loadConfig(t,"speed"),r.speedY.active=!1),(y(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),x(t,"scale")&&(r.scaleX.loadConfig(t,"scale"),r.scaleY.active=!1),x(t,"callbackScope")){var s=p(t,"callbackScope",null);this.emitCallbackScope=s,this.deathCallbackScope=s}if(x(t,"emitZone")&&this.addEmitZone(t.emitZone),x(t,"deathZone")&&this.addDeathZone(t.deathZone),x(t,"bounds")){var n=this.addParticleBounds(t.bounds);n.collideLeft=p(t,"collideLeft",!0),n.collideRight=p(t,"collideRight",!0),n.collideTop=p(t,"collideTop",!0),n.collideBottom=p(t,"collideBottom",!0)}return x(t,"followOffset")&&this.followOffset.setFromObject(p(t,"followOffset",0)),x(t,"texture")&&this.setTexture(t.texture),x(t,"frame")?this.setEmitterFrame(t.frame):x(t,"anim")&&this.setAnim(t.anim),x(t,"reserve")&&this.reserve(t.reserve),x(t,"advance")&&this.fastForward(t.advance),this.resetCounters(this.frequency,this.emitting),this.emitting&&this.emit(c.START,this),this},updateConfig:function(t){return t&&(this.config?this.setConfig(S(this.config,t)):this.setConfig(t)),this},toJSON:function(){var t=a(this),e=0,i="";for(e=0;e<N.length;e++)t[i=N[e]]=this[i];var r=this.ops;for(e=0;e<B.length;e++)r[i=B[e]]&&(t[i]=r[i].toJSON());return r.speedY.active||(delete t.speedX,t.speed=r.speedX.toJSON()),this.scaleX===this.scaleY&&(delete t.scaleX,delete t.scaleY,t.scale=r.scaleX.toJSON()),t},resetCounters:function(t,e){var i=this.counters;i.fill(0),i[0]=t,e&&(i[5]=1)},startFollow:function(t,e,i,r){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=r,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){var t,e=this.frames,i=e.length;return 1===i?t=e[0]:this.randomFrame?t=g(e):(t=e[this.currentFrame],this.frameCounter++,this.frameCounter===this.frameQuantity&&(this.frameCounter=0,this.currentFrame++,this.currentFrame===i&&(this.currentFrame=0))),this.texture.get(t)},setEmitterFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0;var r=typeof t;if(this.frames.length=0,Array.isArray(t))this.frames=this.frames.concat(t);else if("string"===r||"number"===r)this.frames.push(t);else if("object"===r){var s=t;(t=p(s,"frames",null))&&(this.frames=this.frames.concat(t));var n=p(s,"cycle",!1);this.randomFrame=!n,this.frameQuantity=p(s,"quantity",i)}return 1===this.frames.length&&(this.frameQuantity=1,this.randomFrame=!1),this},getAnim:function(){var t=this.anims,e=t.length;if(0===e)return null;if(1===e)return t[0];if(this.randomAnim)return g(t);var i=t[this.currentAnim];return this.animCounter++,this.animCounter>=this.animQuantity&&(this.animCounter=0,this.currentAnim=I(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var r=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===r)this.anims.push(t);else if("object"===r){var s=t;(t=p(s,"anims",null))&&(this.anims=this.anims.concat(t));var n=p(s,"cycle",!1);this.randomAnim=!n,this.animQuantity=p(s,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,r,s,n,a,o){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=x(h,"w")?h.w:h.width,r=x(h,"h")?h.h:h.height}return this.addParticleProcessor(new E(t,e,i,r,s,n,a,o))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],r=0;r<t.length;r++)if((e=t[r])instanceof h)i.push(e);else if("function"==typeof e.contains)e=new h(e,!0),i.push(e);else{var s=p(e,"type","onEnter"),n=p(e,"source",null);if(n&&"function"==typeof n.contains)e=new h(n,"onEnter"===s),i.push(e)}return this.deathZones=this.deathZones.concat(i),i},removeDeathZone:function(t){return R(this.deathZones,t),this},clearDeathZones:function(){return this.deathZones.length=0,this},addEmitZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],r=0;r<t.length;r++)if((e=t[r])instanceof A||e instanceof l)i.push(e);else{var s=p(e,"source",null);if(s){var n=p(e,"type","random");if("random"===n&&"function"==typeof s.getRandomPoint)e=new A(s),i.push(e);else if("edge"===n&&"function"==typeof s.getPoints){var a=p(e,"quantity",1),o=p(e,"stepRate",0),h=p(e,"yoyo",!1),u=p(e,"seamless",!0),d=p(e,"total",-1);e=new l(s,a,o,h,u,d),i.push(e)}}}return this.emitZones=this.emitZones.concat(i),i},removeEmitZone:function(t){return R(this.emitZones,t),this.zoneIndex=0,this},clearEmitZones:function(){return this.emitZones.length=0,this.zoneIndex=0,this},getEmitZone:function(t){var e=this.emitZones,i=e.length;if(0!==i){var r=e[this.zoneIndex];r.getPoint(t),r.total>-1&&(this.zoneTotal++,this.zoneTotal===r.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i<e.length;i++){var r=e[i];if(r.willKill(t))return this.emit(c.DEATH_ZONE,this,t,r),!0}return!1},setEmitZone:function(t){var e;return(e=isFinite(t)?t:this.emitZones.indexOf(t))>=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new m(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var r=0;r<t;r++)e.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return this.maxParticles>0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,r=i.length,s=0;s<r;s++)t.call(e,i[s],this);return this},forEachDead:function(t,e){for(var i=this.dead,r=i.length,s=0;s<r;s++)t.call(e,i[s],this);return this},start:function(t,e){return void 0===t&&(t=0),this.emitting||(t>0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return O(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var r=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,r),r},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var r=this.dead,s=this.stopAfter,n=this.follow?this.follow.x+this.followOffset.x:e,a=this.follow?this.follow.y+this.followOffset.y:i,o=0;o<t;o++){var h=r.pop();if(h||(h=new this.particleClass(this)),h.fire(n,a)?(this.particleBringToTop?this.alive.push(h):this.alive.unshift(h),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,h,this)):this.dead.push(h),s>0&&(this.stopCounter++,this.stopCounter>=s))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i<Math.abs(t);)this.preUpdate(0,e),i+=e;return this.skipping=!1,this},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible),this.getWorldTransformMatrix(this.worldMatrix);var r=this.getProcessors(),s=this.alive,n=this.dead,a=0,o=[],h=s.length;for(a=0;a<h;a++){var l=s[a];l.update(e,i,r)&&o.push({index:a,particle:l})}if((h=o.length)>0){var u=this.deathCallback,d=this.deathCallbackScope;for(a=h-1;a>=0;a--){var f=o[a];s.splice(f.index,1),n.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===s.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,r=i.length,s=[],n=0;n<r;n++){var a=i[n];M(t,a.getBounds(e))&&s.push(a)}return s},getBounds:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1e3/60),void 0===r&&(r=new _);var s,n,a=this.getWorldTransformMatrix(),h=this.alive,l=!1;if(r.setTo(0,0,0,0),e>0){var u=0;for(this.skipping=!0;u<Math.abs(e);){for(this.preUpdate(0,i),s=0;s<h.length;s++)n=h[s].getBounds(a),l?b(r,n):(l=!0,o(n,r));u+=i}this.skipping=!1}else for(s=0;s<h.length;s++)n=h[s].getBounds(a),l?b(r,n):(l=!0,o(n,r));return t>0&&T(r,t,t),r},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t<B.length;t++){e[B[t]].destroy()}for(t=0;t<this.alive.length;t++)this.alive[t].destroy();for(t=0;t<this.dead.length;t++)this.dead[t].destroy();this.ops=null,this.alive=[],this.dead=[],this.worldMatrix.destroy()}});t.exports=k},9871(t,e,i){var r=i(59996),s=i(61340),n=new s,a=new s,o=new s,h=new s;t.exports=function(t,e,i,s){i.addToRenderList(e),n.copyWithScrollFactorFrom(i.matrix,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),s&&n.multiply(s),h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),n.multiply(h);var l=t.currentContext,u=i.roundPixels,d=i.alpha,c=e.alpha,f=e.alive,p=f.length,g=e.viewBounds;if(e.visible&&0!==p&&(!g||r(g,i.worldView))){e.sortCallback&&e.depthSort(),l.save(),l.globalCompositeOperation=t.blendModes[e.blendMode];for(var m=0;m<p;m++){var v=f[m],y=v.alpha*c*d;if(!(y<=0||0===v.scaleX||0===v.scaleY)){o.applyITRS(v.x,v.y,v.rotation,v.scaleX,v.scaleY),n.multiply(o,a);var x=v.frame,T=x.canvasData;if(T.width>0&&T.height>0){var w=-x.halfWidth,b=-x.halfHeight;l.globalAlpha=y,l.save(),a.setToContext(l),u&&(w=Math.round(w),b=Math.round(b)),l.imageSmoothingEnabled=!x.source.scaleMode,l.drawImage(x.source.image,T.x,T.y,T.width,T.height,w,b,T.width,T.height),l.restore()}}}l.restore()}}},92730(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(95540),o=i(31600);s.register("particles",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=a(t,"config",null),h=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,h,t),s&&h.setConfig(s),h})},676(t,e,i){var r=i(39429),s=i(31600);r.register("particles",function(t,e,i,r){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new s(this.scene,t,e,i,r))})},90668(t,e,i){var r=i(29747),s=r,n=r;s=i(21188),n=i(9871),t.exports={renderWebGL:s,renderCanvas:n}},21188(t,e,i){var r=i(59996),s=i(61340),n=i(70554),a=new s,o=new s,h=new s,l=new s,u={},d={},c={quad:new Float32Array(8)};t.exports=function(t,e,i,s){var f=i.camera;f.addToRenderList(e),a.copyWithScrollFactorFrom(f.getViewMatrix(!i.useCanvas),f.scrollX,f.scrollY,e.scrollFactorX,e.scrollFactorY),s&&a.multiply(s),l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.multiply(l);var p=n.getTintAppendFloatAlpha,g=e.alpha,m=e.alive,v=m.length,y=e.viewBounds;if(0!==v&&(!y||r(y,f.worldView))){e.sortCallback&&e.depthSort();for(var x=e.tintMode,T=0;T<v;T++){var w=m[T],b=w.alpha*g;if(!(b<=0||0===w.scaleX||0===w.scaleY)){h.applyITRS(w.x,w.y,w.rotation,w.scaleX,w.scaleY),a.multiply(h,o);var S=w.frame,C=-S.halfWidth,E=-S.halfHeight;o.setQuad(C,E,C+S.width,E+S.height,c.quad),u.frame!==S&&(u.frame=S,u.uvSource=S);var A,_,M=p(w.tint,b);if(d.tintTopLeft=M,d.tintBottomLeft=M,d.tintTopRight=M,d.tintBottomRight=M,d.tintEffect=x,e.lighting)if(w.texture&&(A=S.texture.dataSource[S.sourceIndex]),_=w.rotation,e.parentContainer)_=e.getWorldTransformMatrix(a,o).rotate(w.rotation).rotationNormalized;var R=e.customRenderNodes,P=e.defaultRenderNodes;(R.Submitter||P.Submitter).run(i,e,s,0,u,c,d,A,_)}}}}},20286(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=!0),this.emitter,this.x=t,this.y=e,this.active=i},update:function(){},destroy:function(){this.emitter=null}});t.exports=r},9774(t){t.exports="complete"},812(t){t.exports="deathzone"},30522(t){t.exports="explode"},96695(t){t.exports="start"},18677(t){t.exports="stop"},20696(t,e,i){t.exports={COMPLETE:i(9774),DEATH_ZONE:i(812),EXPLODE:i(30522),START:i(96695),STOP:i(18677)}},18404(t,e,i){t.exports={EmitterColorOp:i(76472),EmitterOp:i(44777),Events:i(20696),GravityWell:i(24502),Particle:i(56480),ParticleBounds:i(69601),ParticleEmitter:i(31600),ParticleProcessor:i(20286),Zones:i(21024)}},26388(t,e,i){var r=new(i(83419))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=t.worldPosition,i=this.source.contains(e.x,e.y);return i&&this.killOnEnter||!i&&!this.killOnEnter}});t.exports=r},19909(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s,n){void 0===r&&(r=!1),void 0===s&&(s=!0),void 0===n&&(n=-1),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=r,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.total=n,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=r},68875(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(t){this.source=t,this._tempVec=new s,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=n},21024(t,e,i){t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159(t,e,i){var r=i(83419),s=i(31401),n=i(68287),a=new r({Extends:n,Mixins:[s.PathFollower],initialize:function(t,e,i,r,s,a){n.call(this,t,i,r,s,a),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=a},90145(t,e,i){var r=i(39429),s=i(1159);r.register("follower",function(t,e,i,r,n){var a=new s(this.scene,t,e,i,r,n);return this.displayList.add(a),this.updateList.add(a),a})},80321(t,e,i){var r=i(43246),s=i(83419),n=i(31401),a=i(95643),o=i(30100),h=i(67277),l=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,r,s,n,h){void 0===r&&(r=16777215),void 0===s&&(s=128),void 0===n&&(n=1),void 0===h&&(h=.1),a.call(this,t,"PointLight"),this.initRenderNodes(this._defaultRenderNodesMap),this.setPosition(e,i),this.color=o(r),this.intensity=n,this.attenuation=h,this.width=2*s,this.height=2*s,this._radius=s},_defaultRenderNodesMap:{get:function(){return r}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(80321);s.register("pointlight",function(t,e){void 0===t&&(t={});var i=n(t,"color",16777215),s=n(t,"radius",128),o=n(t,"intensity",1),h=n(t,"attenuation",.1),l=new a(this.scene,0,0,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},71255(t,e,i){var r=i(39429),s=i(80321);r.register("pointlight",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},67277(t,e,i){var r=i(29747),s=r,n=r;s=i(57787),t.exports={renderWebGL:s,renderCanvas:n}},57787(t,e,i){var r=i(91296);t.exports=function(t,e,i,s){var n=i.camera;n.addToRenderList(e);var a=r(e,n,s,!i.useCanvas).calc,o=e.width,h=e.height,l=-e._radius,u=-e._radius,d=l+o,c=u+h,f=a.getX(0,0),p=a.getY(0,0),g=a.getX(l,u),m=a.getY(l,u),v=a.getX(l,c),y=a.getY(l,c),x=a.getX(d,c),T=a.getY(d,c),w=a.getX(d,u),b=a.getY(d,u);(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batch(i,e,g,m,v,y,w,b,x,T,f,p)}},591(t,e,i){var r=i(83419),s=i(45650),n=i(88571),a=i(83999),o=i(58855),h=new r({Extends:n,Mixins:[a],initialize:function(t,e,i,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===a&&(a=32),void 0===h&&(h=!0);var l=t.sys.textures.addDynamicTexture(s(),r,a,h);n.call(this,t,e,i,l),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1,this.renderMode=o.RENDER,this.isCurrentlyRendering=!1},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e,i){return this.texture.setSize(t,e,i),this.setSize(this.texture.width,this.texture.height),this},saveTexture:function(t){var e=this.texture,i=e.key,r=e.manager;return r.exists(i)&&r.get(i)===e?(r.renameTexture(i,t),this._saved=!0):(e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0)),e},setRenderMode:function(t,e){return this.renderMode=t,e&&this.texture.preserve(!0),this},render:function(){return this.texture.render(),this},fill:function(t,e,i,r,s,n){return this.texture.fill(t,e,i,r,s,n),this},clear:function(t,e,i,r){return this.texture.clear(t,e,i,r),this},stamp:function(t,e,i,r,s){return this.texture.stamp(t,e,i,r,s),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,r,s){return this.texture.draw(t,e,i,r,s),this},capture:function(t,e){return this.texture.capture(t,e),this},repeat:function(t,e,i,r,s,n,a){return this.texture.repeat(t,e,i,r,s,n,a),this},preserve:function(t){return this.texture.preserve(t),this},callback:function(t){return this.texture.callback(t),this},snapshotArea:function(t,e,i,r,s,n,a){return this.texture.snapshotArea(t,e,i,r,s,n,a),this},snapshot:function(t,e,i){return this.texture.snapshot(t,e,i)},snapshotPixel:function(t,e,i){return this.texture.snapshotPixel(t,e,i)},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=h},97272(t,e,i){var r=i(40652),s=i(58855);t.exports=function(t,e,i,n){var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n)}},34495(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(591);s.register("renderTexture",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",32),h=n(t,"height",32),l=new a(this.scene,i,s,o,h);return void 0!==e&&(t.add=e),r(this.scene,l,t),l})},60505(t,e,i){var r=i(39429),s=i(591);r.register("renderTexture",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},83999(t,e,i){var r=i(29747),s=r,n=r;s=i(53937),n=i(97272),t.exports={renderWebGL:s,renderCanvas:n}},58855(t){t.exports={RENDER:"render",REDRAW:"redraw",ALL:"all"}},53937(t,e,i){var r=i(99517),s=i(58855);t.exports=function(t,e,i,n){if(!e.isCurrentlyRendering){e.isCurrentlyRendering=!0;var a=!0,o=!0;e.renderMode===s.REDRAW?o=!1:e.renderMode===s.RENDER&&(a=!1),a&&e.render(),o&&r(t,e,i,n),e.isCurrentlyRendering=!1}}},77757(t,e,i){var r=i(9674),s=i(85760),n=i(83419),a=i(31401),o=i(95643),h=i(38745),l=i(84322),u=i(26099),d=new n({Extends:o,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.RenderNodes,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,h],initialize:function(t,e,i,s,n,a,h,d,c){void 0===s&&(s="__DEFAULT"),void 0===a&&(a=2),void 0===h&&(h=!0),o.call(this,t,"Rope"),this.anims=new r(this),this.points=a,this.vertices,this.uv,this.colors,this.alphas,this.tintMode="__DEFAULT"===s?l.FILL:l.MULTIPLY,this.dirty=!1,this.horizontal=h,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.initRenderNodes(this._defaultRenderNodesMap),Array.isArray(a)&&this.resizeArrays(a.length),this.setPoints(a,d,c),this.updateVertices()},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintMode:function(t){return void 0===t&&(t=l.MULTIPLY),this.tintMode=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var r,s=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var n=0;if(void 0!==e)for(r=0;r<i;r++)s[n=2*r]=t,s[n+1]=e;else if(t.length===i)for(r=0;r<i;r++)s[n=2*r]=t[r],s[n+1]=t[r];else{var a=t[0];for(r=0;r<i;r++)n=2*r,t.length>n&&(a=t[n]),s[n]=a,t.length>n+1&&(a=t[n+1]),s[n+1]=a}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,r=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var s=0;if(t.length===e)for(i=0;i<e;i++)r[s=2*i]=t[i],r[s+1]=t[i];else{var n=t[0];for(i=0;i<e;i++)s=2*i,t.length>s&&(n=t[s]),r[s]=n,t.length>s+1&&(n=t[s+1]),r[s+1]=n}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var r,s,n,a=t;if(a<2&&(a=2),t=[],this.horizontal)for(n=-this.frame.halfWidth,s=this.frame.width/(a-1),r=0;r<a;r++)t.push({x:n+r*s,y:0});else for(n=-this.frame.halfHeight,s=this.frame.height/(a-1),r=0;r<a;r++)t.push({x:0,y:n+r*s})}var o=t.length,h=this.points.length;return o<1?(console.warn("Rope: Not enough points given"),this):(1===o&&(t.unshift({x:0,y:0}),o++),h!==o&&this.resizeArrays(o),this.dirty=!0,this.points=t,this.updateUVs(),null!=e&&this.setColors(e),null!=i&&this.setAlphas(i),this)},updateUVs:function(){for(var t=this.uv,e=this.points.length,i=this.frame.u0,r=this.frame.v0,s=this.frame.u1,n=this.frame.v1,a=(s-i)/(e-1),o=(n-r)/(e-1),h=0;h<e;h++){var l,u,d,c,f=4*h;this.horizontal?(this._flipX?(l=s-h*a,d=s-h*a):(l=i+h*a,d=i+h*a),this._flipY?(u=n,c=r):(u=r,c=n)):(this._flipX?(l=i,d=s):(l=s,d=i),this._flipY?(u=n-h*o,c=n-h*o):(u=r+h*o,c=r+h*o)),t[f+0]=l,t[f+1]=u,t[f+2]=d,t[f+3]=c}return this},resizeArrays:function(t){var e=this.colors,i=this.alphas;this.vertices=new Float32Array(4*t),this.uv=new Float32Array(4*t),e=new Uint32Array(2*t),i=new Float32Array(2*t);for(var r=0;r<2*t;r++)e[r]=16777215,i[r]=1;return this.colors=e,this.alphas=i,this.dirty=!0,this},updateVertices:function(){var t=this._perp,e=this.points,i=this.vertices,r=e.length;if(this.dirty=!1,!(r<1)){for(var s,n=e[0],a=this.horizontal?this.frame.halfHeight:this.frame.halfWidth,o=0;o<r;o++){var h=e[o],l=4*o;s=o<r-1?e[o+1]:h,t.x=s.y-n.y,t.y=-(s.x-n.x);var u=t.length();t.x/=u,t.y/=u,t.x*=a,t.y*=a,i[l]=h.x+t.x,i[l+1]=h.y+t.y,i[l+2]=h.x-t.x,i[l+3]=h.y-t.y,n=h}return this}},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebugVerts:null,this},renderDebugVerts:function(t,e,i){var r=t.debugGraphic,s=i[0],n=i[1],a=i[2],o=i[3];r.lineBetween(s,n,a,o);for(var h=4;h<e;h+=4){var l=i[h+0],u=i[h+1],d=i[h+2],c=i[h+3];r.lineBetween(s,n,l,u),r.lineBetween(a,o,d,c),r.lineBetween(a,o,l,u),r.lineBetween(l,u,d,c),s=l,n=u,a=d,o=c}},preDestroy:function(){this.anims.destroy(),this.anims=void 0,this.points=null,this.vertices=null,this.uv=null,this.colors=null,this.alphas=null,this.debugCallback=null,this.debugGraphic=null},flipX:{get:function(){return this._flipX},set:function(t){return this._flipX=t,this.updateUVs()}},flipY:{get:function(){return this._flipY},set:function(t){return this._flipY=t,this.updateUVs()}}});t.exports=d},95262(t){t.exports=function(){}},26209(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(35154),o=i(77757);s.register("rope",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),h=n(t,"horizontal",!0),l=a(t,"points",void 0),u=a(t,"colors",void 0),d=a(t,"alphas",void 0),c=new o(this.scene,0,0,i,s,l,h,u,d);return void 0!==e&&(t.add=e),r(this.scene,c,t),c})},96819(t,e,i){var r=i(77757);i(39429).register("rope",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))})},38745(t,e,i){var r=i(29747),s=r,n=r;s=i(20439),n=i(95262),t.exports={renderWebGL:s,renderCanvas:n}},20439(t,e,i){var r=i(91296),s={multiTexturing:!1,smoothPixelArt:!1};t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o,h=r(e,a,n,!i.useCanvas).calc;e.dirty&&e.updateVertices();var l=e.texture;o=l&&null!==l.smoothPixelArt?l.smoothPixelArt:e.scene.sys.game.config.smoothPixelArt,s.smoothPixelArt=o,(e.customRenderNodes.BatchHandler||e.defaultRenderNodes.BatchHandler).batchStrip(i,e,h,e.texture.source[0].glTexture,e.vertices,e.uv,e.colors,e.alphas,e.alpha,e.tintMode,s,e.debugCallback)}},20071(t,e,i){var r=i(71911),s=i(26099),n=i(55403),a=i(87774),o=i(83419),h=i(95540),l=i(31401),u=i(95643),d=i(25479),c=new o({Extends:u,Mixins:[l.BlendMode,l.ComputedSize,l.Depth,l.GetBounds,l.Origin,l.ScrollFactor,l.Transform,l.Visible,d],initialize:function(t,e,i,r,a,o,l){void 0===e&&(e={}),"string"==typeof e&&(e={fragmentKey:e}),void 0===i&&(i=0),void 0===r&&(r=0),void 0===a&&(a=128),void 0===o&&(o=128),u.call(this,t,"Shader");var d=t.sys.renderer;this.textures=[],this.renderNode=new n(d.renderNodes,e),this.setupUniforms=h(e,"setupUniforms",function(){}),e.updateShaderConfig&&(this.renderNode.updateShaderConfig=e.updateShaderConfig);var c=h(e,"initialUniforms",{});Object.entries(c).forEach(function(t){this.setUniform(t[0],t[1])},this),this.drawingContext=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.textureCoordinateTopLeft=new s(0,1),this.textureCoordinateTopRight=new s(1,1),this.textureCoordinateBottomLeft=new s(0,0),this.textureCoordinateBottomRight=new s(1,0),this.setTextures(l),this.setPosition(i,r),this.setSize(a,o),this.setOrigin(.5,.5)},getUniform:function(t){return this.renderNode.programManager.uniforms[t]},setUniform:function(t,e){return this.renderNode.programManager.setUniform(t,e),this},setTextures:function(t){void 0===t&&(t=[]),this.textures.length=0;for(var e=0;e<t.length;e++){var i=t[e];"string"==typeof i&&(i=this.scene.textures.get(i)),this.textures.push(i)}return this},setRenderToTexture:function(t){if(this.renderToTexture)return this;var e=this.width,i=this.height,s=this.scene.sys.renderer,n=this.scene,o=new r(0,0,e,i).setScene(n.game.scene.systemScene,!1);return this.drawingContext=new a(s,{width:e,height:i,camera:o}),this.glTexture=this.drawingContext.texture,t&&(this.texture=n.sys.textures.addGLTexture(t,this.glTexture)),this.renderToTexture=!0,this.renderWebGLStep(s,this,this.drawingContext),this},renderImmediate:function(){return this.renderWebGLStep(this.scene.renderer,this,this.drawingContext),this},setupUniforms:function(t,e){},setAlpha:function(){return this},setTextureCoordinates:function(t,e,i,r,s,n,a,o){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=1),void 0===r&&(r=1),void 0===s&&(s=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===o&&(o=0),this.textureCoordinateTopLeft.set(t,e),this.textureCoordinateTopRight.set(i,r),this.textureCoordinateBottomLeft.set(s,n),this.textureCoordinateBottomRight.set(a,o),this},setTextureCoordinatesFromFrame:function(t,e){"string"==typeof t&&(e?"string"==typeof e&&(e=this.scene.textures.get(e)):e=this.textures[0],t=e.get(t));var i=t.u0,r=t.v0,s=t.u1,n=t.v1;this.setTextureCoordinates(i,r,s,r,i,n,s,n)},preDestroy:function(){this.renderNode=null,this.textures.length=0,this.drawingContext&&(this.drawingContext.destroy(),this.texture&&this.texture.destroy(),this.drawingContext=null,this.glTexture=null,this.texture=null)}});t.exports=c},80464(t){t.exports=function(){}},54935(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(20071);s.register("shader",function(t,e){void 0===t&&(t={});var i=n(t,"config",null),s=n(t,"x",0),o=n(t,"y",0),h=n(t,"width",128),l=n(t,"height",128),u=new a(this.scene,i,s,o,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u})},74177(t,e,i){var r=i(20071);i(39429).register("shader",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},25479(t,e,i){var r=i(29747),s=r,n=r;s=i(19257),n=i(80464),t.exports={renderWebGL:s,renderCanvas:n}},19257(t){t.exports=function(t,e,i,r){if(i.camera.addToRenderList(e),e.renderToTexture){if((i=e.drawingContext).width!==e.width||i.height!==e.height){var s=e.width,n=e.height;i.resize(s,n),i.camera.setSize(s,n)}i.use()}e.renderNode.run(i,e,r),e.renderToTexture&&i.release()}},10441(t,e,i){var r=i(70554);t.exports=function(t,e,i,s,n,a,o){var h,l,u,d,c,f=r.getTintAppendFloatAlpha(s.fillColor,s.fillAlpha*n),p=s.pathData,g=s.pathIndexes,m=p.length,v=Array(2*m),y=Array(m),x=0,T=0;for(h=0;h<m;h+=2)l=p[h]-a,u=p[h+1]-o,d=i.getX(l,u),c=i.getY(l,u),v[x++]=d,v[x++]=c,y[T++]=f;e.batch(t,g,v,y,s.lighting)}},65960(t){t.exports=function(t,e,i,r){var s=i||e.fillColor,n=r||e.fillAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+a+","+o+","+h+","+n+")"}},75177(t){t.exports=function(t,e,i,r){var s=i||e.strokeColor,n=r||e.strokeAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+a+","+o+","+h+","+n+")",t.lineWidth=e.lineWidth}},17803(t,e,i){var r=i(87891),s=i(83419),n=i(31401),a=i(95643),o=i(23031),h=new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),a.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.enableFilters&&(this.filtersFocusContext=!0),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},34682(t,e,i){var r=i(70554);t.exports=function(t,e,i,s,n,a,o){var h=r.getTintAppendFloatAlpha(s.strokeColor,s.strokeAlpha*n),l=s.pathData,u=l.length-1,d=s.lineWidth,c=!s.closePath,f=s.customRenderNodes.StrokePath||s.defaultRenderNodes.StrokePath,p=[];c&&(u-=2);for(var g=0;g<u;g+=2){var m=l[g]-a,v=l[g+1]-o;g>0&&m===l[g-2]&&v===l[g-1]||p.push({x:m,y:v,width:d})}f.run(t,e,p,d,c,i,h,h,h,h,void 0,s.lighting)}},23629(t,e,i){var r=i(13609),s=i(83419),n=i(39506),a=i(94811),o=i(96503),h=i(36383),l=i(17803),u=new s({Extends:l,Mixins:[r],initialize:function(t,e,i,r,s,n,a,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===s&&(s=0),void 0===n&&(n=360),void 0===a&&(a=!1),l.call(this,t,"Arc",new o(0,0,r)),this._startAngle=s,this._endAngle=n,this._anticlockwise=a,this._iterations=.01,this.setPosition(e,i);var d=2*this.geom.radius;this.setSize(d,d),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,r=n(this._startAngle),s=n(this._endAngle),o=i,l=i;s-=r,this._anticlockwise?s<-h.TAU?s=-h.TAU:s>0&&(s=-h.TAU+s%h.TAU):s>h.TAU?s=h.TAU:s<0&&(s=h.TAU+s%h.TAU);for(var u,d=[o+Math.cos(r)*i,l+Math.sin(r)*i];e<1;)u=s*e+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+r,d.push(o+Math.cos(u)*i,l+Math.sin(u)*i),d.push(o+Math.cos(r)*i,l+Math.sin(r)*i),this.pathIndexes=a(d),this.pathData=d,this}});t.exports=u},42542(t,e,i){var r=i(39506),s=i(65960),n=i(75177),a=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(a(t,h,e,i,o)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,r(e._startAngle),r(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(s(h,e),h.fill()),e.isStroked&&(n(h,e),h.stroke()),h.restore()}}},42563(t,e,i){var r=i(23629),s=i(39429);s.register("arc",function(t,e,i,s,n,a,o,h){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o,h))}),s.register("circle",function(t,e,i,s,n){return this.displayList.add(new r(this.scene,t,e,i,0,360,!1,s,n))})},13609(t,e,i){var r=i(29747),s=r,n=r;s=i(41447),n=i(42542),t.exports={renderWebGL:s,renderCanvas:n}},41447(t,e,i){var r=i(91296),s=i(10441),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&s(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},89(t,e,i){var r=i(83419),s=i(33141),n=i(94811),a=i(87841),o=i(17803),h=new r({Extends:o,Mixins:[s],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),o.call(this,t,"Curve",r),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,n),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],r=this.geom.getPoints(e),s=0;s<r.length;s++)i.push(r[s].x,r[s].y);return i.push(r[0].x,r[0].y),this.pathIndexes=n(i),this.pathData=i,this}});t.exports=h},3170(t,e,i){var r=i(65960),s=i(75177),n=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,d=u.length-1,c=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(c,f),e.closePath||(d-=2);for(var p=2;p<d;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}e.closePath&&o.closePath(),e.isFilled&&(r(o,e),o.fill()),e.isStroked&&(s(o,e),o.stroke()),o.restore()}}},40511(t,e,i){var r=i(39429),s=i(89);r.register("curve",function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,r,n))})},33141(t,e,i){var r=i(29747),s=r,n=r;s=i(53987),n=i(3170),t.exports={renderWebGL:s,renderCanvas:n}},53987(t,e,i){var r=i(10441),s=i(91296),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX+e._curveBounds.x,u=e._displayOriginY+e._curveBounds.y,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},19921(t,e,i){var r=i(83419),s=i(94811),n=i(54205),a=i(8497),o=i(17803),h=new r({Extends:o,Mixins:[n],initialize:function(t,e,i,r,s,n,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===s&&(s=128),o.call(this,t,"Ellipse",new a(r/2,s/2,r,s)),this._smoothness=64,this.setPosition(e,i),this.width=r,this.height=s,void 0!==n&&this.setFillStyle(n,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateDisplayOrigin(),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=h},7930(t,e,i){var r=i(65960),s=i(75177),n=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,d=u.length-1,c=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(c,f),e.closePath||(d-=2);for(var p=2;p<d;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}o.closePath(),e.isFilled&&(r(o,e),o.fill()),e.isStroked&&(s(o,e),o.stroke()),o.restore()}}},1543(t,e,i){var r=i(19921);i(39429).register("ellipse",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},54205(t,e,i){var r=i(29747),s=r,n=r;s=i(19467),n=i(7930),t.exports={renderWebGL:s,renderCanvas:n}},19467(t,e,i){var r=i(10441),s=i(91296),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},30479(t,e,i){var r=i(83419),s=i(17803),n=i(26015),a=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,r,n,a,o,h,l,u,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===n&&(n=128),void 0===a&&(a=32),void 0===o&&(o=32),s.call(this,t,"Grid",null),this.cellWidth=a,this.cellHeight=o,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.cellPadding=.5,this.strokeOutside=!1,this.strokeOutsideIncomplete=!0,this.setPosition(e,i),this.setSize(r,n),this.setFillStyle(h,l),void 0!==u&&this.setStrokeStyle(1,u,d),this.updateDisplayOrigin()},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setCellPadding:function(t){return this.cellPadding=t||0,this},setStrokeOutside:function(t,e){return this.strokeOutside=t,void 0!==e&&(this.strokeOutsideIncomplete=e),this}});t.exports=a},49912(t,e,i){var r=i(65960),s=i(75177),n=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,d=e.width,c=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(d/f),m=Math.ceil(c/p),v=f,y=p,x=f-(g*f-d),T=p-(m*p-c),w=e.isFilled,b=e.showAltCells,S=e.isStroked,C=e.cellPadding,E=e.lineWidth/2,A=0,_=0,M=0,R=0,P=0;if(C&&(v-=2*C,y-=2*C,x-=2*C,T-=2*C),w&&e.fillAlpha>0)for(r(o,e),_=0;_<m;_++)for(b&&(M=_%2),A=0;A<g;A++)b&&M?M=0:(M++,P=_<m-1?y:T,(R=A<g-1?v:x)>0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P));if(b&&e.altFillAlpha>0)for(r(o,e,e.altFillColor,e.altFillAlpha*u),_=0;_<m;_++)for(b&&(M=_%2),A=0;A<g;A++)!b||M?(M=0,P=_<m-1?y:T,(R=A<g-1?v:x)>0&&P>0&&o.fillRect(h+A*f+C,l+_*p+C,R,P)):M=1;if(S&&e.strokeAlpha>0){s(o,e,e.strokeColor,e.strokeAlpha*u);var O=e.strokeOutside?0:1;for(A=O;A<g;A++){var L=A*f;o.beginPath(),o.moveTo(L+h,l),o.lineTo(L+h,c+l),o.stroke()}for(_=O;_<m;_++){var F=_*p;o.beginPath(),o.moveTo(h,F+l),o.lineTo(h+d,F+l),o.stroke()}e.strokeOutside&&(d>E&&(o.beginPath(),o.moveTo(d+h,l),o.lineTo(d+h,c+l),o.stroke()),c>E&&(o.beginPath(),o.moveTo(h,c+l),o.lineTo(d+h,c+l),o.stroke()))}o.restore()}}},34137(t,e,i){var r=i(39429),s=i(30479);r.register("grid",function(t,e,i,r,n,a,o,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h,l,u))})},26015(t,e,i){var r=i(29747),s=r,n=r;s=i(46161),n=i(49912),t.exports={renderWebGL:s,renderCanvas:n}},46161(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){var a=i.camera;a.addToRenderList(e);var o=e.customRenderNodes.FillRect||e.defaultRenderNodes.FillRect,h=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,l=r(e,a,n,!i.useCanvas).calc;l.translate(-e._displayOriginX,-e._displayOriginY);var u,d=e.alpha,c=e.width,f=e.height,p=e.cellWidth,g=e.cellHeight,m=Math.ceil(c/p),v=Math.ceil(f/g),y=p,x=g,T=p-(m*p-c),w=g-(v*g-f),b=e.isFilled,S=e.showAltCells,C=e.isStroked,E=e.cellPadding,A=e.lineWidth,_=A/2,M=0,R=0,P=0,O=0,L=0;if(E&&(y-=2*E,x-=2*E,T-=2*E,w-=2*E),b&&e.fillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),R=0;R<v;R++)for(S&&(P=R%2),M=0;M<m;M++)S&&P?P=0:(P++,L=R<v-1?x:w,(O=M<m-1?y:T)>0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u,e.lighting));if(S&&e.altFillAlpha>0)for(u=s.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*d),R=0;R<v;R++)for(S&&(P=R%2),M=0;M<m;M++)!S||P?(P=0,L=R<v-1?x:w,(O=M<m-1?y:T)>0&&L>0&&o.run(i,l,h,M*p+E,R*g+E,O,L,u,u,u,u)):P=1;if(C&&e.strokeAlpha>0){var F=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d),D=e.strokeOutside?0:1;for(M=D;M<m;M++){var I=M*p-_;o.run(i,l,h,I,0,A,f,F,F,F,F)}for(R=D;R<v;R++){var N=R*g-_;o.run(i,l,h,0,N,c,A,F,F,F,F)}e.strokeOutside&&e.strokeOutsideIncomplete&&(c>_&&o.run(i,l,h,c-_,0,A,f,F,F,F,F),f>_&&o.run(i,l,h,0,f-_,c,A,F,F,F,F))}}},61475(t,e,i){var r=i(99651),s=i(83419),n=i(17803),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,r,s,a,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=15658734),void 0===o&&(o=10066329),void 0===h&&(h=13421772),n.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=a,this.fillLeft=o,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},11508(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection;e.showTop&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(l,-1),a.lineTo(0,u-1),a.lineTo(-l,-1),a.lineTo(-l,-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(-l,-h),a.lineTo(-l,0),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h),a.lineTo(l,-h),a.lineTo(l,0),a.fill()),a.restore()}}},3933(t,e,i){var r=i(39429),s=i(61475);r.register("isobox",function(t,e,i,r,n,a,o){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o))})},99651(t,e,i){var r=i(29747),s=r,n=r;s=i(68149),n=i(11508),t.exports={renderWebGL:s,renderCanvas:n}},68149(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p,g,m=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,v=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,y=r(e,a,n,!i.useCanvas).calc,x=e.width,T=e.height,w=x/2,b=x/e.projection,S=e.alpha,C=e.lighting;e.showTop&&(o=s.getTintAppendFloatAlpha(e.fillTop,S),h=-w,l=-T,u=0,d=-b-T,c=w,f=-T,p=0,g=b-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,S),h=-w,l=0,u=0,d=b,c=0,f=b-T,p=-w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,S),h=w,l=0,u=0,d=b,c=0,f=b-T,p=w,g=-T,m.run(i,y,v,h,l,u,d,c,f,o,o,o,C),m.run(i,y,v,c,f,p,g,h,l,o,o,o,C))}}},16933(t,e,i){var r=i(83419),s=i(60561),n=i(17803),a=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,r,s,a,o,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=48),void 0===s&&(s=32),void 0===a&&(a=!1),void 0===o&&(o=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),n.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=a,this.isFilled=!0,this.setPosition(e,i),this.setSize(r,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=a},79590(t,e,i){var r=i(65960),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)&&e.isFilled){var o=e.width,h=e.height,l=o/2,u=o/e.projection,d=e.isReversed;e.showTop&&d&&(r(a,e,e.fillTop),a.beginPath(),a.moveTo(-l,-h),a.lineTo(0,-u-h),a.lineTo(l,-h),a.lineTo(0,u-h),a.fill()),e.showLeft&&(r(a,e,e.fillLeft),a.beginPath(),d?(a.moveTo(-l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(-l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),e.showRight&&(r(a,e,e.fillRight),a.beginPath(),d?(a.moveTo(l,-h),a.lineTo(0,u),a.lineTo(0,u-h)):(a.moveTo(l,0),a.lineTo(0,u),a.lineTo(0,u-h)),a.fill()),a.restore()}}},49803(t,e,i){var r=i(39429),s=i(16933);r.register("isotriangle",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},60561(t,e,i){var r=i(29747),s=r,n=r;s=i(51503),n=i(79590),t.exports={renderWebGL:s,renderCanvas:n}},51503(t,e,i){var r=i(91296),s=i(70554);t.exports=function(t,e,i,n){if(e.isFilled){var a=i.camera;a.addToRenderList(e);var o,h,l,u,d,c,f,p=e.customRenderNodes.FillTri||e.defaultRenderNodes.FillTri,g=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,m=r(e,a,n,!i.useCanvas).calc,v=e.width,y=e.height,x=v/2,T=v/e.projection,w=e.isReversed,b=e.alpha,S=e.lighting;if(e.showTop&&w){o=s.getTintAppendFloatAlpha(e.fillTop,b),h=-x,l=-y,u=0,d=-T-y,c=x,f=-y;var C=T-y;p.run(i,m,g,h,l,u,d,c,f,o,o,o,S),p.run(i,m,g,c,f,0,C,h,l,o,o,o,S)}e.showLeft&&(o=s.getTintAppendFloatAlpha(e.fillLeft,b),w?(h=-x,l=-y,u=0,d=T,c=0,f=T-y):(h=-x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S)),e.showRight&&(o=s.getTintAppendFloatAlpha(e.fillRight,b),w?(h=x,l=-y,u=0,d=T,c=0,f=T-y):(h=x,l=0,u=0,d=T,c=0,f=T-y),p.run(i,m,g,h,l,u,d,c,f,o,o,o,S))}}},57847(t,e,i){var r=i(83419),s=i(17803),n=i(23031),a=i(36823),o=new r({Extends:s,Mixins:[a],initialize:function(t,e,i,r,a,o,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=128),void 0===h&&(h=0),s.call(this,t,"Line",new n(r,a,o,h));var d=Math.max(1,this.geom.right-this.geom.left),c=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(d,c),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,r){return this.geom.setTo(t,e,i,r),this}});t.exports=o},17440(t,e,i){var r=i(75177),s=i(20926);t.exports=function(t,e,i,n){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,n)){var o=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(r(a,e),a.beginPath(),a.moveTo(e.geom.x1-o,e.geom.y1-h),a.lineTo(e.geom.x2-o,e.geom.y2-h),a.stroke()),a.restore()}}},2481(t,e,i){var r=i(39429),s=i(57847);r.register("line",function(t,e,i,r,n,a,o,h){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h))})},36823(t,e,i){var r=i(29747),s=r,n=r;s=i(77385),n=i(17440),t.exports={renderWebGL:s,renderCanvas:n}},77385(t,e,i){var r=i(91296),s=i(70554),n=[{x:0,y:0,width:0},{x:0,y:0,width:0}];t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha;if(e.isStroked){var c=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*d);n[0].x=e.geom.x1-l,n[0].y=e.geom.y1-u,n[0].width=e._startWidth,n[1].x=e.geom.x2-l,n[1].y=e.geom.y2-u,n[1].width=e._endWidth,(e.customRenderNodes.StrokePath||e.defaultRenderNodes.StrokePath).run(i,e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,n,1,!0,h,c,c,c,c,void 0,e.lighting)}}},24949(t,e,i){var r=i(90273),s=i(83419),n=i(94811),a=i(13829),o=i(25717),h=i(17803),l=i(5469),u=new s({Extends:h,Mixins:[r],initialize:function(t,e,i,r,s,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new o(r));var l=a(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==s&&this.setFillStyle(s,n),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e<t;e++)l(this.geom);return this.updateData()},setTo:function(t){this.geom.setTo(t);var e=a(this.geom);return this.setSize(e.width,e.height),this.updateDisplayOrigin(),this.updateData()},updateData:function(){for(var t=[],e=this.geom.points,i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=n(t),this.pathData=t,this}});t.exports=u},38710(t,e,i){var r=i(65960),s=i(75177),n=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,d=u.length-1,c=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(c,f),e.closePath||(d-=2);for(var p=2;p<d;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}e.closePath&&o.closePath(),e.isFilled&&(r(o,e),o.fill()),e.isStroked&&(s(o,e),o.stroke()),o.restore()}}},64827(t,e,i){var r=i(39429),s=i(24949);r.register("polygon",function(t,e,i,r,n){return this.displayList.add(new s(this.scene,t,e,i,r,n))})},90273(t,e,i){var r=i(29747),s=r,n=r;s=i(73695),n=i(38710),t.exports={renderWebGL:s,renderCanvas:n}},73695(t,e,i){var r=i(10441),s=i(91296),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},74561(t,e,i){var r=i(83419),s=i(94811),n=i(87841),a=i(17803),o=i(95597),h=new r({Extends:a,Mixins:[o],initialize:function(t,e,i,r,s,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=128),void 0===s&&(s=128),a.call(this,t,"Rectangle",new n(0,0,r,s)),this.radius=20,this.isRounded=!1,this.setPosition(e,i),this.setSize(r,s),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setRounded:function(t){return void 0===t&&(t=16),this.radius=t,this.isRounded=t>0,this.updateRoundedData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){if(this.isRounded)return this.updateRoundedData();var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this},updateRoundedData:function(){var t=[],e=this.width/2,i=this.height/2,r=Math.min(e,i),n=Math.min(this.radius,r),a=e,o=i,h=Math.max(4,Math.min(16,Math.ceil(n/2)));return this.arcTo(t,a-e+n,o-i+n,n,Math.PI,1.5*Math.PI,h),t.push(a+e-n,o-i),this.arcTo(t,a+e-n,o-i+n,n,1.5*Math.PI,2*Math.PI,h),t.push(a+e,o+i-n),this.arcTo(t,a+e-n,o+i-n,n,0,.5*Math.PI,h),t.push(a-e+n,o+i),this.arcTo(t,a-e+n,o+i-n,n,.5*Math.PI,Math.PI,h),t.push(a-e,o-i+n),this.pathIndexes=s(t),this.pathData=t,this},arcTo:function(t,e,i,r,s,n,a){for(var o=(n-s)/a,h=0;h<=a;h++){var l=s+o*h;t.push(e+Math.cos(l)*r,i+Math.sin(l)*r)}}});t.exports=h},48682(t,e,i){var r=i(65960),s=i(75177),n=i(20926),a=function(t,e,i,r,s,n){var a=Math.min(r/2,s/2),o=Math.min(n,a);0!==o?(t.moveTo(e+o,i),t.lineTo(e+r-o,i),t.arcTo(e+r,i,e+r,i+o,o),t.lineTo(e+r,i+s-o),t.arcTo(e+r,i+s,e+r-o,i+s,o),t.lineTo(e+o,i+s),t.arcTo(e,i+s,e,i+s-o,o),t.lineTo(e,i+o),t.arcTo(e,i,e+o,i,o),t.closePath()):t.rect(e,i,r,s)};t.exports=function(t,e,i,o){i.addToRenderList(e);var h=t.currentContext;if(n(t,h,e,i,o)){var l=e._displayOriginX,u=e._displayOriginY;e.isFilled&&(r(h,e),e.isRounded?(h.beginPath(),a(h,-l,-u,e.width,e.height,e.radius),h.fill()):h.fillRect(-l,-u,e.width,e.height)),e.isStroked&&(s(h,e),h.beginPath(),e.isRounded?a(h,-l,-u,e.width,e.height,e.radius):h.rect(-l,-u,e.width,e.height),h.stroke()),h.restore()}}},87959(t,e,i){var r=i(39429),s=i(74561);r.register("rectangle",function(t,e,i,r,n,a){return this.displayList.add(new s(this.scene,t,e,i,r,n,a))})},95597(t,e,i){var r=i(29747),s=r,n=r;s=i(52059),n=i(48682),t.exports={renderWebGL:s,renderCanvas:n}},52059(t,e,i){var r=i(10441),s=i(91296),n=i(34682),a=i(70554);t.exports=function(t,e,i,o){var h=i.camera;h.addToRenderList(e);var l=s(e,h,o,!i.useCanvas).calc,u=e._displayOriginX,d=e._displayOriginY,c=e.alpha,f=e.customRenderNodes,p=e.defaultRenderNodes,g=f.Submitter||p.Submitter;if(e.isFilled)if(e.isRounded)r(i,g,l,e,c,u,d);else{var m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);(f.FillRect||p.FillRect).run(i,l,g,-u,-d,e.width,e.height,m,m,m,m,e.lighting)}e.isStroked&&n(i,g,l,e,c,u,d)}},55911(t,e,i){var r=i(81991),s=i(83419),n=i(94811),a=i(17803),o=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,r,s,n,o,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=5),void 0===s&&(s=32),void 0===n&&(n=64),a.call(this,t,"Star",null),this._points=r,this._innerRadius=s,this._outerRadius=n,this.setPosition(e,i),this.setSize(2*n,2*n),void 0!==o&&this.setFillStyle(o,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,r=this._outerRadius,s=Math.PI/2*3,a=Math.PI/e,o=r,h=r;t.push(o,h+-r);for(var l=0;l<e;l++)t.push(o+Math.cos(s)*r,h+Math.sin(s)*r),s+=a,t.push(o+Math.cos(s)*i,h+Math.sin(s)*i),s+=a;return t.push(o,h+-r),this.pathIndexes=n(t),this.pathData=t,this}});t.exports=o},64272(t,e,i){var r=i(65960),s=i(75177),n=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,d=u.length-1,c=u[0]-h,f=u[1]-l;o.beginPath(),o.moveTo(c,f),e.closePath||(d-=2);for(var p=2;p<d;p+=2){var g=u[p]-h,m=u[p+1]-l;o.lineTo(g,m)}o.closePath(),e.isFilled&&(r(o,e),o.fill()),e.isStroked&&(s(o,e),o.stroke()),o.restore()}}},93697(t,e,i){var r=i(55911);i(39429).register("star",function(t,e,i,s,n,a,o){return this.displayList.add(new r(this.scene,t,e,i,s,n,a,o))})},81991(t,e,i){var r=i(29747),s=r,n=r;s=i(57017),n=i(64272),t.exports={renderWebGL:s,renderCanvas:n}},57017(t,e,i){var r=i(10441),s=i(91296),n=i(34682);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=s(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter;e.isFilled&&r(i,c,h,e,d,l,u),e.isStroked&&n(i,c,h,e,d,l,u)}},36931(t,e,i){var r=i(83419),s=i(17803),n=i(16483),a=i(96195),o=new r({Extends:s,Mixins:[a],initialize:function(t,e,i,r,a,o,h,l,u,d,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===a&&(a=128),void 0===o&&(o=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new n(r,a,o,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==d&&this.setFillStyle(d,c),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,r,s,n){return this.geom.setTo(t,e,i,r,s,n),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=o},85172(t,e,i){var r=i(65960),s=i(75177),n=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,a)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,d=e.geom.y1-l,c=e.geom.x2-h,f=e.geom.y2-l,p=e.geom.x3-h,g=e.geom.y3-l;o.beginPath(),o.moveTo(u,d),o.lineTo(c,f),o.lineTo(p,g),o.closePath(),e.isFilled&&(r(o,e),o.fill()),e.isStroked&&(s(o,e),o.stroke()),o.restore()}}},45245(t,e,i){var r=i(39429),s=i(36931);r.register("triangle",function(t,e,i,r,n,a,o,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,r,n,a,o,h,l,u))})},96195(t,e,i){var r=i(29747),s=r,n=r;s=i(83253),n=i(85172),t.exports={renderWebGL:s,renderCanvas:n}},83253(t,e,i){var r=i(91296),s=i(34682),n=i(70554);t.exports=function(t,e,i,a){var o=i.camera;o.addToRenderList(e);var h=r(e,o,a,!i.useCanvas).calc,l=e._displayOriginX,u=e._displayOriginY,d=e.alpha,c=e.customRenderNodes,f=e.defaultRenderNodes,p=c.Submitter||f.Submitter;if(e.isFilled){var g=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d),m=e.geom.x1-l,v=e.geom.y1-u,y=e.geom.x2-l,x=e.geom.y2-u,T=e.geom.x3-l,w=e.geom.y3-u;(c.FillTri||f.FillTri).run(i,h,p,m,v,y,x,T,w,g,g,g,e.lighting)}e.isStroked&&s(i,p,h,e,d,l,u)}},68287(t,e,i){var r=i(9674),s=i(40939),n=i(83419),a=i(31401),o=i(95643),h=i(92751),l=new n({Extends:o,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.Size,a.TextureCrop,a.Tint,a.Transform,a.Visible,h],initialize:function(t,e,i,s,n){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return a.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=l},76552(t){t.exports=function(t,e,i,r){i.addToRenderList(e),t.batchSprite(e,e.frame,i,r)}},15567(t,e,i){var r=i(25305),s=i(13059),n=i(44603),a=i(23568),o=i(68287);n.register("sprite",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,h,t),s(h,t),h})},46409(t,e,i){var r=i(39429),s=i(68287);r.register("sprite",function(t,e,i,r){return this.displayList.add(new s(this.scene,t,e,i,r))})},92751(t,e,i){var r=i(29747),s=r,n=r;s=i(9409),n=i(76552),t.exports={renderWebGL:s,renderCanvas:n}},9409(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}},18207(t){t.exports={None:0,Power0:1,Power1:10,Power2:20,Power3:30,Power4:40,Linear:1,Gravity:2,Quad:10,"Quad.easeOut":10,"Quad.easeIn":11,"Quad.easeInOut":12,Cubic:20,"Cubic.easeOut":20,"Cubic.easeIn":21,"Cubic.easeInOut":22,Quart:30,"Quart.easeOut":30,"Quart.easeIn":31,"Quart.easeInOut":32,Quint:40,"Quint.easeOut":40,"Quint.easeIn":41,"Quint.easeInOut":42,Sine:50,"Sine.easeOut":50,"Sine.easeIn":51,"Sine.easeInOut":52,Expo:60,"Expo.easeOut":60,"Expo.easeIn":61,"Expo.easeInOut":62,Circ:70,"Circ.easeOut":70,"Circ.easeIn":71,"Circ.easeInOut":72,Back:90,"Back.easeOut":90,"Back.easeIn":91,"Back.easeInOut":92,Bounce:100,"Bounce.easeOut":100,"Bounce.easeIn":101,"Bounce.easeInOut":102,Stepped:110,Smoothstep:120,"Smoothstep.easeOut":120,"Smoothstep.easeIn":121,"Smoothstep.easeInOut":122}},68218(t,e,i){for(var r=i(18207),s={},n=Object.keys(r),a=n.length,o=0;o<a;o++){var h=n[o];s[r[h]]=h}t.exports=s},76573(t,e,i){var r=i(83419),s=i(31401),n=i(95643),a=i(53384),o=i(70554),h=i(18207),l=i(68218),u=i(71238),d=o.getTintAppendFloatAlpha,c=new r({Extends:n,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.ElapseTimer,s.Lighting,s.Mask,s.RenderNodes,s.TextureCrop,s.Visible,u],initialize:function(t,e,i){n.call(this,t,"SpriteGPULayer"),this.memberCount=0,this.size=Math.max(i,0),this._segments=24,this.MAX_BUFFER_UPDATE_SEGMENTS_FULL=16777215,this.bufferUpdateSegments=0,this.bufferUpdateSegmentSize=Math.ceil(this.size/this._segments),this.gravity=1024,this._animationsEnabled={};for(var r=Object.keys(h),s=r.length,o=0;o<s;o++)this._animationsEnabled[r[o]]=!1;this.EASE=h,this.EASE_CODES=l,this.setTexture(e),this.initRenderNodes(new Phaser.Structs.Map),this.frameDataTexture=null,this.frameDataIndices={},this.frameDataIndicesInv={},this.animationData=[],this.animationDataNames={},this.animationDataIndices={},this.generateFrameDataTexture(),this.submitterNode=new a(t.renderer.renderNodes,{},this),this.defaultRenderNodes.Submitter=this.submitterNode,this.renderNodeData[this.submitterNode.name]={},this.resize(this.size),this.nextMember=new ArrayBuffer(this.getDataByteSize()),this.nextMemberF32=new Float32Array(this.nextMember),this.nextMemberU32=new Uint32Array(this.nextMember)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},getDataByteSize:function(){return this.submitterNode.instanceBufferLayout.layout.stride},getShaderFeatures:function(){for(var t=[],e=Object.keys(this._animationsEnabled),i=e.length,r=0;r<i;r++)this._animationsEnabled[e[r]]&&t.push(e[r]);return t},setAnimations:function(t){for(var e=t.length,i=this.texture.getFrameNames(!0).length,r=0;r<e;r++){var s=t[r],n={};s.key?(n.name=s.key,n.duration=s.duration,n.frames=s.frames):(n.name=s.name,n.duration=s.duration,n.frames=s.frames.slice()),n.index=i,n.frameCount=n.frames.length,i+=n.frameCount,this.animationData.push(n),this.animationDataNames[n.name]=n,this.animationDataIndices[n.index]=n}return this.generateFrameDataTexture(),this},generateFrameDataTexture:function(){var t=this.texture,e=t.getFrameNames(!0),i=e.length;this.frameDataIndices={},this.frameDataIndicesInv={};for(var r=0;r<i;r++){var s=e[r],n=t.get(s);this.frameDataIndices[s]=r,this.frameDataIndicesInv[r]=s}var a=this.animationData.length;for(r=0;r<a;r++)for(var o=this.animationData[r],h=o.frameCount,l=0;l<h;l++)e.push(o.frames[l]);var u=3*(i=e.length),d=Math.min(u,4096),c=Math.ceil(u/4096),f=d*c*4,p=t.manager,g=new ArrayBuffer(f),m=new Uint16Array(g),v=new Uint8Array(g);for(r=0;r<i;r++){var y=e[r];if("string"==typeof y)n=t.get(e[r]);else if(y&&void 0!==y.key){n=p.get(y.key).get(y.frame)}else n=y.frame;var x=3*r*m.BYTES_PER_ELEMENT;m[x]=n.cutX,m[x+1]=n.cutY,m[x+2]=n.cutWidth,m[x+3]=n.cutHeight;var T=.5,w=.5;n.customPivot&&(T=n.pivotX,w=n.pivotY),m[x+4]=Math.round((T-.5)*n.cutWidth)+32768,m[x+5]=Math.round((w-.5)*n.cutHeight)+32768}this.frameDataTexture&&this.frameDataTexture.destroy(),this.frameDataTexture=this.scene.renderer.createUint8ArrayTexture(v,d,c,!1,!1)},resize:function(t,e){var i=this.submitterNode.instanceBufferLayout,r=i.buffer,s=r.viewU8,n=t*i.layout.stride;if(this.size=t,r.resize(n),e)this.memberCount=0;else{var a=r.viewU8;a.set(s.subarray(0,Math.min(a.byteLength,n))),this.memberCount=Math.min(this.memberCount,t)}return this.bufferUpdateSegmentSize=Math.ceil(this.size/this._segments),this.setAllSegmentsNeedUpdate(),this},setSegmentNeedsUpdate:function(t){if(!(t<0||t>=this.size||this.bufferUpdateSegments===this.MAX_BUFFER_UPDATE_SEGMENTS_FULL)){var e=Math.floor(t/this.bufferUpdateSegmentSize);this.bufferUpdateSegments|=1<<e}},setAllSegmentsNeedUpdate:function(){this.bufferUpdateSegments=this.MAX_BUFFER_UPDATE_SEGMENTS_FULL},clearAllSegmentsNeedUpdate:function(){this.bufferUpdateSegments=0},addData:function(t){if(this.memberCount>=this.size)return this;var e=this.submitterNode.instanceBufferLayout,i=e.buffer.viewF32,r=this.memberCount*e.layout.stride;return i.set(t,r/i.BYTES_PER_ELEMENT),this.setSegmentNeedsUpdate(this.memberCount),this.memberCount++,this},addMember:function(t){if(this.memberCount>=this.size)return this;var e=this.nextMemberF32,i=this.nextMemberU32;t||(t={});var r=this.frame;if(void 0!==t.frame&&(r=t.frame.base?t.frame.base:t.frame),"string"==typeof r&&!(r=this.texture.get(r)))return this;var s=0;this._setAnimatedValue(t.x,s),s+=4,this._setAnimatedValue(t.y,s),s+=4,this._setAnimatedValue(t.rotation,s),s+=4,this._setAnimatedValue(t.scaleX,s,1),s+=4,this._setAnimatedValue(t.scaleY,s,1),s+=4,this._setAnimatedValue(t.alpha,s,1),s+=4;var n=t.animation;if(n){var a;if("string"==typeof n||"number"==typeof n)a="string"==typeof n?this.animationDataNames[n]:this.animationDataIndices[n],this._setAnimatedValue({base:a.index,amplitude:a.frameCount,duration:a.duration,ease:h.Linear,yoyo:!1},s);else{var o=n.base;a="string"==typeof o?this.animationDataNames[o]:"number"==typeof o?this.animationDataIndices[o]:this.animationData[0],this._setAnimatedValue({base:a.index,amplitude:"number"==typeof n.amplitude?n.amplitude:a.frameCount,duration:n.duration||a.duration,delay:n.delay||0,ease:n.ease||h.Linear,yoyo:!!n.yoyo},s)}}else{var l=this.frameDataIndices[r.name],u=t.frame;u&&void 0!==u.base?this._setAnimatedValue({base:l,amplitude:u.amplitude,duration:u.duration,delay:u.delay,ease:u.ease,yoyo:u.yoyo},s):this._setAnimatedValue(l,s)}s+=4,this._setAnimatedValue(t.tintBlend,s,1),s+=4;var c=void 0===t.tintBottomLeft?16777215:t.tintBottomLeft,f=void 0===t.tintTopLeft?16777215:t.tintTopLeft,p=void 0===t.tintBottomRight?16777215:t.tintBottomRight,g=void 0===t.tintTopRight?16777215:t.tintTopRight,m=void 0===t.alphaBottomLeft?1:t.alphaBottomLeft,v=void 0===t.alphaTopLeft?1:t.alphaTopLeft,y=void 0===t.alphaBottomRight?1:t.alphaBottomRight,x=void 0===t.alphaTopRight?1:t.alphaTopRight;return i[s++]=d(c,m),i[s++]=d(f,v),i[s++]=d(p,y),i[s++]=d(g,x),e[s++]=void 0===t.originX?.5:t.originX,e[s++]=void 0===t.originY?.5:t.originY,e[s++]=t.tintMode||0,e[s++]=void 0===t.creationTime?this.timeElapsed:t.creationTime,e[s++]=void 0===t.scrollFactorX?1:t.scrollFactorX,e[s++]=void 0===t.scrollFactorY?1:t.scrollFactorY,this.addData(this.nextMemberF32),this},editMember:function(t,e){if(t<0||t>=this.memberCount)return this;var i=this.memberCount;return this.memberCount=t,this.addMember(e),this.memberCount=i,this},patchMember:function(t,e,i){if(!(t<0||t>=this.memberCount)){var r=this.submitterNode.instanceBufferLayout,s=r.buffer,n=t*r.layout.stride,a=s.viewU32,o=n/4;if(i)for(var h=0;h<e.length;h++)i[h]&&(a[o+h]=e[h]);else a.set(e,o);this.setSegmentNeedsUpdate(t)}},getMember:function(t){if(t<0||t>=this.memberCount)return null;var e=this.submitterNode.instanceBufferLayout,i=e.buffer,r=t*e.layout.stride,s=i.viewF32,n=i.viewU32,a={},o=r/s.BYTES_PER_ELEMENT;a.x=this._getAnimatedValue(o),o+=4,a.y=this._getAnimatedValue(o),o+=4,a.rotation=this._getAnimatedValue(o),o+=4,a.scaleX=this._getAnimatedValue(o),o+=4,a.scaleY=this._getAnimatedValue(o),o+=4,a.alpha=this._getAnimatedValue(o),o+=4;var h=this._getAnimatedValue(o);o+=4,"number"!=typeof h&&(h=h.base);var l=this.frameDataIndicesInv[h];if(void 0===l){var u=this.animationDataIndices[h];u&&(a.animation=u.name)}else a.frame=l;return a.tintBlend=this._getAnimatedValue(o),o+=4,a.tintBottomLeft=n[o++],a.tintTopLeft=n[o++],a.tintBottomRight=n[o++],a.tintTopRight=n[o++],a.alphaBottomLeft=(a.tintBottomLeft>>>24)/255,a.alphaTopLeft=(a.tintTopLeft>>>24)/255,a.alphaBottomRight=(a.tintBottomRight>>>24)/255,a.alphaTopRight=(a.tintTopRight>>>24)/255,a.tintBottomLeft&=16777215,a.tintTopLeft&=16777215,a.tintBottomRight&=16777215,a.tintTopRight&=16777215,a.originX=s[o++],a.originY=s[o++],a.tintMode=s[o++],a.creationTime=s[o++],a.scrollFactorX=s[o++],a.scrollFactorY=s[o++],a},getMemberData:function(t,e){if(t<0||t>=this.memberCount)return null;var i=this.submitterNode.instanceBufferLayout,r=i.buffer,s=i.layout.stride,n=t*s;e||(e=this.nextMemberU32);var a=r.viewU32,o=a.BYTES_PER_ELEMENT;return e.set(a.subarray(n/o,n/o+s/o)),e},removeMembers:function(t,e){if(t<0||t>=this.memberCount)return this;void 0===e&&(e=1),e=Math.min(e,this.memberCount-t);var i=this.submitterNode.instanceBufferLayout,r=i.layout.stride,s=t*r,n=e*r,a=i.buffer.viewU8;a.set(a.subarray(s+n),s);for(var o=t;o<this.memberCount;o+=this.bufferUpdateSegmentSize)this.setSegmentNeedsUpdate(o);return this.memberCount-=e,this},insertMembers:function(t,e){if(t<0||t>this.memberCount)return this;Array.isArray(e)||(e=[e]);var i=this.memberCount,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s,a=e.length*s;r.buffer.viewU8.copyWithin(n+a,n,i*s),this.memberCount=t;for(var o=0;o<e.length;o++)this.addMember(e[o]);for(this.memberCount=Math.min(this.size,i+e.length),o=t;o<this.memberCount;o+=this.bufferUpdateSegmentSize)this.setSegmentNeedsUpdate(o);return this},insertMembersData:function(t,e){if(t<0||t>this.memberCount)return this;var i=e.length*e.BYTES_PER_ELEMENT,r=this.submitterNode.instanceBufferLayout,s=r.layout.stride,n=t*s;r.buffer.viewU8.copyWithin(n+i,n,this.memberCount*s),r.buffer.viewU32.set(e,n/e.BYTES_PER_ELEMENT),this.memberCount=Math.min(this.size,this.memberCount+i/s);for(var a=t;a<this.memberCount;a+=this.bufferUpdateSegmentSize)this.setSegmentNeedsUpdate(a);return this},_setAnimatedValue:function(t,e,i){var r=this.nextMemberF32;if(void 0===i&&(i=0),"number"==typeof t)r[e++]=t,r[e++]=0,r[e++]=0,r[e]=0;else if(void 0===t)r[e++]=i,r[e++]=0,r[e++]=0,r[e]=0;else{var s=t.base||0,n=t.ease||0,a=t.amplitude||0,o=Math.abs(t.duration||0),l=t.delay||0,u=void 0===t.yoyo||t.yoyo,d=void 0===t.loop||t.loop;"string"==typeof n&&(n=this.EASE[n]||0);var c=this.EASE_CODES[n];if(this._animationsEnabled[c]||this.setAnimationEnabled(c,!0),n===h.Gravity){var f=t.velocity||0,p=t.gravityFactor||1;p>=1?p=0:p<-1&&(p=-.999),p=(p+1)/2,a=Math.floor(f)+p}(l=o>0?l/o%2:0)<0&&(l+=2),l/=2,l+=n,u&&(o=-o),d||(l=-l),r[e++]=s,r[e++]=a,r[e++]=o,r[e]=l}},_getAnimatedValue:function(t){var e=this.submitterNode.instanceBufferLayout.buffer.viewF32,i=e[t++],r=e[t++],s=e[t++],n=e[t];if(0===r||0===s||0===o)return i;n>0||(n=-n);var a=s<0;a&&(s=-s);var o=Math.floor(n);if(n=(n-=o)*s*2%s,o===h.Gravity){var l=Math.floor(r),u=2*(r-l)-1;return 0===u&&(u=1),{base:i,ease:o,duration:s,delay:n,yoyo:a,velocity:l,gravityFactor:u}}return{base:i,ease:o,amplitude:r,duration:s,delay:n,yoyo:a}},setAnimationEnabled:function(t,e){return this._animationsEnabled[t]=!!e,this},preDestroy:function(){this.frameDataTexture.destroy()}});t.exports=c},16193(t,e,i){var r=i(10312),s=i(44603),n=i(23568),a=i(76573);s.register("spriteGPULayer",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"size",1),o=new a(this.scene,i,s);return void 0!==e&&(t.add=e),o.alpha=n(t,"alpha",1),o.blendMode=n(t,"blendMode",r.NORMAL),o.visible=n(t,"visible",!0),e&&this.scene.sys.displayList.add(o),o})},96019(t,e,i){var r=i(76573);i(39429).register("spriteGPULayer",function(t,e){return this.displayList.add(new r(this.scene,t,e))})},71238(t,e,i){var r=i(29747),s=i(97591),n=r;t.exports={renderWebGL:s,renderCanvas:n}},97591(t){t.exports=function(t,e,i,r){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i)}},14727(t,e,i){var r=i(78705),s=i(83419),n=i(88571),a=i(74759),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.type="Stamp"},_defaultRenderNodesMap:{get:function(){return r}}});t.exports=o},656(t,e,i){var r=new(i(61340));t.exports=function(t,e,i){i.addToRenderList(e),r.copyFrom(i.matrix),i.matrix.loadIdentity();var s=i.scrollX,n=i.scrollY;i.scrollX=0,i.scrollY=0,t.batchSprite(e,e.frame,i),i.scrollX=s,i.scrollY=n,i.matrix.copyFrom(r)}},31479(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(14727);s.register("stamp",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=n(t,"frame",null),o=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,o,t),o})},85326(t,e,i){var r=i(14727);i(39429).register("stamp",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},74759(t,e,i){var r=i(29747);r=i(656),t.exports={renderCanvas:r}},14220(t){t.exports=function(t,e,i){var r=t.canvas,s=t.context,n=t.style,a=[],o=0,h=i.length;n.maxLines>0&&n.maxLines<i.length&&(h=n.maxLines),n.syncFont(r,s);for(var l=t.letterSpacing,u=0;u<h;u++){var d=n.strokeThickness;if(0===l)d+=s.measureText(i[u]).width;else{for(var c=i[u],f=0;f<c.length;f++)d+=s.measureText(c[f]).width;c.length>1&&(d+=l*(c.length-1))}n.wordWrap&&(d-=s.measureText(" ").width),a[u]=Math.ceil(d),o=Math.max(o,a[u])}var p=e.fontSize+n.strokeThickness,g=p*h,m=t.lineSpacing;return h>1&&(g+=m*(h-1)),{width:o,height:g,lines:h,lineWidths:a,lineSpacing:m,lineHeight:p}}},79557(t,e,i){var r=i(27919);t.exports=function(t){var e=r.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var s=i.measureText(t.testString);if("actualBoundingBoxAscent"in s){var n=s.actualBoundingBoxAscent,a=s.actualBoundingBoxDescent;return r.remove(e),{ascent:n,descent:a,fontSize:n+a}}var o=Math.ceil(s.width*t.baselineX),h=o,l=2*h;h=h*t.baselineY|0,e.width=o,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,o,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},d=i.getImageData(0,0,o,l);if(!d)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,r.remove(e),u;var c,f,p=d.data,g=p.length,m=4*o,v=0,y=!1;for(c=0;c<h;c++){for(f=0;f<m;f+=4)if(255!==p[v+f]){y=!0;break}if(y)break;v+=m}for(u.ascent=h-c,v=g-m,y=!1,c=l;c>h;c--){for(f=0;f<m;f+=4)if(255!==p[v+f]){y=!0;break}if(y)break;v-=m}return u.descent=c-h,u.fontSize=u.ascent+u.descent,r.remove(e),u}},50171(t,e,i){var r=i(40366),s=i(27919),n=i(40939),a=i(83419),o=i(31401),h=i(95643),l=i(14220),u=i(35154),d=i(35846),c=i(61771),f=i(35762),p=i(45650),g=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Tint,o.Transform,o.Visible,c],initialize:function(t,e,i,r,n){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initRenderNodes(this._defaultRenderNodesMap),this.canvas=s.create(this),this.context,this.style=new f(this,n),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.letterSpacing=0,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this._textureKey=p(),this.texture=t.sys.textures.addCanvas(this._textureKey,this.canvas),this.context=this.texture.context,this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(r),n&&n.padding&&this.setPadding(n.padding),n&&n.lineSpacing&&this.setLineSpacing(n.lineSpacing),n&&n.letterSpacing&&this.setLetterSpacing(n.letterSpacing)},_defaultRenderNodesMap:{get:function(){return n}},initRTL:function(){if(!this.style.rtl)return this.canvas.dir="ltr",void(this.context.direction="ltr");this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",r(this.canvas,this.scene.sys.canvas),this.originX=1},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var r="",s=t.replace(/ +/gi," ").split(this.splitRegExp),n=s.length,a=0;a<n;a++){var o=s[a],h="",l=(o=o.replace(/^ *|\s*$/gi,"")).length*this.letterSpacing;if(e.measureText(o).width+l<i)r+=o+"\n";else{for(var u=i,d=o.split(" "),c=0;c<d.length;c++){var f=d[c],p=f+" ",g=p.length*this.letterSpacing,m=e.measureText(p).width+g;if(m>u){if(0===c){for(var v=p;v.length;){var y=(v=v.slice(0,-1)).length*this.letterSpacing;if((m=e.measureText(v).width+y)<=u)break}if(!v.length)throw new Error("wordWrapWidth < a single character");var x=f.substr(v.length);d[c]=x,h+=v}var T=d[c].length?c:c+1,w=d.slice(T).join(" ").replace(/[ \n]*$/gi,"");s.splice(a+1,0,w),n=s.length;break}h+=p,u-=m}r+=h.replace(/[ \n]*$/gi,"")+"\n"}}return r=r.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var r="",s=t.split(this.splitRegExp),n=s.length-1,a=e.measureText(" ").width,o=0;o<=n;o++){for(var h=i,l=s[o].split(" "),u=l.length-1,d=0;d<=u;d++){var c=l[d],f=c.length*this.letterSpacing,p=e.measureText(c).width+f,g=p;d<u&&(g+=a),g>h&&d>0&&(r+="\n",h=i),r+=c,d<u?(r+=" ",h-=g):h-=p}o<n&&(r+="\n")}return r},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},appendText:function(t,e){void 0===e&&(e=!0),t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t=t.toString();var i=this._text.concat(e?"\n"+t:t);return i!==this._text&&(this._text=i,this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,r,s,n){return this.style.setShadow(t,e,i,r,s,n)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setLetterSpacing:function(t){return this.letterSpacing=t,this.updateText()},setPadding:function(t,e,i,r){if("object"==typeof t){var s=t,n=u(s,"x",null);null!==n?(t=n,i=n):(t=u(s,"left",0),i=u(s,"right",t));var a=u(s,"y",null);null!==a?(e=a,r=a):(e=u(s,"top",0),r=u(s,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===r&&(r=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=r,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},setRTL:function(t){void 0===t&&(t=!0);var e=this.style;return e.rtl===t||(e.rtl=t,t?(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",r(this.canvas,this.scene.sys.canvas)):(this.canvas.dir="ltr",this.context.direction="ltr"),"left"===e.align?e.align="right":"right"===e.align&&(e.align="left")),this},updateText:function(){var t=this.canvas,e=this.context,i=this.style,r=i.resolution,s=i.metrics;i.syncFont(t,e);var n=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(n=this.runWordWrap(this._text));var a,o=n.split(this.splitRegExp),h=l(this,s,o),u=this.padding;0===i.fixedWidth?(this.width=h.width+u.left+u.right,a=h.width):(this.width=i.fixedWidth,(a=this.width-u.left-u.right)<h.width&&(a=h.width)),0===i.fixedHeight?this.height=h.height+u.top+u.bottom:this.height=i.fixedHeight;var d,c,f=this.width,p=this.height;this.updateDisplayOrigin(),f*=r,p*=r,f=Math.max(f,1),p=Math.max(p,1),t.width!==f||t.height!==p?(t.width=f,t.height=p,this.frame.setSize(f,p),this.frame.source.updateSize(f,p),this.frame.source.resolution=r,this.frame.updateUVs(),i.syncFont(t,e),i.rtl&&(e.direction="rtl")):e.clearRect(0,0,f,p),e.save(),e.scale(r,r),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,f,p)),i.syncStyle(t,e),e.translate(u.left,u.top);for(var g=0;g<h.lines;g++){if(d=i.strokeThickness/2,c=i.strokeThickness/2+g*h.lineHeight+s.ascent,g>0&&(c+=h.lineSpacing*g),i.rtl)d=f-d-u.left-u.right;else if("right"===i.align)d+=a-h.lineWidths[g];else if("center"===i.align)d+=(a-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var m=h.width-h.lineWidths[g],v=e.measureText(" ").width,y=o[g].trim(),x=y.split(" ");m+=(o[g].length-y.length)*v;for(var T=Math.floor(m/v),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;o[g]=x.join(" ")}}this.autoRound&&(d=Math.round(d),c=Math.round(c));var b=this.letterSpacing;if(i.strokeThickness&&0===b&&(i.syncShadow(e,i.shadowStroke),e.strokeText(o[g],d,c)),i.color)if(i.syncShadow(e,i.shadowFill),0!==b)for(var S=0,C=o[g].split(""),E=0;E<C.length;E++)i.strokeThickness&&(i.syncShadow(e,i.shadowStroke),e.strokeText(C[E],d+S,c),i.syncShadow(e,i.shadowFill)),e.fillText(C[E],d+S,c),S+=e.measureText(C[E]).width+b;else e.fillText(o[g],d,c)}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0));var A=this.input;return A&&!A.customHitArea&&(A.hitArea.width=this.width,A.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){d(this.canvas),s.remove(this.canvas);var t=this.texture;t&&t.destroy()}});t.exports=g},79724(t){t.exports=function(t,e,i,r){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,r))}},71259(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(50171);s.register("text",function(t,e){void 0===t&&(t={});var i=n(t,"text",""),s=n(t,"style",null),o=n(t,"padding",null);null!==o&&(s.padding=o);var h=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,h,t),h.autoRound=n(t,"autoRound",!0),h.resolution=n(t,"resolution",1),h})},68005(t,e,i){var r=i(50171);i(39429).register("text",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},61771(t,e,i){var r=i(29747),s=r,n=r;s=i(34397),n=i(79724),t.exports={renderWebGL:s,renderCanvas:n}},35762(t,e,i){var r=i(83419),s=i(23568),n=i(35154),a=i(79557),o={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new r({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0)},setStyle:function(t,e,i){for(var r in void 0===e&&(e=!0),void 0===i&&(i=!1),o){var h=i?o[r][1]:this[r];"wordWrapCallback"===r||"wordWrapCallbackScope"===r?this[r]=n(t,o[r][0],h):t&&"fontSize"===r&&"number"==typeof t.fontSize?this[r]=t.fontSize.toString()+"px":this[r]=s(t,o[r][0],h)}var l=n(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=n(t,"fill",null);null!==u&&(this.color=u);var d=n(t,"metrics",!1);return d?this.metrics={ascent:n(d,"ascent",0),descent:n(d,"descent",0),fontSize:n(d,"fontSize",0)}:!e&&this.metrics||(this.metrics=a(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,r="",s="";if("string"!=typeof t)i=n(t,"fontFamily","Courier"),r=n(t,"fontSize","16px"),s=n(t,"fontStyle","");else{var a=t.split(" "),o=0;s=a.length>2?a[o++]:"",r=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&r===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=r,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===r&&(r=0),void 0===s&&(s=!1),void 0===n&&(n=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=r,this.shadowStroke=s,this.shadowFill=n,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397(t){t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},20839(t,e,i){var r=i(9674),s=i(27919),n=i(41571),a=i(83419),o=i(31401),h=i(95643),l=i(68703),u=i(56295),d=i(45650),c=i(26099),f=new a({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Lighting,o.Mask,o.Origin,o.RenderNodes,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,n,a,o,l){var u=t.sys.renderer,f=u&&!u.gl;h.call(this,t,"TileSprite");var p=t.sys.textures.get(o).get(l);n=n?Math.floor(n):p.width,a=a?Math.floor(a):p.height,this._tilePosition=new c,this._tileScale=new c(1,1),this._tileRotation=0,this.dirty=!1,this.renderer=u,this.canvas=f?s.create(this,n,a):null,this.context=f?this.canvas.getContext("2d",{willReadFrequently:!1}):null,this._displayTextureKey=d(),this.displayTexture=f?t.sys.textures.addCanvas(this._displayTextureKey,this.canvas):null,this.displayFrame=this.displayTexture?this.displayTexture.get():null,this.currentFrame=null,this.fillCanvas=f?s.create2D(this,p.width,this.displayFrame.height):null,this.fillContext=this.fillCanvas?this.fillCanvas.getContext("2d",{willReadFrequently:!1}):null,this.fillPattern=null,this.anims=new r(this),this.setTexture(o,l),this.setPosition(e,i),this.setSize(n,a),this.setOrigin(.5,.5),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return n}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},setFrame:function(t){var e=this.texture.get(t);return e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.frame=e,this.dirty=!0,this},setSizeToFrame:function(){return this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileRotation:function(t){return void 0===t&&(t=0),this.tileRotation=t,this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.renderer&&!this.renderer.gl){var t=this.frame,e=this.fillContext,i=this.fillCanvas,r=t.cutWidth,s=t.cutHeight;e.clearRect(0,0,r,s),i.width=r,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,r,s),this.fillPattern=e.createPattern(i,"repeat"),this.currentFrame=t}},updateCanvas:function(){var t=this.canvas,e=this.width,i=this.height,r=this.currentFrame!==this.frame;if((t.width!==e||t.height!==i||r)&&(t.width=e,t.height=i,this.displayFrame.setSize(e,i),this.updateDisplayOrigin(),r&&this.updateTileTexture(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var s=this.context;this.scene.sys.game.config.antialias||l.disable(s);var n=this._tileScale.x,a=this._tileScale.y,o=this._tilePosition.x,h=this._tilePosition.y;s.clearRect(0,0,e,i),s.save(),s.rotate(this._tileRotation),s.scale(n,a),s.translate(-o,-h),s.fillStyle=this.fillPattern;var u=Math.max(e,Math.abs(e/n)),d=Math.max(i,Math.abs(i/a)),c=Math.sqrt(u*u+d*d);s.fillRect(o-c,h-c,2*c,2*c),s.restore(),this.dirty=!1}},setSize:function(t,e){this.width=t,this.height=e,this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},preDestroy:function(){this.canvas&&s.remove(this.canvas),this.fillCanvas&&s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.renderer=null,this.anims.destroy(),this.anims=void 0},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileRotation:{get:function(){return this._tileRotation},set:function(t){this._tileRotation=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=f},46992(t){t.exports=function(t,e,i,r){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.displayFrame,i,r)}},14167(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(20839);s.register("tileSprite",function(t,e){void 0===t&&(t={});var i=n(t,"x",0),s=n(t,"y",0),o=n(t,"width",512),h=n(t,"height",512),l=n(t,"key",""),u=n(t,"frame",""),d=new a(this.scene,i,s,o,h,l,u);return void 0!==e&&(t.add=e),r(this.scene,d,t),d})},91681(t,e,i){var r=i(20839);i(39429).register("tileSprite",function(t,e,i,s,n,a){return this.displayList.add(new r(this.scene,t,e,i,s,n,a))})},56295(t,e,i){var r=i(29747),s=r,n=r;s=i(18553),n=i(46992),t.exports={renderWebGL:s,renderCanvas:n}},18553(t){t.exports=function(t,e,i,r){var s=e.width,n=e.height;if(0!==s&&0!==n){i.camera.addToRenderList(e);var a=e.customRenderNodes,o=e.defaultRenderNodes;(a.Submitter||o.Submitter).run(i,e,r,0,a.Texturer||o.Texturer,a.Transformer||o.Transformer)}}},18471(t,e,i){var r=i(45319),s=i(40939),n=i(83419),a=i(31401),o=i(51708),h=i(8443),l=i(95643),u=i(36383),d=i(14463),c=i(45650),f=i(10247),p=new n({Extends:l,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Lighting,a.Mask,a.Origin,a.RenderNodes,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,f],initialize:function(t,e,i,r){l.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.glFlipY=!0,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._getFrame=!1,this._rfvCallbackId=0;var s=t.sys.game;this._device=s.device.video,this.setPosition(e,i),this.setSize(256,256),this.initRenderNodes(this._defaultRenderNodesMap),s.events.on(h.PAUSE,this.globalPause,this),s.events.on(h.RESUME,this.globalResume,this);var n=t.sys.sound;n&&n.on(d.GLOBAL_MUTE,this.globalMute,this),r&&this.load(r)},_defaultRenderNodesMap:{get:function(){return s}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,r,s){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,r,s))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var r=this._device.getVideoURL(t);return r?(this.cacheKey="",this.loadHandler(r.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,r){e||(e=!1);var s=this.video;if(s?(this.removeLoadEventHandlers(),this.stop()):((s=document.createElement("video")).controls=!1,s.setAttribute("playsinline","playsinline"),s.setAttribute("preload","auto"),s.setAttribute("disablePictureInPicture","true")),e?(s.muted=!0,s.defaultMuted=!0,s.setAttribute("autoplay","autoplay")):(s.muted=!1,s.defaultMuted=!1,s.removeAttribute("autoplay")),i?s.setAttribute("crossorigin",i):s.removeAttribute("crossorigin"),r)if("srcObject"in s)try{s.srcObject=r}catch(t){if("TypeError"!==t.name)throw t;s.src=URL.createObjectURL(r)}else s.src=URL.createObjectURL(r);else s.src=t;this.retry=0,this.video=s,this._playCalled=!1,s.load(),this.addLoadEventHandlers();var n=this.scene.sys.textures.get(this._key);return this.setTexture(n),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var r=e.width,s=e.height,n=this.videoTexture,a=this.videoTextureSource,h=!n||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,n?(a.source=i,a.width=r,a.height=s,n.get().setSize(r,s)):((n=this.scene.sys.textures.create(this._key,i,r,s)).add("__BASE",0,0,0,r,s),this.setTexture(n),this.videoTexture=n,this.videoTextureSource=n.source[0],this.videoTextureSource.setFlipY(this.glFlipY),this.emit(o.VIDEO_TEXTURE,this,n)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,r,s),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l<this._lastUpdate&&this.emit(o.VIDEO_LOOP,this),this._lastUpdate=l,this._getFrame?(this.removeEventHandlers(),i.pause(),this._getFrame=!1):this._rfvCallbackId=this.video.requestVideoFrameCallback(this.requestVideoFrame.bind(this))}},play:function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=u.MAX_SAFE_INTEGER);var r=this.video;return!r||this.isPlaying()?(r||console.warn("Video not loaded"),this):(void 0===t&&(t=r.loop),r.loop=t,this._markerIn=e,this._markerOut=i,this._playingMarker=e>-1&&i>e&&i<u.MAX_SAFE_INTEGER,this._playCalled||(this._getFrame=!1,this._rfvCallbackId=r.requestVideoFrameCallback(this.requestVideoFrame.bind(this)),this._playCalled=!0,this.createPlayPromise()),this)},getFirstFrame:function(){var t=this.video;return!t||this.isPlaying()?(t||console.warn("Video not loaded"),this):(this._playCalled||(this._getFrame=!0,this._rfvCallbackId=t.requestVideoFrameCallback(this.requestVideoFrame.bind(this)),this.createPlayPromise()),this)},addLoadEventHandlers:function(){var t=this.video;t&&(t.addEventListener("error",this._loadCallbackHandler),t.addEventListener("abort",this._loadCallbackHandler),t.addEventListener("loadedmetadata",this._metadataCallbackHandler))},removeLoadEventHandlers:function(){var t=this.video;t&&(t.removeEventListener("error",this._loadCallbackHandler),t.removeEventListener("abort",this._loadCallbackHandler))},addEventHandlers:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.addEventListener(i,e[i])}},removeEventHandlers:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i])}},createPlayPromise:function(t){void 0===t&&(t=!0);var e=this.video,i=e.play();if(void 0!==i){var r=this.playSuccess.bind(this),s=this.playError.bind(this);if(!t){var n=this;s=function(){n.failedPlayAttempts++}}i.then(r).catch(s)}else e.addEventListener("playing",this._callbacks.legacy),t||this.failedPlayAttempts++},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),void 0===s&&(s=i),void 0===n&&(n=r);var a=this.video,o=this.snapshotTexture;return o?(o.setSize(s,n),a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)):(o=this.scene.sys.textures.createCanvas(c(),s,n),this.snapshotTexture=o,a&&o.context.drawImage(a,t,e,i,r,0,0,s,n)),o.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var r=i*t;this.setCurrentTime(r)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],r=parseFloat(t.substr(1));"+"===i?t=e.currentTime+r:"-"===i&&(t=e.currentTime-r)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!0),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.glFlipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(h.PAUSE,this.globalPause,this),t.off(h.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(d.GLOBAL_MUTE,this.globalMute,this)}});t.exports=p},58352(t){t.exports=function(t,e,i,r){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,r))}},11511(t,e,i){var r=i(25305),s=i(44603),n=i(23568),a=i(18471);s.register("video",function(t,e){void 0===t&&(t={});var i=n(t,"key",null),s=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},89025(t,e,i){var r=i(18471);i(39429).register("video",function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))})},10247(t,e,i){var r=i(29747),s=r,n=r;s=i(29849),n=i(58352),t.exports={renderWebGL:s,renderCanvas:n}},29849(t){t.exports=function(t,e,i,r){if(e.videoTexture){i.camera.addToRenderList(e);var s=e.customRenderNodes,n=e.defaultRenderNodes;(s.Submitter||n.Submitter).run(i,e,r,0,s.Texturer||n.Texturer,s.Transformer||n.Transformer)}}},41481(t,e,i){var r=i(10312),s=i(96503),n=i(87902),a=i(83419),o=i(31401),h=i(95643),l=i(87841),u=i(37303),d=new a({Extends:h,Mixins:[o.Depth,o.GetBounds,o.Origin,o.Transform,o.ScrollFactor,o.Visible],initialize:function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=s),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=s,this.height=n,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var r=this.input;return i&&r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new s(0,0,t),n)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.camera.addToRenderList(e)}});t.exports=d},95261(t,e,i){var r=i(44603),s=i(23568),n=i(41481);r.register("zone",function(t){var e=s(t,"x",0),i=s(t,"y",0),r=s(t,"width",1),a=s(t,"height",r);return new n(this.scene,e,i,r,a)})},84175(t,e,i){var r=i(41481);i(39429).register("zone",function(t,e,i,s){return this.displayList.add(new r(this.scene,t,e,i,s))})},95166(t){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503(t,e,i){var r=i(83419),s=i(87902),n=i(26241),a=i(79124),o=i(23777),h=i(28176),l=new r({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562(t){t.exports=function(t){return Math.PI*t.radius*2}},92110(t,e,i){var r=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new r),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250(t,e,i){var r=i(96503);t.exports=function(t){return new r(t.x,t.y,t.radius)}},87902(t){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)}},70588(t,e,i){var r=i(87902);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},26394(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241(t,e,i){var r=i(92110),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},79124(t,e,i){var r=i(71562),s=i(92110),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;h<e;h++){var l=n(h/e,0,a.TAU);o.push(s(t,l))}return o}},50884(t){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},39212(t){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},28176(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),n=s>1?2-s:s,a=n*Math.cos(i),o=n*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},88911(t,e,i){var r=i(96503);r.Area=i(95166),r.Circumference=i(71562),r.CircumferencePoint=i(92110),r.Clone=i(42250),r.Contains=i(87902),r.ContainsPoint=i(5698),r.ContainsRect=i(70588),r.CopyFrom=i(26394),r.Equals=i(76278),r.GetBounds=i(2074),r.GetPoint=i(26241),r.GetPoints=i(79124),r.Offset=i(50884),r.OffsetPoint=i(39212),r.Random=i(28176),t.exports=r},23777(t){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874(t){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990(t){t.exports=function(t){var e=t.width/2,i=t.height/2,r=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*r/(10+Math.sqrt(4-3*r)))}},79522(t,e,i){var r=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=t.width/2,n=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+n*Math.sin(e),i}},58102(t,e,i){var r=i(8497);t.exports=function(t){return new r(t.x,t.y,t.width,t.height)}},81154(t){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var r=(e-t.x)/t.width,s=(i-t.y)/t.height;return(r*=r)+(s*=s)<.25}},46662(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)}},1632(t,e,i){var r=i(81154);t.exports=function(t,e){return r(t,e.x,e.y)&&r(t,e.right,e.y)&&r(t,e.x,e.bottom)&&r(t,e.right,e.bottom)}},65534(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497(t,e,i){var r=i(83419),s=i(81154),n=i(90549),a=i(48320),o=i(23777),h=i(24820),l=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694(t,e,i){var r=i(87841);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549(t,e,i){var r=i(79522),s=i(62945),n=i(36383),a=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,n.TAU);return r(t,o,i)}},48320(t,e,i){var r=i(92990),s=i(79522),n=i(62945),a=i(36383);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&i>0&&(e=r(t)/i);for(var h=0;h<e;h++){var l=n(h/e,0,a.TAU);o.push(s(t,l))}return o}},73424(t){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},44808(t){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},24820(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},49203(t,e,i){var r=i(8497);r.Area=i(78874),r.Circumference=i(92990),r.CircumferencePoint=i(79522),r.Clone=i(58102),r.Contains=i(81154),r.ContainsPoint=i(46662),r.ContainsRect=i(1632),r.CopyFrom=i(65534),r.Equals=i(36146),r.GetBounds=i(23694),r.GetPoint=i(90549),r.GetPoints=i(48320),r.Offset=i(73424),r.OffsetPoint=i(44808),r.Random=i(24820),t.exports=r},55738(t,e,i){var r=i(23777),s=i(79291),n={Circle:i(88911),Ellipse:i(49203),Intersects:i(91865),Line:i(2529),Polygon:i(58423),Rectangle:i(93232),Triangle:i(84435)};n=s(!1,n,r),t.exports=n},2044(t,e,i){var r=i(20339);t.exports=function(t,e){return r(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},81491(t){t.exports=function(t,e){var i=e.width/2,r=e.height/2,s=Math.abs(t.x-e.x-i),n=Math.abs(t.y-e.y-r),a=i+t.radius,o=r+t.radius;if(s>a||n>o)return!1;if(s<=i||n<=r)return!0;var h=s-i,l=n-r;return h*h+l*l<=t.radius*t.radius}},63376(t,e,i){var r=i(26099),s=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o,h,l=t.x,u=t.y,d=t.radius,c=e.x,f=e.y,p=e.radius;if(u===f)0===(o=(a=-2*f)*a-4*(n=1)*(c*c+(h=(p*p-d*d-c*c+l*l)/(2*(l-c)))*h-2*c*h+f*f-p*p))?i.push(new r(h,-a/(2*n))):o>0&&(i.push(new r(h,(-a+Math.sqrt(o))/(2*n))),i.push(new r(h,(-a-Math.sqrt(o))/(2*n))));else{var g=(l-c)/(u-f),m=(p*p-d*d-c*c+l*l-f*f+u*u)/(2*(u-f));0===(o=(a=2*u*g-2*m*g-2*l)*a-4*(n=g*g+1)*(l*l+u*u+m*m-d*d-2*u*m))?(h=-a/(2*n),i.push(new r(h,m-h*g))):o>0&&(h=(-a+Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)),h=(-a-Math.sqrt(o))/(2*n),i.push(new r(h,m-h*g)))}}return i}},97439(t,e,i){var r=i(4042),s=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC(),h=e.getLineD();r(n,t,i),r(a,t,i),r(o,t,i),r(h,t,i)}return i}},4042(t,e,i){var r=i(26099),s=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n,a,o=t.x1,h=t.y1,l=t.x2,u=t.y2,d=e.x,c=e.y,f=e.radius,p=l-o,g=u-h,m=o-d,v=h-c,y=p*p+g*g,x=2*(p*m+g*v),T=x*x-4*y*(m*m+v*v-f*f);if(0===T){var w=-x/(2*y);n=o+w*p,a=h+w*g,w>=0&&w<=1&&i.push(new r(n,a))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);n=o+b*p,a=h+b*g,b>=0&&b<=1&&i.push(new r(n,a));var S=(-x+Math.sqrt(T))/(2*y);n=o+S*p,a=h+S*g,S>=0&&S<=1&&i.push(new r(n,a))}}return i}},36100(t,e,i){var r=i(25836);t.exports=function(t,e,i,s){void 0===i&&(i=!1);var n,a,o,h=t.x1,l=t.y1,u=t.x2,d=t.y2,c=e.x1,f=e.y1,p=u-h,g=d-l,m=e.x2-c,v=e.y2-f,y=p*v-g*m;if(0===y)return null;if(i){if(n=(p*(f-l)+g*(h-c))/(m*g-v*p),0!==p)a=(c+m*n-h)/p;else{if(0===g)return null;a=(f+v*n-l)/g}if(a<0||n<0||n>1)return null;o=a}else{if(a=((l-f)*p-(h-c)*g)/y,(n=((c-h)*v-(f-l)*m)/y)<0||n>1||a<0||a>1)return null;o=n}return void 0===s&&(s=new r),s.set(h+p*o,l+g*o,o)}},3073(t,e,i){var r=i(36100),s=i(23031),n=i(25836),a=new s,o=new n;t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=new n);var h=!1;s.set(),o.set();for(var l=e[e.length-1],u=0;u<e.length;u++){var d=e[u];a.setTo(l.x,l.y,d.x,d.y),l=d,r(t,a,i,o)&&(!h||o.z<s.z)&&(s.copy(o),h=!0)}return h?s:null}},56362(t,e,i){var r=i(25836),s=i(61369),n=i(3073),a=new r;t.exports=function(t,e,i,r){void 0===r&&(r=new s),Array.isArray(e)||(e=[e]);var o=!1;r.set(),a.set();for(var h=0;h<e.length;h++)n(t,e[h].points,i,a)&&(!o||a.z<r.z)&&(r.set(a.x,a.y,a.z,h),o=!0);return o?r:null}},60646(t,e,i){var r=i(26099),s=i(76112),n=i(92773);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var a=e.getLineA(),o=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new r,new r,new r,new r],d=[s(a,t,u[0]),s(o,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],c=0;c<4;c++)d[c]&&i.push(u[c]);return i}},71147(t,e,i){var r=i(61369),s=i(56362),n=new(i(23031));function a(t,e,i,a,o){var h=Math.cos(t),l=Math.sin(t);n.setTo(e,i,e+h,i+l);var u=s(n,a,!0);u&&o.push(new r(u.x,u.y,t,u.w))}function o(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var r=[],s=[],n=0;n<i.length;n++)for(var h=i[n].points,l=0;l<h.length;l++){var u=Math.atan2(h[l].y-e,h[l].x-t);-1===s.indexOf(u)&&(a(u,t,e,i,r),a(u-1e-5,t,e,i,r),a(u+1e-5,t,e,i,r),s.push(u))}return r.sort(o)}},68389(t,e,i){var r=i(87841),s=i(59996);t.exports=function(t,e,i){return void 0===i&&(i=new r),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},52784(t,e,i){var r=i(60646),s=i(59996);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=t.getLineA(),a=t.getLineB(),o=t.getLineC(),h=t.getLineD();r(n,e,i),r(a,e,i),r(o,e,i),r(h,e,i)}return i}},26341(t,e,i){var r=i(89265),s=i(60646);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC();s(n,t,i),s(a,t,i),s(o,t,i)}return i}},38720(t,e,i){var r=i(4042),s=i(67636);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();r(n,e,i),r(a,e,i),r(o,e,i)}return i}},13882(t,e,i){var r=i(26099),s=i(2822),n=i(76112);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e))for(var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=[new r,new r,new r],u=[n(a,e,l[0]),n(o,e,l[1]),n(h,e,l[2])],d=0;d<3;d++)u[d]&&i.push(l[d]);return i}},75636(t,e,i){var r=i(82944),s=i(13882);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var n=e.getLineA(),a=e.getLineB(),o=e.getLineC();s(t,n,i),s(t,a,i),s(t,o,i)}return i}},80462(t,e,i){var r=i(87902),s=new(i(26099));t.exports=function(t,e,i){if(void 0===i&&(i=s),r(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(r(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var n=t.x2-t.x1,a=t.y2-t.y1,o=e.x-t.x1,h=e.y-t.y1,l=n*n+a*a,u=n,d=a;if(l>0){var c=(o*n+h*a)/l;u*=c,d*=c}return i.x=t.x1+u,i.y=t.y1+d,u*u+d*d<=l&&u*n+d*a>=0&&r(e,i.x,i.y)}},76112(t){t.exports=function(t,e,i){var r=t.x1,s=t.y1,n=t.x2,a=t.y2,o=e.x1,h=e.y1,l=e.x2,u=e.y2;if(r===n&&s===a||o===l&&h===u)return!1;var d=(u-h)*(n-r)-(l-o)*(a-s);if(0===d)return!1;var c=((l-o)*(s-h)-(u-h)*(r-o))/d,f=((n-r)*(s-h)-(a-s)*(r-o))/d;return!(c<0||c>1||f<0||f>1)&&(i&&(i.x=r+c*(n-r),i.y=s+c*(a-s)),!0)}},92773(t){t.exports=function(t,e){var i=t.x1,r=t.y1,s=t.x2,n=t.y2,a=e.x,o=e.y,h=e.right,l=e.bottom,u=0;if(i>=a&&i<=h&&r>=o&&r<=l||s>=a&&s<=h&&n>=o&&n<=l)return!0;if(i<a&&s>=a){if((u=r+(n-r)*(a-i)/(s-i))>o&&u<=l)return!0}else if(i>h&&s<=h&&(u=r+(n-r)*(h-i)/(s-i))>=o&&u<=l)return!0;if(r<o&&n>=o){if((u=i+(s-i)*(o-r)/(n-r))>=a&&u<=h)return!0}else if(r>l&&n<=l&&(u=i+(s-i)*(l-r)/(n-r))>=a&&u<=h)return!0;return!1}},16204(t){t.exports=function(t,e,i){void 0===i&&(i=1);var r=e.x1,s=e.y1,n=e.x2,a=e.y2,o=t.x,h=t.y,l=(n-r)*(n-r)+(a-s)*(a-s);if(0===l)return!1;var u=((o-r)*(n-r)+(h-s)*(a-s))/l;if(u<0)return Math.sqrt((r-o)*(r-o)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var d=((s-h)*(n-r)-(r-o)*(a-s))/l;return Math.abs(d)*Math.sqrt(l)<=i}return Math.sqrt((n-o)*(n-o)+(a-h)*(a-h))<=i}},14199(t,e,i){var r=i(16204);t.exports=function(t,e){if(!r(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),n=Math.min(e.y1,e.y2),a=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=n&&t.y<=a}},59996(t){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0)&&!(t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},89265(t,e,i){var r=i(76112),s=i(37303),n=i(48653),a=i(77493);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),o=e.getLineB(),h=e.getLineC();if(s(t,i.x1,i.y1)||s(t,i.x2,i.y2))return!0;if(s(t,o.x1,o.y1)||s(t,o.x2,o.y2))return!0;if(s(t,h.x1,h.y1)||s(t,h.x2,h.y2))return!0;var l=t.getLineA(),u=t.getLineB(),d=t.getLineC(),c=t.getLineD();if(r(i,l)||r(i,u)||r(i,d)||r(i,c))return!0;if(r(o,l)||r(o,u)||r(o,d)||r(o,c))return!0;if(r(h,l)||r(h,u)||r(h,d)||r(h,c))return!0;var f=a(t);return n(e,f,!0).length>0}},84411(t){t.exports=function(t,e,i,r,s,n){return void 0===n&&(n=0),!(e>t.right+n||i<t.left-n||r>t.bottom+n||s<t.top-n)}},67636(t,e,i){var r=i(80462),s=i(10690);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)&&(!!s(t,e.x,e.y)||(!!r(t.getLineA(),e)||(!!r(t.getLineB(),e)||!!r(t.getLineC(),e))))}},2822(t,e,i){var r=i(76112);t.exports=function(t,e){return!(!t.contains(e.x1,e.y1)&&!t.contains(e.x2,e.y2))||(!!r(t.getLineA(),e)||(!!r(t.getLineB(),e)||!!r(t.getLineC(),e)))}},82944(t,e,i){var r=i(48653),s=i(71694),n=i(76112);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),a=t.getLineB(),o=t.getLineC(),h=e.getLineA(),l=e.getLineB(),u=e.getLineC();if(n(i,h)||n(i,l)||n(i,u))return!0;if(n(a,h)||n(a,l)||n(a,u))return!0;if(n(o,h)||n(o,l)||n(o,u))return!0;var d=s(t),c=r(e,d,!0);return c.length>0||(d=s(e),(c=r(t,d,!0)).length>0)}},91865(t,e,i){t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938(t){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993(t){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var r=Math.round(t.x1),s=Math.round(t.y1),n=Math.round(t.x2),a=Math.round(t.y2),o=Math.abs(n-r),h=Math.abs(a-s),l=r<n?1:-1,u=s<a?1:-1,d=o-h;i.push({x:r,y:s});for(var c=1;r!==n||s!==a;){var f=d<<1;f>-h&&(d-=h,r+=l),f<o&&(d+=o,s+=u),c%e===0&&i.push({x:r,y:s}),c++}return i}},36469(t){t.exports=function(t,e,i){var r=e-(t.x1+t.x2)/2,s=i-(t.y1+t.y2)/2;return t.x1+=r,t.y1+=s,t.x2+=r,t.y2+=s,t}},31116(t,e,i){var r=i(23031);t.exports=function(t){return new r(t.x1,t.y1,t.x2,t.y2)}},59944(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},59220(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},78177(t,e,i){var r=i(35001);t.exports=function(t,e,i){void 0===i&&(i=e);var s=r(t),n=t.x2-t.x1,a=t.y2-t.y1;return e&&(t.x1=t.x1-n/s*e,t.y1=t.y1-a/s*e),i&&(t.x2=t.x2+n/s*i,t.y2=t.y2+a/s*i),t}},26708(t,e,i){var r=i(52816),s=i(6113),n=i(26099);t.exports=function(t,e,i,a,o){void 0===a&&(a=0),void 0===o&&(o=[]);var h,l,u=[],d=t.x1,c=t.y1,f=t.x2-d,p=t.y2-c,g=s(e,o),m=i-1;for(h=0;h<m;h++)l=g(h/m),u.push(new n(d+f*l,c+p*l));if(l=g(1),u.push(new n(d+f*l,c+p*l)),a>0){var v=u[0],y=[v];for(h=1;h<u.length-1;h++){var x=u[h];r(v,x)>=a&&(y.push(x),v=x)}var T=u[u.length-1];return r(v,T)<a&&y.pop(),y.push(T),y}return u}},32125(t,e,i){var r=i(26099);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},99569(t,e,i){var r=i(26099);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=t.x1,n=t.y1,a=t.x2,o=t.y2,h=(a-s)*(a-s)+(o-n)*(o-n);if(0===h)return i;var l=((e.x-s)*(a-s)+(e.y-n)*(o-n))/h;return i.x=s+l*(a-s),i.y=n+l*(o-n),i}},34638(t,e,i){var r=i(36383),s=i(91938),n=i(26099);t.exports=function(t,e){void 0===e&&(e=new n);var i=s(t)-r.PI_OVER_2;return e.x=Math.cos(i),e.y=Math.sin(i),e}},13151(t,e,i){var r=i(26099);t.exports=function(t,e,i){return void 0===i&&(i=new r),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},15258(t,e,i){var r=i(35001),s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=r(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,u=0;u<e;u++){var d=u/e,c=a+(h-a)*d,f=o+(l-o)*d;n.push(new s(c,f))}return n}},26408(t){t.exports=function(t,e){var i=t.x1,r=t.y1,s=t.x2,n=t.y2,a=(s-i)*(s-i)+(n-r)*(n-r);if(0===a)return!1;var o=((r-e.y)*(s-i)-(i-e.x)*(n-r))/a;return Math.abs(o)*Math.sqrt(a)}},98770(t){t.exports=function(t){return Math.abs(t.y1-t.y2)}},35001(t){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},23031(t,e,i){var r=i(83419),s=i(13151),n=i(15258),a=i(23777),o=i(65822),h=i(26099),l=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=r},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return n(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=r,this},setFromObjects:function(t,e){return this.x1=t.x,this.y1=t.y,this.x2=e.x,this.y2=e.y,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795(t,e,i){var r=i(36383),s=i(15994),n=i(91938);t.exports=function(t){var e=n(t)-r.PI_OVER_2;return s(e,-Math.PI,Math.PI)}},52616(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.cos(s(t)-r.PI_OVER_2)}},87231(t,e,i){var r=i(36383),s=i(91938);t.exports=function(t){return Math.sin(s(t)-r.PI_OVER_2)}},89662(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165(t){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777(t,e,i){var r=i(91938),s=i(64795);t.exports=function(t,e){return 2*s(e)-Math.PI-r(t)}},39706(t,e,i){var r=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,s=(t.y1+t.y2)/2;return r(t,i,s,e)}},82585(t,e,i){var r=i(64400);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},64400(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,t}},62377(t){t.exports=function(t,e,i,r,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(r)*s,t.y2=i+Math.sin(r)*s,t}},71366(t){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809(t){t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529(t,e,i){var r=i(23031);r.Angle=i(91938),r.BresenhamPoints=i(84993),r.CenterOn=i(36469),r.Clone=i(31116),r.CopyFrom=i(59944),r.Equals=i(59220),r.Extend=i(78177),r.GetEasedPoints=i(26708),r.GetMidPoint=i(32125),r.GetNearestPoint=i(99569),r.GetNormal=i(34638),r.GetPoint=i(13151),r.GetPoints=i(15258),r.GetShortestDistance=i(26408),r.Height=i(98770),r.Length=i(35001),r.NormalAngle=i(64795),r.NormalX=i(52616),r.NormalY=i(87231),r.Offset=i(89662),r.PerpSlope=i(71165),r.Random=i(65822),r.ReflectAngle=i(69777),r.Rotate=i(39706),r.RotateAroundPoint=i(82585),r.RotateAroundXY=i(64400),r.SetToAngle=i(62377),r.Slope=i(71366),r.Width=i(10809),t.exports=r},12306(t,e,i){var r=i(25717);t.exports=function(t){return new r(t.points)}},63814(t){t.exports=function(t,e,i){for(var r=!1,s=-1,n=t.points.length-1;++s<t.points.length;n=s){var a=t.points[s].x,o=t.points[s].y,h=t.points[n].x,l=t.points[n].y;(o<=i&&i<l||l<=i&&i<o)&&e<(h-a)*(i-o)/(l-o)+a&&(r=!r)}return r}},99338(t,e,i){var r=i(63814);t.exports=function(t,e){return r(t,e.x,e.y)}},94811(t){"use strict";function e(t,e,r){r=r||2;var n,a,o,h,d,c,p,g=e&&e.length,m=g?e[0]*r:t.length,v=i(t,0,m,r,!0),y=[];if(!v||v.next===v.prev)return y;if(g&&(v=function(t,e,r,s){var n,a,o,h=[];for(n=0,a=e.length;n<a;n++)(o=i(t,e[n]*s,n<a-1?e[n+1]*s:t.length,s,!1))===o.next&&(o.steiner=!0),h.push(f(o));for(h.sort(l),n=0;n<h.length;n++)r=u(h[n],r);return r}(t,e,v,r)),t.length>80*r){n=o=t[0],a=h=t[1];for(var x=r;x<m;x+=r)(d=t[x])<n&&(n=d),(c=t[x+1])<a&&(a=c),d>o&&(o=d),c>h&&(h=c);p=0!==(p=Math.max(o-n,h-a))?32767/p:0}return s(v,y,r,n,a,p,0),y}function i(t,e,i,r,s){var n,a;if(s===A(t,e,i,r)>0)for(n=e;n<i;n+=r)a=S(n,t[n],t[n+1],a);else for(n=i-r;n>=e;n-=r)a=S(n,t[n],t[n+1],a);return a&&v(a,a.next)&&(C(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!v(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,l,u,d,f){if(t){!f&&d&&function(t,e,i,r){var s=t;do{0===s.z&&(s.z=c(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,r,s,n,a,o,h,l=1;do{for(i=t,t=null,n=null,a=0;i;){for(a++,r=i,o=0,e=0;e<l&&(o++,r=r.nextZ);e++);for(h=l;o>0||h>0&&r;)0!==o&&(0===h||!r||i.z<=r.z)?(s=i,i=i.nextZ,o--):(s=r,r=r.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;i=r}n.nextZ=null,l*=2}while(a>1)}(s)}(t,l,u,d);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,d?a(t,l,u,d):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),C(t),t=g.next,m=g.next;else if((t=g)===m){f?1===f?s(t=o(r(t),e,i),e,i,l,u,d,2):2===f&&h(t,e,i,l,u,d):s(r(t),e,i,l,u,d,1);break}}}function n(t){var e=t.prev,i=t,r=t.next;if(m(e,i,r)>=0)return!1;for(var s=e.x,n=i.x,a=r.x,o=e.y,h=i.y,l=r.y,u=s<n?s<a?s:a:n<a?n:a,d=o<h?o<l?o:l:h<l?h:l,c=s>n?s>a?s:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,g=r.next;g!==e;){if(g.x>=u&&g.x<=c&&g.y>=d&&g.y<=f&&p(s,o,n,h,a,l,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function a(t,e,i,r){var s=t.prev,n=t,a=t.next;if(m(s,n,a)>=0)return!1;for(var o=s.x,h=n.x,l=a.x,u=s.y,d=n.y,f=a.y,g=o<h?o<l?o:l:h<l?h:l,v=u<d?u<f?u:f:d<f?d:f,y=o>h?o>l?o:l:h>l?h:l,x=u>d?u>f?u:f:d>f?d:f,T=c(g,v,e,i,r),w=c(y,x,e,i,r),b=t.prevZ,S=t.nextZ;b&&b.z>=T&&S&&S.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=v&&b.y<=x&&b!==s&&b!==a&&p(o,u,h,d,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;S&&S.z<=w;){if(S.x>=g&&S.x<=y&&S.y>=v&&S.y<=x&&S!==s&&S!==a&&p(o,u,h,d,l,f,S.x,S.y)&&m(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function o(t,e,i){var s=t;do{var n=s.prev,a=s.next.next;!v(n,a)&&y(n,s,s.next,a)&&w(n,a)&&w(a,n)&&(e.push(n.i/i|0),e.push(s.i/i|0),e.push(a.i/i|0),C(s),C(s.next),s=t=a),s=s.next}while(s!==t);return r(s)}function h(t,e,i,n,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),s(h,e,i,n,a,o,0),void s(u,e,i,n,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,r=e,s=t.x,n=t.y,a=-1/0;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var o=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=s&&o>a&&(a=o,i=r.x<r.next.x?r:r.next,o===s))return i}r=r.next}while(r!==e);if(!i)return null;var h,l=i,u=i.x,c=i.y,f=1/0;r=i;do{s>=r.x&&r.x>=u&&s!==r.x&&p(n<c?s:a,n,u,c,n<c?a:s,n,r.x,r.y)&&(h=Math.abs(n-r.y)/(s-r.x),w(r,t)&&(h<f||h===f&&(r.x>i.x||r.x===i.x&&d(i,r)))&&(i=r,f=h)),r=r.next}while(r!==l);return i}(t,e);if(!i)return e;var s=b(i,t);return r(s,s.next),r(i,i.next)}function d(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function c(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function p(t,e,i,r,s,n,a,o){return(s-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(s-a)*(r-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||v(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,r){var s=T(m(t,e,i)),n=T(m(t,e,r)),a=T(m(i,r,t)),o=T(m(i,r,e));return s!==n&&a!==o||(!(0!==s||!x(t,i,e))||(!(0!==n||!x(t,r,e))||(!(0!==a||!x(i,t,r))||!(0!==o||!x(i,e,r)))))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new E(t.i,t.x,t.y),r=new E(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function S(t,e,i,r){var s=new E(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,r){for(var s=0,n=e,a=i-r;n<i;n+=r)s+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return s}e.deviation=function(t,e,i,r){var s=e&&e.length,n=s?e[0]*i:t.length,a=Math.abs(A(t,0,n,i));if(s)for(var o=0,h=e.length;o<h;o++){var l=e[o]*i,u=o<h-1?e[o+1]*i:t.length;a-=Math.abs(A(t,l,u,i))}var d=0;for(o=0;o<r.length;o+=3){var c=r[o]*i,f=r[o+1]*i,p=r[o+2]*i;d+=Math.abs((t[c]-t[p])*(t[f+1]-t[c+1])-(t[c]-t[f])*(t[p+1]-t[c+1]))}return 0===a&&0===d?0:Math.abs((d-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,s=0;s<t.length;s++){for(var n=0;n<t[s].length;n++)for(var a=0;a<e;a++)i.vertices.push(t[s][n][a]);s>0&&(r+=t[s-1].length,i.holes.push(r))}return i},t.exports=e},13829(t,e,i){var r=i(87841);t.exports=function(t,e){void 0===e&&(e=new r);for(var i,s=1/0,n=1/0,a=-s,o=-n,h=0;h<t.points.length;h++)i=t.points[h],s=Math.min(s,i.x),n=Math.min(n,i.y),a=Math.max(a,i.x),o=Math.max(o,i.y);return e.x=s,e.y=n,e.width=a-s,e.height=o-n,e}},26173(t){t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},9564(t,e,i){var r=i(35001),s=i(23031),n=i(30052);t.exports=function(t,e,i,a){void 0===a&&(a=[]);var o=t.points,h=n(t);!e&&i>0&&(e=h/i);for(var l=0;l<e;l++)for(var u=h*(l/e),d=0,c=0;c<o.length;c++){var f=o[c],p=o[(c+1)%o.length],g=new s(f.x,f.y,p.x,p.y),m=r(g);if(!(u<d||u>d+m)){var v=g.getPoint((u-d)/m);a.push(v);break}d+=m}return a}},30052(t,e,i){var r=i(35001),s=i(23031);t.exports=function(t){for(var e=t.points,i=0,n=0;n<e.length;n++){var a=e[n],o=e[(n+1)%e.length],h=new s(a.x,a.y,o.x,o.y);i+=r(h)}return i}},25717(t,e,i){var r=i(83419),s=i(63814),n=i(9564),a=i(23777),o=new r({initialize:function(t){this.type=a.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=0;i<t.length;i++)e={x:0,y:0},"number"==typeof t[i]||"string"==typeof t[i]?(e.x=parseFloat(t[i]),e.y=parseFloat(t[i+1]),i++):Array.isArray(t[i])?(e.x=t[i][0],e.y=t[i][1]):(e.x=t[i].x,e.y=t[i].y),this.points.push(e);return this.calculateArea(),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,r=0;r<this.points.length-1;r++)t=this.points[r],i+=((e=this.points[r+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area},getPoints:function(t,e,i){return n(this,t,e,i)}});t.exports=o},8133(t){t.exports=function(t){return t.points.reverse(),t}},29524(t){function e(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r}function i(t,e,i){var r=e.x,s=e.y,n=i.x-r,a=i.y-s;if(0!==n||0!==a){var o=((t.x-r)*n+(t.y-s)*a)/(n*n+a*a);o>1?(r=i.x,s=i.y):o>0&&(r+=n*o,s+=a*o)}return(n=t.x-r)*n+(a=t.y-s)*a}function r(t,e,s,n,a){for(var o,h=n,l=e+1;l<s;l++){var u=i(t[l],t[e],t[s]);u>h&&(o=l,h=u)}h>n&&(o-e>1&&r(t,e,o,n,a),a.push(t[o]),s-o>1&&r(t,o,s,n,a))}function s(t,e){var i=t.length-1,s=[t[0]];return r(t,0,i,e,s),s.push(t[i]),s}t.exports=function(t,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var n=t.points;if(n.length>2){var a=i*i;r||(n=function(t,i){for(var r,s=t[0],n=[s],a=1,o=t.length;a<o;a++)e(r=t[a],s)>i&&(n.push(r),s=r);return s!==r&&n.push(r),n}(n,a)),t.setTo(s(n,a))}return t}},5469(t){var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,r=[],s=t.points;for(i=0;i<s.length;i++)r.push([s[i].x,s[i].y]);var n=[];for(r.length>0&&n.push(e([0,0],r[0])),i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],h=a[0],l=a[1],u=o[0],d=o[1];n.push([.85*h+.15*u,.85*l+.15*d]),n.push([.15*h+.85*u,.15*l+.85*d])}return r.length>1&&n.push(e([0,0],r[r.length-1])),t.setTo(n)}},24709(t){t.exports=function(t,e,i){for(var r=t.points,s=0;s<r.length;s++)r[s].x+=e,r[s].y+=i;return t}},58423(t,e,i){var r=i(25717);r.Clone=i(12306),r.Contains=i(63814),r.ContainsPoint=i(99338),r.Earcut=i(94811),r.GetAABB=i(13829),r.GetNumberArray=i(26173),r.GetPoints=i(9564),r.Perimeter=i(30052),r.Reverse=i(8133),r.Simplify=i(29524),r.Smooth=i(5469),r.Translate=i(24709),t.exports=r},39843(t){t.exports=function(t){return t.width*t.height}},98615(t){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},31688(t){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},67502(t){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},65085(t,e,i){var r=i(87841);t.exports=function(t){return new r(t.x,t.y,t.width,t.height)}},37303(t){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},96553(t,e,i){var r=i(37303);t.exports=function(t,e){return r(t,e.x,e.y)}},70273(t){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&(e.x>t.x&&e.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom)}},43459(t){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},77493(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},9219(t){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},53751(t,e,i){var r=i(8249);t.exports=function(t,e){var i=r(t);return i<r(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},16088(t,e,i){var r=i(8249);t.exports=function(t,e){var i=r(t);return i>r(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859(t){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217(t,e,i){var r=i(87841),s=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new r),0===t.length)return e;for(var i,n,a,o=Number.MAX_VALUE,h=Number.MAX_VALUE,l=s.MIN_SAFE_INTEGER,u=s.MIN_SAFE_INTEGER,d=0;d<t.length;d++)i=t[d],Array.isArray(i)?(n=i[0],a=i[1]):(n=i.x,a=i.y),o=Math.min(o,n),h=Math.min(h,a),l=Math.max(l,n),u=Math.max(u,a);return e.x=o,e.y=h,e.width=l-o,e.height=u-h,e}},9477(t,e,i){var r=i(87841);t.exports=function(t,e,i,s,n){return void 0===n&&(n=new r),n.setTo(Math.min(t,i),Math.min(e,s),Math.abs(t-i),Math.abs(e-s))}},8249(t){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},27165(t,e,i){var r=i(26099);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.centerX,e.y=t.centerY,e}},20812(t,e,i){var r=i(13019),s=i(26099);t.exports=function(t,e,i){if(void 0===i&&(i=new s),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var n=r(t)*e;return e>.5?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},34819(t,e,i){var r=i(20812),s=i(13019);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&i>0&&(e=s(t)/i);for(var a=0;a<e;a++){var o=a/e;n.push(r(t,o))}return n}},51313(t,e,i){var r=i(26099);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.width,e.y=t.height,e}},86091(t,e,i){var r=i(67502);t.exports=function(t,e,i){var s=t.centerX,n=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,s,n)}},53951(t,e,i){var r=i(87841),s=i(59996);t.exports=function(t,e,i){return void 0===i&&(i=new r),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},14649(t,e,i){var r=i(13019),s=i(26099);t.exports=function(t,e,i,n){if(void 0===n&&(n=[]),!e&&!i)return n;e?i=Math.round(r(t)/e):e=r(t)/i;for(var a=t.x,o=t.y,h=0,l=0;l<i;l++)switch(n.push(new s(a,o)),h){case 0:(a+=e)>=t.right&&(h=1,o+=a-t.right,a=t.right);break;case 1:(o+=e)>=t.bottom&&(h=2,a-=o-t.bottom,o=t.bottom);break;case 2:(a-=e)<=t.left&&(h=3,o-=t.left-a,a=t.left);break;case 3:(o-=e)<=t.top&&(h=0,o=t.top)}return n}},33595(t){t.exports=function(t,e){for(var i=t.x,r=t.right,s=t.y,n=t.bottom,a=0;a<e.length;a++)i=Math.min(i,e[a].x),r=Math.max(r,e[a].x),s=Math.min(s,e[a].y),n=Math.max(n,e[a].y);return t.x=i,t.y=s,t.width=r-i,t.height=n-s,t}},20074(t){t.exports=function(t,e){var i=Math.min(t.x,e.x),r=Math.max(t.right,e.right);t.x=i,t.width=r-i;var s=Math.min(t.y,e.y),n=Math.max(t.bottom,e.bottom);return t.y=s,t.height=n-s,t}},92171(t){t.exports=function(t,e,i){var r=Math.min(t.x,e),s=Math.max(t.right,e);t.x=r,t.width=s-r;var n=Math.min(t.y,i),a=Math.max(t.bottom,i);return t.y=n,t.height=a-n,t}},42981(t){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},46907(t){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},60170(t){t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},13019(t){t.exports=function(t){return 2*(t.width+t.height)}},85133(t,e,i){var r=i(26099),s=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new r),e=s(e);var n=Math.sin(e),a=Math.cos(e),o=a>0?t.width/2:t.width/-2,h=n>0?t.height/2:t.height/-2;return Math.abs(o*n)<Math.abs(h*a)?h=o*n/a:o=h*a/n,i.x=o+t.centerX,i.y=h+t.centerY,i}},26597(t,e,i){var r=i(26099);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},86470(t,e,i){var r=i(30976),s=i(70273),n=i(26099);t.exports=function(t,e,i){if(void 0===i&&(i=new n),s(t,e))switch(r(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},87841(t,e,i){var r=i(83419),s=i(37303),n=i(20812),a=i(34819),o=i(23777),h=i(23031),l=i(26597),u=new r({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},94845(t){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},31730(t){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},36899(t,e,i){var r=i(87841);t.exports=function(t,e,i){void 0===i&&(i=new r);var s=Math.min(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-s,o=Math.max(t.bottom,e.bottom)-n;return i.setTo(s,n,a,o)}},93232(t,e,i){var r=i(87841);r.Area=i(39843),r.Ceil=i(98615),r.CeilAll=i(31688),r.CenterOn=i(67502),r.Clone=i(65085),r.Contains=i(37303),r.ContainsPoint=i(96553),r.ContainsRect=i(70273),r.CopyFrom=i(43459),r.Decompose=i(77493),r.Equals=i(9219),r.FitInside=i(53751),r.FitOutside=i(16088),r.Floor=i(80774),r.FloorAll=i(83859),r.FromPoints=i(19217),r.FromXY=i(9477),r.GetAspectRatio=i(8249),r.GetCenter=i(27165),r.GetPoint=i(20812),r.GetPoints=i(34819),r.GetSize=i(51313),r.Inflate=i(86091),r.Intersection=i(53951),r.MarchingAnts=i(14649),r.MergePoints=i(33595),r.MergeRect=i(20074),r.MergeXY=i(92171),r.Offset=i(42981),r.OffsetPoint=i(46907),r.Overlaps=i(60170),r.Perimeter=i(13019),r.PerimeterPoint=i(85133),r.Random=i(26597),r.RandomOutside=i(86470),r.SameDimensions=i(94845),r.Scale=i(31730),r.Union=i(36899),t.exports=r},41658(t){t.exports=function(t){var e=t.x1,i=t.y1,r=t.x2,s=t.y2,n=t.x3,a=t.y3;return Math.abs(((n-e)*(s-i)-(r-e)*(a-i))/2)}},39208(t,e,i){var r=i(16483);t.exports=function(t,e,i){var s=i*(Math.sqrt(3)/2);return new r(t,e,t+i/2,e+s,t-i/2,e+s)}},39545(t,e,i){var r=i(94811),s=i(16483);t.exports=function(t,e,i,n,a){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===a&&(a=[]);for(var o,h,l,u,d,c,f,p,g,m=r(t,e),v=0;v<m.length;v+=3)o=m[v],h=m[v+1],l=m[v+2],u=t[2*o]*i,d=t[2*o+1]*n,c=t[2*h]*i,f=t[2*h+1]*n,p=t[2*l]*i,g=t[2*l+1]*n,a.push(new s(u,d,c,f,p,g));return a}},90301(t,e,i){var r=i(16483);t.exports=function(t,e,i,s){return void 0===s&&(s=i),new r(t,e,t,e-s,t+i,e)}},23707(t,e,i){var r=i(97523),s=i(13584);t.exports=function(t,e,i,n){void 0===n&&(n=r);var a=n(t),o=e-a.x,h=i-a.y;return s(t,o,h)}},97523(t,e,i){var r=i(26099);t.exports=function(t,e){return void 0===e&&(e=new r),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},24951(t,e,i){var r=i(26099);function s(t,e,i,r){return t*r-e*i}t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x3,n=t.y3,a=t.x1-i,o=t.y1-n,h=t.x2-i,l=t.y2-n,u=2*s(a,o,h,l),d=s(o,a*a+o*o,l,h*h+l*l),c=s(a,a*a+o*o,h,h*h+l*l);return e.x=i-d/u,e.y=n+c/u,e}},85614(t,e,i){var r=i(96503);t.exports=function(t,e){void 0===e&&(e=new r);var i,s,n=t.x1,a=t.y1,o=t.x2,h=t.y2,l=t.x3,u=t.y3,d=o-n,c=h-a,f=l-n,p=u-a,g=d*(n+o)+c*(a+h),m=f*(n+l)+p*(a+u),v=2*(d*(u-h)-c*(l-o));if(Math.abs(v)<1e-6){var y=Math.min(n,o,l),x=Math.min(a,h,u);i=.5*(Math.max(n,o,l)-y),s=.5*(Math.max(a,h,u)-x),e.x=y+i,e.y=x+s,e.radius=Math.sqrt(i*i+s*s)}else e.x=(p*g-c*m)/v,e.y=(d*m-f*g)/v,i=e.x-n,s=e.y-a,e.radius=Math.sqrt(i*i+s*s);return e}},74422(t,e,i){var r=i(16483);t.exports=function(t){return new r(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},10690(t){t.exports=function(t,e,i){var r=t.x3-t.x1,s=t.y3-t.y1,n=t.x2-t.x1,a=t.y2-t.y1,o=e-t.x1,h=i-t.y1,l=r*r+s*s,u=r*n+s*a,d=r*o+s*h,c=n*n+a*a,f=n*o+a*h,p=l*c-u*u,g=0===p?0:1/p,m=(c*d-u*f)*g,v=(l*f-u*d)*g;return m>=0&&v>=0&&m+v<1}},48653(t){t.exports=function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=[]);for(var s,n,a,o,h,l,u=t.x3-t.x1,d=t.y3-t.y1,c=t.x2-t.x1,f=t.y2-t.y1,p=u*u+d*d,g=u*c+d*f,m=c*c+f*f,v=p*m-g*g,y=0===v?0:1/v,x=t.x1,T=t.y1,w=0;w<e.length&&(n=(p*(l=c*(a=e[w].x-x)+f*(o=e[w].y-T))-g*(h=u*a+d*o))*y,!((s=(m*h-g*l)*y)>=0&&n>=0&&s+n<1&&(r.push({x:e[w].x,y:e[w].y}),i)));w++);return r}},96006(t,e,i){var r=i(10690);t.exports=function(t,e){return r(t,e.x,e.y)}},71326(t){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694(t){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522(t){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437(t,e,i){var r=i(26099),s=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new r);var n=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=n.x1,i.y=n.y1,i;var h=s(n),l=s(a),u=s(o),d=(h+l+u)*e,c=0;return d<h?(c=d/h,i.x=n.x1+(n.x2-n.x1)*c,i.y=n.y1+(n.y2-n.y1)*c):d>h+l?(c=(d-=h+l)/u,i.x=o.x1+(o.x2-o.x1)*c,i.y=o.y1+(o.y2-o.y1)*c):(c=(d-=h)/l,i.x=a.x1+(a.x2-a.x1)*c,i.y=a.y1+(a.y2-a.y1)*c),i}},80672(t,e,i){var r=i(35001),s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),l=r(a),u=r(o),d=r(h),c=l+u+d;!e&&i>0&&(e=c/i);for(var f=0;f<e;f++){var p=c*(f/e),g=0,m=new s;p<l?(g=p/l,m.x=a.x1+(a.x2-a.x1)*g,m.y=a.y1+(a.y2-a.y1)*g):p>l+u?(g=(p-=l+u)/d,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),n.push(m)}return n}},39757(t,e,i){var r=i(26099);function s(t,e,i,r){var s=t-i,n=e-r,a=s*s+n*n;return Math.sqrt(a)}t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x1,n=t.y1,a=t.x2,o=t.y2,h=t.x3,l=t.y3,u=s(h,l,a,o),d=s(i,n,h,l),c=s(a,o,i,n),f=u+d+c;return e.x=(i*u+a*d+h*c)/f,e.y=(n*u+o*d+l*c)/f,e}},13584(t){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376(t,e,i){var r=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),s=t.getLineC();return r(e)+r(i)+r(s)}},90260(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=t.x2-t.x1,s=t.y2-t.y1,n=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return o+h>=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+n*h),e.y=t.y1+(s*o+a*h),e}},52172(t,e,i){var r=i(99614),s=i(39757);t.exports=function(t,e){var i=s(t);return r(t,i.x,i.y,e)}},49907(t,e,i){var r=i(99614);t.exports=function(t,e,i){return r(t,e.x,e.y,i)}},99614(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x1-e,o=t.y1-i;return t.x1=a*s-o*n+e,t.y1=a*n+o*s+i,a=t.x2-e,o=t.y2-i,t.x2=a*s-o*n+e,t.y2=a*n+o*s+i,a=t.x3-e,o=t.y3-i,t.x3=a*s-o*n+e,t.y3=a*n+o*s+i,t}},16483(t,e,i){var r=i(83419),s=i(10690),n=i(20437),a=i(80672),o=i(23777),h=i(23031),l=i(90260),u=new r({initialize:function(t,e,i,r,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,r,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x3=s,this.y3=n,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435(t,e,i){var r=i(16483);r.Area=i(41658),r.BuildEquilateral=i(39208),r.BuildFromPolygon=i(39545),r.BuildRight=i(90301),r.CenterOn=i(23707),r.Centroid=i(97523),r.CircumCenter=i(24951),r.CircumCircle=i(85614),r.Clone=i(74422),r.Contains=i(10690),r.ContainsArray=i(48653),r.ContainsPoint=i(96006),r.CopyFrom=i(71326),r.Decompose=i(71694),r.Equals=i(33522),r.GetPoint=i(20437),r.GetPoints=i(80672),r.InCenter=i(39757),r.Perimeter=i(1376),r.Offset=i(13584),r.Random=i(90260),r.Rotate=i(52172),r.RotateAroundPoint=i(49907),r.RotateAroundXY=i(99614),t.exports=r},74457(t){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragStartCamera:null,dragX:0,dragY:0}}},84409(t){t.exports=function(t,e){return function(i,r,s,n){var a=t.getPixelAlpha(r,s,n.texture.key,n.frame.name);return a&&a>=e}}},7003(t,e,i){var r=i(83419),s=i(93301),n=i(50792),a=i(8214),o=i(8443),h=i(78970),l=i(85098),u=i(42515),d=i(36210),c=i(61340),f=i(85955),p=new r({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new n,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new d(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers;for(var i=0;i<=this.pointersTotal;i++){var r=new u(this,i);r.smoothFactor=e.inputSmoothFactor,this.pointers.push(r)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(a.MANAGER_BOOT),e.on(o.PRE_RENDER,this.preRender,this),e.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var r=0;r<i.length;r++){var s=i[r];if(s.sys.input&&s.sys.input.updatePoll(t,e)&&this.globalTopOnly)return}},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this.canvas.style.cursor=t.cursor)},resetCursor:function(t,e){(e||t&&t.cursor)&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(t){void 0===t&&(t=1);var e=[];this.pointersTotal+t>10&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var r=this.pointers.length,s=new u(this,r);s.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(s),this.pointersTotal++,e.push(s)}return e},updateInputPlugins:function(t,e){var i=this.game.scene.getScenes(!1,!0);this._tempSkip=!1;for(var r=0;r<i.length;r++){var s=i[r];if(s.sys.input)if(s.sys.input.update(t,e)&&this.globalTopOnly||this._tempSkip)return}},onTouchStart:function(t){for(var e=this.pointers,i=[],r=0;r<t.changedTouches.length;r++)for(var n=t.changedTouches[r],a=1;a<e.length;a++){var o=e[a];if(!o.active){o.touchstart(n,t),this.activePointer=o,i.push(o);break}}this.updateInputPlugins(s.TOUCH_START,i)},onTouchMove:function(t){for(var e=this.pointers,i=[],r=0;r<t.changedTouches.length;r++)for(var n=t.changedTouches[r],a=1;a<e.length;a++){var o=e[a];if(o.active&&o.identifier===n.identifier){var h=document.elementFromPoint(n.clientX,n.clientY)===this.canvas;!this.isOver&&h?this.setCanvasOver(t):this.isOver&&!h&&this.setCanvasOut(t),this.isOver&&(o.touchmove(n,t),this.activePointer=o,i.push(o));break}}this.updateInputPlugins(s.TOUCH_MOVE,i)},onTouchEnd:function(t){for(var e=this.pointers,i=[],r=0;r<t.changedTouches.length;r++)for(var n=t.changedTouches[r],a=1;a<e.length;a++){var o=e[a];if(o.active&&o.identifier===n.identifier){o.touchend(n,t),i.push(o);break}}this.updateInputPlugins(s.TOUCH_END,i)},onTouchCancel:function(t){for(var e=this.pointers,i=[],r=0;r<t.changedTouches.length;r++)for(var n=t.changedTouches[r],a=1;a<e.length;a++){var o=e[a];if(o.active&&o.identifier===n.identifier){o.touchcancel(n,t),i.push(o);break}}this.updateInputPlugins(s.TOUCH_CANCEL,i)},onMouseDown:function(t){var e=this.mousePointer;e.down(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(s.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(t){var e=this.mousePointer;e.move(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(s.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(t){var e=this.mousePointer;e.up(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(s.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(t){var e=this.mousePointer;e.wheel(t),this.activePointer=e,this.updateInputPlugins(s.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(t){var e=this.mouse.locked;this.mousePointer.locked=e,this.events.emit(a.POINTERLOCK_CHANGE,t,e)},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var r=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){r=!1;break}s=s.parentContainer}while(s);return r},hitTest:function(t,e,i,r){void 0===r&&(r=this._tempHitTest);var s=this._tempPoint,n=i.scrollX,a=i.scrollY;r.length=0;var o=t.x,h=t.y;i.getWorldPoint(o,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,c=0;c<e.length;c++){var p=e[c];if(this.inputCandidate(p,i)){var g=s.x+n*p.scrollFactorX-n,m=s.y+a*p.scrollFactorY-a;p.parentContainer?(p.getWorldTransformMatrix(u,d),u.applyInverse(g,m,l)):f(g,m,p.x,p.y,p.rotation,p.scaleX,p.scaleY,l),this.pointWithinHitArea(p,l.x,l.y)&&r.push(p)}}return r},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var r=t.input;return!(!r||!r.hitAreaCallback(r.hitArea,e,i,t))&&(r.localX=e,r.localY=i,!0)},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i,r){var s=t.position,n=t.prevPosition;n.x=s.x,n.y=s.y;var a=this.scaleManager.transformX(e),o=this.scaleManager.transformY(i),h=t.smoothFactor;r&&0!==h?(s.x=a*h+n.x*(1-h),s.y=o*h+n.y*(1-h)):(s.x=a,s.y=o)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(o.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=p},48205(t,e,i){var r=i(96503),s=i(87902),n=i(83419),a=i(93301),o=i(74457),h=i(84409),l=i(20339),u=i(8497),d=i(81154),c=i(8214),f=i(50792),p=i(95540),g=i(23777),m=i(89639),v=i(41212),y=i(37277),x=i(87841),T=i(37303),w=i(44594),b=i(16483),S=i(10690),C=new n({Extends:f,initialize:function(t){f.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,m.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(c.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(c.GAME_OUT,this.onGameOut,this),this.manager.events.on(c.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(c.START)},onGameOver:function(t){this.isActive()&&this.emit(c.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(c.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(c.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,r=e.length;if(0!==i||0!==r){for(var s=this._list,n=0;n<i;n++){var a=t[n],o=s.indexOf(a);o>-1&&(s.splice(o,1),this.clear(a,!0))}this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.manager&&this.manager.enabled&&this.enabled&&this.scene.sys.canInput()},setCursor:function(t){this.manager&&this.manager.setCursor(t)},resetCursor:function(){this.manager&&this.manager.resetCursor(null,!0)},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,r=this.manager.pointers;for(i=0;i<r.length;i++)r[i].updateMotion();if(0===this._list.length)return!1;var s=this.pollRate;if(-1===s)return!1;if(s>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var n=!1;for(i=0;i<r.length;i++){var a=0,o=r[i];this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp,o),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),a+=this.processOverOutEvents(o),2===this.getDragState(o)&&this.processDragThresholdEvent(o,t),a>0&&(n=!0)}return n},update:function(t,e){if(!this.isActive())return!1;for(var i=!1,r=0;r<e.length;r++){var s=0,n=e[r];switch(this._tempZones=[],this._temp=this.hitTestPointer(n),this.sortGameObjects(this._temp,n),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),t){case a.MOUSE_DOWN:s+=this.processDragDownEvent(n),s+=this.processDownEvents(n),s+=this.processOverOutEvents(n);break;case a.MOUSE_UP:s+=this.processDragUpEvent(n),s+=this.processUpEvents(n),s+=this.processOverOutEvents(n);break;case a.TOUCH_START:s+=this.processDragDownEvent(n),s+=this.processDownEvents(n),s+=this.processOverEvents(n);break;case a.TOUCH_END:case a.TOUCH_CANCEL:s+=this.processDragUpEvent(n),s+=this.processUpEvents(n),s+=this.processOutEvents(n);break;case a.MOUSE_MOVE:case a.TOUCH_MOVE:s+=this.processDragMoveEvent(n),s+=this.processMoveEvents(n),s+=this.processOverOutEvents(n);break;case a.MOUSE_WHEEL:s+=this.processWheelEvent(n)}s>0&&(i=!0)}return this._updatedThisFrame=!0,i},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var r=this._draggable.indexOf(t);return r>-1&&this._draggable.splice(r,1),t},disable:function(t,e){void 0===e&&(e=!1);var i=t.input;i&&(i.enabled=!1,i.dragState=0);for(var r,s=this._drag,n=this._over,a=this.manager,o=0;o<a.pointers.length;o++)(r=s[o].indexOf(t))>-1&&s[o].splice(r,1),(r=n[o].indexOf(t))>-1&&n[o].splice(r,1);return e&&this.resetCursor(),this},enable:function(t,e,i,r){return void 0===r&&(r=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&r&&!t.input.dropZone&&(t.input.dropZone=r),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var r=e[i],s=this.manager.hitTest(t,this._list,r),n=0;n<s.length;n++){var a=s[n];a.input.dropZone&&this._tempZones.push(a)}if(s.length>0)return t.camera=r,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,r=this._eventData,s=this._eventContainer;r.cancelled=!1;for(var n=0;n<i.length;n++){var a=i[n];if(a.input&&a.input.enabled){if(e++,a.emit(c.GAMEOBJECT_POINTER_DOWN,t,a.input.localX,a.input.localY,s),r.cancelled||!this.isActive())break;if(a.input&&a.input.enabled&&(this.emit(c.GAMEOBJECT_DOWN,t,a,s),r.cancelled||!this.isActive()))break}}return!r.cancelled&&this.isActive()&&(t.downElement===this.manager.game.canvas?this.emit(c.POINTER_DOWN,t,i):this.emit(c.POINTER_DOWN_OUTSIDE,t)),e},getDragState:function(t){return this._dragState[t.id]},setDragState:function(t,e){this._dragState[t.id]=e},processDragThresholdEvent:function(t,e){var i=!1,r=this.dragTimeThreshold,s=this.dragDistanceThreshold;if((s>0&&l(t.x,t.y,t.downX,t.downY)>=s||r>0&&e>=t.downTime+r)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i<e.length;i++){var r=e[i],s=r.input;s.dragState=2,s.dragStartX=r.x,s.dragStartY=r.y,s.dragStartXGlobal=t.worldX,s.dragStartYGlobal=t.worldY,s.dragStartCamera=t.camera,s.dragX=s.dragStartXGlobal-s.dragStartX,s.dragY=s.dragStartYGlobal-s.dragStartY,r.emit(c.GAMEOBJECT_DRAG_START,t,s.dragX,s.dragY),this.emit(c.DRAG_START,t,r)}return this.setDragState(t,4),e.length},processDragDownEvent:function(t){var e=this._temp;if(0===this._draggable.length||0===e.length||!t.primaryDown||0!==this.getDragState(t))return 0;this.setDragState(t,1);for(var i=[],r=0;r<e.length;r++){var s=e[r];s.input.draggable&&0===s.input.dragState&&i.push(s)}return 0===i.length?(this.setDragState(t,0),0):(i.length>1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;var e=this._tempZones,i=this._drag[t.id];i.length>1&&(i=i.slice(0));for(var r=0;r<i.length;r++){var s,n,a=i[r],o=a.input,h=o.target;if(h){var l=e.indexOf(h);0===l?(a.emit(c.GAMEOBJECT_DRAG_OVER,t,h),this.emit(c.DRAG_OVER,t,a,h)):l>0?(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):(a.emit(c.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(c.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(c.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(c.DRAG_ENTER,t,a,h));var u=t.positionToCamera(o.dragStartCamera);if(a.parentContainer){var d=u.x-o.dragStartXGlobal,f=u.y-o.dragStartYGlobal,p=a.getParentRotation(),g=d*Math.cos(p)+f*Math.sin(p),m=f*Math.cos(p)-d*Math.sin(p);g*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,s=g+o.dragStartX,n=m+o.dragStartY}else s=u.x-o.dragX,n=u.y-o.dragY;a.emit(c.GAMEOBJECT_DRAG,t,s,n),this.emit(c.DRAG,t,a,s,n)}return i.length},processDragUpEvent:function(t){var e=this._drag[t.id];e.length>1&&(e=e.slice(0));for(var i=0;i<e.length;i++){var r=e[i],s=r.input;if(s&&2===s.dragState){s.dragState=0,s.dragX=s.localX-r.displayOriginX,s.dragY=s.localY-r.displayOriginY,s.dragStartCamera=null;var n=!1,a=s.target;a&&(r.emit(c.GAMEOBJECT_DROP,t,a),this.emit(c.DROP,t,r,a),s.target=null,n=!0),r.input&&r.input.enabled&&(r.emit(c.GAMEOBJECT_DRAG_END,t,s.dragX,s.dragY,n),this.emit(c.DRAG_END,t,r,n))}}return this.setDragState(t,0),e.splice(0),0},processMoveEvents:function(t){var e=0,i=this._temp,r=this._eventData,s=this._eventContainer;r.cancelled=!1;for(var n=0;n<i.length;n++){var a=i[n];if(a.input&&a.input.enabled){if(e++,a.emit(c.GAMEOBJECT_POINTER_MOVE,t,a.input.localX,a.input.localY,s),r.cancelled||!this.isActive())break;if(a.input&&a.input.enabled){if(this.emit(c.GAMEOBJECT_MOVE,t,a,s),r.cancelled||!this.isActive())break;if(this.topOnly)break}}}return!r.cancelled&&this.isActive()&&this.emit(c.POINTER_MOVE,t,i),e},processWheelEvent:function(t){var e=0,i=this._temp,r=this._eventData,s=this._eventContainer;r.cancelled=!1;for(var n=t.deltaX,a=t.deltaY,o=t.deltaZ,h=0;h<i.length;h++){var l=i[h];if(l.input&&l.input.enabled){if(e++,l.emit(c.GAMEOBJECT_POINTER_WHEEL,t,n,a,o,s),r.cancelled||!this.isActive())break;if(l.input&&l.input.enabled&&(this.emit(c.GAMEOBJECT_WHEEL,t,l,n,a,o,s),r.cancelled||!this.isActive()))break}}return!r.cancelled&&this.isActive()&&this.emit(c.POINTER_WHEEL,t,i,n,a,o),e},processOverEvents:function(t){var e=this._temp,i=0,r=e.length,s=[];if(r>0){var n=this.manager,a=this._eventData,o=this._eventContainer;a.cancelled=!1;for(var h=0;h<r;h++){var l=e[h];if(l.input&&l.input.enabled){if(s.push(l),n.setCursor(l.input),l.emit(c.GAMEOBJECT_POINTER_OVER,t,l.input.localX,l.input.localY,o),i++,a.cancelled||!this.isActive())break;if(l.input&&l.input.enabled&&(this.emit(c.GAMEOBJECT_OVER,t,l,o),a.cancelled||!this.isActive()))break}}!a.cancelled&&this.isActive()&&this.emit(c.POINTER_OVER,t,s)}return this._over[t.id]=s,i},processOutEvents:function(t){var e=this._over[t.id],i=0,r=e.length;if(r>0){var s=this.manager,n=this._eventData,a=this._eventContainer;n.cancelled=!1,this.sortGameObjects(e,t);for(var o=0;o<r;o++){var h=e[o];if((h=e[o]).input&&h.input.enabled){if(s.resetCursor(h.input),h.emit(c.GAMEOBJECT_POINTER_OUT,t,a),i++,n.cancelled||!this.isActive())break;if(h.input&&h.input.enabled&&(this.emit(c.GAMEOBJECT_OUT,t,h,a),n.cancelled||!this.isActive()))break}}!n.cancelled&&this.isActive()&&this.emit(c.POINTER_OUT,t,e),this._over[t.id]=[]}return i},processOverOutEvents:function(t){var e,i,r=this._temp,s=[],n=[],a=[],o=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<o.length;e++)i=o[e],-1===r.indexOf(i)&&-1===h.indexOf(i)?s.push(i):a.push(i);for(e=0;e<r.length;e++)i=r[e],-1===o.indexOf(i)&&n.push(i);var u=s.length,d=0,f=this._eventData,p=this._eventContainer;if(f.cancelled=!1,u>0){for(this.sortGameObjects(s,t),e=0;e<u;e++)if((i=s[e]).input&&i.input.enabled){if(l.resetCursor(i.input),i.emit(c.GAMEOBJECT_POINTER_OUT,t,p),d++,f.cancelled||!this.isActive())break;if(i.input&&i.input.enabled&&(this.emit(c.GAMEOBJECT_OUT,t,i,p),f.cancelled||!this.isActive()))break}f.cancelled&&!this.isActive()||this.emit(c.POINTER_OUT,t,s)}if(u=n.length,f.cancelled=!1,u>0){for(this.sortGameObjects(n,t),e=0;e<u;e++)if((i=n[e]).input&&i.input.enabled){if(l.setCursor(i.input),i.emit(c.GAMEOBJECT_POINTER_OVER,t,i.input.localX,i.input.localY,p),d++,f.cancelled||!this.isActive())break;if(i.input&&i.input.enabled&&(this.emit(c.GAMEOBJECT_OVER,t,i,p),f.cancelled||!this.isActive()))break}!f.cancelled&&this.isActive()&&this.emit(c.POINTER_OVER,t,n)}return o=a.concat(n),this._over[t.id]=this.sortGameObjects(o,t),d},processUpEvents:function(t){var e=this._temp,i=this._eventData,r=this._eventContainer;i.cancelled=!1;for(var s=0;s<e.length;s++){var n=e[s];if(n.input&&n.input.enabled){if(n.emit(c.GAMEOBJECT_POINTER_UP,t,n.input.localX,n.input.localY,r),i.cancelled||!this.isActive())break;if(n.input&&n.input.enabled&&(this.emit(c.GAMEOBJECT_UP,t,n,r),i.cancelled||!this.isActive()))break}}return!i.cancelled&&this.isActive()&&(t.upElement===this.manager.game.canvas?this.emit(c.POINTER_UP,t,e):this.emit(c.POINTER_UP_OUTSIDE,t)),e.length},forceDownState:function(t,e){this.forceState(t,e,c.GAMEOBJECT_POINTER_DOWN,c.GAMEOBJECT_DOWN,!1)},forceUpState:function(t,e){this.forceState(t,e,c.GAMEOBJECT_POINTER_UP,c.GAMEOBJECT_UP,!1)},forceOverState:function(t,e){this.forceState(t,e,c.GAMEOBJECT_POINTER_OVER,c.GAMEOBJECT_OVER,!0)},forceOutState:function(t,e){this.forceState(t,e,c.GAMEOBJECT_POINTER_OUT,c.GAMEOBJECT_OUT,!1)},forceState:function(t,e,i,r,s){var n=this._eventData,a=this._eventContainer;n.cancelled=!1,e.input&&e.input.enabled&&(e.emit(i,t,e.input.localX,e.input.localY,a),s&&this.setCursor(e.input),!n.cancelled&&this.isActive()&&e.input&&e.input.enabled&&this.emit(r,t,e,a))},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i];r.input.draggable=e;var s=this._draggable.indexOf(r);e&&-1===s?this._draggable.push(r):!e&&s>-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var r=!1,s=!1,n=!1,a=!1,h=!1,l=!0;if(v(e)&&Object.keys(e).length){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d)),r=p(u,"draggable",!1),s=p(u,"dropZone",!1),n=p(u,"cursor",!1),a=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c<t.length;c++){var f=t[c];if(h&&"Container"===f.type)console.warn("Cannot pixelPerfect test a Container. Use a custom callback.");else{var g=f.input?f.input:o(f,e,i);g.customHitArea=l,g.dropZone=s,g.cursor=a?"pointer":n,f.input=g,r&&this.setDraggable(f),this.queueForInsertion(f)}}return this},setHitAreaCircle:function(t,e,i,n,a){void 0===a&&(a=s);var o=new r(e,i,n);return this.setHitArea(t,o,a)},setHitAreaEllipse:function(t,e,i,r,s,n){void 0===n&&(n=d);var a=new u(e,i,r,s);return this.setHitArea(t,a,n)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=T),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i],s=r.frame,n=0,a=0;r.width?(n=r.width,a=r.height):s&&(n=s.realWidth,a=s.realHeight),"Container"!==r.type||0!==n&&0!==a?0!==n&&0!==a&&(r.input=o(r,new x(0,0,n,a),e),this.queueForInsertion(r)):console.warn("Container.setInteractive must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,r,s,n){void 0===n&&(n=T);var a=new x(e,i,r,s);return this.setHitArea(t,a,n)},setHitAreaTriangle:function(t,e,i,r,s,n,a,o){void 0===o&&(o=S);var h=new b(e,i,r,s,n,a);return this.setHitArea(t,h,o)},enableDebug:function(t,e){void 0===e&&(e=65280);var i=t.input;if(!i||!i.hitArea)return this;var r=i.hitArea,s=r.type,n=i.hitAreaDebug,a=this.systems.add,o=this.systems.updateList;n&&(o.remove(n),n.destroy(),n=null);var h=0,l=0;switch(s){case g.CIRCLE:n=a.arc(0,0,r.radius),h=r.x-r.radius,l=r.y-r.radius;break;case g.ELLIPSE:n=a.ellipse(0,0,r.width,r.height),h=r.x-r.width/2,l=r.y-r.height/2;break;case g.LINE:n=a.line(0,0,r.x1,r.y1,r.x2,r.y2);break;case g.POLYGON:n=a.polygon(0,0,r.points);break;case g.RECTANGLE:n=a.rectangle(0,0,r.width,r.height),h=r.x,l=r.y;break;case g.TRIANGLE:n=a.triangle(0,0,r.x1,r.y1,r.x2,r.y2,r.x3,r.y3)}return n&&(n.isFilled=!1,n.strokeColor=e,n.preUpdate=function(){n.setVisible(t.visible),n.setStrokeStyle(1/t.scale,n.strokeColor),n.setDisplayOrigin(t.displayOriginX,t.displayOriginY);var e=t.x,i=t.y,r=t.rotation,s=t.scaleX,a=t.scaleY;if(t.parentContainer){var o=t.getWorldTransformMatrix();e=o.tx,i=o.ty,r=o.rotation,s=o.scaleX,a=o.scaleY}n.setRotation(r),n.setScale(s,a),n.setPosition(e+h*s,i+l*a),n.setScrollFactor(t.scrollFactorX,t.scrollFactorY),n.setDepth(t.depth)},o.add(n),i.hitAreaDebug=n),this},removeDebug:function(t){var e=t.input;e&&e.hitAreaDebug&&(e.hitAreaDebug.destroy(),e.hitAreaDebug=null);return this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t,e){if(t.length<2||!e.camera)return t;var i=e.camera.renderList;return t.sort(function(t,e){var r=Math.max(i.indexOf(t),0);return Math.max(i.indexOf(e),0)-r})},sortDropZones:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortDropZoneHandler.bind(this)))},sortDropZoneHandler:function(t,e){if(t.parentContainer||e.parentContainer){if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),r=e.getIndexList(),s=Math.min(i.length,r.length),n=0;n<s;n++){var a=i[n],o=r[n];if(a!==o)return o-a}return r.length-i.length}return this.displayList.getIndex(e)-this.displayList.getIndex(t)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit(c.SHUTDOWN),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0,this._dragState.length=0;for(var t=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.manager;e.canvas.style.cursor=e.defaultCursor;var i=this.systems.events;i.off(w.TRANSITION_START,this.transitionIn,this),i.off(w.TRANSITION_OUT,this.transitionOut,this),i.off(w.TRANSITION_COMPLETE,this.transitionComplete,this),i.off(w.PRE_UPDATE,this.preUpdate,this),e.events.off(c.GAME_OUT,this.onGameOut,this),e.events.off(c.GAME_OVER,this.onGameOver,this),i.off(w.SHUTDOWN,this.shutdown,this)},resetPointers:function(){for(var t=this.manager.pointers,e=0;e<t.length;e++)t[e].reset()},destroy:function(){this.shutdown(),this.pluginEvents.emit(c.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(w.START,this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},isOver:{get:function(){return this.manager.isOver}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});y.register("InputPlugin",C,"input"),t.exports=C},89639(t,e,i){var r=i(35154),s={},n={register:function(t,e,i,r,n){s[t]={plugin:e,mapping:i,settingsKey:r,configKey:n}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,n=e.game.config;for(var a in s){var o=s[a].plugin,h=s[a].mapping,l=s[a].settingsKey,u=s[a].configKey;r(i,l,n[u])&&(t[h]=new o(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=n},42515(t,e,i){var r=i(31040),s=i(83419),n=i(20339),a=i(43855),o=i(47235),h=i(26099),l=i(25892),u=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var n=o(this.motionFactor,i,t),h=o(this.motionFactor,s,e);a(n,t,.1)&&(n=t),a(h,e,.1)&&(h=e),this.midPoint.set(n,h);var l=t-n,u=e-h;this.velocity.set(l,u),this.angle=r(n,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.buttons?0===this.button&&!this.isDown:0===this.button},rightButtonReleased:function(){return 0===this.buttons?2===this.button&&!this.isDown:2===this.button},middleButtonReleased:function(){return 0===this.buttons?1===this.button&&!this.isDown:1===this.button},backButtonReleased:function(){return 0===this.buttons?3===this.button&&!this.isDown:3===this.button},forwardButtonReleased:function(){return 0===this.buttons?4===this.button&&!this.isDown:4===this.button},getDistance:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,r=this.prevPosition.y,s=this.position.x,n=this.position.y,a=0;a<t;a++){var h=1/t*a;e[a]={x:o(h,i,s),y:o(h,r,n)}}return e},reset:function(){this.event=null,this.downElement=null,this.upElement=null,this.button=0,this.buttons=0,this.position.set(0,0),this.prevPosition.set(0,0),this.midPoint.set(-1,-1),this.velocity.set(0,0),this.angle=0,this.distance=0,this.worldX=0,this.worldY=0,this.downX=0,this.downY=0,this.upX=0,this.upY=0,this.moveTime=0,this.upTime=0,this.downTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.deltaX=0,this.deltaY=0,this.deltaZ=0,this.active=0===this.id},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},time:{get:function(){return this.event?this.event.timeStamp:0}}});t.exports=u},93301(t){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},7179(t){t.exports="boot"},85375(t){t.exports="destroy"},62224(t){t.exports="dragend"},23388(t){t.exports="dragenter"},16133(t){t.exports="drag"},27829(t){t.exports="dragleave"},53904(t){t.exports="dragover"},56058(t){t.exports="dragstart"},2642(t){t.exports="drop"},88171(t){t.exports="gameobjectdown"},36147(t){t.exports="dragend"},71692(t){t.exports="dragenter"},96149(t){t.exports="drag"},81285(t){t.exports="dragleave"},74048(t){t.exports="dragover"},21322(t){t.exports="dragstart"},49378(t){t.exports="drop"},86754(t){t.exports="gameobjectmove"},86433(t){t.exports="gameobjectout"},60709(t){t.exports="gameobjectover"},24081(t){t.exports="pointerdown"},11172(t){t.exports="pointermove"},18907(t){t.exports="pointerout"},95579(t){t.exports="pointerover"},35368(t){t.exports="pointerup"},26972(t){t.exports="wheel"},47078(t){t.exports="gameobjectup"},73802(t){t.exports="gameobjectwheel"},56718(t){t.exports="gameout"},25936(t){t.exports="gameover"},27503(t){t.exports="boot"},50852(t){t.exports="process"},96438(t){t.exports="update"},59152(t){t.exports="pointerlockchange"},47777(t){t.exports="pointerdown"},27957(t){t.exports="pointerdownoutside"},19444(t){t.exports="pointermove"},54251(t){t.exports="pointerout"},18667(t){t.exports="pointerover"},27192(t){t.exports="pointerup"},24652(t){t.exports="pointerupoutside"},45132(t){t.exports="wheel"},44512(t){t.exports="preupdate"},15757(t){t.exports="shutdown"},41637(t){t.exports="start"},93802(t){t.exports="update"},8214(t,e,i){t.exports={BOOT:i(7179),DESTROY:i(85375),DRAG_END:i(62224),DRAG_ENTER:i(23388),DRAG:i(16133),DRAG_LEAVE:i(27829),DRAG_OVER:i(53904),DRAG_START:i(56058),DROP:i(2642),GAME_OUT:i(56718),GAME_OVER:i(25936),GAMEOBJECT_DOWN:i(88171),GAMEOBJECT_DRAG_END:i(36147),GAMEOBJECT_DRAG_ENTER:i(71692),GAMEOBJECT_DRAG:i(96149),GAMEOBJECT_DRAG_LEAVE:i(81285),GAMEOBJECT_DRAG_OVER:i(74048),GAMEOBJECT_DRAG_START:i(21322),GAMEOBJECT_DROP:i(49378),GAMEOBJECT_MOVE:i(86754),GAMEOBJECT_OUT:i(86433),GAMEOBJECT_OVER:i(60709),GAMEOBJECT_POINTER_DOWN:i(24081),GAMEOBJECT_POINTER_MOVE:i(11172),GAMEOBJECT_POINTER_OUT:i(18907),GAMEOBJECT_POINTER_OVER:i(95579),GAMEOBJECT_POINTER_UP:i(35368),GAMEOBJECT_POINTER_WHEEL:i(26972),GAMEOBJECT_UP:i(47078),GAMEOBJECT_WHEEL:i(73802),MANAGER_BOOT:i(27503),MANAGER_PROCESS:i(50852),MANAGER_UPDATE:i(96438),POINTER_DOWN:i(47777),POINTER_DOWN_OUTSIDE:i(27957),POINTER_MOVE:i(19444),POINTER_OUT:i(54251),POINTER_OVER:i(18667),POINTER_UP:i(27192),POINTER_UP_OUTSIDE:i(24652),POINTER_WHEEL:i(45132),POINTERLOCK_CHANGE:i(59152),PRE_UPDATE:i(44512),SHUTDOWN:i(15757),START:i(41637),UPDATE:i(93802)}},97421(t,e,i){var r=new(i(83419))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=r},28884(t,e,i){var r=i(83419),s=i(92734),n=new r({initialize:function(t,e,i){void 0===i&&(i=!1),this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=i},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},99125(t,e,i){var r=i(97421),s=i(28884),n=i(83419),a=i(50792),o=i(26099),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n<e.buttons.length;n++)i.push(new s(this,n,e.buttons[n].value>=.5));this.buttons=i;var h=[];for(n=0;n<e.axes.length;n++)h.push(new r(this,n));this.axes=h,this.vibration=e.vibrationActuator;var l={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:l,this._LCRight=i[15]?i[15]:l,this._LCTop=i[12]?i[12]:l,this._LCBottom=i[13]?i[13]:l,this._RCLeft=i[2]?i[2]:l,this._RCRight=i[1]?i[1]:l,this._RCTop=i[3]?i[3]:l,this._RCBottom=i[0]?i[0]:l,this._FBLeftTop=i[4]?i[4]:l,this._FBLeftBottom=i[6]?i[6]:l,this._FBRightTop=i[5]?i[5]:l,this._FBRightBottom=i[7]?i[7]:l;var u={value:0};this._HAxisLeft=h[0]?h[0]:u,this._VAxisLeft=h[1]?h[1]:u,this._HAxisRight=h[2]?h[2]:u,this._VAxisRight=h[3]?h[3]:u,this.leftStick=new o,this.rightStick=new o,this._created=performance.now()},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){if(!(t.timestamp<this._created)){var e,i=this.buttons,r=t.buttons,s=i.length;for(e=0;e<s;e++)i[e].update(r[e].value);var n=this.axes,a=t.axes;for(s=n.length,e=0;e<s;e++)n[e].update(a[e]);s>=2&&(this.leftStick.set(n[0].getValue(),n[1].getValue()),s>=4&&this.rightStick.set(n[2].getValue(),n[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=h},56654(t,e,i){var r=i(83419),s=i(50792),n=i(92734),a=i(99125),o=i(35154),h=i(89639),l=i(8214),u=new r({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=o(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=o(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=this.gamepads,e=0;e<t.length;e++)t[e]&&t[e].removeAllListeners()},disconnectAll:function(){for(var t=this.gamepads,e=0;e<t.length;e++)t[e]&&(t[e].pad.connected=!1)},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var r=t[i];if(r){var s=r.id,n=r.index,o=e[n];if(o)o.id!==s?(o.destroy(),e[n]=new a(this,r)):o.update(r);else{var h=new a(this,r);e[n]=h,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=h):this._pad3=h:this._pad2=h:this._pad1=h}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var r=e[i],s=this.getPad(r.gamepad.index);"gamepadconnected"===r.type?this.emit(n.CONNECTED,s,r):"gamepaddisconnected"===r.type&&this.emit(n.DISCONNECTED,s,r)}}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});h.register("GamepadPlugin",u,"gamepad","gamepad","inputGamepad"),t.exports=u},89651(t){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},65294(t){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},90089(t){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},64894(t,e,i){t.exports={DUALSHOCK_4:i(65294),SNES_USB:i(89651),XBOX_360:i(90089)}},46008(t){t.exports="down"},7629(t){t.exports="up"},42206(t){t.exports="connected"},86544(t){t.exports="disconnected"},94784(t){t.exports="down"},14325(t){t.exports="up"},92734(t,e,i){t.exports={BUTTON_DOWN:i(46008),BUTTON_UP:i(7629),CONNECTED:i(42206),DISCONNECTED:i(86544),GAMEPAD_BUTTON_DOWN:i(94784),GAMEPAD_BUTTON_UP:i(14325)}},48646(t,e,i){t.exports={Axis:i(97421),Button:i(28884),Events:i(92734),Gamepad:i(99125),GamepadPlugin:i(56654),Configs:i(64894)}},14350(t,e,i){var r=i(93301),s=i(79291),n={CreatePixelPerfectHandler:i(84409),CreateInteractiveObject:i(74457),Events:i(8214),Gamepad:i(48646),InputManager:i(7003),InputPlugin:i(48205),InputPluginCache:i(89639),Keyboard:i(51442),Mouse:i(87078),Pointer:i(42515),Touch:i(95618)};n=s(!1,n,r),t.exports=n},78970(t,e,i){var r=i(72905),s=i(83419),n=i(8443),a=i(8214),o=i(46032),h=i(29747),l=new s({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(n.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var r=t[i];"string"==typeof r&&(r=o[r.trim().toUpperCase()]),-1===e.indexOf(r)&&e.push(r)}this.preventDefault=e.length>0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var s=t[i];"string"==typeof s&&(s=o[s.toUpperCase()]),r(e,s)}this.preventDefault=e.length>0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(n.POST_STEP,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846(t,e,i){var r=i(83419),s=i(50792),n=i(95922),a=i(8443),o=i(35154),h=i(8214),l=i(89639),u=i(30472),d=i(46032),c=i(87960),f=i(74600),p=i(44594),g=i(56583),m=new r({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:d.UP,down:d.DOWN,left:d.LEFT,right:d.RIGHT,space:d.SPACE,shift:d.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var r={};if("string"==typeof t){t=t.split(",");for(var s=0;s<t.length;s++){var n=t[s].trim();n&&(r[n]=this.addKey(n,e,i))}}else for(var a in t)r[a]=this.addKey(t[a],e,i);return r},addKey:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var r=this.keys;if(t instanceof u){var s=r.indexOf(t);return s>-1?r[s]=t:r[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=d[t.toUpperCase()]),r[t]||(r[t]=new u(this,t),e&&this.addCapture(t),r[t].setEmitOnRepeat(i)),r[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var r,s=this.keys;if(t instanceof u){var n=s.indexOf(t);n>-1&&(r=this.keys[n],this.keys[n]=void 0)}else"string"==typeof t&&(t=d[t.toUpperCase()]);return s[t]&&(r=s[t],s[t]=void 0),r&&(r.plugin=null,i&&this.removeCapture(r.keyCode),e&&r.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,r=0;r<i.length;r++){var s=i[r];s&&(i[r]=void 0,e&&this.removeCapture(s.keyCode),t&&s.destroy())}return this},createCombo:function(t,e){return new c(this,t,e)},checkDown:function(t,e){if(void 0===e&&(e=0),this.enabled&&t.isDown){var i=g(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,r=0;r<e;r++){var s=t[r],a=s.keyCode,o=i[a],h=!1;void 0===s.cancelled&&(s.cancelled=0,s.stopImmediatePropagation=function(){s.cancelled=1},s.stopPropagation=function(){s.cancelled=-1}),-1!==s.cancelled&&(a===this.prevCode&&s.timeStamp===this.prevTime&&s.type===this.prevType||(this.prevCode=a,this.prevTime=s.timeStamp,this.prevType=s.type,"keydown"===s.type?(o&&(h=o.isDown,o.onDown(s)),s.cancelled||o&&h||(f[a]&&this.emit(n.KEY_DOWN+f[a],s),s.cancelled||this.emit(n.ANY_KEY_DOWN,s))):(o&&o.onUp(s),s.cancelled||(f[a]&&this.emit(n.KEY_UP+f[a],s),s.cancelled||this.emit(n.ANY_KEY_UP,s))),1===s.cancelled&&(s.cancelled=0)))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.removeAllKeys(!0),this.removeAllListeners(),this.sceneInputPlugin.manager.events.off(h.MANAGER_PROCESS,this.update,this),this.game.events.off(a.BLUR,this.resetKeys),this.scene.sys.events.off(p.PAUSE,this.resetKeys,this),this.scene.sys.events.off(p.SLEEP,this.resetKeys,this),this.queue=[]},destroy:function(){this.shutdown();for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].destroy();this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.manager=null},time:{get:function(){return this.sceneInputPlugin.manager.time}}});l.register("KeyboardPlugin",m,"keyboard","keyboard","inputKeyboard"),t.exports=m},66970(t){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},87960(t,e,i){var r=i(83419),s=i(95922),n=i(95540),a=i(68769),o=i(92803),h=new r({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var r=0;r<e.length;r++){var h=e[r];"string"==typeof h?this.keyCodes.push(h.toUpperCase().charCodeAt(0)):"number"==typeof h?this.keyCodes.push(h):h.hasOwnProperty("keyCode")&&this.keyCodes.push(h.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=n(i,"resetOnWrongKey",!0),this.maxKeyDelay=n(i,"maxKeyDelay",0),this.resetOnMatch=n(i,"resetOnMatch",!1),this.deleteOnMatch=n(i,"deleteOnMatch",!1);var l=this;this.onKeyDown=function(t){!l.matched&&l.enabled&&(a(t,l)&&(l.manager.emit(s.COMBO_MATCH,l,t),l.resetOnMatch?o(l):l.deleteOnMatch&&l.destroy()))},this.manager.on(s.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(s.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}});t.exports=h},68769(t,e,i){var r=i(66970);t.exports=function(t,e){if(e.matched)return!0;var i=!1,s=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var n=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=n&&(s=!0,i=r(t,e))}else s=!0,i=r(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803(t){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612(t){t.exports="keydown"},23345(t){t.exports="keyup"},21957(t){t.exports="keycombomatch"},44743(t){t.exports="down"},3771(t){t.exports="keydown-"},46358(t){t.exports="keyup-"},75674(t){t.exports="up"},95922(t,e,i){t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442(t,e,i){t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i<e}},90229(t){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},38796(t){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},30472(t,e,i){var r=i(83419),s=i(50792),n=i(95922),a=new r({Extends:s,initialize:function(t,e){s.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(n.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(n.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(n.UP,this,t))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=a},46032(t){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},74600(t,e,i){var r=i(46032),s={};for(var n in r)s[r[n]]=n;t.exports=s},41170(t){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i<e}},85098(t,e,i){var r=i(83419),s=i(89357),n=i(8214),a=i(29747),o=new r({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,r=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===r&&t.preventDefault())},this.onMouseDownWindow=function(t){t.sourceCapabilities&&t.sourceCapabilities.firesTouchEvents||!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==r&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===r&&t.preventDefault())},this.onMouseUpWindow=function(t){t.sourceCapabilities&&t.sourceCapabilities.firesTouchEvents||!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==r&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===r&&t.preventDefault()};var a={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,a),t.addEventListener("mouseout",this.onMouseOut,a),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,a),window.top.addEventListener("mouseup",this.onMouseUpWindow,a)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,a),window.addEventListener("mouseup",this.onMouseUpWindow,a),this.isTop=!1}s.pointerLock&&(this.pointerLockChange=function(t){var r=e.target;e.locked=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},87078(t,e,i){t.exports={MouseManager:i(85098)}},36210(t,e,i){var r=i(83419),s=i(8214),n=i(29747),a=new r({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=n,this.onTouchStartWindow=n,this.onTouchMove=n,this.onTouchEnd=n,this.onTouchEndWindow=n,this.onTouchCancel=n,this.onTouchCancelWindow=n,this.isTop=!0,t.events.once(s.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,r=i.canvas,s=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){s&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===r&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==r&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===r&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==r&&i.onTouchEnd(t)},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var n=this.capture,a={passive:!0},o={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,n?o:a),t.addEventListener("touchmove",this.onTouchMove,n?o:a),t.addEventListener("touchend",this.onTouchEnd,n?o:a),t.addEventListener("touchcancel",this.onTouchCancel,n?o:a),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,o),window.top.addEventListener("touchend",this.onTouchEndWindow,o),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,o)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,o),window.addEventListener("touchend",this.onTouchEndWindow,o),window.addEventListener("touchcancel",this.onTouchCancelWindow,o),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},95618(t,e,i){t.exports={TouchManager:i(36210)}},41299(t,e,i){var r=i(83419),s=i(23906),n=i(54899),a=i(95540),o=i(98356),h=i(3374),l=i(84376),u=i(92638),d=new r({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var r=a(e,"url");void 0===r?r=t.path+i+"."+a(e,"extension",""):"string"!=typeof r||r.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(r=t.path+r),this.url=r,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?s.FILE_POPULATED:s.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile,this.base64="string"==typeof r&&0===r.indexOf("data:"),this.retryAttempts=a(e,"maxRetries",t.maxRetries)},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){if(this.state===s.FILE_POPULATED)this.loader.nextFile(this,!0);else{if(this.state=s.FILE_LOADING,this.src=o(this,this.loader.baseURL),!this.src)throw new Error("URL Error in File: "+this.key+" from: "+this.url);0===this.src.indexOf("data:")&&(this.base64=!0),this.xhrLoader=l(this,this.loader.xhr)}},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some(function(e){return 0===t.responseURL.indexOf(e)})&&0===e.target.status,r=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(r=!1),this.state=s.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,r)},onBase64Load:function(t){this.xhrLoader=t,this.state=s.FILE_LOADED,this.percentComplete=1,this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.retryAttempts>0?(this.retryAttempts--,this.load()):this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(n.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==s.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(n.FILE_COMPLETE,e,i,t),this.loader.emit(n.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=s.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});d.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var r=new FileReader;r.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+r.result.split(",")[1]},r.onerror=t.onerror,r.readAsDataURL(e)}},d.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=d},74099(t){var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356(t){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|file:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261(t,e,i){var r=i(83419),s=i(23906),n=i(50792),a=i(54899),o=i(74099),h=i(95540),l=i(35154),u=i(41212),d=i(37277),c=i(44594),f=i(92638),p=new r({Extends:n,initialize:function(t){n.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout),h(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=h(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=h(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=h(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new Set,this.inflight=new Set,this.queue=new Set,this._deleteQueue=new Set,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,this.multiKeyIndex=0,this.maxRetries=h(i,"maxRetries",e.loaderMaxRetries),t.sys.events.once(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.add(i),this.emit(a.ADD,i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(t){var e=t.hasCacheConflict();return e||this.list.forEach(function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}),!e&&this.isLoading()&&(this.inflight.forEach(function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}),this.queue.forEach(function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),e},addPack:function(t,e){if("string"==typeof e){var i=l(t,e);i&&(t={packKey:i})}var r=0,s=this.baseURL,n=this.path,a=this.prefix;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=t[o],d=h(u,"baseURL",s),c=h(u,"path",n),f=h(u,"prefix",a),p=h(u,"files",null),g=h(u,"defaultType","void");if(Array.isArray(p)){this.setBaseURL(d),this.setPath(c),this.setPrefix(f);for(var m=0;m<p.length;m++){var v=p[m],y=v.hasOwnProperty("type")?v.type:g;this[y]&&(this[y](v),r++)}}}return this.setBaseURL(s),this.setPath(n),this.setPrefix(a),r>0},removePack:function(t,e){var i,r=this.systems.anims,s=this.cacheManager,n=this.textureManager,a={animation:"json",aseprite:"json",audio:"audio",audioSprite:"audio",binary:"binary",bitmapFont:"bitmapFont",css:null,glsl:"shader",html:"html",json:"json",obj:"obj",plugin:null,scenePlugin:null,script:null,spine:"json",text:"text",tilemapCSV:"tilemap",tilemapImpact:"tilemap",tilemapTiledJSON:"tilemap",video:"video",xml:"xml"};if(u(t))i=t;else if(!(i=s.json.get(t)))return void console.warn("Asset Pack not found in JSON cache:",t);for(var o in e&&(i={_:i[e]}),i){var l=i[o],d=h(l,"prefix",""),c=h(l,"files"),f=h(l,"defaultType");if(Array.isArray(c))for(var p=0;p<c.length;p++){var g=c[p],m=g.hasOwnProperty("type")?g.type:f;if(m){var v=d+g.key;if("animation"===m&&r.remove(v),"aseprite"!==m&&"atlas"!==m&&"atlasXML"!==m&&"htmlTexture"!==m&&"image"!==m&&"multiatlas"!==m&&"spritesheet"!==m&&"svg"!==m&&"texture"!==m&&"unityAtlas"!==m||(n.remove(v),a[m]))if("pack"!==m){if("spine"===m){var y=s.custom.spine.get(v);if(!y)continue;var x=void 0===y.prefix?"":y.prefix;s.custom.spine.remove(v);var T=s.custom.spineTextures.get(v);if(!T)continue;s.custom.spineTextures.remove(v);for(var w=0;w<T.pages.length;w++){var b=x+T.pages[w].name,S=v+":"+b;n.exists(S)?n.remove(S):n.remove(b)}}var C=a[m];if(null!==C)if(C)s[C].remove(v);else console.warn("Unknown type:",m)}else this.removePack(v,g.dataKey)}else console.warn("No type:",g)}}},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.forEach(function(t){if((t.state===s.FILE_POPULATED||t.state===s.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.add(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1},this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.add(t),this.emit(a.FILE_LOAD,t),t.onProcess()):(this.totalFailed++,this._deleteQueue.add(t),this.emit(a.FILE_LOAD_ERROR,t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===s.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===s.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&(t.multiFile.addToCache(),t.multiFile.pendingDestroy()):(t.addToCache(),t.pendingDestroy())),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(a.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=s.LOADER_COMPLETE,this.systems.events.off(c.UPDATE,this.update,this),this._deleteQueue.forEach(function(t){t.destroy()}),this._deleteQueue.clear(),this.emit(a.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.add(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var r=new Blob([t],{type:i}),s=URL.createObjectURL(r),n=document.createElement("a");return n.download=e,n.textContent="Download "+e,n.href=s,n.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(h(e,"baseURL",t.loaderBaseURL)),this.setPath(h(e,"path",t.loaderPath)),this.setPrefix(h(e,"prefix",t.loaderPrefix)),this.state=s.LOADER_IDLE},shutdown:function(){this.reset(),this.state=s.LOADER_SHUTDOWN,this.removeAllListeners(),this.systems.events.off(c.UPDATE,this.update,this),this.systems.events.off(c.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=s.LOADER_DESTROYED,this.systems.events.off(c.UPDATE,this.update,this),this.systems.events.off(c.START,this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null,this.sceneManager=null}});d.register("Loader",p,"load"),t.exports=p},3374(t,e,i){var r=i(79291),s=i(92638);t.exports=function(t,e){var i=void 0===t?s():r({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},26430(t,e,i){var r=i(83419),s=i(23906),n=i(54899),a=new r({initialize:function(t,e,i,r){var n=[];r.forEach(function(t){t&&n.push(t)}),this.loader=t,this.type=e,this.key=i;var a=this.key;t.prefix&&""!==t.prefix&&(this.key=t.prefix+a),this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.state=s.FILE_PENDING,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var o=0;o<n.length;o++)n[o].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&(this.failed++,console.error('File failed: %s "%s" (via %s "%s")',this.type,this.key,t.type,t.key))},pendingDestroy:function(){if(this.state!==s.FILE_PENDING_DESTROY){var t=this.key,e=this.type;this.loader.emit(n.FILE_COMPLETE,t,e),this.loader.emit(n.FILE_KEY_COMPLETE+e+"-"+t,t,e),this.loader.flagForRemoval(this);for(var i=0;i<this.files.length;i++)this.files[i].pendingDestroy();this.state=s.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.files=null,this.config=null}});t.exports=a},84376(t,e,i){var r=i(3374);t.exports=function(t,e){var i=r(e,t.xhrSettings);if(t.base64){var s,n=t.url.split(";base64,").pop()||t.url.split(",").pop();return s="arraybuffer"===t.xhrSettings.responseType?{response:Uint8Array.from(atob(n),function(t){return t.charCodeAt(0)}).buffer}:{responseText:atob(n)},void t.onBase64Load(s)}var a=new XMLHttpRequest;if(a.open("GET",t.src,i.async,i.user,i.password),a.responseType=t.xhrSettings.responseType,a.timeout=i.timeout,i.headers)for(var o in i.headers)a.setRequestHeader(o,i.headers[o]);return i.header&&i.headerValue&&a.setRequestHeader(i.header,i.headerValue),i.requestedWith&&a.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&a.overrideMimeType(i.overrideMimeType),i.withCredentials&&(a.withCredentials=!0),a.onload=t.onLoad.bind(t,a),a.onerror=t.onError.bind(t,a),a.onprogress=t.onProgress.bind(t),a.ontimeout=t.onError.bind(t,a),a.send(),a}},92638(t){t.exports=function(t,e,i,r,s,n){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===r&&(r=""),void 0===s&&(s=0),void 0===n&&(n=!1),{responseType:t,async:e,user:i,password:r,timeout:s,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}}},23906(t){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},42155(t){t.exports="addfile"},38991(t){t.exports="complete"},27540(t){t.exports="filecomplete"},87464(t){t.exports="filecomplete-"},94486(t){t.exports="loaderror"},13035(t){t.exports="load"},38144(t){t.exports="fileprogress"},97520(t){t.exports="postprocess"},85595(t){t.exports="progress"},55680(t){t.exports="start"},54899(t,e,i){t.exports={ADD:i(42155),COMPLETE:i(38991),FILE_COMPLETE:i(27540),FILE_KEY_COMPLETE:i(87464),FILE_LOAD_ERROR:i(94486),FILE_LOAD:i(13035),FILE_PROGRESS:i(38144),POST_PROCESS:i(97520),PROGRESS:i(85595),START:i(55680)}},14135(t,e,i){var r=i(83419),s=i(74099),n=i(518),a=i(54899),o=new r({Extends:n,initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),n.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});s.register("animation",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,r,i));return this}),t.exports=o},76272(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(19550),o=i(41212),h=i(518),l=i(26430),u=new r({Extends:l,initialize:function(t,e,i,r,s,u){var d,c;if(o(e)){var f=e;e=n(f,"key"),d=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),c=new h(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","json"),xhrSettings:n(f,"atlasXhrSettings")})}else d=new a(t,e,i,s),c=new h(t,e,r,u);d.linkFile?l.call(this,t,"atlasjson",e,[d,c,d.linkFile]):l.call(this,t,"atlasjson",e,[d,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("aseprite",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new u(this,t[a]),this.addFile(n.files);else n=new u(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=u},38734(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(19550),o=i(41212),h=i(518),l=i(26430),u=new r({Extends:l,initialize:function(t,e,i,r,s,u){var d,c;if(o(e)){var f=e;e=n(f,"key"),d=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),c=new h(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","json"),xhrSettings:n(f,"atlasXhrSettings")})}else d=new a(t,e,i,s),c=new h(t,e,r,u);d.linkFile?l.call(this,t,"atlasjson",e,[d,c,d.linkFile]):l.call(this,t,"atlasjson",e,[d,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});s.register("atlas",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new u(this,t[a]),this.addFile(n.files);else n=new u(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=u},74599(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(19550),o=i(41212),h=i(26430),l=i(57318),u=new r({Extends:h,initialize:function(t,e,i,r,s,u){var d,c;if(o(e)){var f=e;e=n(f,"key"),d=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),c=new l(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","xml"),xhrSettings:n(f,"atlasXhrSettings")})}else d=new a(t,e,i,s),c=new l(t,e,r,u);d.linkFile?h.call(this,t,"atlasxml",e,[d,c,d.linkFile]):h.call(this,t,"atlasxml",e,[d,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});s.register("atlasXML",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new u(this,t[a]),this.addFile(n.files);else n=new u(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=u},21097(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(89749),l=i(41212),u=new r({Extends:n,initialize:function(t,e,i,r,s){if(l(e)){var a=e;e=o(a,"key"),r=o(a,"xhrSettings"),s=o(a,"context",s)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:r,config:{context:s}};n.call(this,t,h)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(e){t.data=e,t.onProcessComplete()},function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()}),this.config.context=null}});u.create=function(t,e,i,r,s){var n=t.systems.game,a=n.config.audio,d=n.device.audio;l(e)&&(i=o(e,"url",[]),r=o(e,"config",{}));var c=u.getAudioURL(n,i);return c?d.webAudio&&!a.disableWebAudio?new u(t,e,c,s,n.sound.context):new h(t,e,c,r):(console.warn('No audio URLs for "%s" can play on this device',e),null)},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var r=o(e[i],"url",e[i]);if(0===r.indexOf("blob:")||0===r.indexOf("data:"))return{url:r,type:""};var s=r.match(/\.([a-zA-Z0-9]+)($|\?)/);if(s=o(e[i],"type",s?s[1]:"").toLowerCase(),t.device.audio[s])return{url:r,type:s}}return null},a.register("audio",function(t,e,i,r){var s,n=this.systems.game,a=n.config.audio,o=n.device.audio;if(a.noAudio||!o.webAudio&&!o.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(s=u.create(this,t[h]))&&this.addFile(s);else(s=u.create(this,t,e,i,r))&&this.addFile(s);return this}),t.exports=u},89524(t,e,i){var r=i(21097),s=i(83419),n=i(74099),a=i(95540),o=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,u,d){if(o(e)){var c=e;e=a(c,"key"),i=a(c,"jsonURL"),s=a(c,"audioURL"),n=a(c,"audioConfig"),u=a(c,"audioXhrSettings"),d=a(c,"jsonXhrSettings")}var f;if(s){var p=r.create(t,e,s,n,u);p&&(f=new h(t,e,i,d),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,d),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=n,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=a(this.config,"audioConfig"),s=a(this.config,"audioXhrSettings"),n=r.create(this.loader,t.key,e,i,s);n&&(this.addToMultiFile(n),this.loader.addFile(n))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});n.register("audioSprite",function(t,e,i,r,s,n){var a,o=this.systems.game,h=o.config.audio,l=o.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var d=0;d<t.length;d++)(a=new u(this,t[d])).files&&this.addFile(a.files);else(a=new u(this,t,e,i,r,s,n)).files&&this.addFile(a.files);return this})},85722(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r,s){var a="bin";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),r=o(l,"xhrSettings"),a=o(l,"extension",a),s=o(l,"dataType",s)}var u={type:"binary",cache:t.cacheManager.binary,extension:a,responseType:"arraybuffer",key:e,url:i,xhrSettings:r,config:{dataType:s}};n.call(this,t,u)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,r,i));return this}),t.exports=l},97025(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(19550),o=i(41212),h=i(26430),l=i(21859),u=i(57318),d=new r({Extends:h,initialize:function(t,e,i,r,s,l){var d,c;if(o(e)){var f=e;e=n(f,"key"),d=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),c=new u(t,{key:e,url:n(f,"fontDataURL"),extension:n(f,"fontDataExtension","xml"),xhrSettings:n(f,"fontDataXhrSettings")})}else d=new a(t,e,i,s),c=new u(t,e,r,l);d.linkFile?h.call(this,t,"bitmapfont",e,[d,c,d.linkFile]):h.call(this,t,"bitmapfont",e,[d,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),r=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:r,texture:t.key,frame:null}),this.complete=!0}}});s.register("bitmapFont",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new d(this,t[a]),this.addFile(n.files);else n=new d(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=d},16024(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r){var s="css";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),r=o(a,"xhrSettings"),s=o(a,"extension",s)}var l={type:"script",cache:!1,extension:s,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("css",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},69559(t,e,i){var r=i(38734),s=i(85722),n=i(83419),a=i(74099),o=i(95540),h=i(19550),l=i(41212),u=i(518),d=i(31403),c=i(46975),f=i(59327),p=i(26430),g=i(82038),m=i(55222),v=new n({Extends:p,initialize:function(t,e,i,r){if(i.multiAtlasURL){var n=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:r,config:i});p.call(this,t,"texture",e,[n])}else{var a=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===a.toLowerCase()?"KTX":"PVR");var o=new s(t,{key:e,url:i.textureURL,extension:a,xhrSettings:r,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:r,config:i});p.call(this,t,"texture",e,[o,h])}else p.call(this,t,"texture",e,[o])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,r=this.loader,n=r.baseURL,a=r.path,h=r.prefix,l=o(i,"multiBaseURL",this.baseURL),u=o(i,"multiPath",this.path),d=o(i,"prefix",this.prefix),c=o(i,"textureXhrSettings");l&&r.setBaseURL(l),u&&r.setPath(u),d&&r.setPrefix(d);for(var f=0;f<e.length;f++){var p=e[f].image,g="CMA"+this.multiKeyIndex+"_"+p,m=new s(r,g,p,c);if(this.addToMultiFile(m),r.addFile(m),e[f].normalMap){var v=new s(r,g,e[f].normalMap,c);v.type="normalMap",m.setLink(v),this.addToMultiFile(v),r.addFile(v)}}r.setBaseURL(n),r.setPath(a),r.setPrefix(h)}}},addToCache:function(){function t(t){console.warn('Compressed Texture Invalid: "'+n.key+'". '+t)}if(this.isReadyToProcess()){var e=this.config;if(e.multiAtlasURL)this.addMultiToCache();else{var i,r=this.loader.systems.renderer,s=this.loader.textureManager,n=this.files[0],a=this.files[1];if("PVR"===e.type?i=g(n.data):"KTX"===e.type&&((i=d(n.data))||t("KTX file contains unsupported format.")),i&&!m(i)&&(t("Texture dimensions failed verification. Check the texture format specifications for "+e.format+" 0x"+i.internalFormat.toString(16)+"."),i=null),i&&!r.supportsCompressedTexture(e.format,i.internalFormat)&&(t("Texture format "+e.format+" with internal format "+i.internalFormat+" not supported by the GPU. Texture invalid. This is often due to the texture using sRGB instead of linear RGB."),i=null),i){i.format=r.getCompressedTextureName(e.format,i.internalFormat);var o=a&&a.data?a.data:null;s.addCompressedTexture(n.key,i,o)}}this.complete=!0}},addMultiToCache:function(){for(var t,e=this.config,i=this.files[0],r=[],s=[],n=[],a=this.loader.systems.renderer,o=this.loader.textureManager,h=1;h<this.files.length;h++){var l=this.files[h];if("normalMap"!==l.type)for(var u=l.key.indexOf("_"),c=l.key.substr(u+1),f=l.data,p=0;p<i.data.textures.length;p++){var m=i.data.textures[p];if(m.image===c){"PVR"===e.type?t=g(f):"KTX"===e.type&&(t=d(f)),t&&a.supportsCompressedTexture(e.format,t.internalFormat)&&(t.format=a.getCompressedTextureName(e.format,t.internalFormat),s.push(t),r.push(m),l.linkFile&&n.push(l.linkFile.data));break}}}0===n.length&&(n=void 0),o.addAtlasJSONArray(this.key,s,r,n),this.complete=!0}});a.register("texture",function(t,e,i){var s=this.systems.renderer,n=function(t,e,i,n){var a={format:null,type:null,textureURL:void 0,atlasURL:void 0,multiAtlasURL:void 0,multiPath:void 0,multiBaseURL:void 0};if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),n=o(u,"xhrSettings")}var d=!1;for(var p in i)if(s.supportsCompressedTexture(p)){var g=i[p];"string"==typeof g?a.textureURL=g:a=c(g,a),a.format=p.toUpperCase(),d=!0;break}if(d)if("IMG"===a.format){var m;m=a.multiAtlasURL?new f(t,e,a.multiAtlasURL,a.multiPath,a.multiBaseURL,n).files:a.atlasURL?new r(t,e,a.textureURL,a.atlasURL,n).files:new h(t,e,a.textureURL,n),t.addFile(m)}else{var y=new v(t,e,a,n);t.addFile(y.files)}else console.warn("No supported compressed texture format or IMG fallback",e)};if(Array.isArray(t))for(var a=0;a<t.length;a++)n(this,t[a]);else n(this,t,e,i);return this}),t.exports=v},87674(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(98356),l=i(41212),u=new r({Extends:n,initialize:function(t,e,i,r,a,h){var u="ttf";if(l(e)){var d=e;e=o(d,"key"),i=o(d,"url"),r=o(d,"format","truetype"),a=o(d,"descriptors",null),h=o(d,"xhrSettings"),u=o(d,"extension",u)}else void 0===r&&(r="truetype");var c={type:"font",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:h};n.call(this,t,c),this.data={format:r,descriptors:a},this.state=s.FILE_POPULATED},onProcess:function(){var t;this.state=s.FILE_PROCESSING,this.src=h(this,this.loader.baseURL);var e=this.key,i="url("+this.src+') format("'+this.data.format+'")';t=this.data.descriptors?new FontFace(e,i,this.data.descriptors):new FontFace(e,i);var r=this;t.load().then(function(){document.fonts.add(t),document.body.classList.add("fonts-loaded"),r.onProcessComplete()}).catch(function(){console.warn("Font failed to load",i),r.onProcessComplete()})}});a.register("font",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i,r,s));return this}),t.exports=u},47931(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(73894),u=new r({Extends:n,initialize:function(t,e,i,r){var s="glsl";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),r=o(a,"xhrSettings"),s=o(a,"extension",s)}var l={type:"glsl",cache:t.cacheManager.shader,extension:s,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){this.cache.add(this.key,new l(this.key,this.data))}});a.register("glsl",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},89749(t,e,i){var r=i(83419),s=i(54899),n=i(41299),a=i(95540),o=i(98356),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r){if(h(e)){var s=e;e=a(s,"key"),r=a(s,"config",r)}var o={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:r};n.call(this,t,o),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0,this.percentComplete=0;for(var e=0;e<t;e++){var i=new Audio;i.dataset||(i.dataset={}),i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=o(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=l},88470(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r){var s="html";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),r=o(a,"xhrSettings"),s=o(a,"extension",s)}var l={type:"text",cache:t.cacheManager.html,extension:s,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},14643(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r,s,a){void 0===r&&(r=512),void 0===s&&(s=512);var l="html";if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),a=o(u,"xhrSettings"),l=o(u,"extension",l),r=o(u,"width",r),s=o(u,"height",s)}var d={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:a,config:{width:r,height:s}};n.call(this,t,d)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var r=[i.join("\n")],a=this;try{var o=new window.Blob(r,{type:"image/svg+xml;charset=utf-8"})}catch(t){return a.state=s.FILE_ERRORED,void a.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){n.revokeObjectURL(a.data),a.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(a.data),a.onProcessError()},n.createObjectURL(this.data,o,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i,r,s));return this}),t.exports=l},19550(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(98356),u=new r({Extends:n,initialize:function t(e,i,r,s,a){var l,u="png";if(h(i)){var d=i;i=o(d,"key"),r=o(d,"url"),l=o(d,"normalMap"),s=o(d,"xhrSettings"),u=o(d,"extension",u),a=o(d,"frameConfig")}Array.isArray(r)&&(l=r[1],r=r[0]);var c={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:r,xhrSettings:s,config:a};if(n.call(this,e,c),l){var f=new t(e,this.key,l,s,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){n.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){n.revokeObjectURL(t.data),t.onProcessError()},n.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=s.FILE_PROCESSING,t===s.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=s.FILE_LOADING,this.src=l(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=s.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src},addToCache:function(){var t=this.linkFile;t?t.state>=s.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},518(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(35154),l=i(41212),u=new r({Extends:n,initialize:function(t,e,i,r,a){var u="json";if(l(e)){var d=e;e=o(d,"key"),i=o(d,"url"),r=o(d,"xhrSettings"),u=o(d,"extension",u),a=o(d,"dataKey",a)}var c={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:r,config:a};n.call(this,t,c),l(i)&&(this.data=a?h(i,a):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new u(this,t[s]));else this.addFile(new u(this,t,e,r,i));return this}),t.exports=u},59327(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(19550),o=i(41212),h=i(518),l=i(26430),u=new r({Extends:l,initialize:function(t,e,i,r,s,a,u){if(o(e)){var d=e;e=n(d,"key"),i=n(d,"url",!1)?n(d,"url"):n(d,"atlasURL"),a=n(d,"xhrSettings"),r=n(d,"path"),s=n(d,"baseURL"),u=n(d,"textureXhrSettings")}var c=new h(t,e,i,a);l.call(this,t,"multiatlas",e,[c]),this.config.path=r,this.config.baseURL=s,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,r=this.loader,s=r.baseURL,o=r.path,h=r.prefix,l=n(i,"baseURL",this.baseURL),u=n(i,"path",this.path),d=n(i,"prefix",this.prefix),c=n(i,"textureXhrSettings");r.setBaseURL(l),r.setPath(u),r.setPrefix(d);for(var f=0;f<e.length;f++){var p=e[f].image,g="MA"+this.multiKeyIndex+"_"+p,m=new a(r,g,p,c);if(this.addToMultiFile(m),r.addFile(m),e[f].normalMap){var v=new a(r,g,e[f].normalMap,c);v.type="normalMap",m.setLink(v),this.addToMultiFile(v),r.addFile(v)}}r.setBaseURL(s),r.setPath(o),r.setPrefix(h)}},addToCache:function(){if(this.isReadyToProcess()){for(var t=this.files[0],e=[],i=[],r=[],s=1;s<this.files.length;s++){var n=this.files[s];if("normalMap"!==n.type)for(var a=n.key.indexOf("_"),o=n.key.substr(a+1),h=n.data,l=0;l<t.data.textures.length;l++){var u=t.data.textures[l];if(u.image===o){i.push(h),e.push(u),n.linkFile&&r.push(n.linkFile.data);break}}}0===r.length&&(r=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,r),this.complete=!0}}});s.register("multiatlas",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new u(this,t[a]),this.addFile(n.files);else n=new u(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=u},99297(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(41212),o=i(26430),h=i(34328),l=new r({Extends:o,initialize:function(t,e,i,r){var s="js",l=[];if(a(e)){var u=e;e=n(u,"key"),i=n(u,"url"),r=n(u,"xhrSettings"),s=n(u,"extension",s)}Array.isArray(i)||(i=[i]);for(var d=0;d<i.length;d++){var c=new h(t,{key:e+"_"+d.toString(),url:i[d],extension:s,xhrSettings:r});c.onProcess=function(){this.onProcessComplete()},l.push(c)}o.call(this,t,"scripts",e,l)},addToCache:function(){if(this.isReadyToProcess()){for(var t=0;t<this.files.length;t++){var e=this.files[t];e.data=document.createElement("script"),e.data.language="javascript",e.data.type="text/javascript",e.data.defer=!1,e.data.text=e.xhrLoader.responseText,document.head.appendChild(e.data)}this.complete=!0}}});s.register("scripts",function(t,e,i){var r;if(Array.isArray(t))for(var s=0;s<t.length;s++)r=new l(this,t[s]),this.addFile(r.files);else r=new l(this,t,e,i),this.addFile(r.files);return this}),t.exports=l},11069(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(19550),l=i(41212),u=i(26430),d=i(39620),c=new r({Extends:n,initialize:function(t,e,i,r){var s={type:"pct",cache:t.cacheManager.atlas,extension:"pct",responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,s)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=d(this.xhrLoader.responseText);t?(this.data=t,this.onProcessComplete()):this.onProcessError()}}),f=new r({Extends:u,initialize:function(t,e,i,r,s,n,a){if(l(e)){var h=e;e=o(h,"key"),i=o(h,"url",!1)?o(h,"url"):o(h,"atlasURL"),n=o(h,"xhrSettings"),r=o(h,"path"),s=o(h,"baseURL"),a=o(h,"textureXhrSettings")}var d=new c(t,e,i,n);u.call(this,t,"pctatlas",e,[d]),this.config.path=r,this.config.baseURL=s,this.config.textureXhrSettings=a},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"pct"===t.type&&t.data&&Array.isArray(t.data.pages))){var e=t.data.pages,i=this.config,r=this.loader,s=r.baseURL,n=r.path,a=r.prefix,l=o(i,"baseURL",this.baseURL),u=o(i,"path",this.path),d=o(i,"prefix",this.prefix),c=o(i,"textureXhrSettings");r.setBaseURL(l),r.setPath(u),r.setPrefix(d);for(var f=0;f<e.length;f++){var p=e[f].filename,g="PCT"+this.multiKeyIndex+"_"+p,m=new h(r,g,p,c);this.addToMultiFile(m),r.addFile(m)}r.setBaseURL(s),r.setPath(n),r.setPrefix(a)}},addToCache:function(){if(this.isReadyToProcess()){for(var t=this.files[0].data,e=t.pages,i="PCT"+this.multiKeyIndex+"_",r={},s=1;s<this.files.length;s++){var n=this.files[s],a=n.key,o=a.indexOf(i);r[o>=0?a.substring(o+i.length):a]=n.data}for(var h=[],l=0;l<e.length;l++){var u=r[e[l].filename];u&&h.push(u)}this.loader.cacheManager.atlas.add(this.key,t),this.loader.textureManager.addAtlasPCT(this.key,h,t),this.complete=!0}}});a.register("atlasPCT",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new f(this,t[a]),this.addFile(n.files);else n=new f(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=f},58610(t,e,i){var r=i(83419),s=i(23906),n=i(74099),a=i(518),o=new r({Extends:a,initialize:function(t,e,i,r,s){a.call(this,t,e,i,r,s),this.type="packfile"},onProcess:function(){if(this.state!==s.FILE_POPULATED&&(this.state=s.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var t={};t[this.config]=this.data,this.data=t}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});n.register("pack",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,r,i));return this}),t.exports=o},48988(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r,a,l){var u="js";if(h(e)){var d=e;e=o(d,"key"),i=o(d,"url"),l=o(d,"xhrSettings"),u=o(d,"extension",u),r=o(d,"start"),a=o(d,"mapping")}var c={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:r,mapping:a}};n.call(this,t,c),"function"==typeof i&&(this.data=i,this.state=s.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=o(e,"start",!1),r=o(e,"mapping",null);if(this.state===s.FILE_POPULATED)t.install(this.key,this.data,i,r);else{this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var n=t.install(this.key,window[this.key],i,r);(i||r)&&(this.loader.systems[r]=n,this.loader.scene[r]=n)}this.onProcessComplete()}});a.register("plugin",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i,r,s));return this}),t.exports=l},67397(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r,s){var a="svg";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),r=o(l,"svgConfig",{}),s=o(l,"xhrSettings"),a=o(l,"extension",a)}var u={type:"svg",cache:t.textureManager,extension:a,responseType:"text",key:e,url:i,xhrSettings:s,config:{width:o(r,"width"),height:o(r,"height"),scale:o(r,"scale")}};n.call(this,t,u)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,r=this.config.height,a=this.config.scale;t:if(i&&r||a){var o=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=o.hasAttribute("viewBox"),l=parseFloat(o.getAttribute("width")),u=parseFloat(o.getAttribute("height"));if(!h&&l&&u)o.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var d=o.getAttribute("viewBox").split(/\s+|,/);l=d[2],u=d[3]}if(a){if(!l||!u)break t;i=l*a,r=u*a}o.setAttribute("width",i.toString()+"px"),o.setAttribute("height",r.toString()+"px"),e=[(new XMLSerializer).serializeToString(o)]}try{var c=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||n.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,n.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},n.createObjectURL(this.data,c,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("svg",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,r));return this}),t.exports=l},88423(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r){var s="js";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),r=o(a,"xhrSettings"),s=o(a,"extension",s)}var l={type:"text",extension:s,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});a.register("sceneFile",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},56812(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r,a,l){var u="js";if(h(e)){var d=e;e=o(d,"key"),i=o(d,"url"),l=o(d,"xhrSettings"),u=o(d,"extension",u),r=o(d,"systemKey"),a=o(d,"sceneKey")}var c={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:r,sceneKey:a}};n.call(this,t,c),"function"==typeof i&&(this.data=i,this.state=s.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,r=o(e,"systemKey",i),n=o(e,"sceneKey",i);this.state===s.FILE_POPULATED?t.installScenePlugin(r,this.data,n,this.loader.scene,!0):(this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(r,window[this.key],n,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",function(t,e,i,r,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i,r,s));return this}),t.exports=l},34328(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r,s){var a="js";if(h(e)){var l=e;e=o(l,"key"),i=o(l,"url"),r=o(l,"type","script"),s=o(l,"xhrSettings"),a=o(l,"extension",a)}else void 0===r&&(r="script");var u={type:r,cache:!1,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};n.call(this,t,u)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("script",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,r));return this}),t.exports=l},85035(t,e,i){var r=i(83419),s=i(23906),n=i(74099),a=i(19550),o=new r({Extends:a,initialize:function(t,e,i,r,s){a.call(this,t,e,i,s,r),this.type="spritesheet"},addToCache:function(){var t=this.linkFile;t?t.state>=s.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});n.register("spritesheet",function(t,e,i,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,i,r));return this}),t.exports=o},78776(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=new r({Extends:n,initialize:function(t,e,i,r){var s="text",a="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=o(u,"key"),i=o(u,"url"),r=o(u,"xhrSettings"),a=o(u,"extension",a),s=o(u,"type",s),l=o(u,"cache",l)}var d={type:s,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,d)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i));return this}),t.exports=l},49477(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(80341),u=new r({Extends:n,initialize:function(t,e,i,r){var s="csv";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),r=o(a,"xhrSettings"),s=o(a,"extension",s)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:s,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});a.register("tilemapCSV",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},40807(t,e,i){var r=i(83419),s=i(74099),n=i(518),a=i(80341),o=new r({Extends:n,initialize:function(t,e,i,r){n.call(this,t,e,i,r),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});s.register("tilemapImpact",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},56775(t,e,i){var r=i(83419),s=i(74099),n=i(518),a=i(80341),o=new r({Extends:n,initialize:function(t,e,i,r){n.call(this,t,e,i,r),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});s.register("tilemapTiledJSON",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},25771(t,e,i){var r=i(83419),s=i(74099),n=i(95540),a=i(19550),o=i(41212),h=i(26430),l=i(78776),u=new r({Extends:h,initialize:function(t,e,i,r,s,u){var d,c;if(o(e)){var f=e;e=n(f,"key"),d=new a(t,{key:e,url:n(f,"textureURL"),extension:n(f,"textureExtension","png"),normalMap:n(f,"normalMap"),xhrSettings:n(f,"textureXhrSettings")}),c=new l(t,{key:e,url:n(f,"atlasURL"),extension:n(f,"atlasExtension","txt"),xhrSettings:n(f,"atlasXhrSettings")})}else d=new a(t,e,i,s),c=new l(t,e,r,u);d.linkFile?h.call(this,t,"unityatlas",e,[d,c,d.linkFile]):h.call(this,t,"unityatlas",e,[d,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});s.register("unityAtlas",function(t,e,i,r,s){var n;if(Array.isArray(t))for(var a=0;a<t.length;a++)n=new u(this,t[a]),this.addFile(n.files);else n=new u(this,t,e,i,r,s),this.addFile(n.files);return this}),t.exports=u},33720(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(98356),h=i(95540),l=i(41212),u=new r({Extends:n,initialize:function(t,e,i,r){if(void 0===r&&(r=!1),l(e)){var s=e;e=h(s,"key"),i=h(s,"url",[]),r=h(s,"noAudio",!1)}var a=t.systems.game.device.video.getVideoURL(i);a||console.warn("VideoFile: No supported format for "+e);var o={type:"video",cache:t.cacheManager.video,extension:a.type,key:e,url:a.url,config:{noAudio:r}};n.call(this,t,o)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=o(this,this.loader.baseURL),this.state=s.FILE_LOADED,this.loader.nextFile(this,!0)}});a.register("video",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},57318(t,e,i){var r=i(83419),s=i(23906),n=i(41299),a=i(74099),o=i(95540),h=i(41212),l=i(56836),u=new r({Extends:n,initialize:function(t,e,i,r){var s="xml";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),r=o(a,"xhrSettings"),s=o(a,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:r};n.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",function(t,e,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},64589(t,e,i){t.exports={AnimationJSONFile:i(14135),AsepriteFile:i(76272),AtlasJSONFile:i(38734),AtlasXMLFile:i(74599),AudioFile:i(21097),AudioSpriteFile:i(89524),BinaryFile:i(85722),BitmapFontFile:i(97025),CompressedTextureFile:i(69559),CSSFile:i(16024),FontFile:i(87674),GLSLFile:i(47931),HTML5AudioFile:i(89749),HTMLFile:i(88470),HTMLTextureFile:i(14643),ImageFile:i(19550),JSONFile:i(518),MultiAtlasFile:i(59327),MultiScriptFile:i(99297),PackFile:i(58610),PCTAtlasFile:i(11069),PluginFile:i(48988),SceneFile:i(88423),ScenePluginFile:i(56812),ScriptFile:i(34328),SpriteSheetFile:i(85035),SVGFile:i(67397),TextFile:i(78776),TilemapCSVFile:i(49477),TilemapImpactFile:i(40807),TilemapJSONFile:i(56775),UnityAtlasFile:i(25771),VideoFile:i(33720),XMLFile:i(57318)}},57777(t,e,i){var r=i(23906),s=i(79291),n={Events:i(54899),FileTypes:i(64589),File:i(41299),FileTypesManager:i(74099),GetURL:i(98356),LoaderPlugin:i(74261),MergeXHRSettings:i(3374),MultiFile:i(26430),XHRLoader:i(84376),XHRSettings:i(92638)};n=s(!1,n,r),t.exports=n},53307(t){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},85710(t,e,i){var r=i(6411);t.exports=function(t,e){return r(t)/r(e)/r(t-e)}},30976(t){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},87842(t){t.exports=function(t,e,i,r,s){var n=.5*(r-e),a=.5*(s-i),o=t*t;return(2*i-2*r+n+a)*(t*o)+(-3*i+3*r-2*n-a)*o+n*t+i}},26302(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var r=Math.pow(i,-e);return Math.ceil(t*r)/r}},45319(t){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},39506(t,e,i){var r=i(36383);t.exports=function(t){return t*r.DEG_TO_RAD}},61241(t){t.exports=function(t,e){return Math.abs(t-e)}},38857(t,e,i){var r=i(45319),s=i(83419),n=i(37867),a=i(29747),o=new n,h=new s({initialize:function t(e,i,r,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=t.DefaultOrder),this._x=e,this._y=i,this._z=r,this._order=s,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,r){return void 0===r&&(r=this._order),this._x=t,this._y=e,this._z=i,this._order=r,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var s=t.val,n=s[0],a=s[4],o=s[8],h=s[1],l=s[5],u=s[9],d=s[2],c=s[6],f=s[10],p=0,g=0,m=0,v=.99999;switch(e){case"XYZ":g=Math.asin(r(o,-1,1)),Math.abs(o)<v?(p=Math.atan2(-u,f),m=Math.atan2(-a,n)):p=Math.atan2(c,l);break;case"YXZ":p=Math.asin(-r(u,-1,1)),Math.abs(u)<v?(g=Math.atan2(o,f),m=Math.atan2(h,l)):g=Math.atan2(-d,n);break;case"ZXY":p=Math.asin(r(c,-1,1)),Math.abs(c)<v?(g=Math.atan2(-d,f),m=Math.atan2(-a,l)):m=Math.atan2(h,n);break;case"ZYX":g=Math.asin(-r(d,-1,1)),Math.abs(d)<v?(p=Math.atan2(c,f),m=Math.atan2(h,n)):m=Math.atan2(-a,l);break;case"YZX":m=Math.asin(r(h,-1,1)),Math.abs(h)<v?(p=Math.atan2(-u,l),g=Math.atan2(-d,n)):g=Math.atan2(o,f);break;case"XZY":m=Math.asin(-r(a,-1,1)),Math.abs(a)<v?(p=Math.atan2(c,l),g=Math.atan2(o,n)):p=Math.atan2(-u,f)}return this._x=p,this._y=g,this._z=m,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},6411(t){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},99472(t){t.exports=function(t,e){return Math.random()*(e-t)+t}},77623(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var r=Math.pow(i,-e);return Math.floor(t*r)/r}},62945(t,e,i){var r=i(45319);t.exports=function(t,e,i){return(i-e)*(t=r(t,0,1))+e}},2672(t,e,i){var r=i(26099);t.exports=function(t,e){void 0===e&&(e=new r);var i=t.length;if(!Array.isArray(t)||0===i)throw new Error("GetCentroid points be a non-empty array");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var s=0;s<i;s++)e.x+=t[s].x,e.y+=t[s].y;e.x/=i,e.y/=i}return e}},38265(t){t.exports=function(t,e){return t/e/1e3}},55133(t,e,i){var r=i(87841);t.exports=function(t,e){void 0===e&&(e=new r);for(var i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=0;o<t.length;o++){var h=t[o];h.x>i&&(i=h.x),h.x<s&&(s=h.x),h.y>n&&(n=h.y),h.y<a&&(a=h.y)}return e.x=s,e.y=a,e.width=i-s,e.height=n-a,e}},72958(t,e,i){var r=i(26099),s=i(25836),n=i(61369),a=new r,o=new s,h=new n,l=new r(12.9898,78.233),u=new s(12.9898,78.233,9441.8953),d=new n(12.9898,78.233,9441.8953,61.99),c=function(t){var e;switch(t.length){case 4:h.set(t[0],t[1],t[2],t[3]),e=43757.5453*Math.sin(h.dot(d));break;case 3:o.set(t[0],t[1],t[2]),e=43757.5453*Math.sin(o.dot(u));break;case 2:a.set(t[0],t[1]),e=43757.5453*Math.sin(a.dot(l));break;default:e=43757.5453*Math.sin(12.9898*t[0])}return e-Math.floor(e)},f=Math.pow(2,32),p=function(t,e){var i;switch(t.length){case 4:i=19*t[0]+47*t[1]+101*t[2]+173*t[3];break;case 3:i=19*t[0]+47*t[1]+101*t[2];break;case 2:i=19*t[0]+47*t[1];break;default:i=19*t[0]}e&&(i*=Math.pow(2,32-Math.floor(Math.log2(i))));var r=747796405*(i>>>0)+2891336453,s=277803737*(r>>>(r>>>28)+4^r),n=(s>>>22^s)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var r=i(72958),s=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var r,s,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),g=e.noiseCells||[32,32,32,32].slice(0,p);for(r=0;r<p;r++){var m=t[r]*i*g[r];n[r]=Math.floor(m),a[r]=m%1}var v=0,y=0;0!==u&&1!==u||(v=4*p);var x=Math.pow(3,p);for(l=0;l<x;l++)switch(o[0]=l%3-1,p>1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),s=c(p,n,o,e,i),h=f(p,o,a,s),u){case 0:h<v&&(v=h);break;case 1:h<v&&(v=h,y=s[0]);break;case 2:h=Math.sqrt(h),v+=Math.pow(2,-32/d*h)}return 0===u?Math.sqrt(v):1===u?y:-1/32*d*Math.log2(v)},c=function(t,e,i,n,a){var o,u,d=n.noiseWrap?n.noiseWrap:n.noiseCells||[32,32,32,32],c=n.noiseSeed?n.noiseSeed:s;for(o=0;o<t;o++)h[o]=(e[o]+i[o])%(d[o]*a);for(o=0;o<t;o++){var f=Array(t);for(u=0;u<t;u++)f[u]=h[u]+c[o*t+u];l[o]=r(f,n.algorithm)}return l},f=function(t,e,i,r){var s;for(s=0;s<t;s++)u[s]=e[s]-i[s]+r[s];var n=0;for(s=0;s<t;s++)n+=u[s]*u[s];return n};t.exports=function(t,e){"number"==typeof t&&(t=[t]),e||(e={});for(var i=0,r=e.noiseIterations||1,s=0;s<r;s++){var n=Math.pow(2,s);i+=(d(t,e,n)-.5)/n}return i+.5}},84366(t){var e=[0,0,0],i=[0,0,0],r=[0,0,0],s=[11.3,23.7,13.1],n=[29.9,2.3,31.7],a=[0,0,0],o=function(t,e,s,n,a,o,h){for(var l,u=0,d=0,c=n.noiseCells||[32,32,32],f=n.noisePeriod||c,p=n.noiseFlow||0,g=0;g<t;g++){var m=Math.pow(a,g),v=Math.pow(o,g);for(l=0;l<e;l++)i[l]=(s[l]+g)*m;for(l=0;l<e;l++)r[l]=f[l]*m;2===e?d=N(i,r,p*v+g):3===e&&(d=Lt(i,r,p*v+g)),u+=d/Math.pow(h,g)}return u},h={x:0,y:0},l={x:0,y:0},u={x:0,y:0},d={x:0,y:0},c={x:0,y:0},f={x:0,y:0},p={x:0,y:0},g={x:0,y:0},m={x:0,y:0},v={x:0,y:0},y={x:0,y:0},x={x:0,y:0},T=[0,0,0],w=[0,0,0],b=[0,0,0],S=[0,0,0],C=[0,0,0],E=[0,0,0],A=[0,0,0],_=[0,0,0],M={x:0,y:0},R={x:0,y:0},P={x:0,y:0},O=[0,0,0],L=[0,0,0],F=[0,0,0],D=[0,0,0];function I(t,e){return t.x*e.x+t.y*e.y}var N=function(t,e,i){var r,s=h,n=l,o=u,N=d,B=c,k=f,U=p,z=g,Y=m,X=v,W=y,G=x,V=T,H=w,j=b,q=S,K=C,Z=E,Q=A,J=_,$=M,tt=R,et=P,it=O,rt=L,st=F,nt=D,at=t[0],ot=t[1];s.x=at+.5*ot,s.y=ot,n.x=Math.floor(s.x),n.y=Math.floor(s.y),o.x=s.x-n.x,o.y=s.y-n.y;var ht=o.y<=o.x?1:0;if(N.x=ht,N.y=1-ht,B.x=n.x+N.x,B.y=n.y+N.y,k.x=n.x+1,k.y=n.y+1,U.x=n.x-.5*n.y,U.y=n.y,z.x=U.x+N.x-.5*N.y,z.y=U.y+N.y,Y.x=U.x+.5,Y.y=U.y+1,X.x=at-U.x,X.y=ot-U.y,W.x=at-z.x,W.y=ot-z.y,G.x=at-Y.x,G.y=ot-Y.y,e[0]>0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),r=0;r<3;r++)V[r]=Math.floor(j[r]+.5*q[r]+.5),H[r]=Math.floor(q[r]+.5);else V[0]=n.x,V[1]=B.x,V[2]=k.x,H[0]=n.y,H[1]=B.y,H[2]=k.y;for(V[0]+=a[0],V[1]+=a[0],V[2]+=a[0],H[0]+=a[1],H[1]+=a[1],H[2]+=a[1],r=0;r<3;r++)K[r]=V[r]%289,K[r]<0&&(K[r]+=289);for(r=0;r<3;r++)K[r]=((51*K[r]+2)*K[r]+H[r])%289;for(r=0;r<3;r++)K[r]=(34*K[r]+10)*K[r]%289;for(r=0;r<3;r++)Z[r]=.07482*K[r]+i,Q[r]=Math.cos(Z[r]),J[r]=Math.sin(Z[r]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),r=0;r<3;r++)it[r]=Math.max(it[r],0),rt[r]=it[r]*it[r],st[r]=rt[r]*rt[r];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(st[0]*nt[0]+st[1]*nt[1]+st[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],rt=[0,0,0,0],st=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],gt=[0,0,0,0],mt=[0,0,0,0],vt=[0,0,0,0],yt=[0,0,0,0],xt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],bt=[0,0,0,0],St=[0,0,0,0],Ct=[0,0,0,0],Et=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Pt=[0,0,0,0],Ot=function(t,e){for(var i=0;i<4;i++){var r=t[i]%289;r<0&&(r+=289),e[i]=(34*r+10)*r%289}},Lt=function(t,e,i){var r=B,s=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=V,f=H,p=j,g=q,m=K,v=Z,y=Q,x=J,T=$,w=tt,b=et,S=it,C=rt,E=st,A=nt,_=at,M=ot,R=ht,P=lt,O=ut,L=dt,F=ct,D=ft,I=pt,N=gt,Lt=mt,Ft=vt,Dt=yt,It=xt,Nt=Tt,Bt=wt,kt=bt,Ut=St,zt=Ct,Yt=Et,Xt=At,Wt=_t,Gt=Mt,Vt=Rt,Ht=Pt;r[0]=0*t[0]+1*t[1]+1*t[2],r[1]=1*t[0]+0*t[1]+1*t[2],r[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)s[jt]=Math.floor(r[jt]),n[jt]=r[jt]-s[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=s[jt]+d[jt],p[jt]=s[jt]+c[jt],g[jt]=s[jt]+1;var qt=s[0],Kt=s[1],Zt=s[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],re=g[0],se=g[1],ne=g[2];for(m[0]=-.5*qt+.5*Kt+.5*Zt,m[1]=.5*qt-.5*Kt+.5*Zt,m[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,y[0]=-.5*te+.5*ee+.5*ie,y[1]=.5*te-.5*ee+.5*ie,y[2]=.5*te+.5*ee-.5*ie,x[0]=-.5*re+.5*se+.5*ne,x[1]=.5*re-.5*se+.5*ne,x[2]=.5*re+.5*se-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-m[jt],w[jt]=t[jt]-v[jt],b[jt]=t[jt]-y[jt],S[jt]=t[jt]-x[jt];if(e[0]>0||e[1]>0||e[2]>0){if(C[0]=m[0],C[1]=v[0],C[2]=y[0],C[3]=x[0],E[0]=m[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],A[0]=m[2],A[1]=v[2],A[2]=y[2],A[3]=x[2],e[0]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=C[0],oe=E[0],he=A[0],le=C[1],ue=E[1],de=A[1],ce=C[2],fe=E[2],pe=A[2],ge=C[3],me=E[3],ve=A[3];s[0]=Math.floor(0*ae+1*oe+1*he+.5),s[1]=Math.floor(1*ae+0*oe+1*he+.5),s[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),g[0]=Math.floor(0*ge+1*me+1*ve+.5),g[1]=Math.floor(1*ge+0*me+1*ve+.5),g[2]=Math.floor(1*ge+1*me+0*ve+.5)}s[0]+=a[0],s[1]+=a[1],s[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],g[0]+=a[0],g[1]+=a[1],g[2]+=a[2];var ye=rt,xe=st;for(ye[0]=s[2],ye[1]=f[2],ye[2]=p[2],ye[3]=g[2],Ot(ye,xe),xe[0]+=s[1],xe[1]+=f[1],xe[2]+=p[1],xe[3]+=g[1],Ot(xe,ye),ye[0]+=s[0],ye[1]+=f[0],ye[2]+=p[0],ye[3]+=g[0],Ot(ye,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],P[jt]=.108705628*_[jt],O[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),F[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=O[jt]*F[jt],Ft[jt]=L[jt]*F[jt],Dt[jt]=R[jt],It[jt]=Math.sin(P[jt]),Nt[jt]=Math.cos(P[jt]),Bt[jt]=L[jt]*It[jt]-O[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*O[jt])+R[jt]*Nt[jt],zt[jt]=-(Ft[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),D[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Ft[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Dt[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)D[jt]=O[jt]*F[jt],I[jt]=L[jt]*F[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],be=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2],Se=Te*Te+we*we+be*be;Wt[jt]=.5-Se,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Vt[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ce=D[jt],Ee=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2];Ht[jt]=Ce*_e+Ee*Me+Ae*Re}var Pe=0;for(jt=0;jt<4;jt++)Pe+=Vt[jt]*Ht[jt];return 39.5*Pe};t.exports=function(t,r){"number"==typeof t&&(t=[t]),r||(r={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=r.noiseIterations||1,u=r.noiseWarpIterations||1,d=r.noiseDetailPower||2,c=r.noiseFlowPower||2,f=r.noiseContributionPower||2,p=r.noiseWarpDetailPower||2,g=r.noiseWarpFlowPower||2,m=r.noiseWarpContributionPower||2,v=r.noiseCells||[32,32,32],y=r.noiseOffset||[0,0,0],x=r.noiseWarpAmount||0;if(r.noiseSeed)for(var T=[1,2,3],w=0;w<h;w++)a[w]=void 0===r.noiseSeed[w]?T[w]:r.noiseSeed[w];for(w=0;w<h;w++)e[w]=t[w]*v[w]+y[w];if(x>0&&u>0&&h>=2)if(2===h){var b=o(u,2,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1];var S=o(u,2,i,r,p,g,m);e[0]+=b*x,e[1]+=S*x}else if(3===h){var C=o(u,3,e,r,p,g,m);i[0]=e[0]+s[0],i[1]=e[1]+s[1],i[2]=e[2]+s[2];var E=o(u,3,i,r,p,g,m);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,r,p,g,m);e[0]+=C*x,e[1]+=E*x,e[2]+=A*x}return o(l,h,e,r,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var r=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=r,this},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*s+a*o,c=h*s-n*o,f=e*u+i*d+r*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+r*h)*f,t[2]=(a*i-r*n)*f,t[3]=d*f,t[4]=(l*e-r*o)*f,t[5]=(-a*e+r*s)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=r*h-i*l,t[2]=i*a-r*n,t[3]=a*o-s*l,t[4]=e*l-r*o,t[5]=r*s-e*a,t[6]=s*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*s+a*o)+r*(h*s-n*o)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],g=d[3],m=d[4],v=d[5],y=d[6],x=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*r+f*a+p*l,e[2]=c*s+f*o+p*u,e[3]=g*i+m*n+v*h,e[4]=g*r+m*a+v*l,e[5]=g*s+m*o+v*u,e[6]=y*i+x*n+T*h,e[7]=y*r+x*a+T*l,e[8]=y*s+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,r=t.y;return e[6]=i*e[0]+r*e[3]+e[6],e[7]=i*e[1]+r*e[4]+e[7],e[8]=i*e[2]+r*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*r+h*a,e[2]=l*s+h*o,e[3]=l*n-h*i,e[4]=l*a-h*r,e[5]=l*o-h*s,this},scale:function(t){var e=this.val,i=t.x,r=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=r*e[3],e[4]=r*e[4],e[5]=r*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,r=t.z,s=t.w,n=e+e,a=i+i,o=r+r,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=r*o,p=s*n,g=s*a,m=s*o,v=this.val;return v[0]=1-(d+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=c+p,v[2]=u+g,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=r*h-s*o,T=r*l-n*o,w=r*u-a*o,b=s*l-n*h,S=s*u-a*h,C=n*u-a*l,E=d*m-c*g,A=d*v-f*g,_=d*y-p*g,M=c*v-f*m,R=c*y-p*m,P=f*y-p*v,O=x*P-T*R+w*M+b*_-S*A+C*E;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*_-o*P-u*A)*O,i[2]=(o*R-h*_+u*E)*O,i[3]=(n*R-s*P-a*M)*O,i[4]=(r*P-n*_+a*A)*O,i[5]=(s*_-r*R-a*E)*O,i[6]=(m*C-v*S+y*b)*O,i[7]=(v*w-g*C-y*T)*O,i[8]=(g*S-m*w+y*x)*O,this):null}});t.exports=r},37867(t,e,i){var r=i(83419),s=i(25836),n=1e-6,a=new r({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,r,s,n,a,o,h,l,u,d,c,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=r,m[4]=s,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=d,m[12]=c,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var r=o.fromQuat(i).val,s=e.x,n=e.y,a=e.z;return this.setValues(r[0]*s,r[1]*s,r[2]*s,0,r[4]*n,r[5]*n,r[6]*n,0,r[8]*a,r[9]*a,r[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var r=this.val;return r[12]=t,r[13]=e,r[14]=i,this},scaling:function(t,e,i){this.zero();var r=this.val;return r[0]=t,r[5]=e,r[10]=i,r[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],r=t[3],s=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=r,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*n,y=e*o-r*n,x=e*h-s*n,T=i*o-r*a,w=i*h-s*a,b=r*h-s*o,S=l*p-u*f,C=l*g-d*f,E=l*m-c*f,A=u*g-d*p,_=u*m-c*p,M=d*m-c*g,R=v*M-y*_+x*A+T*E-w*C+b*S;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(r*_-i*M-s*A)*R,(p*b-g*w+m*T)*R,(d*w-u*b-c*T)*R,(o*E-n*M-h*C)*R,(e*M-r*E+s*C)*R,(g*x-f*b-m*y)*R,(l*b-d*x+c*y)*R,(n*_-a*E+h*S)*R,(i*E-e*_-s*S)*R,(f*w-p*x+m*v)*R,(u*x-l*w-c*v)*R,(a*C-n*A-o*S)*R,(e*A-i*C+r*S)*R,(p*y-f*T-g*v)*R,(l*T-u*y+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(d*m-c*g)-u*(o*m-h*g)+p*(o*c-h*d),-(i*(d*m-c*g)-u*(r*m-s*g)+p*(r*c-s*d)),i*(o*m-h*g)-a*(r*m-s*g)+p*(r*h-s*o),-(i*(o*c-h*d)-a*(r*c-s*d)+u*(r*h-s*o)),-(n*(d*m-c*g)-l*(o*m-h*g)+f*(o*c-h*d)),e*(d*m-c*g)-l*(r*m-s*g)+f*(r*c-s*d),-(e*(o*m-h*g)-n*(r*m-s*g)+f*(r*h-s*o)),e*(o*c-h*d)-n*(r*c-s*d)+l*(r*h-s*o),n*(u*m-c*p)-l*(a*m-h*p)+f*(a*c-h*u),-(e*(u*m-c*p)-l*(i*m-s*p)+f*(i*c-s*u)),e*(a*m-h*p)-n*(i*m-s*p)+f*(i*h-s*a),-(e*(a*c-h*u)-n*(i*c-s*u)+l*(i*h-s*a)),-(n*(u*g-d*p)-l*(a*g-o*p)+f*(a*d-o*u)),e*(u*g-d*p)-l*(i*g-r*p)+f*(i*d-r*u),-(e*(a*g-o*p)-n*(i*g-r*p)+f*(i*o-r*a)),e*(a*d-o*u)-n*(i*d-r*u)+l*(i*o-r*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(d*m-c*g)-(e*o-r*n)*(u*m-c*p)+(e*h-s*n)*(u*g-d*p)+(i*o-r*a)*(l*m-c*f)-(i*h-s*a)*(l*g-d*f)+(r*h-s*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],r=e[1],s=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*a+w*u+b*p,e[1]=x*r+T*o+w*d+b*g,e[2]=x*s+T*h+w*c+b*m,e[3]=x*n+T*l+w*f+b*v,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*a+w*u+b*p,e[5]=x*r+T*o+w*d+b*g,e[6]=x*s+T*h+w*c+b*m,e[7]=x*n+T*l+w*f+b*v,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*a+w*u+b*p,e[9]=x*r+T*o+w*d+b*g,e[10]=x*s+T*h+w*c+b*m,e[11]=x*n+T*l+w*f+b*v,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*a+w*u+b*p,e[13]=x*r+T*o+w*d+b*g,e[14]=x*s+T*h+w*c+b*m,e[15]=x*n+T*l+w*f+b*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,r=e.val,s=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],T=r[0],w=r[4],b=r[8],S=r[12],C=r[1],E=r[5],A=r[9],_=r[13],M=r[2],R=r[6],P=r[10],O=r[14],L=r[3],F=r[7],D=r[11],I=r[15];return this.setValues(s*T+n*C+a*M+o*L,h*T+l*C+u*M+d*L,c*T+f*C+p*M+g*L,m*T+v*C+y*M+x*L,s*w+n*E+a*R+o*F,h*w+l*E+u*R+d*F,c*w+f*E+p*R+g*F,m*w+v*E+y*R+x*F,s*b+n*A+a*P+o*D,h*b+l*A+u*P+d*D,c*b+f*A+p*P+g*D,m*b+v*A+y*P+x*D,s*S+n*_+a*O+o*I,h*S+l*_+u*O+d*I,c*S+f*_+p*O+g*I,m*S+v*_+y*O+x*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var r=this.val;return r[12]=r[0]*t+r[4]*e+r[8]*i+r[12],r[13]=r[1]*t+r[5]*e+r[9]*i+r[13],r[14]=r[2]*t+r[6]*e+r[10]*i+r[14],r[15]=r[3]*t+r[7]*e+r[11]*i+r[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var r=this.val;return r[0]=r[0]*t,r[1]=r[1]*t,r[2]=r[2]*t,r[3]=r[3]*t,r[4]=r[4]*e,r[5]=r[5]*e,r[6]=r[6]*e,r[7]=r[7]*e,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.setValues(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,l*a+i,l*o-r*n,0,h*o-r*a,l*o+r*n,s*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,r=e.x,s=e.y,a=e.z,o=Math.sqrt(r*r+s*s+a*a);if(Math.abs(o)<n)return this;r*=o=1/o,s*=o,a*=o;var h=Math.sin(t),l=Math.cos(t),u=1-l,d=i[0],c=i[1],f=i[2],p=i[3],g=i[4],m=i[5],v=i[6],y=i[7],x=i[8],T=i[9],w=i[10],b=i[11],S=i[12],C=i[13],E=i[14],A=i[15],_=r*r*u+l,M=s*r*u+a*h,R=a*r*u-s*h,P=r*s*u-a*h,O=s*s*u+l,L=a*s*u+r*h,F=r*a*u+s*h,D=s*a*u-r*h,I=a*a*u+l;return this.setValues(d*_+g*M+x*R,c*_+m*M+T*R,f*_+v*M+w*R,p*_+y*M+b*R,d*P+g*O+x*L,c*P+m*O+T*L,f*P+v*O+w*L,p*P+y*O+b*L,d*F+g*D+x*I,c*F+m*D+T*I,f*F+v*D+w*I,p*F+y*D+b*I,S,C,E,A)},rotateX:function(t){var e=this.val,i=Math.sin(t),r=Math.cos(t),s=e[4],n=e[5],a=e[6],o=e[7],h=e[8],l=e[9],u=e[10],d=e[11];return e[4]=s*r+h*i,e[5]=n*r+l*i,e[6]=a*r+u*i,e[7]=o*r+d*i,e[8]=h*r-s*i,e[9]=l*r-n*i,e[10]=u*r-a*i,e[11]=d*r-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),r=Math.cos(t),s=e[0],n=e[1],a=e[2],o=e[3],h=e[8],l=e[9],u=e[10],d=e[11];return e[0]=s*r-h*i,e[1]=n*r-l*i,e[2]=a*r-u*i,e[3]=o*r-d*i,e[8]=s*i+h*r,e[9]=n*i+l*r,e[10]=a*i+u*r,e[11]=o*i+d*r,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),r=Math.cos(t),s=e[0],n=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=e[6],d=e[7];return e[0]=s*r+h*i,e[1]=n*r+l*i,e[2]=a*r+u*i,e[3]=o*r+d*i,e[4]=h*r-s*i,e[5]=l*r-n*i,e[6]=u*r-a*i,e[7]=d*r-o*i,this},fromRotationTranslation:function(t,e){var i=t.x,r=t.y,s=t.z,n=t.w,a=i+i,o=r+r,h=s+s,l=i*a,u=i*o,d=i*h,c=r*o,f=r*h,p=s*h,g=n*a,m=n*o,v=n*h;return this.setValues(1-(c+p),u+v,d-m,0,u-v,1-(l+p),f+g,0,d+m,f-g,1-(l+c),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,r=t.z,s=t.w,n=e+e,a=i+i,o=r+r,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=r*o,p=s*n,g=s*a,m=s*o;return this.setValues(1-(d+f),l+m,u-g,0,l-m,1-(h+f),c+p,0,u+g,c-p,1-(h+d),0,0,0,0,1)},frustum:function(t,e,i,r,s,n){var a=1/(e-t),o=1/(r-i),h=1/(s-n);return this.setValues(2*s*a,0,0,0,0,2*s*o,0,0,(e+t)*a,(r+i)*o,(n+s)*h,-1,0,0,n*s*2*h,0)},perspective:function(t,e,i,r){var s=1/Math.tan(t/2),n=1/(i-r);return this.setValues(s/e,0,0,0,0,s,0,0,0,0,(r+i)*n,-1,0,0,2*r*i*n,0)},perspectiveLH:function(t,e,i,r){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-r/(i-r),1,0,0,i*r/(i-r),0)},ortho:function(t,e,i,r,s,n){var a=t-e,o=i-r,h=s-n;return a=0===a?a:1/a,o=0===o?o:1/o,h=0===h?h:1/h,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(r+i)*o,(n+s)*h,1)},lookAtRH:function(t,e,i){var r=this.val;return d.subVectors(t,e),0===d.lengthSq()&&(d.z=1),d.normalize(),l.crossVectors(i,d),0===l.lengthSq()&&(1===Math.abs(i.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),l.crossVectors(i,d)),l.normalize(),u.crossVectors(d,l),r[0]=l.x,r[1]=l.y,r[2]=l.z,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[8]=d.x,r[9]=d.y,r[10]=d.z,this},lookAt:function(t,e,i){var r=t.x,s=t.y,a=t.z,o=i.x,h=i.y,l=i.z,u=e.x,d=e.y,c=e.z;if(Math.abs(r-u)<n&&Math.abs(s-d)<n&&Math.abs(a-c)<n)return this.identity();var f=r-u,p=s-d,g=a-c,m=1/Math.sqrt(f*f+p*p+g*g),v=h*(g*=m)-l*(p*=m),y=l*(f*=m)-o*g,x=o*p-h*f;(m=Math.sqrt(v*v+y*y+x*x))?(v*=m=1/m,y*=m,x*=m):(v=0,y=0,x=0);var T=p*x-g*y,w=g*v-f*x,b=f*y-p*v;return(m=Math.sqrt(T*T+w*w+b*b))?(T*=m=1/m,w*=m,b*=m):(T=0,w=0,b=0),this.setValues(v,T,f,0,y,w,p,0,x,b,g,0,-(v*r+y*s+x*a),-(T*r+w*s+b*a),-(f*r+p*s+g*a),1)},yawPitchRoll:function(t,e,i){this.zero(),o.zero(),h.zero();var r=this.val,s=o.val,n=h.val,a=Math.sin(i),l=Math.cos(i);return r[10]=1,r[15]=1,r[0]=l,r[1]=a,r[4]=-a,r[5]=l,a=Math.sin(e),l=Math.cos(e),s[0]=1,s[15]=1,s[5]=l,s[10]=l,s[9]=-a,s[6]=a,a=Math.sin(t),l=Math.cos(t),n[5]=1,n[15]=1,n[0]=l,n[2]=-a,n[8]=a,n[10]=l,this.multiplyLocal(o),this.multiplyLocal(h),this},setWorldMatrix:function(t,e,i,r,s){return this.yawPitchRoll(t.y,t.x,t.z),o.scaling(i.x,i.y,i.z),h.xyz(e.x,e.y,e.z),this.multiplyLocal(o),this.multiplyLocal(h),r&&this.multiplyLocal(r),s&&this.multiplyLocal(s),this},multiplyToMat4:function(t,e){var i=this.val,r=t.val,s=i[0],n=i[1],a=i[2],o=i[3],h=i[4],l=i[5],u=i[6],d=i[7],c=i[8],f=i[9],p=i[10],g=i[11],m=i[12],v=i[13],y=i[14],x=i[15],T=r[0],w=r[1],b=r[2],S=r[3],C=r[4],E=r[5],A=r[6],_=r[7],M=r[8],R=r[9],P=r[10],O=r[11],L=r[12],F=r[13],D=r[14],I=r[15];return e.setValues(T*s+w*h+b*c+S*m,w*n+w*l+b*f+S*v,b*a+w*u+b*p+S*y,S*o+w*d+b*g+S*x,C*s+E*h+A*c+_*m,C*n+E*l+A*f+_*v,C*a+E*u+A*p+_*y,C*o+E*d+A*g+_*x,M*s+R*h+P*c+O*m,M*n+R*l+P*f+O*v,M*a+R*u+P*p+O*y,M*o+R*d+P*g+O*x,L*s+F*h+D*c+I*m,L*n+F*l+D*f+I*v,L*a+F*u+D*p+I*y,L*o+F*d+D*g+I*x)},fromRotationXYTranslation:function(t,e,i){var r=e.x,s=e.y,n=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),u=r,d=s,c=n,f=-a,p=0-f*h,g=0-o*h,m=f*l,v=o*l;return i||(u=l*r+h*n,d=p*r+o*s+m*n,c=g*r+a*s+v*n),this.setValues(l,p,g,0,0,o,a,0,h,m,v,0,u,d,c,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}}),o=new a,h=new a,l=new s,u=new s,d=new s;t.exports=a},86883(t){t.exports=function(t,e,i){return Math.min(t+e,i)}},50040(t){t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort(function(t,e){return t-e});var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},37204(t){t.exports=function(t,e,i){return Math.max(t-e,i)}},65201(t){t.exports=function(t,e,i,r){void 0===i&&(i=e+1);var s=(t-e)/(i-e);return s>1?void 0!==r?(s=(r-t)/(r-i))<0&&(s=0):s=1:s<0&&(s=0),s}},15746(t,e,i){var r=i(83419),s=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new s,p=new r({initialize:function(t,e,i,r){this.onChangeCallback=n,this.set(t,e,i,r)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,r,s){return void 0===s&&(s=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=r||0),s&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this._x=t*s,this._y=e*s,this._z=i*s,this._w=r*s),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.set(i+e*(t.x-i),r+e*(t.y-r),s+e*(t.z-s),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length()<o&&c.copy(d).cross(t),c.normalize(),this.setAxisAngle(c,Math.PI)):i>.999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var r=f.val;return r[0]=e.x,r[3]=e.y,r[6]=e.z,r[1]=i.x,r[4]=i.y,r[7]=i.z,r[2]=-t.x,r[5]=-t.y,r[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+s*n+i*o-r*a,i*h+s*a+r*n-e*o,r*h+s*o+e*a-i*n,s*h-e*n-i*a-r*o)},slerp:function(t,e){var i=this.x,r=this.y,s=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+r*h+s*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),g=Math.sin(p);c=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(c*i+f*a,c*r+f*h,c*s+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r,n=s?1/s:0;return this.set(-t*n,-e*n,-i*n,r*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+s*n,i*a+r*n,r*a-i*n,s*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-r*n,i*a+s*n,r*a+e*n,s*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,r=this.z,s=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,r*a+s*n,s*a-r*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,r=t.y/2,s=t.z/2,n=Math.cos(i),a=Math.cos(r),o=Math.cos(s),h=Math.sin(i),l=Math.sin(r),u=Math.sin(s);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,r=i[0],s=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=r+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-s)*e,.25/e)):r>o&&r>d?(e=2*Math.sqrt(1+r-o-d),this.set(.25*e,(s+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-r-d),this.set((s+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-r-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-s)/e)),this},fromMat3:function(t){var e,i=t.val,r=i[0]+i[4]+i[8];if(r>0)e=Math.sqrt(r+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var n=h[s],a=h[n];e=Math.sqrt(i[3*s+s]-i[3*n+n]-i[3*a+a]+1),l[s]=.5*e,e=.5/e,l[n]=(i[3*n+s]+i[3*s+n])*e,l[a]=(i[3*a+s]+i[3*s+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var r=i(36383);t.exports=function(t){return t*r.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,r=2*Math.random()-1,s=Math.sqrt(1-r*r)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=r*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,r=t.y;return t.x=i*Math.cos(e)-r*Math.sin(e),t.y=i*Math.sin(e)+r*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,r){var s=Math.cos(r),n=Math.sin(r),a=t.x-e,o=t.y-i;return t.x=a*s-o*n+e,t.y=a*n+o*s+i,t}},1163(t){t.exports=function(t,e,i,r,s){var n=r+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(n),t.y=i+s*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,r,s){return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},72678(t,e,i){var r=i(25836),s=i(37867),n=i(15746),a=new s,o=new n,h=new r;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var r=Math.pow(i,-e);return Math.round(t*r)/r}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var r=i(26099);t.exports=function(t,e,i,s){void 0===s&&(s=new r);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),s.set(n,a)}},85955(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o,h){void 0===h&&(h=new r);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,g=1/(d*p+f*-c);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=d*g*e+-c*g*t+(-s*d+i*c)*g,h}},26099(t,e,i){var r=i(83419),s=i(43855),n=new r({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},invert:function(){return this.set(this.y,this.x)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return s(this.x,t.x,e)&&s(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this},transformMat3:function(t){var e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this},transformMat4:function(t){var e=this.x,i=this.y,r=t.val;return this.x=r[0]*e+r[4]*i+r[12],this.y=r[1]*e+r[5]*i+r[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)},projectUnit:function(t,e){void 0===e&&(e=new n);var i=this.x*t.x+this.y*t.y;return 0!==i&&(e.x=i*t.x,e.y=i*t.y),e}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},25836(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new r(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return Math.sqrt(e*e+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0;return e*e+i*i+r*r},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,r=t*t+e*e+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z;return this.x=i*a-r*n,this.y=r*s-e*a,this.z=e*n-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this},applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+r*s[6],this.y=e*s[1]+i*s[4]+r*s[7],this.z=e*s[2]+i*s[5]+r*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*r+s[12],this.y=s[1]*e+s[5]*i+s[9]*r+s[13],this.z=s[2]*e+s[6]*i+s[10]*r+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=e*s[0]+i*s[4]+r*s[8]+s[12],a=e*s[1]+i*s[5]+r*s[9]+s[13],o=e*s[2]+i*s[6]+r*s[10]+s[14],h=e*s[3]+i*s[7]+r*s[11]+s[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},project:function(t){var e=this.x,i=this.y,r=this.z,s=t.val,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],d=s[6],c=s[7],f=s[8],p=s[9],g=s[10],m=s[11],v=s[12],y=s[13],x=s[14],T=1/(e*h+i*c+r*m+s[15]);return this.x=(e*n+i*l+r*f+v)*T,this.y=(e*a+i*u+r*p+y)*T,this.z=(e*o+i*d+r*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,r=t.y,s=t.z,n=t.w,a=this.x-i,o=n-this.y-1-r,h=this.z;return this.x=2*a/s-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});r.ZERO=new r,r.RIGHT=new r(1,0,0),r.LEFT=new r(-1,0,0),r.UP=new r(0,-1,0),r.DOWN=new r(0,1,0),r.FORWARD=new r(0,0,1),r.BACK=new r(0,0,-1),r.ONE=new r(1,1,1),t.exports=r},61369(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0)},clone:function(){return new r(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,r){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=r||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return Math.sqrt(t*t+e*e+i*i+r*r)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,r=this.w;return t*t+e*e+i*i+r*r},normalize:function(){var t=this.x,e=this.y,i=this.z,r=this.w,s=t*t+e*e+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=r*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,r=this.y,s=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=r+e*(t.y-r),this.z=s+e*(t.z-s),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+r*r+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,r=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+r*r+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,r=this.z,s=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*r-a*i,l=o*i+a*e-s*r,u=o*r+s*i-n*e,d=-s*e-n*i-a*r;return this.x=h*o+d*-s+l*-a-u*-n,this.y=l*o+d*-n+u*-s-h*-a,this.z=u*o+d*-a+h*-n-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.distSq=r.prototype.distanceSq,r.prototype.len=r.prototype.length,r.prototype.lenSq=r.prototype.lengthSq,t.exports=r},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t){t.exports=function(t,e,i){var r=i-e;return e+((t-e)%r+r)%r}},31040(t){t.exports=function(t,e,i,r){return Math.atan2(r-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,r){return Math.atan2(i-t,r-e)}},1432(t,e,i){var r=i(36383);t.exports=function(t){return t>Math.PI&&(t-=r.TAU),Math.abs(((t+r.PI_OVER_2)%r.TAU-r.TAU)%r.TAU)}},49127(t,e,i){var r=i(12407);t.exports=function(t,e){return r(e-t)}},52285(t,e,i){var r=i(36383),s=i(12407),n=r.TAU;t.exports=function(t,e){var i=s(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var r=i(86554);t.exports=function(t,e){return r(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var r=i(99472);t.exports=function(){return r(-Math.PI,Math.PI)}},86564(t,e,i){var r=i(99472);t.exports=function(){return r(-180,180)}},90154(t,e,i){var r=i(12407);t.exports=function(t){return r(t+Math.PI)}},48736(t,e,i){var r=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=r.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=r.TAU:e-=r.TAU),e>t?t+=i:e<t&&(t-=i))),t}},61430(t){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},86554(t,e,i){var r=i(15994);t.exports=function(t){return r(t,-Math.PI,Math.PI)}},30954(t,e,i){var r=i(15994);t.exports=function(t){return r(t,-180,180)}},25588(t,e,i){t.exports={Between:i(31040),BetweenPoints:i(55495),BetweenPointsY:i(128),BetweenY:i(41273),CounterClockwise:i(1432),GetClockwiseDistance:i(49127),GetCounterClockwiseDistance:i(52285),GetShortestDistance:i(67317),Normalize:i(12407),Random:i(53993),RandomDegrees:i(86564),Reverse:i(90154),RotateTo:i(48736),ShortestBetween:i(61430),Wrap:i(86554),WrapDegrees:i(30954)}},36383(t){var e={TAU:2*Math.PI,PI_OVER_2:Math.PI/2,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},20339(t){t.exports=function(t,e,i,r){var s=t-i,n=e-r;return Math.sqrt(s*s+n*n)}},52816(t){t.exports=function(t,e){var i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)}},64559(t){t.exports=function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r}},82340(t){t.exports=function(t,e,i,r){return Math.max(Math.abs(t-i),Math.abs(e-r))}},14390(t){t.exports=function(t,e,i,r,s){return void 0===s&&(s=2),Math.sqrt(Math.pow(i-t,s)+Math.pow(r-e,s))}},2243(t){t.exports=function(t,e,i,r){return Math.abs(t-i)+Math.abs(e-r)}},89774(t){t.exports=function(t,e,i,r){var s=t-i,n=e-r;return s*s+n*n}},50994(t,e,i){t.exports={Between:i(20339),BetweenPoints:i(52816),BetweenPointsSquared:i(64559),Chebyshev:i(82340),Power:i(14390),Snake:i(2243),Squared:i(89774)}},62640(t,e,i){var r=i(54178),s=i(41521),n=i(79980),a=i(85433),o=i(99140),h=i(48857),l=i(81596),u=i(59133),d=i(98516),c=i(35248),f=i(82500),p=i(49752);t.exports={Power0:l,Power1:u.Out,Power2:a.Out,Power3:d.Out,Power4:c.Out,Linear:l,Quad:u.Out,Cubic:a.Out,Quart:d.Out,Quint:c.Out,Sine:f.Out,Expo:h.Out,Circ:n.Out,Elastic:o.Out,Back:r.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":a.In,"Quart.easeIn":d.In,"Quint.easeIn":c.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":n.In,"Elastic.easeIn":o.In,"Back.easeIn":r.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":d.Out,"Quint.easeOut":c.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":n.Out,"Elastic.easeOut":o.Out,"Back.easeOut":r.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":d.InOut,"Quint.easeInOut":c.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":n.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":r.InOut,"Bounce.easeInOut":s.InOut}},1639(t){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},50099(t){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},41286(t){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},54178(t,e,i){t.exports={In:i(1639),Out:i(41286),InOut:i(50099)}},59590(t){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},41788(t){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},69905(t){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},41521(t,e,i){t.exports={In:i(59590),Out:i(69905),InOut:i(41788)}},91861(t){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},4177(t){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},57512(t){t.exports=function(t){return Math.sqrt(1- --t*t)}},79980(t,e,i){t.exports={In:i(91861),Out:i(57512),InOut:i(4177)}},51150(t){t.exports=function(t){return t*t*t}},82820(t){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},35033(t){t.exports=function(t){return--t*t*t+1}},85433(t,e,i){t.exports={In:i(51150),Out:i(35033),InOut:i(82820)}},69965(t){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var r=i/4;return e<1?e=1:r=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/i)}},50665(t){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var r=i/4;return e<1?e=1:r=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/i)*.5+1}},7744(t){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var r=i/4;return e<1?e=1:r=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-r)*(2*Math.PI)/i)+1}},99140(t,e,i){t.exports={In:i(69965),Out:i(7744),InOut:i(50665)}},24590(t){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},87844(t){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},89433(t){t.exports=function(t){return 1-Math.pow(2,-10*t)}},48857(t,e,i){t.exports={In:i(24590),Out:i(89433),InOut:i(87844)}},48820(t,e,i){t.exports={Back:i(54178),Bounce:i(41521),Circular:i(79980),Cubic:i(85433),Elastic:i(99140),Expo:i(48857),Linear:i(81596),Quadratic:i(59133),Quartic:i(98516),Quintic:i(35248),Sine:i(82500),Stepped:i(49752)}},7147(t){t.exports=function(t){return t}},81596(t,e,i){t.exports=i(7147)},34826(t){t.exports=function(t){return t*t}},20544(t){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},92029(t){t.exports=function(t){return t*(2-t)}},59133(t,e,i){t.exports={In:i(34826),Out:i(92029),InOut:i(20544)}},64413(t){t.exports=function(t){return t*t*t*t}},78137(t){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},45840(t){t.exports=function(t){return 1- --t*t*t*t}},98516(t,e,i){t.exports={In:i(64413),Out:i(45840),InOut:i(78137)}},87745(t){t.exports=function(t){return t*t*t*t*t}},16509(t){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},17868(t){t.exports=function(t){return--t*t*t*t*t+1}},35248(t,e,i){t.exports={In:i(87745),Out:i(17868),InOut:i(16509)}},80461(t){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},34025(t){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},52768(t){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},82500(t,e,i){t.exports={In:i(80461),Out:i(52768),InOut:i(34025)}},72251(t){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},25777(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},5470(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},48379(t,e,i){t.exports={Ceil:i(75698),Equal:i(43855),Floor:i(25777),GreaterThan:i(5470),LessThan:i(94977)}},75508(t,e,i){var r=i(36383),s=i(79291),n={Angle:i(25588),Distance:i(50994),Easing:i(48820),Fuzzy:i(48379),Interpolation:i(38289),Pow2:i(49001),Snap:i(73697),RandomDataGenerator:i(28453),Average:i(53307),Bernstein:i(85710),Between:i(30976),CatmullRom:i(87842),CeilTo:i(26302),Clamp:i(45319),DegToRad:i(39506),Difference:i(61241),Euler:i(38857),Factorial:i(6411),FloatBetween:i(99472),FloorTo:i(77623),FromPercent:i(62945),GetCentroid:i(2672),GetSpeed:i(38265),GetVec2Bounds:i(55133),Hash:i(72958),HashCell:i(84854),HashSimplex:i(84366),IsEven:i(78702),IsEvenStrict:i(94883),Linear:i(28915),LinearXY:i(94908),MaxAdd:i(86883),Median:i(50040),MinSub:i(37204),Percent:i(65201),RadToDeg:i(43396),RandomXY:i(74362),RandomXYZ:i(60706),RandomXYZW:i(67421),Rotate:i(36305),RotateAround:i(11520),RotateAroundDistance:i(1163),RotateTo:i(70336),RoundAwayFromZero:i(2284),RoundTo:i(41013),SmootherStep:i(54261),SmoothStep:i(7602),ToXY:i(44408),TransformXY:i(85955),Within:i(60417),Wrap:i(15994),Vector2:i(26099),Vector3:i(25836),Vector4:i(61369),Matrix3:i(94434),Matrix4:i(37867),Quaternion:i(15746),RotateVec3:i(72678)};n=s(!1,n,r),t.exports=n},89318(t,e,i){var r=i(85710);t.exports=function(t,e){for(var i=0,s=t.length-1,n=0;n<=s;n++)i+=Math.pow(1-e,s-n)*Math.pow(e,n)*t[n]*r(s,n);return i}},77259(t,e,i){var r=i(87842);t.exports=function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return t[0]===t[i]?(e<0&&(n=Math.floor(s=i*(1+e))),r(s-n,t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i])):e<0?t[0]-(r(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(r(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):r(s-n,t[n?n-1:0],t[n],t[i<n+1?i:n+1],t[i<n+2?i:n+2])}},36316(t){t.exports=function(t,e,i,r,s){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,s)}},28392(t,e,i){var r=i(28915);t.exports=function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return e<0?r(t[0],t[1],s):e>1?r(t[i],t[i-1],i-s):r(t[n],t[n+1>i?i:n+1],s-n)}},32112(t){t.exports=function(t,e,i,r){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,r)}},47235(t,e,i){var r=i(7602);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},50178(t,e,i){var r=i(54261);t.exports=function(t,e,i){return e+(i-e)*r(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},50030(t){t.exports=function(t,e){return t>0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var r=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var r=0;r<t.length;r++)e=.02519603282416938*(i+=t.charCodeAt(r)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-.5)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(this.frac()*(e+1)),r=t[i];t[i]=t[e],t[e]=r}return t}});t.exports=r},63448(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),r?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),r?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,r){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),r?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},85454(t,e,i){i(63595);var r=i(8054),s=i(79291),n={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),Filters:i(11889),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:i(44563),Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),TintModes:i(84322),Tweens:i(43066),Utils:i(91799)};n.Sound=i(23717),n=s(!1,n,r),t.exports=n,i.g.Phaser=n},71289(t,e,i){var r=i(83419),s=i(92209),n=i(88571),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},86689(t,e,i){var r=i(83419),s=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,r,s,!1)},collideTiles:function(t,e,i,r,s){return this.world.collideTiles(t,e,i,r,s)},overlapTiles:function(t,e,i,r,s){return this.world.overlapTiles(t,e,i,r,s)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,r,s,n){void 0===r&&(r=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,r),void 0!==s&&void 0!==n&&t.body.maxVelocity.set(s,n),a},accelerateToObject:function(t,e,i,r,s){return this.accelerateTo(t,e.x,e.y,i,r,s)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,r=null,s=t.x,n=t.y,o=e.length,h=0;h<o;h++){var l=e[h],u=l.body||l;if(t!==l&&t!==u&&t!==u.gameObject&&t!==u.center){var d=a(s,n,u.center.x,u.center.y);d<i&&(r=l,i=d)}}return r},furthest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=-1,r=null,s=t.x,n=t.y,o=e.length,h=0;h<o;h++){var l=e[h],u=l.body||l;if(t!==l&&t!==u&&t!==u.gameObject&&t!==u.center){var d=a(s,n,u.center.x,u.center.y);d>i&&(r=l,i=d)}}return r},moveTo:function(t,e,i,r,s){void 0===r&&(r=60),void 0===s&&(s=0);var a=Math.atan2(i-t.y,e-t.x);return s>0&&(r=n(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(a,r),a},moveToObject:function(t,e,i,r){return this.moveTo(t,e.x,e.y,i,r)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,r,s,n){return d(this.world,t,e,i,r,s,n)},overlapCirc:function(t,e,i,r,s){return u(this.world,t,e,i,r,s)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759(t,e,i){var r=i(83419),s=i(92209),n=i(68287),a=new r({Extends:n,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Collision,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Pushable,s.Size,s.Velocity],initialize:function(t,e,i,r,s){n.call(this,t,e,i,r,s),this.body=null}});t.exports=a},37742(t,e,i){var r=i(83419),s=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new r({Mixins:[s],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=r,this.sourceWidth=i,this.sourceHeight=r,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(r/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var r=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,r=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,r=!0)}r&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,r=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,r),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,r=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var s=this.autoFrame;r.set((i.x-s.x)/t,(i.y-s.y)/t),this.world.updateMotion(this,t),this._dx=i.x-s.x,this._dy=i.y-s.y}else this.world.updateMotion(this,t),this.newVelocity.set(r.x*t,r.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=r.x,o=r.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,r=this.gameObject;if(this.moves){var s=this.deltaMax.x,a=this.deltaMax.y;0!==s&&0!==e&&(e<0&&e<-s?e=-s:e>0&&e>s&&(e=s)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),r&&(r.x+=e,r.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&r&&(r.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,r=this.customBoundsRectangle,s=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.x<r.x&&s.left?(t.x=r.x,e.x*=n,i.left=!0,o=!0):this.right>r.right&&s.right&&(t.x=r.right-this.width,e.x*=n,i.right=!0,o=!0),t.y<r.y&&s.up?(t.y=r.y,e.y*=a,i.up=!0,o=!0):this.bottom>r.bottom&&s.down&&(t.y=r.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&(!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r&&r.getCenter){var s=(r.width-t)/2,n=(r.height-e)/2;this.offset.set(s,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var r=this.position;i&&i.getTopLeft?i.getTopLeft(r):r.set(t,e),this.prev.copy(r),this.prevFrame.copy(r),this.autoFrame.copy(r),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,r,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,r,i+this.velocity.x/2,r+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,r){void 0===t&&(t=!0),this.collideWorldBounds=t;var s=void 0!==e,n=void 0!==i;return(s||n)&&(this.worldBounce||(this.worldBounce=new d),s&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==r&&(this.onWorldBounds=r),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,r){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var s=this.blocked;i&&(s.left=!0,s.none=!1),r&&(s.right=!0,s.none=!1)},processY:function(t,e,i,r){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var s=this.blocked;i&&(s.up=!0,s.none=!1),r&&(s.down=!0,s.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=r,this.collideCallback=s,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=r},66022(t,e,i){var r=i(71289),s=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,r,s){return this.world.addCollider(t,e,i,r,s)},overlap:function(t,e,i,r,s){return this.world.addOverlap(t,e,i,r,s)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,r){var s=new n(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.DYNAMIC_BODY),s},staticBody:function(t,e,i,r){var s=new l(this.world);return s.position.set(t,e),i&&r&&s.setSize(i,r),this.world.add(s,o.STATIC_BODY),s},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return e}},64897(t,e,i){var r=i(37747);t.exports=function(t,e,i,s){var n=0,a=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dx<e._dx&&(-(n=t.x-e.width-e.x)>a&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var r=i(37747);t.exports=function(t,e,i,s){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dy<e._dy&&(-(n=t.y-e.bottom)>a&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==r.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==r.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){if(i||s)if(l(i))s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",r)}),s=null}else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,s&&(s.classType=o(s,"classType",r)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(s,"collideWorldBounds",!1),setBoundsRectangle:o(s,"customBoundsRectangle",null),setAccelerationX:o(s,"accelerationX",0),setAccelerationY:o(s,"accelerationY",0),setAllowDrag:o(s,"allowDrag",!0),setAllowGravity:o(s,"allowGravity",!0),setAllowRotation:o(s,"allowRotation",!0),setDamping:o(s,"useDamping",!1),setBounceX:o(s,"bounceX",0),setBounceY:o(s,"bounceY",0),setDragX:o(s,"dragX",0),setDragY:o(s,"dragY",0),setEnable:o(s,"enable",!0),setGravityX:o(s,"gravityX",0),setGravityY:o(s,"gravityY",0),setFrictionX:o(s,"frictionX",0),setFrictionY:o(s,"frictionY",0),setMaxSpeed:o(s,"maxSpeed",-1),setMaxVelocityX:o(s,"maxVelocityX",1e4),setMaxVelocityY:o(s,"maxVelocityY",1e4),setVelocityX:o(s,"velocityX",0),setVelocityY:o(s,"velocityY",0),setAngularVelocity:o(s,"angularVelocity",0),setAngularAcceleration:o(s,"angularAcceleration",0),setAngularDrag:o(s,"angularDrag",0),setMass:o(s,"mass",1),setImmovable:o(s,"immovable",!1)},h.call(this,e,i,s),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var r=this.getChildren(),s=0;s<r.length;s++)r[s].body.velocity.set(t+s*i,e+s*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),r=0;r<i.length;r++)i[r].body.velocity.x=t+r*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),r=0;r<i.length;r++)i[r].body.velocity.y=t+r*e;return this}});t.exports=u},3017(t){var e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.right?(e.processX(-v,o,!1,!0),1):l&&m&&i.blocked.left?(e.processX(v,o,!0),1):f&&m&&e.blocked.right?(i.processX(-v,h,!1,!0),2):c&&g&&e.blocked.left?(i.processX(v,h,!0),2):0},x=function(t){if(r&&s)v*=.5,0===t||3===t?(e.processX(v,n),i.processX(-v,a)):(e.processX(-v,n),i.processX(v,a));else if(r&&!s)0===t||3===t?e.processX(v,o,!0):e.processX(-v,o,!1,!0);else if(!r&&s)0===t||3===t?i.processX(-v,h,!1,!0):i.processX(v,h,!0);else{var g=.5*v;0===t?p?(e.processX(v,0,!0),i.processX(0,null,!1,!0)):f?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.x,!0),i.processX(-g,null,!1,!0)):1===t?d?(e.processX(0,null,!1,!0),i.processX(v,0,!0)):u?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,null,!1,!0),i.processX(g,e.velocity.x,!0)):2===t?p?(e.processX(-v,0,!1,!0),i.processX(0,null,!0)):c?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,i.velocity.x,!1,!0),i.processX(g,null,!0)):3===t&&(d?(e.processX(0,null,!0),i.processX(-v,0,!1,!0)):l?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.x,!0),i.processX(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,r=i.velocity.x,s=Math.sqrt(r*r*i.mass/e.mass)*(r>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return r=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,s=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-T*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var r=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=r*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var r=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=r*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(r&&s)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(r&&!s)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!r&&s)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,r=i.velocity.y,s=Math.sqrt(r*r*i.mass/e.mass)*(r>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(s+o);return o-=h,n=h+(s-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return r=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,s=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-T*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var r=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=r*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var r=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=r*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var r=i(64897),s=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},89936(t,e,i){var r=i(45170),s=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=r(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=s.Set(t,e,a);return o||h?(o?s.RunImmovableBody1(l):h&&s.RunImmovableBody2(l),!0):l>0||s.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var r=i(87902),s=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new s({Mixins:[n],initialize:function(t,e){var i=64,r=64,s=void 0!==e;s&&e.displayWidth&&(i=e.displayWidth,r=e.displayHeight),s||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=s?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-r*e.originY),this.width=i,this.height=r,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var r=this.world;return this.gameObject&&this.gameObject.body&&(r.disable(this.gameObject),this.gameObject.body=null),t.body&&r.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var r=this.gameObject;if(r&&r.frame&&(t||(t=r.frame.realWidth),e||(e=r.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&r&&r.getCenter){var s=r.displayWidth/2,n=r.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?r(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,r=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,r,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var r=i(13759),s=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,s){i||s?l(i)?(s=i,i=null,s.internalCreateCallback=this.createCallbackHandler,s.internalRemoveCallback=this.removeCallbackHandler,s.createMultipleCallback=this.createMultipleCallbackHandler,s.classType=o(s,"classType",r)):Array.isArray(i)&&l(i[0])?(s=i,i=null,s.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",r)},this)):s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:s={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,s),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e<t.length;e++)t[e].body.reset();return this}});t.exports=u},82248(t,e,i){var r=i(55495),s=i(37742),n=i(45319),a=i(83419),o=i(79342),h=i(37747),l=i(20339),u=i(52816),d=i(50792),c=i(63012),f=i(43855),p=i(5470),g=i(94977),m=i(64897),v=i(45170),y=i(96523),x=i(35154),T=i(36383),w=i(25774),b=i(96602),S=i(87841),C=i(59542),E=i(40012),A=i(14087),_=i(89936),M=i(72624),R=i(2483),P=i(61340),O=i(26099),L=i(15994),F=new a({Extends:d,initialize:function(t,e){d.call(this),this.scene=t,this.bodies=new Set,this.staticBodies=new Set,this.pendingDestroy=new Set,this.colliders=new w,this.gravity=new O(x(e,"gravity.x",0),x(e,"gravity.y",0)),this.bounds=new S(x(e,"x",0),x(e,"y",0),x(e,"width",t.sys.scale.width),x(e,"height",t.sys.scale.height)),this.checkCollision={up:x(e,"checkCollision.up",!0),down:x(e,"checkCollision.down",!0),left:x(e,"checkCollision.left",!0),right:x(e,"checkCollision.right",!0)},this.fps=x(e,"fps",60),this.fixedStep=x(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(e,"timeScale",1),this.OVERLAP_BIAS=x(e,"overlapBias",4),this.TILE_BIAS=x(e,"tileBias",16),this.forceX=x(e,"forceX",!1),this.isPaused=x(e,"isPaused",!1),this._total=0,this.drawDebug=x(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(e,"debugShowBody",!0),debugShowStaticBody:x(e,"debugShowStaticBody",!0),debugShowVelocity:x(e,"debugShowVelocity",!0),bodyDebugColor:x(e,"debugBodyColor",16711935),staticBodyDebugColor:x(e,"debugStaticBodyColor",255),velocityDebugColor:x(e,"debugVelocityColor",65280)},this.maxEntries=x(e,"maxEntries",16),this.useTree=x(e,"useTree",!0),this.tree=new C(this.maxEntries),this.staticTree=new C(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new P,this._tempMatrix2=new P,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i];if(r.isParent)for(var s=r.getChildren(),n=0;n<s.length;n++){var a=s[n];a.isParent?this.enable(a,e):this.enableBody(a,e)}else this.enableBody(r,e)}},enableBody:function(t,e){return void 0===e&&(e=h.DYNAMIC_BODY),t.hasTransformComponent&&(t.body||(e===h.DYNAMIC_BODY?t.body=new s(this,t):e===h.STATIC_BODY&&(t.body=new M(this,t))),this.add(t.body)),t},add:function(t){return t.physicsType===h.DYNAMIC_BODY?this.bodies.add(t):t.physicsType===h.STATIC_BODY&&(this.staticBodies.add(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var r=i.getChildren(),s=0;s<r.length;s++){var n=r[s];n.isParent?this.disable(n):this.disableBody(n.body)}else this.disableBody(i.body)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===h.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===h.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},setBounds:function(t,e,i,r,s,n,a,o){return this.bounds.setTo(t,e,i,r),void 0!==s&&this.setBoundsCollision(s,n,a,o),this},setBoundsCollision:function(t,e,i,r){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===r&&(r=!0),this.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=r,this},pause:function(){return this.isPaused=!0,this.emit(c.PAUSE),this},resume:function(){return this.isPaused=!1,this.emit(c.RESUME),this},addCollider:function(t,e,i,r,s){void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i);var n=new o(this,!1,t,e,i,r,s);return this.colliders.add(n),n},addOverlap:function(t,e,i,r,s){void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i);var n=new o(this,!0,t,e,i,r,s);return this.colliders.add(n),n},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i=this._frameTime,r=this._frameTimeMS*this.timeScale;this._elapsed+=e;var s=this.bodies,n=this._elapsed>=r;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),s.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=r,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(s)));for(var a=this.colliders.update(),o=0;o<a.length;o++){var h=a[o];h.active&&h.update()}this.emit(c.WORLD_STEP,i)}for(;this._elapsed>=r;)this._elapsed-=r,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),r=0;r<i.length;r++){var s=i[r];s.active&&s.update()}this.emit(c.WORLD_STEP,t),this.stepsLastFrame++},singleStep:function(){this.update(0,this._frameTimeMS),this.postUpdate()},postUpdate:function(){var t=this.bodies,e=this.staticBodies;if(this.stepsLastFrame&&(this.stepsLastFrame=0,t.forEach(function(t){t.enable&&t.postUpdate()})),this.drawDebug){var i=this.debugGraphic;i.clear(),t.forEach(function(t){t.willDrawDebug()&&t.drawDebug(i)}),e.forEach(function(t){t.willDrawDebug()&&t.drawDebug(i)})}var r=this.pendingDestroy;if(r.size>0){var s=this.tree,n=this.staticTree;r.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(s.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),r.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,r=t.angularAcceleration,s=t.angularDrag,a=t.maxAngular;r?i+=r*e:t.allowDrag&&s&&(p(i-(s*=e),0,.1)?i-=s:g(i+s,0,.1)?i+=s:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,r=t.acceleration.x,s=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),r?i+=r*e:m&&s&&(v?(i*=s=Math.pow(s,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(s*=e),0,.01)?i-=s:g(i+s,0,.01)?i+=s:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,r,s){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e)||0===(t.collisionMask&e.collisionCategory)||0===(e.collisionMask&t.collisionCategory))return o;if(i&&!1===i.call(r,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,s);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;s?(u=A(t,e,s,f,n),d=_(t,e,s,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(u=A(t,e,s,f,n),this.intersects(t,e)&&(d=_(t,e,s,f,a))):(d=_(t,e,s,f,a),this.intersects(t,e)&&(u=A(t,e,s,f,n))),o=u||d}return o&&(s?(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e):(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e)),o},separateCircle:function(t,e,i){m(t,e,!1,0),v(t,e,!1,0);var s=t.isCircle,n=e.isCircle,a=t.center,o=e.center,h=t.immovable,d=e.immovable,c=t.velocity,f=e.velocity,p=0,g=!0;if(s!==n){g=!1;var y=a.x,x=a.y,w=t.halfWidth,b=e.position.x,S=e.position.y,C=e.right,E=e.bottom;n&&(y=o.x,x=o.y,w=e.halfWidth,b=t.position.x,S=t.position.y,C=t.right,E=t.bottom),x<S?y<b?p=l(y,x,b,S)-w:y>C&&(p=l(y,x,C,S)-w):x>E&&(y<b?p=l(y,x,b,E)-w:y>C&&(p=l(y,x,C,E)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=r(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=a.x-o.x,L=a.y-o.y,F=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),D=(o.x-a.x)/F||0,I=(o.y-a.y)/F||0,N=2*(c.x*D+c.y*I-f.x*D-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*D,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*D,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else h||!t.pushable&&!P||(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),r=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-r)*(t.center.y-r)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!0)},collide:function(t,e,i,r,s){return void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),this.collideObjects(t,e,i,r,s,!1)},collideObjects:function(t,e,i,r,s,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a<e.length;a++)this.collideHandler(t,e[a],i,r,s,n);else if(h&&!l)if(e)for(a=0;a<t.length;a++)this.collideHandler(t[a],e,i,r,s,n);else for(a=0;a<t.length;a++){var u=t[a];for(o=a+1;o<t.length;o++)a!==o&&this.collideHandler(u,t[o],i,r,s,n)}else for(a=0;a<t.length;a++)for(o=0;o<e.length;o++)this.collideHandler(t[a],e[o],i,r,s,n);else this.collideHandler(t,e,i,r,s,n);return this._total>0},collideHandler:function(t,e,i,r,s,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,r,s,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,r,s,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,r,s,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,r,s,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,r,s,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,r,s,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,r,s,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,r,s,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,r,s,n)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,r,s,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a<o;a++)u!==(l=c[a])&&l.enable&&!l.checkCollision.none&&e.contains(l.gameObject)&&this.separate(u,l,r,s,n)&&(i&&i.call(s,u.gameObject,l.gameObject),this._total++)}else{var f=e.getChildren(),p=f.indexOf(t);for(o=f.length,a=0;a<o;a++)(l=f[a].body)&&a!==p&&l.enable&&this.separate(u,l,r,s,n)&&(i&&i.call(s,u.gameObject,l.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,r,s,n){if(!this.canCollide(t,e))return!1;var a=t.getChildren();if(0===a.length)return!1;for(var o=!1,h=0;h<a.length;h++)(a[h].body||a[h].isBody)&&this.collideSpriteVsTilemapLayer(a[h],e,i,r,s,n)&&(o=!0);return o},collideTiles:function(t,e,i,r,s){return!(0===e.length||t.body&&!t.body.enable||t.isBody&&!t.enable)&&this.collideSpriteVsTilesHandler(t,e,i,r,s,!1,!1)},overlapTiles:function(t,e,i,r,s){return!(0===e.length||t.body&&!t.body.enable||t.isBody&&!t.enable)&&this.collideSpriteVsTilesHandler(t,e,i,r,s,!0,!1)},collideSpriteVsTilemapLayer:function(t,e,i,r,s,n){var a=t.isBody?t:t.body;if(!a.enable||a.checkCollision.none||!this.canCollide(a,e))return!1;var o=e.layer,h=a.x-o.tileWidth*e.scaleX,l=a.y-o.tileHeight*e.scaleY,u=a.width+o.tileWidth*e.scaleX,d=a.height+o.tileHeight*e.scaleY,c=n?null:this.tileFilterOptions,f=y(h,l,u,d,c,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,r,s,n,!0)},collideSpriteVsTilesHandler:function(t,e,i,r,s,n,a){for(var o,h,l=t.isBody?t:t.body,u={left:0,right:0,top:0,bottom:0},d=!1,f=0;f<e.length;f++){var p=(h=(o=e[f]).tilemapLayer).tileToWorldXY(o.x,o.y);u.left=p.x,u.top=p.y,u.right=u.left+o.width*h.scaleX,u.bottom=u.top+o.height*h.scaleY,R(u,l)&&(!r||r.call(s,t,o))&&b(o,t)&&(n||E(f,l,o,u,h,this.TILE_BIAS,a))&&(this._total++,d=!0,i&&i.call(s,t,o),n&&l.onOverlap?this.emit(c.TILE_OVERLAP,t,o,l):l.onCollide&&this.emit(c.TILE_COLLIDE,t,o,l))}return d},collideGroupVsGroup:function(t,e,i,r,s,n){if(0!==t.getLength()&&0!==e.getLength()&&this.canCollide(t,e))for(var a=t.getChildren(),o=0;o<a.length;o++)this.collideSpriteVsGroup(a[o],e,i,r,s,n)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=L(t.x,this.bounds.left-e,this.bounds.right+e),t.y=L(t.y,this.bounds.top-e,this.bounds.bottom+e)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null,this.debugGraphic&&(this.debugGraphic.destroy(),this.debugGraphic=null)}});t.exports=F},1093(t){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},59023(t){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62069(t){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,r){return this.body.setCollideWorldBounds(t,e,i,r),this}}},78389(t,e,i){var r=i(79599),s={setCollisionCategory:function(t){return(this.body?this.body:this).collisionCategory=t,this},willCollideWith:function(t){return 0!==((this.body?this.body:this).collisionMask&t)},addCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask|t,this},removeCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask&~t,this},setCollidesWith:function(t){return(this.body?this.body:this).collisionMask=r(t),this},resetCollisionCategory:function(){var t=this.body?this.body:this;return t.collisionCategory=1,t.collisionMask=2147483647,this}};t.exports=s},87118(t){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},52819(t){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},4074(t){var e={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,e,i,r,s){return t&&this.body.reset(e,i),r&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=e},40831(t){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},26775(t){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},9437(t){var e={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=e},30621(t){t.exports={setMass:function(t){return this.body.mass=t,this}}},72441(t,e,i){var r=i(47956),s=i(96503),n=i(2044),a=i(81491);t.exports=function(t,e,i,o,h,l){var u=r(t,e-o,i-o,2*o,2*o,h,l);if(0===u.length)return u;for(var d=new s(e,i,o),c=new s,f=[],p=0;p<u.length;p++){var g=u[p];g.isCircle?(c.setTo(g.center.x,g.center.y,g.halfWidth),n(d,c)&&f.push(g)):a(d,g)&&f.push(g)}return f}},47956(t){t.exports=function(t,e,i,r,s,n,a){void 0===n&&(n=!0),void 0===a&&(a=!1);var o=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+r,l.maxY=i+s,a&&(h=t.staticTree.search(l)),n&&t.useTree)o=t.tree.search(l);else if(n)for(var u=Array.from(t.bodies),d={position:{x:e,y:i},left:e,top:i,right:e+r,bottom:i+s,isCircle:!1},c=t.intersects,f=0;f<u.length;f++){var p=u[f];c(p,d)&&o.push(p)}return h.concat(o)}},62121(t){var e={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=e},29384(t){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},15098(t){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},92209(t,e,i){t.exports={Acceleration:i(1093),Angular:i(59023),Bounce:i(62069),Collision:i(78389),Debug:i(87118),Drag:i(52819),Enable:i(4074),Friction:i(40831),Gravity:i(26775),Immovable:i(9437),Mass:i(30621),OverlapCirc:i(72441),OverlapRect:i(47956),Pushable:i(62121),Size:i(29384),Velocity:i(15098)}},37747(t){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},20009(t){t.exports="collide"},36768(t){t.exports="overlap"},60473(t){t.exports="pause"},89954(t){t.exports="resume"},61804(t){t.exports="tilecollide"},7161(t){t.exports="tileoverlap"},34689(t){t.exports="worldbounds"},16006(t){t.exports="worldstep"},63012(t,e,i){t.exports={COLLIDE:i(20009),OVERLAP:i(36768),PAUSE:i(60473),RESUME:i(89954),TILE_COLLIDE:i(61804),TILE_OVERLAP:i(7161),WORLD_BOUNDS:i(34689),WORLD_STEP:i(16006)}},27064(t,e,i){var r=i(37747),s=i(79291),n={ArcadePhysics:i(86689),Body:i(37742),Collider:i(79342),Components:i(92209),Events:i(63012),Factory:i(66022),GetCollidesWith:i(79599),GetOverlapX:i(64897),GetOverlapY:i(45170),SeparateX:i(14087),SeparateY:i(89936),Group:i(60758),Image:i(71289),Sprite:i(13759),StaticBody:i(72624),StaticGroup:i(71464),Tilemap:i(55173),World:i(82248)};n=s(!1,n,r),t.exports=n},96602(t){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},36294(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var r=i(21329),s=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()<e.deltaAbsY()&&(x=-1),0!==e.deltaX()&&0!==e.deltaY()&&p&&g&&(y=Math.min(Math.abs(e.position.x-c),Math.abs(e.right-u)),x=Math.min(Math.abs(e.position.y-f),Math.abs(e.bottom-d))),y<x){if(p&&0!==(m=r(e,i,u,c,h,l))&&!n(a,e))return!0;g&&(v=s(e,i,d,f,h,l))}else{if(g&&0!==(v=s(e,i,d,f,h,l))&&!n(a,e))return!0;p&&(m=r(e,i,u,c,h,l))}return 0!==m||0!==v}},21329(t,e,i){var r=i(36294);t.exports=function(t,e,i,s,n,a){var o=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,d=e.collideRight;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaX()<0&&d&&t.checkCollision.left?l&&t.x<s&&(o=t.x-s)<-n&&(o=0):t.deltaX()>0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:r(t,o)),o}},53442(t,e,i){var r=i(67013);t.exports=function(t,e,i,s,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y<s&&(o=t.y-s)<-n&&(o=0):t.deltaY()>0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:r(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var r={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=r},44563(t,e,i){t.exports={Arcade:i(27064),Matter:i(3875)}},68174(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(){this.boundsCenter=new s,this.centerDiff=new s},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,r=t.bounds.max.x-t.bounds.min.x,s=t.bounds.max.y-t.bounds.min.y,n=r*t.centerOfMass.x,a=s*t.centerOfMass.y;return e.set(r/2,s/2),i.set(n-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+r.y+n.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i+r.y+n.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+r.y+n.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i+n.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.centerDiff;return new s(e+r.x,i+r.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i+n.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+r.x+n.x,i-(r.y-n.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e+n.x,i-(r.y-n.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var r=this.boundsCenter,n=this.centerDiff;return new s(e-(r.x-n.x),i-(r.y-n.y))}return!1}});t.exports=n},19933(t,e,i){var r=i(6790);r.Body=i(22562),r.Composite=i(69351),r.World=i(4372),r.Collision=i(52284),r.Detector=i(81388),r.Pairs=i(99561),r.Pair=i(4506),r.Query=i(73296),r.Resolver=i(66272),r.Constraint=i(48140),r.Common=i(53402),r.Engine=i(48413),r.Events=i(35810),r.Sleeping=i(53614),r.Plugin=i(73832),r.Bodies=i(66280),r.Composites=i(74116),r.Axes=i(66615),r.Bounds=i(15647),r.Svg=i(74058),r.Vector=i(31725),r.Vertices=i(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,t.exports=r},28137(t,e,i){var r=i(66280),s=i(83419),n=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),d=i(73834),c=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return this.world.add(a),a},trapezoid:function(t,e,i,s,n,a){var o=r.trapezoid(t,e,i,s,n,a);return this.world.add(o),o},circle:function(t,e,i,s,n){var a=r.circle(t,e,i,s,n);return this.world.add(a),a},polygon:function(t,e,i,s,n){var a=r.polygon(t,e,i,s,n);return this.world.add(a),a},fromVertices:function(t,e,i,s,n,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=r.fromVertices(t,e,i,s,n,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,r,s){void 0===s&&(s=!0);var n=c.parseBody(t,e,i,r);return s&&!this.world.has(n)&&this.world.add(n),n},fromSVG:function(t,e,i,s,n,a){void 0===s&&(s=1),void 0===n&&(n={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u<h.length;u++){var d=o.pathToVertices(h[u],30);1!==s&&g.scale(d,s,s),l.push(d)}var c=r.fromVertices(t,e,l,n);return a&&this.world.add(c),c},fromJSON:function(t,e,i,r,s){void 0===r&&(r={}),void 0===s&&(s=!0);var n=f.parseBody(t,e,i,r);return n&&s&&this.world.add(n),n},imageStack:function(t,e,i,r,s,a,o,h,u){void 0===o&&(o=0),void 0===h&&(h=0),void 0===u&&(u={});var d=this.world,c=this.sys.displayList;u.addToWorld=!1;var f=n.stack(i,r,s,a,o,h,function(i,r){var s=new l(d,i,r,t,e,u);return c.add(s),s.body});return d.add(f),f},stack:function(t,e,i,r,s,a,o){var h=n.stack(t,e,i,r,s,a,o);return this.world.add(h),h},pyramid:function(t,e,i,r,s,a,o){var h=n.pyramid(t,e,i,r,s,a,o);return this.world.add(h),h},chain:function(t,e,i,r,s,a){return n.chain(t,e,i,r,s,a)},mesh:function(t,e,i,r,s){return n.mesh(t,e,i,r,s)},newtonsCradle:function(t,e,i,r,s){var a=n.newtonsCradle(t,e,i,r,s);return this.world.add(a),a},car:function(t,e,i,r,s){var a=n.car(t,e,i,r,s);return this.world.add(a),a},softBody:function(t,e,i,r,s,a,o,h,l,u){var d=n.softBody(t,e,i,r,s,a,o,h,l,u);return this.world.add(d),d},joint:function(t,e,i,r,s){return this.constraint(t,e,i,r,s)},spring:function(t,e,i,r,s){return this.constraint(t,e,i,r,s)},constraint:function(t,e,i,r,s){void 0===r&&(r=1),void 0===s&&(s={}),s.bodyA="body"===t.type?t:t.body,s.bodyB="body"===e.type?e:e.body,isNaN(i)||(s.length=i),s.stiffness=r;var n=a.create(s);return this.world.add(n),n},worldConstraint:function(t,e,i,r){void 0===i&&(i=1),void 0===r&&(r={}),r.bodyB="body"===t.type?t:t.body,isNaN(e)||(r.length=e),r.stiffness=i;var s=a.create(r);return this.world.add(s),s},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new p(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,r,s){var n=new l(this.world,t,e,i,r,s);return this.sys.displayList.add(n),n},tileBody:function(t,e){return new d(this.world,t,e)},sprite:function(t,e,i,r,s){var n=new u(this.world,t,e,i,r,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),n},gameObject:function(t,e,i){return h(this.world,t,e,i)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=m},75803(t,e,i){var r=i(9503),s=i(95540),n=i(26099);function a(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var h=e.x,l=e.y;if(e.body={temp:!0,position:{x:h,y:l}},[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity].forEach(function(t){for(var i in t)a(t[i])?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]})}),e.world=t,e._tempVec2=new n(h,l),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var u=s(i,"shape",null);u||(u="rectangle"),i.addToWorld=o,e.setBody(u,i)}return e}},23181(t,e,i){var r=i(83419),s=i(9503),n=i(95643),a=i(95540),o=i(88571),h=i(26099),l=new r({Extends:o,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity],initialize:function(t,e,i,r,s,o){n.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(r,s),this.setSizeToFrame(),this.setOrigin(),this.initRenderNodes(this._defaultRenderNodesMap),this.world=t,this._tempVec2=new h(e,i);var l=a(o,"shape",null);l?this.setBody(l,o):this.setRectangle(this.width,this.height,o),this.setPosition(e,i)}});t.exports=l},42045(t,e,i){var r=i(60461),s=i(66615),n=i(66280),a=i(22562),o=i(68174),h=i(15647),l=i(83419),u=i(52284),d=i(53402),c=i(69351),f=i(74116),p=i(48140),g=i(81388),m=i(20339),v=i(28137),y=i(95540),x=i(35154),T=i(46975),w=i(4506),b=i(99561),S=i(37277),C=i(73296),E=i(66272),A=i(44594),_=i(74058),M=i(31725),R=i(41598),P=i(68243);d.setDecomp(i(55973));var O=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=a,this.composite=c,this.collision=u,this.detector=g,this.pair=w,this.pairs=b,this.query=C,this.resolver=E,this.constraint=p,this.bodies=n,this.composites=f,this.axes=s,this.bounds=h,this.svg=_,this.vector=M,this.vertices=R,this.verts=R,this._tempVec2=M.create(),E._restingThresh=x(this.config,"restingThresh",4),E._restingThreshTangent=x(this.config,"restingThreshTangent",6),E._positionDampen=x(this.config,"positionDampen",.9),E._positionWarming=x(this.config,"positionWarming",.8),E._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),t.sys.events.once(A.BOOT,this.boot,this),t.sys.events.on(A.START,this.start,this)},boot:function(){this.world=new P(this.scene,this.config),this.add=new v(this.world),this.bodyBounds=new o,this.systems.events.once(A.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new P(this.scene,this.config),this.add=new v(this.world));var t=this.systems.events;t.on(A.UPDATE,this.world.update,this.world),t.on(A.POST_UPDATE,this.world.postUpdate,this.world),t.once(A.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return T(y(e,"matter",{}),y(t,"matter",{}))},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var r=M.create(e,i);return C.point(t,r).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var r=M.create(t,e),s=[];return C.point(i,r).forEach(function(t){-1===s.indexOf(t)&&s.push(t)}),s},intersectRect:function(t,e,i,r,s,n){void 0===s&&(s=!1),n=this.getMatterBodies(n);var a={min:{x:t,y:e},max:{x:t+i,y:e+r}},o=[];return C.region(n,a,s).forEach(function(t){-1===o.indexOf(t)&&o.push(t)}),o},intersectRay:function(t,e,i,r,s,n){void 0===s&&(s=1),n=this.getMatterBodies(n);for(var a=[],o=C.ray(n,M.create(t,e),M.create(i,r),s),h=0;h<o.length;h++)a.push(o[h].body);return a},intersectBody:function(t,e){e=this.getMatterBodies(e);for(var i=[],r=C.collides(t,e),s=0;s<r.length;s++){var n=r[s];n.bodyA===t?i.push(n.bodyB):i.push(n.bodyA)}return i},overlap:function(t,e,i,r,s){void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=i),Array.isArray(t)||(t=[t]),t=this.getMatterBodies(t),e=this.getMatterBodies(e);for(var n=!1,a=0;a<t.length;a++)for(var o=t[a],h=C.collides(o,e),l=0;l<h.length;l++){var u=h[l],d=u.bodyA.id===o.id?u.bodyB:u.bodyA;if(!r||r.call(s,o,d,u))if(n=!0,i)i.call(s,o,d,u);else if(!r)return!0}return n},setCollisionCategory:function(t,e){return(t=this.getMatterBodies(t)).forEach(function(t){t.collisionFilter.category=e}),this},setCollisionGroup:function(t,e){return(t=this.getMatterBodies(t)).forEach(function(t){t.collisionFilter.group=e}),this},setCollidesWith:function(t,e){t=this.getMatterBodies(t);var i=0;if(Array.isArray(e))for(var r=0;r<e.length;r++)i|=e[r];else i=e;return t.forEach(function(t){t.collisionFilter.mask=i}),this},getMatterBodies:function(t){if(!t)return this.world.getAllBodies();Array.isArray(t)||(t=[t]);for(var e=[],i=0;i<t.length;i++){var r=t[i].hasOwnProperty("body")?t[i].body:t[i];e.push(r)}return e},setVelocity:function(t,e,i){t=this.getMatterBodies(t);var r=this._tempVec2;return r.x=e,r.y=i,t.forEach(function(t){a.setVelocity(t,r)}),this},setVelocityX:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.x=e,t.forEach(function(t){i.y=t.velocity.y,a.setVelocity(t,i)}),this},setVelocityY:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.y=e,t.forEach(function(t){i.x=t.velocity.x,a.setVelocity(t,i)}),this},setAngularVelocity:function(t,e){return(t=this.getMatterBodies(t)).forEach(function(t){a.setAngularVelocity(t,e)}),this},applyForce:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return t.forEach(function(t){i.x=t.position.x,i.y=t.position.y,a.applyForce(t,i,e)}),this},applyForceFromPosition:function(t,e,i,r){t=this.getMatterBodies(t);var s=this._tempVec2;return t.forEach(function(t){void 0===r&&(r=t.angle),s.x=i*Math.cos(r),s.y=i*Math.sin(r),a.applyForce(t,e,s)}),this},applyForceFromAngle:function(t,e,i){t=this.getMatterBodies(t);var r=this._tempVec2;return t.forEach(function(t){void 0===i&&(i=t.angle),r.x=e*Math.cos(i),r.y=e*Math.sin(i),a.applyForce(t,{x:t.position.x,y:t.position.y},r)}),this},getConstraintLength:function(t){var e=t.pointA.x,i=t.pointA.y,r=t.pointB.x,s=t.pointB.y;return t.bodyA&&(e+=t.bodyA.position.x,i+=t.bodyA.position.y),t.bodyB&&(r+=t.bodyB.position.x,s+=t.bodyB.position.y),m(e,i,r,s)},alignBody:function(t,e,i,s){var n;switch(t=t.hasOwnProperty("body")?t.body:t,s){case r.TOP_LEFT:case r.LEFT_TOP:n=this.bodyBounds.getTopLeft(t,e,i);break;case r.TOP_CENTER:n=this.bodyBounds.getTopCenter(t,e,i);break;case r.TOP_RIGHT:case r.RIGHT_TOP:n=this.bodyBounds.getTopRight(t,e,i);break;case r.LEFT_CENTER:n=this.bodyBounds.getLeftCenter(t,e,i);break;case r.CENTER:n=this.bodyBounds.getCenter(t,e,i);break;case r.RIGHT_CENTER:n=this.bodyBounds.getRightCenter(t,e,i);break;case r.LEFT_BOTTOM:case r.BOTTOM_LEFT:n=this.bodyBounds.getBottomLeft(t,e,i);break;case r.BOTTOM_CENTER:n=this.bodyBounds.getBottomCenter(t,e,i);break;case r.BOTTOM_RIGHT:case r.RIGHT_BOTTOM:n=this.bodyBounds.getBottomRight(t,e,i)}return n&&a.setPosition(t,n),this},shutdown:function(){var t=this.systems.events;this.world&&(t.off(A.UPDATE,this.world.update,this.world),t.off(A.POST_UPDATE,this.world.postUpdate,this.world)),t.off(A.SHUTDOWN,this.shutdown,this),this.add&&this.add.destroy(),this.world&&this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off(A.START,this.start,this),this.scene=null,this.systems=null}});S.register("MatterPhysics",O,"matterPhysics"),t.exports=O},34803(t,e,i){var r=i(9674),s=i(83419),n=i(9503),a=i(95643),o=i(95540),h=i(68287),l=i(26099),u=new s({Extends:h,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity],initialize:function(t,e,i,s,n,h){a.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.initRenderNodes(this._defaultRenderNodesMap),this.world=t,this._tempVec2=new l(e,i);var u=o(h,"shape",null);u?this.setBody(u,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i)}});t.exports=u},73834(t,e,i){var r=i(66280),s=i(22562),n=i(83419),a=i(9503),o=i(62644),h=i(50792),l=i(95540),u=i(97022),d=i(41598),c=new n({Extends:h,Mixins:[a.Bounce,a.Collision,a.Friction,a.Gravity,a.Mass,a.Sensor,a.Sleep,a.Static],initialize:function(t,e,i){h.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var r=l(i,"body",null),n=l(i,"addToWorld",!0);if(r)this.setBody(r,n);else{var a=e.getCollisionGroup();l(a,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i),r=this.body}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,d=e.flipY?-1:1;s.scale(r,u,d,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,n=r.rectangle(i,s,e.width,e.height,t);return this.setBody(n,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),c=l(h,"objects",[]),f=[],p=0;p<c.length;p++){var g=c[p],m=n+g.x*e,v=a+g.y*i,y=g.width*e,x=g.height*i,T=null;if(g.rectangle)T=r.rectangle(m+y/2,v+x/2,y,x,t);else if(g.ellipse)T=r.circle(m+y/2,v+x/2,y/2,t);else if(g.polygon||g.polyline){var w=(g.polygon?g.polygon:g.polyline).map(function(t){return{x:t.x*e,y:t.y*i}}),b=d.create(w),S=d.centre(b);m+=S.x,v+=S.y,T=r.fromVertices(m,v,b,t)}T&&f.push(T)}if(1===f.length)this.setBody(f[0],t.addToWorld);else if(f.length>1){var C=o(t);C.parts=f,this.setBody(s.create(C),C.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},19496(t,e,i){var r=i(66280),s=i(22562),n=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,r){void 0===r&&(r={});for(var o=a(i,"fixtures",[]),h=[],l=0;l<o.length;l++)for(var u=this.parseFixture(o[l]),d=0;d<u.length;d++)h.push(u[d]);var c=n.clone(i,!0);n.extend(c,r,!0),delete c.fixtures,delete c.type;var f=s.create(c);return s.setParts(f,h),s.setPosition(f,{x:t,y:e}),f},parseFixture:function(t){var e,i=n.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var s=a(t.circle,"x"),o=a(t.circle,"y"),h=a(t.circle,"radius");e=[r.circle(s,o,h,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){void 0===e&&(e={});for(var i=[],a=0;a<t.length;a++)o.clockwiseSort(t[a]),i.push(s.create(n.extend({position:o.centre(t[a]),vertices:t[a]},e)));return r.flagCoincidentParts(i)}};t.exports=h},85791(t,e,i){var r=i(66280),s=i(22562),n={parseBody:function(t,e,i,n){var a;void 0===n&&(n={});var o=i.vertices;if(1===o.length)n.vertices=o[0],a=s.create(n),r.flagCoincidentParts(a.parts);else{for(var h=[],l=0;l<o.length;l++){var u=s.create({vertices:o[l]});h.push(u)}r.flagCoincidentParts(h),n.parts=h,a=s.create(n)}return a.label=i.label,s.setPosition(a,{x:t,y:e}),a}};t.exports=n},98713(t,e,i){var r=i(15647),s=i(83419),n=i(69351),a=i(48140),o=i(81388),h=i(1121),l=i(8214),u=i(46975),d=i(53614),c=i(26099),f=i(41598),p=new s({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new c,this.body=null,this.part=null,this.constraint=a.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var s=n.allBodies(this.world.localWorld),a=0;a<s.length;a++){var l=s[a];if(!l.ignorePointer&&r.contains(l.bounds,e)&&o.canCollide(l.collisionFilter,i.collisionFilter)&&this.hitTestBody(l,e))return this.world.emit(h.DRAG_START,l,this.part,this),!0}return!1},hitTestBody:function(t,e){for(var i=this.constraint,r=t.parts.length,s=r>1?1:0;s<r;s++){var n=t.parts[s];if(f.contains(n.vertices,e))return i.pointA=e,i.pointB={x:e.x-t.position.x,y:e.y-t.position.y},i.bodyB=t,i.angleB=t.angle,d.set(t,!1),this.part=n,this.body=t,!0}return!1},update:function(){var t=this.pointer,e=this.body;if(this.active&&t)if(t.isDown||!e){if(t.isDown){if(!this.camera||!e&&!this.getBody(t))return;e=this.body;var i=this.position,r=this.constraint;this.camera.getWorldPoint(t.x,t.y,i),r.pointA.x=i.x,r.pointA.y=i.y,d.set(e,!1),this.world.emit(h.DRAG,e,this)}}else this.stopDrag();else e&&this.stopDrag()},stopDrag:function(){var t=this.body,e=this.constraint;e.bodyB=null,e.pointB=null,this.pointer=null,this.body=null,this.part=null,t&&this.world.emit(h.DRAG_END,t,this)},destroy:function(){this.world.removeConstraint(this.constraint),this.pointer=null,this.constraint=null,this.body=null,this.part=null,this.world.off(h.BEFORE_UPDATE,this.update),this.scene.sys.input.off(l.POINTER_DOWN,this.onDown,this),this.scene.sys.input.off(l.POINTER_UP,this.onUp,this)}});t.exports=p},68243(t,e,i){var r=i(66280),s=i(22562),n=i(83419),a=i(53402),o=i(69351),h=i(48413),l=i(50792),u=i(1121),d=i(95540),c=i(35154),f=i(22562),p=i(35810),g=i(73834),m=i(4372),v=i(13037),y=i(31725),x=new n({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=c(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=c(e,"enabled",!0),this.getDelta=c(e,"getDelta",this.update60Hz);var r=d(e,"runner",{});d(r,"fps",!1)&&(r.delta=1e3/d(r,"fps",60)),this.runner=v.create(r),this.autoUpdate=c(e,"autoUpdate",!0);var s=c(e,"debug",!1);if(this.drawDebug="object"==typeof s||s,this.debugGraphic,this.debugConfig={showAxes:d(s,"showAxes",!1),showAngleIndicator:d(s,"showAngleIndicator",!1),angleColor:d(s,"angleColor",15208787),showBroadphase:d(s,"showBroadphase",!1),broadphaseColor:d(s,"broadphaseColor",16757760),showBounds:d(s,"showBounds",!1),boundsColor:d(s,"boundsColor",16777215),showVelocity:d(s,"showVelocity",!1),velocityColor:d(s,"velocityColor",44783),showCollisions:d(s,"showCollisions",!1),collisionColor:d(s,"collisionColor",16094476),showSeparations:d(s,"showSeparations",!1),separationColor:d(s,"separationColor",16753920),showBody:d(s,"showBody",!0),showStaticBody:d(s,"showStaticBody",!0),showInternalEdges:d(s,"showInternalEdges",!1),renderFill:d(s,"renderFill",!1),renderLine:d(s,"renderLine",!0),fillColor:d(s,"fillColor",1075465),fillOpacity:d(s,"fillOpacity",1),lineColor:d(s,"lineColor",2678297),lineOpacity:d(s,"lineOpacity",1),lineThickness:d(s,"lineThickness",1),staticFillColor:d(s,"staticFillColor",857979),staticLineColor:d(s,"staticLineColor",1255396),showSleeping:d(s,"showSleeping",!1),staticBodySleepOpacity:d(s,"staticBodySleepOpacity",.7),sleepFillColor:d(s,"sleepFillColor",4605510),sleepLineColor:d(s,"sleepLineColor",10066585),showSensors:d(s,"showSensors",!0),sensorFillColor:d(s,"sensorFillColor",857979),sensorLineColor:d(s,"sensorLineColor",1255396),showPositions:d(s,"showPositions",!0),positionSize:d(s,"positionSize",4),positionColor:d(s,"positionColor",14697178),showJoint:d(s,"showJoint",!0),jointColor:d(s,"jointColor",14737474),jointLineOpacity:d(s,"jointLineOpacity",1),jointLineThickness:d(s,"jointLineThickness",2),pinSize:d(s,"pinSize",4),pinColor:d(s,"pinColor",4382944),springColor:d(s,"springColor",14697184),anchorColor:d(s,"anchorColor",15724527),anchorSize:d(s,"anchorSize",4),showConvexHulls:d(s,"showConvexHulls",!1),hullColor:d(s,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),d(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var a=d(n,"x",0),o=d(n,"y",0),u=d(n,"width",t.sys.scale.width),f=d(n,"height",t.sys.scale.height),p=d(n,"thickness",64),g=d(n,"left",!0),m=d(n,"right",!0),y=d(n,"top",!0),x=d(n,"bottom",!0);this.setBounds(a,o,u,f,p,g,m,y,x)}}},setCompositeRenderStyle:function(t){var e,i,r,s=t.bodies,n=t.constraints,a=t.composites;for(e=0;e<s.length;e++)r=(i=s[e]).render,this.setBodyRenderStyle(i,r.lineColor,r.lineOpacity,r.lineThickness,r.fillColor,r.fillOpacity);for(e=0;e<n.length;e++)r=(i=n[e]).render,this.setConstraintRenderStyle(i,r.lineColor,r.lineOpacity,r.lineThickness,r.pinSize,r.anchorColor,r.anchorSize);for(e=0;e<a.length;e++)i=a[e],this.setCompositeRenderStyle(i);return this},setBodyRenderStyle:function(t,e,i,r,s,n){var a=t.render,o=this.debugConfig;return a?(null==e&&(e=t.isStatic?o.staticLineColor:o.lineColor),null==i&&(i=o.lineOpacity),null==r&&(r=o.lineThickness),null==s&&(s=t.isStatic?o.staticFillColor:o.fillColor),null==n&&(n=o.fillOpacity),!1!==e&&(a.lineColor=e),!1!==i&&(a.lineOpacity=i),!1!==r&&(a.lineThickness=r),!1!==s&&(a.fillColor=s),!1!==n&&(a.fillOpacity=n),this):this},setConstraintRenderStyle:function(t,e,i,r,s,n,a){var o=t.render,h=this.debugConfig;if(!o)return this;if(null==e){var l=o.type;"line"===l?e=h.jointColor:"pin"===l?e=h.pinColor:"spring"===l&&(e=h.springColor)}return null==i&&(i=h.jointLineOpacity),null==r&&(r=h.jointLineThickness),null==s&&(s=h.pinSize),null==n&&(n=h.anchorColor),null==a&&(a=h.anchorSize),!1!==e&&(o.lineColor=e),!1!==i&&(o.lineOpacity=i),!1!==r&&(o.lineThickness=r),!1!==s&&(o.pinSize=s),!1!==n&&(o.anchorColor=n),!1!==a&&(o.anchorSize=a),this},setEventsProxy:function(){var t=this,e=this.engine,i=this.localWorld;this.drawDebug&&(p.on(i,"compositeModified",function(e){t.setCompositeRenderStyle(e)}),p.on(i,"beforeAdd",function(e){for(var i=[].concat(e.object),r=0;r<i.length;r++){var s=i[r],n=s.render;"body"===s.type?t.setBodyRenderStyle(s,n.lineColor,n.lineOpacity,n.lineThickness,n.fillColor,n.fillOpacity):"composite"===s.type?t.setCompositeRenderStyle(s):"constraint"===s.type&&t.setConstraintRenderStyle(s,n.lineColor,n.lineOpacity,n.lineThickness,n.pinSize,n.anchorColor,n.anchorSize)}})),p.on(i,"beforeAdd",function(e){t.emit(u.BEFORE_ADD,e)}),p.on(i,"afterAdd",function(e){t.emit(u.AFTER_ADD,e)}),p.on(i,"beforeRemove",function(e){t.emit(u.BEFORE_REMOVE,e)}),p.on(i,"afterRemove",function(e){t.emit(u.AFTER_REMOVE,e)}),p.on(e,"beforeUpdate",function(e){t.emit(u.BEFORE_UPDATE,e)}),p.on(e,"afterUpdate",function(e){t.emit(u.AFTER_UPDATE,e)}),p.on(e,"collisionStart",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,r,t),r.gameObject&&r.gameObject.emit("collide",r,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(r,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),r.onCollideCallback&&r.onCollideCallback(t),i.onCollideWith[r.id]&&i.onCollideWith[r.id](r,t),r.onCollideWith[i.id]&&r.onCollideWith[i.id](i,t)}),t.emit(u.COLLISION_START,e,i,r)}),p.on(e,"collisionActive",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,r,t),r.gameObject&&r.gameObject.emit("collideActive",r,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(r,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),r.onCollideActiveCallback&&r.onCollideActiveCallback(t)}),t.emit(u.COLLISION_ACTIVE,e,i,r)}),p.on(e,"collisionEnd",function(e){var i,r,s=e.pairs;s.length>0&&s.map(function(t){i=t.bodyA,r=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,r,t),r.gameObject&&r.gameObject.emit("collideEnd",r,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(r,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),r.onCollideEndCallback&&r.onCollideEndCallback(t)}),t.emit(u.COLLISION_END,e,i,r)})},setBounds:function(t,e,i,r,s,n,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=64),void 0===n&&(n=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(n,"left",t-s,e-s,s,r+2*s),this.updateWall(a,"right",t+i,e-s,s,r+2*s),this.updateWall(o,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+r,i,s),this},updateWall:function(t,e,i,r,s,n){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=s/2,r+=n/2,this.walls[e]=this.create(i,r,s,n,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,s,n){var a=r.rectangle(t,e,i,s,n);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i],s=r.body?r.body:r;o.remove(this.localWorld,s,e)}return this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,r=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(r,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new g(this,t[i],e);return this},nextGroup:function(t){return f.nextGroup(t)},nextCategory:function(){return f.nextCategory()},pause:function(){return this.enabled=!1,this.emit(u.PAUSE),this},resume:function(){return this.enabled=!0,this.runner.timeLastTick=a.now(),this.emit(u.RESUME),this},update:function(t){if(this.enabled&&this.autoUpdate){var e=this.engine,i=this.runner,r=a.now(),s=i.delta,n=0,o=t-i.timeLastTick;if((!o||!i.timeLastTick||o>Math.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+s*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var d=i.maxUpdates||Math.ceil(i.maxFrameTime/s),c=a.now();s>0&&i.timeBuffer>=s*v._timeBufferMargin;){h.update(e,s),i.timeBuffer-=s,n+=1;var f=a.now()-r,p=a.now()-c,g=f+v._elapsedNextEstimate*p/n;if(n>=d||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/s-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,r=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(r,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(r),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(r,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(r,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=a.keys(t.buckets),n=0;n<s.length;n++){var o=s[n];if(!(t.buckets[o].length<2)){var h=o.split(/C|R/);e.strokeRect(parseInt(h[1],10)*t.bucketWidth,parseInt(h[2],10)*t.bucketHeight,t.bucketWidth,t.bucketHeight)}}return this},renderSeparations:function(t,e,i){e.lineStyle(1,i,1);for(var r=0;r<t.length;r++){var s=t[r];if(s.isActive){var n=s.collision,a=n.bodyA,o=n.bodyB,h=a.position,l=o.position,u=n.penetration,d=a.isStatic||o.isStatic?1:4;o.isStatic&&(d=0),e.lineBetween(l.x,l.y,l.x-u.x*d,l.y-u.y*d),d=a.isStatic||o.isStatic?1:4,a.isStatic&&(d=0),e.lineBetween(h.x,h.y,h.x-u.x*d,h.y-u.y*d)}}return this},renderCollisions:function(t,e,i){var r,s;for(e.lineStyle(1,i,.5),e.fillStyle(i,1),r=0;r<t.length;r++)if((s=t[r]).isActive)for(var n=0;n<s.contactCount;n++){var a=s.contacts[n].vertex;a&&e.fillRect(a.x-2,a.y-2,5,5)}for(r=0;r<t.length;r++)if((s=t[r]).isActive){var o=s.collision,h=s.contacts;if(s.contactCount>0){var l=h[0].vertex.x,u=h[0].vertex.y;2===s.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,r){e.lineStyle(1,i,r);for(var s=0;s<t.length;s++){var n=t[s];if(n.render.visible){var a=n.bounds;if(a)e.strokeRect(a.min.x,a.min.y,a.max.x-a.min.x,a.max.y-a.min.y);else for(var o=n.parts,h=o.length>1?1:0;h<o.length;h++){var l=o[h];e.strokeRect(l.bounds.min.x,l.bounds.min.y,l.bounds.max.x-l.bounds.min.x,l.bounds.max.y-l.bounds.min.y)}}}return this},renderBodyAxes:function(t,e,i,r,s){e.lineStyle(1,r,s);for(var n=0;n<t.length;n++){var a,o,h,l=t[n],u=l.parts;if(l.render.visible)if(i)for(o=u.length>1?1:0;o<u.length;o++)for(a=u[o],h=0;h<a.axes.length;h++){var d=a.axes[h];e.lineBetween(a.position.x,a.position.y,a.position.x+20*d.x,a.position.y+20*d.y)}else for(o=u.length>1?1:0;o<u.length;o++)for(a=u[o],h=0;h<a.axes.length;h++)e.lineBetween(a.position.x,a.position.y,(a.vertices[0].x+a.vertices[a.vertices.length-1].x)/2,(a.vertices[0].y+a.vertices[a.vertices.length-1].y)/2)}return this},renderBodyVelocity:function(t,e,i,r,s){e.lineStyle(s,i,r);for(var n=0;n<t.length;n++){var a=t[n];a.render.visible&&e.lineBetween(a.position.x,a.position.y,a.position.x+2*(a.position.x-a.positionPrev.x),a.position.y+2*(a.position.y-a.positionPrev.y))}return this},renderBodies:function(t){for(var e=this.debugGraphic,i=this.debugConfig,r=i.showBody,s=i.showStaticBody,n=i.showSleeping,a=i.showInternalEdges,o=i.showConvexHulls,h=i.renderFill,l=i.renderLine,u=i.staticBodySleepOpacity,d=i.sleepFillColor,c=i.sleepLineColor,f=i.hullColor,p=0;p<t.length;p++){var g=t[p];if(g.render.visible&&((s||!g.isStatic)&&(r||g.isStatic))){var m=g.render.lineColor,v=g.render.lineOpacity,y=g.render.lineThickness,x=g.render.fillColor,T=g.render.fillOpacity;n&&g.isSleeping&&(g.isStatic?(v*=u,T*=u):(m=c,x=d)),h||(x=null),l||(m=null),this.renderBody(g,e,a,m,v,y,x,T);var w=g.parts.length;o&&w>1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,r,s,n,a,o){void 0===r&&(r=null),void 0===s&&(s=null),void 0===n&&(n=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,d=t.parts,c=d.length,f=c>1?1:0;f<c;f++){var p=d[f],g=p.render,m=g.opacity;if(g.visible&&0!==m&&(!p.isSensor||h.showSensors)){var v=p.circleRadius;if(e.beginPath(),p.isSensor?(null!==a&&e.fillStyle(l,o*m),null!==r&&e.lineStyle(n,u,s*m)):(null!==a&&e.fillStyle(a,o*m),null!==r&&e.lineStyle(n,r,s*m)),v)e.arc(p.position.x,p.position.y,v,0,2*Math.PI);else{var y=p.vertices,x=y.length;e.moveTo(y[0].x,y[0].y);for(var T=1;T<x;T++){var w=y[T];if(!y[T-1].isInternal||i?e.lineTo(w.x,w.y):e.moveTo(w.x,w.y),T<x&&w.isInternal&&!i){var b=(T+1)%x;e.moveTo(y[b].x,y[b].y)}}e.closePath()}null!==a&&e.fillPath(),null!==r&&e.strokePath()}}if(h.showPositions&&!t.isStatic){var S=t.position.x,C=t.position.y,E=Math.ceil(h.positionSize/2);e.fillStyle(h.positionColor,1),e.fillRect(S-E,C-E,h.positionSize,h.positionSize)}return this},renderConvexHull:function(t,e,i,r){if(void 0===r&&(r=1),t.parts.length>1){var s=t.vertices;e.lineStyle(r,i),e.beginPath(),e.moveTo(s[0].x,s[0].y);for(var n=1;n<s.length;n++)e.lineTo(s[n].x,s[n].y);e.lineTo(s[0].x,s[0].y),e.strokePath()}return this},renderJoints:function(){for(var t=this.debugGraphic,e=o.allConstraints(this.localWorld),i=0;i<e.length;i++){var r=e[i].render,s=r.lineColor,n=r.lineOpacity,a=r.lineThickness,h=r.pinSize,l=r.anchorColor,u=r.anchorSize;this.renderConstraint(e[i],t,s,n,a,h,l,u)}},renderConstraint:function(t,e,i,r,s,n,o,h){var l=t.render;if(!l.visible||!t.pointA||!t.pointB)return this;e.lineStyle(s,i,r);var u,d,c=t.bodyA,f=t.bodyB;if(u=c?y.add(c.position,t.pointA):t.pointA,"pin"===l.type)e.strokeCircle(u.x,u.y,n);else{if(d=f?y.add(f.position,t.pointB):t.pointB,e.beginPath(),e.moveTo(u.x,u.y),"spring"===l.type)for(var p,g=y.sub(d,u),m=y.perp(y.normalise(g)),v=Math.ceil(a.clamp(t.length/5,12,20)),x=1;x<v;x+=1)p=x%2==0?1:-1,e.lineTo(u.x+g.x*(x/v)+m.x*p*4,u.y+g.y*(x/v)+m.y*p*4);e.lineTo(d.x,d.y)}return e.strokePath(),l.anchors&&h>0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(d.x,d.y,h)),this},resetCollisionIDs:function(){return s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410(t){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968(t){var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this},setOnCollide:function(t){return this.body.onCollideCallback=t,this},setOnCollideEnd:function(t){return this.body.onCollideEndCallback=t,this},setOnCollideActive:function(t){return this.body.onCollideActiveCallback=t,this},setOnCollideWith:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i].hasOwnProperty("body")?t[i].body:t[i];this.body.setOnCollideWith(r,e)}return this}};t.exports=e},51607(t,e,i){var r=i(22562),s={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),r.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return r.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=s},5436(t){var e={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=e},39858(t){t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},37302(t,e,i){var r=i(22562),s=i(26099),n={setMass:function(t){return r.setMass(this.body,t),this},setDensity:function(t){return r.setDensity(this.body,t),this},centerOfMass:{get:function(){return new s(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=n},39132(t){t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},57772(t,e,i){var r=i(66280),s=i(22562),n=i(43855),a=i(95540),o=i(19496),h=i(85791),l=i(41598),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,r){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},r)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i<t.parts.length;i++)t.parts[i].gameObject=this;var r=this;if(t.destroy=function(){r.world.remove(r.body,!0),r.body.gameObject=null},e&&(this.world.has(t)&&this.world.remove(t,!0),this.world.add(t)),this._originComponent){var s=t.render.sprite.xOffset,a=t.render.sprite.yOffset,o=t.centerOfMass.x,h=t.centerOfMass.y;if(n(o,.5)&&n(h,.5))this.setOrigin(s+.5,a+.5);else{var l=t.centerOffset.x,u=t.centerOffset.y;this.setOrigin(s+l/this.displayWidth,a+u/this.displayHeight)}}return this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var n=a(t,"type","rectangle"),u=a(t,"x",this._tempVec2.x),d=a(t,"y",this._tempVec2.y),c=a(t,"width",this.width),f=a(t,"height",this.height);switch(n){case"rectangle":i=r.rectangle(u,d,c,f,e);break;case"circle":var p=a(t,"radius",Math.max(c,f)/2),g=a(t,"maxSides",25);i=r.circle(u,d,p,e,g);break;case"trapezoid":var m=a(t,"slope",.5);i=r.trapezoid(u,d,c,f,m,e);break;case"polygon":var v=a(t,"sides",5),y=a(t,"radius",Math.max(c,f)/2);i=r.polygon(u,d,v,y,e);break;case"fromVertices":case"fromVerts":var x=a(t,"verts",null);if(x)if("string"==typeof x&&(x=l.fromPath(x)),this.body&&!this.body.hasOwnProperty("temp"))s.setVertices(this.body,x),i=this.body;else{var T=a(t,"flagInternal",!1),w=a(t,"removeCollinear",.01),b=a(t,"minimumArea",10);i=r.fromVertices(u,d,x,e,T,w,b)}break;case"fromPhysicsEditor":i=o.parseBody(u,d,t,e);break;case"fromPhysicsTracer":i=h.parseBody(u,d,t,e)}return i&&this.setExistingBody(i,t.addToWorld),this}};t.exports=u},38083(t,e,i){var r=i(1121),s=i(53614),n=i(35810),a={setToSleep:function(){return s.set(this.body,!0),this},setAwake:function(){return s.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepStart",function(t){e.emit(r.SLEEP_START,t,this)})}else n.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepEnd",function(t){e.emit(r.SLEEP_END,t,this)})}else n.off(this.body,"sleepEnd");return this}};t.exports=a},90556(t,e,i){var r=i(22562),s={setStatic:function(t){return r.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=s},85436(t,e,i){var r=i(22562),s=i(36383),n=i(86554),a=i(30954),o={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),r.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),r.setPosition(this.body,this._tempVec2)}},scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this.setScale(t,t)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,r.scale(this.body,e,i),r.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,r.scale(this.body,e,i),r.scale(this.body,this._scaleX,t)}},angle:{get:function(){return a(this.body.angle*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=n(t),r.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),r.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=n(t),r.setAngle(this.body,t),this},setFixedRotation:function(){return r.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,r.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var s=1/this._scaleX,n=1/this._scaleY;return this._scaleX=t,this._scaleY=e,r.scale(this.body,s,n,i),r.scale(this.body,t,e,i),this}};t.exports=o},42081(t,e,i){var r=i(22562),s={setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),r.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),r.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),r.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return r.getVelocity(this.body)},setAngularVelocity:function(t){return r.setAngularVelocity(this.body,t),this},getAngularVelocity:function(){return r.getAngularVelocity(this.body)},setAngularSpeed:function(t){return r.setAngularSpeed(this.body,t),this},getAngularSpeed:function(){return r.getAngularSpeed(this.body)}};t.exports=s},9503(t,e,i){t.exports={Bounce:i(70410),Collision:i(66968),Force:i(51607),Friction:i(5436),Gravity:i(39858),Mass:i(37302),Sensor:i(39132),SetBody:i(57772),Sleep:i(38083),Static:i(90556),Transform:i(85436),Velocity:i(42081)}},85608(t){t.exports="afteradd"},1213(t){t.exports="afterremove"},25968(t){t.exports="afterupdate"},67205(t){t.exports="beforeadd"},39438(t){t.exports="beforeremove"},44823(t){t.exports="beforeupdate"},92593(t){t.exports="collisionactive"},60128(t){t.exports="collisionend"},76861(t){t.exports="collisionstart"},92362(t){t.exports="dragend"},76408(t){t.exports="drag"},93971(t){t.exports="dragstart"},5656(t){t.exports="pause"},47861(t){t.exports="resume"},79099(t){t.exports="sleepend"},35906(t){t.exports="sleepstart"},1121(t,e,i){t.exports={AFTER_ADD:i(85608),AFTER_REMOVE:i(1213),AFTER_UPDATE:i(25968),BEFORE_ADD:i(67205),BEFORE_REMOVE:i(39438),BEFORE_UPDATE:i(44823),COLLISION_ACTIVE:i(92593),COLLISION_END:i(60128),COLLISION_START:i(76861),DRAG_END:i(92362),DRAG:i(76408),DRAG_START:i(93971),PAUSE:i(5656),RESUME:i(47861),SLEEP_END:i(79099),SLEEP_START:i(35906)}},3875(t,e,i){t.exports={BodyBounds:i(68174),Components:i(9503),Events:i(1121),Factory:i(28137),MatterGameObject:i(75803),Image:i(23181),Matter:i(19933),MatterPhysics:i(42045),PolyDecomp:i(55973),Sprite:i(34803),TileBody:i(73834),PhysicsEditorParser:i(19496),PhysicsJSONParser:i(85791),PointerConstraint:i(98713),World:i(68243)}},22562(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(31725),a=i(53614),o=i(53402),h=i(15647),l=i(66615);!function(){r._timeCorrection=!0,r._inertiaScale=4,r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,r._baseDelta=1e3/60,r.create=function(e){var i={id:o.nextId(),type:"body",label:"Body",parts:[],plugin:{},attractors:e.attractors||[],wrapBounds:null,angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,deltaTime:1e3/60,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=s.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var r=o.extend(i,e);return t(r,e),r.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},r},r.nextGroup=function(t){return t?r._nextNonCollidingGroupId--:r._nextCollidingGroupId++},r.nextCategory=function(){return r._nextCategory=r._nextCategory<<1,r._nextCategory};var t=function(t,e){if(e=e||{},r.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||n.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),r.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var i=t.bounds,a=t.centerOfMass,o=t.centerOffset,u=i.max.x-i.min.x,d=i.max.y-i.min.y;a.x=-(i.min.x-t.position.x)/u,a.y=-(i.min.y-t.position.y)/d,o.x=u*a.x,o.y=d*a.y}};r.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(Object.prototype.hasOwnProperty.call(e,s))switch(i=e[s],s){case"isStatic":r.setStatic(t,i);break;case"isSleeping":a.set(t,i);break;case"mass":r.setMass(t,i);break;case"density":r.setDensity(t,i);break;case"inertia":r.setInertia(t,i);break;case"vertices":r.setVertices(t,i);break;case"position":r.setPosition(t,i);break;case"angle":r.setAngle(t,i);break;case"velocity":r.setVelocity(t,i);break;case"angularVelocity":r.setAngularVelocity(t,i);break;case"speed":r.setSpeed(t,i);break;case"angularSpeed":r.setAngularSpeed(t,i);break;case"parts":r.setParts(t,i);break;case"centre":r.setCentre(t,i);break;default:t[s]=i}},r.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var r=t.parts[i];e?(r.isStatic||(r._original={restitution:r.restitution,friction:r.friction,mass:r.mass,inertia:r.inertia,density:r.density,inverseMass:r.inverseMass,inverseInertia:r.inverseInertia}),r.restitution=0,r.friction=1,r.mass=r.inertia=r.density=1/0,r.inverseMass=r.inverseInertia=0,r.positionPrev.x=r.position.x,r.positionPrev.y=r.position.y,r.anglePrev=r.angle,r.angularVelocity=0,r.speed=0,r.angularSpeed=0,r.motion=0):r._original&&(r.restitution=r._original.restitution,r.friction=r._original.friction,r.mass=r._original.mass,r.inertia=r._original.inertia,r.density=r._original.density,r.inverseMass=r._original.inverseMass,r.inverseInertia=r._original.inverseInertia,r._original=null),r.isStatic=e}},r.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},r.setDensity=function(t,e){r.setMass(t,e*t.area),t.density=e},r.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},r.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=s.create(e,t),t.axes=l.fromVertices(t.vertices),t.area=s.area(t.vertices),r.setMass(t,t.density*t.area);var i=s.centre(t.vertices);s.translate(t.vertices,i,-1),r.setInertia(t,r._inertiaScale*s.inertia(t.vertices,t.mass)),s.translate(t.vertices,t.position),h.update(t.bounds,t.vertices,t.velocity)},r.setParts=function(t,e,i){var n;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,n=0;n<e.length;n++){var a=e[n];a!==t&&(a.parent=t,t.parts.push(a))}if(1!==t.parts.length){if(i=void 0===i||i){var o=[];for(n=0;n<e.length;n++)o=o.concat(e[n].vertices);s.clockwiseSort(o);var l=s.hull(o),u=s.centre(l);r.setVertices(t,l),s.translate(t.vertices,u)}var d=r._totalProperties(t),c=d.centre.x,f=d.centre.y,p=t.bounds,g=t.centerOfMass,m=t.centerOffset;h.update(p,t.vertices,t.velocity),g.x=-(p.min.x-c)/(p.max.x-p.min.x),g.y=-(p.min.y-f)/(p.max.y-p.min.y),m.x=c,m.y=f,t.area=d.area,t.parent=t,t.position.x=c,t.position.y=f,t.positionPrev.x=c,t.positionPrev.y=f,r.setMass(t,d.mass),r.setInertia(t,d.inertia),r.setPosition(t,d.centre)}},r.setCentre=function(t,e,i){i?(t.positionPrev.x+=e.x,t.positionPrev.y+=e.y,t.position.x+=e.x,t.position.y+=e.y):(t.positionPrev.x=e.x-(t.position.x-t.positionPrev.x),t.positionPrev.y=e.y-(t.position.y-t.positionPrev.y),t.position.x=e.x,t.position.y=e.y)},r.setPosition=function(t,e,i){var r=n.sub(e,t.position);i?(t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.velocity.x=r.x,t.velocity.y=r.y,t.speed=n.magnitude(r)):(t.positionPrev.x+=r.x,t.positionPrev.y+=r.y);for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.position.x+=r.x,o.position.y+=r.y,s.translate(o.vertices,r),h.update(o.bounds,o.vertices,t.velocity)}},r.setAngle=function(t,e,i){var r=e-t.angle;i?(t.anglePrev=t.angle,t.angularVelocity=r,t.angularSpeed=Math.abs(r)):t.anglePrev+=r;for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.angle+=r,s.rotate(o.vertices,r,t.position),l.rotate(o.axes,r),h.update(o.bounds,o.vertices,t.velocity),a>0&&n.rotateAbout(o.position,r,t.position,o.position)}},r.setVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=n.magnitude(t.velocity)},r.getVelocity=function(t){var e=r._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},r.getSpeed=function(t){return n.magnitude(r.getVelocity(t))},r.setSpeed=function(t,e){r.setVelocity(t,n.mult(n.normalise(r.getVelocity(t)),e))},r.setAngularVelocity=function(t,e){var i=t.deltaTime/r._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},r.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*r._baseDelta/t.deltaTime},r.getAngularSpeed=function(t){return Math.abs(r.getAngularVelocity(t))},r.setAngularSpeed=function(t,e){r.setAngularVelocity(t,o.sign(r.getAngularVelocity(t))*e)},r.translate=function(t,e,i){r.setPosition(t,n.add(t.position,e),i)},r.rotate=function(t,e,i,s){if(i){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;r.setPosition(t,{x:i.x+(o*n-h*a),y:i.y+(o*a+h*n)},s),r.setAngle(t,t.angle+e,s)}else r.setAngle(t,t.angle+e,s)},r.scale=function(t,e,i,n){var a=0,o=0;n=n||t.position;for(var u=t.inertia===1/0,d=0;d<t.parts.length;d++){var c=t.parts[d];c.scale.x=e,c.scale.y=i,s.scale(c.vertices,e,i,n),c.axes=l.fromVertices(c.vertices),c.area=s.area(c.vertices),r.setMass(c,t.density*c.area),s.translate(c.vertices,{x:-c.position.x,y:-c.position.y}),r.setInertia(c,r._inertiaScale*s.inertia(c.vertices,c.mass)),s.translate(c.vertices,{x:c.position.x,y:c.position.y}),d>0&&(a+=c.area,o+=c.inertia),c.position.x=n.x+(c.position.x-n.x)*e,c.position.y=n.y+(c.position.y-n.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(r.setMass(t,t.density*a),r.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&r.setInertia(t,1/0)},r.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=r._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),d=(t.position.x-t.positionPrev.x)*a,c=(t.position.y-t.positionPrev.y)*a;t.velocity.x=d*u+t.force.x/t.mass*i,t.velocity.y=c*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=n.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f<t.parts.length;f++){var p=t.parts[f];s.translate(p.vertices,t.velocity),f>0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&n.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},r.updateVelocities=function(t){var e=r._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},r.applyForce=function(t,e,i){var r=e.x-t.position.x,s=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=r*i.y-s*i.x},r._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i<t.parts.length;i++){var r=t.parts[i],s=r.mass!==1/0?r.mass:1;e.mass+=s,e.area+=r.area,e.inertia+=r.inertia,e.centre=n.add(e.centre,n.mult(r.position,s))}return e.centre=n.div(e.centre,e.mass),e},r.wrap=function(t,e){var i=h.wrap(t.bounds,e);return i&&r.translate(t,i),i}}()},69351(t,e,i){var r={};t.exports=r;var s=i(35810),n=i(53402),a=i(15647),o=i(22562);r.create=function(t){return n.extend({id:n.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},wrapBounds:null,cache:{allBodies:null,allConstraints:null,allComposites:null}},t)},r.setModified=function(t,e,i,n){if(s.trigger(t,"compositeModified",t),t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),i&&t.parent&&r.setModified(t.parent,e,i,n),n)for(var a=0;a<t.composites.length;a++){var o=t.composites[a];r.setModified(o,e,i,n)}},r.add=function(t,e){var i=[].concat(e);s.trigger(t,"beforeAdd",{object:e});for(var a=0;a<i.length;a++){var o=i[a];switch(o.type){case"body":if(o.parent!==o){n.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}r.addBody(t,o);break;case"constraint":r.addConstraint(t,o);break;case"composite":r.addComposite(t,o);break;case"mouseConstraint":r.addConstraint(t,o.constraint)}}return s.trigger(t,"afterAdd",{object:e}),t},r.remove=function(t,e,i){var n=[].concat(e);s.trigger(t,"beforeRemove",{object:e});for(var a=0;a<n.length;a++){var o=n[a];switch(o.type){case"body":r.removeBody(t,o,i);break;case"constraint":r.removeConstraint(t,o,i);break;case"composite":r.removeComposite(t,o,i);break;case"mouseConstraint":r.removeConstraint(t,o.constraint)}}return s.trigger(t,"afterRemove",{object:e}),t},r.addComposite=function(t,e){return t.composites.push(e),e.parent=t,r.setModified(t,!0,!0,!1),t},r.removeComposite=function(t,e,i){var s=n.indexOf(t.composites,e);if(-1!==s){var a=r.allBodies(e);r.removeCompositeAt(t,s);for(var o=0;o<a.length;o++)a[o].sleepCounter=0}if(i)for(o=0;o<t.composites.length;o++)r.removeComposite(t.composites[o],e,!0);return t},r.removeCompositeAt=function(t,e){return t.composites.splice(e,1),r.setModified(t,!0,!0,!1),t},r.addBody=function(t,e){return t.bodies.push(e),r.setModified(t,!0,!0,!1),t},r.removeBody=function(t,e,i){var s=n.indexOf(t.bodies,e);if(-1!==s&&(r.removeBodyAt(t,s),e.sleepCounter=0),i)for(var a=0;a<t.composites.length;a++)r.removeBody(t.composites[a],e,!0);return t},r.removeBodyAt=function(t,e){return t.bodies.splice(e,1),r.setModified(t,!0,!0,!1),t},r.addConstraint=function(t,e){return t.constraints.push(e),r.setModified(t,!0,!0,!1),t},r.removeConstraint=function(t,e,i){var s=n.indexOf(t.constraints,e);if(-1!==s&&r.removeConstraintAt(t,s),i)for(var a=0;a<t.composites.length;a++)r.removeConstraint(t.composites[a],e,!0);return t},r.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),r.setModified(t,!0,!0,!1),t},r.clear=function(t,e,i){if(i)for(var s=0;s<t.composites.length;s++)r.clear(t.composites[s],e,!0);return e?t.bodies=t.bodies.filter(function(t){return t.isStatic}):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,r.setModified(t,!0,!0,!1),t},r.allBodies=function(t){if(t.cache&&t.cache.allBodies)return t.cache.allBodies;for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(r.allBodies(t.composites[i]));return t.cache&&(t.cache.allBodies=e),e},r.allConstraints=function(t){if(t.cache&&t.cache.allConstraints)return t.cache.allConstraints;for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(r.allConstraints(t.composites[i]));return t.cache&&(t.cache.allConstraints=e),e},r.allComposites=function(t){if(t.cache&&t.cache.allComposites)return t.cache.allComposites;for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(r.allComposites(t.composites[i]));return t.cache&&(t.cache.allComposites=e),e},r.get=function(t,e,i){var s,n;switch(i){case"body":s=r.allBodies(t);break;case"constraint":s=r.allConstraints(t);break;case"composite":s=r.allComposites(t).concat(t)}return s?0===(n=s.filter(function(t){return t.id.toString()===e.toString()})).length?null:n[0]:null},r.move=function(t,e,i){return r.remove(t,e),r.add(i,e),t},r.rebase=function(t){for(var e=r.allBodies(t).concat(r.allConstraints(t)).concat(r.allComposites(t)),i=0;i<e.length;i++)e[i].id=n.nextId();return t},r.translate=function(t,e,i){for(var s=i?r.allBodies(t):t.bodies,n=0;n<s.length;n++)o.translate(s[n],e);return t},r.rotate=function(t,e,i,s){for(var n=Math.cos(e),a=Math.sin(e),h=s?r.allBodies(t):t.bodies,l=0;l<h.length;l++){var u=h[l],d=u.position.x-i.x,c=u.position.y-i.y;o.setPosition(u,{x:i.x+(d*n-c*a),y:i.y+(d*a+c*n)}),o.rotate(u,e)}return t},r.scale=function(t,e,i,s,n){for(var a=n?r.allBodies(t):t.bodies,h=0;h<a.length;h++){var l=a[h],u=l.position.x-s.x,d=l.position.y-s.y;o.setPosition(l,{x:s.x+u*e,y:s.y+d*i}),o.scale(l,e,i)}return t},r.bounds=function(t){for(var e=r.allBodies(t),i=[],s=0;s<e.length;s+=1){var n=e[s];i.push(n.bounds.min,n.bounds.max)}return a.create(i)},r.wrap=function(t,e){var i=a.wrap(r.bounds(t),e);return i&&r.translate(t,i),i}},4372(t,e,i){var r={};t.exports=r;var s=i(69351);r.create=s.create,r.add=s.add,r.remove=s.remove,r.clear=s.clear,r.addComposite=s.addComposite,r.addBody=s.addBody,r.addConstraint=s.addConstraint},52284(t,e,i){var r={};t.exports=r;var s,n,a,o=i(41598),h=i(4506);s=[],n={overlap:0,axis:null},a={overlap:0,axis:null},r.create=function(t,e){return{pair:null,collided:!1,bodyA:t,bodyB:e,parentA:t.parent,parentB:e.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[null,null],supportCount:0}},r.collides=function(t,e,i){if(r._overlapAxes(n,t.vertices,e.vertices,t.axes),n.overlap<=0)return null;if(r._overlapAxes(a,e.vertices,t.vertices,e.axes),a.overlap<=0)return null;var s,l,u=i&&i.table[h.id(t,e)];u?s=u.collision:((s=r.create(t,e)).collided=!0,s.bodyA=t.id<e.id?t:e,s.bodyB=t.id<e.id?e:t,s.parentA=s.bodyA.parent,s.parentB=s.bodyB.parent),t=s.bodyA,e=s.bodyB,l=n.overlap<a.overlap?n:a;var d=s.normal,c=s.tangent,f=s.penetration,p=s.supports,g=l.overlap,m=l.axis,v=m.x,y=m.y;v*(e.position.x-t.position.x)+y*(e.position.y-t.position.y)>=0&&(v=-v,y=-y),d.x=v,d.y=y,c.x=-y,c.y=v,f.x=v*g,f.y=y*g,s.depth=g;var x=r._findSupports(t,e,d,1),T=0;if(o.contains(t.vertices,x[0])&&(p[T++]=x[0]),o.contains(t.vertices,x[1])&&(p[T++]=x[1]),T<2){var w=r._findSupports(e,t,d,-1);o.contains(e.vertices,w[0])&&(p[T++]=w[0]),T<2&&o.contains(e.vertices,w[1])&&(p[T++]=w[1])}return 0===T&&(p[T++]=x[0]),s.supportCount=T,s},r._overlapAxes=function(t,e,i,r){var s,n,a,o,h,l,u=e.length,d=i.length,c=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=r.length,v=Number.MAX_VALUE,y=0;for(h=0;h<m;h++){var x=r[h],T=x.x,w=x.y,b=c*T+f*w,S=p*T+g*w,C=b,E=S;for(l=1;l<u;l+=1)(o=e[l].x*T+e[l].y*w)>C?C=o:o<b&&(b=o);for(l=1;l<d;l+=1)(o=i[l].x*T+i[l].y*w)>E?E=o:o<S&&(S=o);if((s=(n=C-S)<(a=E-b)?n:a)<v&&(v=s,y=h,s<=0))break}t.axis=r[y],t.overlap=v},r._findSupports=function(t,e,i,r){var n,a,o,h=e.vertices,l=h.length,u=t.position.x,d=t.position.y,c=i.x*r,f=i.y*r,p=h[0],g=p,m=c*(u-g.x)+f*(d-g.y);for(o=1;o<l;o+=1)(a=c*(u-(g=h[o]).x)+f*(d-g.y))<m&&(m=a,p=g);return m=c*(u-(n=h[(l+p.index-1)%l]).x)+f*(d-n.y),c*(u-(g=h[(p.index+1)%l]).x)+f*(d-g.y)<m?(s[0]=p,s[1]=g,s):(s[0]=p,s[1]=n,s)}},43424(t){var e={};t.exports=e,e.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},81388(t,e,i){var r={};t.exports=r;var s=i(53402),n=i(52284);r.create=function(t){return s.extend({bodies:[],collisions:[],pairs:null},t)},r.setBodies=function(t,e){t.bodies=e.slice(0)},r.clear=function(t){t.bodies=[],t.collisions=[]},r.collisions=function(t){var e,i,s=t.pairs,a=t.bodies,o=a.length,h=r.canCollide,l=n.collides,u=t.collisions,d=0;for(a.sort(r._compareBoundsX),e=0;e<o;e++){var c=a[e],f=c.bounds,p=c.bounds.max.x,g=c.bounds.max.y,m=c.bounds.min.y,v=c.isStatic||c.isSleeping,y=c.parts.length,x=1===y;for(i=e+1;i<o;i++){var T=a[i];if((M=T.bounds).min.x>p)break;if(!(g<M.min.y||m>M.max.y)&&(!v||!T.isStatic&&!T.isSleeping)&&h(c.collisionFilter,T.collisionFilter)){var w=T.parts.length;if(x&&1===w)(A=l(c,T,s))&&(u[d++]=A);else for(var b=w>1?1:0,S=y>1?1:0;S<y;S++)for(var C=c.parts[S],E=(f=C.bounds,b);E<w;E++){var A,_=T.parts[E],M=_.bounds;f.min.x>M.max.x||f.max.x<M.min.x||f.max.y<M.min.y||f.min.y>M.max.y||(A=l(C,_,s))&&(u[d++]=A)}}}}return u.length!==d&&(u.length=d),u},r.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},r._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506(t,e,i){var r={};t.exports=r;var s=i(43424);r.create=function(t,e){var i=t.bodyA,n=t.bodyB,a={id:r.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[s.create(),s.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(a,t,e),a},r.update=function(t,e,i){var r=e.supports,s=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.friction<o.friction?a.friction:o.friction,t.frictionStatic=a.frictionStatic>o.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=s,e.pair=t;var h=r[0],l=n[0],u=r[1],d=n[1];d.vertex!==h&&l.vertex!==u||(n[1]=l,n[0]=l=d,d=n[1]),l.vertex=h,d.vertex=u},r.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},r.id=function(t,e){return t.id<e.id?t.id.toString(36)+":"+e.id.toString(36):e.id.toString(36)+":"+t.id.toString(36)}},99561(t,e,i){var r={};t.exports=r;var s=i(4506),n=i(53402);r.create=function(t){return n.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},r.update=function(t,e,i){var r,n,a,o=s.update,h=s.create,l=s.setActive,u=t.table,d=t.list,c=d.length,f=c,p=t.collisionStart,g=t.collisionEnd,m=t.collisionActive,v=e.length,y=0,x=0,T=0;for(a=0;a<v;a++)(n=(r=e[a]).pair)?(n.isActive&&(m[T++]=n),o(n,r,i)):(u[(n=h(r,i)).id]=n,p[y++]=n,d[f++]=n);for(f=0,c=d.length,a=0;a<c;a++)(n=d[a]).timeUpdated>=i?d[f++]=n:(l(n,!1,i),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?d[f++]=n:(g[x++]=n,delete u[n.id]));d.length!==f&&(d.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==T&&(m.length=T)},r.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296(t,e,i){var r={};t.exports=r;var s=i(31725),n=i(52284),a=i(15647),o=i(66280),h=i(41598);r.collides=function(t,e){for(var i=[],r=e.length,s=t.bounds,o=n.collides,h=a.overlaps,l=0;l<r;l++){var u=e[l],d=u.parts.length,c=1===d?0:1;if(t!==u&&h(u.bounds,s))for(var f=c;f<d;f++){var p=u.parts[f];if(h(p.bounds,s)){var g=o(p,t);if(g){i.push(g);break}}}}return i},r.ray=function(t,e,i,n){n=n||1e-100;for(var a=s.angle(e,i),h=s.magnitude(s.sub(e,i)),l=.5*(i.x+e.x),u=.5*(i.y+e.y),d=o.rectangle(l,u,h,n,{angle:a}),c=r.collides(d,t),f=0;f<c.length;f+=1){var p=c[f];p.body=p.bodyB=p.bodyA}return c},r.region=function(t,e,i){for(var r=[],s=0;s<t.length;s++){var n=t[s],o=a.overlaps(n.bounds,e);(o&&!i||!o&&i)&&r.push(n)}return r},r.point=function(t,e){for(var i=[],r=0;r<t.length;r++){var s=t[r];if(a.contains(s.bounds,e))for(var n=1===s.parts.length?0:1;n<s.parts.length;n++){var o=s.parts[n];if(a.contains(o.bounds,e)&&h.contains(o.vertices,e)){i.push(s);break}}}return i}},66272(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(53402),a=i(15647);r._restingThresh=2,r._restingThreshTangent=Math.sqrt(6),r._positionDampen=.9,r._positionWarming=.8,r._frictionNormalMultiplier=5,r._frictionMaxStatic=Number.MAX_VALUE,r.preSolvePosition=function(t){var e,i,r,s=t.length;for(e=0;e<s;e++)(i=t[e]).isActive&&(r=i.contactCount,i.collision.parentA.totalContacts+=r,i.collision.parentB.totalContacts+=r)},r.solvePosition=function(t,e,i){var s,a,o,h,l,u,d,c,f=r._positionDampen*(i||1),p=n.clamp(e/n._baseDelta,0,1),g=t.length;for(s=0;s<g;s++)(a=t[s]).isActive&&!a.isSensor&&(h=(o=a.collision).parentA,l=o.parentB,u=o.normal,a.separation=o.depth+u.x*(l.positionImpulse.x-h.positionImpulse.x)+u.y*(l.positionImpulse.y-h.positionImpulse.y));for(s=0;s<g;s++)(a=t[s]).isActive&&!a.isSensor&&(h=(o=a.collision).parentA,l=o.parentB,u=o.normal,c=a.separation-a.slop*p,(h.isStatic||l.isStatic)&&(c*=2),h.isStatic||h.isSleeping||(d=f/h.totalContacts,h.positionImpulse.x+=u.x*c*d,h.positionImpulse.y+=u.y*c*d),l.isStatic||l.isSleeping||(d=f/l.totalContacts,l.positionImpulse.x-=u.x*c*d,l.positionImpulse.y-=u.y*c*d))},r.postSolvePosition=function(t){for(var e=r._positionWarming,i=t.length,n=s.translate,o=a.update,h=0;h<i;h++){var l=t[h],u=l.positionImpulse,d=u.x,c=u.y,f=l.velocity;if(l.totalContacts=0,0!==d||0!==c){for(var p=0;p<l.parts.length;p++){var g=l.parts[p];n(g.vertices,u),o(g.bounds,g.vertices,f),g.position.x+=d,g.position.y+=c}l.positionPrev.x+=d,l.positionPrev.y+=c,d*f.x+c*f.y<0?(u.x=0,u.y=0):(u.x*=e,u.y*=e)}}},r.preSolveVelocity=function(t){var e,i,r=t.length;for(e=0;e<r;e++){var s=t[e];if(s.isActive&&!s.isSensor){var n=s.contacts,a=s.contactCount,o=s.collision,h=o.parentA,l=o.parentB,u=o.normal,d=o.tangent;for(i=0;i<a;i++){var c=n[i],f=c.vertex,p=c.normalImpulse,g=c.tangentImpulse;if(0!==p||0!==g){var m=u.x*p+d.x*g,v=u.y*p+d.y*g;h.isStatic||h.isSleeping||(h.positionPrev.x+=m*h.inverseMass,h.positionPrev.y+=v*h.inverseMass,h.anglePrev+=h.inverseInertia*((f.x-h.position.x)*v-(f.y-h.position.y)*m)),l.isStatic||l.isSleeping||(l.positionPrev.x-=m*l.inverseMass,l.positionPrev.y-=v*l.inverseMass,l.anglePrev-=l.inverseInertia*((f.x-l.position.x)*v-(f.y-l.position.y)*m))}}}}},r.solveVelocity=function(t,e){var i,s,a,o,h=e/n._baseDelta,l=h*h*h,u=-r._restingThresh*h,d=r._restingThreshTangent,c=r._frictionNormalMultiplier*h,f=r._frictionMaxStatic,p=t.length;for(a=0;a<p;a++){var g=t[a];if(g.isActive&&!g.isSensor){var m=g.collision,v=m.parentA,y=m.parentB,x=m.normal.x,T=m.normal.y,w=m.tangent.x,b=m.tangent.y,S=g.inverseMass,C=g.friction*g.frictionStatic*c,E=g.contacts,A=g.contactCount,_=1/A,M=v.position.x-v.positionPrev.x,R=v.position.y-v.positionPrev.y,P=v.angle-v.anglePrev,O=y.position.x-y.positionPrev.x,L=y.position.y-y.positionPrev.y,F=y.angle-y.anglePrev;for(o=0;o<A;o++){var D=E[o],I=D.vertex,N=I.x-v.position.x,B=I.y-v.position.y,k=I.x-y.position.x,U=I.y-y.position.y,z=M-B*P-(O-U*F),Y=R+N*P-(L+k*F),X=x*z+T*Y,W=w*z+b*Y,G=g.separation+X,V=Math.min(G,1),H=(V=G<0?0:V)*C;W<-H||W>H?(s=W>0?W:-W,(i=g.friction*(W>0?1:-1)*l)<-s?i=-s:i>s&&(i=s)):(i=W,s=f);var j=N*T-B*x,q=k*T-U*x,K=_/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*X*K;if(i*=K,X<u)D.normalImpulse=0;else{var Q=D.normalImpulse;D.normalImpulse+=Z,D.normalImpulse>0&&(D.normalImpulse=0),Z=D.normalImpulse-Q}if(W<-d||W>d)D.tangentImpulse=0;else{var J=D.tangentImpulse;D.tangentImpulse+=i,D.tangentImpulse<-s&&(D.tangentImpulse=-s),D.tangentImpulse>s&&(D.tangentImpulse=s),i=D.tangentImpulse-J}var $=x*Z+w*i,tt=T*Z+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(N*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(k*tt-U*$)*y.inverseInertia)}}}}},48140(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,r=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,s=n.magnitude(n.sub(i,r));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},r.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var i=t[e],r=i.constraintImpulse;i.isStatic||0===r.x&&0===r.y&&0===r.angle||(i.position.x+=r.x,i.position.y+=r.y,i.angle+=r.angle)}},r.solveAll=function(t,e){for(var i=l.clamp(e/l._baseDelta,0,1),s=0;s<t.length;s+=1){var n=t[s],a=!n.bodyA||n.bodyA&&n.bodyA.isStatic,o=!n.bodyB||n.bodyB&&n.bodyB.isStatic;(a||o)&&r.solve(t[s],i)}for(s=0;s<t.length;s+=1)a=!(n=t[s]).bodyA||n.bodyA&&n.bodyA.isStatic,o=!n.bodyB||n.bodyB&&n.bodyB.isStatic,a||o||r.solve(t[s],i)},r.solve=function(t,e){var i=t.bodyA,s=t.bodyB,a=t.pointA,o=t.pointB;if(i||s){i&&!i.isStatic&&(n.rotate(a,i.angle-t.angleA,a),t.angleA=i.angle),s&&!s.isStatic&&(n.rotate(o,s.angle-t.angleB,o),t.angleB=s.angle);var h=a,l=o;if(i&&(h=n.add(i.position,a)),s&&(l=n.add(s.position,o)),h&&l){var u=n.sub(h,l),d=n.magnitude(u);d<r._minLength&&(d=r._minLength);var c,f,p,g,m,v=(d-t.length)/d,y=t.stiffness>=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=n.mult(u,v*y),w=(i?i.inverseMass:0)+(s?s.inverseMass:0),b=w+((i?i.inverseInertia:0)+(s?s.inverseInertia:0));if(x>0){var S=n.create();p=n.div(u,d),m=n.sub(s&&n.sub(s.position,s.positionPrev)||S,i&&n.sub(i.position,i.positionPrev)||S),g=n.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),c=n.cross(a,T)/b*r._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=c,i.angle-=c),s&&!s.isStatic&&(f=s.inverseMass/w,s.constraintImpulse.x+=T.x*f,s.constraintImpulse.y+=T.y*f,s.position.x+=T.x*f,s.position.y+=T.y*f,x>0&&(s.positionPrev.x+=x*p.x*g*f,s.positionPrev.y+=x*p.y*g*f),c=n.cross(o,T)/b*r._torqueDampen*s.inverseInertia*(1-t.angularStiffness),s.constraintImpulse.angle+=c,s.angle+=c)}}},r.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],l=i.constraintImpulse;if(!(i.isStatic||0===l.x&&0===l.y&&0===l.angle)){a.set(i,!1);for(var u=0;u<i.parts.length;u++){var d=i.parts[u];s.translate(d.vertices,l),u>0&&(d.position.x+=l.x,d.position.y+=l.y),0!==l.angle&&(s.rotate(d.vertices,l.angle,i.position),h.rotate(d.axes,l.angle),u>0&&n.rotateAbout(d.position,l.angle,i.position,d.position)),o.update(d.bounds,d.vertices,i.velocity)}l.angle*=r._warming,l.x*=r._warming,l.y*=r._warming}}},r.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},r.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},r.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),r=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),s=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(r*r+s*s)}},53402(t,e,i){var r={};t.exports=r,function(){r._baseDelta=1e3/60,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(t,e){var i,s;"boolean"==typeof e?(i=2,s=e):(i=1,s=!0);for(var n=i;n<arguments.length;n++){var a=arguments[n];if(a)for(var o in a)s&&a[o]&&a[o].constructor===Object?t[o]&&t[o].constructor!==Object?t[o]=a[o]:(t[o]=t[o]||{},r.extend(t[o],s,a[o])):t[o]=a[o]}return t},r.clone=function(t,e){return r.extend({},e,t)},r.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},r.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),r=0;r<i.length;r++)e.push(t[i[r]]);return e}for(var s in t)e.push(t[s]);return e},r.get=function(t,e,i,r){e=e.split(".").slice(i,r);for(var s=0;s<e.length;s+=1)t=t[e[s]];return t},r.set=function(t,e,i,s,n){var a=e.split(".").slice(s,n);return r.get(t,e,0,-1)[a[a.length-1]]=i,i},r.shuffle=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(r.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t},r.choose=function(t){return t[Math.floor(r.random()*t.length)]},r.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},r.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.isFunction=function(t){return"function"==typeof t},r.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},r.isString=function(t){return"[object String]"===toString.call(t)},r.clamp=function(t,e,i){return t<e?e:t>i?i:t},r.sign=function(t){return t<0?-1:1},r.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-r._nowStartTime},r.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return r._seed=(9301*r._seed+49297)%233280,r._seed/233280};r.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[t]||(r.warn(t),r._warnedOnce[t]=!0)},r.deprecated=function(t,e,i){t[e]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",i)},t[e])},r.nextId=function(){return r._nextId++},r.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},r.map=function(t,e){if(t.map)return t.map(e);for(var i=[],r=0;r<t.length;r+=1)i.push(e(t[r]));return i},r.topologicalSort=function(t){var e=[],i=[],s=[];for(var n in t)i[n]||s[n]||r._topologicalSort(n,i,s,t,e);return e},r._topologicalSort=function(t,e,i,s,n){var a=s[t]||[];i[t]=!0;for(var o=0;o<a.length;o+=1){var h=a[o];i[h]||(e[h]||r._topologicalSort(h,e,i,s,n))}i[t]=!1,e[t]=!0,n.push(t)},r.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var i=arguments[e];i._chained?t.push.apply(t,i._chained):t.push(i)}var r=function(){for(var e,i=new Array(arguments.length),r=0,s=arguments.length;r<s;r++)i[r]=arguments[r];for(r=0;r<t.length;r+=1){var n=t[r].apply(e,i);void 0!==n&&(e=n)}return e};return r._chained=t,r},r.chainPathBefore=function(t,e,i){return r.set(t,e,r.chain(i,r.get(t,e)))},r.chainPathAfter=function(t,e,i){return r.set(t,e,r.chain(r.get(t,e),i))},r.setDecomp=function(t){r._decomp=t},r.getDecomp=function(){var t=r._decomp;try{t||"undefined"==typeof window||(t=window.decomp),t||void 0===i.g||(t=i.g.decomp)}catch(e){t=null}return t}}()},48413(t,e,i){var r={};t.exports=r;var s=i(53614),n=i(66272),a=i(81388),o=i(99561),h=i(35810),l=i(69351),u=i(48140),d=i(53402),c=i(22562);r._deltaMax=1e3/60,r.create=function(t){t=t||{};var e=d.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0,lastUpdatesPerFrame:0}},t);return e.world=t.world||l.create({label:"World"}),e.pairs=t.pairs||o.create(),e.detector=t.detector||a.create(),e.detector.pairs=e.pairs,e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},r.update=function(t,e){var i,c=d.now(),f=t.world,p=t.detector,g=t.pairs,m=t.timing,v=m.timestamp;e>r._deltaMax&&d.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",r._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:d._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f),w=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&s.update(x,e),r._bodiesApplyGravity(x,t.gravity),r.wrap(x,w),r.attractors(x),e>0&&r._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i<t.constraintIterations;i++)u.solveAll(T,e);u.postSolveAll(x);var b=a.collisions(p);o.update(g,b,v),t.enableSleeping&&s.afterCollisions(g.list),g.collisionStart.length>0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=d.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(g.list),i=0;i<t.positionIterations;i++)n.solvePosition(g.list,e,S);for(n.postSolvePosition(x),u.preSolveAll(x),i=0;i<t.constraintIterations;i++)u.solveAll(T,e);for(u.postSolveAll(x),n.preSolveVelocity(g.list),i=0;i<t.velocityIterations;i++)n.solveVelocity(g.list,e);return r._bodiesUpdateVelocities(x),g.collisionActive.length>0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:m.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:m.timestamp,delta:e}),r._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=d.now()-c,t},r.merge=function(t,e){if(d.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var i=l.allBodies(t.world),n=0;n<i.length;n++){var a=i[n];s.set(a,!1),a.id=d.nextId()}}},r.clear=function(t){o.clear(t.pairs),a.clear(t.detector)},r._bodiesClearForces=function(t){for(var e=t.length,i=0;i<e;i++){var r=t[i];r.force.x=0,r.force.y=0,r.torque=0}},r._bodiesApplyGravity=function(t,e){var i=void 0!==e.scale?e.scale:.001,r=t.length;if((0!==e.x||0!==e.y)&&0!==i)for(var s=0;s<r;s++){var n=t[s];n.ignoreGravity||n.isStatic||n.isSleeping||(n.force.y+=n.mass*e.y*i,n.force.x+=n.mass*e.x*i)}},r._bodiesUpdate=function(t,e){for(var i=t.length,r=0;r<i;r++){var s=t[r];s.isStatic||s.isSleeping||c.update(s,e)}},r._bodiesUpdateVelocities=function(t){for(var e=t.length,i=0;i<e;i++)c.updateVelocities(t[i])},r.wrap=function(t,e){for(var i=0;i<t.length;i+=1){var r=t[i];null!==r.wrapBounds&&c.wrap(r,r.wrapBounds)}for(i=0;i<e.length;i+=1){var s=e[i];null!==s.wrapBounds&&l.wrap(s,s.wrapBounds)}},r.attractors=function(t){for(var e=0;e<t.length;e++){var i=t[e],r=i.attractors;if(r&&r.length>0)for(var s=0;s<t.length;s++){var n=t[s];if(e!==s)for(var a=0;a<r.length;a++){var o=r[a],h=o;d.isFunction(o)&&(h=o(i,n)),h&&c.applyForce(n,n.position,h)}}}}},35810(t,e,i){var r={};t.exports=r;var s=i(53402);r.on=function(t,e,i){for(var r,s=e.split(" "),n=0;n<s.length;n++)r=s[n],t.events=t.events||{},t.events[r]=t.events[r]||[],t.events[r].push(i);return i},r.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=s.keys(t.events).join(" "));for(var r=e.split(" "),n=0;n<r.length;n++){var a=t.events[r[n]],o=[];if(i&&a)for(var h=0;h<a.length;h++)a[h]!==i&&o.push(a[h]);t.events[r[n]]=o}}else t.events={}},r.trigger=function(t,e,i){var r,n,a,o,h=t.events;if(h&&s.keys(h).length>0){i||(i={}),r=e.split(" ");for(var l=0;l<r.length;l++)if(a=h[n=r[l]]){(o=s.clone(i,!1)).name=n,o.source=t;for(var u=0;u<a.length;u++)a[u].apply(t,[o])}}}},6790(t,e,i){var r={};t.exports=r;var s=i(73832),n=i(53402);r.name="matter-js",r.version="0.20.0",r.uses=[],r.used=[],r.use=function(){s.use(r,Array.prototype.slice.call(arguments))},r.before=function(t,e){return t=t.replace(/^Matter./,""),n.chainPathBefore(r,t,e)},r.after=function(t,e){return t=t.replace(/^Matter./,""),n.chainPathAfter(r,t,e)}},73832(t,e,i){var r={};t.exports=r;var s=i(53402);r._registry={},r.register=function(t){if(r.isPlugin(t)||s.warn("Plugin.register:",r.toString(t),"does not implement all required fields."),t.name in r._registry){var e=r._registry[t.name],i=r.versionParse(t.version).number,n=r.versionParse(e.version).number;i>n?(s.warn("Plugin.register:",r.toString(e),"was upgraded to",r.toString(t)),r._registry[t.name]=t):i<n?s.warn("Plugin.register:",r.toString(e),"can not be downgraded to",r.toString(t)):t!==e&&s.warn("Plugin.register:",r.toString(t),"is already registered to different plugin object")}else r._registry[t.name]=t;return t},r.resolve=function(t){return r._registry[r.dependencyParse(t).name]},r.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},r.isPlugin=function(t){return t&&t.name&&t.version&&t.install},r.isUsed=function(t,e){return t.used.indexOf(e)>-1},r.isFor=function(t,e){var i=t.for&&r.dependencyParse(t.for);return!t.for||e.name===i.name&&r.versionSatisfies(e.version,i.range)},r.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=r.dependencies(t),n=s.topologicalSort(i),a=[],o=0;o<n.length;o+=1)if(n[o]!==t.name){var h=r.resolve(n[o]);h?r.isUsed(t,h.name)||(r.isFor(h,t)||(s.warn("Plugin.use:",r.toString(h),"is for",h.for,"but installed on",r.toString(t)+"."),h._warned=!0),h.install?h.install(t):(s.warn("Plugin.use:",r.toString(h),"does not specify an install function."),h._warned=!0),h._warned?(a.push("🔶 "+r.toString(h)),delete h._warned):a.push("✅ "+r.toString(h)),t.used.push(h.name)):a.push("❌ "+n[o])}a.length>0&&!h.silent&&s.info(a.join(" "))}else s.warn("Plugin.use:",r.toString(t),"does not specify any dependencies to install.")},r.dependencies=function(t,e){var i=r.dependencyParse(t),n=i.name;if(!(n in(e=e||{}))){t=r.resolve(t)||t,e[n]=s.map(t.uses||[],function(e){r.isPlugin(e)&&r.register(e);var n=r.dependencyParse(e),a=r.resolve(e);return a&&!r.versionSatisfies(a.version,n.range)?(s.warn("Plugin.dependencies:",r.toString(a),"does not satisfy",r.toString(n),"used by",r.toString(i)+"."),a._warned=!0,t._warned=!0):a||(s.warn("Plugin.dependencies:",r.toString(e),"used by",r.toString(i),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a<e[n].length;a+=1)r.dependencies(e[n][a],e);return e}},r.dependencyParse=function(t){return s.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/.test(t)||s.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},r.versionParse=function(t){var e=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||s.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),r=Number(i[4]),n=Number(i[5]),a=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:r,minor:n,patch:a,parts:[r,n,a],prerelease:i[7],number:1e8*r+1e4*n+a}},r.versionSatisfies=function(t,e){e=e||"*";var i=r.versionParse(e),s=r.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return s.number>i.number;if(">="===i.operator)return s.number>=i.number;if("~"===i.operator)return s.major===i.major&&s.minor===i.minor&&s.patch>=i.patch;if("^"===i.operator)return i.major>0?s.major===i.major&&s.number>=i.number:i.minor>0?s.minor===i.minor&&s.patch>=i.patch:s.patch===i.patch}return t===e||"*"===t}},13037(t,e,i){var r={};t.exports=r;var s=i(35810),n=i(48413),a=i(53402);!function(){r._maxFrameDelta=1e3/15,r._frameDeltaFallback=1e3/60,r._timeBufferMargin=1.5,r._elapsedNextEstimate=1,r._smoothingLowerBound=.1,r._smoothingUpperBound=.9,r.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},r.run=function(t,e){return t.timeBuffer=r._frameDeltaFallback,function i(s){t.frameRequestId=r._onNextFrame(t,i),s&&t.enabled&&r.tick(t,e,s)}(),t},r.tick=function(e,i,o){var h=a.now(),l=e.delta,u=0,d=o-e.timeLastTick;if((!d||!e.timeLastTick||d>Math.max(r._maxFrameDelta,e.maxFrameTime))&&(d=e.frameDelta||r._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(d),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var c=e.frameDeltaHistory.slice(0).sort(),f=e.frameDeltaHistory.slice(c.length*r._smoothingLowerBound,c.length*r._smoothingUpperBound);d=t(f)||d}e.frameDeltaSnapping&&(d=1e3/Math.round(1e3/d)),e.frameDelta=d,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+l*r._timeBufferMargin),e.lastUpdatesDeferred=0;var p=e.maxUpdates||Math.ceil(e.maxFrameTime/l),g={timestamp:i.timing.timestamp};s.trigger(e,"beforeTick",g),s.trigger(e,"tick",g);for(var m=a.now();l>0&&e.timeBuffer>=l*r._timeBufferMargin;){s.trigger(e,"beforeUpdate",g),n.update(i,l),s.trigger(e,"afterUpdate",g),e.timeBuffer-=l,u+=1;var v=a.now()-h,y=a.now()-m,x=v+r._elapsedNextEstimate*y/u;if(u>=p||x>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/l-r._timeBufferMargin));break}}i.timing.lastUpdatesPerFrame=u,s.trigger(e,"afterTick",g),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/l)>p?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},r.stop=function(t){r._cancelNextFrame(t)},r._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},r._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,i=t.length,r=0;r<i;r+=1)e+=t[r];return e/i||0};r._mean=t}()},53614(t,e,i){var r={};t.exports=r;var s=i(22562),n=i(35810),a=i(53402);r._motionWakeThreshold=.18,r._motionSleepThreshold=.08,r._minBias=.9,r.update=function(t,e){for(var i=e/a._baseDelta,n=r._motionSleepThreshold,o=0;o<t.length;o++){var h=t[o],l=s.getSpeed(h),u=s.getAngularSpeed(h),d=l*l+u*u;if(0===h.force.x&&0===h.force.y){var c=Math.min(h.motion,d),f=Math.max(h.motion,d);h.motion=r._minBias*c+(1-r._minBias)*f,h.sleepThreshold>0&&h.motion<n?(h.sleepCounter+=1,h.sleepCounter>=h.sleepThreshold/i&&r.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else r.set(h,!1)}},r.afterCollisions=function(t){for(var e=r._motionSleepThreshold,i=0;i<t.length;i++){var s=t[i];if(s.isActive){var n=s.collision,a=n.bodyA.parent,o=n.bodyB.parent;if(!(a.isSleeping&&o.isSleeping||a.isStatic||o.isStatic)&&(a.isSleeping||o.isSleeping)){var h=a.isSleeping&&!a.isStatic?a:o,l=h===a?o:a;!h.isStatic&&l.motion>e&&r.set(h,!1)}}}},r.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},66280(t,e,i){var r={};t.exports=r;var s=i(41598),n=i(53402),a=i(22562),o=i(15647),h=i(31725);r.rectangle=function(t,e,i,r,o){o=o||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+r+" L 0 "+r)};if(o.chamfer){var l=o.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete o.chamfer}return a.create(n.extend({},h,o))},r.trapezoid=function(t,e,i,r,o,h){h=h||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var l,u=i*(o*=.5),d=u+(1-2*o)*i,c=d+u;l=o<.5?"L 0 0 L "+u+" "+-r+" L "+d+" "+-r+" L "+c+" 0":"L 0 0 L "+d+" "+-r+" L "+c+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return a.create(n.extend({},f,h))},r.circle=function(t,e,i,s,a){s=s||{};var o={label:"Circle Body",circleRadius:i};a=a||25;var h=Math.ceil(Math.max(10,Math.min(a,i)));return h%2==1&&(h+=1),r.polygon(t,e,h,i,n.extend({},o,s))},r.polygon=function(t,e,i,o,h){if(h=h||{},i<3)return r.circle(t,e,o,h);for(var l=2*Math.PI/i,u="",d=.5*l,c=0;c<i;c+=1){var f=d+c*l,p=Math.cos(f)*o,g=Math.sin(f)*o;u+="L "+p.toFixed(3)+" "+g.toFixed(3)+" "}var m={label:"Polygon Body",position:{x:t,y:e},vertices:s.fromPath(u)};if(h.chamfer){var v=h.chamfer;m.vertices=s.chamfer(m.vertices,v.radius,v.quality,v.qualityMin,v.qualityMax),delete h.chamfer}return a.create(n.extend({},m,h))},r.fromVertices=function(t,e,i,r,l,u,d,c){var f,p,g,m,v,y,x,T,w,b,S=n.getDecomp();for(f=Boolean(S&&S.quickDecomp),r=r||{},g=[],l=void 0!==l&&l,u=void 0!==u?u:.01,d=void 0!==d?d:10,c=void 0!==c?c:.01,n.isArray(i[0])||(i=[i]),w=0;w<i.length;w+=1)if(v=i[w],!(m=s.isConvex(v))&&!f&&n.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),m||!f)v=m?s.clockwiseSort(v):s.hull(v),g.push({position:{x:t,y:e},vertices:v});else{var C=v.map(function(t){return[t.x,t.y]});S.makeCCW(C),!1!==u&&S.removeCollinearPoints(C,u),!1!==c&&S.removeDuplicatePoints&&S.removeDuplicatePoints(C,c);var E=S.quickDecomp(C);for(y=0;y<E.length;y++){var A=E[y].map(function(t){return{x:t[0],y:t[1]}});d>0&&s.area(A)<d||g.push({position:s.centre(A),vertices:A})}}for(y=0;y<g.length;y++)g[y]=a.create(n.extend(g[y],r));if(l)for(y=0;y<g.length;y++){var _=g[y];for(x=y+1;x<g.length;x++){var M=g[x];if(o.overlaps(_.bounds,M.bounds)){var R=_.vertices,P=M.vertices;for(T=0;T<_.vertices.length;T++)for(b=0;b<M.vertices.length;b++){var O=h.magnitudeSquared(h.sub(R[(T+1)%R.length],P[b])),L=h.magnitudeSquared(h.sub(R[T],P[(b+1)%P.length]));O<5&&L<5&&(R[T].isInternal=!0,P[b].isInternal=!0)}}}}return g.length>1?(p=a.create(n.extend({parts:g.slice(0)},r)),a.setPosition(p,{x:t,y:e}),p):g[0]},r.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i<t.length;i++)for(var r=t[i],s=i+1;s<t.length;s++){var n=t[s];if(o.overlaps(r.bounds,n.bounds))for(var a=r.vertices,l=n.vertices,u=0;u<r.vertices.length;u++)for(var d=0;d<n.vertices.length;d++){var c=h.magnitudeSquared(h.sub(a[(u+1)%a.length],l[d])),f=h.magnitudeSquared(h.sub(a[u],l[(d+1)%l.length]));c<e&&f<e&&(a[u].isInternal=!0,l[d].isInternal=!0)}}return t}},74116(t,e,i){var r={};t.exports=r;var s=i(69351),n=i(48140),a=i(53402),o=i(22562),h=i(66280);r.stack=function(t,e,i,r,n,a,h){for(var l,u=s.create({label:"Stack"}),d=t,c=e,f=0,p=0;p<r;p++){for(var g=0,m=0;m<i;m++){var v=h(d,c,m,p,l,f);if(v){var y=v.bounds.max.y-v.bounds.min.y,x=v.bounds.max.x-v.bounds.min.x;y>g&&(g=y),o.translate(v,{x:.5*x,y:.5*y}),d=v.bounds.max.x+n,s.addBody(u,v),l=v,f+=1}else d+=n}c+=g+a,d=t}return u},r.chain=function(t,e,i,r,o,h){for(var l=t.bodies,u=1;u<l.length;u++){var d=l[u-1],c=l[u],f=d.bounds.max.y-d.bounds.min.y,p=d.bounds.max.x-d.bounds.min.x,g=c.bounds.max.y-c.bounds.min.y,m={bodyA:d,pointA:{x:p*e,y:f*i},bodyB:c,pointB:{x:(c.bounds.max.x-c.bounds.min.x)*r,y:g*o}},v=a.extend(m,h);s.addConstraint(t,n.create(v))}return t.label+=" Chain",t},r.mesh=function(t,e,i,r,o){var h,l,u,d,c,f=t.bodies;for(h=0;h<i;h++){for(l=1;l<e;l++)u=f[l-1+h*e],d=f[l+h*e],s.addConstraint(t,n.create(a.extend({bodyA:u,bodyB:d},o)));if(h>0)for(l=0;l<e;l++)u=f[l+(h-1)*e],d=f[l+h*e],s.addConstraint(t,n.create(a.extend({bodyA:u,bodyB:d},o))),r&&l>0&&(c=f[l-1+(h-1)*e],s.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:d},o)))),r&&l<e-1&&(c=f[l+1+(h-1)*e],s.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:d},o))))}return t.label+=" Mesh",t},r.pyramid=function(t,e,i,s,n,a,h){return r.stack(t,e,i,s,n,a,function(e,r,a,l,u,d){var c=Math.min(s,Math.ceil(i/2)),f=u?u.bounds.max.x-u.bounds.min.x:0;if(!(l>c||a<(l=c-l)||a>i-1-l))return 1===d&&o.translate(u,{x:(a+(i%2==1?1:-1))*f,y:0}),h(t+(u?a*f:0)+a*n,r,a,l,u,d)})},r.newtonsCradle=function(t,e,i,r,a){for(var o=s.create({label:"Newtons Cradle"}),l=0;l<i;l++){var u=h.circle(t+l*(1.9*r),e+a,r,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),d=n.create({pointA:{x:t+l*(1.9*r),y:e},bodyB:u});s.addBody(o,u),s.addConstraint(o,d)}return o},r.car=function(t,e,i,r,a){var l=o.nextGroup(!0),u=.5*-i+20,d=.5*i-20,c=s.create({label:"Car"}),f=h.rectangle(t,e,i,r,{collisionFilter:{group:l},chamfer:{radius:.5*r},density:2e-4}),p=h.circle(t+u,e+0,a,{collisionFilter:{group:l},friction:.8}),g=h.circle(t+d,e+0,a,{collisionFilter:{group:l},friction:.8}),m=n.create({bodyB:f,pointB:{x:u,y:0},bodyA:p,stiffness:1,length:0}),v=n.create({bodyB:f,pointB:{x:d,y:0},bodyA:g,stiffness:1,length:0});return s.addBody(c,f),s.addBody(c,p),s.addBody(c,g),s.addConstraint(c,m),s.addConstraint(c,v),c},r.softBody=function(t,e,i,s,n,o,l,u,d,c){d=a.extend({inertia:1/0},d),c=a.extend({stiffness:.2,render:{type:"line",anchors:!1}},c);var f=r.stack(t,e,i,s,n,o,function(t,e){return h.circle(t,e,u,d)});return r.mesh(f,i,s,l,c),f.label="Soft Body",f}},66615(t,e,i){var r={};t.exports=r;var s=i(31725),n=i(53402);r.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var r=(i+1)%t.length,a=s.normalise({x:t[r].y-t[i].y,y:t[i].x-t[r].x}),o=0===a.y?1/0:a.x/a.y;e[o=o.toFixed(3).toString()]=a}return n.values(e)},r.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),r=Math.sin(e),s=0;s<t.length;s++){var n,a=t[s];n=a.x*i-a.y*r,a.y=a.x*r+a.y*i,a.x=n}}},15647(t){var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var r=0;r<e.length;r++){var s=e[r];s.x>t.max.x&&(t.max.x=s.x),s.x<t.min.x&&(t.min.x=s.x),s.y>t.max.y&&(t.max.y=s.y),s.y<t.min.y&&(t.min.y=s.y)}i&&(i.x>0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,r=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+r},e.wrap=function(t,e,i){var r=null,s=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?r=e.min.x-t.max.x:t.max.x<e.min.x&&(r=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?s=e.min.y-t.max.y:t.max.y<e.min.y&&(s=e.max.y-t.min.y)),null!==r||null!==s)return{x:r||0,y:s||0}}},74058(t,e,i){var r={};t.exports=r;i(15647);var s=i(53402);r.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||s.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,n,a,o,h,l,u,d,c,f,p,g=[],m=0,v=0,y=0;e=e||15;var x=function(t,e,i){var r=i%2==1&&i>1;if(!c||t!=c.x||e!=c.y){c&&r?(f=c.x,p=c.y):(f=0,p=0);var s={x:f+t,y:p+e};!r&&c||(c=s),g.push(s),v=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(r._svgPathToAbsolute(t),a=t.getTotalLength(),l=[],i=0;i<t.pathSegList.numberOfItems;i+=1)l.push(t.pathSegList.getItem(i));for(u=l.concat();m<a;){if((h=l[t.getPathSegAtLength(m)])!=d){for(;u.length&&u[0]!=h;)T(u.shift());d=h}switch(h.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":o=t.getPointAtLength(m),x(o.x,o.y,0)}m+=e}for(i=0,n=u.length;i<n;++i)T(u[i]);return g},r._svgPathToAbsolute=function(t){for(var e,i,r,s,n,a,o=t.pathSegList,h=0,l=0,u=o.numberOfItems,d=0;d<u;++d){var c=o.getItem(d),f=c.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(f))"x"in c&&(h=c.x),"y"in c&&(l=c.y);else switch("x1"in c&&(r=h+c.x1),"x2"in c&&(n=h+c.x2),"y1"in c&&(s=l+c.y1),"y2"in c&&(a=l+c.y2),"x"in c&&(h+=c.x),"y"in c&&(l+=c.y),f){case"m":o.replaceItem(t.createSVGPathSegMovetoAbs(h,l),d);break;case"l":o.replaceItem(t.createSVGPathSegLinetoAbs(h,l),d);break;case"h":o.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),d);break;case"v":o.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),d);break;case"c":o.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,r,s,n,a),d);break;case"s":o.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,n,a),d);break;case"q":o.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,r,s),d);break;case"t":o.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),d);break;case"a":o.replaceItem(t.createSVGPathSegArcAbs(h,l,c.r1,c.r2,c.angle,c.largeArcFlag,c.sweepFlag),d);break;case"z":case"Z":h=e,l=i}"M"!=f&&"m"!=f||(e=h,i=l)}}},31725(t){var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var r=Math.cos(e),s=Math.sin(e);i||(i={});var n=t.x*r-t.y*s;return i.y=t.x*s+t.y*r,i.x=n,i},e.rotateAbout=function(t,e,i,r){var s=Math.cos(e),n=Math.sin(e);r||(r={});var a=i.x+((t.x-i.x)*s-(t.y-i.y)*n);return r.y=i.y+((t.x-i.x)*n+(t.y-i.y)*s),r.x=a,r},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},41598(t,e,i){var r={};t.exports=r;var s=i(31725),n=i(53402);r.create=function(t,e){for(var i=[],r=0;r<t.length;r++){var s=t[r],n={x:s.x,y:s.y,index:r,body:e,isInternal:!1};i.push(n)}return i},r.fromPath=function(t,e){var i=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,function(t,e,r){i.push({x:parseFloat(e),y:parseFloat(r)})}),r.create(i,e)},r.centre=function(t){for(var e,i,n,a=r.area(t,!0),o={x:0,y:0},h=0;h<t.length;h++)n=(h+1)%t.length,e=s.cross(t[h],t[n]),i=s.mult(s.add(t[h],t[n]),e),o=s.add(o,i);return s.div(o,6*a)},r.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return s.div(e,t.length)},r.area=function(t,e){for(var i=0,r=t.length-1,s=0;s<t.length;s++)i+=(t[r].x-t[s].x)*(t[r].y+t[s].y),r=s;return e?i/2:Math.abs(i)/2},r.inertia=function(t,e){for(var i,r,n=0,a=0,o=t,h=0;h<o.length;h++)r=(h+1)%o.length,n+=(i=Math.abs(s.cross(o[r],o[h])))*(s.dot(o[r],o[r])+s.dot(o[r],o[h])+s.dot(o[h],o[h])),a+=i;return e/6*(n/a)},r.translate=function(t,e,i){i=void 0!==i?i:1;var r,s=t.length,n=e.x*i,a=e.y*i;for(r=0;r<s;r++)t[r].x+=n,t[r].y+=a;return t},r.rotate=function(t,e,i){if(0!==e){var r,s,n,a,o=Math.cos(e),h=Math.sin(e),l=i.x,u=i.y,d=t.length;for(a=0;a<d;a++)s=(r=t[a]).x-l,n=r.y-u,r.x=l+(s*o-n*h),r.y=u+(s*h+n*o);return t}},r.contains=function(t,e){for(var i,r=e.x,s=e.y,n=t.length,a=t[n-1],o=0;o<n;o++){if(i=t[o],(r-a.x)*(i.y-a.y)+(s-a.y)*(a.x-i.x)>0)return!1;a=i}return!0},r.scale=function(t,e,i,n){if(1===e&&1===i)return t;var a,o;n=n||r.centre(t);for(var h=0;h<t.length;h++)a=t[h],o=s.sub(a,n),t[h].x=n.x+o.x*e,t[h].y=n.y+o.y*i;return t},r.chamfer=function(t,e,i,r,a){e="number"==typeof e?[e]:e||[8],i=void 0!==i?i:-1,r=r||2,a=a||14;for(var o=[],h=0;h<t.length;h++){var l=t[h-1>=0?h-1:t.length-1],u=t[h],d=t[(h+1)%t.length],c=e[h<e.length?h:e.length-1];if(0!==c){var f=s.normalise({x:u.y-l.y,y:l.x-u.x}),p=s.normalise({x:d.y-u.y,y:u.x-d.x}),g=Math.sqrt(2*Math.pow(c,2)),m=s.mult(n.clone(f),c),v=s.normalise(s.mult(s.add(f,p),.5)),y=s.sub(u,s.mult(v,g)),x=i;-1===i&&(x=1.75*Math.pow(c,.32)),(x=n.clamp(x,r,a))%2==1&&(x+=1);for(var T=Math.acos(s.dot(f,p))/x,w=0;w<x;w++)o.push(s.add(s.rotate(m,T*w),y))}else o.push(u)}return o},r.clockwiseSort=function(t){var e=r.mean(t);return t.sort(function(t,i){return s.angle(e,t)-s.angle(e,i)}),t},r.isConvex=function(t){var e,i,r,s,n=0,a=t.length;if(a<3)return null;for(e=0;e<a;e++)if(r=(e+2)%a,s=(t[i=(e+1)%a].x-t[e].x)*(t[r].y-t[i].y),(s-=(t[i].y-t[e].y)*(t[r].x-t[i].x))<0?n|=1:s>0&&(n|=2),3===n)return!1;return 0!==n||null},r.hull=function(t){var e,i,r=[],n=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i<t.length;i+=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];r.length>=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return r.pop(),n.pop(),r.concat(n)}},55973(t){function e(t,e,i){i=i||0;var r,s,n,a,o,h,l,u=[0,0];return r=t[1][1]-t[0][1],s=t[0][0]-t[1][0],n=r*t[0][0]+s*t[0][1],a=e[1][1]-e[0][1],o=e[0][0]-e[1][0],h=a*e[0][0]+o*e[0][1],S(l=r*o-a*s,0,i)||(u[0]=(o*n-s*h)/l,u[1]=(r*h-a*n)/l),u}function i(t,e,i,r){var s=e[0]-t[0],n=e[1]-t[1],a=r[0]-i[0],o=r[1]-i[1];if(a*n-o*s===0)return!1;var h=(s*(i[1]-t[1])+n*(t[0]-i[0]))/(a*n-o*s),l=(a*(t[1]-i[1])+o*(i[0]-t[0]))/(o*s-a*n);return h>=0&&h<=1&&l>=0&&l<=1}function r(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function s(t,e,i){return r(t,e,i)>0}function n(t,e,i){return r(t,e,i)>=0}function a(t,e,i){return r(t,e,i)<0}function o(t,e,i){return r(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,r,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],r=r||[],h=h||[];var m=[0,0],v=[0,0],x=[0,0],T=0,w=0,S=0,C=0,E=0,A=0,_=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;L<e.length;++L)if(p(P,L)){r.push(P[L]),T=w=Number.MAX_VALUE;for(var F=0;F<e.length;++F)s(c(P,L-1),c(P,L),c(P,F))&&o(c(P,L-1),c(P,L),c(P,F-1))&&(x=b(c(P,L-1),c(P,L),c(P,F),c(P,F-1)),a(c(P,L+1),c(P,L),x)&&(S=d(P[L],x))<w&&(w=S,v=x,A=F)),s(c(P,L+1),c(P,L),c(P,F+1))&&o(c(P,L+1),c(P,L),c(P,F))&&(x=b(c(P,L+1),c(P,L),c(P,F),c(P,F+1)),s(c(P,L-1),c(P,L),x)&&(S=d(P[L],x))<T&&(T=S,m=x,E=F));if(A===(E+1)%e.length)x[0]=(v[0]+m[0])/2,x[1]=(v[1]+m[1])/2,h.push(x),L<E?(f(M,P,L,E+1),M.push(x),R.push(x),0!==A&&f(R,P,A,P.length),f(R,P,0,L+1)):(0!==L&&f(M,P,L,P.length),f(M,P,0,E+1),M.push(x),R.push(x),f(R,P,A,L+1));else{if(A>E&&(E+=e.length),C=Number.MAX_VALUE,E<A)return i;for(F=A;F<=E;++F)n(c(P,L-1),c(P,L),c(P,F))&&o(c(P,L+1),c(P,L),c(P,F))&&(S=d(c(P,L),c(P,F)))<C&&y(P,L,F)&&(C=S,_=F%e.length);L<_?(f(M,P,L,_+1),0!==_&&f(R,P,_,O.length),f(R,P,0,L+1)):(0!==L&&f(M,P,L,O.length),f(M,P,0,_+1),f(R,P,_,L+1))}return M.length<R.length?(t(M,i,r,h,l,u,g),t(R,i,r,h,l,u,g)):(t(R,i,r,h,l,u,g),t(M,i,r,h,l,u,g)),i}return i.push(e),i},isSimple:function(t){var e,r=t;for(e=0;e<r.length-1;e++)for(var s=0;s<e-1;s++)if(i(r[e],r[e+1],r[s],r[s+1]))return!1;for(e=1;e<r.length-2;e++)if(i(r[0],r[r.length-1],r[e],r[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,r=t.length-1;t.length>3&&r>=0;--r)u(c(t,r-1),c(t,r),c(t,r+1),e)&&(t.splice(r%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var r=t[i],s=i-1;s>=0;--s)C(r,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,r=1;r<t.length;++r)(i[r][1]<i[e][1]||i[r][1]===i[e][1]&&i[r][0]>i[e][0])&&(e=r);return!s(c(t,e-1),c(t,e),c(t,e+1))&&(function(t){for(var e=[],i=t.length,r=0;r!==i;r++)e.push(t.pop());for(r=0;r!==i;r++)t[r]=e[r]}(t),!0)}};var h=[],l=[];function u(t,e,i,s){if(s){var n=h,a=l;n[0]=e[0]-t[0],n[1]=e[1]-t[1],a[0]=i[0]-e[0],a[1]=i[1]-e[1];var o=n[0]*a[0]+n[1]*a[1],u=Math.sqrt(n[0]*n[0]+n[1]*n[1]),d=Math.sqrt(a[0]*a[0]+a[1]*a[1]);return Math.acos(o/(u*d))<s}return 0===r(t,e,i)}function d(t,e){var i=e[0]-t[0],r=e[1]-t[1];return i*i+r*r}function c(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function f(t,e,i,r){for(var s=i;s<r;s++)t.push(e[s])}function p(t,e){return a(c(t,e-1),c(t,e),c(t,e+1))}var g=[],m=[];function v(t,i,r){var s,a,h=g,l=m;if(n(c(t,i+1),c(t,i),c(t,r))&&o(c(t,i-1),c(t,i),c(t,r)))return!1;a=d(c(t,i),c(t,r));for(var u=0;u!==t.length;++u)if((u+1)%t.length!==i&&u!==i&&n(c(t,i),c(t,r),c(t,u+1))&&o(c(t,i),c(t,r),c(t,u))&&(h[0]=c(t,i),h[1]=c(t,r),l[0]=c(t,u),l[1]=c(t,u+1),s=e(h,l),d(c(t,i),s)<a))return!1;return!0}function y(t,e,r){for(var s=0;s!==t.length;++s)if(s!==e&&s!==r&&(s+1)%t.length!==e&&(s+1)%t.length!==r&&i(c(t,e),c(t,r),c(t,s),c(t,s+1)))return!1;return!0}function x(t,e,i,r){var s=r||[];if(function(t){t.length=0}(s),e<i)for(var n=e;n<=i;n++)s.push(t[n]);else{for(n=0;n<=i;n++)s.push(t[n]);for(n=e;n<t.length;n++)s.push(t[n])}return s}function T(t){for(var e=[],i=[],r=[],s=[],n=Number.MAX_VALUE,a=0;a<t.length;++a)if(p(t,a))for(var o=0;o<t.length;++o)if(v(t,a,o)){i=T(x(t,a,o,s)),r=T(x(t,o,a,s));for(var h=0;h<r.length;h++)i.push(r[h]);i.length<n&&(e=i,n=i.length,e.push([c(t,a),c(t,o)]))}return e}function w(t,e){if(0===e.length)return[t];if(e instanceof Array&&e.length&&e[0]instanceof Array&&2===e[0].length&&e[0][0]instanceof Array){for(var i=[t],r=0;r<e.length;r++)for(var s=e[r],n=0;n<i.length;n++){var a=w(i[n],s);if(a){i.splice(n,1),i.push(a[0],a[1]);break}}return i}s=e,r=t.indexOf(s[0]),n=t.indexOf(s[1]);return-1!==r&&-1!==n&&[x(t,r,n),x(t,n,r)]}function b(t,e,i,r,s){s=s||0;var n=e[1]-t[1],a=t[0]-e[0],o=n*t[0]+a*t[1],h=r[1]-i[1],l=i[0]-r[0],u=h*i[0]+l*i[1],d=n*l-h*a;return S(d,0,s)?[0,0]:[(l*o-a*u)/d,(n*u-h*o)/d]}function S(t,e,i){return i=i||0,Math.abs(t-e)<=i}function C(t,e,i){return S(t[0],e[0],i)&&S(t[1],e[1],i)}},52018(t,e,i){var r=new(i(83419))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=r},42363(t){var e={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};e.DefaultScene.push("CameraManager3D"),e.Global.push("facebook"),t.exports=e},37277(t){var e={},i={},r={register:function(t,i,r,s){void 0===s&&(s=!1),e[t]={plugin:i,mapping:r,custom:s}},registerCustom:function(t,e,r,s){i[t]={plugin:e,mapping:r,data:s}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=r},77332(t,e,i){var r=i(83419),s=i(8443),n=i(50792),a=i(74099),o=i(44603),h=i(39429),l=i(95540),u=i(37277),d=i(72905),c=i(8054),f=new r({Extends:n,initialize:function(t){n.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted||t.config.renderType===c.HEADLESS?this.boot():t.events.once(s.BOOT,this.boot,this)},boot:function(){var t,e,i,r,n,a,o,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t<u.length;t++)e=u[t],i=l(e,"key",null),r=l(e,"plugin",null),n=l(e,"start",!1),a=l(e,"mapping",null),o=l(e,"data",null),i&&(r?this.install(i,r,n,a,o):console.warn("Missing `plugin` for key: "+i));for(u=(u=h.installScenePlugins).concat(this._pendingScene),t=0;t<u.length;t++)e=u[t],i=l(e,"key",null),r=l(e,"plugin",null),a=l(e,"mapping",null),i&&(r?this.installScenePlugin(i,r,a):console.warn("Missing `plugin` for key: "+i));this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(s.DESTROY,this.destroy,this)},addToScene:function(t,e,i){var r,s,n,a=this.game,o=t.scene,h=t.settings.map,l=t.settings.isBooted;for(r=0;r<e.length;r++)a[s=e[r]]?(t[s]=a[s],h.hasOwnProperty(s)&&(o[h[s]]=t[s])):"game"===s&&h.hasOwnProperty(s)&&(o[h[s]]=a);for(var d=0;d<i.length;d++)for(n=i[d],r=0;r<n.length;r++)if(s=n[r],u.hasCore(s)){var c=u.getCore(s),f=c.mapping,p=new c.plugin(o,this,f);t[f]=p,c.custom?o[f]=p:h.hasOwnProperty(f)&&(o[h[f]]=p),l&&p.boot()}for(n=this.plugins,r=0;r<n.length;r++){var g=n[r];g.mapping&&(o[g.mapping]=g.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t=t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,r,s){if(void 0===s&&(s=!1),"function"==typeof e){if(u.hasCore(t)||u.register(t,e,i,!0),-1===this.scenePlugins.indexOf(t))this.scenePlugins.push(t);else if(!s&&u.hasCore(t))return void console.warn("Scene Plugin key in use: "+t);if(r){var n=new e(r,this,t);r.sys[t]=n,i&&""!==i&&(r[i]=n),n.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,r,s){if(void 0===i&&(i=!1),void 0===r&&(r=null),void 0===s&&(s=null),"function"!=typeof e)return console.warn("Invalid Plugin: "+t),null;if(u.hasCustom(t))return console.warn("Plugin key in use: "+t),null;if(null!==r&&(i=!0),this.game.isBooted){if(u.registerCustom(t,e,r,s),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:r,data:s});return null},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++){if(e[i].key===t)return i}return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=u.getCustom(t);if(i){var r=new i.plugin(this);i={key:e,plugin:r,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),r.init(i.data),r.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var r=this.getClass(t);return r&&e?(i=this.createEntry(t,t))?i.plugin:null:r||null},getClass:function(t){return u.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&d(this.plugins,e),u.removeCustom(t)},removeScenePlugin:function(t){d(this.scenePlugins,t),u.remove(t)},registerGameObject:function(t,e,i){return e&&h.register(t,e),i&&o.register(t,i),this},removeGameObject:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),e&&h.remove(t),i&&o.remove(t),this},registerFileType:function(t,e,i){a.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();u.destroyCustomPlugins(),this.game.noReturn&&u.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=f},45145(t,e,i){var r=i(52018),s=i(83419),n=i(44594),a=new s({Extends:r,initialize:function(t,e,i){r.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(n.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},18922(t,e,i){t.exports={BasePlugin:i(52018),DefaultPlugins:i(42363),PluginCache:i(37277),PluginManager:i(77332),ScenePlugin:i(45145)}},63595(){"undefined"!=typeof HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),i=this.getVideoPlaybackQuality(),r=this.mozPresentedFrames||this.mozPaintedFrames||i.totalVideoFrames-i.droppedVideoFrames,s=(n,a)=>{const o=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||o.totalVideoFrames-o.droppedVideoFrames;if(h>r){const r=this.mozFrameDelay||o.totalFrameDelay-i.totalFrameDelay||0,s=a-n;t(a,{presentationTime:a+1e3*r,expectedDisplayTime:a+s,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+s/1e3,presentedFrames:h,processingDuration:r}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(a,t))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(t=>s(e,t)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312(t){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795(t){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},84322(t){t.exports={MULTIPLY:0,FILL:1,ADD:2,SCREEN:4,OVERLAY:5,HARD_LIGHT:6}},68627(t,e,i){var r=i(19715),s=i(32880),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(56373),u=i(97480),d=i(69442),c=i(8443),f=i(61340),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels,transparent:e.transparent},this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:e.transparent,desynchronized:e.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=e.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.isBooted=!1,this.init()},init:function(){var t=this.game;t.events.once(c.BOOT,function(){var t=this.config;if(!t.transparent){var e=this.gameContext,i=this.gameCanvas;e.fillStyle=t.backgroundColor.rgba,e.fillRect(0,0,i.width,i.height)}},this),t.textures.once(d.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,r=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),this.emit(h.PRE_RENDER_CLEAR),e.clearBeforeRender&&(t.clearRect(0,0,i,r),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,r))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var s=e.length;this.emit(h.RENDER,t,i);var n=i.x,a=i.y,o=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(n,a,o,l),u.clip()),i.emit(r.PRE_RENDER,i),this.currentContext=u;var d=i.mask;d&&d.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(n,a,o,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=s,i.renderToTexture&&i.emit(r.PRE_RENDER,i),i.matrix.copyToContext(u);for(var c=0;c<s;c++){var f=e[c];f.mask&&f.mask.preRenderCanvas(this,f,i),f.renderCanvas(this,f,i),f.mask&&f.mask.postRenderCanvas(this,f,i)}u.setTransform(1,0,0,1,0,0),u.globalCompositeOperation="source-over",u.globalAlpha=1,i.flashEffect.postRenderCanvas(u),i.fadeEffect.postRenderCanvas(u),i.dirty=!1,d&&d.postRenderCanvas(this),u.restore(),i.renderToTexture&&(i.emit(r.POST_RENDER,i),i.renderToGame&&t.sys.context.drawImage(i.canvas,n,a)),i.emit(r.POST_RENDER,i)},postRender:function(){this.gameContext.restore(),this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(s(this.gameCanvas,t),t.callback=null)},snapshotCanvas:function(t,e,i,r,n,a,o,h,l){void 0===i&&(i=!1),this.snapshotArea(r,n,a,o,e,h,l);var u=this.snapshotState;return u.getPixel=i,s(t,u),u.callback=null,this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,t,e,i)},snapshotArea:function(t,e,i,r,s,n,a){var o=this.snapshotState;return o.callback=s,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=Math.min(i,this.gameCanvas.width),o.height=Math.min(r,this.gameCanvas.height),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},batchSprite:function(t,e,i,r){var s=i.alpha*t.alpha;if(0!==s){var n=this.currentContext,a=this._tempMatrix1,o=this._tempMatrix2,h=e.canvasData,l=h.x,u=h.y,d=e.cutWidth,c=e.cutHeight,f=e.customPivot,p=e.source.resolution,g=t.displayOriginX,m=t.displayOriginY,v=-g+e.x,y=-m+e.y;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),d=x.cw,c=x.ch,l=x.cx,u=x.cy,v=-g+x.x,y=-m+x.y,t.flipX&&(v>=0?v=-(v+d):v<0&&(v=Math.abs(v)-d)),t.flipY&&(y>=0?y=-(y+c):y<0&&(y=Math.abs(y)-c))}var T=1,w=1;t.flipX&&(f||(v+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*m),w=-1);var b=t.x,S=t.y;if(i.roundPixels&&(b=Math.floor(b),S=Math.floor(S)),o.applyITRS(b,S,t.rotation,t.scaleX*T,t.scaleY*w),a.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,t.scrollFactorX,t.scrollFactorY),r&&a.multiply(r),a.multiply(o),i.renderRoundPixels&&(a.e=Math.floor(a.e+.5),a.f=Math.floor(a.f+.5)),n.save(),a.setToContext(n),n.globalCompositeOperation=this.blendModes[t.blendMode],n.globalAlpha=s,n.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),d>0&&c>0){var C=d/p,E=c/p;i.roundPixels&&(v=Math.floor(v+.5),y=Math.floor(y+.5),C+=.5,E+=.5),n.drawImage(e.source.image,l,u,d,c,v,y,C,E)}t.mask&&t.mask.postRenderCanvas(this,t,i),n.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},55830(t,e,i){t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373(t,e,i){var r=i(10312),s=i(89289);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[r.NORMAL]=i,t[r.ADD]="lighter",t[r.MULTIPLY]=e?"multiply":i,t[r.SCREEN]=e?"screen":i,t[r.OVERLAY]=e?"overlay":i,t[r.DARKEN]=e?"darken":i,t[r.LIGHTEN]=e?"lighten":i,t[r.COLOR_DODGE]=e?"color-dodge":i,t[r.COLOR_BURN]=e?"color-burn":i,t[r.HARD_LIGHT]=e?"hard-light":i,t[r.SOFT_LIGHT]=e?"soft-light":i,t[r.DIFFERENCE]=e?"difference":i,t[r.EXCLUSION]=e?"exclusion":i,t[r.HUE]=e?"hue":i,t[r.SATURATION]=e?"saturation":i,t[r.COLOR]=e?"color":i,t[r.LUMINOSITY]=e?"luminosity":i,t[r.ERASE]="destination-out",t[r.SOURCE_IN]="source-in",t[r.SOURCE_OUT]="source-out",t[r.SOURCE_ATOP]="source-atop",t[r.DESTINATION_OVER]="destination-over",t[r.DESTINATION_IN]="destination-in",t[r.DESTINATION_OUT]="destination-out",t[r.DESTINATION_ATOP]="destination-atop",t[r.LIGHTER]="lighter",t[r.COPY]="copy",t[r.XOR]="xor",t}},20926(t,e,i){var r=i(91296);t.exports=function(t,e,i,s,n){var a=s.alpha*i.alpha;if(a<=0)return!1;var o=r(i,s,n).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=a,e.save(),o.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899(t){t.exports="losewebgl"},6119(t){t.exports="postrender"},31124(t){t.exports="prerenderclear"},48070(t){t.exports="prerender"},15640(t){t.exports="render"},8912(t){t.exports="resize"},87124(t){t.exports="restorewebgl"},53998(t){t.exports="setparalleltextureunits"},92503(t,e,i){t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),PRE_RENDER_CLEAR:i(31124),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124),SET_PARALLEL_TEXTURE_UNITS:i(53998)}},36909(t,e,i){t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=n(e,"callback"),a=n(e,"type","image/png"),o=n(e,"encoder",.92),h=Math.abs(Math.round(n(e,"x",0))),l=Math.abs(Math.round(n(e,"y",0))),u=Math.floor(n(e,"width",t.width)),d=Math.floor(n(e,"height",t.height));if(n(e,"getPixel",!1)){var c=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new s(c[0],c[1],c[2],c[3]))}else if(0!==h||0!==l||u!==t.width||d!==t.height){var f=r.createWebGL(this,u,d),p=f.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&p.drawImage(t,h,l,u,d,0,0,u,d);var g=new Image;g.onerror=function(){i.call(null),r.remove(f)},g.onload=function(){i.call(null,g),r.remove(f)},g.src=f.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},88815(t,e,i){var r=i(27919),s=i(40987),n=i(95540);t.exports=function(t,e){var i=t,a=n(e,"callback"),o=n(e,"type","image/png"),h=n(e,"encoder",.92),l=Math.abs(Math.round(n(e,"x",0))),u=Math.abs(Math.round(n(e,"y",0))),d=n(e,"getPixel",!1),c=n(e,"isFramebuffer",!1),f=c?n(e,"bufferWidth",1):i.drawingBufferWidth,p=c?n(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var g=new Uint8Array(4),m=p-u-1;i.readPixels(l,m,1,1,i.RGBA,i.UNSIGNED_BYTE,g),a.call(null,new s(g[0],g[1],g[2],g[3]))}else{var v=Math.floor(n(e,"width",f)),y=Math.floor(n(e,"height",p)),x=new Uint8Array(v*y*4);i.readPixels(l,p-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var T=r.createWebGL(this,v,y),w=T.getContext("2d",{willReadFrequently:!0}),b=w.getImageData(0,0,v,y),S=b.data,C=0;C<y;C++)for(var E=0;E<v;E++){var A=4*((y-C-1)*v+E),_=4*(C*v+E),M=x[A+0],R=x[A+1],P=x[A+2],O=x[A+3];if(e.unpremultiplyAlpha&&0!==O){var L=255/O;M=Math.floor(M*L),R=Math.floor(R*L),P=Math.floor(P*L)}S[_+0]=M,S[_+1]=R,S[_+2]=P,S[_+3]=O}w.putImageData(b,0,0);var F=new Image;F.onerror=function(){a.call(null),r.remove(T)},F.onload=function(){a.call(null,F),r.remove(T)},F.src=T.toDataURL(o,h)}}},89966(t,e,i){t.exports={Canvas:i(32880),WebGL:i(88815)}},87774(t,e,i){var r=i(50030),s=new(i(83419))({initialize:function(t,e){void 0===e&&(e={}),this.renderer=t,this.camera=null,this.setCamera(e.camera||null),this.state={bindings:{framebuffer:null},blend:{},colorClearValue:e.clearColor||[0,0,0,0],scissor:{box:[0,0,0,0],enable:!0},viewport:[0,0,0,0]},this.blendMode=-1,this.setBlendMode(e.blendMode||0),this.autoClear=0,void 0===e.autoClear||!0===e.autoClear?this.setAutoClear(!0,!0,!0):Array.isArray(e.autoClear)&&this.setAutoClear.apply(this,e.autoClear),this.useCanvas=!!e.useCanvas,this.framebuffer=null,this.texture=null,this.enableMipmap=!!e.enableMipmap,this.pool=e.pool||null,this.lastUsed=0,this.width=0,this.height=0,this._locks=[],e.copyFrom?this.copy(e.copyFrom):this.resize(e.width||t.width,e.height||t.height)},resize:function(t,e){if((t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),this.useCanvas)this.framebuffer||(this.framebuffer=this.renderer.createFramebuffer(null));else if(this.framebuffer)this.framebuffer.resize(t,e);else{var i=this.renderer,s=i.gl,n=r(t,e),a=s.NEAREST;i.config.antialias&&(a=s.LINEAR);var o=a;n&&this.enableMipmap&&i.config.mipmapRegeneration&&i.mipmapFilter&&(o=i.mipmapFilter);var h=s.CLAMP_TO_EDGE;n&&(h=s.REPEAT),this.texture=i.createTexture2D(0,o,a,h,h,s.RGBA,null,t,e),this.framebuffer=i.createFramebuffer(this.texture,!0,!1)}this.state.bindings.framebuffer=this.framebuffer,this.width=t,this.height=e,this.state.scissor.box=[0,0,t,e],this.state.viewport=[0,0,t,e]},copy:function(t){var e=t.state,i=e.blend,r=e.scissor;this.autoClear=t.autoClear,this.useCanvas=t.useCanvas,this.framebuffer=t.framebuffer,this.texture=t.texture,this.camera=t.camera,this.blendMode=t.blendMode,this.width=t.width,this.height=t.height,this.state={bindings:{framebuffer:e.bindings.framebuffer},blend:{color:i.color&&i.color.slice(),enable:i.enable,equation:i.equation,func:i.func},colorClearValue:e.colorClearValue.slice(),scissor:{box:r.box.slice(),enable:r.enable},viewport:e.viewport.slice()}},getClone:function(t){var e=new s(this.renderer,{copyFrom:this});return t||e.setAutoClear(!1,!1,!1),e},setAutoClear:function(t,e,i){var r=0,s=this.renderer.gl;t&&(r|=s.COLOR_BUFFER_BIT),e&&(r|=s.DEPTH_BUFFER_BIT),i&&(r|=s.STENCIL_BUFFER_BIT),this.autoClear=r},setBlendMode:function(t,e){if(t!==this.blendMode){var i=this.state.blend,r=this.renderer.blendModes[t];i.enable=r.enable,i.equation=r.equation,i.func=r.func,i.color=e||void 0,this.blendMode=t}},setCamera:function(t){this.camera=t},setClearColor:function(t,e,i,r){var s=this.state.colorClearValue;t===s[0]&&e===s[1]&&i===s[2]&&r===s[3]||(this.state.colorClearValue=[t,e,i,r])},setScissorBox:function(t,e,i,r){e=this.height-e-r,this.state.scissor.box=[t,e,i,r]},setScissorEnable:function(t){this.state.scissor.enable=t},use:function(){this.renderer.renderNodes.finishBatch(),this.autoClear&&this.clear()},release:function(){this.pool&&0===this._locks.length&&(this.lastUsed=Date.now(),this.pool.add(this)),this.renderer.renderNodes.finishBatch()},lock:function(t){-1===this._locks.indexOf(t)&&this._locks.push(t)},unlock:function(t,e){var i=this._locks.indexOf(t);-1!==i&&this._locks.splice(i,1),e&&this.release()},isLocked:function(){return this._locks.length>0},beginDraw:function(){this.framebuffer&&this.renderer.glTextureUnits.unbindTexture(this.texture),this.renderer.glWrapper.update(this.state)},clear:function(t){this.beginDraw(),void 0===t&&(t=this.autoClear),this.renderer.renderNodes.finishBatch(),this.renderer.gl.clear(t)},destroy:function(){this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.state.bindings.framebuffer),this.renderer=null,this.camera=null,this.state=null,this.framebuffer=null,this.texture=null}});t.exports=s},65656(t,e,i){var r=i(83419),s=i(87774),n=new r({initialize:function(t,e,i){this.renderer=t,this.maxAge=e,this.maxPoolSize=i,this.agePool=[],this.sizePool={}},add:function(t){if(-1===this.agePool.indexOf(t)){var e=t.width+"x"+t.height;this.sizePool[e]?this.sizePool[e].push(t):this.sizePool[e]=[t],this.agePool.push(t)}},get:function(t,e){var i,r,n=this.renderer;void 0===t&&(t=n.width),void 0===e&&(e=n.height);var a=n.getMaxTextureSize();t>a&&(t=a),e>a&&(e=a);var o=t+"x"+e,h=this.sizePool[o];if(h&&h.length>0)return i=h.pop(),r=this.agePool.indexOf(i),this.agePool.splice(r,1),i;if(this.agePool.length>0){var l=Date.now(),u=this.maxAge;if(l-(i=this.agePool[0]).lastUsed>u){this.agePool.shift();var d=i.width+"x"+i.height;return r=(h=this.sizePool[d]).indexOf(i),h.splice(r,1),i.resize(t,e),i}}return this.agePool.length<this.maxPoolSize?i=new s(n,{autoClear:!0,pool:this,width:t,height:e}):(i=this.agePool.shift())?(r=(h=this.sizePool[o]).indexOf(i),h.splice(r,1),i.resize(t,e),i):i=new s(n,{autoClear:!0,pool:this,width:t,height:e})},setMaxAge:function(t){this.maxAge=t},setMaxPoolSize:function(t){this.maxPoolSize=t},clear:function(){for(var t=0;t<this.agePool.length;t++)this.agePool[t].destroy();this.sizePool={},this.agePool.length=0},prune:function(){var t=this.sizePool,e=this.agePool,i=e.length-this.maxPoolSize;if(i>0)for(var r=e.splice(0,i),s=0;s<i;s++){var n=r[s],a=t[n.width+"x"+n.height],o=a.indexOf(n);a.splice(o,1),n.destroy()}}});t.exports=n},56436(t,e,i){var r=i(83419),s=i(62644),n=new r({initialize:function(t,e,i){this.renderer=t,this.indexBuffer=i,this.attributeBufferLayouts=e,this.currentProgramKey=null,this.currentConfig={base:{vertexShader:"",fragmentShader:""},additions:[],features:[]},this.programs={},this.uniforms={}},getCurrentProgramSuite:function(){var t=this.currentConfig,e=this.renderer,i=e.shaderProgramFactory,r=i.getKey(t.base,t.additions,t.features);if(!this.programs[r]){var n=i.getShaderProgram(t.base,t.additions,t.features);n.compiling&&n.checkParallelCompile(),n.compiling||(this.programs[r]={program:n,vao:e.createVAO(n,this.indexBuffer,this.attributeBufferLayouts),config:s(t)})}return this.programs[r]||null},resetCurrentConfig:function(){this.currentConfig.base.vertexShader="",this.currentConfig.base.fragmentShader="",this.currentConfig.additions.length=0,this.currentConfig.features.length=0},setUniform:function(t,e){this.uniforms[t]=e},removeUniform:function(t){delete this.uniforms[t]},clearUniforms:function(){this.uniforms={}},applyUniforms:function(t){var e=this.uniforms;for(var i in e)t.setUniform(i,e[i])},setBaseShader:function(t,e,i){var r=this.currentConfig.base;r.name=t,r.vertexShader=e,r.fragmentShader=i},addAddition:function(t,e){void 0===e?this.currentConfig.additions.push(t):this.currentConfig.additions.splice(e,0,t)},getAddition:function(t){for(var e=this.currentConfig.additions,i=0;i<e.length;i++){var r=e[i];if(r.name===t)return r}return null},getAdditionsByTag:function(t){return this.currentConfig.additions.filter(function(e){return!!e.tags&&e.tags.includes(t)})},getAdditionIndex:function(t){return this.currentConfig.additions.findIndex(function(e){return e.name===t})},removeAddition:function(t){this.currentConfig.additions=this.currentConfig.additions.filter(function(e){return e.name!==t})},replaceAddition:function(t,e){var i=this.currentConfig.additions.findIndex(function(e){return e.name===t});-1!==i&&(this.currentConfig.additions[i]=e)},addFeature:function(t){-1===this.currentConfig.features.indexOf(t)&&this.currentConfig.features.push(t)},removeFeature:function(t){this.currentConfig.features=this.currentConfig.features.filter(function(e){return e!==t})},clearFeatures:function(){this.currentConfig.features.length=0}});t.exports=n},18804(t,e,i){var r=new(i(83419))({initialize:function(t){this.renderer=t,this.programs={}},has:function(t){return void 0!==this.programs[t]},getShaderProgram:function(t,e,i){var r=this.getKey(t,e,i),s=this.programs[r];return s||(s=this.createShaderProgram(r,t,e,i)),s},getKey:function(t,e,i){var r=t.name;if(e&&e.length>0){r+="_";for(var s=0;s<e.length;s++){var n=e[s];n.disable||(r+="_"+n.name)}}return i&&i.length>0&&(r+="__",r+=i.sort().join("_")),r},createShaderProgram:function(t,e,i,r){var s=e.vertexShader,n=e.fragmentShader;if(s=s.replace(/\r/g,""),n=n.replace(/\r/g,""),i){for(var a,o,h={},l=0;l<i.length;l++){var u=i[l];if(!u.disable)for(a in u.additions)o=(o=u.additions[a]).replace(/\r/g,""),h[a]||(h[a]=""),h[a]+=o+"\n"}for(a in h){var d="#pragma phaserTemplate("+a+")\n";o=h[a],s=s.replace(d,o),n=n.replace(d,o)}}if(r){var c="",f=/[^a-zA-Z0-9]/g;for(l=0;l<r.length;l++){c+="#define FEATURE_"+r[l].toUpperCase().replace(f,"_")+"\n"}s=s.replace("#pragma phaserTemplate(features)",c),n=n.replace("#pragma phaserTemplate(features)",c)}s=s.replace("#pragma phaserTemplate(shaderName)","#define SHADER_NAME "+t+"__VERTEX"),n=n.replace("#pragma phaserTemplate(shaderName)","#define SHADER_NAME "+t+"__FRAGMENT");var p=/\s*#pragma phaserTemplate\(.*/g;s=s.replace(p,""),n=n.replace(p,"");var g=this.renderer.createProgram(s,n);return this.programs[t]=g,g}});t.exports=r},70554(t,e,i){var r=i(61340);t.exports={getTintFromFloats:function(t,e,i,r){return((255*r&255)<<24|(255*t&255)<<16|(255*e&255)<<8|255*i&255)>>>0},getTintAppendFloatAlpha:function(t,e){return((255*e&255)<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255*e&255)<<24|(255&t)<<16|(t>>8&255)<<8|t>>16&255)>>>0},getFloatsFromUintRGB:function(t){return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},updateLightingUniforms:function(t,e,i,s,n,a,o,h){var l=e.camera,u=l.scene.sys.lights;if(u&&u.active){var d=u.getLights(l),c=d.length,f=u.ambientColor,p=e.height;if(t){i.setUniform("uNormSampler",s),i.setUniform("uCamera",[l.x,l.y,l.rotation,l.zoom]),i.setUniform("uAmbientLightColor",[f.r,f.g,f.b]),i.setUniform("uLightCount",c);for(var g=new r,m=0;m<c;m++){var v=d[m].light,y=v.color,x="uLights["+m+"].";g.copyWithScrollFactorFrom(l.matrixCombined,l.scrollX,l.scrollY,v.scrollFactorX,v.scrollFactorY),g.transformPoint(v.x,v.y,n),i.setUniform(x+"position",[n.x,p-n.y,v.z*l.zoom]),i.setUniform(x+"color",[y.r,y.g,y.b]),i.setUniform(x+"intensity",v.intensity),i.setUniform(x+"radius",v.radius)}a&&(i.setUniform("uDiffuseFlatThreshold",3*h),i.setUniform("uPenumbra",o))}else for(i.removeUniform("uNormSampler"),i.removeUniform("uCamera"),i.removeUniform("uAmbientLightColor"),i.removeUniform("uLightCount"),i.removeUniform("uPenumbra"),i.removeUniform("uDiffuseFlatThreshold"),m=0;m<c;m++)x="uLights["+m+"].",i.removeUniform(x+"position"),i.removeUniform(x+"color"),i.removeUniform(x+"intensity"),i.removeUniform(x+"radius")}}}},74797(t,e,i){var r=i(95428),s=i(72905),n=i(83419),a=i(8054),o=i(50792),h=i(92503),l=i(50030),u=i(37867),d=i(29747),c=i(87774),f=i(97480),p=i(69442),g=i(70554),m=i(88815),v=i(26128),y=i(37959),x=i(1482),T=i(86272),w=i(82751),b=i(13760),S=i(84387),C=i(85788),E=i(47774),A=i(53314),_=i(30130),M=i(65656),R=i(18804),P=!1,O=new n({Extends:o,initialize:function(t){o.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!0,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,pathDetailThreshold:e.pathDetailThreshold,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter,mipmapRegeneration:e.mipmapRegeneration},this.game=t,this.type=a.WEBGL,this.renderNodes=null,this.cameraRenderNode=null,this.shaderProgramFactory=new R(this),this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0,unpremultiplyAlpha:!0},this.maxTextures=0,this.textureUnitIndices=[],this.glBufferWrappers=[],this.glProgramWrappers=[],this.glTextureWrappers=[],this.glFramebufferWrappers=[],this.glVAOWrappers=[],this.genericQuadIndexBuffer=null,this.baseDrawingContext=null,this.currentViewCamera=null,this.drawingContextPool=new M(this,1e3,1024),this.contextLostHandler=d,this.contextRestoredHandler=d,this.previousContextLostHandler=d,this.previousContextRestoredHandler=d,this.gl=null,this.glWrapper=null,this.glTextureUnits=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.parallelShaderCompileExtension=null,this.standardDerivativesExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.normalTexture=null,this.whiteTexture=null,this.shaderSetters=null,this.mipmapFilter=null,this.isBooted=!1,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.projectionFlipY=!1,this.spector=null,this._debugCapture=!1,this.init(this.config)},init:function(t){var e,i=this.game,r=this.canvas,s=t.backgroundColor;if(!(e=i.config.context?i.config.context:r.getContext("webgl",t.contextCreation)||r.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e,this.setExtensions(),this.setContextHandlers(),i.context=e;for(var n=0;n<=27;n++)this.blendModes.push(E.createCombined(this));this.blendModes[1].func=[e.ONE,e.DST_ALPHA,e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17].equation=[e.FUNC_REVERSE_SUBTRACT,e.FUNC_REVERSE_SUBTRACT],this.blendModes[17].func=[e.ZERO,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE_MINUS_SRC_ALPHA],this.glFormats=[e.BYTE,e.SHORT,e.UNSIGNED_BYTE,e.UNSIGNED_SHORT,e.FLOAT],this.shaderSetters=new T(this),t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.glWrapper=new y(this),this.glWrapper.update(void 0,!0),e.clearColor(s.redGL,s.greenGL,s.blueGL,s.alphaGL),e.clear(e.COLOR_BUFFER_BIT);for(-1!==["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"].indexOf(t.mipmapFilter)&&(this.mipmapFilter=e[t.mipmapFilter]),this.maxTextures=g.checkShaderMax(e,t.maxTextures),n=0;n<this.maxTextures;n++)this.textureUnitIndices.push(n);return this.glTextureUnits=new b(this),this.projectionMatrix=(new u).identity(),i.textures.once(p.READY,this.boot,this),this},boot:function(){var t=this.game,e=this.gl,i=t.scale.baseSize,r=i.width,s=i.height;this.width=r,this.height=s,this.isBooted=!0,this.glWrapper.updateVAO({vao:null}),this.genericQuadIndexBuffer=this.createIndexBuffer(new Uint16Array([0,1,2,3]),e.STATIC_DRAW),this.renderNodes=new _(this),this.cameraRenderNode=this.renderNodes.getNode("Camera"),this.blankTexture=t.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=t.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=t.textures.getFrame("__WHITE").glTexture,this.baseDrawingContext=new c(this,{autoClear:!0,useCanvas:!0,clearColor:[this.config.backgroundColor.redGL,this.config.backgroundColor.greenGL,this.config.backgroundColor.blueGL,this.config.backgroundColor.alphaGL]}),this.on(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),t.scale.on(f.RESIZE,this.onResize,this),this.resize(r,s)},setExtensions:function(){var t=this.gl,e=this.game,i=t.getSupportedExtensions();this.supportedExtensions=i;var r="ANGLE_instanced_arrays";if(this.instancedArraysExtension=i.indexOf(r)>-1?t.getExtension(r):null,e.config.skipUnreadyShaders){var s="KHR_parallel_shader_compile";this.parallelShaderCompileExtension=i.indexOf(s)>-1?t.getExtension(s):null,this.parallelShaderCompileExtension||(e.config.skipUnreadyShaders=!1)}var n="OES_vertex_array_object";this.vaoExtension=i.indexOf(n)>-1?t.getExtension(n):null;var a="OES_standard_derivatives";if(this.standardDerivativesExtension=i.indexOf(a)>-1?t.getExtension(a):null,t instanceof WebGLRenderingContext){if(!this.instancedArraysExtension)throw new Error("ANGLE_instanced_arrays extension not supported. Required for rendering.");if(t.vertexAttribDivisor=this.instancedArraysExtension.vertexAttribDivisorANGLE.bind(this.instancedArraysExtension),t.drawArraysInstanced=this.instancedArraysExtension.drawArraysInstancedANGLE.bind(this.instancedArraysExtension),t.drawElementsInstanced=this.instancedArraysExtension.drawElementsInstancedANGLE.bind(this.instancedArraysExtension),!this.vaoExtension)throw new Error("OES_vertex_array_object extension not supported. Required for rendering.");if(t.createVertexArray=this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension),t.bindVertexArray=this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension),t.deleteVertexArray=this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension),t.isVertexArray=this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension),this.standardDerivativesExtension)t.FRAGMENT_SHADER_DERIVATIVE_HINT=this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;else if(e.config.smoothPixelArt)throw new Error("OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.")}},setContextHandlers:function(t,e){this.previousContextLostHandler&&this.canvas.removeEventListener("webglcontextlost",this.previousContextLostHandler,!1),this.previousContextRestoredHandler&&this.canvas.removeEventListener("webglcontextrestored",this.previousContextRestoredHandler,!1),this.contextLostHandler="function"==typeof t?t.bind(this):this.dispatchContextLost.bind(this),this.contextRestoredHandler="function"==typeof e?e.bind(this):this.dispatchContextRestored.bind(this),this.canvas.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.previousContextLostHandler=this.contextLostHandler,this.previousContextRestoredHandler=this.contextRestoredHandler},dispatchContextLost:function(t){this.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),this.emit(h.LOSE_WEBGL,this),t.preventDefault()},dispatchContextRestored:function(t){if(this.gl.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{this.setExtensions(),this.glWrapper.update(A.getDefault(this),!0),this.glTextureUnits.init(),this.compression=this.getCompressedTextures();var e=function(t){t.createResource()};r(this.glTextureWrappers,e),r(this.glBufferWrappers,e),r(this.glFramebufferWrappers,e),r(this.glProgramWrappers,e),r(this.glVAOWrappers,e),this.glTextureUnits.bindUnits(this.glTextureUnits.units,!0),this.resize(this.game.scale.baseSize.width,this.game.scale.baseSize.height),this.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),this.emit(h.RESTORE_WEBGL,this),t.preventDefault()}},captureFrame:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1)},captureNextFrame:function(){P},getFps:function(){P},log:function(){},startCapture:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!1),void 0===i&&(i=!1)},stopCapture:function(){P},onCapture:function(t){},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),this.drawingBufferHeight=i.drawingBufferHeight,this.glWrapper.update({scissor:{box:[0,i.drawingBufferHeight-e,t,e]},viewport:[0,0,t,e]}),this.emit(h.RESIZE,t,e),this},getCompressedTextures:function(){var t="WEBGL_compressed_texture_",e="WEBKIT_"+t,i=function(i,r){var s=i.getExtension(t+r)||i.getExtension(e+r)||i.getExtension("EXT_texture_compression_"+r);if(s){var n={};for(var a in s)n[s[a]]=a;return n}},r=this.gl;return{ETC:i(r,"etc"),ETC1:i(r,"etc1"),ATC:i(r,"atc"),ASTC:i(r,"astc"),BPTC:i(r,"bptc"),RGTC:i(r,"rgtc"),PVRTC:i(r,"pvrtc"),S3TC:i(r,"s3tc"),S3TCSRGB:i(r,"s3tc_srgb"),IMG:!0}},getCompressedTextureName:function(t,e){var i=this.compression[t.toUpperCase()];if(e in i)return i[e]},supportsCompressedTexture:function(t,e){var i=this.compression[t.toUpperCase()];return!!i&&(!e||e in i)},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e,i){return t===this.projectionWidth&&e===this.projectionHeight&&i===this.projectionFlipY||(this.projectionWidth=t,this.projectionHeight=e,this.projectionFlipY=!!i,i?this.projectionMatrix.ortho(0,t,0,e,-1e3,1e3):this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},setProjectionMatrixFromDrawingContext:function(t){return this.setProjectionMatrix(t.width,t.height,!1)},resetProjectionMatrix:function(){return this.setProjectionMatrix(this.width,this.height)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},addBlendMode:function(t,e){return this.blendModes.push(E.createCombined(this,!0,void 0,e,t[0],t[1]))-1-1},updateBlendMode:function(t,e,i){if(t>17&&this.blendModes[t]){var r=this.blendModes[t];2===e.length?r.func=[e[0],e[1],e[0],e[1]]:r.func=[e[0],e[1],e[2],e[3]],r.equation="number"==typeof i?[i,i]:[i[0],i[1]]}return this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},clearFramebuffer:function(t,e,i){var r=this.gl,s=0;t&&(this.glWrapper.updateColorClearValue({colorClearValue:t}),s|=r.COLOR_BUFFER_BIT),void 0!==e&&(this.glWrapper.updateStencilClear({stencil:{clear:e}}),s|=r.STENCIL_BUFFER_BIT),void 0!==i&&(s|=r.DEPTH_BUFFER_BIT),r.clear(s)},createTextureFromSource:function(t,e,i,r,s,n){void 0===s&&(s=!1);var o=this.gl,h=o.NEAREST,u=o.NEAREST,d=o.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);if(c&&!s&&(d=o.REPEAT),r===a.ScaleModes.LINEAR&&this.config.antialias){var f=t&&t.compressed,p=!f&&c||f&&t.mipmaps.length>1;h=this.mipmapFilter&&p?this.mipmapFilter:o.LINEAR,u=o.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,h,u,d,d,o.RGBA,t,void 0,void 0,void 0,void 0,n):this.createTexture2D(0,h,u,d,d,o.RGBA,null,e,i,void 0,void 0,n)},createTexture2D:function(t,e,i,r,s,n,a,o,h,l,u,d){"number"!=typeof o&&(o=a?a.width:1),"number"!=typeof h&&(h=a?a.height:1);var c=new w(this,t,e,i,r,s,n,a,o,h,l,u,d);return this.glTextureWrappers.push(c),c},createFramebuffer:function(t,e,i){Array.isArray(t)||null===t||(t=[t]);var r=new S(this,t,e,i);return this.glFramebufferWrappers.push(r),r},createProgram:function(t,e){var i=new x(this,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createIndexBuffer:function(t,e){var i=this.gl,r=new v(this,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(r),r},createVAO:function(t,e,i){var r=new C(this,t,e,i);return this.glVAOWrappers.push(r),r},deleteTexture:function(t){if(t)return s(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(s(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(s(this.glProgramWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(s(this.glBufferWrappers,t),t.destroy(),this):this},preRender:function(){if(!this.contextLost){this.emit(h.PRE_RENDER_CLEAR);var t=this.baseDrawingContext;if(this.config.clearBeforeRender){var e=this.config.backgroundColor;t.setClearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.setAutoClear(!0,!0,!0)}else t.setAutoClear(!1,!1,!1);t.use(),this.emit(h.PRE_RENDER)}},render:function(t,e,i){this.contextLost||(this.emit(h.RENDER,t,i),this.currentViewCamera=i,this.cameraRenderNode.run(this.baseDrawingContext,e,i),this.currentViewCamera=null)},postRender:function(){if(this.baseDrawingContext.release(),!this.contextLost){this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(m(this.gl,t),t.callback=null)}},drawElements:function(t,e,i,r,s,n,a){var o=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),o.drawElements(a||o.TRIANGLE_STRIP,s,o.UNSIGNED_SHORT,n)},drawInstancedArrays:function(t,e,i,r,s,n,a,o){var h=this.gl;t.beginDraw(),i.bind(),r.bind(),this.glTextureUnits.bindUnits(e),h.drawArraysInstanced(o||h.TRIANGLE_STRIP,s,n,a)},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,r,s,n,a){var o=this.snapshotState;return o.callback=s,o.type=n,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=i,o.height=r,o.unpremultiplyAlpha=this.game.config.premultipliedAlpha,this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,r,s,n,a,o,h,l,u){void 0===s&&(s=!1),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i),"pixel"===l&&(s=!0,l="image/png"),this.snapshotArea(n,a,o,h,r,l,u);var d=this.snapshotState;return d.getPixel=s,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,d.width=Math.min(d.width,e),d.height=Math.min(d.height,i),this.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:t}}),m(this.gl,d),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.width,h=t.height,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!1,r)},createCanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.canvasToTexture(t,e,r,i)},videoToTexture:function(t,e,i,r){void 0===i&&(i=!1),void 0===r&&(r=!0);var s=this.gl,n=s.NEAREST,a=s.NEAREST,o=t.videoWidth,h=t.videoHeight,u=s.CLAMP_TO_EDGE,d=l(o,h);return!i&&d&&(u=s.REPEAT),this.config.antialias&&(n=d&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,a=s.LINEAR),e?(e.update(t,o,h,r,u,u,n,a,e.format),e):this.createTexture2D(0,n,a,u,u,s.RGBA,t,o,h,!0,!0,r)},createVideoTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!0),this.videoToTexture(t,null,e,i)},updateVideoTexture:function(t,e,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),this.videoToTexture(t,e,r,i)},createUint8ArrayTexture:function(t,e,i,r,s){var n=this.gl,a=n.NEAREST,o=n.NEAREST,h=n.CLAMP_TO_EDGE;return l(e,i)&&(h=n.REPEAT),void 0===r&&(r=!0),void 0===s&&(s=!0),this.createTexture2D(0,a,o,h,h,n.RGBA,t,e,i,r,!1,s)},setTextureFilter:function(t,e){var i=this.gl,r=0===e?i.LINEAR:i.NEAREST,s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,t.wrapS,t.wrapT,r,r,t.format),n&&s.bind(n,0),this},setTextureWrap:function(t,e,i){var r=this.gl;if(!l(t.width,t.height)&&(e!==r.CLAMP_TO_EDGE||i!==r.CLAMP_TO_EDGE))return this;var s=this.glTextureUnits,n=s.units[0];return s.bind(t,0),t.update(t.pixels,t.width,t.height,t.flipY,e,i,t.minFilter,t.magFilter,t.format),n&&s.bind(n,0),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.off(h.RESIZE,this.baseDrawingContext.resize,this.baseDrawingContext),this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);var t=function(t){t.destroy()};r(this.glBufferWrappers,t),r(this.glFramebufferWrappers,t),r(this.glProgramWrappers,t),r(this.glTextureWrappers,t),this.removeAllListeners(),this.extensions={},this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0}});t.exports=O},14500(t){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159(t,e,i){var r=i(14500),s=i(79291),n={Shaders:i(89350),ShaderAdditionMakers:i(83786),DrawingContext:i(87774),DrawingContextPool:i(65656),ProgramManager:i(56436),RenderNodes:i(54521),ShaderProgramFactory:i(18804),Utils:i(70554),WebGLRenderer:i(74797),Wrappers:i(31884)};n=s(!1,n,r),t.exports=n},47774(t){var e={createCombined:function(t,e,i,r,s,n){var a=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=a.FUNC_ADD),void 0===s&&(s=a.ONE),void 0===n&&(n=a.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,r],func:[s,n,s,n]}},createSeparate:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!0),void 0===i&&(i=[0,0,0,0]),void 0===r&&(r=l.FUNC_ADD),void 0===s&&(s=l.FUNC_ADD),void 0===n&&(n=l.ONE),void 0===a&&(a=l.ONE_MINUS_SRC_ALPHA),void 0===o&&(o=l.ONE),void 0===h&&(h=l.ONE_MINUS_SRC_ALPHA),{enabled:e,color:i,equation:[r,s],func:[n,a,o,h]}}};t.exports=e},53314(t,e,i){var r=i(8054),s=i(62644),n=i(71623),a={getDefault:function(t){return{bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},blend:s(t.blendModes[r.BlendModes.NORMAL]),colorClearValue:[0,0,0,1],colorWritemask:[!0,!0,!0,!0],cullFace:!1,depthTest:!1,scissor:{enable:!0,box:[0,0,0,0]},stencil:n.create(t),texturing:{flipY:!1,premultiplyAlpha:!1},vao:null,viewport:[0,0,0,0]}}};t.exports=a},71623(t){var e={create:function(t,e,i,r,s,n,a,o,h){var l=t.gl;return void 0===e&&(e=!1),void 0===i&&(i=l.ALWAYS),void 0===r&&(r=0),void 0===s&&(s=255),void 0===n&&(n=l.KEEP),void 0===a&&(a=l.KEEP),void 0===o&&(o=l.KEEP),void 0===h&&(h=0),{enabled:e,func:{func:i,ref:r,mask:s},op:{fail:n,zfail:a,zpass:o},clear:h}}};t.exports=e},13961(t,e,i){var r=i(83419),s=i(56436),n=i(40952),a=i(6141),o=i(36909),h=new r({Extends:a,initialize:function(t,e,i){var r=t.renderer,h=r.gl,l=(i=this._copyAndCompleteConfig(t,i||{},e)).name;if(!l)throw new Error("BatchHandler must have a name");a.call(this,l,t),this.instancesPerBatch=-1,this.verticesPerInstance=i.verticesPerInstance;var u=Math.floor(65536/this.verticesPerInstance),d=i.instancesPerBatch||r.config.batchSize||u;this.instancesPerBatch=Math.min(d,u),this.indicesPerInstance=i.indicesPerInstance,this.bytesPerIndexPerInstance=this.indicesPerInstance*Uint16Array.BYTES_PER_ELEMENT,this.maxTexturesPerBatch=1,this.manager.on(o.Events.SET_PARALLEL_TEXTURE_UNITS,this.updateTextureCount,this),r.glWrapper.updateVAO({vao:null}),this.indexBuffer=r.createIndexBuffer(this._generateElementIndices(this.instancesPerBatch),i.indexBufferDynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var c=i.vertexBufferLayout;if(c.count=this.instancesPerBatch*this.verticesPerInstance,this.vertexBufferLayout=new n(r,c,null),this.programManager=new s(r,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(i.shaderName,i.vertexSource,i.fragmentSource),i.shaderAdditions)for(var f=0;f<i.shaderAdditions.length;f++){var p=i.shaderAdditions[f];this.programManager.addAddition(p)}if(i.shaderFeatures)for(f=0;f<i.shaderFeatures.length;f++)this.programManager.addFeature(i.shaderFeatures[f]);this.bytesPerInstance=this.vertexBufferLayout.layout.stride*this.verticesPerInstance,this.floatsPerInstance=this.bytesPerInstance/Float32Array.BYTES_PER_ELEMENT,this.currentBatchEntry={start:0,count:0,unit:0,texture:[]},this.batchEntries=[],this.instanceCount=0,this.updateTextureCount(t.maxParallelTextureUnits),this.resize(r.width,r.height),r.on(o.Events.RESIZE,this.resize,this)},_copyAndCompleteConfig:function(t,e,i){var r={};r.name=e.name||i.name,r.verticesPerInstance=e.verticesPerInstance||i.verticesPerInstance,r.indicesPerInstance=e.indicesPerInstance||i.indicesPerInstance,r.shaderName=e.shaderName||i.shaderName,r.vertexSource=e.vertexSource||i.vertexSource,r.fragmentSource=e.fragmentSource||i.fragmentSource,r.shaderAdditions=e.shaderAdditions||i.shaderAdditions,Array.isArray(r.shaderAdditions)&&(r.shaderAdditions=r.shaderAdditions.map(function(t){return Object.assign({},t)})),r.shaderFeatures=e.shaderFeatures||i.shaderFeatures,r.indexBufferDynamic=e.indexBufferDynamic||i.indexBufferDynamic,r.instancesPerBatch=e.instancesPerBatch,r.maxTexturesPerBatch=e.maxTexturesPerBatch;var s=e.vertexBufferLayout||i.vertexBufferLayout;r.vertexBufferLayout={},r.vertexBufferLayout.usage=s.usage,r.vertexBufferLayout.layout=[];for(var n=e.vertexBufferLayoutRemove||[],a=0;a<s.layout.length;a++){var o=s.layout[a];-1===n.indexOf(o.name)&&(r.vertexBufferLayout.layout[a]={name:o.name,size:o.size||1,type:o.type||"FLOAT",normalized:o.normalized||!1})}if(e.vertexBufferLayoutAdd){var h=e.vertexBufferLayoutAdd||[];for(a=0;a<h.length;a++){var l=h[a];r.vertexBufferLayout.layout.push({name:l.name,size:l.size||1,type:l.type||"FLOAT",normalized:l.normalized||!1})}}return r},_generateElementIndices:function(t){return new ArrayBuffer(t*this.bytesPerInstance)},resize:function(t,e){},updateTextureCount:function(t){},run:function(t){},batch:function(){}});t.exports=h},16971(t,e,i){var r=i(83419),s=i(4127),n=i(89924),a=i(13961),o=new r({Extends:a,initialize:function(t,e){a.call(this,t,this.defaultConfig,e),this._emptyTextures=[]},defaultConfig:{name:"BatchHandlerPointLight",verticesPerInstance:4,indicesPerInstance:6,shaderName:"POINTLIGHT",vertexSource:n,fragmentSource:s,vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius",size:1},{name:"inLightAttenuation",size:1},{name:"inLightColor",size:4}]}},_generateElementIndices:function(t){for(var e=new ArrayBuffer(6*t*2),i=new Uint16Array(e),r=0,s=0;s<t;s++){var n=4*s;i[r++]=n,i[r++]=n,i[r++]=n+1,i[r++]=n+2,i[r++]=n+3,i[r++]=n+3}return e},setupUniforms:function(t){var e=this.programManager,i=t.width,r=t.height;e.setUniform("uCameraZoom",t.camera.zoom),e.setUniform("uResolution",[i,r]),t.renderer.setProjectionMatrixFromDrawingContext(t),e.setUniform("uProjectionMatrix",t.renderer.projectionMatrix.val)},run:function(t){var e=this.instanceCount;if(0!==e){this.onRunBegin(t);var i=this.programManager,r=i.getCurrentProgramSuite();if(r){var s=r.program,n=r.vao;this.setupUniforms(t),i.applyUniforms(s),this.vertexBufferLayout.buffer.update(this.instanceCount*this.bytesPerInstance),this.manager.renderer.drawElements(t,this._emptyTextures,s,n,e*this.indicesPerInstance,0)}this.instanceCount=0,this.onRunEnd(t)}},batch:function(t,e,i,r,s,n,a,o,h,l,u,d){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,t);var c=e.color,f=e.intensity,p=e.radius,g=e.attenuation,m=c.r*f,v=c.g*f,y=c.b*f,x=e.alpha,T=this.instanceCount*this.floatsPerInstance,w=this.vertexBufferLayout.buffer.viewF32;w[T++]=s,w[T++]=n,w[T++]=u,w[T++]=d,w[T++]=p,w[T++]=g,w[T++]=m,w[T++]=v,w[T++]=y,w[T++]=x,w[T++]=i,w[T++]=r,w[T++]=u,w[T++]=d,w[T++]=p,w[T++]=g,w[T++]=m,w[T++]=v,w[T++]=y,w[T++]=x,w[T++]=h,w[T++]=l,w[T++]=u,w[T++]=d,w[T++]=p,w[T++]=g,w[T++]=m,w[T++]=v,w[T++]=y,w[T++]=x,w[T++]=a,w[T++]=o,w[T++]=u,w[T++]=d,w[T++]=p,w[T++]=g,w[T++]=m,w[T++]=v,w[T++]=y,w[T++]=x,this.instanceCount++,this.instanceCount===this.instancesPerBatch&&this.run(t)}});t.exports=o},15214(t,e,i){var r=i(26099),s=i(83419),n=i(62644),a=i(70554),o=i(98840),h=i(44667),l=i(81084),u=i(44349),d=i(6184),c=i(11653),f=i(40829),p=i(42792),g=i(96049),m=i(33997),v=i(79532),y=i(65217),x=i(74505),T=i(13961),w=new s({Extends:T,initialize:function(t,e){this.renderOptions={multiTexturing:!1,texRes:!1,lighting:!1,selfShadow:!1,selfShadowPenumbra:0,selfShadowThreshold:0,smoothPixelArt:!1},T.call(this,t,this.defaultConfig,e),this.programManager.setUniform("uMainSampler[0]",this.manager.renderer.textureUnitIndices),this.nextRenderOptions=n(this.renderOptions),this._renderOptionsChanged=!1,this._lightVector=new r},defaultConfig:{name:"BatchHandlerQuad",verticesPerInstance:4,indicesPerInstance:6,shaderName:"STANDARD",vertexSource:h,fragmentSource:o,shaderAdditions:[p(),g(!0),x(!0),c(1),m(),u(),d(!0),y(!0),v(!0),f(!0),l(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexDatum"},{name:"inTintEffect"},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},_generateElementIndices:function(t){for(var e=new ArrayBuffer(6*t*2),i=new Uint16Array(e),r=0,s=0;s<t;s++){var n=4*s;i[r++]=n,i[r++]=n,i[r++]=n+1,i[r++]=n+2,i[r++]=n+3,i[r++]=n+3}return e},updateTextureCount:function(t){var e=this.manager.renderer;void 0===t&&(t=e.maxTextures);var i=Math.max(1,Math.min(t,e.maxTextures));if(i!==this.maxTexturesPerBatch){if(i<this.currentBatchEntry.unit&&this.manager.currentBatchNode===this&&this.manager.finishBatch(),this.maxTexturesPerBatch=i,this.renderOptions.multiTexturing){var r=this.programManager,s=r.getAdditionsByTag("TEXTURE")[0];s&&r.replaceAddition(s.name,m(this.maxTexturesPerBatch))}this.resize(e.width,e.height)}},setupUniforms:function(t){var e=this.programManager,i=this.renderOptions;e.setUniform("uResolution",[t.width,t.height]),t.renderer.setProjectionMatrixFromDrawingContext(t),e.setUniform("uProjectionMatrix",t.renderer.projectionMatrix.val),this.renderOptions.lighting&&a.updateLightingUniforms(i.lighting,t,e,1,this._lightVector,i.selfShadow,i.selfShadowThreshold,i.selfShadowPenumbra)},setupTextureUniforms:function(t){var e=this.programManager;if(this.renderOptions.multiTexturing){for(var i=[],r=0;r<t.length;r++)i.push(t[r].width,t[r].height);e.setUniform("uMainResolution[0]",i)}else e.setUniform("uMainResolution[0]",[t[0].width,t[0].height])},finalizeTextureCount:function(t){var e=this.programManager;this.renderOptions.lighting&&(t=1);var i=e.getAdditionsByTag("TEXTURE")[0];i&&e.replaceAddition(i.name,m(t));var r=e.getAdditionsByTag("TexCount")[0];r&&e.replaceAddition(r.name,c(t))},updateRenderOptions:function(t){var e=this.nextRenderOptions,i=this.renderOptions,r=!1,s=!!t.multiTexturing&&!t.lighting;s!==i.multiTexturing&&(e.multiTexturing=s,r=!0);var n=!!t.lighting;n!==i.lighting&&(e.lighting=n,r=!0);var a=n&&t.lighting.selfShadow&&t.lighting.selfShadow.enabled;a!==i.selfShadow&&(e.selfShadow=a,r=!0);var o=a?t.lighting.selfShadow.penumbra:0;o!==i.selfShadowPenumbra&&(e.selfShadowPenumbra=o,r=!0);var h=a?t.lighting.selfShadow.diffuseFlatThreshold:0;h!==i.selfShadowThreshold&&(e.selfShadowThreshold=h,r=!0);var l=!!t.smoothPixelArt;l!==i.smoothPixelArt&&(e.smoothPixelArt=l,e.texRes=l,r=!0),this._renderOptionsChanged=r},updateShaderConfig:function(){var t,e=this.programManager,i=this.renderOptions,r=this.nextRenderOptions;if(i.multiTexturing!==r.multiTexturing){var s=r.multiTexturing;i.multiTexturing=s;var n=e.getAdditionsByTag("TexCount")[0];n&&e.replaceAddition(n.name,c(s?this.maxTexturesPerBatch:1));var a=e.getAdditionsByTag("TEXTURE")[0];a&&e.replaceAddition(a.name,m(s?this.maxTexturesPerBatch:1))}if(i.lighting!==r.lighting){var o=r.lighting;i.lighting=o;var h=e.getAdditionsByTag("LIGHTING");for(t=0;t<h.length;t++){h[t].disable=!o}if(o){var l=e.getAddition("DefineLights");l&&(l.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}}if(i.selfShadow!==r.selfShadow){var u=r.selfShadow;i.selfShadow=u,u?e.addFeature("SELFSHADOW"):e.removeFeature("SELFSHADOW")}if(i.selfShadowPenumbra=r.selfShadowPenumbra,i.selfShadowThreshold=r.selfShadowThreshold,i.smoothPixelArt!==r.smoothPixelArt){var d=r.smoothPixelArt;i.smoothPixelArt=d;var f=e.getAddition("SmoothPixelArt");f&&(f.disable=!d)}if(i.texRes!==r.texRes){var p=r.texRes;i.texRes=p;var g=e.getAddition("GetTexRes");g&&(g.disable=!p)}},run:function(t){if(0!==this.instanceCount){this.onRunBegin(t),this.pushCurrentBatchEntry();var e=this.programManager,i=this.bytesPerIndexPerInstance,r=this.indicesPerInstance,s=this.manager.renderer;this.vertexBufferLayout.buffer.update(this.instanceCount*this.bytesPerInstance);for(var n=this.batchEntries.length,a=0;a<n;a++){var o=this.batchEntries[a];this.finalizeTextureCount(o.unit);var h=e.getCurrentProgramSuite();if(h){var l=h.program,u=h.vao;this.setupUniforms(t),e.applyUniforms(l),this.renderOptions.texRes&&(this.setupTextureUniforms(o.texture),e.applyUniforms(l)),s.drawElements(t,o.texture,l,u,o.count*r,o.start*i)}}this.instanceCount=0,this.currentBatchEntry.start=0,this.batchEntries.length=0,this.onRunEnd(t)}},batch:function(t,e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y,x){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,t),this.updateRenderOptions(x),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var T=this.batchTextures(e,x),w=this.instanceCount*this.floatsPerInstance,b=this.vertexBufferLayout.buffer,S=b.viewF32,C=b.viewU32;S[w++]=s,S[w++]=n,S[w++]=u,S[w++]=d+f,S[w++]=T,S[w++]=p,C[w++]=m,S[w++]=i,S[w++]=r,S[w++]=u,S[w++]=d,S[w++]=T,S[w++]=p,C[w++]=g,S[w++]=h,S[w++]=l,S[w++]=u+c,S[w++]=d+f,S[w++]=T,S[w++]=p,C[w++]=y,S[w++]=a,S[w++]=o,S[w++]=u+c,S[w++]=d,S[w++]=T,S[w++]=p,C[w++]=v,this.instanceCount++,this.currentBatchEntry.count++,this.instanceCount===this.instancesPerBatch&&this.run(t)},batchTextures:function(t,e){var i=this.renderOptions,r=0,s=this.currentBatchEntry;if(i.multiTexturing)-1===(r=t.batchUnit)&&(s.texture.length===this.maxTexturesPerBatch&&(this.pushCurrentBatchEntry(),s=this.currentBatchEntry),r=s.unit,t.batchUnit=r,s.texture[r]=t,s.unit++);else if(i.lighting){r=e.lighting.normalMapRotation;var n=e.lighting.normalGLTexture;s.texture[0]===t&&s.texture[1]===n||(this.pushCurrentBatchEntry(),s=this.currentBatchEntry,t.batchUnit=0,n.batchUnit=1,s.texture[0]=t,s.texture[1]=n,s.unit=2)}else s.texture[0]!==t&&(this.pushCurrentBatchEntry(),s=this.currentBatchEntry,t.batchUnit=0,s.texture[0]=t,s.unit=1);return r},pushCurrentBatchEntry:function(){if(!(this.currentBatchEntry.count<1)){this.batchEntries.push(this.currentBatchEntry);for(var t=this.currentBatchEntry.texture,e=0;e<t.length;e++)t[e].batchUnit=-1;this.currentBatchEntry={start:this.instanceCount,count:0,unit:0,texture:[]}}}});t.exports=w},72266(t,e,i){var r=i(83419),s=i(15214),n=new r({Extends:s,initialize:function(t,e){void 0===e&&(e={}),e.name||(e.name="BatchHandlerQuadSingle"),e.shaderName||(e.shaderName="STANDARD_SINGLE"),e.instancesPerBatch||(e.instancesPerBatch=1),s.call(this,t,e)}});t.exports=n},62791(t,e,i){var r=i(83419),s=i(98840),n=i(44667),a=i(44349),o=i(11653),h=i(42792),l=i(96049),u=i(74505),d=i(33997),c=i(70554),f=i(15214),p=c.getTintAppendFloatAlpha,g=new r({Extends:f,initialize:function(t,e){f.call(this,t,e),this.renderOptions.multiTexturing=!0},defaultConfig:{name:"BatchHandlerStrip",verticesPerInstance:2,indicesPerInstance:2,shaderName:"STRIP",vertexSource:n,fragmentSource:s,shaderAdditions:[h(),l(!0),u(!0),o(1),d(),a()],vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexDatum"},{name:"inTintEffect"},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},_generateElementIndices:function(t){for(var e=new ArrayBuffer(2*t*2),i=new Uint16Array(e),r=i.length,s=0;s<r;s++)i[s]=s;return e},batchStrip:function(t,e,i,r,s,n,a,o,h,l,u,d){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,t);var c=s.length/(2*this.verticesPerInstance);if(c>this.instancesPerBatch)throw new Error("BatchHandlerStrip: Vertex count exceeds maximum per batch ("+this.maxVerticesPerBatch+")");this.instanceCount+c>this.instancesPerBatch&&this.run(t),this.updateRenderOptions(u),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var f,g=this.batchTextures(r),m=this.instanceCount*this.floatsPerInstance,v=this.vertexBufferLayout.buffer,y=v.viewF32,x=v.viewU32,T=!1;if(this.instanceCount>0){var w=1+this.floatsPerInstance/this.verticesPerInstance;y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],y[m++]=y[m-w],x[m++]=x[m-w],T=!0}d&&(f=[]);for(var b=i.a,S=i.b,C=i.c,E=i.d,A=i.e,_=i.f,M=s.length,R=0;R<M;R+=2){var P=s[R],O=s[R+1],L=P*b+O*C+A,F=P*S+O*E+_;y[m++]=L,y[m++]=F,y[m++]=n[R],y[m++]=n[R+1],y[m++]=g,y[m++]=l,x[m++]=p(a[R/2],o[R/2]*h),T?(R-=2,this.instanceCount++,this.currentBatchEntry.count++,T=!1):f&&f.push(L,F),R%4==2&&(this.instanceCount++,this.currentBatchEntry.count++)}d&&d.call(e,e,M,f)}});t.exports=g},21832(t,e,i){var r=i(83419),s=i(98840),n=i(44667),a=i(81084),o=i(44349),h=i(6184),l=i(11653),u=i(40829),d=i(42792),c=i(96049),f=i(33997),p=i(10455),g=i(79532),m=i(65217),v=i(74505),y=i(44832),x=i(23295),T=i(15214),w=new r({Extends:T,initialize:function(t,e){T.call(this,t,e)},defaultConfig:{name:"BatchHandlerTileSprite",verticesPerInstance:4,indicesPerInstance:6,shaderName:"TILESPRITE",vertexSource:n,fragmentSource:s,shaderAdditions:[p(),d(),c(!0),x(!0),y(!0),v(!0),l(1),f(),o(),h(!0),m(!0),g(!0),u(!0),a(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inFrame",size:4},{name:"inTexDatum"},{name:"inTintEffect"},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},updateRenderOptions:function(t){T.prototype.updateRenderOptions.call(this,t);var e=this.renderOptions,i=this.nextRenderOptions,r=this._renderOptionsChanged;i.clampFrame=!!t.clampFrame,i.clampFrame!==e.clampFrame&&(r=!0),i.wrapFrame=!!t.wrapFrame,i.wrapFrame!==e.wrapFrame&&(r=!0),i.texRes=i.clampFrame||i.texRes,i.texRes!==e.texRes&&(r=!0),r&&(this._renderOptionsChanged=!0)},updateShaderConfig:function(){T.prototype.updateShaderConfig.call(this);var t=this.programManager,e=this.renderOptions,i=this.nextRenderOptions;if(i.clampFrame!==e.clampFrame){var r=i.clampFrame;e.clampFrame=r,t.getAddition("TexCoordFrameClamp").disable=!i.clampFrame}if(i.wrapFrame!==e.wrapFrame){var s=i.wrapFrame;e.wrapFrame=s,t.getAddition("TexCoordFrameWrap").disable=!s}},batch:function(t,e,i,r,s,n,a,o,h,l,u,d,c,f,p,g,m,v,y,x,T,w,b,S,C,E,A,_){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,t),this.updateRenderOptions(x),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());var M=this.batchTextures(e,x),R=this.instanceCount*this.floatsPerInstance,P=this.vertexBufferLayout.buffer,O=P.viewF32,L=P.viewU32;O[R++]=s,O[R++]=n,O[R++]=b,O[R++]=S,O[R++]=u,O[R++]=d,O[R++]=c,O[R++]=f,O[R++]=M,O[R++]=p,L[R++]=m,O[R++]=i,O[R++]=r,O[R++]=T,O[R++]=w,O[R++]=u,O[R++]=d,O[R++]=c,O[R++]=f,O[R++]=M,O[R++]=p,L[R++]=g,O[R++]=h,O[R++]=l,O[R++]=A,O[R++]=_,O[R++]=u,O[R++]=d,O[R++]=c,O[R++]=f,O[R++]=M,O[R++]=p,L[R++]=y,O[R++]=a,O[R++]=o,O[R++]=C,O[R++]=E,O[R++]=u,O[R++]=d,O[R++]=c,O[R++]=f,O[R++]=M,O[R++]=p,L[R++]=v,this.instanceCount++,this.currentBatchEntry.count++,this.instanceCount===this.instancesPerBatch&&this.run(t)}});t.exports=w},62087(t,e,i){var r=i(26099),s=i(83419),n=i(81084),a=i(6184),o=i(13198),h=i(73416),l=i(91627),u=i(70554),d=i(13961),c=new s({Extends:d,initialize:function(t,e){d.call(this,t,this.defaultConfig,e),this._emptyTextures=[],this.vertexCount=0,this._lightVector=new r,this.renderOptions={lighting:!1},this.nextRenderOptions={lighting:!1},this._renderOptionsChanged=!1},defaultConfig:{name:"BatchHandlerTriFlat",verticesPerInstance:3,indicesPerInstance:3,shaderName:"FLAT",vertexSource:l,fragmentSource:h,shaderAdditions:[a(!0),o(!0),n(!0)],indexBufferDynamic:!0,vertexBufferLayout:{usage:"DYNAMIC_DRAW",layout:[{name:"inPosition",size:2},{name:"inTint",size:4,type:"UNSIGNED_BYTE",normalized:!0}]}},_generateElementIndices:function(t){return new ArrayBuffer(3*t*2)},setupUniforms:function(t){var e=this.programManager;t.renderer.setProjectionMatrixFromDrawingContext(t),e.setUniform("uProjectionMatrix",t.renderer.projectionMatrix.val),this.renderOptions.lighting&&(u.updateLightingUniforms(this.renderOptions.lighting,t,e,1,this._lightVector),e.setUniform("uResolution",[t.width,t.height]))},updateRenderOptions:function(t){var e=this.nextRenderOptions,i=!1;t!==this.renderOptions.lighting&&(e.lighting=t,i=!0),this._renderOptionsChanged=i},updateShaderConfig:function(){var t=this.programManager,e=this.renderOptions,i=this.nextRenderOptions;if(e.lighting!==i.lighting){var r=i.lighting;e.lighting=r;for(var s=t.getAdditionsByTag("LIGHTING"),n=0;n<s.length;n++){s[n].disable=!r}if(r){var a=t.getAddition("DefineLights");a&&(a.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}}},run:function(t){if(0!==this.instanceCount){this.onRunBegin(t);var e=this.programManager,i=e.getCurrentProgramSuite();if(i){var r=i.program,s=i.vao;this.setupUniforms(t),e.applyUniforms(r);var n=this.indicesPerInstance,a=this.instanceCount,o=this.manager.renderer,h=this.vertexBufferLayout.buffer,l=this.vertexBufferLayout.layout.stride;h.update(this.vertexCount*l),s.bind(),s.indexBuffer.update(a*n*2),o.drawElements(t,this._emptyTextures,r,s,a*n,0,o.gl.TRIANGLES)}this.instanceCount=0,this.vertexCount=0,this.onRunEnd(t)}},batch:function(t,e,i,r,s){0===this.instanceCount&&this.manager.setCurrentBatchNode(this,t),this.updateRenderOptions(s),this._renderOptionsChanged&&(this.run(t),this.updateShaderConfig());for(var n=0,a=0,o=this.instancesPerBatch,h=this.vertexBufferLayout.layout.stride,l=this.verticesPerInstance,u=this.indexBuffer.viewU16,d=this.instanceCount*this.indicesPerInstance,c=this.vertexBufferLayout.buffer,f=c.viewF32,p=c.viewU32,g=this.vertexCount*h/f.BYTES_PER_ELEMENT,m=[],v=0,y=[],x=0,T=0;T<e.length;T++){var w=e[T],b=2*w;m[T]!==n&&(f[g++]=i[b],f[g++]=i[b+1],p[g++]=r[w],m[v++]=n,y[x++]=this.vertexCount,this.vertexCount++);var S=y[x-1];u[d++]=S,++a===l&&(this.instanceCount++,a=0),(this.instanceCount===o||0===a&&d+l>=u.length)&&(n++,this.run(t),d=this.instanceCount*this.indicesPerInstance,g=this.vertexCount*h/f.BYTES_PER_ELEMENT,v=0,x=0)}}});t.exports=c},61842(t,e,i){var r=i(19715),s=i(1e3),n=i(61340),a=i(87841),o=i(43855),h=i(83419),l=i(70554),u=i(6141);function d(t){return l.getTintAppendFloatAlpha(16777215,t)}var c=new h({Extends:u,initialize:function(t){u.call(this,"Camera",t),this.batchHandlerQuadSingleNode=t.getNode("BatchHandlerQuadSingle"),this.fillCameraNode=t.getNode("FillCamera"),this.listCompositorNode=t.getNode("ListCompositor"),this._parentTransformMatrix=new n},run:function(t,e,i,n,h,l){var u;this.onRunBegin(t);var c=t.renderer.drawingContextPool,f=this.manager,p=i.alpha,g=i.filters.internal.getActive(),m=i.filters.external.getActive(),v=h||i.forceComposite||g.length||m.length||p<1;n?i.matrixExternal.multiply(n,n):n=this._parentTransformMatrix.copyFrom(i.matrixExternal);var y=n.decomposeMatrix(),x=o(y.translateX,0)&&o(y.translateY,0)&&o(y.rotation,0)&&o(y.scaleX,1)&&o(y.scaleY,1),T=i.x,w=i.y,b=i.width,S=i.height,C=t.getClone();C.setCamera(i),v?((u=c.get(b,S)).setCamera(i),u.setScissorBox(0,0,b,S)):(u=C).setScissorBox(T,w,b,S),u.use();var E=this.fillCameraNode;if(i.backgroundColor.alphaGL>0){var A=i.backgroundColor,_=s(A.red,A.green,A.blue,A.alpha);E.run(u,_,v)}this.listCompositorNode.run(u,e,null,l);var M=i.flashEffect;M.postRenderWebGL()&&(_=s(M.red,M.green,M.blue,255*M.alpha),E.run(u,_,v));var R=i.fadeEffect;if(R.postRenderWebGL()&&(_=s(R.red,R.green,R.blue,255*R.alpha),E.run(u,_,v)),f.finishBatch(),v){var P,O,L,F,D={smoothPixelArt:f.renderer.game.config.smoothPixelArt},I=new a(0,0,u.width,u.height);for(P=0;P<g.length;P++)O=g[P],u=f.getNode(O.renderNode).run(O,u),L=O.getPaddingCeil(),I.setTo(I.x+L.x,I.y+L.y,I.width+L.width,I.height+L.height);var N=u,B=m.length>0,k=!B,U=new a(0,0,C.width,C.height);if(B){for(P=m.length-1;P>=0;P--)(O=m[P]).active&&(L=O.getPaddingCeil(),U.setTo(U.x+L.x,U.y+L.y,U.width+L.width,U.height+L.height));(k=U.width!==u.width||U.height!==u.height||!x)&&((u=c.get(U.width,U.height)).setScissorBox(0,0,U.width,U.height),u.setCamera(C.camera),u.use())}else u=C;if(k){var z,Y=U.x,X=U.y;n.setQuad(I.x,I.y,I.x+I.width,I.y+I.height),z=n.quad,F=B?4294967295:d(p),i.roundPixels&&(z[0]=Math.round(z[0]),z[1]=Math.round(z[1]),z[2]=Math.round(z[2]),z[3]=Math.round(z[3]),z[4]=Math.round(z[4]),z[5]=Math.round(z[5]),z[6]=Math.round(z[6]),z[7]=Math.round(z[7])),this.batchHandlerQuadSingleNode.batch(u,N.texture,z[0]-Y,z[1]-X,z[2]-Y,z[3]-X,z[6]-Y,z[7]-X,z[4]-Y,z[5]-X,0,1,1,-1,!1,F,F,F,F,D)}if(N!==u&&N.release(),B){var W=!1;for(N=null,L=new a,P=0;P<m.length;P++)(O=m[P]).allowBaseDraw&&u.width===C.width&&u.height===C.height&&P===m.length-1&&1===p&&(W=!0,N=C),u=f.getNode(O.renderNode).run(O,u,N,L),(L=O.currentPadding).x=-L.x,L.y=-L.y,L.width=-L.width,L.height=-L.height;if(!W){F=d(p);var G=-L.x,V=-L.y,H=u.width+L.right,j=u.height+L.bottom;this.batchHandlerQuadSingleNode.batch(C,u.texture,G,j,G,V,H,j,H,V,0,0,1,1,!1,F,F,F,F,D),u.release()}}}i.dirty=!1,i.emit(r.POST_RENDER,i),this.onRunEnd(t)}});t.exports=c},76409(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"DrawLine",t)},run:function(t,e,i,r,s,n,a,o,h){this.onRunBegin(t);var l=s-i,u=n-r,d=Math.sqrt(l*l+u*u),c=a*(n-r)/d,f=a*(i-s)/d,p=o*(n-r)/d,g=o*(i-s)/d,m=s-p,v=n-g,y=i-c,x=r-f,T=s+p,w=n+g,b=i+c,S=r+f,C=h.length;e?(h[C+0]=e.getX(b,S),h[C+1]=e.getY(b,S),h[C+2]=e.getX(y,x),h[C+3]=e.getY(y,x),h[C+4]=e.getX(m,v),h[C+5]=e.getY(m,v),h[C+6]=e.getX(T,w),h[C+7]=e.getY(T,w)):(h[C+0]=b,h[C+1]=S,h[C+2]=y,h[C+3]=x,h[C+4]=m,h[C+5]=v,h[C+6]=T,h[C+7]=w),this.onRunEnd(t)}});t.exports=n},95449(t,e,i){var r=i(19715),s=i(42538),n=i(83419),a=i(10312),o=i(6141),h=new n({Extends:o,initialize:function(t){o.call(this,"DynamicTextureHandler",t),this.fillRectNode=this.manager.getNode("FillRect")},run:function(t){var e=t.drawingContext,i=e.camera,n=e.renderer,o=t.manager;this.onRunBegin(e);var h,l,u,d,c,f,p,g,m,v,y,x,T,w,b=e.framebuffer.renderTexture;if(b)for(var S=n.glTextureUnits,C=S.units,E=0;E<C.length;E++)C[E]===b&&S.bind(null,E);e.setScissorBox(0,0,i.width,i.height),e.use();for(var A=t.commandBuffer,_=A.length,M=null,R=!1,P=e,O=n.gl,L=0;L<_;L++){switch(A[L]){case s.CLEAR:T=A[++L],w=A[++L],x=A[++L],d=A[++L];var F=P.getClone();F.setScissorEnable(!0),F.setScissorBox(T,w,x,d),F.use(),F.clear(O.COLOR_BUFFER_BIT|O.DEPTH_BUFFER_BIT|O.STENCIL_BUFFER_BIT),F.release();break;case s.FILL:var D=A[++L];T=A[++L],w=A[++L],x=A[++L],d=A[++L],this.fillRectNode.run(P,null,null,T,w,x,d,D,D,D,D,!1);break;case s.STAMP:c=A[++L],u=A[++L],T=A[++L],w=A[++L],h=A[++L],y=A[++L],g=A[++L],m=A[++L],v=A[++L],f=A[++L],p=A[++L],l=A[++L];var I=o.resetStamp(h,y);I.setPosition(T,w).setRotation(g).setTexture(c,u).setOrigin(f,p).setScale(m,v).setBlendMode(l),P=this._draw(n,I,P,e,M);break;case s.REPEAT:c=A[++L],u=A[++L],T=A[++L],w=A[++L],h=A[++L],y=A[++L],g=A[++L],m=A[++L],v=A[++L],f=A[++L],p=A[++L],l=A[++L],x=A[++L],d=A[++L];var N=A[++L],B=A[++L],k=A[++L],U=A[++L],z=A[++L],Y=o.resetTileSprite(h,y);Y.setPosition(T,w).setRotation(g).setTexture(c,u).setSize(x,d).setOrigin(f,p).setScale(m,v).setBlendMode(l).setTilePosition(N,B).setTileRotation(k).setTileScale(U,z),P=this._draw(n,Y,P,e,M);break;case s.DRAW:var X=A[++L];if(T=A[++L],w=A[++L],void 0!==T){var W=X.x;X.x+=T}if(void 0!==w){var G=X.y;X.y+=w}P=this._draw(n,X,P,e,M),void 0!==T&&(X.x=W),void 0!==w&&(X.y=G);break;case s.SET_ERASE:A[++L]?(M||(M=e.getClone()).setBlendMode(a.ERASE),P!==M&&(P.release(),P=M,M.use())):P===M&&(M.release(),P=e,e.use());break;case s.PRESERVE:R=A[++L];break;case s.CALLBACK:(0,A[++L])();break;case s.CAPTURE:X=A[++L];var V=A[++L],H=t.startCapture(X,V),j=P;V.camera&&((j=j.getClone()).setCamera(V.camera),j.use()),this._draw(n,X,j,e,M,H.transform),t.finishCapture(X,H),V.camera&&j.release()}}R||(A.length=0),P.release(),b.needsMipmapRegeneration=!0,i.emit(r.POST_RENDER,i),this.onRunEnd(e)},_draw:function(t,e,i,r,s,n){if(i!==s&&e.blendMode!==i.blendMode&&e.blendMode!==a.SKIP_CHECK){i.release();var o=e.blendMode;o===r.blendMode?i=r:(i=r.getClone()).setBlendMode(o),i.use()}return e.renderWebGLStep(t,e,i,n),i}});t.exports=h},61199(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"FillCamera",t),this.fillRectNode=this.manager.getNode("FillRect")},run:function(t,e,i){this.onRunBegin(t);var r=t.camera,s=i?0:r.x,n=i?0:r.y,a=r.width,o=r.height;this.fillRectNode.run(t,null,null,s,n,a,o,e,e,e,e),this.onRunEnd(t)}});t.exports=n},14255(t,e,i){var r=i(94811),s=i(83419),n=i(6141),a=new s({Extends:n,initialize:function(t){n.call(this,"FillPath",t)},run:function(t,e,i,s,n,a,o,h,l){this.onRunBegin(t),void 0===h&&(h=0);var u,d,c,f,p,g,m=s.length,v=0,y=0,x=[],T=[],w=0;for(d=0;d<m;d++)c=s[d],p=e.getX(c.x,c.y),g=e.getY(c.x,c.y),d>0&&d<m-1&&Math.abs(p-x[v-2])<=h&&Math.abs(g-x[v-1])<=h||(x[v++]=p,x[v++]=g);if(f=r(x),n===a&&n===o){var b=x.length;for(u=0;u<b;u+=2)T[w++]=n;i.batch(t,f,x,T,l)}else{var S=f.length,C=Array(S),E=Array(2*S),A=0;for(u=0;u<S;u+=3){var _=2*f[u];p=x[_+0],g=x[_+1],E[A++]=p,E[A++]=g,p=x[(_=2*f[u+1])+0],g=x[_+1],E[A++]=p,E[A++]=g,p=x[(_=2*f[u+2])+0],g=x[_+1],E[A++]=p,E[A++]=g,T[w++]=n,T[w++]=a,T[w++]=o,C[y++]=u+0,C[y++]=u+1,C[y++]=u+2}i.batch(t,C,E,T,l)}this.onRunEnd(t)}});t.exports=a},12682(t,e,i){var r=i(61340),s=i(83419),n=i(6141),a=new s({Extends:n,initialize:function(t){n.call(this,"FillRect",t),this._batchHandlerDefault=t.getNode("BatchHandlerTriFlat"),this._identityMatrix=new r,this._indexedTriangles=[0,1,2,2,3,0]},run:function(t,e,i,r,s,n,a,o,h,l,u,d){this.onRunBegin(t),e||(e=this._identityMatrix),i||(i=this._batchHandlerDefault);var c=e.setQuad(r,s,r+n,s+a);i.batch(t,this._indexedTriangles,c,[o,l,u,h],d),this.onRunEnd(t)}});t.exports=a},13119(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"FillTri",t),this._indexedTriangles=[0,1,2]},run:function(t,e,i,r,s,n,a,o,h,l,u,d,c){this.onRunBegin(t),e?i.batch(t,this._indexedTriangles,[e.getX(r,s),e.getY(r,s),e.getX(n,a),e.getY(n,a),e.getX(o,h),e.getY(o,h)],[l,u,d],c):i.batch(t,this._indexedTriangles,[r,s,n,a,o,h],[l,u,d],c),this.onRunEnd(t)}});t.exports=n},27996(t,e,i){var r=i(83419),s=i(8054),n=i(6141),a=new r({Extends:n,initialize:function(t){n.call(this,"ListCompositor",t)},run:function(t,e,i,r){this.onRunBegin(t);for(var n=t,a=t.blendMode,o=a,h=this.manager.renderer,l=0;l<e.length;l++){var u=e[l];u.blendMode!==o&&u.blendMode!==s.BlendModes.SKIP_CHECK&&(n!==t&&n.release(),(o=u.blendMode)===a?n=t:((n=t.getClone()).setBlendMode(o),n.use())),u.renderWebGLStep(h,u,n,i,r,e,l)}n!==t&&n.release(),this.onRunEnd(t)}});t.exports=a},56432(t,e,i){var r=i(83419),s=i(46975),n=i(6141),a=new r({Extends:n,initialize:function(t){n.call(this,"RebindContext",t),this._state={bindings:{activeTexture:0,arrayBuffer:null,elementArrayBuffer:null,framebuffer:null,program:null,renderbuffer:null},vao:null}},run:function(t){this.onRunBegin(t);var e=this.manager.renderer,i=e.glWrapper;e.clearFramebuffer(void 0,void 0,0),i.update(s(this._state,i.state),!0),e.glTextureUnits.unbindAllUnits(),this.onRunEnd(t)}});t.exports=a},6141(t,e,i){var r=new(i(83419))({initialize:function(t,e){this.name=t,this.manager=e,this._run=null},run:function(){},onRunBegin:function(t){},onRunEnd:function(t){},setDebug:function(t){t?(this._run=this.run,this.run=function(){var t=this.manager;t.pushDebug(this.name);var e=this._run.apply(this,arguments);return t.popDebug(),e}):(this.run=this._run,this._run=null)}});t.exports=r},30130(t,e,i){var r=i(50792),s=i(83419),n=i(92503),a=i(47406),o=i(53663),h=i(16971),l=i(15214),u=i(72266),d=i(62791),c=i(21832),f=i(62087),p=i(61842),g=i(76409),m=i(95449),v=i(61199),y=i(14255),x=i(12682),T=i(13119),w=i(22731),b=i(57032),S=i(52903),C=i(13922),E=i(33466),A=i(75798),_=i(90830),M=i(52302),R=i(34989),P=i(91614),O=i(15600),L=i(99786),F=i(26825),D=i(54900),I=i(34652),N=i(26703),B=i(56165),k=i(40305),U=i(55905),z=i(58167),Y=i(40752),X=i(13279),W=i(27459),G=i(88856),V=i(10845),H=i(99184),j=i(27996),q=i(56432),K=i(17486),Z=i(31029),Q=i(94494),J=i(87469),$=i(89723),tt=i(12913),et=i(22995),it=i(86081),rt=i(88383),st=i(34454),nt=i(46211),at=i(95433),ot=new s({Extends:r,initialize:function(t){r.call(this),this.renderer=t;var e=t.game;this.maxParallelTextureUnits=e.config.autoMobileTextures&&!e.device.os.desktop?1:t.maxTextures,this._nodes={},this._nodeConstructors={BaseFilter:a,BaseFilterShader:o,BatchHandlerPointLight:h,BatchHandlerQuad:l,BatchHandlerQuadSingle:u,BatchHandlerStrip:d,BatchHandlerTileSprite:c,BatchHandlerTriFlat:f,Camera:p,DrawLine:g,DynamicTextureHandler:m,FillCamera:v,FillPath:y,FillRect:x,FillTri:T,FilterBarrel:w,FilterBlend:b,FilterBlocky:S,FilterBlur:C,FilterBlurHigh:E,FilterBlurLow:A,FilterBlurMed:_,FilterBokeh:M,FilterColorMatrix:R,FilterCombineColorMatrix:P,FilterDisplacement:O,FilterGlow:L,FilterGradientMap:F,FilterImageLight:D,FilterKey:I,FilterMask:N,FilterNormalTools:B,FilterPanoramaBlur:k,FilterParallelFilters:U,FilterPixelate:z,FilterQuantize:Y,FilterSampler:X,FilterShadow:W,FilterThreshold:G,FilterVignette:V,FilterWipe:H,ListCompositor:j,RebindContext:q,StrokePath:K,SubmitterQuad:Z,SubmitterTile:Q,SubmitterTilemapGPULayer:J,SubmitterTileSprite:$,TexturerImage:tt,TexturerTileSprite:et,TransformerImage:it,TransformerStamp:rt,TransformerTile:st,TransformerTileSprite:nt,YieldContext:at},Object.entries(e.config.renderNodes).forEach(function(t){var e=t[0],i=t[1];this.addNodeConstructor(e,i)},this),this.currentBatchNode=null,this.currentBatchDrawingContext=null,this.debug=!1,this.debugGraph=null,this.currentDebugNode=null},addNode:function(t,e){if(this._nodes[t])throw new Error("node "+t+" already exists.");this._nodes[t]=e,this.debug&&e.setDebug(!0)},addNodeConstructor:function(t,e){if(this._nodeConstructors[t])throw new Error("node constructor "+t+" already exists.");this._nodeConstructors[t]=e},getNode:function(t){if(this._nodes[t])return this._nodes[t];if(this._nodeConstructors[t]){var e=new this._nodeConstructors[t](this);return this.addNode(t,e),e}return null},hasNode:function(t,e){return!!this._nodes[t]||!e&&!!this._nodeConstructors[t]},setCurrentBatchNode:function(t,e){this.currentBatchNode!==t&&(null!==this.currentBatchNode&&this.currentBatchNode.run(this.currentBatchDrawingContext),this.currentBatchNode=t,this.currentBatchDrawingContext=t?e:null)},setMaxParallelTextureUnits:function(t){this.maxParallelTextureUnits=Math.max(1,Math.min(t,this.renderer.maxTextures)),this.emit(n.SET_PARALLEL_TEXTURE_UNITS,this.maxParallelTextureUnits)},finishBatch:function(){null!==this.currentBatchNode&&this.setCurrentBatchNode(null)},startStandAloneRender:function(){this.finishBatch()},setDebug:function(t){for(var e in this.debug=t,this._nodes)this._nodes[e].setDebug(t);t&&(this.debugGraph=null,this.currentDebugNode=null,this.pushDebug("[Render Tree Root]"),this.renderer.once(n.POST_RENDER,function(){this.setDebug(!1)},this))},pushDebug:function(t){if(this.debug){var e={name:t,children:[],parent:this.currentDebugNode};this.debugGraph?this.currentDebugNode.children.push(e):this.debugGraph=e,this.currentDebugNode=e}},popDebug:function(){this.debug&&(this.currentDebugNode.parent?this.currentDebugNode=this.currentDebugNode.parent:this.currentDebugNode=null)},debugToString:function(){var t;return t=function t(e,i){for(var r=function(t){return" ".repeat(t)}(i)+e.name+"\n",s=0;s<e.children.length;s++)r+=t(e.children[s],i+1);return r}(this.debugGraph,0),t}});t.exports=ot},55403(t,e,i){var r=i(83419),s=i(40952),n=i(56436),a=i(6141),o=i(65884),h=i(72823),l=new r({Extends:a,initialize:function(t,e){a.call(this,"ShaderQuad",t);var i=t.renderer;this.renderer=i,(e=this._completeConfig(e)).updateShaderConfig&&(this.updateShaderConfig=e.updateShaderConfig),this.indexBuffer=i.genericQuadIndexBuffer,this.vertexBufferLayout=new s(i,e.vertexBufferLayout,null),this.programManager=new n(i,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(e.shaderName,e.vertexSource,e.fragmentSource);for(var r=0;r<e.shaderAdditions.length;r++){var o=e.shaderAdditions[r];this.programManager.addAddition(o)}this.setUniform=this.programManager.setUniform.bind(this.programManager),this.transformerNode=t.getNode("TransformerImage"),this._texturerProxy={frameWidth:1,frameHeight:1,frame:{realWidth:1,realHeight:1},uvSource:{x:0,y:0}}},_completeConfig:function(t){var e=this.renderer.gl,i=t.vertexSource;if(!i){var r=t.vertexKey;if(r){var s=this.manager.renderer.game.cache.shader.get(r);s&&s.glsl&&(i=s.glsl)}}i||(i=o);var n=t.fragmentSource;if(!n){var a=t.fragmentKey;a&&(s=this.manager.renderer.game.cache.shader.get(a))&&s.glsl&&(n=s.glsl)}return n||(n=h),{name:t.name||"ShaderQuad",shaderName:t.shaderName||t.name||"ShaderQuad",vertexSource:i,fragmentSource:n,shaderAdditions:t.shaderAdditions||[],vertexBufferLayout:{usage:"DYNAMIC_DRAW",count:4,layout:[{name:"inPosition",size:2,type:e.FLOAT,normalized:!1},{name:"inTexCoord",size:2,type:e.FLOAT,normalized:!1}]}}},run:function(t,e,i){var r=this.manager,s=this.renderer;r.startStandAloneRender(),this.onRunBegin(t);var n,a,o,h,l,u,d,c,f=e.width,p=e.height;if(this._texturerProxy.frame.realWidth=f,this._texturerProxy.frame.realHeight=p,this._texturerProxy.frameWidth=f,this._texturerProxy.frameHeight=p,e.renderToTexture)n=0,a=0,o=0,h=p,l=f,u=p,d=f,c=0;else{var g=this.transformerNode;g.run(t,e,this._texturerProxy,i);var m=g.quad;n=m[0],a=m[1],o=m[2],h=m[3],l=m[4],u=m[5],d=m[6],c=m[7]}var v=this.vertexBufferLayout.layout.stride,y=this.vertexBufferLayout.buffer,x=y.viewF32,T=0;x[T++]=o,x[T++]=h,x[T++]=e.textureCoordinateBottomLeft.x,x[T++]=e.textureCoordinateBottomLeft.y,x[T++]=n,x[T++]=a,x[T++]=e.textureCoordinateTopLeft.x,x[T++]=e.textureCoordinateTopLeft.y,x[T++]=l,x[T++]=u,x[T++]=e.textureCoordinateBottomRight.x,x[T++]=e.textureCoordinateBottomRight.y,x[T++]=d,x[T++]=c,x[T++]=e.textureCoordinateTopRight.x,x[T++]=e.textureCoordinateTopRight.y,y.update(4*v);var w=this.programManager;this.updateShaderConfig(t,e,this);var b=w.getCurrentProgramSuite();if(b){var S=b.program,C=b.vao,E=this.setUniform;s.setProjectionMatrixFromDrawingContext(t),E("uProjectionMatrix",t.renderer.projectionMatrix.val),e.setupUniforms(E,t),w.applyUniforms(S),s.drawElements(t,this.setupTextures(e),S,C,4,0)}this.onRunEnd(t)},setupTextures:function(t){for(var e=t.textures,i=[],r=0;r<e.length;r++){var s=e[r].get().source.glTexture;i.push(s)}return i},updateShaderConfig:function(t,e,i){}});t.exports=l},17486(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"StrokePath",t),this.drawLineNode=this.manager.getNode("DrawLine")},run:function(t,e,i,r,s,n,a,o,h,l,u,d){this.onRunBegin(t);var c,f,p=this.drawLineNode,g=i.length-1,m=!1,v=!1;r>2&&g>1&&(m=!0,s||(v=!0));for(var y,x,T,w,b,S,C,E,A=[],_=0,M=[],R=0,P=[],O=0,L=u*u,F=0;F<g;F+=E){if(S=0===F,C=F===g-1,E=1,c=i[F],f=i[F+E],L&&!C)for(x=f.x-c.x,T=f.y-c.y,w=n.getX(x,T)-n.tx,b=n.getY(x,T)-n.ty;F+E<g-1&&w*w+b*b<=L;)x=(f=i[F+ ++E]).x-c.x,T=f.y-c.y,w=n.getX(x,T)-n.tx,b=n.getY(x,T)-n.ty;p.run(t,n,c.x,c.y,f.x,f.y,c.width/2,f.width/2,M),y=(R+=8)/2,P[O++]=a,P[O++]=h,P[O++]=l,P[O++]=o,A[_++]=y-4,A[_++]=y-3,A[_++]=y-2,A[_++]=y-2,A[_++]=y-1,A[_++]=y-4,m&&!S&&(A[_++]=y-4,A[_++]=y-3,A[_++]=y-6,A[_++]=y-6,A[_++]=y-5,A[_++]=y-4,v&&C&&(A[_++]=y-2,A[_++]=y-1,A[_++]=0,A[_++]=0,A[_++]=1,A[_++]=y-2))}e.batch(t,A,M,P,d),this.onRunEnd(t)}});t.exports=n},95433(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"YieldContext",t),this._state={blend:this.manager.renderer.blendModes[0],vao:null}},run:function(t){this.onRunBegin(t);var e=this.manager,i=e.renderer;e.startStandAloneRender(),i.glWrapper.update(this._state),i.glTextureUnits.unbindAllUnits(),this.onRunEnd(t)}});t.exports=n},70972(t,e,i){var r=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"]]);t.exports=r},98682(t,e,i){var r=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"]]);t.exports=r},87891(t,e,i){var r=new(i(90330))([["Submitter","BatchHandlerTriFlat"],["FillPath","FillPath"],["FillRect","FillRect"],["FillTri","FillTri"],["StrokePath","StrokePath"]]);t.exports=r},40939(t,e,i){var r=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"],["Transformer","TransformerImage"],["Texturer","TexturerImage"]]);t.exports=r},68668(t,e,i){var r=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"]]);t.exports=r},43246(t,e,i){var r=new(i(90330))([["BatchHandler","BatchHandlerPointLight"]]);t.exports=r},30529(t,e,i){var r=new(i(90330))([["BatchHandler","BatchHandlerQuad"]]);t.exports=r},85760(t,e,i){var r=new(i(90330))([["BatchHandler","BatchHandlerStrip"]]);t.exports=r},78705(t,e,i){var r=new(i(90330))([["Submitter","SubmitterQuad"],["BatchHandler","BatchHandlerQuad"],["Transformer","TransformerStamp"],["Texturer","TexturerImage"]]);t.exports=r},41571(t,e,i){var r=new(i(90330))([["Submitter","SubmitterTileSprite"],["BatchHandler","BatchHandlerTileSprite"],["Transformer","TransformerTileSprite"],["Texturer","TexturerTileSprite"]]);t.exports=r},67743(t,e,i){var r=new(i(90330))([["Submitter","SubmitterTilemapGPULayer"]]);t.exports=r},79317(t,e,i){var r=new(i(90330))([["Submitter","SubmitterTile"],["BatchHandler","BatchHandlerTileSprite"],["Transformer","TransformerTile"]]);t.exports=r},59212(t,e,i){var r={DefaultBitmapTextNodes:i(70972),DefaultBlitterNodes:i(98682),DefaultGraphicsNodes:i(87891),DefaultImageNodes:i(40939),DefaultParticleEmitterNodes:i(68668),DefaultPointLightNodes:i(43246),DefaultQuadNodes:i(30529),DefaultRopeNodes:i(85760),DefaultStampNodes:i(78705),DefaultTilemapGPULayerNodes:i(67743),DefaultTilemapLayerNodes:i(79317),DefaultTileSpriteNodes:i(41571)};t.exports=r},47406(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},run:function(t,e,i,r){}});t.exports=n},53663(t,e,i){var r=i(83419),s=i(2807),n=i(99501),a=i(56436),o=i(40952),h=i(47406),l=new r({Extends:h,initialize:function(t,e,i,r,l){if(!r){var u=e.renderer.game.cache.shader.get(i);if(!u||!u.glsl)throw new Error("BaseFilterShader: No fragment shader source provided and no shader found with key "+i);r=u.glsl}h.call(this,t,e);var d=e.renderer,c=d.gl,f={name:t,shaderName:t,vertexSource:s,fragmentSource:r,shaderAdditions:l||[],vertexBufferLayout:{usage:"DYNAMIC_DRAW",count:4,layout:[{name:"inPosition",size:2,type:c.FLOAT,normalized:!1},{name:"inTexCoord",size:2,type:c.FLOAT,normalized:!1}]}};f.shaderAdditions.push(n()),this.indexBuffer=d.genericQuadIndexBuffer,this.vertexBufferLayout=new o(d,f.vertexBufferLayout,null),this.programManager=new a(d,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(f.shaderName,f.vertexSource,f.fragmentSource);for(var p=0;p<f.shaderAdditions.length;p++){var g=f.shaderAdditions[p];this.programManager.addAddition(g)}this.programManager.setUniform("uMainSampler",0)},run:function(t,e,i,r){var s=this.manager,n=s.renderer;s.startStandAloneRender(),r||(r=t.getPaddingCeil()),i||(i=n.drawingContextPool.get(e.width+r.width,e.height+r.height)),i.use(),this.onRunBegin(i);var a=[e.texture];this.setupTextures(t,a,i);var o=-1,h=-1,l=-1,d=1,c=1,f=1,p=1,g=-1;if(r.left){var m=2*r.left/i.width;o-=m,l-=m}if(r.right){var v=2*r.right/i.width;p-=v,c-=v}if(r.top){var y=2*r.top/i.height;d+=y,f+=y}if(r.bottom){var x=2*r.bottom/i.height;h+=x,g+=x}var T=this.vertexBufferLayout.layout.stride,w=this.vertexBufferLayout.buffer,b=w.viewF32,S=0;b[S++]=-1,b[S++]=-1,b[S++]=u(0,o,p),b[S++]=u(0,h,g),b[S++]=-1,b[S++]=1,b[S++]=u(0,l,c),b[S++]=u(1,d,f),b[S++]=1,b[S++]=-1,b[S++]=u(1,o,p),b[S++]=u(0,h,g),b[S++]=1,b[S++]=1,b[S++]=u(1,l,c),b[S++]=u(1,d,f),w.update(4*T);var C=this.programManager;this.updateShaderConfig(t,i);var E=C.getCurrentProgramSuite();if(E){var A=E.program,_=E.vao;this.setupUniforms(t,i),C.applyUniforms(A),n.drawElements(i,a,A,_,4,0)}return e.release(),this.onRunEnd(i),i},updateShaderConfig:function(t,e){},setupTextures:function(t,e,i){},setupUniforms:function(t,e){}});function u(t,e,i){return(e=.5*(1/e+1))+t*((i=.5*(1/i+1))-e)}t.exports=l},22731(t,e,i){var r=i(83419),s=i(53663),n=i(10235),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterBarrel",t,null,n)},setupUniforms:function(t,e){this.programManager.setUniform("amount",t.amount)}});t.exports=a},57032(t,e,i){var r=i(90330),s=i(83419),n=i(10312),a=i(53663),o=i(65980),h=new s({Extends:a,initialize:function(t){this._blendModeMap=new r;var e=this._blendModeMap;Object.entries(n).forEach(function(t){e.set(t[1],t[0])});var i=e.get(n.NORMAL),s=[{name:i,additions:{fragmentHeader:"#define BLEND "+i},tags:["blendmode"]}];a.call(this,"FilterBlend",t,null,o,s)},updateShaderConfig:function(t,e){var i=t.blendMode;i===n.SKIP_CHECK&&(i=n.NORMAL);var r=this._blendModeMap.get(i)||this._blendModeMap.get(n.NORMAL),s=this.programManager.getAdditionsByTag("blendmode")[0];s.name=r,s.additions.fragmentHeader="#define BLEND "+r},setupTextures:function(t,e,i){e[1]=t.glTexture},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uMainSampler2",1),i.setUniform("amount",t.amount),i.setUniform("color",t.color)}});t.exports=h},52903(t,e,i){var r=i(83419),s=i(53663),n=i(5899),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterBlocky",t,null,n)},setupUniforms:function(t,e){var i=this.programManager,r=Math.max(1,t.size.x),s=Math.max(1,t.size.y);i.setUniform("resolution",[e.width,e.height]),i.setUniform("uSizeAndOffset",[r,s,t.offset.x,t.offset.y])}});t.exports=a},13922(t,e,i){var r=i(87841),s=i(83419),n=i(47406),a=new s({Extends:n,initialize:function(t){n.call(this,"FilterBlur",t)},run:function(t,e,i,s){this.onRunBegin(i);var n=t.quality,a=t.steps,o=null;switch(n){case 2:o=this.manager.getNode("FilterBlurHigh");break;case 1:o=this.manager.getNode("FilterBlurMed");break;default:o=this.manager.getNode("FilterBlurLow")}var h={strength:t.strength,color:t.glcolor,x:t.x,y:t.y};s||(s=t.getPaddingCeil());for(var l=e,u=0;u<a;u++){h.x=t.x,h.y=0,l=o.run(h,l,null,s),0===u&&(s=new r);var d=u===a-1?i:null;h.x=0,h.y=t.y,l=o.run(h,l,d,s)}return i=l,this.onRunEnd(i),i}});t.exports=a},33466(t,e,i){var r=i(83419),s=i(53663),n=i(20784),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterBlurHigh",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("resolution",[e.width,e.height]),i.setUniform("strength",t.strength),i.setUniform("color",t.color),i.setUniform("offset",[t.x,t.y])}});t.exports=a},75798(t,e,i){var r=i(83419),s=i(53663),n=i(65122),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterBlurLow",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("resolution",[e.width,e.height]),i.setUniform("strength",t.strength),i.setUniform("color",t.color),i.setUniform("offset",[t.x,t.y])}});t.exports=a},90830(t,e,i){var r=i(83419),s=i(53663),n=i(60942),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterBlurMed",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("resolution",[e.width,e.height]),i.setUniform("strength",t.strength),i.setUniform("color",t.color),i.setUniform("offset",[t.x,t.y])}});t.exports=a},52302(t,e,i){var r=i(83419),s=i(53663),n=i(43722),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterBokeh",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("radius",t.radius),i.setUniform("amount",t.amount),i.setUniform("contrast",t.contrast),i.setUniform("strength",t.strength),i.setUniform("blur",[t.blurX,t.blurY]),i.setUniform("isTiltShift",t.isTiltShift),i.setUniform("resolution",[e.width,e.height])}});t.exports=a},34989(t,e,i){var r=i(83419),s=i(53663),n=i(19883),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterColorMatrix",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uColorMatrix[0]",t.colorMatrix.getData()),i.setUniform("uAlpha",t.colorMatrix.alpha)}});t.exports=a},91614(t,e,i){var r=i(83419),s=i(53663),n=i(32624),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterCombineColorMatrix",t,null,n)},setupTextures:function(t,e,i){e[1]=t.glTexture},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uTransferSampler",1),i.setUniform("uColorMatrixSelf[0]",t.colorMatrixSelf.getData()),i.setUniform("uColorMatrixTransfer[0]",t.colorMatrixTransfer.getData()),i.setUniform("uAlphaSelf",t.colorMatrixSelf.alpha),i.setUniform("uAlphaTransfer",t.colorMatrixTransfer.alpha),i.setUniform("uAdditions",t.additions),i.setUniform("uMultiplications",t.multiplications)}});t.exports=a},15600(t,e,i){var r=i(83419),s=i(53663),n=i(12886),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterDisplacement",t,null,n)},setupTextures:function(t,e){e[1]=t.glTexture},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uDisplacementSampler",1),i.setUniform("amount",[t.x,t.y])}});t.exports=a},99786(t,e,i){var r=i(83419),s=i(53663),n=i(33016),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterGlow",t,null,n,[{name:"distance_10.0",additions:{fragmentDefine:"#define DISTANCE 10.0"},tags:["distance"]},{name:"quality_0.1",additions:{fragmentDefine:"#define QUALITY 0.1"},tags:["quality"]}])},updateShaderConfig:function(t,e){var i=this.programManager,r=t.distance.toFixed(0)+".0",s=i.getAdditionsByTag("distance")[0];s.name="distance_"+r,s.additions.fragmentDefine="#undef DISTANCE\n#define DISTANCE "+r;var n=t.quality.toFixed(0)+".0",a=i.getAdditionsByTag("quality")[0];a.name="quality_"+n,a.additions.fragmentDefine="#undef QUALITY\n#define QUALITY "+n},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("resolution",[e.width,e.height]),i.setUniform("glowColor",t.glcolor),i.setUniform("outerStrength",t.outerStrength),i.setUniform("innerStrength",t.innerStrength),i.setUniform("scale",t.scale),i.setUniform("knockout",t.knockout)}});t.exports=a},26825(t,e,i){var r=i(83419),s=i(53663),n=i(33179),a=i(68589),o=new r({Extends:s,initialize:function(t){var e=[{name:"RAMP_0",tags:"RAMP",additions:{fragmentHeader:a}}];s.call(this,"FilterGradientMap",t,null,n,e)},setupTextures:function(t,e,i){e[1]=t.ramp.glTexture},setupUniforms:function(t,e){var i=this.programManager,r=t.ramp;i.setUniform("uRampTexture",1),i.setUniform("uRampResolution",r.dataTextureResolution),i.setUniform("uRampBandStart",r.dataTextureFirstBand),i.setUniform("uDither",t.dither),i.setUniform("uUnpremultiply",t.unpremultiply),i.setUniform("uColor",t.color),i.setUniform("uColorFactor",t.colorFactor),i.setUniform("uAlpha",t.alpha)},updateShaderConfig:function(t,e){var i=t.ramp.bandTreeDepth,r=this.programManager.getAdditionsByTag("RAMP")[0];r.name="RAMP_"+i,r.additions.fragmentHeader=a.replace("#define BAND_TREE_DEPTH 0.0","#define BAND_TREE_DEPTH "+i+".0")}});t.exports=o},54900(t,e,i){var r=i(83419),s=i(53663),n=i(94526),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterImageLight",t,null,n)},setupTextures:function(t,e,i){e[1]=t.environmentGlTexture,e[2]=t.normalGlTexture},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uEnvSampler",1),i.setUniform("uNormSampler",2),i.setUniform("uViewMatrix",t.viewMatrix.val),i.setUniform("uModelRotation",t.getModelRotation()),i.setUniform("uBulge",t.bulge),i.setUniform("uColorFactor",t.colorFactor)}});t.exports=a},34652(t,e,i){var r=i(83419),s=i(53663),n=i(4488),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterKey",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uColor",t.color),i.setUniform("uIsolateThresholdFeather",[t.isolate,t.threshold,t.feather])}});t.exports=a},26703(t,e,i){var r=i(83419),s=i(53663),n=i(39603),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterMask",t,null,n)},setupTextures:function(t,e,i){t.maskGameObject&&(t.needsUpdate||t.autoUpdate)&&t.updateDynamicTexture(i.width,i.height),e[1]=t.glTexture},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uMaskSampler",1),i.setUniform("invert",t.invert)}});t.exports=a},56165(t,e,i){var r=i(83419),s=i(53663),n=i(60047),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterNormalTools",t,null,n,[{name:"view",additions:{fragmentHeader:"#define VIEW_MATRIX"},tags:["header"]}])},updateShaderConfig:function(t,e){var i=this.programManager.getAdditionsByTag("header")[0];i.name="view",i.additions.fragmentHeader="#define VIEW_MATRIX",1!==t.facingPower&&(i.name+="_facingPower",i.additions.fragmentHeader+="\n#define FACING_POWER"),t.outputRatio&&(i.name+="_ratio",i.additions.fragmentHeader+="\n#define OUTPUT_RATIO")},setupUniforms:function(t,e){var i=this.programManager;if(i.setUniform("uViewMatrix",t.viewMatrix.val),1!==t.facingPower&&i.setUniform("uFacingPower",t.facingPower),t.outputRatio){var r=t.ratioVector;i.setUniform("uRatioVector",[r.x,r.y,r.z]),i.setUniform("uRatioRadius",t.ratioRadius)}}});t.exports=a},40305(t,e,i){var r=i(83419),s=i(53663),n=i(7529),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterPanoramaBlur",t,null,n,[{name:"samples_32_16",additions:{fragmentHeader:"#define SAMPLES_X 32.0\n#define SAMPLES_Y 16.0"},tags:["samples"]}])},updateShaderConfig:function(t,e){var i=t.samplesX.toFixed(0),r=t.samplesY.toFixed(0),s=this.programManager.getAdditionsByTag("samples")[0];s.name="samples_"+i+"_"+r,s.additions.fragmentHeader="#define SAMPLES_X "+i+".0\n#define SAMPLES_Y "+r+".0"},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uRadius",t.radius),i.setUniform("uPower",t.power)}});t.exports=a},55905(t,e,i){var r=i(87841),s=i(83419),n=i(10312),a=i(47406),o=new s({Extends:a,initialize:function(t){a.call(this,"FilterParallelFilters",t)},run:function(t,e,i,s){this.onRunBegin(i),e.lock(this);var a=t.bottom.getActive(),o=t.top.getActive(),h=s||t.getPaddingCeil();if(a.length+o.length>0){var l=e,u=e;if(a.length>0){s=h;for(var d=0;d<a.length;d++){var c=a[d],f=this.manager.getNode(c.renderNode);l=f.run(c,l,null,s),0===d&&d<a.length-1&&(s=new r)}}if(o.length>0)for(s=h,d=0;d<o.length;d++)c=o[d],u=(f=this.manager.getNode(c.renderNode)).run(c,u,null,s),0===d&&d<o.length-1&&(s=new r);e.unlock(this),e!==l&&e!==u&&e.release(),t.blend.glTexture=u.texture,f=this.manager.getNode("FilterBlend"),i=this.manager.getNode("FilterBlend").run(t.blend,l,i,s),u.release()}else{f=this.manager.getNode("FilterBlend");var p={blendMode:n.COPY,glTexture:e.texture,amount:1,color:[1,1,1,1]};e.unlock(this),i=f.run(p,e,i,h)}return this.onRunEnd(i),i}});t.exports=o},58167(t,e,i){var r=i(83419),s=i(53663),n=i(99191),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterPixelate",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("amount",t.amount),i.setUniform("resolution",[e.width,e.height])}});t.exports=a},40752(t,e,i){var r=i(83419),s=i(53663),n=i(88430),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterQuantize",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uSteps",t.steps),i.setUniform("uGamma",t.gamma),i.setUniform("uOffset",t.offset),i.setUniform("uMode",t.mode),i.setUniform("uDither",t.dither)}});t.exports=a},13279(t,e,i){var r=i(83419),s=i(47406),n=new r({Extends:s,initialize:function(t){s.call(this,"FilterSampler",t)},run:function(t,e,i,r){this.onRunBegin(e);var s=this.manager.renderer,n=0,a=0,o=1,h=1,l=e.width,u=e.height,d=!1;return t.region?(n=t.region.x,a=t.region.y,void 0!==t.region.width?(o=t.region.width,h=t.region.height):d=!0):(o=l,h=u),s.snapshotFramebuffer(e.framebuffer,l,u,t.callback,d,n,a,o,h),this.onRunEnd(e),e}});t.exports=n},27459(t,e,i){var r=i(83419),s=i(53663),n=i(69355),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterShadow",t,null,n)},setupUniforms:function(t,e){var i=this.programManager,r=t.samples;i.setUniform("lightPosition",[t.x,1-t.y]),i.setUniform("decay",t.decay),i.setUniform("power",t.power/r),i.setUniform("color",t.glcolor),i.setUniform("samples",r),i.setUniform("intensity",t.intensity)}});t.exports=a},88856(t,e,i){var r=i(83419),s=i(53663),n=i(92636),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterThreshold",t,null,n)},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("edge1",t.edge1),i.setUniform("edge2",t.edge2),i.setUniform("invert",t.invert)}});t.exports=a},10845(t,e,i){var r=i(83419),s=i(53663),n=i(18185),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterVignette",t,null,n)},setupUniforms:function(t,e){var i=this.programManager,r=t.color;i.setUniform("uRadius",t.radius),i.setUniform("uStrength",t.strength),i.setUniform("uPosition",[t.x,t.y]),i.setUniform("uColor",[r.redGL,r.greenGL,r.blueGL,r.alphaGL]),i.setUniform("uBlendMode",t.blendMode)}});t.exports=a},99184(t,e,i){var r=i(83419),s=i(53663),n=i(99174),a=new r({Extends:s,initialize:function(t){s.call(this,"FilterWipe",t,null,n)},setupTextures:function(t,e,i){e[1]=t.wipeTexture.get().glTexture},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uMainSampler2",1),i.setUniform("uProgress_WipeWidth_Direction_Axis",[t.progress,t.wipeWidth,t.direction,t.axis]),i.setUniform("uReveal",t.reveal)}});t.exports=a},54521(t,e,i){var r={BaseFilter:i(47406),BaseFilterShader:i(53663),BatchHandler:i(13961),BatchHandlerPointLight:i(16971),BatchHandlerQuad:i(15214),BatchHandlerQuadSingle:i(72266),BatchHandlerStrip:i(62791),BatchHandlerTileSprite:i(21832),BatchHandlerTriFlat:i(62087),Camera:i(61842),Defaults:i(59212),DrawLine:i(76409),DynamicTextureHandler:i(95449),FillCamera:i(61199),FillPath:i(14255),FillRect:i(12682),FillTri:i(13119),FilterBarrel:i(22731),FilterBlend:i(57032),FilterBlur:i(13922),FilterBlurHigh:i(33466),FilterBlurLow:i(75798),FilterBlurMed:i(90830),FilterBokeh:i(52302),FilterColorMatrix:i(34989),FilterCombineColorMatrix:i(91614),FilterDisplacement:i(15600),FilterGlow:i(99786),FilterGradientMap:i(26825),FilterImageLight:i(54900),FilterKey:i(34652),FilterMask:i(26703),FilterNormalTools:i(56165),FilterPanoramaBlur:i(40305),FilterParallelFilters:i(55905),FilterPixelate:i(58167),FilterQuantize:i(40752),FilterSampler:i(13279),FilterShadow:i(27459),FilterThreshold:i(88856),FilterVignette:i(10845),FilterWipe:i(99184),ListCompositor:i(27996),RebindContext:i(56432),RenderNode:i(6141),StrokePath:i(17486),SubmitterQuad:i(31029),SubmitterSpriteGPULayer:i(53384),SubmitterTile:i(94494),SubmitterTilemapGPULayer:i(87469),SubmitterTileSprite:i(89723),TexturerImage:i(12913),TexturerTileSprite:i(22995),TransformerImage:i(86081),TransformerStamp:i(88383),TransformerTile:i(34454),TransformerTileSprite:i(46211),YieldContext:i(95433)};t.exports=r},31029(t,e,i){var r=i(83419),s=i(46975),n=i(70554),a=i(6141),o=n.getTintAppendFloatAlpha,h=new r({Extends:a,initialize:function(t,e){e=s(e||{},this.defaultConfig),a.call(this,e.name,t),this.batchHandler=e.batchHandler,this._renderOptions={multiTexturing:!0,lighting:null,smoothPixelArt:null},this._lightingOptions={normalGLTexture:null,normalMapRotation:0,selfShadow:{enabled:!1,penumbra:0,diffuseFlatThreshold:0}}},defaultConfig:{name:"SubmitterQuad",role:"Submitter",batchHandler:"BatchHandler"},run:function(t,e,i,r,s,n,a,h,l){var u,d,c,f,p;this.onRunBegin(t),s.run&&s.run(t,e,r),n.run&&n.run(t,e,s,i,r),a?(a.run&&a.run(t,e,r),u=a.tintEffect,d=a.tintTopLeft,c=a.tintBottomLeft,f=a.tintTopRight,p=a.tintBottomRight):(u=e.tintMode,d=o(e.tintTopLeft,e._alphaTL),c=o(e.tintBottomLeft,e._alphaBL),f=o(e.tintTopRight,e._alphaTR),p=o(e.tintBottomRight,e._alphaBR));var g=n.quad,m=s.uvSource,v=m.u0,y=m.v0,x=m.u1,T=m.v1;this.setRenderOptions(e,h,l),(e.customRenderNodes[this.batchHandler]||e.defaultRenderNodes[this.batchHandler]).batch(t,s.frame.source.glTexture,g[0],g[1],g[2],g[3],g[6],g[7],g[4],g[5],v,y,x-v,T-y,u,d,c,f,p,this._renderOptions),this.onRunEnd(t)},setRenderOptions:function(t,e,i){var r,s,n,a=this._renderOptions;if(t.displayTexture?(r=t.displayTexture,s=t.displayFrame.sourceIndex):t.texture?(r=t.texture,s=t.frame.sourceIndex):t.tileset&&(r=Array.isArray(t.tileset)?t.tileset[0].image:t.tileset.image,s=0),t.lighting){if(e||r&&(e=r.dataSource[s]),e=e?e.glTexture:this.manager.renderer.normalTexture,isNaN(i))if(i=t.rotation,t.parentContainer)i=t.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2).rotationNormalized;var o=t.selfShadow,h=o.enabled;null===h&&(h=t.scene.sys.game.config.selfShadow),this._lightingOptions.normalGLTexture=e,this._lightingOptions.normalMapRotation=i,this._lightingOptions.selfShadow.enabled=h,this._lightingOptions.selfShadow.penumbra=o.penumbra,this._lightingOptions.selfShadow.diffuseFlatThreshold=o.diffuseFlatThreshold,a.lighting=this._lightingOptions}else a.lighting=null;n=r&&null!==r.smoothPixelArt?r.smoothPixelArt:t.scene.sys.game.config.smoothPixelArt,a.smoothPixelArt=n}});t.exports=h},53384(t,e,i){var r=i(61340),s=i(26099),n=i(83419),a=i(46975),o=i(56436),h=i(81084),l=i(44349),u=i(6184),d=i(11653),c=i(40829),f=i(42792),p=i(96049),g=i(33997),m=i(79532),v=i(74505),y=i(70554),x=i(40952),T=i(6141),w=i(49119),b=i(3524),S=new n({Extends:T,initialize:function(t,e,i){var n=t.renderer,h=a(e||{},this.defaultConfig),l=h.name;this._completeLayout(h),T.call(this,l,t),this.config=h,this.gameObject=i,this.instanceBufferLayout=new x(n,h.instanceBufferLayout,null),this.vertexBufferLayout=new x(n,h.vertexBufferLayout,null);var u=this.vertexBufferLayout.buffer,d=u.viewU8;if(d[0]=0,d[1]=1,d[2]=2,d[3]=3,u.update(),this.programManager=new o(n,[this.vertexBufferLayout,this.instanceBufferLayout],this.indexBuffer),this.programManager.setBaseShader(h.shaderName,h.vertexSource,h.fragmentSource),h.shaderAdditions)for(var c=0;c<h.shaderAdditions.length;c++){var f=h.shaderAdditions[c];this.programManager.addAddition(f)}if(h.shaderFeatures)for(c=0;c<h.shaderFeatures.length;c++)this.programManager.addFeature(h.shaderFeatures[c]);this._calcMatrix=new r,this._lightVector=new s},defaultConfig:{name:"SubmitterSpriteGPULayer",count:0,shaderName:"SpriteGPULayer",vertexSource:b,fragmentSource:w,shaderAdditions:[f(),p(),v(!0),d(1),g(),l(),u(!0),m(!0),c(!0),h(!0)],instanceBufferLayout:{usage:"STATIC_DRAW",instanceDivisor:1,layout:[{name:"inPositionX",size:4},{name:"inPositionY",size:4},{name:"inRotation",size:4},{name:"inScaleX",size:4},{name:"inScaleY",size:4},{name:"inAlpha",size:4},{name:"inFrame",size:4},{name:"inTintBlend",size:4},{name:"inTintBL",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTintTL",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTintBR",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inTintTR",size:4,type:"UNSIGNED_BYTE",normalized:!0},{name:"inOriginAndTintModeAndCreationTime",size:4},{name:"inScrollFactor",size:2}]},vertexBufferLayout:{usage:"STATIC_DRAW",count:4,layout:[{name:"inVertex",type:"UNSIGNED_BYTE"}]}},_completeLayout:function(t){var e=t.vertexBufferLayout;t.vertexBufferLayout={},t.vertexBufferLayout.usage=e.usage,t.vertexBufferLayout.count=e.count,t.vertexBufferLayout.layout=[];for(var i=t.vertexBufferLayoutRemove||[],r=0;r<e.layout.length;r++){var s=e.layout[r];-1===i.indexOf(s.name)&&(t.vertexBufferLayout.layout[r]={name:s.name,size:s.size||1,type:s.type||"FLOAT",normalized:s.normalized||!1})}if(t.vertexBufferLayoutAdd){var n=t.vertexBufferLayoutAdd||[];for(r=0;r<n.length;r++){var a=n[r];t.vertexBufferLayout.layout.push({name:a.name,size:a.size||1,type:a.type||"FLOAT",normalized:a.normalized||!1})}}for(e=t.instanceBufferLayout,t.instanceBufferLayout={},t.instanceBufferLayout.usage=e.usage,t.instanceBufferLayout.instanceDivisor=e.instanceDivisor,t.instanceBufferLayout.layout=[],i=t.instanceBufferLayoutRemove||[],r=0;r<e.layout.length;r++)s=e.layout[r],-1===i.indexOf(s.name)&&(t.instanceBufferLayout.layout[r]={name:s.name,size:s.size||1,type:s.type||"FLOAT",normalized:s.normalized||!1});if(t.instanceBufferLayoutAdd)for(n=t.instanceBufferLayoutAdd||[],r=0;r<n.length;r++)a=n[r],t.instanceBufferLayout.layout.push({name:a.name,size:a.size||1,type:a.type||"FLOAT",normalized:a.normalized||!1})},setupUniforms:function(t){var e=t.camera,i=this.programManager,r=this.gameObject;i.setUniform("uRoundPixels",e.roundPixels),i.setUniform("uResolution",[t.width,t.height]),t.renderer.setProjectionMatrixFromDrawingContext(t),i.setUniform("uProjectionMatrix",t.renderer.projectionMatrix.val);var s=e.matrixCombined;i.setUniform("uViewMatrix",[s.a,s.b,0,s.c,s.d,0,s.tx,s.ty,1]),i.setUniform("uCameraScrollAndAlpha",[e.scrollX,e.scrollY,r.alpha]),i.setUniform("uTime",r.timeElapsed),i.setUniform("uDiffuseResolution",[r.frame.source.width,r.frame.source.height]),i.setUniform("uFrameDataResolution",[r.frameDataTexture.width,r.frameDataTexture.height]),i.setUniform("uGravity",r.gravity),i.setUniform("uMainSampler[0]",0),i.setUniform("uFrameDataTexture",1);var n=r.texture.source[0].glTexture;i.setUniform("uMainResolution[0]",[n.width,n.height]),y.updateLightingUniforms(r.lighting,t,i,2,this._lightVector,r.selfShadow.enabled,r.selfShadow.diffuseFlatThreshold,r.selfShadow.penumbra)},updateRenderOptions:function(){for(var t=this.programManager,e=this.gameObject.lighting,i=t.getAdditionsByTag("LIGHTING"),r=0;r<i.length;r++)i[r].disable=!e;if(e){var s=t.getAddition("DefineLights");s&&(s.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}var n=t.getAddition("SmoothPixelArt");if(n){var a=this.gameObject.texture.smoothPixelArt;null===a&&(a=this.gameObject.scene.game.config.smoothPixelArt),n.disable=!a}t.clearFeatures();var o=this.gameObject.getShaderFeatures();for(r=0;r<o.length;r++)t.addFeature(o[r]);this.gameObject.selfShadow.enabled&&t.addFeature("SELFSHADOW")},run:function(t){var e,i=this.gameObject;if(0!==i.memberCount){this.manager.startStandAloneRender(),this.onRunBegin(t);var r=i.bufferUpdateSegments;if(r>0){var s=this.instanceBufferLayout.buffer,n=i.memberCount,a=Math.floor(n/i.bufferUpdateSegmentSize),o=!0;for(e=0;e<=a;e++)if(!(1<<e&r)){o=!1;break}if(r===i.MAX_BUFFER_UPDATE_SEGMENTS_FULL||n<=i.bufferUpdateSegmentSize||o)s.update();else{var h=i.bufferUpdateSegmentSize,l=h*this.instanceBufferLayout.layout.stride;for(e=0;e<32&&e*h<n;e++)r&1<<e&&s.update(l,e*l)}i.clearAllSegmentsNeedUpdate()}var u=[i.frame.source.glTexture,i.frameDataTexture];if(i.lighting){var d=i.texture.dataSource[i.frame.sourceIndex];d=d?d.glTexture:this.manager.renderer.normalTexture,u[2]=d}this.updateRenderOptions();var c=this.programManager,f=c.getCurrentProgramSuite();if(f){var p=f.program,g=f.vao;this.setupUniforms(t),c.applyUniforms(p),this.manager.renderer.drawInstancedArrays(t,u,p,g,0,4,i.memberCount)}this.onRunEnd(t)}}});t.exports=S},94494(t,e,i){var r=i(83419),s=i(31029),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e),this._renderOptions.clampFrame=!0},defaultConfig:{name:"SubmitterTile",role:"Submitter",batchHandler:"BatchHandler"},run:function(t,e,i,r,s,n,a,o,h){var l,u,d,c,f;if(this.onRunBegin(t),s.run&&s.run(t,e,r),n.run&&n.run(t,e,s,i,r),a)a.run&&a.run(t,e,r),l=a.tintEffect,u=a.tintTopLeft,d=a.tintBottomLeft,c=a.tintTopRight,f=a.tintBottomRight;else{l=e.tintMode;var p=4294967295;u=p,d=p,c=p,f=p}var g=s.frame,m=n.quad,v=s.uvSource,y=v.u0,x=v.v0,T=v.u1,w=v.v1;this.setRenderOptions(e,o,h),(e.customRenderNodes[this.batchHandler]||e.defaultRenderNodes[this.batchHandler]).batch(t,g.source.glTexture,m[0],m[1],m[2],m[3],m[6],m[7],m[4],m[5],y,x,T-y,w-x,l,u,d,c,f,this._renderOptions,y,w,y,x,T,w,T,x),this.onRunEnd(t)}});t.exports=n},89723(t,e,i){var r=i(83419),s=i(70554),n=i(31029),a=s.getTintAppendFloatAlpha,o=new r({Extends:n,initialize:function(t,e){n.call(this,t,e),this._renderOptions.wrapFrame=!0},defaultConfig:{name:"SubmitterTileSprite",role:"Submitter",batchHandler:"BatchHandler"},run:function(t,e,i,r,s,n,o,h,l){var u,d,c,f,p;this.onRunBegin(t),s.run&&s.run(t,e,r),n.run&&n.run(t,e,s,i,r),o?(o.run&&o.run(t,e,r),u=o.tintEffect,d=o.tintTopLeft,c=o.tintBottomLeft,f=o.tintTopRight,p=o.tintBottomRight):(u=e.tintMode,d=a(e.tintTopLeft,e._alphaTL),c=a(e.tintBottomLeft,e._alphaBL),f=a(e.tintTopRight,e._alphaTR),p=a(e.tintBottomRight,e._alphaBR));var g=s.frame,m=n.quad,v=g,y=v.u0,x=v.v0,T=v.u1,w=v.v1,b=s.uvMatrix.quad;this.setRenderOptions(e,h,l),this._lightingOptions.normalMapRotation+=e.tileRotation,(e.customRenderNodes[this.batchHandler]||e.defaultRenderNodes[this.batchHandler]).batch(t,g.source.glTexture,m[0],m[1],m[2],m[3],m[6],m[7],m[4],m[5],y,x,T-y,w-x,u,d,c,f,p,this._renderOptions,b[0],b[1],b[2],b[3],b[6],b[7],b[4],b[5]),this.onRunEnd(t)}});t.exports=o},87469(t,e,i){var r=i(61340),s=i(26099),n=i(83419),a=i(46975),o=i(56436),h=i(84639),l=i(81084),u=i(6184),d=i(747),c=i(74505),f=i(57532),p=i(23879),g=i(40952),m=i(6141),v=i(70554),y=new n({Extends:m,initialize:function(t,e){var i=t.renderer,n=a(e||{},this.defaultConfig),h=n.name;if(this._completeLayout(n),m.call(this,h,t),this.config=n,this.indexBuffer=i.genericQuadIndexBuffer,this.vertexBufferLayout=new g(i,n.vertexBufferLayout,null),this.programManager=new o(i,[this.vertexBufferLayout],this.indexBuffer),this.programManager.setBaseShader(n.shaderName,n.vertexSource,n.fragmentSource),n.shaderAdditions)for(var l=0;l<n.shaderAdditions.length;l++){var u=n.shaderAdditions[l];this.programManager.addAddition(u)}if(n.shaderFeatures)for(l=0;l<n.shaderFeatures.length;l++)this.programManager.addFeature(n.shaderFeatures[l]);this._spriteMatrix=new r,this._calcMatrix=new r,this._lightVector=new s,this._quad=new Float32Array(8)},defaultConfig:{name:"SubmitterTilemapGPULayer",shaderName:"TilemapGPULayer",vertexSource:p,fragmentSource:f,shaderAdditions:[c(!0),d(!0),u(!0),l(!0)],vertexBufferLayout:{usage:"DYNAMIC_DRAW",count:4,layout:[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]}},_completeLayout:function(t){var e=t.vertexBufferLayout;t.vertexBufferLayout={},t.vertexBufferLayout.usage=e.usage,t.vertexBufferLayout.count=e.count||4,t.vertexBufferLayout.layout=[];for(var i=t.vertexBufferLayoutRemove||[],r=0;r<e.layout.length;r++){var s=e.layout[r];-1===i.indexOf(s.name)&&(t.vertexBufferLayout.layout[r]={name:s.name,size:s.size||1,type:s.type||"FLOAT",normalized:s.normalized||!1})}if(t.vertexBufferLayoutAdd){var n=t.vertexBufferLayoutAdd||[];for(r=0;r<n.length;r++){var a=n[r];t.vertexBufferLayout.layout.push({name:a.name,size:a.size||1,type:a.type||"FLOAT",normalized:a.normalized||!1})}}},setupUniforms:function(t,e){var i=this.programManager;i.setUniform("uResolution",[t.width,t.height]),t.renderer.setProjectionMatrixFromDrawingContext(t),i.setUniform("uProjectionMatrix",t.renderer.projectionMatrix.val);var r=e.tileset,s=r.glTexture,n=e.layerDataTexture,a=r.getAnimationDataTexture(t.renderer);i.setUniform("uMainSampler",0),i.setUniform("uLayerSampler",1),i.setUniform("uAnimSampler",2),i.setUniform("uMainResolution",[s.width,s.height]),i.setUniform("uLayerResolution",[n.width,n.height]),i.setUniform("uAnimResolution",[a.width,a.height]),i.setUniform("uTileColumns",r.columns),i.setUniform("uTileWidthHeightMarginSpacing",[r.tileWidth,r.tileHeight,r.tileMargin,r.tileSpacing]),i.setUniform("uAlpha",e.alpha),i.setUniform("uTime",e.timeElapsed),v.updateLightingUniforms(e.lighting,t,i,3,this._lightVector,e.selfShadow.enabled,e.selfShadow.diffuseFlatThreshold,e.selfShadow.penumbra)},updateRenderOptions:function(t){var e=this.programManager,i=t.tileset.image,r=e.getAdditionsByTag("MAXANIMS")[0];r&&e.removeAddition(r.name),t.tileset.maxAnimationLength>0&&e.addAddition(h(t.tileset.maxAnimationLength));for(var s=t.lighting,n=e.getAdditionsByTag("LIGHTING"),a=0;a<n.length;a++){n[a].disable=!s}if(s){var o=e.getAddition("DefineLights");o&&(o.additions.fragmentDefine="#define LIGHT_COUNT "+this.manager.renderer.config.maxLights)}var l=t.selfShadow.enabled;null===l&&(l=t.scene.sys.game.config.selfShadow),l?e.addFeature("SELFSHADOW"):e.removeFeature("SELFSHADOW");var u=i.smoothPixelArt;null===u&&(u=t.scene.sys.game.config.smoothPixelArt);var d=e.getAddition("SmoothPixelArt");d&&(d.disable=!u),i.source[0].glTexture.magFilter===this.manager.renderer.gl.LINEAR?e.addFeature("BORDERFILTER"):e.removeFeature("BORDERFILTER")},run:function(t,e,i){var r=this.manager,s=r.renderer;r.startStandAloneRender(),this.onRunBegin(t);var n=t.camera,a=this._spriteMatrix,o=this._calcMatrix,h=this._quad,l=e.x,u=e.y,d=e.width,c=e.height;o.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),i&&o.multiply(i),a.applyITRS(l,u,0,e.scaleX,e.scaleY),o.multiply(a),o.setQuad(l,u,l+d,u+c,h);var f=this.vertexBufferLayout.layout.stride,p=this.vertexBufferLayout.buffer,g=p.viewF32,m=0;g[m++]=h[2],g[m++]=h[3],g[m++]=0,g[m++]=0,g[m++]=h[0],g[m++]=h[1],g[m++]=0,g[m++]=1,g[m++]=h[4],g[m++]=h[5],g[m++]=1,g[m++]=0,g[m++]=h[6],g[m++]=h[7],g[m++]=1,g[m++]=1,p.update(4*f);var v=e.tileset,y=v.glTexture,x=v.getAnimationDataIndexMap(s).size>0,T=[y,e.layerDataTexture];if(x&&(T[2]=v.getAnimationDataTexture(s)),e.lighting){var w=v.image.dataSource[0];w=w?w.glTexture:this.manager.renderer.normalTexture,T[3]=w}this.updateRenderOptions(e);var b=this.programManager,S=b.getCurrentProgramSuite();if(S){var C=S.program,E=S.vao;this.setupUniforms(t,e),b.applyUniforms(C),s.drawElements(t,T,C,E,4,0)}this.onRunEnd(t)}});t.exports=y},12913(t,e,i){var r=i(83419),s=i(6141),n=new r({Extends:s,initialize:function(t){s.call(this,"TexturerImage",t),this.frame=null,this.frameWidth=0,this.frameHeight=0,this.uvSource=null},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,this.frameWidth=r.cutWidth,this.frameHeight=r.cutHeight,this.uvSource=r,e.isCropped){var s=e._crop;this.uvSource=s,s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY),this.frameWidth=s.width,this.frameHeight=s.height}var n=r.source.resolution;this.frameWidth/=n,this.frameHeight/=n,this.onRunEnd(t)}});t.exports=n},22995(t,e,i){var r=i(61340),s=i(83419),n=i(6141),a=new s({Extends:n,initialize:function(t){n.call(this,"TexturerTileSprite",t),this.frame=null,this.uvMatrix=new r},run:function(t,e,i){this.onRunBegin(t);var r=e.frame;if(this.frame=r,e.isCropped){var s=e._crop;s.flipX===e.flipX&&s.flipY===e.flipY||e.frame.updateCropUVs(s,e.flipX,e.flipY)}this.uvMatrix.loadIdentity(),this.uvMatrix.scale(1/r.width,1/r.height),this.uvMatrix.translate(e.tilePositionX,e.tilePositionY),this.uvMatrix.scale(1/e.tileScaleX,1/e.tileScaleY),this.uvMatrix.rotate(-e.tileRotation),this.uvMatrix.setQuad(0,0,e.width,e.height),this.onRunEnd(t)}});t.exports=a},86081(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this.quad=new Float32Array(8),this._spriteMatrix=new r,this._calcMatrix=new r},defaultConfig:{name:"TransformerImage",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=t.camera,v=this._spriteMatrix,y=this._calcMatrix.copyWithScrollFactorFrom(m.getViewMatrix(!t.useCanvas),m.scrollX,m.scrollY,e.scrollFactorX,e.scrollFactorY);r&&y.multiply(r),v.applyITRS(e.x,e.y,e.rotation,e.scaleX*p,e.scaleY*g),y.multiply(v),y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight,this.quad);var x=y.matrix,T=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3];if(e.willRoundVertices(m,T)){var w=this.quad;w[0]=Math.round(w[0]),w[1]=Math.round(w[1]),w[2]=Math.round(w[2]),w[3]=Math.round(w[3]),w[4]=Math.round(w[4]),w[5]=Math.round(w[5]),w[6]=Math.round(w[6]),w[7]=Math.round(w[7])}this.onRunEnd(t)}});t.exports=o},88383(t,e,i){var r=i(61340),s=i(83419),n=i(46975),a=i(6141),o=new s({Extends:a,initialize:function(t,e){e=n(e||{},this.defaultConfig),a.call(this,e.name,t),this._spriteMatrix=new r,this.quad=this._spriteMatrix.quad},defaultConfig:{name:"TransformerStamp",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=i.frame,a=i.uvSource,o=a.x,h=a.y,l=e.displayOriginX,u=e.displayOriginY,d=-l+o,c=-u+h,f=n.customPivot,p=1,g=1;e.flipX&&(f||(d+=-n.realWidth+2*l),p=-1),e.flipY&&(f||(c+=-n.realHeight+2*u),g=-1);var m=e.x,v=e.y,y=this._spriteMatrix;y.applyITRS(m,v,e.rotation,e.scaleX*p,e.scaleY*g);var x=y.matrix;this.onlyTranslate=1===x[0]&&0===x[1]&&0===x[2]&&1===x[3],y.setQuad(d,c,d+i.frameWidth,c+i.frameHeight);var T=y.matrix,w=1===T[0]&&0===T[1]&&0===T[2]&&1===T[3];if(e.willRoundVertices(t.camera,w)){var b=this.quad;b[0]=Math.round(b[0]),b[1]=Math.round(b[1]),b[2]=Math.round(b[2]),b[3]=Math.round(b[3]),b[4]=Math.round(b[4]),b[5]=Math.round(b[5]),b[6]=Math.round(b[6]),b[7]=Math.round(b[7])}this.onRunEnd(t)}});t.exports=o},34454(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTile",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=t.camera,a=this._calcMatrix,o=this._spriteMatrix;a.copyWithScrollFactorFrom(n.getViewMatrix(!t.useCanvas),n.scrollX,n.scrollY,e.scrollFactorX,e.scrollFactorY),r&&a.multiply(r);var h=i.frameWidth,l=i.frameHeight,u=h,d=l,c=h/2,f=l/2,p=e.scaleX,g=e.scaleY,m=e.gidMap[s.index],v=m.tileOffset.x,y=m.tileOffset.y,x=e.x+s.pixelX*p+(c*p-v),T=e.y+s.pixelY*g+(f*g-y),w=-c,b=-f;s.flipX&&(u*=-1,w+=h),s.flipY&&(d*=-1,w+=l),o.applyITRS(x,T,s.rotation,p,g),a.multiply(o),a.setQuad(w,b,w+u,b+d,this.quad);var S=a.matrix,C=1===S[0]&&0===S[1]&&0===S[2]&&1===S[3];if(e.willRoundVertices(n,C)){var E=this.quad;E[0]=Math.round(E[0]),E[1]=Math.round(E[1]),E[2]=Math.round(E[2]),E[3]=Math.round(E[3]),E[4]=Math.round(E[4]),E[5]=Math.round(E[5]),E[6]=Math.round(E[6]),E[7]=Math.round(E[7])}this.onRunEnd(t)}});t.exports=n},46211(t,e,i){var r=i(83419),s=i(86081),n=new r({Extends:s,initialize:function(t,e){s.call(this,t,e)},defaultConfig:{name:"TransformerTileSprite",role:"Transformer"},run:function(t,e,i,r,s){this.onRunBegin(t);var n=e.width,a=e.height,o=e.displayOriginX,h=e.displayOriginY,l=-o,u=-h,d=1,c=1;e.flipX&&(l+=2*o-n,d=-1),e.flipY&&(u+=2*h-a,c=-1);var f=e.x,p=e.y,g=t.camera,m=this._calcMatrix,v=this._spriteMatrix;m.copyWithScrollFactorFrom(g.getViewMatrix(!t.useCanvas),g.scrollX,g.scrollY,e.scrollFactorX,e.scrollFactorY),r&&m.multiply(r),v.applyITRS(f,p,e.rotation,e.scaleX*d,e.scaleY*c),m.multiply(v),m.setQuad(l,u,l+n,u+a,this.quad);var y=m.matrix,x=1===y[0]&&0===y[1]&&0===y[2]&&1===y[3];if(e.willRoundVertices(g,x)){var T=this.quad;T[0]=Math.round(T[0]),T[1]=Math.round(T[1]),T[2]=Math.round(T[2]),T[3]=Math.round(T[3]),T[4]=Math.round(T[4]),T[5]=Math.round(T[5]),T[6]=Math.round(T[6]),T[7]=Math.round(T[7])}this.onRunEnd(t)}});t.exports=n},84547(t){t.exports=["vec4 applyLighting (vec4 fragColor, vec3 normal)","{"," vec4 lighting = getLighting(fragColor, normal);"," return fragColor * vec4(lighting.rgb * lighting.a, lighting.a);","}"].join("\n")},11104(t){t.exports=["vec4 applyTint(vec4 texture)","{"," vec3 unpremultTexture = texture.rgb / texture.a;"," float alpha = texture.a * outTint.a;"," vec3 color = vec3(unpremultTexture);"," if (outTintEffect == 0.0) {"," color *= outTint.bgr;"," }"," else if (outTintEffect == 1.0) {"," color = outTint.bgr;"," }"," else if (outTintEffect == 2.0) {"," color += outTint.bgr;"," }"," else if (outTintEffect == 4.0) {"," color = 1.0 - (1.0 - unpremultTexture) * (1.0 - outTint.bgr);"," }"," else if (outTintEffect == 5.0) {"," color = vec3("," unpremultTexture.r < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," unpremultTexture.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," unpremultTexture.b < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," else if (outTintEffect == 6.0) {"," color = vec3("," outTint.b < 0.5 ? 2.0 * outTint.b * unpremultTexture.r : 1.0 - 2.0 * (1.0 - outTint.b) * (1.0 - unpremultTexture.r),"," outTint.g < 0.5 ? 2.0 * outTint.g * unpremultTexture.g : 1.0 - 2.0 * (1.0 - outTint.g) * (1.0 - unpremultTexture.g),"," outTint.r < 0.5 ? 2.0 * outTint.r * unpremultTexture.b : 1.0 - 2.0 * (1.0 - outTint.r) * (1.0 - unpremultTexture.b)"," );"," }"," return vec4(color * alpha, alpha);","}"].join("\n")},81556(t){t.exports=["vec4 boundedSampler(sampler2D sampler, vec2 uv)","{"," if (clamp(uv, 0.0, 1.0) != uv)"," {"," return vec4(0.0, 0.0, 0.0, 0.0);"," }"," return texture2D(sampler, uv);","}"].join("\n")},96293(t){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," c.rgb *= c.a;"," result.rgb *= result.a;"," gl_FragColor = mix(c, result, uAlpha);","}"].join("\n")},78390(t){t.exports=["vec2 v2len (vec2 a, vec2 b)","{"," return sqrt(a*a+b*b);","}","vec2 getBlockyTexCoord (vec2 texCoord, vec2 texRes) {"," texCoord *= texRes;"," vec2 seam = floor(texCoord + 0.5);"," texCoord = (texCoord - seam) / v2len(dFdx(texCoord), dFdy(texCoord)) + seam;"," texCoord = clamp(texCoord, seam-.5, seam+.5);"," return texCoord / texRes;","}"].join("\n")},11719(t){t.exports=["struct Light","{"," vec3 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = LIGHT_COUNT;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform int uLightCount;","#ifdef FEATURE_SELFSHADOW","uniform float uDiffuseFlatThreshold;","uniform float uPenumbra;","#endif","vec4 getLighting (vec4 fragColor, vec3 normal)","{"," vec3 finalColor = vec3(0.0);"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," #ifdef FEATURE_SELFSHADOW"," vec3 unpremultipliedColor = fragColor.rgb / fragColor.a;"," float occlusionThreshold = 1.0 - ((unpremultipliedColor.r + unpremultipliedColor.g + unpremultipliedColor.b) / uDiffuseFlatThreshold);"," #endif"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), light.position.z / res.x);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," #ifdef FEATURE_SELFSHADOW"," float occluded = smoothstep(0.0, 1.0, (diffuseFactor - occlusionThreshold) / uPenumbra);"," vec3 diffuse = light.color * diffuseFactor * occluded;"," #else"," vec3 diffuse = light.color * diffuseFactor;"," #endif"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," return colorOutput;","}"].join("\n")},14030(t){t.exports=["vec2 clampTexCoordWithinFrame (vec2 texCoord)","{"," vec2 texRes = getTexRes();"," vec4 frameTexel = outFrame * texRes.xyxy;"," vec2 frameMin = frameTexel.xy + vec2(0.5, 0.5);"," vec2 frameMax = frameTexel.xy + frameTexel.zw - vec2(0.5, 0.5);"," return clamp(texCoord, frameMin / texRes, frameMax / texRes);","}"].join("\n")},10235(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = boundedSampler(uMainSampler, texCoord);","}"].join("\n")},65980(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform float amount;","uniform vec4 color;","varying vec2 outTexCoord;","vec4 NORMAL (vec4 base, vec4 blend)","{"," return blend + base * (1.0 - blend.a);","}","vec4 ADD (vec4 base, vec4 blend)","{"," return base + blend;","}","vec4 MULTIPLY (vec4 base, vec4 blend)","{"," return base * blend;","}","vec4 SCREEN (vec4 base, vec4 blend)","{"," return 1.0 - (1.0 - base) * (1.0 - blend);","}","float overlayChannel (float base, float blend)","{"," return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 OVERLAY (vec4 base, vec4 blend)","{"," return vec4("," overlayChannel(base.r, blend.r),"," overlayChannel(base.g, blend.g),"," overlayChannel(base.b, blend.b),"," overlayChannel(base.a, blend.a)"," );","}","vec4 DARKEN (vec4 base, vec4 blend)","{"," return min(base, blend);","}","vec4 LIGHTEN (vec4 base, vec4 blend)","{"," return max(base, blend);","}","float dodgeChannel (float base, float blend)","{"," return blend == 1.0 ? blend : min(1.0, base / (1.0 - blend));","}","vec4 COLOR_DODGE (vec4 base, vec4 blend)","{"," return vec4("," dodgeChannel(base.r, blend.r),"," dodgeChannel(base.g, blend.g),"," dodgeChannel(base.b, blend.b),"," dodgeChannel(base.a, blend.a)"," );","}","float burnChannel (float base, float blend)","{"," return blend == 0.0 ? blend : 1.0 - min(1.0, (1.0 - base) / blend);","}","vec4 COLOR_BURN (vec4 base, vec4 blend)","{"," return vec4("," burnChannel(base.r, blend.r),"," burnChannel(base.g, blend.g),"," burnChannel(base.b, blend.b),"," burnChannel(base.a, blend.a)"," );","}","float hardLightChannel (float base, float blend)","{"," return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);","}","vec4 HARD_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," hardLightChannel(base.r, blend.r),"," hardLightChannel(base.g, blend.g),"," hardLightChannel(base.b, blend.b),"," hardLightChannel(base.a, blend.a)"," );","}","float softLightChannel (float base, float blend)","{"," return blend < 0.5 ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));","}","vec4 SOFT_LIGHT (vec4 base, vec4 blend)","{"," return vec4("," softLightChannel(base.r, blend.r),"," softLightChannel(base.g, blend.g),"," softLightChannel(base.b, blend.b),"," softLightChannel(base.a, blend.a)"," );","}","vec4 DIFFERENCE (vec4 base, vec4 blend)","{"," return abs(base - blend);","}","vec4 EXCLUSION (vec4 base, vec4 blend)","{"," return base + blend - 2.0 * base * blend;","}","vec3 rgbToHsl (vec3 color)","{"," vec3 hsl = vec3(0.0);"," float fmin = min(min(color.r, color.g), color.b);"," float fmax = max(max(color.r, color.g), color.b);"," float delta = fmax - fmin;"," hsl.z = (fmax + fmin) / 2.0;"," if (delta == 0.0)"," {"," hsl.x = 0.0;"," hsl.y = 0.0;"," }"," else"," {"," if (hsl.z < 0.5)"," {"," hsl.y = delta / (fmax + fmin);"," }"," else"," {"," hsl.y = delta / (2.0 - fmax - fmin);"," }"," float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;"," float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;"," float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;"," if (color.r == fmax)"," {"," hsl.x = deltaB - deltaG;"," }"," else if (color.g == fmax)"," {"," hsl.x = (1.0 / 3.0) + deltaR - deltaB;"," }"," else if (color.b == fmax)"," {"," hsl.x = (2.0 / 3.0) + deltaG - deltaR;"," }"," if (hsl.x < 0.0)"," {"," hsl.x += 1.0;"," }"," else if (hsl.x > 1.0)"," {"," hsl.x -= 1.0;"," }"," }"," return hsl;","}","vec3 hslToRgb (vec3 hsl)","{"," float p = hsl.z * (1.0 - hsl.y);"," float q = hsl.z * (1.0 - hsl.y * hsl.x);"," float t = hsl.z * (1.0 - hsl.y * (1.0 - hsl.x));"," if (hsl.x < 1.0 / 6.0)"," {"," return vec3(hsl.z, t, p);"," }"," else if (hsl.x < 0.5)"," {"," return vec3(q, hsl.z, p);"," }"," else if (hsl.x < 2.0 / 3.0)"," {"," return vec3(p, hsl.z, t);"," }"," return vec3(p, q, hsl.z);","}","vec4 HUE (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, baseHSL.y, baseHSL.z)), base.a);","}","vec4 SATURATION (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 COLOR (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(blendHSL.x, blendHSL.y, baseHSL.z)), base.a);","}","vec4 LUMINOSITY (vec4 base, vec4 blend)","{"," vec3 baseHSL = rgbToHsl(base.rgb);"," vec3 blendHSL = rgbToHsl(blend.rgb);"," return vec4(hslToRgb(vec3(baseHSL.x, baseHSL.y, blendHSL.z)), base.a);","}","vec4 ERASE (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 SOURCE_IN (vec4 base, vec4 blend)","{"," return blend * base.a;","}","vec4 SOURCE_OUT (vec4 base, vec4 blend)","{"," return blend * (1.0 - base.a);","}","vec4 SOURCE_ATOP (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * base.a;","}","vec4 DESTINATION_OVER (vec4 base, vec4 blend)","{"," return base + blend * (1.0 - base.a);","}","vec4 DESTINATION_IN (vec4 base, vec4 blend)","{"," return base * blend.a;","}","vec4 DESTINATION_OUT (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a);","}","vec4 DESTINATION_ATOP (vec4 base, vec4 blend)","{"," return base * blend.a + blend * (1.0 - base.a);","}","vec4 LIGHTER (vec4 base, vec4 blend)","{"," return ADD(base, blend);","}","vec4 COPY (vec4 base, vec4 blend)","{"," return blend;","}","vec4 XOR (vec4 base, vec4 blend)","{"," return base * (1.0 - blend.a) + blend * (1.0 - base.a);","}","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 base = boundedSampler(uMainSampler, outTexCoord);"," vec4 blend = boundedSampler(uMainSampler2, outTexCoord) * color;"," vec4 blended = BLEND(base, blend);"," gl_FragColor = mix(base, blended, amount);","}"].join("\n")},5899(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec4 uSizeAndOffset;","varying vec2 outTexCoord;","void main()","{"," vec2 gridCell = floor((outTexCoord * resolution + uSizeAndOffset.zw) / uSizeAndOffset.xy) * uSizeAndOffset.xy - uSizeAndOffset.zw;"," vec2 texCoord = gridCell / resolution;"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},20784(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.1964825501511404;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += boundedSampler(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += boundedSampler(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},65122(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.29411764705882354;"," col += boundedSampler(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += boundedSampler(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},60942(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += boundedSampler(uMainSampler, uv) * 0.2270270270;"," col += boundedSampler(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += boundedSampler(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += boundedSampler(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},43722(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","#pragma phaserTemplate(fragmentHeader)","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = boundedSampler(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},19883(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},32624(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uTransferSampler;","uniform float uColorMatrixSelf[20];","uniform float uColorMatrixTransfer[20];","uniform float uAlphaSelf;","uniform float uAlphaTransfer;","uniform vec4 uAdditions;","uniform vec4 uMultiplications;","varying vec2 outTexCoord;","#define S uColorMatrixSelf","#define T uColorMatrixTransfer","void main ()","{"," vec4 self = texture2D(uMainSampler, outTexCoord);"," if (uAlphaSelf == 0.0)"," {"," gl_FragColor = self;"," return;"," }"," if (self.a > 0.0)"," {"," self.rgb /= self.a;"," }"," vec4 resultSelf;"," resultSelf.r = (S[0] * self.r) + (S[1] * self.g) + (S[2] * self.b) + (S[3] * self.a) + S[4];"," resultSelf.g = (S[5] * self.r) + (S[6] * self.g) + (S[7] * self.b) + (S[8] * self.a) + S[9];"," resultSelf.b = (S[10] * self.r) + (S[11] * self.g) + (S[12] * self.b) + (S[13] * self.a) + S[14];"," resultSelf.a = (S[15] * self.r) + (S[16] * self.g) + (S[17] * self.b) + (S[18] * self.a) + S[19];"," if (uAlphaTransfer == 0.0)"," {"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," gl_FragColor = mix(self, resultSelf, uAlphaSelf);"," return;"," }"," vec4 tex = texture2D(uTransferSampler, outTexCoord);"," if (tex.a > 0.0)"," {"," tex.rgb /= tex.a;"," }"," vec4 resultTransfer;"," resultTransfer.r = (T[0] * tex.r) + (T[1] * tex.g) + (T[2] * tex.b) + (T[3] * tex.a) + T[4];"," resultTransfer.g = (T[5] * tex.r) + (T[6] * tex.g) + (T[7] * tex.b) + (T[8] * tex.a) + T[9];"," resultTransfer.b = (T[10] * tex.r) + (T[11] * tex.g) + (T[12] * tex.b) + (T[13] * tex.a) + T[14];"," resultTransfer.a = (T[15] * tex.r) + (T[16] * tex.g) + (T[17] * tex.b) + (T[18] * tex.a) + T[19];"," vec4 combo = (resultSelf + resultTransfer) * uAdditions + (resultSelf * resultTransfer) * uMultiplications;"," self.rgb *= self.a;"," resultSelf.rgb *= resultSelf.a;"," combo.rgb *= combo.a;"," gl_FragColor = mix(self, mix(resultSelf, combo, uAlphaTransfer), uAlphaSelf);","}"].join("\n")},12886(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rg) * amount;"," gl_FragColor = boundedSampler(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},33016(t){t.exports=["#pragma phaserTemplate(shaderName)","#define DISTANCE 10.0","#define QUALITY 10.0","#pragma phaserTemplate(fragmentDefine)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform float scale;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float MAX_ALPHA = DISTANCE * (DISTANCE + 1.0) * QUALITY / 2.0;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y) * scale;"," float totalAlpha = 0.0;"," float curAngle = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float curDistance = 0.0; curDistance < DISTANCE; curDistance++)"," {"," curAngle += fract(sin(dot(vec2(curDistance, outTexCoord.x + outTexCoord.y), vec2(12.9898, 78.233))) * 43758.5453);"," for (float i = 0.0; i < QUALITY; i++)"," {"," curAngle += PI * 2.0 / (QUALITY);"," direction = vec2(cos(curAngle), sin(curAngle)) * px;"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = boundedSampler(uMainSampler, displaced);"," totalAlpha += (DISTANCE - curDistance) * color.a;"," }"," }"," color = boundedSampler(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," if (knockout)"," {"," float resultAlpha = outerGlowStrength + innerGlowStrength;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},33179(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uColorFactor;","uniform bool uUnpremultiply;","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uUnpremultiply)"," {"," sample.rgb /= sample.a;"," }"," vec4 modulatedSample = sample * uColorFactor + uColor;"," float progress = modulatedSample.r + modulatedSample.g + modulatedSample.b + modulatedSample.a;"," vec4 rampColor = getRampAt(progress);"," rampColor.rgb *= rampColor.a;"," gl_FragColor = mix(sample, rampColor * sample.a, uAlpha);","}"].join("\n")},94526(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uEnvSampler;","uniform sampler2D uNormSampler;","uniform mat4 uViewMatrix;","uniform float uModelRotation;","uniform float uBulge;","uniform vec3 uColorFactor;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 normal = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normalN = normal * 2.0 - 1.0;"," float normalXYLength = length(normalN.xy);"," float angle = atan("," normalN.y,"," normalN.x"," ) - uModelRotation;"," normalN = vec3("," normalXYLength * cos(angle),"," normalXYLength * sin(angle),"," normalN.z"," );"," normalN = reflect(vec3(0.0, 0.0, -1.0), normalN);"," normalN = (uViewMatrix * vec4(normalN, 1.0)).xyz;"," float envX = atan(normalN.x, normalN.z) / PI;"," float envY = sin(normalN.y * PI / 2.0);"," vec2 uv = vec2(envX, envY) * 0.5 + 0.5;"," vec2 rotatedTexCoord = vec2("," cos(-uModelRotation) * outTexCoord.x - sin(-uModelRotation) * outTexCoord.y,"," sin(-uModelRotation) * outTexCoord.x + cos(- uModelRotation) * outTexCoord.y"," );"," uv += uBulge * (rotatedTexCoord - 0.5);"," if (uv.y < 0.0)"," {"," uv.y = abs(uv.y);"," uv.x += 0.5;"," }"," else if (uv.y > 1.0)"," {"," uv.y = 2.0 - uv.y;"," uv.x += 0.5;"," }"," vec3 environment = texture2D(uEnvSampler, uv).rgb;"," gl_FragColor = vec4(environment * color.rgb * uColorFactor, color.a);","}"].join("\n")},4488(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 uColor;","uniform vec4 uIsolateThresholdFeather;","varying vec2 outTexCoord;","void main()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec3 unpremultipliedColor = color.rgb / color.a;"," float isolate = uIsolateThresholdFeather.x;"," float threshold = uIsolateThresholdFeather.y;"," float feather = uIsolateThresholdFeather.z;"," float match = distance(unpremultipliedColor, uColor.rgb);"," match = clamp(match - threshold, 0.0, 1.0);"," match = clamp(match / feather, 0.0, 1.0);"," if (isolate == 1.0)"," {"," match = 1.0 - match;"," }"," match = mix(1.0, match, uColor.a);"," gl_FragColor = color * match;","}"].join("\n")},39603(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," vec4 mask = texture2D(uMaskSampler, outTexCoord);"," float a = mask.a;"," color *= invert ? (1.0 - a) : a;"," gl_FragColor = color;","}"].join("\n")},60047(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","#pragma phaserTemplate(fragmentHeader)","uniform sampler2D uMainSampler;","uniform mat4 uViewMatrix;","#ifdef FACING_POWER","uniform float uFacingPower;","#endif","#ifdef OUTPUT_RATIO","uniform vec3 uRatioVector;","uniform float uRatioRadius;","#endif","varying vec2 outTexCoord;","void main()","{"," vec3 normal = texture2D(uMainSampler, outTexCoord).rgb * 2.0 - 1.0;"," normal = (uViewMatrix * vec4(normal, 1.0)).xyz;"," #ifdef FACING_POWER"," normal = normalize(normal * vec3(1.0, 1.0, uFacingPower));"," #endif"," #ifdef OUTPUT_RATIO"," float ratio = dot(normal, normalize(uRatioVector));"," ratio = (ratio - 1.0 + uRatioRadius) / uRatioRadius;"," if (ratio <= 0.0)"," {"," ratio = 0.0;"," }"," normal = vec3(ratio * 2.0 - 1.0);"," #endif"," gl_FragColor = vec4((normal + 1.0) * 0.5, 1.0);","}"].join("\n")},7529(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uPower;","varying vec2 outTexCoord;","#define PI 3.14159265358979323846","#pragma phaserTemplate(fragmentHeader)","#define STEP_X 1.0 / SAMPLES_X","#define STEP_Y 1.0 / SAMPLES_Y","vec3 uvPanoramaNormal(vec2 uv)","{"," float y = uv.y * 2.0 - 1.0;"," float angle = (uv.x * 2.0 - 1.0) * PI;"," float x = sin(angle);"," float z = cos(angle);"," vec2 xz = vec2(x, z);"," xz *= sqrt(1.0 - y * y);"," return normalize(vec3(xz.x, y, xz.y));","}","void main()","{"," vec3 acc = vec3(0.0);"," float div = 0.0;"," vec3 texelNormal = uvPanoramaNormal(outTexCoord);"," for (float y = STEP_Y / 2.0; y < 1.0; y += STEP_Y)"," {"," float yWeight = cos((y * 2.0 - 1.0) * PI / 2.0);"," for (float x = STEP_X / 2.0; x < 1.0; x += STEP_X)"," {"," vec2 uv = vec2(x, y);"," vec3 sampleNormal = uvPanoramaNormal(uv);"," float dotProduct = dot(sampleNormal, texelNormal);"," dotProduct = (dotProduct - 1.0 + uRadius) / uRadius;"," if (dotProduct <= 0.0)"," {"," continue;"," }"," vec3 color = texture2D(uMainSampler, uv).rgb;"," color *= pow(length(color), uPower);"," acc += color * dotProduct * yWeight;"," div += dotProduct * yWeight;"," }"," }"," gl_FragColor = vec4(acc / div, 1.0);","}"].join("\n")},99191(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},88430(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","uniform sampler2D uMainSampler;","uniform vec4 uSteps;","uniform vec4 uGamma;","uniform vec4 uOffset;","uniform int uMode;","uniform bool uDither;","varying vec2 outTexCoord;","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 ditherIGN(vec4 value)","{"," value += fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5;"," return value;","}","void main ()","{"," vec4 sample = texture2D(uMainSampler, outTexCoord);"," if (uMode == 1)"," {"," sample = rgbaToHsva(sample);"," }"," sample = pow(sample, uGamma);"," sample -= uOffset;"," vec4 steps = max(uSteps - 1.0, 1.0);"," sample *= steps;"," if (uDither)"," {"," sample = ditherIGN(sample);"," }"," sample = ceil(sample - 0.5);"," sample /= steps;"," sample += uOffset;"," sample = pow(sample, 1.0 / uGamma);"," if (uMode == 1)"," {"," sample.x = mod(sample.x, 1.0);"," sample = hsvaToRgba(clamp(sample, 0.0, 1.0));"," }"," gl_FragColor = sample;","}"].join("\n")},69355(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 texture = boundedSampler(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += boundedSampler(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, clamp(shadow * mask, 0.0, 1.0));","}"].join("\n")},92636(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 edge1;","uniform vec4 edge2;","uniform vec4 invert;","varying vec2 outTexCoord;","void main ()","{"," vec4 color = texture2D(uMainSampler, outTexCoord);"," color = clamp((color - edge1) / (edge2 - edge1), 0.0, 1.0);"," color = mix(color, 1.0 - color, invert);"," gl_FragColor = color;","}"].join("\n")},18185(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uRadius;","uniform float uStrength;","uniform vec2 uPosition;","uniform vec4 uColor;","uniform int uBlendMode;","varying vec2 outTexCoord;","void main ()","{"," float vignette = 1.0;"," vec2 position = vec2(uPosition.x, 1.0 - uPosition.y);"," float d = length(outTexCoord - position);"," if (d <= uRadius)"," {"," float g = d / uRadius;"," vignette = sin(g * 3.14 * uStrength);"," }"," vec4 color = uColor;"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," if (uBlendMode == 1)"," {"," color.rgb = texture.rgb + color.rgb;"," }"," else if (uBlendMode == 2)"," {"," color.rgb = texture.rgb * color.rgb;"," }"," else if (uBlendMode == 3)"," {"," color.rgb = 1.0 - ((1.0 - texture.rgb) * (1.0 - color.rgb));"," }"," gl_FragColor = mix(texture, color, vignette);","}"].join("\n")},99174(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uMainSampler2;","uniform vec4 uProgress_WipeWidth_Direction_Axis;","uniform float uReveal;","varying vec2 outTexCoord;","void main ()","{"," vec4 color0;"," vec4 color1;"," if (uReveal == 0.0)"," {"," color0 = texture2D(uMainSampler, outTexCoord);"," color1 = texture2D(uMainSampler2, outTexCoord);"," }"," else"," {"," color0 = texture2D(uMainSampler2, outTexCoord);"," color1 = texture2D(uMainSampler, outTexCoord);"," }"," float distance = uProgress_WipeWidth_Direction_Axis.x;"," float width = uProgress_WipeWidth_Direction_Axis.y;"," float direction = uProgress_WipeWidth_Direction_Axis.z;"," float axis = outTexCoord.x;"," if (uProgress_WipeWidth_Direction_Axis.w == 1.0)"," {"," axis = outTexCoord.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},73416(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = outTint;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},91627(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec4 inTint;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = vec4(inTint.bgr * inTint.a, inTint.a);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84220(t){t.exports=["vec3 getNormalFromMap (vec2 texCoord)","{"," vec3 normalMap = texture2D(uNormSampler, texCoord).rgb;"," return normalize(outInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));","}"].join("\n")},2860(t){t.exports=["uniform vec2 uMainResolution[TEXTURE_COUNT];","vec2 getTexRes ()","{"," #if TEXTURE_COUNT == 1"," float texId = 0.0;"," #else"," float texId = outTexDatum;"," #endif"," #pragma phaserTemplate(texIdProcess)"," vec2 texRes = vec2(0.0);"," for (int i = 0; i < TEXTURE_COUNT; i++)"," {"," if (texId == float(i))"," {"," texRes = uMainResolution[i];"," break;"," }"," }"," return texRes;","}"].join("\n")},46432(t){t.exports=["uniform sampler2D uMainSampler[TEXTURE_COUNT];","vec4 getTexture (vec2 texCoord)","{"," #if TEXTURE_COUNT == 1"," return texture2D(uMainSampler[0], texCoord);"," #else"," if (outTexDatum == 0.0) return texture2D(uMainSampler[0], texCoord);"," #define ELSE_TEX_CASE(INDEX) else if (outTexDatum == float(INDEX)) return texture2D(uMainSampler[INDEX], texCoord);"," #pragma phaserTemplate(texIdProcess)"," else return vec4(0.0, 0.0, 0.0, 0.0);"," #endif","}"].join("\n")},41509(t){t.exports=["#pragma phaserTemplate(shaderName)","precision highp float;","#pragma phaserTemplate(fragmentHeader)","#define PI 3.14159265358979323846","uniform int uRepeatMode;","uniform float uOffset;","uniform int uShapeMode;","uniform vec2 uShape;","uniform vec2 uStart;","varying vec2 outTexCoord;","float linear()","{"," float len = length(uShape);"," return dot(uShape, outTexCoord - uStart) / len / len;","}","float bilinear()","{"," return abs(linear());","}","float radial()","{"," return distance(uStart, outTexCoord) / length(uShape);","}","float conicSymmetric()","{"," return dot(normalize(uShape), normalize(outTexCoord - uStart)) * 0.5 + 0.5;","}","float conicAsymmetric()","{"," vec2 fromStart = outTexCoord - uStart;"," float angleFromStart = atan(fromStart.y, fromStart.x);"," float shapeAngle = atan(uShape.y, uShape.x);"," float angle = (angleFromStart - shapeAngle) / PI / 2.0;"," if (angle < 0.0) angle += 1.0;"," return angle;","}","float repeat(float value)","{"," if (uRepeatMode == 1)"," {"," if (value < 0.0 || value > 1.0)"," {"," discard;"," }"," return value;"," }"," else if (uRepeatMode == 2)"," {"," return mod(value, 1.0);"," }"," else if (uRepeatMode == 3)"," {"," return 1.0 - abs(1.0 - mod(value, 2.0));"," }"," return clamp(value, 0.0, 1.0);","}","void main()","{"," float progress = 0.0;"," if (uShapeMode == 0)"," {"," progress = linear();"," }"," else if (uShapeMode == 1)"," {"," progress = bilinear();"," }"," else if (uShapeMode == 2)"," {"," progress = radial();"," }"," else if (uShapeMode == 3)"," {"," progress = conicSymmetric();"," }"," else if (uShapeMode == 4)"," {"," progress = conicAsymmetric();"," }"," progress -= uOffset;"," progress = repeat(progress);"," vec4 bandCol = getRampAt(progress);"," bandCol.rgb *= bandCol.a;"," gl_FragColor = bandCol;","}"].join("\n")},98840(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},44667(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexDatum;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexDatum;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTexDatum = inTexDatum;"," outTint = inTint;"," outTintEffect = inTintEffect;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},16421(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uOffset;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uPower;","uniform int uMode;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","void main ()","{"," float value = pow(trig(outTexCoord + uOffset), uPower);"," if (uMode == 0)"," {"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 1)"," {"," float valueR = pow(trig(outTexCoord + uOffset + 32.1), uPower);"," float valueG = pow(trig(outTexCoord + uOffset + 11.1), uPower);"," float valueB = pow(trig(outTexCoord + uOffset + 23.4), uPower);"," vec4 color = vec4(valueR, valueG, valueB, 1.);"," color *= mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," }"," else if (uMode == 2)"," {"," float valueAngle = pow(trig(outTexCoord + uOffset), uPower) * 3.141592;"," float x = value * cos(valueAngle);"," float y = value * sin(valueAngle);"," vec4 color = vec4("," x,"," y,"," sqrt(1. - x * x - y * y),"," 1.0"," );"," gl_FragColor = color * 0.5 + 0.5;"," }","}"].join("\n")},83587(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uCells;","uniform vec2 uPeriod;","uniform vec2 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec2 uSeed;","varying vec2 outTexCoord;","float psrdnoise(vec2 x, vec2 period, float alpha)","{"," vec2 uv = vec2(x.x+x.y*0.5, x.y);"," vec2 i0 = floor(uv), f0 = fract(uv);"," float cmp = step(f0.y, f0.x);"," vec2 o1 = vec2(cmp, 1.0-cmp);"," vec2 i1 = i0 + o1, i2 = i0 + 1.0;"," vec2 v0 = vec2(i0.x - i0.y*0.5, i0.y);"," vec2 v1 = vec2(v0.x + o1.x - o1.y*0.5, v0.y + o1.y);"," vec2 v2 = vec2(v0.x + 0.5, v0.y + 1.0);"," vec2 x0 = x - v0, x1 = x - v1, x2 = x - v2;"," vec3 iu, iv, xw, yw;"," if(any(greaterThan(period, vec2(0.0)))) {"," xw = vec3(v0.x, v1.x, v2.x); yw = vec3(v0.y, v1.y, v2.y);"," if(period.x > 0.0)"," xw = mod(vec3(v0.x, v1.x, v2.x), period.x);"," if(period.y > 0.0)"," yw = mod(vec3(v0.y, v1.y, v2.y), period.y);"," iu = floor(xw + 0.5*yw + 0.5); iv = floor(yw + 0.5);"," } else {"," iu = vec3(i0.x, i1.x, i2.x); iv = vec3(i0.y, i1.y, i2.y);"," }"," iu += uSeed.xxx; iv += uSeed.yyy;"," vec3 hash = mod(iu, 289.0);"," hash = mod((hash*51.0 + 2.0)*hash + iv, 289.0);"," hash = mod((hash*34.0 + 10.0)*hash, 289.0);"," vec3 psi = hash*0.07482 + alpha;"," vec3 gx = cos(psi); vec3 gy = sin(psi);"," vec2 g0 = vec2(gx.x, gy.x);"," vec2 g1 = vec2(gx.y, gy.y);"," vec2 g2 = vec2(gx.z, gy.z);"," vec3 w = 0.8 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2));"," w = max(w, 0.0); vec3 w2 = w*w; vec3 w4 = w2*w2;"," vec3 gdotx = vec3(dot(g0, x0), dot(g1, x1), dot(g2, x2));"," float n = dot(w4, gdotx);"," return 10.9*n;","}","float iterate (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec2 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec2 warp (vec2 coord)","{"," vec2 o2 = vec2(11.3, 23.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec2(coord1, coord2);","}","void main ()","{"," vec2 coord = outTexCoord * uCells + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},13460(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifndef ITERATION_COUNT","#define ITERATION_COUNT 1.0","#endif","#ifndef WARP_ITERATION_COUNT","#define WARP_ITERATION_COUNT 1.0","#endif","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uCells;","uniform vec3 uPeriod;","uniform vec3 uOffset;","uniform float uFlow;","uniform float uDetailPower;","uniform float uFlowPower;","uniform float uContributionPower;","uniform float uWarpDetailPower;","uniform float uWarpFlowPower;","uniform float uWarpContributionPower;","uniform float uWarpAmount;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","uniform float uNormalScale;","uniform float uValueFactor;","uniform float uValueAdd;","uniform float uValuePower;","uniform vec3 uSeed;","varying vec2 outTexCoord;","vec4 permute(vec4 i) {"," vec4 im = mod(i, 289.0);"," return mod(((im * 34.0) + 10.0) * im, 289.0);","}","float psrdnoise(vec3 x, vec3 period, float alpha) {"," const mat3 M = mat3(0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0);"," const mat3 Mi = mat3(-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5);"," vec3 uvw = M * x;"," vec3 i0 = floor(uvw);"," vec3 f0 = fract(uvw);"," vec3 g_ = step(f0.xyx, f0.yzz);"," vec3 l_ = 1.0 - g_;"," vec3 g = vec3(l_.z, g_.xy);"," vec3 l = vec3(l_.xy, g_.z);"," vec3 o1 = min(g, l);"," vec3 o2 = max(g, l);"," vec3 i1 = i0 + o1, i2 = i0 + o2, i3 = i0 + 1.0;"," vec3 v0 = Mi * i0, v1 = Mi * i1, v2 = Mi * i2, v3 = Mi * i3;"," vec3 x0 = x - v0, x1 = x - v1, x2 = x - v2, x3 = x - v3;"," if(any(greaterThan(period, vec3(0.0)))) {"," vec4 vx = vec4(v0.x, v1.x, v2.x, v3.x);"," vec4 vy = vec4(v0.y, v1.y, v2.y, v3.y);"," vec4 vz = vec4(v0.z, v1.z, v2.z, v3.z);"," if(period.x > 0.0)"," vx = mod(vx, period.x);"," if(period.y > 0.0)"," vy = mod(vy, period.y);"," if(period.z > 0.0)"," vz = mod(vz, period.z);"," i0 = floor(M * vec3(vx.x, vy.x, vz.x) + 0.5);"," i1 = floor(M * vec3(vx.y, vy.y, vz.y) + 0.5);"," i2 = floor(M * vec3(vx.z, vy.z, vz.z) + 0.5);"," i3 = floor(M * vec3(vx.w, vy.w, vz.w) + 0.5);"," }"," i0 += uSeed; i1 += uSeed; i2 += uSeed; i3 += uSeed;"," vec4 hash = permute(permute(permute(vec4(i0.z, i1.z, i2.z, i3.z)) + vec4(i0.y, i1.y, i2.y, i3.y)) + vec4(i0.x, i1.x, i2.x, i3.x));"," vec4 theta = hash * 3.883222077;"," vec4 sz = 0.996539792 - 0.006920415 * hash;"," vec4 psi = hash * 0.108705628;"," vec4 Ct = cos(theta);"," vec4 St = sin(theta);"," vec4 sz_prime = sqrt(1.0 - sz * sz);"," vec4 gx, gy, gz;"," if(alpha != 0.0) {"," vec4 px = Ct * sz_prime;"," vec4 py = St * sz_prime;"," vec4 pz = sz;"," vec4 Sp = sin(psi);"," vec4 Cp = cos(psi);"," vec4 Ctp = St * Sp - Ct * Cp;"," vec4 qx = mix(Ctp * St, Sp, sz);"," vec4 qy = mix(-Ctp * Ct, Cp, sz);"," vec4 qz = -(py * Cp + px * Sp);"," vec4 Sa = vec4(sin(alpha));"," vec4 Ca = vec4(cos(alpha));"," gx = Ca * px + Sa * qx;"," gy = Ca * py + Sa * qy;"," gz = Ca * pz + Sa * qz;"," } else {"," gx = Ct * sz_prime;"," gy = St * sz_prime;"," gz = sz;"," }"," vec3 g0 = vec3(gx.x, gy.x, gz.x), g1 = vec3(gx.y, gy.y, gz.y);"," vec3 g2 = vec3(gx.z, gy.z, gz.z), g3 = vec3(gx.w, gy.w, gz.w);"," vec4 w = 0.5 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3));"," w = max(w, 0.0);"," vec4 w2 = w * w;"," vec4 w3 = w2 * w;"," vec4 gdotx = vec4(dot(g0, x0), dot(g1, x1), dot(g2, x2), dot(g3, x3));"," float n = dot(w3, gdotx);"," return 39.5 * n;","}","float iterate (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","float iterateWarp (vec3 coord, float detailPower, float flowPower, float contributionPower)","{"," float value = 0.;"," float itValue = 0.;"," for (float iteration = 0.; iteration < WARP_ITERATION_COUNT; iteration++)"," {"," float detailScale = pow(detailPower, iteration);"," float flowScale = pow(flowPower, iteration);"," itValue = psrdnoise((coord + iteration) * detailScale, uPeriod * detailScale, uFlow * flowScale + iteration);"," value += itValue / pow(contributionPower, iteration);"," }"," return value;","}","vec3 warp (vec3 coord)","{"," vec3 o2 = vec3(11.3, 23.7, 13.1);"," vec3 o3 = vec3(29.9, 2.3, 31.7);"," float coord1 = iterateWarp(coord, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord2 = iterateWarp(coord + o2, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," float coord3 = iterateWarp(coord + o3, uWarpDetailPower, uWarpFlowPower, uWarpContributionPower);"," return vec3(coord1, coord2, coord3);","}","void main ()","{"," vec3 coord = (vec3(outTexCoord, 0.0) * uCells) + uOffset;"," if (uWarpAmount > 0.)"," {"," coord += warp(coord) * uWarpAmount;"," }"," float value = iterate(coord, uDetailPower, uFlowPower, uContributionPower) * uValueFactor + uValueAdd;"," value = pow(clamp(value, 0., 1.), uValuePower);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},17205(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec2 uSeedX;","uniform vec2 uSeedY;","uniform vec2 uCells;","uniform vec2 uCellOffset;","uniform vec2 uVariation;","uniform vec2 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec2 p)","{"," return fract(43757.5453*sin(dot(p, vec2(12.9898,78.233))));","}","vec2 bigCoord (vec2 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec2 hash2D (vec2 coord)","{"," return vec2("," trig(coord + uSeedX),"," trig(coord + uSeedY)"," ) * uVariation;","}","float worley2D (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley2DIndex (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley2DSmooth (vec2 uv, float scale)","{"," vec2 coord = bigCoord(uv, scale);"," vec2 point = floor(coord);"," vec2 frac = fract(coord);"," float value = 0.0;"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec2 cellNeighbor = vec2(i, j);"," vec2 jitter = hash2D(mod(point + cellNeighbor, uWrap * scale));"," vec2 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley2D (vec2 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley2D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley2DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley2DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," float value = iterateWorley2D(outTexCoord);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},79814(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec3 uSeedX;","uniform vec3 uSeedY;","uniform vec3 uSeedZ;","uniform vec3 uCells;","uniform vec3 uCellOffset;","uniform vec3 uVariation;","uniform vec3 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec3 p)","{"," return fract(43757.5453*sin(dot(p, vec3(12.9898,78.233, 9441.8953))));","}","vec3 bigCoord (vec3 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec3 hash3D (vec3 coord)","{"," return vec3("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ)"," ) * uVariation;","}","float worley3D (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley3DIndex (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float dist = 12.0;"," float random = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley3DSmooth (vec3 uv, float scale)","{"," vec3 coord = bigCoord(uv, scale);"," vec3 point = floor(coord);"," vec3 frac = fract(coord);"," float value = 0.0;"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec3 cellNeighbor = vec3(i, j, k);"," vec3 jitter = hash3D(mod(point + cellNeighbor, uWrap * scale));"," vec3 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley3D (vec3 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley3D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley3DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley3DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec3 uv = vec3(outTexCoord, 0.0);"," float value = iterateWorley3D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},99595(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(fragmentMode)","#pragma phaserTemplate(fragmentIterations)","#pragma phaserTemplate(fragmentNormalMap)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform vec4 uSeedX;","uniform vec4 uSeedY;","uniform vec4 uSeedZ;","uniform vec4 uSeedW;","uniform vec4 uCells;","uniform vec4 uCellOffset;","uniform vec4 uVariation;","uniform vec4 uWrap;","uniform float uSmoothing;","uniform float uNormalScale;","uniform vec4 uColorStart;","uniform vec4 uColorEnd;","varying vec2 outTexCoord;","float trig(vec4 p)","{"," return fract(43757.5453*sin(dot(p, vec4(12.9898,78.233,9441.8953,61.99))));","}","vec4 bigCoord (vec4 coord, float scale)","{"," return (coord + uCellOffset) * scale * uCells;","}","vec4 hash4D (vec4 coord)","{"," return vec4("," trig(coord + uSeedX),"," trig(coord + uSeedY),"," trig(coord + uSeedZ),"," trig(coord + uSeedW)"," ) * uVariation;","}","float worley4D (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," }"," }"," return sqrt(dist);","}","float worley4DIndex (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float dist = 16.0;"," float random = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = dot(diff, diff); // Squared length of diff."," if (d < dist)"," {"," dist = d;"," random = jitter.x;"," }"," }"," return random;","}","float worley4DSmooth (vec4 uv, float scale)","{"," vec4 coord = bigCoord(uv, scale);"," vec4 point = floor(coord);"," vec4 frac = fract(coord);"," float value = 0.0;"," for (float l = -1.0; l <= 1.0; l++)"," for (float k = -1.0; k <= 1.0; k++)"," for (float j = -1.0; j <= 1.0; j++)"," for (float i = -1.0; i <= 1.0; i++)"," {"," vec4 cellNeighbor = vec4(i, j, k, l);"," vec4 jitter = hash4D(mod(point + cellNeighbor, uWrap * scale));"," vec4 diff = cellNeighbor - frac + jitter;"," float d = length(diff);"," value += exp2(-32.0 / uSmoothing * d); // Accumulate fast-decaying exponential of length."," }"," return -(1.0 / 32.0 * uSmoothing) * log2(value);","}","float iterateWorley4D (vec4 uv)","{"," float value = 0.0;"," float itValue = 0.0;"," for (float iteration = 0.0; iteration < ITERATION_COUNT; iteration++)"," {"," float scale = exp2(iteration);"," #ifdef MODE_DISTANCE"," itValue = worley4D(uv + iteration, scale);"," #endif"," #ifdef MODE_INDEX"," itValue = worley4DIndex(uv + iteration, scale);"," #endif"," #ifdef MODE_DISTANCE_SMOOTH"," itValue = worley4DSmooth(uv + iteration, scale);"," #endif"," value += (itValue - 0.5) / scale;"," }"," return value + 0.5;","}","void main ()","{"," vec4 uv = vec4(outTexCoord, 0.0, 0.0);"," float value = iterateWorley4D(uv);"," #ifndef NORMAL_MAP"," vec4 color = mix(uColorStart, uColorEnd, value);"," color.rgb *= color.a;"," gl_FragColor = color;"," #else"," float dx = dFdx(value) * uNormalScale;"," float dy = dFdy(value) * uNormalScale;"," vec3 normal = vec3(dx, dy, 1.0 - sqrt(dx * dx + dy * dy)) * 0.5 + 0.5;"," gl_FragColor = vec4(normal, 1.0);"," #endif","}"].join("\n")},62807(t){t.exports=["float inverseRotation = -rotation - uCamera.z;","float irSine = sin(inverseRotation);","float irCosine = cos(inverseRotation);","outInverseRotationMatrix = mat3("," irCosine, irSine, 0.0,"," -irSine, irCosine, 0.0,"," 0.0, 0.0, 1.0",");"].join("\n")},4127(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","precision mediump float;","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},68589(t){t.exports=["#extension GL_OES_standard_derivatives : enable","#define BAND_TREE_DEPTH 0.0","uniform sampler2D uRampTexture;","uniform vec2 uRampResolution;","uniform float uRampBandStart;","uniform bool uDither;","float decodeNumberSample(vec4 sample)","{"," return ("," sample.r * 255.0 +"," sample.g * 255.0 * 256.0 +"," sample.b * 255.0 * 256.0 * 256.0 +"," sample.a * 255.0 * 256.0 * 256.0 * 256.0"," ) / 256.0 / 256.0;","}","struct Band","{"," vec4 colorStart;"," vec4 colorEnd;"," float start;"," float end;"," int colorSpace;"," int interpolation;"," float middle;","};","Band getBand(float progress)","{"," vec2 rampStep = 1.0 / uRampResolution;"," vec2 c = rampStep / 2.0;"," float start = decodeNumberSample(texture2D(uRampTexture, c));"," float end = decodeNumberSample(texture2D(uRampTexture, vec2(1.0, 0.0) * rampStep + c));"," float TREE_OFFSET = 2.0; // Beginning of tree block."," float index = 0.0;"," float x, y;"," for (float i = 0.0; i < BAND_TREE_DEPTH; i++)"," {"," x = mod(index + TREE_OFFSET, uRampResolution.x);"," y = floor(x / uRampResolution.x);"," float pivot = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," if (progress > pivot)"," {"," start = pivot;"," index = index * 2.0 + 2.0;"," }"," else"," {"," end = pivot;"," index = index * 2.0 + 1.0;"," }"," }"," float bandNumber = index - uRampBandStart + TREE_OFFSET;"," float bandIndex = bandNumber * 3.0 + uRampBandStart;"," x = mod(bandIndex, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorStart = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 1.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," vec4 colorEnd = texture2D(uRampTexture, vec2(x, y) * rampStep + c);"," x = mod(bandIndex + 2.0, uRampResolution.x);"," y = floor(bandIndex / uRampResolution.x);"," float bandData = decodeNumberSample(texture2D(uRampTexture, vec2(x, y) * rampStep + c));"," int colorSpace = int(floor(bandData / 255.0));"," int interpolation = int(floor(bandData)) - colorSpace * 255;"," return Band(colorStart, colorEnd, start, end, colorSpace, interpolation, fract(bandData) * 2.0);","}","float interpolate(float progress, int mode)","{"," if (mode == 1)"," {"," if ((progress *= 2.0) < 1.0)"," {"," return 0.5 * sqrt(1.0 - (--progress * progress));"," }"," progress = 1.0 - progress;"," return 1.0 - 0.5 * sqrt(1.0 - progress * progress);"," }"," if (mode == 2)"," {"," return sin((progress - 0.5) * 3.14159265358979323846) * 0.5 + 0.5;"," }"," if (mode == 3)"," {"," return sqrt(1.0 - (--progress * progress));"," }"," if (mode == 4)"," {"," return 1.0 - sqrt(1.0 - progress * progress);"," }"," return progress;","}","float ditherIGN(float value)","{"," float dx = dFdx(value);"," float dy = dFdy(value);"," float rateOfChange = sqrt(dx * dx + dy * dy);"," value += (fract(52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y)) - 0.5) * rateOfChange;"," return value;","}","vec4 rgbaToHsva(vec4 rgba)","{"," float r = rgba.r;"," float g = rgba.g;"," float b = rgba.b;"," float a = rgba.a;"," float min = min(min(r, g), b);"," float max = max(max(r, g), b);"," float d = max - min;"," float h = 0.0;"," float s = (max == 0.0) ? 0.0 : d / max;"," float v = max;"," if (max != min)"," {"," if (max == r)"," {"," h = (g - b) / d + ((g < b) ? 6.0 : 0.0);"," }"," else if (max == g)"," {"," h = (b - r) / d + 2.0;"," }"," else"," {"," h = (r - g) / d + 4.0;"," }"," h /= 6.0;"," }"," return vec4(h, s, v, a);","}","float hsvaToRgbaConvert(float n, vec4 hsva)","{"," float k = mod(n + hsva.x * 6.0, 6.0);"," float min = min(min(k, 4.0 - k), 1.0);"," return hsva.z - hsva.z * hsva.y * max(0.0, min);","}","vec4 hsvaToRgba(vec4 hsva)","{"," return vec4("," hsvaToRgbaConvert(5.0, hsva),"," hsvaToRgbaConvert(3.0, hsva),"," hsvaToRgbaConvert(1.0, hsva),"," hsva.a"," );","}","vec4 mixBandColor(float progress, Band band)","{"," if (band.colorSpace == 0)"," {"," return mix(band.colorStart, band.colorEnd, progress);"," }"," vec4 hsvaStart = rgbaToHsva(band.colorStart);"," vec4 hsvaEnd = rgbaToHsva(band.colorEnd);"," if (band.colorSpace == 1)"," {"," float dH = hsvaStart.x - hsvaEnd.x;"," if (dH > 0.5)"," {"," hsvaStart.x -= 1.0;"," }"," else if (dH < -0.5)"," {"," hsvaStart.x += 1.0;"," }"," }"," else if (band.colorSpace == 2)"," {"," if (hsvaStart.x > hsvaEnd.x)"," {"," hsvaStart.x -= 1.0;"," }"," }"," else if (band.colorSpace == 3)"," {"," if (hsvaStart.x < hsvaEnd.x)"," {"," hsvaStart.x += 1.0;"," }"," }"," vec4 hsvaMix = mix(hsvaStart, hsvaEnd, progress);"," hsvaMix.x = mod(hsvaMix.x, 1.0);"," return hsvaToRgba(hsvaMix);","}","vec4 getRampAt(float progress)","{"," Band band = getBand(progress);"," float bandProgress = (progress - band.start) / (band.end - band.start);"," float gamma = log(0.5) / log(band.middle);"," bandProgress = pow(bandProgress, gamma);"," bandProgress = interpolate(bandProgress, band.interpolation);"," if (uDither)"," {"," bandProgress = ditherIGN(bandProgress);"," }"," return mixBandColor(bandProgress, band);","}"].join("\n")},72823(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," vec4 fragColor = vec4(outTexCoord.xyx, 1.0);"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},65884(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},2807(t){t.exports=["#pragma phaserTemplate(shaderName)","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},49119(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(fragmentHeader)","void main ()","{"," #pragma phaserTemplate(fragmentProcess)"," gl_FragColor = fragColor;","}"].join("\n")},3524(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#define ROUND_BIAS 0.5001","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform mat3 uViewMatrix;","uniform vec3 uCameraScrollAndAlpha;","uniform int uRoundPixels;","uniform vec2 uResolution;","uniform float uTime;","uniform vec2 uDiffuseResolution;","uniform vec2 uFrameDataResolution;","uniform sampler2D uFrameDataTexture;","uniform float uGravity;","attribute float inVertex;","attribute vec4 inPositionX;","attribute vec4 inPositionY;","attribute vec4 inRotation;","attribute vec4 inScaleX;","attribute vec4 inScaleY;","attribute vec4 inAlpha;","attribute vec4 inFrame;","attribute vec4 inTintBlend;","attribute vec4 inTintTL;","attribute vec4 inTintTR;","attribute vec4 inTintBL;","attribute vec4 inTintBR;","attribute vec4 inOriginAndTintModeAndCreationTime;","attribute vec2 inScrollFactor;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","const float PI = 3.14159265359;","const float HALF_PI = PI / 2.0;","const float BOUNCE_OVERSHOOT = 1.70158;","const float BOUNCE_OVERSHOOT_PLUS = BOUNCE_OVERSHOOT + 1.0;","const float BOUNCE_OVERSHOOT_IN_OUT = BOUNCE_OVERSHOOT * 1.525;","const float BOUNCE_OVERSHOOT_IN_OUT_PLUS = BOUNCE_OVERSHOOT_IN_OUT + 1.0;","float animate (vec4 anim)","{"," float value = anim.x;"," float a = anim.y;"," float b = abs(anim.z);"," float c = abs(anim.w);"," bool yoyo = anim.z < 0.0;"," bool loop = anim.w > 0.0;"," int type = int(floor(c));"," if (type == 0|| b == 0.0)"," {"," return value;"," }"," float duration = b;"," float delay = mod(c, 1.0) * 2.0;"," float rawTime = ((uTime - inOriginAndTintModeAndCreationTime.w) / duration) - delay;"," float time = mod(rawTime, 1.0);"," if (yoyo && (mod(rawTime, 2.0) >= 1.0))"," {"," time = 1.0 - time;"," }"," float repeats = loop ? 0.0 : floor(a);"," float timeContinuous = loop ? time : rawTime;"," #ifdef FEATURE_LINEAR"," if (type == 1)"," {"," return value + a * timeContinuous;"," }"," #endif"," #ifdef FEATURE_GRAVITY"," if (type == 2)"," {"," float v = floor(a);"," float gravityFactor = (a - v) * 2.0 - 1.0;"," if (gravityFactor == 0.0)"," {"," gravityFactor = 1.0;"," }"," float seconds = timeContinuous * duration / 1000.0;"," float accel = uGravity * gravityFactor;"," return value + (v * seconds) + (0.5 * accel * seconds * seconds);"," }"," #endif"," #ifdef FEATURE_QUAD_EASEOUT"," if (type == 10)"," {"," return value + a * time * (2.0 - time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEIN"," if (type == 11)"," {"," return value + a * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUAD_EASEINOUT"," if (type == 12)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * 0.5"," + repeats * a;"," }"," time -= 1.0;"," return value + a * -0.5 * (time * (time - 2.0) - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEOUT"," if (type == 20)"," {"," time -= 1.0;"," return value + a * (time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEIN"," if (type == 21)"," {"," return value + a * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CUBIC_EASEINOUT"," if (type == 22)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEOUT"," if (type == 30)"," {"," time -= 1.0;"," return value + a * (1.0 - time * time * time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEIN"," if (type == 31)"," {"," return value + a * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUART_EASEINOUT"," if (type == 32)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * -0.5 * (time * time * time * time - 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEOUT"," if (type == 40)"," {"," time -= 1.0;"," return value + a * (time * time * time * time * time + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEIN"," if (type == 41)"," {"," return value + a * time * time * time * time * time"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_QUINT_EASEINOUT"," if (type == 42)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * time * time * time * time * time * 0.5"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * time * time * time + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEOUT"," if (type == 50)"," {"," return value + a * sin(time * HALF_PI)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEIN"," if (type == 51)"," {"," return value + a * (1.0 - cos(time * HALF_PI))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SINE_EASEINOUT"," if (type == 52)"," {"," return value + a * 0.5 * (1.0 - cos(PI * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEOUT"," if (type == 60)"," {"," return value + a * (1.0 - pow(2.0, -10.0 * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEIN"," if (type == 61)"," {"," return value + a * pow(2.0, 10.0 * (time - 1.0) - 0.001)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_EXPO_EASEINOUT"," if (type == 62)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * pow(2.0, 10.0 * (time - 1.0))"," + repeats * a;"," }"," time -= 1.0;"," return value + a * 0.5 * (2.0 - pow(2.0, -10.0 * (time - 1.0)))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEOUT"," if (type == 70)"," {"," time -= 1.0;"," return value + a * sqrt(1.0 - time * time)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEIN"," if (type == 71)"," {"," return value + a * (1.0 - sqrt(1.0 - time * time))"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_CIRC_EASEINOUT"," if (type == 72)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * -0.5 * (sqrt(1.0 - time * time) - 1.0)"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (sqrt(1.0 - time * time) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEOUT"," if (type == 90)"," {"," time -= 1.0;"," return value + a * (time * time * (BOUNCE_OVERSHOOT_PLUS * time + BOUNCE_OVERSHOOT) + 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEIN"," if (type == 91)"," {"," return value + a * time * time * (BOUNCE_OVERSHOOT_PLUS * time - BOUNCE_OVERSHOOT)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BACK_EASEINOUT"," if (type == 92)"," {"," time *= 2.0;"," if (time < 1.0)"," {"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time - BOUNCE_OVERSHOOT_IN_OUT))"," + repeats * a;"," }"," time -= 2.0;"," return value + a * 0.5 * (time * time * (BOUNCE_OVERSHOOT_IN_OUT_PLUS * time + BOUNCE_OVERSHOOT_IN_OUT) + 2.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEOUT"," if (type == 100)"," {"," if (time < 1.0 / 2.75)"," {"," return value + a * (7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (7.5625 * time * time + 0.75)"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (7.5625 * time * time + 0.9375)"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (7.5625 * time * time + 0.984375)"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEIN"," if (type == 101)"," {"," time = 1.0 - time;"," if (time < 1.0 / 2.75)"," {"," return value + a * (1.0 - 7.5625 * time * time)"," + repeats * a;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.75))"," + repeats * a;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.9375))"," + repeats * a;"," }"," else"," {"," time -= 2.625 / 2.75;"," return value + a * (1.0 - (7.5625 * time * time + 0.984375))"," + repeats * a;"," }"," }"," #endif"," #ifdef FEATURE_BOUNCE_EASEINOUT"," if (type == 102)"," {"," bool reverse = false;"," if (time < 0.5)"," {"," time = 1.0 - time * 2.0;"," reverse = true;"," }"," if (time < 1.0 / 2.75)"," {"," time = 7.5625 * time * time;"," }"," else if (time < 2.0 / 2.75)"," {"," time -= 1.5 / 2.75;"," time = 7.5625 * time * time + 0.75;"," }"," else if (time < 2.5 / 2.75)"," {"," time -= 2.25 / 2.75;"," time = 7.5625 * time * time + 0.9375;"," }"," else"," {"," time -= 2.625 / 2.75;"," time = 7.5625 * time * time + 0.984375;"," }"," if (reverse)"," {"," return value + a * (1.0 - time) * 0.5"," + repeats * a;"," }"," return value + a * time * 0.5 + 0.5"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_STEPPED"," if (type == 110)"," {"," return value + a * floor(time + 0.5)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEOUT"," if (type == 120)"," {"," return value + a * (smoothstep(0.0, 1.0, time / 2.0 + 0.5) * 2.0 - 1.0)"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEIN"," if (type == 121)"," {"," return value + a * smoothstep(0.0, 1.0, time / 2.0) * 2.0"," + repeats * a;"," }"," #endif"," #ifdef FEATURE_SMOOTHSTEP_EASEINOUT"," if (type == 122)"," {"," return value + a * smoothstep(0.0, 1.0, time)"," + repeats * a;"," }"," #endif"," return value;","}","struct Frame {"," vec2 position;"," vec2 size;"," vec2 offset;","};","Frame getFrame (float frame)","{"," float index1 = floor(frame) * 3.0;"," float index2 = index1 + 1.0;"," float index3 = index1 + 2.0;"," float width = uFrameDataResolution.x;"," float x = mod(index1, width);"," float y = floor(index1 / width);"," vec4 texelUV = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index2, width);"," y = floor(index2 / width);"," vec4 texelWH = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," x = mod(index3, width);"," y = floor(index3 / width);"," vec4 texelOrigin = texture2D("," uFrameDataTexture,"," vec2(x + 0.5, y + 0.5) / uFrameDataResolution"," );"," return Frame("," vec2("," texelUV.r + texelUV.g * 256.0,"," texelUV.b + texelUV.a * 256.0"," ) * 255.0,"," vec2("," texelWH.r + texelWH.g * 256.0,"," texelWH.b + texelWH.a * 256.0"," ) * 255.0,"," vec2("," texelOrigin.r + texelOrigin.g * 256.0,"," texelOrigin.b + texelOrigin.a * 256.0"," ) * 255.0 - 32768.0"," );","}","void main ()","{"," float positionX = animate(inPositionX);"," float positionY = animate(inPositionY);"," float rotation = animate(inRotation);"," float scaleX = animate(inScaleX);"," float scaleY = animate(inScaleY);"," float frame = animate(inFrame);"," float tintBlend = animate(inTintBlend);"," float alpha = animate(inAlpha);"," vec2 origin = inOriginAndTintModeAndCreationTime.xy;"," float tintMode = inOriginAndTintModeAndCreationTime.z;"," float scrollFactorX = inScrollFactor.x;"," float scrollFactorY = inScrollFactor.y;"," Frame frameData = getFrame(frame);"," vec2 uv = frameData.position / uDiffuseResolution;"," vec2 wh = frameData.size / uDiffuseResolution;"," float u = uv.s;"," float v = uv.t;"," float w = wh.s;"," float h = wh.t;"," float width = frameData.size.s;"," float height = frameData.size.t;"," vec4 tint = inTintTL;"," float x = -origin.x;"," float y = -origin.y;"," if (inVertex == 0.0)"," {"," y = 1.0 - origin.y;"," v += h;"," tint = inTintBL;"," }"," else if (inVertex == 2.0)"," {"," x = 1.0 - origin.x;"," y = 1.0 - origin.y;"," u += w;"," v += h;"," tint = inTintBR;"," }"," else if (inVertex == 3.0)"," {"," x = 1.0 - origin.x;"," u += w;"," tint = inTintTR;"," }"," vec3 position = vec3("," (x * width - frameData.offset.x) * scaleX,"," (y * height - frameData.offset.y) * scaleY,"," 1.0"," );"," mat3 viewMatrix = uViewMatrix * mat3("," 1.0, 0.0, 0.0,"," 0.0, 1.0, 0.0,"," uCameraScrollAndAlpha.x * (1.0 - scrollFactorX), uCameraScrollAndAlpha.y * (1.0 - scrollFactorY), 1.0"," );"," float sine = sin(rotation);"," float cosine = cos(rotation);"," mat3 transformMatrix = mat3("," cosine, sine, 0.0,"," -sine, cosine, 0.0,"," positionX, positionY, 1.0"," );"," position = viewMatrix * transformMatrix * position;"," alpha *= uCameraScrollAndAlpha.z;"," tint.a *= alpha;"," if (uRoundPixels == 1 && rotation == 0.0 && scaleX == 1.0 && scaleY == 1.0)"," {"," position.xy = floor(position.xy + ROUND_BIAS);"," }"," gl_Position = uProjectionMatrix * vec4(position.xy, 1.0, 1.0);"," outTexCoord = vec2(u, 1.0 - v);"," outTint = mix(vec4(1.0, 1.0, 1.0, tint.a), tint, tintBlend);"," outTintEffect = tintMode;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},57532(t){t.exports=["#version 100","#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","/* Redefine MAX_ANIM_FRAMES to support animations with different frame numbers. */","#define MAX_ANIM_FRAMES 0","#pragma phaserTemplate(fragmentDefine)","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uLayerSampler;","uniform vec2 uMainResolution;","uniform vec2 uLayerResolution;","uniform float uTileColumns;","uniform vec4 uTileWidthHeightMarginSpacing;","uniform float uAlpha;","uniform float uTime;","#if MAX_ANIM_FRAMES > 0","uniform sampler2D uAnimSampler;","uniform vec2 uAnimResolution;","#endif","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","vec2 getTexRes ()","{"," return uMainResolution;","}","float floatTexel (vec4 texel)","{"," return texel.r * 255.0 + (texel.g * 255.0 * 256.0) + (texel.b * 255.0 * 256.0 * 256.0) + (texel.a * 255.0 * 256.0 * 256.0 * 256.0);","}","struct Tile","{"," float index;"," vec2 uv; // In texels."," #if MAX_ANIM_FRAMES > 0"," bool animated;"," #endif"," bool empty;","};","Tile getLayerData (vec2 coord)","{"," vec2 texelCoord = coord * uLayerResolution;"," vec2 tile = floor(texelCoord);"," vec2 uv = fract(texelCoord);"," uv.y = 1.0 - uv.y;"," vec4 texel = texture2D(uLayerSampler, (tile + 0.5) / uLayerResolution) * 255.0;"," float flags = texel.a;"," /* Check for empty tile flag in bit 28. */"," if (flags == 16.0)"," {"," return Tile("," 0.0,"," vec2(0.0),"," #if MAX_ANIM_FRAMES > 0"," false,"," #endif"," true"," );"," }"," /* Bit 31 is flipX. */"," bool flipX = flags > 127.0;"," /* Bit 30 is flipY. */"," bool flipY = mod(flags, 128.0) > 63.0;"," #if MAX_ANIM_FRAMES > 0"," /* Bit 29 is animation. */"," bool animated = mod(flags, 64.0) > 31.0;"," #endif"," if (flipX)"," {"," uv.x = 1.0 - uv.x;"," }"," if (flipY)"," {"," uv.y = 1.0 - uv.y;"," }"," float index = texel.r + (texel.g * 256.0) + (texel.b * 256.0 * 256.0);"," return Tile("," index,"," uv * uTileWidthHeightMarginSpacing.xy,"," #if MAX_ANIM_FRAMES > 0"," animated,"," #endif"," false"," );","}","vec2 getFrameCorner (float index)","{"," float x = mod(index, uTileColumns);"," float y = floor(index / uTileColumns);"," vec2 xy = vec2(x, y);"," return xy * outTileStride + uTileWidthHeightMarginSpacing.zz;","}","#if MAX_ANIM_FRAMES > 0","float animationIndex (float index)","{"," float animTextureWidth = uAnimResolution.x;"," vec2 index2D = vec2(mod(index, animTextureWidth), floor(index / animTextureWidth));"," vec4 animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," index2D = vec2(mod(index + 1.0, animTextureWidth), floor((index + 1.0) / animTextureWidth));"," vec4 animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animDuration = floatTexel(animDurationTexel);"," float animIndex = floatTexel(animIndexTexel);"," float animTime = mod(uTime, animDuration);"," float animTimeAccum = 0.0;"," for (int i = 0; i < MAX_ANIM_FRAMES; i++)"," {"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animDurationTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float frameDuration = floatTexel(animDurationTexel);"," animTimeAccum += frameDuration;"," if (animTime <= animTimeAccum)"," {"," break;"," }"," animIndex += 2.0;"," }"," animIndex += 1.0;"," index2D = vec2(mod(animIndex, animTextureWidth), floor(animIndex / animTextureWidth));"," animIndexTexel = texture2D(uAnimSampler, (index2D + 0.5) / uAnimResolution);"," float animFrameIndex = floatTexel(animIndexTexel);"," return animFrameIndex;","}","#endif","vec2 getTileTexelCoord (Tile tile)","{"," if (tile.empty)"," {"," return vec2(0.0);"," }"," float index = tile.index;"," #if MAX_ANIM_FRAMES > 0"," if (tile.animated)"," {"," index = animationIndex(index);"," }"," #endif"," vec2 frameCorner = getFrameCorner(index);"," return frameCorner + tile.uv;","}","#pragma phaserTemplate(fragmentHeader)","struct Samples {"," vec4 color;"," #pragma phaserTemplate(defineSamples)","};","Samples getColorSamples (vec2 texCoord)","{"," Samples samples;"," samples.color = texture2D("," uMainSampler,"," vec2(texCoord.x, 1.0 - texCoord.y)"," );"," #pragma phaserTemplate(getSamples)"," return samples;","}","Samples mixSamples (Samples samples1, Samples samples2, float alpha)","{"," Samples samples;"," samples.color = mix(samples1.color, samples2.color, alpha);"," #pragma phaserTemplate(mixSamples)"," return samples;","}","Samples getFinalSamples (Tile tile, vec2 layerTexCoord)","{"," vec2 texelCoord = getTileTexelCoord(tile);"," vec2 texCoord = texelCoord / uMainResolution;"," #pragma phaserTemplate(texCoord)"," #ifndef FEATURE_BORDERFILTER"," return getColorSamples(texCoord);"," #else"," #pragma phaserTemplate(finalSamples)"," vec2 wh = uTileWidthHeightMarginSpacing.xy;"," vec2 frameCorner = getFrameCorner(tile.index);"," vec2 frameCornerOpposite = frameCorner + wh;"," vec2 texCoordClamped = clamp(texCoord, (frameCorner + 0.5) / uMainResolution, (frameCornerOpposite - 0.5) / uMainResolution);"," vec2 dTexelCoord = (texCoord - texCoordClamped) * uMainResolution;"," dTexelCoord.y = -dTexelCoord.y;"," vec2 offsets = sign(dTexelCoord);"," Samples samples0 = getColorSamples(texCoordClamped);"," if (offsets.x == 0.0)"," {"," if (offsets.y == 0.0)"," {"," return samples0;"," }"," Tile tileY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," return mixSamples(samples0, samplesY, abs(dTexelCoord.y));"," }"," else"," {"," if (offsets.y == 0.0)"," {"," Tile tileX = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," return mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," }"," Tile tileX = getLayerData(layerTexCoord + (offsets * vec2(1.0, 0.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordX = getTileTexelCoord(tileX);"," vec2 texCoordX = texelCoordX / uMainResolution;"," Samples samplesX = getColorSamples(texCoordX);"," Tile tileY = getLayerData(layerTexCoord + (offsets * vec2(0.0, 1.0) - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordY = getTileTexelCoord(tileY);"," vec2 texCoordY = texelCoordY / uMainResolution;"," Samples samplesY = getColorSamples(texCoordY);"," Tile tileXY = getLayerData(layerTexCoord + (offsets - dTexelCoord) / wh / uLayerResolution);"," vec2 texelCoordXY = getTileTexelCoord(tileXY);"," vec2 texCoordXY = texelCoordXY / uMainResolution;"," Samples samplesXY = getColorSamples(texCoordXY);"," Samples samples1 = mixSamples(samples0, samplesX, abs(dTexelCoord.x));"," Samples samples2 = mixSamples(samplesY, samplesXY, abs(dTexelCoord.x));"," return mixSamples(samples1, samples2, abs(dTexelCoord.y));"," }"," #endif","}","void main ()","{"," vec2 layerTexCoord = outTexCoord;"," Tile tile = getLayerData(layerTexCoord);"," Samples samples = getFinalSamples(tile, layerTexCoord);"," vec4 fragColor = samples.color;"," #pragma phaserTemplate(declareSamples)"," #pragma phaserTemplate(fragmentProcess)"," fragColor *= uAlpha;"," gl_FragColor = fragColor;","}"].join("\n")},23879(t){t.exports=["#pragma phaserTemplate(shaderName)","#pragma phaserTemplate(extensions)","#pragma phaserTemplate(features)","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","#pragma phaserTemplate(vertexDefine)","uniform mat4 uProjectionMatrix;","uniform vec2 uResolution;","uniform vec4 uTileWidthHeightMarginSpacing;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outTexCoord;","varying vec2 outTileStride;","#pragma phaserTemplate(outVariables)","#pragma phaserTemplate(vertexHeader)","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTileStride = uTileWidthHeightMarginSpacing.xy + uTileWidthHeightMarginSpacing.zz;"," #pragma phaserTemplate(vertexProcess)","}"].join("\n")},84639(t){t.exports=function(t,e){return{name:t+"Anims",additions:{fragmentDefine:"#undef MAX_ANIM_FRAMES\n#define MAX_ANIM_FRAMES "+t},tags:["MAXANIMS"],disable:!!e}}},81084(t,e,i){var r=i(84547);t.exports=function(t){return{name:"ApplyLighting",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyLighting(fragColor, normal);"},tags:["LIGHTING"],disable:!!t}}},44349(t,e,i){var r=i(11104);t.exports=function(t){return{name:"Tint",additions:{fragmentHeader:r,fragmentProcess:"fragColor = applyTint(fragColor);"},tags:["TINT"],disable:!!t}}},99501(t,e,i){var r=i(81556);t.exports=function(t){return{name:"BoundedSampler",additions:{fragmentHeader:r},disable:!!t}}},6184(t,e,i){var r=i(11719);t.exports=function(t){return{name:"DefineLights",additions:{fragmentDefine:"#define LIGHT_COUNT 1",fragmentHeader:r},tags:["LIGHTING"],disable:!!t}}},11653(t){t.exports=function(t,e){return{name:t+"TexCount",additions:{fragmentDefine:"#define TEXTURE_COUNT "+t},tags:["TexCount"],disable:!!e}}},13198(t){t.exports=function(t){return{name:"FlatNormal",additions:{fragmentProcess:"vec3 normal = vec3(0.0, 0.0, 1.0);"},tags:["LIGHTING"],disable:!!t}}},40829(t,e,i){var r=i(84220);t.exports=function(t){return{name:"NormalMap",additions:{fragmentHeader:r,fragmentProcess:"vec3 normal = getNormalFromMap(texCoord);"},tags:["LIGHTING"],disable:!!t}}},42792(t){t.exports=function(t){return{name:"TexCoordOut",additions:{fragmentProcess:"vec2 texCoord = outTexCoord;\n#pragma phaserTemplate(texCoord)"},tags:["TEXCOORD"],disable:!!t}}},96049(t,e,i){var r=i(2860);t.exports=function(t){return{name:"GetTexRes",additions:{fragmentHeader:r},tags:["TEXRES"],disable:!!t}}},33997(t,e,i){var r=i(46432);t.exports=function(t,e){void 0===t&&(t=1);for(var i="",s=1;s<t;s++)i+="ELSE_TEX_CASE("+s+")\n";return{name:"GetTexture"+t,additions:{fragmentHeader:r.replace("#pragma phaserTemplate(texIdProcess)",i),fragmentProcess:"vec4 fragColor = getTexture(texCoord);"},tags:["TEXTURE"],disable:!!e}}},10455(t){t.exports=function(t){return{name:"OutFrame",additions:{vertexHeader:"attribute vec4 inFrame;",vertexProcess:"outFrame = inFrame;",outVariables:"varying vec4 outFrame;"},disable:!!t}}},79532(t,e,i){var r=i(62807);t.exports=function(t){return{name:"OutInverseRotation",additions:{vertexHeader:"uniform vec4 uCamera;",vertexProcess:r,outVariables:"varying mat3 outInverseRotationMatrix;"},tags:["LIGHTING"],disable:!!t}}},65217(t){t.exports=function(t){return{name:"RotDatum",additions:{vertexProcess:"float rotation = inTexDatum;"},tags:["LIGHTING"],disable:!!t}}},747(t){t.exports=function(t){return{name:"SampleNormal",additions:{defineSamples:"vec4 normal;",getSamples:"samples.normal = texture2D(uNormSampler, texCoord);",mixSamples:"samples.normal = mix(samples1.normal, samples2.normal, alpha);",declareSamples:"vec3 normal = normalize(samples.normal.rgb * 2.0 - 1.0);"},tags:["LIGHTING"],disable:!!t}}},74505(t,e,i){var r=i(78390);t.exports=function(t){return{name:"SmoothPixelArt",additions:{extensions:"#extension GL_OES_standard_derivatives : enable",fragmentHeader:r,texCoord:"texCoord = getBlockyTexCoord(texCoord, getTexRes());"},disable:!!t}}},44832(t,e,i){var r=i(14030);t.exports=function(t){return{name:"TexCoordFrameClamp",additions:{fragmentHeader:r,texCoord:"texCoord = clampTexCoordWithinFrame(texCoord);"},disable:!!t}}},23295(t){t.exports=function(t){return{name:"TexCoordFrameWrap",additions:{texCoord:"// Wrap texture coordinate into the UV space of the texture frame.\ntexCoord = mod(texCoord, 1.0) * outFrame.zw + outFrame.xy;"},disable:!!t}}},83786(t,e,i){t.exports={MakeAnimLength:i(84639),MakeApplyLighting:i(81084),MakeApplyTint:i(44349),MakeBoundedSampler:i(99501),MakeDefineLights:i(6184),MakeDefineTexCount:i(11653),MakeFlatNormal:i(13198),MakeGetNormalFromMap:i(40829),MakeGetTexCoordOut:i(42792),MakeGetTexRes:i(96049),MakeGetTexture:i(33997),MakeOutFrame:i(10455),MakeOutInverseRotation:i(79532),MakeRotationDatum:i(65217),MakeSampleNormal:i(747),MakeSmoothPixelArt:i(74505),MakeTexCoordFrameClamp:i(44832),MakeTexCoordFrameWrap:i(23295)}},89350(t,e,i){t.exports={ApplyLighting:i(84547),ApplyTint:i(11104),BoundedSampler:i(81556),ColorMatrixFrag:i(96293),DefineBlockyTexCoord:i(78390),DefineLights:i(11719),DefineTexCoordFrameClamp:i(14030),FilterBarrelFrag:i(10235),FilterBlendFrag:i(65980),FilterBlockyFrag:i(5899),FilterBlurHighFrag:i(20784),FilterBlurLowFrag:i(65122),FilterBlurMedFrag:i(60942),FilterBokehFrag:i(43722),FilterColorMatrixFrag:i(19883),FilterCombineColorMatrixFrag:i(32624),FilterDisplacementFrag:i(12886),FilterGlowFrag:i(33016),FilterGradientMapFrag:i(33179),FilterImageLightFrag:i(94526),FilterKeyFrag:i(4488),FilterMaskFrag:i(39603),FilterNormalToolsFrag:i(60047),FilterPanoramaBlurFrag:i(7529),FilterPixelateFrag:i(99191),FilterQuantizeFrag:i(88430),FilterShadowFrag:i(69355),FilterThresholdFrag:i(92636),FilterVignetteFrag:i(18185),FilterWipeFrag:i(99174),FlatFrag:i(73416),FlatVert:i(91627),GetNormalFromMap:i(84220),GetTexRes:i(2860),GetTexture:i(46432),GradientFrag:i(41509),MultiFrag:i(98840),MultiVert:i(44667),NoiseFrag:i(16421),NoiseSimplex2DFrag:i(83587),NoiseSimplex3DFrag:i(13460),NoiseWorley2DFrag:i(17205),NoiseWorley3DFrag:i(79814),NoiseWorley4DFrag:i(99595),OutInverseRotation:i(62807),PointLightFrag:i(4127),PointLightVert:i(89924),Ramp:i(68589),ShaderQuadFrag:i(72823),ShaderQuadVert:i(65884),SimpleTextureVert:i(2807),SpriteGPULayerFrag:i(49119),SpriteGPULayerVert:i(3524),TilemapGPULayerFrag:i(57532),TilemapGPULayerVert:i(23879)}},26128(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r){this.renderer=t,this.webGLBuffer=null,this.dataBuffer=e,this.viewF32=null,this.viewU8=new Uint8Array(e),this.viewU16=null,this.viewU32=null,this.bufferType=i,this.bufferUsage=r,this.createViews(),this.createResource()},createResource:function(){var t=this.renderer.gl,e=this.bufferType,i=t.createBuffer();this.webGLBuffer=i,this.bind(),t.bufferData(e,this.dataBuffer,this.bufferUsage),this.bind(!0)},bind:function(t){var e=this.renderer.gl,i=this.bufferType,r=t?null:this;i===e.ARRAY_BUFFER?this.renderer.glWrapper.updateBindingsArrayBuffer({bindings:{arrayBuffer:r}}):i===e.ELEMENT_ARRAY_BUFFER&&this.renderer.glWrapper.updateBindingsElementArrayBuffer({bindings:{elementArrayBuffer:r}})},update:function(t,e){var i=this.renderer.gl;this.bind(),void 0===e&&(e=0),void 0===t?i.bufferSubData(this.bufferType,e,this.dataBuffer):i.bufferSubData(this.bufferType,e,this.viewU8.subarray(e,e+t))},resize:function(t){var e=this.renderer.gl;this.dataBuffer=new ArrayBuffer(t),this.createViews(),this.bind(),e.bufferData(this.bufferType,this.dataBuffer,this.bufferUsage)},createViews:function(){var t=this.dataBuffer;this.viewF32=null,t.byteLength%Float32Array.BYTES_PER_ELEMENT===0&&(this.viewF32=new Float32Array(t)),this.viewU8=new Uint8Array(t),this.viewU16=null,t.byteLength%Uint16Array.BYTES_PER_ELEMENT===0&&(this.viewU16=new Uint16Array(t)),this.viewU32=null,t.byteLength%Uint32Array.BYTES_PER_ELEMENT===0&&(this.viewU32=new Uint32Array(t))},destroy:function(){this.renderer.gl.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.dataBuffer=null,this.viewF32=null,this.viewU8=null,this.viewU16=null,this.viewU32=null,this.renderer=null}});t.exports=r},84387(t,e,i){var r=i(83419),s={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},n=new r({initialize:function(t,e,i,r){var s=t.gl;if(this.webGLFramebuffer=null,this.renderer=t,this.useCanvas=!e||0===e.length,this.width=0,this.height=0,this.attachments=[],!this.useCanvas){for(var n=0;n<e.length;n++)if(this.attachments.push({texture:e[n],attachmentPoint:s.COLOR_ATTACHMENT0+n}),0===n)this.width=e[n].width,this.height=e[n].height;else if(e[n].width!==this.width||e[n].height!==this.height)throw new Error("Color attachments must have the same dimensions");r&&i?this.attachments.push({attachmentPoint:s.DEPTH_STENCIL_ATTACHMENT,internalFormat:s.DEPTH_STENCIL}):r?this.attachments.push({attachmentPoint:s.DEPTH_ATTACHMENT,internalFormat:s.DEPTH_COMPONENT16}):i&&this.attachments.push({attachmentPoint:s.STENCIL_ATTACHMENT,internalFormat:s.STENCIL_INDEX8})}this.renderTexture=null,this.attachments[0]&&(this.renderTexture=this.attachments[0].texture),this.createResource()},createResource:function(){if(!this.useCanvas){var t=this.renderer,e=t.glWrapper,i=t.gl;if(this.webGLFramebuffer){i.deleteFramebuffer(this.webGLFramebuffer);for(var r=0;r<this.attachments.length;r++){var n=this.attachments[r];n.texture||i.deleteRenderbuffer(n.renderbuffer)}}var a=i.createFramebuffer();for(this.webGLFramebuffer=a,e.updateBindingsFramebuffer({bindings:{framebuffer:this}},!0),r=0;r<this.attachments.length;r++){var o=(n=this.attachments[r]).attachmentPoint,h=n.texture;if(h)h.isRenderTexture=!0,i.framebufferTexture2D(i.FRAMEBUFFER,o,i.TEXTURE_2D,h.webGLTexture,0);else{var l=i.checkFramebufferStatus(i.FRAMEBUFFER);if(l!==i.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(s[l]||l));var u=i.createRenderbuffer();e.updateBindingsRenderbuffer({bindings:{renderbuffer:u}}),i.renderbufferStorage(i.RENDERBUFFER,n.internalFormat,this.width,this.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,o,i.RENDERBUFFER,u),n.renderbuffer=u}}}},resize:function(t,e){this.useCanvas||(this.width=t,this.height=e,this.renderTexture.resize(t,e),this.createResource())},destroy:function(){if(null!==this.renderer){for(var t=this.renderer,e=t.gl,i=0;i<this.attachments.length;i++){var r=this.attachments[i];r.texture?(t.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:this}}),e.framebufferTexture2D(e.FRAMEBUFFER,r.attachmentPoint,e.TEXTURE_2D,null,0),t.deleteTexture(r.texture)):e.deleteRenderbuffer(r.renderbuffer)}e.deleteFramebuffer(this.webGLFramebuffer),t.glWrapper.updateBindingsFramebuffer({bindings:{framebuffer:null,renderbuffer:null}}),this.attachments.length=0,this.renderTexture=null,this.webGLFramebuffer=null,this.renderer=null}}});t.exports=n},37959(t,e,i){var r=i(83419),s=i(53314),n=new r({initialize:function(t){this.renderer=t,this.state=s.getDefault(t)},update:function(t,e,i){if(void 0===t){if(!e)return;t=this.state}void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===t.vao||i||this.updateVAO(t,e),void 0!==t.bindings&&this.updateBindings(t,e),void 0!==t.blend&&this.updateBlend(t,e),void 0!==t.colorClearValue&&this.updateColorClearValue(t,e),void 0!==t.colorWritemask&&this.updateColorWritemask(t,e),void 0!==t.cullFace&&this.updateCullFace(t,e),void 0!==t.depthTest&&this.updateDepthTest(t,e),void 0!==t.scissor&&this.updateScissor(t,e),void 0!==t.stencil&&this.updateStencil(t,e),void 0!==t.texturing&&this.updateTexturing(t,e),void 0!==t.viewport&&this.updateViewport(t,e),void 0!==t.vao&&i&&this.updateVAO(t,e)},updateBindings:function(t,e){var i=t.bindings;void 0!==i.activeTexture&&this.updateBindingsActiveTexture(t,e),void 0!==i.arrayBuffer&&this.updateBindingsArrayBuffer(t,e),void 0!==i.elementArrayBuffer&&this.updateBindingsElementArrayBuffer(t,e),void 0!==i.framebuffer&&this.updateBindingsFramebuffer(t,e),void 0!==i.program&&this.updateBindingsProgram(t,e),void 0!==i.renderbuffer&&this.updateBindingsRenderbuffer(t,e)},updateBindingsActiveTexture:function(t,e){var i=t.bindings.activeTexture,r=i!==this.state.bindings.activeTexture;if(r&&(this.state.bindings.activeTexture=i),r||e){var s=this.renderer.gl;s.activeTexture(s.TEXTURE0+i)}},updateBindingsArrayBuffer:function(t,e){var i=t.bindings.arrayBuffer,r=this.renderer.gl;if(null!==i&&i.bufferType!==r.ARRAY_BUFFER)throw new Error("Invalid buffer type for ARRAY_BUFFER");var s=i!==this.state.bindings.arrayBuffer;if(s&&(this.state.bindings.arrayBuffer=i),s||e){var n=i?i.webGLBuffer:null;r.bindBuffer(r.ARRAY_BUFFER,n)}},updateBindingsElementArrayBuffer:function(t,e){var i=t.bindings.elementArrayBuffer,r=this.renderer.gl;if(null!==i&&i.bufferType!==r.ELEMENT_ARRAY_BUFFER)throw new Error("Invalid buffer type for ELEMENT_ARRAY_BUFFER");var s=i!==this.state.bindings.elementArrayBuffer;if(s&&(this.state.bindings.elementArrayBuffer=i),s||e){var n=i?i.webGLBuffer:null;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)}},updateBindingsFramebuffer:function(t,e){var i=t.bindings.framebuffer,r=i!==this.state.bindings.framebuffer;if(r&&(this.state.bindings.framebuffer=i),r||e){var s=this.renderer.gl,n=i?i.webGLFramebuffer:null;s.bindFramebuffer(s.FRAMEBUFFER,n)}},updateBindingsProgram:function(t,e){var i=t.bindings.program,r=i!==this.state.bindings.program;if(r&&(this.state.bindings.program=i),r||e){var s=i?i.webGLProgram:null;this.renderer.gl.useProgram(s)}},updateBindingsRenderbuffer:function(t,e){var i=t.bindings.renderbuffer,r=i!==this.state.bindings.renderbuffer;if(r&&(this.state.bindings.renderbuffer=i),r||e){var s=this.renderer.gl,n=i||null;s.bindRenderbuffer(s.RENDERBUFFER,n)}},updateBlend:function(t,e){var i=t.blend;void 0!==i.enabled&&this.updateBlendEnabled(t,e),void 0!==i.color&&this.updateBlendColor(t,e),void 0!==i.equation&&this.updateBlendEquation(t,e),void 0!==i.func&&this.updateBlendFunc(t,e)},updateBlendColor:function(t,e){var i=t.blend.color,r=i[0],s=i[1],n=i[2],a=i[3],o=r!==this.state.blend.color[0]||s!==this.state.blend.color[1]||n!==this.state.blend.color[2]||a!==this.state.blend.color[3];o&&(this.state.blend.color=[r,s,n,a]),(o||e)&&this.renderer.gl.blendColor(r,s,n,a)},updateBlendEnabled:function(t,e){var i=t.blend.enabled,r=i!==this.state.blend.enabled;if(r&&(this.state.blend.enabled=i),r||e){var s=this.renderer.gl;i?s.enable(s.BLEND):s.disable(s.BLEND)}},updateBlendEquation:function(t,e){var i=t.blend.equation,r=i[0]!==this.state.blend.equation[0]||i[1]!==this.state.blend.equation[1];r&&(this.state.blend.equation=[i[0],i[1]]),(r||e)&&this.renderer.gl.blendEquationSeparate(i[0],i[1])},updateBlendFunc:function(t,e){var i=t.blend.func,r=i[0]!==this.state.blend.func[0]||i[1]!==this.state.blend.func[1]||i[2]!==this.state.blend.func[2]||i[3]!==this.state.blend.func[3];r&&(this.state.blend.func=[i[0],i[1],i[2],i[3]]),(r||e)&&this.renderer.gl.blendFuncSeparate(i[0],i[1],i[2],i[3])},updateColorClearValue:function(t,e){var i=t.colorClearValue,r=i[0],s=i[1],n=i[2],a=i[3],o=r!==this.state.colorClearValue[0]||s!==this.state.colorClearValue[1]||n!==this.state.colorClearValue[2]||a!==this.state.colorClearValue[3];o&&(this.state.colorClearValue=[r,s,n,a]),(o||e)&&this.renderer.gl.clearColor(r,s,n,a)},updateColorWritemask:function(t,e){var i=t.colorWritemask,r=i[0],s=i[1],n=i[2],a=i[3],o=r!==this.state.colorWritemask[0]||s!==this.state.colorWritemask[1]||n!==this.state.colorWritemask[2]||a!==this.state.colorWritemask[3];o&&(this.state.colorWritemask=[r,s,n,a]),(o||e)&&this.renderer.gl.colorMask(r,s,n,a)},updateCullFace:function(t,e){var i=!!t.cullFace,r=i!==this.state.cullFace;if(r&&(this.state.cullFace=i),r||e){var s=this.renderer.gl;i?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE)}},updateDepthTest:function(t,e){var i=!!t.depthTest,r=i!==this.state.depthTest;if(r&&(this.state.depthTest=i),r||e){var s=this.renderer.gl;i?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST)}},updateScissor:function(t,e){var i=t.scissor;void 0!==i.enable&&this.updateScissorEnabled(t,e),void 0!==i.box&&this.updateScissorBox(t,e)},updateScissorEnabled:function(t,e){var i=t.scissor.enable,r=i!==this.state.scissor.enable;if(r&&(this.state.scissor.enable=i),r||e){var s=this.renderer.gl;i?s.enable(s.SCISSOR_TEST):s.disable(s.SCISSOR_TEST)}},updateScissorBox:function(t,e){var i=t.scissor.box,r=i[0],s=i[1],n=i[2],a=i[3],o=r!==this.state.scissor.box[0]||s!==this.state.scissor.box[1]||n!==this.state.scissor.box[2]||a!==this.state.scissor.box[3];o&&(this.state.scissor.box=[r,s,n,a]),(o||e)&&this.renderer.gl.scissor(r,s,n,a)},updateStencil:function(t,e){var i=t.stencil;void 0!==i.clear&&this.updateStencilClear(t,e),void 0!==i.enabled&&this.updateStencilEnabled(t,e),void 0!==i.func&&this.updateStencilFunc(t,e),void 0!==i.op&&this.updateStencilOp(t,e)},updateStencilClear:function(t,e){var i=t.stencil.clear,r=i!==this.state.stencil.clear;r&&(this.state.stencil.clear=i),(r||e)&&this.renderer.gl.clearStencil(i)},updateStencilEnabled:function(t,e){var i=t.stencil.enabled,r=i!==this.state.stencil.enabled;if(r&&(this.state.stencil.enabled=i),r||e){var s=this.renderer.gl;i?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST)}},updateStencilFunc:function(t,e){var i=t.stencil.func,r=i.func!==this.state.stencil.func.func||i.ref!==this.state.stencil.func.ref||i.mask!==this.state.stencil.func.mask;(r&&(this.state.stencil.func={func:i.func,ref:i.ref,mask:i.mask}),r||e)&&this.renderer.gl.stencilFunc(i.func,i.ref,i.mask)},updateStencilOp:function(t,e){var i=t.stencil.op,r=i.fail!==this.state.stencil.op.fail||i.zfail!==this.state.stencil.op.zfail||i.zpass!==this.state.stencil.op.zpass;(r&&(this.state.stencil.op={fail:i.fail,zfail:i.zfail,zpass:i.zpass}),r||e)&&this.renderer.gl.stencilOp(i.fail,i.zfail,i.zpass)},updateTexturing:function(t,e){var i=t.texturing;void 0!==i.flipY&&this.updateTexturingFlipY(t,e),void 0!==i.premultiplyAlpha&&this.updateTexturingPremultiplyAlpha(t,e)},updateTexturingFlipY:function(t,e){var i=t.texturing.flipY,r=i!==this.state.texturing.flipY;if(r&&(this.state.texturing.flipY=i),r||e){var s=this.renderer.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i)}},updateTexturingPremultiplyAlpha:function(t,e){var i=t.texturing.premultiplyAlpha,r=i!==this.state.texturing.premultiplyAlpha;if(r&&(this.state.texturing.premultiplyAlpha=i),r||e){var s=this.renderer.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i)}},updateVAO:function(t,e){var i=t.vao,r=i!==this.state.vao;if(r&&(this.state.vao=i),r||e){var s=this.renderer.gl;i?s.bindVertexArray(i.vertexArrayObject):s.bindVertexArray(null)}},updateViewport:function(t,e){var i=t.viewport,r=i[0],s=i[1],n=i[2],a=i[3],o=r!==this.state.viewport[0]||s!==this.state.viewport[1]||n!==this.state.viewport[2]||a!==this.state.viewport[3];o&&(this.state.viewport=[r,s,n,a]),(o||e)&&this.renderer.gl.viewport(r,s,n,a)}});t.exports=n},1482(t,e,i){var r=i(90330);function s(t,e){return t!==e&&(!Number.isNaN(t)&&void 0!==t||!Number.isNaN(e)&&void 0!==e)}var n=new(i(83419))({initialize:function(t,e,i){this.renderer=t,this.webGLProgram=null,this.compiling=!1,this._compileStartTime=0,this.compileTimeMs=0,this.glState={bindings:{program:this}},this.vertexSource=e,this.fragmentSource=i,this._vertexShader=null,this._fragmentShader=null,this.glAttributes=[],this.glAttributeNames=new r,this.glAttributeBuffer=null,this.glUniforms=new r,this.uniformRequests=new r,this.createResource()},createResource:function(){var t=this.renderer,e=t.gl;if(this.glAttributeBuffer=null,!e.isContextLost()){this.compiling=!0,this._compileStartTime=performance.now(),t.glWrapper.state.bindings.program===this&&t.glWrapper.updateBindingsProgram({bindings:{program:null}});var i=e.createProgram();this.webGLProgram=i;var r=e.createShader(e.VERTEX_SHADER),s=e.createShader(e.FRAGMENT_SHADER);this._vertexShader=r,this._fragmentShader=s,e.shaderSource(r,this.vertexSource),e.shaderSource(s,this.fragmentSource),e.compileShader(r),e.compileShader(s),e.attachShader(i,r),e.attachShader(i,s),e.linkProgram(i),t.game.config.skipUnreadyShaders||this._completeProgram()}},checkParallelCompile:function(){var t=this.renderer,e=t.gl,i=t.parallelShaderCompileExtension;i&&e.getProgramParameter(this.webGLProgram,i.COMPLETION_STATUS_KHR)&&this._completeProgram()},_completeProgram:function(){var t=this.webGLProgram,e=this.renderer.gl,i=this._vertexShader,r=this._fragmentShader,s="Shader failed:\n";if(!e.getProgramParameter(t,e.LINK_STATUS)){if(!e.getShaderParameter(i,e.COMPILE_STATUS))throw console.log(this.vertexSource),new Error("Vertex "+s+e.getShaderInfoLog(i));if(!e.getShaderParameter(r,e.COMPILE_STATUS))throw console.log(this.fragmentSource),new Error("Fragment "+s+e.getShaderInfoLog(r));throw console.log(this.vertexSource,this.fragmentSource),new Error("Link Shader failed:"+e.getProgramInfoLog(t))}this._setupAttributesAndUniforms(),this.compileTimeMs=performance.now()-this._compileStartTime,this.compiling=!1},_setupAttributesAndUniforms:function(){var t=this.webGLProgram,e=this.renderer,i=e.gl,r=this;this.glAttributeNames.clear(),this.glAttributes.length=0;for(var s=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES),n=0;n<s;n++){var a=i.getActiveAttrib(t,n),o=i.getAttribLocation(t,a.name);this.glAttributeNames.set(a.name,n),this.glAttributes[n]={location:o,name:a.name,size:a.size,type:a.type}}this.glUniforms.each(function(t,e){r.uniformRequests.has(t)||r.uniformRequests.set(t,e.value)}),this.glUniforms.clear();var h=i.getProgramParameter(t,i.ACTIVE_UNIFORMS);for(n=0;n<h;n++){var l=i.getActiveUniform(t,n),u=e.shaderSetters.constants[l.type],d=0,c=l.size*u.size;c>1&&(d=u.baseType===i.FLOAT?new Float32Array(c):new Int32Array(c)),this.glUniforms.set(l.name,{location:i.getUniformLocation(t,l.name),size:l.size,type:l.type,value:d})}},setUniform:function(t,e){this.uniformRequests.set(t,e)},bind:function(){this.renderer.glWrapper.updateBindingsProgram(this.glState),this.uniformRequests.each(this._processUniformRequest.bind(this)),this.uniformRequests.clear()},_processUniformRequest:function(t,e){var i=this.renderer,r=i.gl,n=this.glUniforms.get(t);if(n){var a=n.value;if(a.length){for(var o=!1,h=0;h<a.length;h++)s(a[h],e[h])&&(o=!0,a[h]=e[h]);if(!o)return}else{if(!s(a,e))return;a=e,n.value=e}var l=n.location,u=n.type,d=n.size,c=i.shaderSetters.constants[u];if(c.isMatrix)c.set.call(r,l,!1,a);else if(d>1)c.setV.call(r,l,a);else switch(c.size){case 1:c.set.call(r,l,e);break;case 2:c.set.call(r,l,e[0],e[1]);break;case 3:c.set.call(r,l,e[0],e[1],e[2]);break;case 4:c.set.call(r,l,e[0],e[1],e[2],e[3])}}},destroy:function(){if(this.webGLProgram){var t=this.renderer.gl;if(!t.isContextLost()){this._vertexShader&&t.deleteShader(this._vertexShader),this._fragmentShader&&t.deleteShader(this._fragmentShader),t.deleteProgram(this.webGLProgram);for(var e=0;e<this.glAttributes.length;e++)t.disableVertexAttribArray(this.glAttributes[e].location);this.glAttributes.length=0,this.glUniforms.clear()}this.glAttributeBuffer=null,this.glAttributeNames.clear(),this.uniformRequests.clear(),this._vertexShader=null,this._fragmentShader=null,this.webGLProgram=null,this.renderer=null}}});t.exports=n},86272(t,e,i){var r=new(i(83419))({initialize:function(t){var e=t.gl;this.constants={5124:{constant:e.INT,baseType:e.INT,size:1,bytes:4,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},35667:{constant:e.INT_VEC2,baseType:e.INT,size:2,bytes:4,set:e.uniform2i,setV:e.uniform2iv,isMatrix:!1},35668:{constant:e.INT_VEC3,baseType:e.INT,size:3,bytes:4,set:e.uniform3i,setV:e.uniform3iv,isMatrix:!1},35669:{constant:e.INT_VEC4,baseType:e.INT,size:4,bytes:4,set:e.uniform4i,setV:e.uniform4iv,isMatrix:!1},5126:{constant:e.FLOAT,baseType:e.FLOAT,size:1,bytes:4,set:e.uniform1f,setV:e.uniform1fv,isMatrix:!1},35664:{constant:e.FLOAT_VEC2,baseType:e.FLOAT,size:2,bytes:4,set:e.uniform2f,setV:e.uniform2fv,isMatrix:!1},35665:{constant:e.FLOAT_VEC3,baseType:e.FLOAT,size:3,bytes:4,set:e.uniform3f,setV:e.uniform3fv,isMatrix:!1},35666:{constant:e.FLOAT_VEC4,baseType:e.FLOAT,size:4,bytes:4,set:e.uniform4f,setV:e.uniform4fv,isMatrix:!1},5125:{constant:e.UNSIGNED_INT,baseType:e.UNSIGNED_INT,size:1,bytes:4,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},5120:{constant:e.BYTE,baseType:e.BYTE,size:1,bytes:1,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},5121:{constant:e.UNSIGNED_BYTE,baseType:e.UNSIGNED_BYTE,size:1,bytes:1,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},5122:{constant:e.SHORT,baseType:e.SHORT,size:1,bytes:2,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},5123:{constant:e.UNSIGNED_SHORT,baseType:e.UNSIGNED_SHORT,size:1,bytes:2,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},35670:{constant:e.BOOL,baseType:e.BOOL,size:1,bytes:4,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},35671:{constant:e.BOOL_VEC2,baseType:e.BOOL,size:2,bytes:4,set:e.uniform2i,setV:e.uniform2iv,isMatrix:!1},35672:{constant:e.BOOL_VEC3,baseType:e.BOOL,size:3,bytes:4,set:e.uniform3i,setV:e.uniform3iv,isMatrix:!1},35673:{constant:e.BOOL_VEC4,baseType:e.BOOL,size:4,bytes:4,set:e.uniform4i,setV:e.uniform4iv,isMatrix:!1},35674:{constant:e.FLOAT_MAT2,baseType:e.FLOAT,size:4,bytes:4,set:e.uniformMatrix2fv,setV:e.uniformMatrix2fv,isMatrix:!0},35675:{constant:e.FLOAT_MAT3,baseType:e.FLOAT,size:9,bytes:4,set:e.uniformMatrix3fv,setV:e.uniformMatrix3fv,isMatrix:!0},35676:{constant:e.FLOAT_MAT4,baseType:e.FLOAT,size:16,bytes:4,set:e.uniformMatrix4fv,setV:e.uniformMatrix4fv,isMatrix:!0},35678:{constant:e.SAMPLER_2D,baseType:e.INT,size:1,bytes:4,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1},35680:{constant:e.SAMPLER_CUBE,baseType:e.INT,size:1,bytes:4,set:e.uniform1i,setV:e.uniform1iv,isMatrix:!1}}}});t.exports=r},13760(t,e,i){var r=new(i(83419))({initialize:function(t){this.renderer=t,this.units=[],this.unitIndices=[],this.init()},init:function(){var t=this.renderer.gl;this.units.length=0,this.unitIndices.length=0;for(var e=t.createTexture(),i=this.renderer.maxTextures-1;i>=0;i--)this.units[i]=void 0,this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:i}}),t.bindTexture(t.TEXTURE_2D,e),this.unitIndices[i]=i;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,255,255]))},bind:function(t,e,i,r){var s=this.units[e]!==t;if((i||!1!==r||s)&&this.renderer.glWrapper.updateBindingsActiveTexture({bindings:{activeTexture:e}},i),s||i){this.units[e]=t;var n=t?t.webGLTexture:null,a=this.renderer.gl;a.bindTexture(a.TEXTURE_2D,n),t&&t.needsMipmapRegeneration&&t.generateMipmap()}},bindUnits:function(t,e){for(var i=Math.min(t.length,this.renderer.maxTextures)-1;i>=0;i--)void 0!==t[i]&&this.bind(t[i],i,e,!1)},unbindTexture:function(t){for(var e=this.units.length-1;e>=0;e--)this.units[e]===t&&this.bind(null,e,!0,!1)},unbindAllUnits:function(){for(var t=this.units.length-1;t>=0;t--)this.bind(null,t,!0,!1)}});t.exports=r},82751(t,e,i){var r=i(83419),s=i(50030),n=new r({initialize:function(t,e,i,r,s,n,a,o,h,l,u,d,c){void 0===c&&(c=!0),this.renderer=t,this.webGLTexture=null,this.isRenderTexture=!1,this.mipLevel=e,this.minFilter=i,this.magFilter=r,this.wrapT=s,this.wrapS=n,this.format=a,this.pixels=o,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!d,this.flipY=!!c,this.__SPECTOR_Metadata={},this.batchUnit=-1,this.needsMipmapRegeneration=!1,this.createResource()},createResource:function(){var t=this.renderer.gl;if(!t.isContextLost())if(this.pixels instanceof n)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();e.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=e,this._processTexture()}},resize:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var i=this.renderer,r=i.gl,n=s(t,e);n?(this.wrapS=r.REPEAT,this.wrapT=r.REPEAT):(this.wrapS=r.CLAMP_TO_EDGE,this.wrapT=r.CLAMP_TO_EDGE),n&&i.mipmapFilter&&(!this.isRenderTexture||i.config.mipmapRegeneration)?this.minFilter=i.mipmapFilter:i.config.antialias?this.minFilter=r.LINEAR:this.minFilter=r.NEAREST,this._processTexture()}},update:function(t,e,i,r,s,n,a,o,h){0!==e&&0!==i&&(this.pixels=t,this.width=e,this.height=i,this.flipY=r,this.wrapS=s,this.wrapT=n,this.minFilter=a,this.magFilter=o,this.format=h,this._processTexture())},_processTexture:function(){var t=this.renderer.gl;this.renderer.glTextureUnits.bind(this,0),this.renderer.glWrapper.updateTexturing({texturing:{flipY:this.flipY,premultiplyAlpha:this.pma}}),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT);var e=this.pixels,i=this.mipLevel,r=this.width,s=this.height,n=this.format;if(null==e)t.texImage2D(t.TEXTURE_2D,i,n,r,s,0,n,t.UNSIGNED_BYTE,null),this.generateMipmap();else if(e.compressed){r=e.width,s=e.height;for(var a=0;a<e.mipmaps.length;a++)t.compressedTexImage2D(t.TEXTURE_2D,a,e.internalFormat,e.mipmaps[a].width,e.mipmaps[a].height,0,e.mipmaps[a].data)}else e instanceof Uint8Array?(t.texImage2D(t.TEXTURE_2D,i,n,r,s,0,n,t.UNSIGNED_BYTE,e),this.generateMipmap()):(this.forceSize||(r=e.width,s=e.height),t.texImage2D(t.TEXTURE_2D,i,n,n,t.UNSIGNED_BYTE,e),this.generateMipmap())},isMipmap:function(){var t=this.minFilter,e=this.renderer.gl;return t===e.NEAREST_MIPMAP_NEAREST||t===e.LINEAR_MIPMAP_NEAREST||t===e.LINEAR_MIPMAP_LINEAR||t===e.NEAREST_MIPMAP_LINEAR},generateMipmap:function(){this.needsMipmapRegeneration=!1;var t=this.renderer.gl;this.isMipmap()&&s(this.width,this.height)&&t.generateMipmap(t.TEXTURE_2D)},spectorMetadata:{get:function(){return this.__SPECTOR_Metadata},set:function(t){this.__SPECTOR_Metadata=t,this.webGLTexture.__SPECTOR_Metadata=t}},destroy:function(){null!==this.webGLTexture&&(this.pixels instanceof n||this.renderer.gl.deleteTexture(this.webGLTexture),this.pixels=null,this.webGLTexture=null,this.renderer=null)}});t.exports=n},85788(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r){this.renderer=t,this.program=e,this.vertexArrayObject=null,this.indexBuffer=i,this.attributeBufferLayouts=r,this.glState={vao:this},this.createResource()},createResource:function(){var t=this.renderer.gl;this.vertexArrayObject=t.createVertexArray(),this.bind(),this.indexBuffer&&this.indexBuffer.bind();for(var e=this.program,i=e.glAttributes,r=e.glAttributeNames,s=0;s<this.attributeBufferLayouts.length;s++){var n=this.attributeBufferLayouts[s];n.buffer.bind();for(var a=n.layout.stride,o=n.layout.instanceDivisor,h=0;h<n.layout.layout.length;h++){var l=n.layout.layout[h],u=r.get(l.name);if(void 0!==u){var d=i[u];l.location=d.location;for(var c=l.location,f=l.bytes||4,p=l.columns||1,g=l.normalized,m=l.offset,v=l.size,y=l.type,x=0;x<p;x++)t.enableVertexAttribArray(c+x),t.vertexAttribPointer(c+x,v,y,g,a,m+f*x*v),isNaN(o)||t.vertexAttribDivisor(c+x,o)}}}this.renderer.glWrapper.updateVAO({vao:null}),this.renderer.glWrapper.updateBindings({bindings:{arrayBuffer:null,elementArrayBuffer:null}})},bind:function(){this.renderer.glWrapper.updateVAO(this.glState)},destroy:function(){var t=this.renderer.gl;this.vertexArrayObject&&(t.deleteVertexArray(this.vertexArrayObject),this.vertexArrayObject=null),this.indexBuffer=null,this.attributeBufferLayouts=null,this.glState=null,this.renderer=null}});t.exports=r},40952(t,e,i){var r=new(i(83419))({initialize:function(t,e,i){this.renderer=t,this.layout=e,this.completeLayout(e);var r=e.stride*e.count;if(i&&i.byteLength<r)throw new Error("Buffer too small for layout");this.buffer=i||t.createVertexBuffer(new ArrayBuffer(r),e.usage)},completeLayout:function(t){var e=this.renderer.gl,i=t.layout,r=this.renderer.shaderSetters.constants;"string"==typeof t.usage&&(t.usage=e[t.usage]);for(var s=0,n=0;n<i.length;n++){var a=i[n],o=a.size,h=a.columns||1;a.offset=s,"string"==typeof a.type&&(a.type=e[a.type]);var l=r[a.type],u=l.size,d=l.bytes;a.bytes=d,s+=o*h*d*u}t.stride=s}});t.exports=r},31884(t,e,i){var r={WebGLGlobalWrapper:i(37959),WebGLBufferWrapper:i(26128),WebGLProgramWrapper:i(1482),WebGLShaderSetterWrapper:i(86272),WebGLTextureWrapper:i(82751),WebGLTextureUnitsWrapper:i(13760),WebGLFramebufferWrapper:i(84387),WebGLVAOWrapper:i(85788),WebGLVertexBufferLayoutWrapper:i(40952)};t.exports=r},76531(t,e,i){var r=i(13560),s=i(83419),n=i(45319),a=i(50792),o=i(97480),h=i(8443),l=i(57811),u=i(74403),d=i(45818),c=i(29747),f=i(87841),p=i(86555),g=i(56583),m=i(26099),v=i(38058),y=new s({Extends:a,initialize:function(t){a.call(this),this.game=t,this.canvas,this.canvasBounds=new f,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=r.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=r.CENTER.NO_CENTER,this.orientation=r.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.domlisteners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(h.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen;var e=this.scaleMode;e!==r.SCALE_MODE.RESIZE&&e!==r.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(e),e===r.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(h.PRE_STEP,this.step,this),t.events.once(h.READY,this.refresh,this),t.events.once(h.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,n=t.zoom,a=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var o=this.parentSize.width;0===o&&(o=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(o*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),n===r.ZOOM.MAX_ZOOM&&(n=this.getMaxZoom()),this.zoom=n,1!==n&&(this._resetZoom=!0),this.baseSize.setSize(e,i),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*n,t.minHeight*n),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*n,t.maxHeight*n),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=d(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==r.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=l(!0));var i=e.width,r=e.height;if(t.width!==i||t.height!==r)return t.setSize(i,r),!0;if(this.canvas){var s=this.canvasBounds,n=this.canvas.getBoundingClientRect();if(n.x!==s.x||n.y!==s.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,s=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(r,s)},resize:function(t,e){var i=this.zoom,r=this.autoRound;r&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),r&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,o=t*i,h=e*i;return r&&(o=Math.floor(o),h=Math.floor(h)),o===t&&h===e||(a.width=o+"px",a.height=h+"px"),this.refresh(s,n)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var r=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=r.marginLeft,s.marginTop=r.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=d(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,a=this.gameSize.height,o=this.zoom,h=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(s*o,a*o),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===r.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===r.SCALE_MODE.EXPAND){var l,u,d=this.game.config.width,c=this.game.config.height,f=this.parentSize.width,p=this.parentSize.height,g=f/d,m=p/c;g<m?(l=d,u=0!==g?p/g:c):(l=0!==m?f/m:d,u=c);var v=n(l,this.displaySize.minWidth,this.displaySize.maxWidth),y=n(u,this.displaySize.minHeight,this.displaySize.maxHeight);this.baseSize.setSize(v,y),this.gameSize.setSize(v,y),h&&(v=Math.floor(v),y=Math.floor(y)),this.canvas.width=v,this.canvas.height=y;var x=f*(v/l),T=p*(y/u);this.displaySize.setSize(x,T),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"}else this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,h&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px";this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=g(this.parentSize.width,this.gameSize.width,0,!0),e=g(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==r.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),n=s.width,a=s.height,o=Math.floor((this.parentSize.width-n)/2),h=Math.floor((this.parentSize.height-a)/2);t===r.CENTER.CENTER_HORIZONTALLY?h=0:t===r.CENTER.CENTER_VERTICALLY&&(o=0),i.marginLeft=o+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget()},leaveFullScreenSuccessHandler:function(){this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.domlisteners;if(e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0,t.refresh()},e.windowResize=function(){t.updateBounds(),t.dirty=!0},screen.orientation&&screen.orientation.addEventListener?screen.orientation.addEventListener("change",e.orientationChange,!1):window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():(this.stopFullscreen(),this.leaveFullScreenSuccessHandler())},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t,e){t instanceof v||(e=t,t=void 0),void 0===e&&(e=new f);var i,r,s=this.baseSize,n=this.parentSize,a=this.canvasBounds,o=this.displayScale,h=a.x>=0?0:-a.x*o.x,l=a.y>=0?0:-a.y*o.y;return i=n.width>=a.width?s.width:s.width-(a.width-n.width)*o.x,r=n.height>=a.height?s.height:s.height-(a.height-n.height)*o.y,e.setTo(h,l,i,r),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;screen.orientation&&screen.orientation.addEventListener?screen.orientation.removeEventListener("change",t.orientationChange,!1):window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=y},64743(t){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218(t){t.exports={LANDSCAPE:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary",PORTRAIT:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary"}},81050(t){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805(t){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560(t,e,i){var r={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=r},56139(t){t.exports="enterfullscreen"},2336(t){t.exports="fullscreenfailed"},47412(t){t.exports="fullscreenunsupported"},51452(t){t.exports="leavefullscreen"},20666(t){t.exports="orientationchange"},47945(t){t.exports="resize"},97480(t,e,i){t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364(t,e,i){var r=i(79291),s=i(13560),n={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};n=r(!1,n,s.CENTER),n=r(!1,n,s.ORIENTATION),n=r(!1,n,s.SCALE_MODE),n=r(!1,n,s.ZOOM),t.exports=n},27397(t,e,i){var r=i(95540),s=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=r(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(s(e+"Physics")),i)for(var a in i)a=s(a.concat("Physics")),-1===n.indexOf(a)&&n.push(a);return n}}},52106(t,e,i){var r=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=r(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033(t){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",matterPhysics:"matter"}},97482(t,e,i){var r=i(83419),s=i(2368),n=new r({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=n},60903(t,e,i){var r=i(83419),s=i(89993),n=i(44594),a=i(8443),o=i(35154),h=i(54899),l=i(29747),u=i(97482),d=i(2368),c=new r({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once(a.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,r;for(this.systemScene=this.createSceneFromInstance("__SYSTEM",new u),this.game.events.emit(a.SYSTEM_READY,this.systemScene,this),t=0;t<this._pending.length;t++){var s;i=(e=this._pending[t]).key,(r=e.scene)instanceof u?s=this.createSceneFromInstance(i,r):"object"==typeof r?s=this.createSceneFromObject(i,r):"function"==typeof r&&(s=this.createSceneFromFunction(i,r)),i=s.sys.settings.key,this.keys[i]=s,this.scenes.push(s),this._data[i]&&(s.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||s.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,r;if(t){for(i=0;i<t;i++)r=this._pending[i],this.add(r.key,r.scene,r.autoStart,r.data);for(i=0;i<this._start.length;i++)r=this._start[i],this.start(r);this._start.length=0,this._pending.length=0}for(i=0;i<this._queue.length;i++)this[(r=this._queue[i]).op](r.keyA,r.keyB,r.data);this._queue.length=0}},add:function(t,e,i,r){return void 0===i&&(i=!1),void 0===r&&(r={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:r}),this.isBooted||(this._data[t]={data:r}),null):(t=this.getKey(t,e),e instanceof u?s=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,s=this.createSceneFromObject(t,e)):"function"==typeof e&&(s=this.createSceneFromFunction(t,e)),s.sys.settings.data=r,t=s.sys.settings.key,this.keys[t]=s,this.scenes.push(s),(i||s.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),s);var s},remove:function(t){if(this.isProcessing)return this.queueOp("remove",t);var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),r=e.sys.settings.key;return i>-1&&(delete this.keys[r],this.scenes.splice(i,1),this._start.indexOf(r)>-1&&(i=this._start.indexOf(r),this._start.splice(i,1)),e.sys.destroy()),this},bootScene:function(t){var e,i=t.sys,r=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,r.data),r.status=s.INIT,r.isTransition&&i.events.emit(n.TRANSITION_INIT,r.transitionFrom,r.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),r.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var r=this.scenes[i].sys;r.settings.status>s.START&&r.settings.status<=s.RUNNING&&r.step(t,e),r.scenePlugin&&r.scenePlugin._target&&r.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=s.LOADING&&i.settings.status<s.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=s.CREATING,t.create.call(t,i.data),i.status===s.DESTROYED)||(i.isTransition&&e.events.emit(n.TRANSITION_START,i.transitionFrom,i.transitionDuration),t.update&&(e.sceneUpdate=t.update),i.status=s.RUNNING,e.events.emit(n.CREATE,t))},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof u){var r=i.sys.settings.key;if(""!==r&&(t=r),this.keys.hasOwnProperty(t))throw new Error("Cannot add Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new d(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){return""===e.sys.settings.key&&(e.sys.settings.key=t),e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new u(e),r=i.sys.settings.key;""!==r?t=r:i.sys.settings.key=t,i.sys.init(this.game);for(var s=["init","preload","create","update","render"],n=0;n<s.length;n++){var a=o(e,s[n],null);a&&(i[s[n]]=a)}if(e.hasOwnProperty("extend"))for(var h in e.extend)if(e.extend.hasOwnProperty(h)){var l=e.extend[h];"data"===h&&i.hasOwnProperty("data")&&"object"==typeof l?i.data.merge(l):"sys"!==h&&(i[h]=l)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof u?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add Scene with duplicate key: "+t);return t},getScenes:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1);for(var i=[],r=this.scenes,s=0;s<r.length;s++){var n=r[s];n&&(!t||t&&n.sys.isActive())&&i.push(n)}return e?i.reverse():i},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isPaused:function(t){var e=this.getScene(t);return e?e.sys.isPaused():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var r=0;r<this._pending.length;r++)if(this._pending[r].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isPaused()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(!i)return console.warn("Scene key not found: "+t),this;var r,n=i.sys,a=n.settings.status;if(a>=s.START&&a<=s.CREATING)return this;if(a>=s.RUNNING&&a<=s.SLEEPING)n.shutdown(),n.sceneUpdate=l,n.start(e);else if(n.sceneUpdate=l,n.start(e),n.load&&(r=n.load),r&&n.settings.hasOwnProperty("pack")&&(r.reset(),r.addPack({payload:n.settings.pack})))return n.settings.status=s.LOADING,r.once(h.COMPLETE,this.payloadComplete,this),r.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==s.SHUTDOWN){var r=i.sys.load;r&&(r.off(h.COMPLETE,this.loadComplete,this),r.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e,i){var r=this.getScene(t),s=this.getScene(e);return r&&s&&r!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e,i):this.start(e,i)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)return this.queueOp("bringToTop",t);var e=this.getIndex(t),i=this.scenes;if(-1!==e&&e<i.length){var r=this.getScene(t);i.splice(e,1),i.push(r)}return this},sendToBack:function(t){if(this.isProcessing)return this.queueOp("sendToBack",t);var e=this.getIndex(t);if(-1!==e&&e>0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}return this},moveDown:function(t){if(this.isProcessing)return this.queueOp("moveDown",t);var e=this.getIndex(t);if(e>0){var i=e-1,r=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=r}return this},moveUp:function(t){if(this.isProcessing)return this.queueOp("moveUp",t);var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,r=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=r}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveAbove",t,e);var i=this.getIndex(t),r=this.getIndex(e);if(-1!==i&&-1!==r&&r<i){var s=this.getAt(r);this.scenes.splice(r,1),this.scenes.splice(i+(r>i),0,s)}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("moveBelow",t,e);var i=this.getIndex(t),r=this.getIndex(e);if(-1!==i&&-1!==r&&r>i){var s=this.getAt(r);this.scenes.splice(r,1),0===i?this.scenes.unshift(s):this.scenes.splice(i-(r<i),0,s)}return this},queueOp:function(t,e,i,r){return this._queue.push({op:t,keyA:e,keyB:i,data:r}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)return this.queueOp("swapPosition",t,e);var i=this.getIndex(t),r=this.getIndex(e);if(i!==r&&-1!==i&&-1!==r){var s=this.getAt(i);this.scenes[i]=this.scenes[r],this.scenes[r]=s}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var r=this.scenes[i].sys,n=!r.settings.visible||r.settings.status!==s.RUNNING&&r.settings.status!==s.PAUSED?"[-] ":"[*] ";n+=r.settings.key+" ("+e[r.settings.status]+")",t.push(n)}console.log(t.join("\n"))},destroy:function(){for(var t=0;t<this.scenes.length;t++){this.scenes[t].sys.destroy()}this.systemScene.sys.destroy(),this.update=l,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null,this.systemScene=null}});t.exports=c},52209(t,e,i){var r=i(45319),s=i(83419),n=i(44594),a=i(95540),o=i(37277),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(n.BOOT,this.boot,this),t.sys.events.on(n.START,this.pluginStart,this)},boot:function(){this.systems.events.once(n.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(n.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var r=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=r,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var s=a(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var o=a(t,"allowInput",!1);this.settings.transitionAllowInput=o;var h=i.sys.settings;h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=r,h.transitionAllowInput=o,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(a(t,"data")):this.manager.start(e,a(t,"data"));var l=a(t,"onStart",null),u=a(t,"onStartScope",this.scene);return l&&l.call(u,this.scene,i,r),this.systems.events.emit(n.TRANSITION_OUT,i,r),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=r(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(n.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,r){return this.manager.add(t,e,i,r)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t,e){return t!==this.key&&this.manager.queueOp("switch",this.key,t,e),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var r=this.manager.getScene(e);return r&&r.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(n.SHUTDOWN,this.shutdown,this),t.off(n.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681(t,e,i){var r=i(89993),s=i(35154),n=i(46975),a=i(87033),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:r.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",n(a,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=o},2368(t,e,i){var r=i(83419),s=i(89993),n=i(42363),a=i(44594),o=i(27397),h=i(52106),l=i(29747),u=i(55681),d=new r({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,n.Global,[n.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(a.PRE_UPDATE,t,e),i.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(a.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=s.PAUSED,e.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=s.RUNNING,i.active=!0,e.emit(a.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==s.CREATING&&i!==s.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=s.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(a.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=s.RUNNING,i.active=!0,i.visible=!0,e.emit(a.WAKE,this,t),i.isTransition&&e.emit(a.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>s.PENDING&&t<=s.RUNNING},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=s.START,i.active=!0,i.visible=!0,e.emit(a.START,this),e.emit(a.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(a.TRANSITION_INIT),e.off(a.TRANSITION_START),e.off(a.TRANSITION_COMPLETE),e.off(a.TRANSITION_OUT),i.status=s.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(a.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=s.DESTROYED,e.active=!1,e.visible=!1,t.emit(a.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","cameras","displayList","events","make","scenePlugin","updateList"],r=0;r<i.length;r++)this[i[r]]=null}});t.exports=d},89993(t){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},69830(t){t.exports="addedtoscene"},7919(t){t.exports="boot"},46763(t){t.exports="create"},11763(t){t.exports="destroy"},71555(t){t.exports="pause"},36735(t){t.exports="postupdate"},3809(t){t.exports="prerender"},90716(t){t.exports="preupdate"},58262(t){t.exports="ready"},91633(t){t.exports="removedfromscene"},10319(t){t.exports="render"},87132(t){t.exports="resume"},81961(t){t.exports="shutdown"},90194(t){t.exports="sleep"},6265(t){t.exports="start"},33178(t){t.exports="transitioncomplete"},43063(t){t.exports="transitioninit"},11259(t){t.exports="transitionout"},61611(t){t.exports="transitionstart"},45209(t){t.exports="transitionwake"},22966(t){t.exports="update"},21747(t){t.exports="wake"},44594(t,e,i){t.exports={ADDED_TO_SCENE:i(69830),BOOT:i(7919),CREATE:i(46763),DESTROY:i(11763),PAUSE:i(71555),POST_UPDATE:i(36735),PRE_RENDER:i(3809),PRE_UPDATE:i(90716),READY:i(58262),REMOVED_FROM_SCENE:i(91633),RENDER:i(10319),RESUME:i(87132),SHUTDOWN:i(81961),SLEEP:i(90194),START:i(6265),TRANSITION_COMPLETE:i(33178),TRANSITION_INIT:i(43063),TRANSITION_OUT:i(11259),TRANSITION_START:i(61611),TRANSITION_WAKE:i(45209),UPDATE:i(22966),WAKE:i(21747)}},62194(t,e,i){var r=i(89993),s=i(79291),n={Events:i(44594),GetPhysicsPlugins:i(27397),GetScenePlugins:i(52106),SceneManager:i(60903),ScenePlugin:i(52209),Settings:i(55681),Systems:i(2368)};n=s(!1,n,r),t.exports=n},30341(t,e,i){var r=i(83419),s=i(50792),n=i(14463),a=i(79291),o=i(29747),h=new r({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=a(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=a(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=a(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=a(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.stop(),this.emit(n.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},85034(t,e,i){var r=i(83419),s=i(41786),n=i(50792),a=i(14463),o=i(8443),h=i(46710),l=i(58731),u=i(29747),d=i(26099),c=new r({Extends:n,initialize:function(t){n.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,this.gameLostFocus=!1,this.listenerPosition=new d;var e=t.events;e.on(o.BLUR,this.onGameBlur,this),e.on(o.FOCUS,this.onGameFocus,this),e.on(o.PRE_STEP,this.update,this),e.once(o.DESTROY,this.destroy,this)},add:u,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var r in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(r)){var n=s(e),a=i.spritemap[r];n.loop=!!a.hasOwnProperty("loop")&&a.loop,i.addMarker({name:r,start:a.start,duration:a.end-a.start,config:n})}return i},get:function(t){return l(this.sounds,"key",t)},getAll:function(t){return t?h(this.sounds,"key",t):h(this.sounds)},getAllPlaying:function(){return h(this.sounds,"isPlaying",!0)},play:function(t,e){var i=this.add(t);return i.once(a.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var r=this.addAudioSprite(t);return r.once(a.COMPLETE,r.destroy,r),r.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach(function(t){t.destroy()}),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var r=this.sounds[i];r.key===t&&(r.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach(function(t){t.stop()&&e++}),e},isPlaying:function(t){var e,i=this.sounds.length-1;if(void 0===t){for(;i>=0;i--)if((e=this.sounds[i]).isPlaying)return!0}else for(;i>=0;i--)if((e=this.sounds[i]).key===t&&e.isPlaying)return!0;return!1},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(r,s){r&&!r.pendingRemove&&t.call(e||i,r,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=c},14747(t,e,i){var r=i(33684),s=i(25960),n=i(57490),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new s(t):i.webAudio&&!e.disableWebAudio?new n(t):new r(t)}};t.exports=a},19723(t){t.exports="complete"},98882(t){t.exports="decodedall"},57506(t){t.exports="decoded"},73146(t){t.exports="destroy"},11305(t){t.exports="detune"},40577(t){t.exports="detune"},30333(t){t.exports="mute"},20394(t){t.exports="rate"},21802(t){t.exports="volume"},1299(t){t.exports="looped"},99190(t){t.exports="loop"},97125(t){t.exports="mute"},89259(t){t.exports="pan"},79986(t){t.exports="pauseall"},17586(t){t.exports="pause"},19618(t){t.exports="play"},42306(t){t.exports="rate"},10387(t){t.exports="resumeall"},48959(t){t.exports="resume"},9960(t){t.exports="seek"},19180(t){t.exports="stopall"},98328(t){t.exports="stop"},50401(t){t.exports="unlocked"},52498(t){t.exports="volume"},14463(t,e,i){t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895(t,e,i){var r=i(30341),s=i(83419),n=i(14463),a=i(45319),o=new s({Extends:r,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,t,e,i)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!r.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.PLAY,this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(this.startTime>0)&&(!!r.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(n.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!r.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(n.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!r.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(n.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound(function(t){t.key===this.key&&t.audio&&i.push(t)},this),i.sort(function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1});var r=i[0];return this.audio=r.audio,r.reset(),r.audio=null,r.startTime=0,r.previousTime=0,!0},playCatchPromise:function(){var t=this.audio.play();t&&t.catch(function(t){console.warn(t)})},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){r.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t){if(this.isPlaying)if(this.startTime>0)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var e=this.currentMarker?this.currentMarker.start:0,i=e+this.duration,r=this.audio.currentTime;if(this.currentConfig.loop)r>=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,r-i),r=this.audio.currentTime):r<e&&(this.audio.currentTime+=e,r=this.audio.currentTime),r<this.previousTime&&this.emit(n.LOOPED,this);else if(r>=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(n.COMPLETE,this);this.previousTime=r}},destroy:function(){r.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(n.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(n.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,n.RATE,t)||(this.calculateRate(),this.emit(n.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,n.DETUNE,t)||(this.calculateRate(),this.emit(n.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(n.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},33684(t,e,i){var r=i(85034),s=i(83419),n=i(14463),a=i(64895),o=new s({Extends:r,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,r.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var r=0;r<i.length;r++)if("true"===i[r].dataset.locked)return t.locked=!0,!1;return!0}),this.locked){var e=!1,i=function(){e=!0},r=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",r);var s=[];if(t.game.cache.audio.entries.each(function(t,e){for(var i=0;i<e.length;i++){var r=e[i];"true"===r.dataset.locked&&s.push(r)}return!0}),0!==s.length){var n=s[s.length-1];n.oncanplaythrough=function(){n.oncanplaythrough=null,s.forEach(function(t){t.dataset.locked="false"}),t.unlocked=!0},s.forEach(function(t){t.load()})}}};this.once(n.UNLOCKED,function(){for(this.forEachActiveSound(function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration});this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}},this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",r,!1)}},onBlur:function(){this.forEachActiveSound(function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())})},onFocus:function(){this.onBlurPausedSounds.forEach(function(t){t.onFocus()}),this.onBlurPausedSounds.length=0},destroy:function(){r.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound(function(t){t.updateMute()}),this.emit(n.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound(function(t){t.updateVolume()}),this.emit(n.GLOBAL_VOLUME,this,t)}}});t.exports=o},23717(t,e,i){t.exports={SoundManagerCreator:i(14747),Events:i(14463),BaseSound:i(30341),BaseSoundManager:i(85034),WebAudioSound:i(71741),WebAudioSoundManager:i(57490),HTML5AudioSound:i(64895),HTML5AudioSoundManager:i(33684),NoAudioSound:i(4603),NoAudioSoundManager:i(25960)}},4603(t,e,i){var r=i(30341),s=i(83419),n=i(50792),a=i(79291),o=i(29747),h=function(){return!1},l=function(){return null},u=function(){return this},d=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=a({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:o,calculateRate:l,destroy:function(){r.prototype.destroy.call(this)}});t.exports=d},25960(t,e,i){var r=i(85034),s=i(83419),n=i(50792),a=i(4603),o=i(29747),h=new s({Extends:n,initialize:function(t){n.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return r.prototype.get.call(this,t)},getAll:function(t){return r.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return r.prototype.remove.call(this,t)},removeAll:function(){return r.prototype.removeAll.call(this)},removeByKey:function(t){return r.prototype.removeByKey.call(this,t)},stopByKey:function(t){return r.prototype.stopByKey.call(this,t)},onBlur:o,onFocus:o,onGameBlur:o,onGameFocus:o,pauseAll:o,resumeAll:o,stopAll:o,update:o,setRate:o,setDetune:o,setMute:o,setVolume:o,unlock:o,forEachActiveSound:function(t,e){r.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){r.prototype.destroy.call(this)}});t.exports=h},71741(t,e,i){var r=i(30341),s=i(83419),n=i(14463),a=i(95540),o=new s({Extends:r,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" not found in cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createPanner&&(this.spatialNode=t.context.createPanner(),this.volumeNode.connect(this.spatialNode)),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),t.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):t.context.createPanner?this.spatialNode.connect(t.destination):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,r.call(this,t,e,i)},play:function(t,e){return!!r.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(n.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!r.prototype.pause.call(this)&&(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(n.PAUSE,this),!0))},resume:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!r.prototype.resume.call(this)&&(this.createAndStartBufferSource(),this.emit(n.RESUME,this),!0))},stop:function(){return!!r.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(n.STOP,this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,r=(this.currentMarker?this.currentMarker.start:0)+t,s=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,r),Math.max(0,s)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var t=this,e=this.manager.context.createBufferSource();return e.buffer=this.audioBuffer,e.connect(this.muteNode),e.onended=function(e){var i=e.target;i!==t.source&&i!==t.loopSource||(t.currentConfig.loop?t.hasLooped=!0:t.hasEnded=!0)},e},stopAndRemoveBufferSource:function(){if(this.source){var t=this.source;this.source=null,t.stop(),t.disconnect()}this.playTime=0,this.startTime=0,this.hasEnded=!1,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1});var t=this.currentConfig.source;if(t&&this.manager.context.createPanner){var e=this.spatialNode;e.panningModel=a(t,"panningModel","equalpower"),e.distanceModel=a(t,"distanceModel","inverse"),e.orientationX.value=a(t,"orientationX",0),e.orientationY.value=a(t,"orientationY",0),e.orientationZ.value=a(t,"orientationZ",-1),e.refDistance=a(t,"refDistance",1),e.maxDistance=a(t,"maxDistance",1e4),e.rolloffFactor=a(t,"rolloffFactor",1),e.coneInnerAngle=a(t,"coneInnerAngle",360),e.coneOuterAngle=a(t,"coneOuterAngle",0),e.coneOuterGain=a(t,"coneOuterGain",0),this.spatialSource=a(t,"follow",null),this.spatialSource||(e.positionX.value=a(t,"x",0),e.positionY.value=a(t,"y",0),e.positionZ.value=a(t,"z",0))}r.prototype.applyConfig.call(this)},x:{get:function(){return this.spatialNode?this.spatialNode.positionX:0},set:function(t){this.spatialNode&&(this.spatialNode.positionX.value=t)}},y:{get:function(){return this.spatialNode?this.spatialNode.positionY:0},set:function(t){this.spatialNode&&(this.spatialNode.positionY.value=t)}},update:function(){if(this.isPlaying&&this.spatialSource){var t=a(this.spatialSource,"x",null),e=a(this.spatialSource,"y",null);t&&t!==this._spatialx&&(this._spatialx=this.spatialNode.positionX.value=t),e&&e!==this._spatialy&&(this._spatialy=this.spatialNode.positionY.value=e)}this.hasEnded?(r.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(n.COMPLETE,this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit(n.LOOPED,this))},destroy:function(){this.pendingRemove||(r.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.pannerNode&&(this.pannerNode.disconnect(),this.pannerNode=null),this.spatialNode&&(this.spatialNode.disconnect(),this.spatialNode=null,this.spatialSource=null),this.rateUpdates.length=0,this.rateUpdates=null)},calculateRate:function(){r.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++){t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate}return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit(n.RATE,this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit(n.DETUNE,this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit(n.MUTE,this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit(n.VOLUME,this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit(n.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit(n.LOOP,this,t)}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.pannerNode?this.pannerNode.pan.value:0},set:function(t){this.currentConfig.pan=t,this.pannerNode&&this.pannerNode.pan.setValueAtTime(t,this.manager.context.currentTime),this.emit(n.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},57490(t,e,i){var r=i(53134),s=i(85034),n=i(83419),a=i(14463),o=i(8443),h=i(71741),l=i(95540),u=new n({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state,s.call(this,t),this.locked&&(t.isBooted?this.unlock():t.events.once(o.BOOT,this.unlock,this)),t.events.on(o.VISIBLE,this.onGameVisible,this)},onGameVisible:function(){var t=this.context;window.setTimeout(function(){t&&(t.suspend(),t.resume())},100)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,n=i.length,o=0;o<i.length;o++){var h=i[o],l=h.key,u=h.data;"string"==typeof u&&(u=r(u));var d=function(t,e){s.add(t,e),this.emit(a.DECODED,t),0===--n&&this.emit(a.DECODED_ALL)}.bind(this,l),c=function(t,e){console.error("Error decoding audio: "+t+" - ",e?e.message:""),0===--n&&this.emit(a.DECODED_ALL)}.bind(this,l);this.context.decodeAudioData(u,d,c)}},setListenerPosition:function(t,e){return void 0===t&&(t=this.game.scale.width/2),void 0===e&&(e=this.game.scale.height/2),this.listenerPosition.set(t,e),this},unlock:function(){var t=this,e=document.body,i=function i(){if(t.context&&e){var r=e.removeEventListener.bind(e);t.context.resume().then(function(){r("touchstart",i),r("touchend",i),r("mousedown",i),r("mouseup",i),r("keydown",i),t.unlocked=!0},function(){r("touchstart",i),r("touchend",i),r("mousedown",i),r("mouseup",i),r("keydown",i)})}};e&&(e.addEventListener("touchstart",i,!1),e.addEventListener("touchend",i,!1),e.addEventListener("mousedown",i,!1),e.addEventListener("mouseup",i,!1),e.addEventListener("keydown",i,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){var t=this.context;!t||this.locked||"suspended"!==t.state&&"interrupted"!==t.state||t.resume()},update:function(t,e){var i=this.context.listener,r=l(this.listenerPosition,"x",null),n=l(this.listenerPosition,"y",null);if(i&&void 0!==i.positionX)r&&r!==this._spatialx&&(this._spatialx=i.positionX.value=r),n&&n!==this._spatialy&&(this._spatialy=i.positionY.value=n);else if(i){r&&r!==this._spatialx&&(this._spatialx=r),n&&n!==this._spatialy&&(this._spatialy=n);var a=l(i,"z",0);i.setPosition(this._spatialx||0,this._spatialy||0,a)}s.prototype.update.call(this,t,e),this.gameLostFocus||this.onFocus()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then(function(){t.context=null})}this.game.events.off(o.VISIBLE,this.onGameVisible,this),s.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit(a.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit(a.GLOBAL_VOLUME,this,t)}}});t.exports=u},73162(t,e,i){var r=i(37105),s=i(83419),n=i(29747),a=i(19186),o=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=n,this.removeCallback=n,this._sortKey=""},add:function(t,e){return e?r.Add(this.list,t):r.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?r.AddAt(this.list,t,e):r.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),a(this.list,e),this):this},getByName:function(t){return r.GetFirst(this.list,"name",t)},getRandom:function(t,e){return r.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return r.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return r.GetAll(this.list,t,e,i,s)},count:function(t,e){return r.CountAllMatching(this.list,t,e)},swap:function(t,e){r.Swap(this.list,t,e)},moveTo:function(t,e){return r.MoveTo(this.list,t,e)},moveAbove:function(t,e){return r.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return r.MoveBelow(this.list,t,e)},remove:function(t,e){return e?r.Remove(this.list,t):r.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?r.RemoveAt(this.list,t):r.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?r.RemoveBetween(this.list,t,e):r.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return r.BringToTop(this.list,t)},sendToBack:function(t){return r.SendToBack(this.list,t)},moveUp:function(t){return r.MoveUp(this.list,t),t},moveDown:function(t){return r.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(t,e){return r.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return r.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],r=2;r<arguments.length;r++)i.push(arguments[r]);for(r=0;r<this.list.length;r++)i[0]=this.list[r],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}}});t.exports=o},90330(t,e,i){var r=new(i(83419))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1]);return this},set:function(t,e){return this.has(t)||this.size++,this.entries[t]=e,this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach(function(t){delete this.entries[t]},this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,r=t.entries;for(var s in r)i.hasOwnProperty(s)&&e?i[s]=r[s]:this.set(s,r[s]);return this}});t.exports=r},25774(t,e,i){var r=i(83419),s=i(50792),n=i(82348),a=new r({Extends:s,initialize:function(){s.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,r=this._active;for(t=0;t<i.length;t++){e=i[t];var s=r.indexOf(e);-1!==s&&(r.splice(s,1),this.emit(n.PROCESS_QUEUE_REMOVE,e))}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],(!this.checkQueue||this.checkQueue&&-1===r.indexOf(e))&&(r.push(e),this.emit(n.PROCESS_QUEUE_ADD,e));return i.length=0,this._toProcess=0,r},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}});t.exports=a},59542(t,e,i){var r=i(43886);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function n(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function a(t,e){o(t,0,t.children.length,e,t)}function o(t,e,i,r,s){s||(s=v(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var n,a=e;a<i;a++)n=t.children[a],h(s,t.leaf?r(n):n);return s}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var i=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),s=Math.min(t.maxX,e.maxX),n=Math.min(t.maxY,e.maxY);return Math.max(0,s-i)*Math.max(0,n-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,i,s,n){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=s||(a=e+Math.ceil((i-e)/s/2)*s,r(t,a,e,i,n),o.push(e,a,a,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!m(t,e))return i;for(var s,n,a,o,h=[];e;){for(s=0,n=e.children.length;s<n;s++)a=e.children[s],m(t,o=e.leaf?r(a):a)&&(e.leaf?i.push(a):g(t,o)?this._all(a,i):h.push(a));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!m(t,e))return!1;for(var r,s,n,a,o=[];e;){for(r=0,s=e.children.length;r<s;r++)if(n=e.children[r],m(t,a=e.leaf?i(n):n)){if(e.leaf||g(t,a))return!0;o.push(n)}e=o.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var s=this.data;this.data=r,r=s}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=v([]),this},remove:function(t,e){if(!t)return this;for(var i,r,s,a,o=this.data,h=this.toBBox(t),l=[],u=[];o||l.length;){if(o||(o=l.pop(),r=l[l.length-1],i=u.pop(),a=!0),o.leaf&&-1!==(s=n(t,o.children,e)))return o.children.splice(s,1),l.push(o),this._condense(l),this;a||o.leaf||!g(o,h)?r?(i++,o=r.children[i],a=!1):o=null:(l.push(o),u.push(i),i=0,r=o,o=o.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,r){var s,n=i-e+1,o=this._maxEntries;if(n<=o)return a(s=v(t.slice(e,i+1)),this.toBBox),s;r||(r=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,r-1))),(s=v([])).leaf=!1,s.height=r;var h,l,u,d,c=Math.ceil(n/o),f=c*Math.ceil(Math.sqrt(o));for(y(t,e,i,f,this.compareMinX),h=e;h<=i;h+=f)for(y(t,h,u=Math.min(h+f-1,i),c,this.compareMinY),l=h;l<=u;l+=c)d=Math.min(l+c-1,u),s.children.push(this._build(t,l,d,r-1));return a(s,this.toBBox),s},_chooseSubtree:function(t,e,i,r){for(var s,n,a,o,h,l,u,c;r.push(e),!e.leaf&&r.length-1!==i;){for(u=c=1/0,s=0,n=e.children.length;s<n;s++)h=d(a=e.children[s]),(l=f(t,a)-h)<c?(c=l,u=h<u?h:u,o=a):l===c&&h<u&&(u=h,o=a);e=o||e.children[0]}return e},_insert:function(t,e,i){var r=this.toBBox,s=i?t:r(t),n=[],a=this._chooseSubtree(s,this.data,e,n);for(a.children.push(t),h(a,s);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(s,n,e)},_split:function(t,e){var i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=v(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,s,n,a,h,l,u,c;for(l=u=1/0,r=e;r<=i-e;r++)a=p(s=o(t,0,r,this.toBBox),n=o(t,r,i,this.toBBox)),h=d(s)+d(n),a<l?(l=a,c=r,u=h<u?h:u):a===l&&h<u&&(u=h,c=r);return c},_chooseSplitAxis:function(t,e,i){var r=t.leaf?this.compareMinX:l,s=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,s)&&t.children.sort(r)},_allDistMargin:function(t,e,i,r){t.children.sort(r);var s,n,a=this.toBBox,l=o(t,0,e,a),u=o(t,i-e,i,a),d=c(l)+c(u);for(s=e;s<i-e;s++)n=t.children[s],h(l,t.leaf?a(n):n),d+=c(l);for(s=i-e-1;s>=e;s--)n=t.children[s],h(u,t.leaf?a(n):n),d+=c(u);return d},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)h(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},86555(t,e,i){var r=i(45319),s=i(83419),n=i(56583),a=i(26099),o=new s({initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===r&&(r=null),this._width=t,this._height=e,this._parent=r,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=r(t,0,this.maxWidth),this.minHeight=r(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=r(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(n(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(n(t,this.snapTo.x)),this._height=this.getNewHeight(n(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=r(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var r=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio<s?(e=(t=n(t,r.x))/this.aspectRatio,r.y>0&&(t=(e=n(e,r.y))*this.aspectRatio)):(i&&this.aspectRatio<s||!i&&this.aspectRatio>s)&&(t=(e=n(e,r.y))*this.aspectRatio,r.x>0&&(e=(t=n(t,r.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},15238(t){t.exports="add"},56187(t){t.exports="remove"},82348(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392(t,e,i){t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Size:i(86555)}},57382(t,e,i){var r=i(83419),s=i(45319),n=i(40987),a=i(8054),o=i(50030),h=i(79237),l=new r({Extends:h,initialize:function(t,e,i,r,s){h.call(this,t,e,i,r,s),this.add("__BASE",0,0,0,r,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=r,this.height=s,this.imageData=this.context.getImageData(0,0,r,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i,r){return void 0===r&&(r=!0),this.context.drawImage(i,t,e),r&&this.update(),this},drawFrame:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=!0);var n=this.manager.getFrame(t,e);if(n){var a=n.canvasData,o=n.cutWidth,h=n.cutHeight,l=n.source.resolution;this.context.drawImage(n.source.image,a.x,a.y,o,h,i,r,o/l,h/l),s&&this.update()}return this},setPixel:function(t,e,i,r,s,n){if(void 0===n&&(n=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=r,a.data[2]=s,a.data[3]=n,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,r,s,n,a){return void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,r,s,n,a),this},getData:function(t,e,i,r){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),r=s(r,1,this.height-e),this.context.getImageData(t,e,i,r)},getPixel:function(t,e,i){i||(i=new n);var r=this.getIndex(t,e);if(r>-1){var s=this.data,a=s[r+0],o=s[r+1],h=s[r+2],l=s[r+3];i.setTo(a,o,h,l)}return i},getPixels:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=s(t,0,this.width),o=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+r,0,this.height),u=new n,d=[],c=h;c<l;c++){for(var f=[],p=a;p<o;p++)u=this.getPixel(p,c,u),f.push({x:p,y:c,color:u.color,alpha:u.alphaGL});d.push(f)}return d},getIndex:function(t,e){return t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e)),t<this.width&&e<this.height?4*(t+e*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),void 0===s&&(s=!0),this.context.clearRect(t,e,i,r),s&&this.update(),this},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=o(t,e),this.frames.__BASE.setSize(t,e,0,0),this.width=t,this.height=e,this.refresh()),this},destroy:function(){h.prototype.destroy.call(this),this._source=null,this.canvas=null,this.context=null,this.imageData=null,this.data=null,this.pixels=null,this.buffer=null}});t.exports=l},81320(t,e,i){var r=i(10312),s=i(38058),n=i(27919),a=i(83419),o=i(8054),h=i(87774),l=i(4327),u=i(95540),d=i(79237),c=i(70554),f=i(42538),p=i(61340),g=new a({Extends:d,initialize:function(t,e,i,r,a){void 0===i&&(i=256),void 0===r&&(r=256),void 0===a&&(a=!0),this.type="DynamicTexture";var l=t.game.renderer,u=l&&l.type===o.CANVAS,c=u?n.create2D(this,i,r):[this];(d.call(this,t,e,c,i,r),this.add("__BASE",0,0,0,i,r),this.renderer=l,this.width=-1,this.height=-1,this.commandBuffer=[],this.canvas=u?c:null,this.context=u?c.getContext("2d",{willReadFrequently:!0}):null,this.camera=new s(0,0,i,r).setScene(t.game.scene.systemScene,!1),this.drawingContext=u?null:new h(l,{width:i,height:r,camera:this.camera,autoClear:!1,enableMipmap:!0}),u)||(this.get().source.glTexture=this.drawingContext.texture);this.setSize(i,r,a)},setSize:function(t,e,i){void 0===e&&(e=t),void 0===i&&(i=!0),i&&((t=Math.floor(t))%2!=0&&t++,(e=Math.floor(e))%2!=0&&e++);var r=this.get(),s=r.source;if(t!==this.width||e!==this.height){this.canvas&&(this.canvas.width=t,this.canvas.height=e);var n=this.drawingContext;!n||n.width===t&&n.height===e||n.resize(t,e),this.camera.setSize(t,e),s.updateSize(t,e),r.setSize(t,e),this.width=t,this.height=e}else{var a=this.getSourceImage();r.cutX+t>a.width&&(t=a.width-r.cutX),r.cutY+e>a.height&&(e=a.height-r.cutY),r.setSize(t,e,r.cutX,r.cutY)}return this},render:function(){if(0!==this.commandBuffer.length)return this.camera.preRender(),this.renderer.type===o.WEBGL&&this._renderWebGL(),this.renderer.type===o.CANVAS&&this._renderCanvas(),this},_renderWebGL:function(){this.renderer.renderNodes.getNode("DynamicTextureHandler").run(this)},_renderCanvas:function(){var t,e,i,s,n,a,o,h,l,u,d,c,p,g,m,v=this.camera,y=this.context,x=this.renderer,T=this.manager;x.setContext(y);for(var w=this.commandBuffer,b=w.length,S=!1,C=!1,E=0;E<b;E++){switch(w[E]){case f.CLEAR:g=w[++E],m=w[++E],p=w[++E],n=w[++E],void 0!==g&&void 0!==m&&void 0!==p&&void 0!==n?y.clearRect(g,m,p,n):(y.save(),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,this.width,this.height),y.restore());break;case f.FILL:var A=w[++E];g=w[++E],m=w[++E],p=w[++E],n=w[++E],t=(A>>24&255)/255;var _=A>>16&255,M=A>>8&255,R=255&A;y.save(),y.globalCompositeOperation="source-over",y.fillStyle="rgba("+_+","+M+","+R+","+t+")",y.fillRect(g,m,p,n),y.restore();break;case f.STAMP:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],C&&(e=r.ERASE);var P=T.resetStamp(t,c);P.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setOrigin(o,h).setBlendMode(e),P.renderCanvas(x,P,v,null);break;case f.REPEAT:a=w[++E],s=w[++E],g=w[++E],m=w[++E],t=w[++E],c=w[++E],l=w[++E],u=w[++E],d=w[++E],o=w[++E],h=w[++E],e=w[++E],p=w[++E],n=w[++E];var O=w[++E],L=w[++E],F=w[++E],D=w[++E],I=w[++E];C&&(e=r.ERASE);var N=T.resetTileSprite(t,c);N.setPosition(g,m).setRotation(l).setScale(u,d).setTexture(a,s).setSize(p,n).setOrigin(o,h).setBlendMode(e).setTilePosition(O,L).setTileRotation(F).setTileScale(D,I),N.renderCanvas(x,N,v,null);break;case f.DRAW:var B=w[++E];if(g=w[++E],m=w[++E],void 0!==g){var k=B.x;B.x=g}if(void 0!==m){var U=B.y;B.y=m}C&&(i=B.blendMode,B.blendMode=r.ERASE),B.renderCanvas(x,B,v,null),void 0!==g&&(B.x=k),void 0!==m&&(B.y=U),C&&(B.blendMode=i);break;case f.SET_ERASE:C=!!w[++E];break;case f.PRESERVE:S=w[++E];break;case f.CALLBACK:(0,w[++E])();break;case f.CAPTURE:B=w[++E];var z=w[++E],Y=this.startCapture(B,z);B.renderCanvas(x,B,z.camera||v,Y.transform),this.finishCapture(B,Y)}}S||(w.length=0),x.setContext()},fill:function(t,e,i,r,s,n){void 0===e&&(e=1),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height);var a=t>>16&255,o=t>>8&255,h=255&t,l=c.getTintFromFloats(a/255,o/255,h/255,e);return this.commandBuffer.push(f.FILL,l,i,r,s,n),this},clear:function(t,e,i,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===r&&(r=this.height),this.commandBuffer.push(f.CLEAR,t,e,i,r),this},stamp:function(t,e,i,r,s){void 0===i&&(i=0),void 0===r&&(r=0);var n=u(s,"alpha",1),a=u(s,"tint",16777215),o=u(s,"angle",0),h=u(s,"rotation",0),l=u(s,"scale",1),d=u(s,"scaleX",l),c=u(s,"scaleY",l),p=u(s,"originX",.5),g=u(s,"originY",.5),m=u(s,"blendMode",0);return 0!==o&&(h=o*Math.PI/180),this.commandBuffer.push(f.STAMP,t,e,i,r,n,a,h,d,c,p,g,m),this},erase:function(t,e,i,r,s){var n=this.commandBuffer,a=n.length;return n[a-2]!==f.SET_ERASE||n[a-1]?n.push(f.SET_ERASE,!0):n.length-=2,this.draw(t,e,i,r,s),n.push(f.SET_ERASE,!1),this},draw:function(t,e,i,r,s){Array.isArray(t)||(t=[t]);for(var n=t.length,a=0;a<n;a++){var o=t[a];if(o&&o!==this)if(o.renderWebGL||o.renderCanvas)this.commandBuffer.push(f.DRAW,o,e,i);else if(o.isParent||o.list)for(var h=o.getChildren(),u=0;u<h.length;u++){var d=h[u];d.willRender(this.camera)&&this.draw(d,e,i)}else"string"==typeof o?this.stamp(o,null,e,i,{alpha:r,tint:s}):o instanceof l?this.stamp(o.texture.key,o,e,i,{alpha:r,tint:s}):Array.isArray(o)&&this.draw(o,e,i,r,s)}return this},capture:function(t,e){return e||(e={}),this.commandBuffer.push(f.CAPTURE,t,e),this},startCapture:function(t,e){var i={},r=void 0;return e.transform instanceof p?r=e.transform:"world"===e.transform&&t.parentContainer&&(r=t.parentContainer.getWorldTransformMatrix()),r&&(i.transform=r),e.camera&&(r||(r=new p),e.camera.matrixExternal.multiply(r,r)),void 0!==e.x&&(i.x=t.x,t.x=e.x),void 0!==e.y&&(i.y=t.y,t.y=e.y),void 0!==e.rotation?(i.rotation=t.rotation,t.rotation=e.rotation):void 0!==e.angle&&(i.rotation=t.rotation,t.angle=e.angle),void 0!==e.scaleX&&(i.scaleX=t.scaleX,t.scaleX=e.scaleX),void 0!==e.scaleY&&(i.scaleY=t.scaleY,t.scaleY=e.scaleY),void 0!==e.originX&&(i.originX=t.originX,t.originX=e.originX),void 0!==e.originY&&(i.originY=t.originY,t.originY=e.originY),void 0!==e.alpha&&(i.alpha=t.alpha,t.alpha=e.alpha),void 0!==e.tint&&(i.tint=t.tint,t.tint=e.tint),void 0!==e.blendMode&&(i.blendMode=t.blendMode,t.blendMode=e.blendMode),i},finishCapture:function(t,e){void 0!==e.x&&(t.x=e.x),void 0!==e.y&&(t.y=e.y),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scaleX&&(t.scaleX=e.scaleX),void 0!==e.scaleY&&(t.scaleY=e.scaleY),void 0!==e.originX&&(t.originX=e.originX),void 0!==e.originY&&(t.originY=e.originY),void 0!==e.alpha&&(t.alpha=e.alpha),void 0!==e.tint&&(t.tint=e.tint),void 0!==e.blendMode&&(t.blendMode=e.blendMode)},repeat:function(t,e,i,r,s,n,a){void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height);var o=u(a,"alpha",1),h=u(a,"tint",16777215),l=u(a,"angle",0),d=u(a,"rotation",0),c=u(a,"scale",1),p=u(a,"scaleX",c),g=u(a,"scaleY",c),m=u(a,"originX",0),v=u(a,"originY",0),y=u(a,"blendMode",0);0!==l&&(d=l*Math.PI/180);var x=u(a,"tilePositionX",0),T=u(a,"tilePositionY",0),w=u(a,"tileRotation",0),b=u(a,"tileScaleX",1),S=u(a,"tileScaleY",1);return this.commandBuffer.push(f.REPEAT,t,e,i,r,o,h,d,p,g,m,v,y,s,n,x,T,w,b,S),this},preserve:function(t){return this.commandBuffer.push(f.PRESERVE,t),this},callback:function(t){return this.commandBuffer.push(f.CALLBACK,t),this},snapshotArea:function(t,e,i,r,s,n,a){return this.drawingContext?this.renderer.snapshotFramebuffer(this.drawingContext.framebuffer,this.width,this.height,s,!1,t,e,i,r,n,a):this.renderer.snapshotCanvas(this.canvas,s,!1,t,e,i,r,n,a),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},getWebGLTexture:function(){if(this.drawingContext)return this.drawingContext.texture},renderWebGL:function(t,e,i,r){var s=this.manager.resetStamp();s.setTexture(this),s.setOrigin(0),s.renderWebGLStep(t,s,i,r)},renderCanvas:function(){},destroy:function(){var t=this.manager.stamp;t&&t.texture===this&&this.manager.resetStamp(),d.prototype.destroy.call(this),n.remove(this.canvas),this.drawingContext&&this.drawingContext.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});t.exports=g},42538(t){t.exports={CLEAR:0,FILL:1,STAMP:2,REPEAT:3,DRAW:4,SET_ERASE:5,PRESERVE:6,CALLBACK:7,CAPTURE:8}},4327(t,e,i){var r=i(83419),s=i(45319),n=i(79291),a=new r({initialize:function(t,e,i,r,s,n,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0},is3Slice:!1,scale9:!1,scale9Borders:{x:0,y:0,w:0,h:0}},this.setSize(n,a,r,s)},setCutPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.cutX=t,this.cutY=e,this.updateUVs()},setCutSize:function(t,e){return this.cutWidth=t,this.cutHeight=e,this.updateUVs()},setSize:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this.setCutPosition(i,r),this.setCutSize(t,e),this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,n=s.cut;n.x=i,n.y=r,n.w=t,n.h=e,n.r=i+t,n.b=r+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var a=s.drawImage;return a.x=i,a.y=r,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,r,s,n){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=r,o.w=s,o.h=n,o.r=i+s,o.b=r+n,this.x=i,this.y=r,this.width=s,this.height=n,this.halfWidth=.5*s,this.halfHeight=.5*n,this.centerX=Math.floor(s/2),this.centerY=Math.floor(n/2),this.updateUVs()},setScale9:function(t,e,i,r){var s=this.data;return s.scale9=!0,s.is3Slice=0===e&&r===this.height,s.scale9Borders.x=t,s.scale9Borders.y=e,s.scale9Borders.w=i,s.scale9Borders.h=r,this},setCropUVs:function(t,e,i,r,n,a,o){var h=this.cutX,l=this.cutY,u=this.cutWidth,d=this.cutHeight,c=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,c)),g=l+(i=s(i,0,f)),m=r=s(r,0,c-e),v=n=s(n,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(r=s(r,0,x.x+u-e)),w=i+(n=s(n,0,x.y+d-i));if(!(x.r<e||x.b<i||x.x>T||x.y>w)){var b=Math.max(x.x,e),S=Math.max(x.y,i),C=Math.min(x.r,T)-b,E=Math.min(x.b,w)-S;m=C,v=E,p=a?h+(u-(b-x.x)-C):h+(b-x.x),g=o?l+(d-(S-x.y)-E):l+(S-x.y),e=b,i=S,r=C,n=E}else p=0,g=0,m=0,v=0}else a&&(p=h+(u-e-r)),o&&(g=l+(d-i-n));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,p/A),t.v0=1-Math.max(0,g/_),t.u1=Math.min(1,(p+m)/A),t.v1=1-Math.min(1,(g+v)/_),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=m,t.ch=v,t.width=r,t.height=n,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,r,s,n){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=r,this.u1=s,this.v1=n,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,r=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=r;var n=this.source.width,a=this.source.height;return this.u0=t/n,this.v0=1-e/a,this.u1=(t+i)/n,this.v1=1-(e+r)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=1-this.cutY/e,this.u1=this.cutX/t,this.v1=1-(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},79237(t,e,i){var r=i(83419),s=i(4327),n=i(11876),a='Texture "%s" has no frame "%s"',o=new r({initialize:function(t,e,i,r,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0,this.smoothPixelArt=null;for(var a=0;a<i.length;a++)this.source.push(new n(this,i[a],r,s))},add:function(t,e,i,r,n,a){if(this.has(t))return null;var o=new s(this,t,e,i,r,n,a);return this.frames[t]=o,"__BASE"===this.firstFrame&&(this.firstFrame=t),this.frameTotal++,o},remove:function(t){return!!this.has(t)&&(this.get(t).destroy(),delete this.frames[t],!0)},has:function(t){return this.frames.hasOwnProperty(t)},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(console.warn(a,this.key,t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var r in this.frames)if("__BASE"!==r||e){var s=this.frames[r];s.sourceIndex===t&&i.push(s)}return i},getFrameBounds:function(t){void 0===t&&(t=0);for(var e=this.getFramesFromTextureSource(t,!0),i=e[0],r=i.cutX,s=i.cutY,n=i.cutX+i.cutWidth,a=i.cutY+i.cutHeight,o=1;o<e.length-1;o++){var h=e[o];h.cutX<r&&(r=h.cutX),h.cutY<s&&(s=h.cutY),h.cutX+h.cutWidth>n&&(n=h.cutX+h.cutWidth),h.cutY+h.cutHeight>a&&(a=h.cutY+h.cutHeight)}return{x:r,y:s,width:n-r,height:a-s}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(a,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setSource:function(t,e,i,r,s){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a<t.length;a++){var o=a+e,h=t[a];h instanceof n&&(h=h.source);var l=this.source[o],u=h.naturalWidth||h.videoWidth||h.width||l.width||r||0,d=h.naturalHeight||h.videoHeight||h.height||l.height||s||0;if(l){if(!i){l.updateSource(h);continue}l.destroy()}this.source[o]=new n(this,h,u,d)}},setDataSource:function(t,e,i,r,s){void 0===e&&(e=0),void 0===i&&(i=!1),Array.isArray(t)||(t=[t]);for(var a=0;a<t.length;a++){var o=a+e,h=t[a],l=this.dataSource[o],u=h.naturalWidth||h.videoWidth||h.width||l.width||r||0,d=h.naturalHeight||h.videoHeight||h.height||l.height||s||0;if(l){if(!i){l.updateSource(h);continue}l.destroy()}this.dataSource[o]=new n(this,h,u,d)}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},setSmoothPixelArt:function(t){this.smoothPixelArt=t,t&&this.setFilter(Phaser.Textures.FilterMode.LINEAR)},setWrap:function(t,e){void 0===e&&(e=t);for(var i=0;i<this.source.length;i++)this.source[i].setWrap(t,e);for(i=0;i<this.dataSource.length;i++)this.dataSource[i].setWrap(t,e)},destroy:function(){var t,e=this.source,i=this.dataSource;for(t=0;t<e.length;t++)e[t]&&e[t].destroy();for(t=0;t<i.length;t++)i[t]&&i[t].destroy();for(var r in this.frames){var s=this.frames[r];s&&s.destroy()}this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key),this.manager=null}});t.exports=o},17130(t,e,i){var r=i(27919),s=i(57382),n=i(83419),a=i(40987),o=i(8054),h=i(81320),l=i(50792),u=i(69442),d=i(4327),c=i(8443),f=i(35154),p=i(88571),g=i(30100),m=i(41212),v=i(61309),y=i(87841),x=i(79237),T=i(20839),w=new n({Extends:l,initialize:function(t){l.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=r.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.tileSprite,this.silentWarnings=!1,t.events.once(c.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(u.LOAD,this.updatePending,this),this.on(u.ERROR,this.updatePending,this);var t=this.game.config;null!==t.defaultImage&&this.addBase64("__DEFAULT",t.defaultImage),null!==t.missingImage&&this.addBase64("__MISSING",t.missingImage),null!==t.whiteImage&&this.addBase64("__WHITE",t.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(c.DESTROY,this.destroy,this),this.game.events.once(c.SYSTEM_READY,function(t){this.stamp=new p(t).setOrigin(0),this.tileSprite=new T(t,0,0,256,256,"__WHITE").setOrigin(0)},this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(u.LOAD),this.off(u.ERROR),this.emit(u.READY))},checkKey:function(t){return!(!t||"string"!=typeof t||this.exists(t))||(this.silentWarnings||console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return this.silentWarnings||console.warn("No texture found matching key: "+t),this;t=this.get(t)}var e=t.key;return this.list.hasOwnProperty(e)&&(t.destroy(),this.emit(u.REMOVE,e),this.emit(u.REMOVE_KEY+e)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,r=new Image;r.onerror=function(){i.emit(u.ERROR,t)},r.onload=function(){var e=i.create(t,r);e&&(v.Image(e,0),i.emit(u.ADD,t,e),i.emit(u.ADD_KEY+t,e),i.emit(u.LOAD,t,e))},r.src=e}return this},getBase64:function(t,e,i,s){void 0===i&&(i="image/png"),void 0===s&&(s=.92);var n="",a=this.getFrame(t,e);if(a&&(a.source.isRenderTexture||a.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(a){var o=a.canvasData,h=r.create2D(this,o.width,o.height),l=h.getContext("2d",{willReadFrequently:!0});o.width>0&&o.height>0&&l.drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=h.toDataURL(i,s),r.remove(h)}return n},addImage:function(t,e,i){var r=null;return this.checkKey(t)&&(r=this.create(t,e),v.Image(r,0),i&&r.setDataSource(i),this.emit(u.ADD,t,r),this.emit(u.ADD_KEY+t,r)),r},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var r=e.width,s=e.height;(i=this.create(t,e,r,s)).add("__BASE",0,0,0,r,s),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var r=null;if(this.checkKey(t)){if((r=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var s=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?v.JSONArray(t,e,i):v.JSONHash(t,e,i)};if(Array.isArray(i))for(var n=0;n<i.length;n++)s(r,n,i[n]);else s(r,0,i)}this.emit(u.ADD,t,r),this.emit(u.ADD_KEY+t,r)}return r},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)),i},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var s=r.create(this,e,i,o.CANVAS,!0);return this.addCanvas(t,s)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var r=null;return i?r=new s(this,t,e,e.width,e.height):this.checkKey(t)&&(r=new s(this,t,e,e.width,e.height),this.list[t]=r,this.emit(u.ADD,t,r),this.emit(u.ADD_KEY+t,r)),r},addDynamicTexture:function(t,e,i,r){var s=null;return"string"!=typeof t||this.exists(t)?t=(s=t).key:(void 0===r&&(r=!0),s=new h(this,t,e,i,r)),this.checkKey(t)?(this.list[t]=s,this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)):s=null,s},addAtlas:function(t,e,i,r){return i&&!Array.isArray(i)&&Array.isArray(i.pages)&&i.frames&&!Array.isArray(i.frames)?this.addAtlasPCT(t,e,i,r):Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,r):this.addAtlasJSONHash(t,e,i,r)},addAtlasJSONArray:function(t,e,i,r){var s=null;if(e instanceof x?(t=e.key,s=e):this.checkKey(t)&&(s=this.create(t,e)),s){if(Array.isArray(i))for(var n=1===i.length,a=0;a<s.source.length;a++){var o=n?i[0]:i[a];v.JSONArray(s,a,o)}else v.JSONArray(s,0,i);r&&s.setDataSource(r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)}return s},addAtlasJSONHash:function(t,e,i,r){var s=null;if(e instanceof x?(t=e.key,s=e):this.checkKey(t)&&(s=this.create(t,e)),s){if(Array.isArray(i))for(var n=0;n<i.length;n++)v.JSONHash(s,n,i[n]);else v.JSONHash(s,0,i);r&&s.setDataSource(r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)}return s},addAtlasPCT:function(t,e,i,r){var s=null;return e instanceof x?(t=e.key,s=e):this.checkKey(t)&&(s=this.create(t,e)),s&&(v.PCT(s,i),r&&s.setDataSource(r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addAtlasXML:function(t,e,i,r){var s=null;return e instanceof x?(t=e.key,s=e):this.checkKey(t)&&(s=this.create(t,e)),s&&(v.AtlasXML(s,0,i),r&&s.setDataSource(r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addUnityAtlas:function(t,e,i,r){var s=null;return e instanceof x?(t=e.key,s=e):this.checkKey(t)&&(s=this.create(t,e)),s&&(v.UnityYAML(s,0,i),r&&s.setDataSource(r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addSpriteSheet:function(t,e,i,r){var s=null;if(e instanceof x?(t=e.key,s=e):this.checkKey(t)&&(s=this.create(t,e)),s){var n=s.source[0].width,a=s.source[0].height;v.SpriteSheet(s,0,0,0,n,a,i),r&&s.setDataSource(r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)}return s},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=f(e,"atlas",null),r=f(e,"frame",null);if(i&&r){var s=this.get(i).get(r);if(s){var n=s.source.image;n||(n=s.source.glTexture);var a=this.create(t,n);return s.trimmed?v.SpriteSheetFromAtlas(a,s,e):v.SpriteSheet(a,0,s.cutX,s.cutY,s.cutWidth,s.cutHeight,e),this.emit(u.ADD,t,a),this.emit(u.ADD_KEY+t,a),a}}},addUint8Array:function(t,e,i,r){if(!this.checkKey(t)||e.length/4!==i*r)return null;var s=this.create(t,e,i,r);return s.add("__BASE",0,0,0,i,r),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s),s},addFlatColor:function(t,e,i,r,s){if(!this.checkKey(t)||e<=0||i<=0)return null;void 0===r&&(r=0),void 0===s&&(s=0);for(var n=g(r),a=n.red,o=n.green,h=n.blue,l=new Uint8Array(e*i*4),u=0;u<e*i;u++)l[4*u]=a,l[4*u+1]=o,l[4*u+2]=h,l[4*u+3]=255*s;return this.addUint8Array(t,l,e,i)},create:function(t,e,i,r){var s=null;return this.checkKey(t)&&(s=new x(this,t,e,i,r),this.list[t]=s),s},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:t instanceof x?t:t instanceof d?t.texture:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},parseFrame:function(t){if(t)return"string"==typeof t?this.getFrame(t):Array.isArray(t)&&2===t.length?this.getFrame(t[0],t[1]):m(t)?this.getFrame(t.key,t.frame):t instanceof x?t.get():t instanceof d?t:void 0},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&"__WHITE"!==e&&"__NORMAL"!==e&&t.push(e);return t},getPixel:function(t,e,i,r){var s=this.getFrame(i,r);if(s){var n=s.source,o=n.image;if(!(n.isCanvas||n.isVideo||o instanceof HTMLImageElement))return console.warn("TextureManager.getPixelAlpha: The texture source must be Image, Canvas, or Video"),null;t-=s.x,e-=s.y;var h=s.data.cut;if(t+=h.x,e+=h.y,t>=h.x&&t<h.r&&e>=h.y&&e<h.b){var l=this._tempContext;l.clearRect(0,0,1,1),l.drawImage(o,t,e,1,1,0,0,1,1);var u=l.getImageData(0,0,1,1);return new a(u.data[0],u.data[1],u.data[2],u.data[3])}}return null},getPixelAlpha:function(t,e,i,r){var s=this.getFrame(i,r);if(s){var n=s.source,a=n.image;if(!(n.isCanvas||n.isVideo||a instanceof HTMLImageElement))return console.warn("TextureManager.getPixelAlpha: The texture source must be Image, Canvas, or Video"),null;t-=s.x,e-=s.y;var o=s.data.cut;if(t+=o.x,e+=o.y,t>=o.x&&t<o.r&&e>=o.y&&e<o.b){var h=this._tempContext;return h.clearRect(0,0,1,1),h.drawImage(a,t,e,1,1,0,0,1,1),h.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e)&&(i.key=e,this.list[e]=i,delete this.list[t],!0)},each:function(t,e){for(var i=[null],r=1;r<arguments.length;r++)i.push(arguments[r]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},resetStamp:function(t,e){void 0===t&&(t=1),void 0===e&&(e=16777215);var i=this.stamp;return i.setCrop(),i.setPosition(0),i.setAngle(0),i.setScale(1),i.setAlpha(t),i.setTint(e),i.setTexture("__WHITE"),i},resetTileSprite:function(t,e){void 0===t&&(t=1),void 0===e&&(e=16777215);var i=this.tileSprite;return i.setPosition(0),i.setAngle(0),i.setScale(1),i.setAlpha(t),i.setTint(e),i.setTexture("__WHITE"),i},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.stamp.destroy(),this.game=null,this.stamp=null,r.remove(this._tempCanvas)}});t.exports=w},11876(t,e,i){var r=i(27919),s=i(83419),n=i(50030),a=i(29795),o=i(82751),h=new s({initialize:function(t,e,i,r,s){void 0===s&&(s=!0);var h=t.manager.game;this.renderer=h.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=r||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type||"DynamicTexture"===e.type,this.isGLTexture=e instanceof o,this.isPowerOf2=n(this.width,this.height),this.glTexture=null,this.flipY=s,this.init(h)},init:function(t){var e=this.renderer;if(e){var i=this.source;if(e.gl){var r=this.image,s=this.flipY,n=this.width,a=this.height,o=this.scaleMode;this.isCanvas?this.glTexture=e.createCanvasTexture(r,!1,s):this.isVideo?this.glTexture=e.createVideoTexture(r,!1,s):this.isRenderTexture?this.glTexture=e.createTextureFromSource(null,n,a,o,void 0,s):this.isGLTexture?this.glTexture=i:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(i,void 0,void 0,o,void 0,s):i instanceof Uint8Array?this.glTexture=e.createUint8ArrayTexture(i,n,a,void 0,s):this.glTexture=e.createTextureFromSource(r,n,a,o,void 0,s)}else this.isRenderTexture&&(this.image=i.canvas)}t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),t===this.flipY||(this.flipY=t,this.update()),this},setWrap:function(t,e){return this.renderer&&this.renderer.gl&&this.renderer.setTextureWrap(this.glTexture,t,e),this},update:function(){var t=this.renderer,e=this.image,i=this.flipY;if(t.gl){var r=this.glTexture;this.isCanvas?t.updateCanvasTexture(e,r,i):this.isVideo?t.updateVideoTexture(e,r,i):r.update(this.source,this.width,this.height,i,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format)}},updateSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.isPowerOf2=n(t,e))},updateSource:function(t){!this.isCanvas||t===this.image||t instanceof HTMLCanvasElement||r.remove(this.image),this.source=t,this.image=t.compressed?null:t,this.compressionAlgorithm=t.compressed?t.format:null,this.width=t.naturalWidth||t.videoWidth||t.width||0,this.height=t.naturalHeight||t.videoHeight||t.height||0,this.isPowerOf2=n(this.width,this.height),this.isCanvas=t instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&t instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===t.type||"DynamicTexture"===t.type,this.isGLTexture=t instanceof o,this.update()},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&r.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=h},43378(t){t.exports={CLAMP_TO_EDGE:33071,REPEAT:10497,MIRRORED_REPEAT:33648}},19673(t){t.exports={LINEAR:0,NEAREST:1}},44538(t){t.exports="addtexture"},63486(t){t.exports="addtexture-"},94851(t){t.exports="onerror"},29099(t){t.exports="onload"},8678(t){t.exports="ready"},86415(t){t.exports="removetexture"},30879(t){t.exports="removetexture-"},69442(t,e,i){t.exports={ADD:i(44538),ADD_KEY:i(63486),ERROR:i(94851),LOAD:i(29099),READY:i(8678),REMOVE:i(86415),REMOVE_KEY:i(30879)}},27458(t,e,i){var r=i(79291),s=i(19673),n=i(43378),a={CanvasTexture:i(57382),DynamicTexture:i(81320),Events:i(69442),FilterMode:s,Frame:i(4327),Parsers:i(61309),Texture:i(79237),TextureManager:i(17130),TextureSource:i(11876),WrapMode:n};a=r(!1,a,s),a=r(!1,a,n),t.exports=a},89905(t){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);for(var s,n=i.getElementsByTagName("SubTexture"),a=0;a<n.length;a++){var o=n[a].attributes,h=o.name.value,l=parseInt(o.x.value,10),u=parseInt(o.y.value,10),d=parseInt(o.width.value,10),c=parseInt(o.height.value,10);if(s=t.add(h,e,l,u,d,c),o.frameX){var f=Math.abs(parseInt(o.frameX.value,10)),p=Math.abs(parseInt(o.frameY.value,10)),g=parseInt(o.frameWidth.value,10),m=parseInt(o.frameHeight.value,10);s.setTrim(g,m,f,p,d,c)}}return t}console.warn("Invalid Texture Atlas XML given")}},72893(t){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},4832(t){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},78566(t,e,i){var r=i(41786);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,a=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o<a.length;o++){var h=a[o];if(n=t.add(h.filename,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&n.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(n.rotated=!0,n.updateUVsInverted());var l=h.anchor||h.pivot;l&&(n.customPivot=!0,n.pivotX=l.x,n.pivotY=l.y),h.scale9Borders&&n.setScale9(h.scale9Borders.x,h.scale9Borders.y,h.scale9Borders.w,h.scale9Borders.h),n.customData=r(h)}else console.warn("Invalid atlas json, frame already exists: "+h.filename)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Array")}},39711(t,e,i){var r=i(41786);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var n,a=i.frames;for(var o in a)if(a.hasOwnProperty(o)){var h=a[o];if(n=t.add(o,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&n.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(n.rotated=!0,n.updateUVsInverted());var l=h.anchor||h.pivot;l&&(n.customPivot=!0,n.pivotX=l.x,n.pivotY=l.y),h.scale9Borders&&n.setScale9(h.scale9Borders.x,h.scale9Borders.y,h.scale9Borders.w,h.scale9Borders.h),n.customData=r(h)}else console.warn("Invalid atlas json, frame already exists: "+o)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},31403(t){t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],r=new Uint8Array(t,0,12);for(e=0;e<r.length;e++)if(r[e]!==i[e])return void console.warn("KTXParser - Invalid file format");var s=Uint32Array.BYTES_PER_ELEMENT,n=new DataView(t,12,13*s),a=67305985===n.getUint32(0,!0);if(0===n.getUint32(1*s,a)){var o=n.getUint32(4*s,a),h=n.getUint32(6*s,a),l=n.getUint32(7*s,a),u=Math.max(1,n.getUint32(11*s,a)),d=n.getUint32(12*s,a),c=new Array(u),f=64+d,p=h,g=l;for(e=0;e<u;e++){var m=new Int32Array(t,f,1)[0];f+=4,c[e]={data:new Uint8Array(t,f,m),width:p,height:g},p=Math.max(1,p>>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:c,width:h,height:l,internalFormat:o,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},41942(t){t.exports=function(t,e){if(e&&e.frames&&e.pages){var i=t.source[0];t.add("__BASE",0,0,0,i.width,i.height);var r=e.frames;for(var s in r)if(r.hasOwnProperty(s)){var n=r[s],a=0|n.page;if(a>=t.source.length)console.warn('PCT atlas frame "'+s+'" references missing page '+a);else{var o=t.add(n.key||s,a,n.x,n.y,n.w,n.h);o?(n.trimmed&&o.setTrim(n.sourceW,n.sourceH,n.trimX,n.trimY,n.w,n.h),n.rotated&&(o.rotated=!0,o.updateUVsInverted())):console.warn("Invalid PCT atlas, frame already exists: "+s)}}return t.customData.pct={pages:e.pages,folders:e.folders},t}console.warn("Invalid PCT atlas data given")}},39620(t){var e={1:".png",2:".webp",3:".jpg",4:".jpeg",5:".gif"},i=function(t,e){for(var i=String(t);i.length<e;)i="0"+i;return i},r=function(t,i,r){var s=t,n="",a=s.indexOf("/");a>0&&function(t){if(0===t.length)return!1;for(var e=0;e<t.length;e++){var i=t.charCodeAt(e);if(i<48||i>57)return!1}return!0}(s.substring(0,a))&&(n=i[parseInt(s.substring(0,a),10)],s=s.substring(a+1));var o=/~([1-5])$/.exec(s);if(o){var h=e[parseInt(o[1],10)];s=s.substring(0,s.length-2)+h}else r&&(s+=r);return n?n+"/"+s:s},s=function(t,s){var n="",a=/~([1-5])$/.exec(t);a&&(n=e[parseInt(a[1],10)],t=t.substring(0,t.length-2));for(var o=[],h=t.split(","),l=0;l<h.length;l++){var u=h[l],d=u.indexOf("#");if(d>=0)for(var c=u.substring(0,d),f=u.substring(d+1),p=f.indexOf("-"),g=f.substring(0,p),m=f.substring(p+1),v=parseInt(g,10),y=parseInt(m,10),x=g.length>1&&"0"===g.charAt(0)?g.length:0,T=v;T<=y;T++){var w=x>0?i(T,x):String(T);o.push(r(c+w,s,n))}else o.push(r(u,s,n))}return o};t.exports=function(t){if("string"!=typeof t||0===t.length)return console.warn("Invalid PCT file: empty or not a string"),null;var e=t.split("\n"),i=e[0];if(13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),!i||0!==i.indexOf("PCT:"))return console.warn("Not a PCT file: missing PCT: header"),null;var n=i.substring(4),a=n.split("."),o=parseInt(a[0],10);if(isNaN(o)||o>1)return console.warn("Unsupported PCT version: "+n),null;for(var h=[],l=[],u={},d=0,c=null,f=1;f<e.length;f++){var p=e[f];if(p&&(13!==p.charCodeAt(p.length-1)||(p=p.substring(0,p.length-1))))if(null===c){var g=p.substring(0,2);if("P:"===g){var m=p.substring(2).split(",");h.push({filename:m[0],format:m[1],width:parseInt(m[2],10),height:parseInt(m[3],10),padding:parseInt(m[4],10)})}else if("F:"===g)l.push(p.substring(2));else if("#"===p.charAt(0))d=parseInt(p.substring(1),10);else if("B:"===g){var v=p.substring(2).split("|"),y=v[0].split(","),x={page:d,x:parseInt(y[0],10),y:parseInt(y[1],10),cols:parseInt(y[2],10),frameW:parseInt(y[3],10),frameH:parseInt(y[4],10),trimmed:v.length>1};if(x.trimmed){var T=v[1].split(",");x.sourceW=parseInt(T[0],10),x.sourceH=parseInt(T[1],10),x.trimX=parseInt(T[2],10),x.trimY=parseInt(T[3],10)}c=x}else if("A:"===g){var w=p.indexOf("=",2);if(-1===w)continue;var b=r(p.substring(2,w),l,""),S=s(p.substring(w+1),l),C=u[b];if(C)for(var E=0;E<S.length;E++){var A=S[E],_={};for(var M in C)_[M]=C[M];_.key=A,u[A]=_}}else{var R=p.split("|");if(R.length<3)continue;var P=r(R[0],l,""),O=parseInt(R[1],10),L=!!(2&O),F=R[2].split(","),D={key:P,page:d,x:parseInt(F[0],10),y:parseInt(F[1],10),w:parseInt(F[2],10),h:parseInt(F[3],10),trimmed:L,rotated:!!(1&O)};if(L){var I=R[3].split(",");D.sourceW=parseInt(I[0],10),D.sourceH=parseInt(I[1],10),D.trimX=parseInt(I[2],10),D.trimY=parseInt(I[3],10)}else D.sourceW=D.w,D.sourceH=D.h,D.trimX=0,D.trimY=0;u[P]=D}}else{var N=c;c=null;for(var B=h[N.page].padding,k=N.frameW+2*B,U=N.frameH+2*B,z=s(p,l),Y=0;Y<z.length;Y++){var X=Y%N.cols,W=Math.floor(Y/N.cols),G=z[Y],V={key:G,page:N.page,x:N.x+X*k+B,y:N.y+W*U+B,w:N.frameW,h:N.frameH,trimmed:N.trimmed,rotated:!1};N.trimmed?(V.sourceW=N.sourceW,V.sourceH=N.sourceH,V.trimX=N.trimX,V.trimY=N.trimY):(V.sourceW=N.frameW,V.sourceH=N.frameH,V.trimX=0,V.trimY=0),u[G]=V}}}return{pages:h,folders:l,frames:u}}},82038(t){function e(t,e,i,r,s,n,a){return void 0===a&&(a=16),Math.floor((t+i)/s)*Math.floor((e+r)/n)*a}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function r(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function s(t,e){return Math.ceil(t/4)*Math.ceil(e/4)*16}function n(t,i){return e(t,i,3,3,4,4,8)}function a(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:[35841]},1:{sizeFunc:i,glFormat:[35843]},2:{sizeFunc:r,glFormat:[35840]},3:{sizeFunc:r,glFormat:[35842]},6:{sizeFunc:n,glFormat:[36196]},7:{sizeFunc:n,glFormat:[33776,35916]},8:{sizeFunc:a,glFormat:[33777,35917]},9:{sizeFunc:a,glFormat:[33778,35918]},11:{sizeFunc:a,glFormat:[33779,35919]},14:{sizeFunc:s,glFormat:[36494,36495]},15:{sizeFunc:s,glFormat:[36492,36493]},22:{sizeFunc:n,glFormat:[37492,37493]},23:{sizeFunc:a,glFormat:[37496,37497]},24:{sizeFunc:n,glFormat:[37494,37495]},25:{sizeFunc:n,glFormat:[37488]},26:{sizeFunc:a,glFormat:[37490]},27:{sizeFunc:a,glFormat:[37808,37840]},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:[37809,37841]},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:[37810,37842]},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:[37811,37843]},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:[37812,37844]},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:[37813,37845]},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:[37814,37846]},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:[37815,37847]},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:[37816,37848]},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:[37817,37849]},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:[37818,37850]},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:[37819,37851]},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:[37820,37852]},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:[37821,37853]}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=55727696===e[0]?e[2]:e[3],r=e[4],s=o[i].glFormat[r],n=o[i].sizeFunc,a=e[11],h=e[7],l=e[6],u=52+e[12],d=new Uint8Array(t,u),c=new Array(a),f=0,p=h,g=l,m=0;m<a;m++){var v=n(p,g);c[m]={data:new Uint8Array(d.buffer,d.byteOffset+f,v),width:p,height:g},p=Math.max(1,p>>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:c,width:h,height:l,internalFormat:s,compressed:!0,generateMipmap:!1}}},75549(t,e,i){var r=i(95540);t.exports=function(t,e,i,s,n,a,o){var h=r(o,"frameWidth",null),l=r(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var d=r(o,"startFrame",0),c=r(o,"endFrame",-1),f=r(o,"margin",0),p=r(o,"spacing",0),g=Math.floor((n-f+p)/(h+p))*Math.floor((a-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(d>g||d<-g)&&(d=0),d<0&&(d=g+d),(-1===c||c>g||c<d)&&(c=g);for(var m=f,v=f,y=0,x=0,T=0,w=0;w<g;w++){y=0,x=0;var b=m+h,S=v+l;b>n&&(y=b-n),S>a&&(x=S-a),w>=d&&w<=c&&(t.add(T,e,i+m,s+v,h-y,l-x),T++),(m+=h+p)+h>n&&(m=f,v+=l+p)}return t}},47534(t,e,i){var r=i(95540);t.exports=function(t,e,i){var s=r(i,"frameWidth",null),n=r(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=r(i,"startFrame",0),l=r(i,"endFrame",-1),u=r(i,"margin",0),d=r(i,"spacing",0),c=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,m=e.realWidth,v=e.realHeight,y=Math.floor((m-u+d)/(s+d)),x=Math.floor((v-u+d)/(n+d)),T=y*x,w=e.x,b=s-w,S=s-(m-p-w),C=e.y,E=n-C,A=n-(v-g-C);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var _=u,M=u,R=0,P=0;P<x;P++){for(var O=0===P,L=P===x-1,F=0;F<y;F++){var D=0===F,I=F===y-1;if(o=t.add(R,0,c+_,f+M,s,n),D||O||I||L){var N=D?w:0,B=O?C:0,k=0,U=0;D&&(k+=s-b),I&&(k+=s-S),O&&(U+=n-E),L&&(U+=n-A);var z=s-k,Y=n-U;o.cutWidth=z,o.cutHeight=Y,o.setTrim(s,n,N,B,z,Y)}_+=d,_+=D?b:I?S:s,R++}_=u,M+=d,M+=O?E:L?A:n}return t}},86147(t){var e=0,i=function(t,i,r,s){var n=e-s.y-s.height;t.add(r,i,s.x,n,s.width,s.height)};t.exports=function(t,r,s){var n=t.source[r];t.add("__BASE",r,0,0,n.width,n.height),e=n.height;for(var a=s.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},d=0;d<a.length;d++){var c=a[d].match(o);if(c){var f="- "===c[1],p=c[2],g=c[3];if(f&&(l!==h&&(i(t,r,l,u),h=l),u={x:0,y:0,width:0,height:0}),"name"!==p)switch(p){case"x":case"y":case"width":case"height":u[p]=parseInt(g,10)}else l=g}}return l!==h&&i(t,r,l,u),t}},55222(t,e,i){var r=i(50030);function s(t){for(var e=t.mipmaps,i=0;i<e.length;i++){var r=e[i].width,s=e[i].height;if((r<<i)%4!=0||(s<<i)%4!=0)return console.warn("BPTC, RGTC, and S3TC dimensions must be a multiple of 4 pixels, and each successive mip level must be half the size of the previous level, rounded down. Mip level "+i+" is "+r+"x"+s),!1}return!0}function n(){return!0}function a(t){var e=t.mipmaps[0];return!!r(e.width,e.height)||(console.warn("PVRTC base dimensions must be power of two. Base level is "+e.width+"x"+e.height),!1)}function o(t){var e=t.mipmaps[0];return e.width%4==0&&e.height%4==0||(console.warn("S3TC SRGB base dimensions must be a multiple of 4 pixels. Base level is "+e.width+"x"+e.height+" pixels"),!1)}var h={37488:n,37489:n,37490:n,37491:n,37492:n,37493:n,37494:n,37495:n,37496:n,37497:n,36196:n,37808:n,37809:n,37810:n,37811:n,37812:n,37813:n,37814:n,37815:n,37816:n,37817:n,37818:n,37819:n,37820:n,37821:n,37840:n,37841:n,37842:n,37843:n,37844:n,37845:n,37846:n,37847:n,37848:n,37849:n,37850:n,37851:n,37852:n,37853:n,36492:s,36493:s,36494:s,36495:s,36283:s,36284:s,36285:s,36286:s,35840:a,35841:a,35842:a,35843:a,33776:s,33777:s,33778:s,33779:s,35916:o,35917:o,35918:o,35919:o};t.exports=function(t){for(var e=t.mipmaps,i=1;i<e.length;i++){var s=e[i].width,n=e[i].height;if(!r(s,n))return console.warn("Mip level "+i+" is not a power-of-two size: "+s+"x"+n),!1}var a=h[t.internalFormat];return a?a(t):(console.warn("No format checker found for internal format "+t.internalFormat+". Assuming valid."),!0)}},61309(t,e,i){t.exports={AtlasXML:i(89905),Canvas:i(72893),Image:i(4832),JSONArray:i(78566),JSONHash:i(39711),KTXParser:i(31403),PCT:i(41942),PCTDecode:i(39620),PVRParser:i(82038),SpriteSheet:i(75549),SpriteSheetFromAtlas:i(47534),UnityYAML:i(86147)}},80341(t){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s,n,a){(void 0===i||i<=0)&&(i=32),(void 0===r||r<=0)&&(r=32),void 0===s&&(s=0),void 0===n&&(n=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|r,this.imageMargin=0|s,this.imageSpacing=0|n,this.properties=a||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e,i,r){return this.images.push({gid:t,image:e,width:i,height:r}),this.total++,this}});t.exports=r},27462(t,e,i){var r=new(i(83419))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e<t.length;++e)for(var i=t[e],r=0;r<i.total;++r)this.gids[i.firstgid+r]=i;this._gids=this.gids},enabled:{get:function(){return!!this.gids},set:function(t){this.gids=t?this._gids:void 0}},getTypeIncludingTile:function(t){if(void 0!==t.type&&""!==t.type)return t.type;if(this.gids&&void 0!==t.gid){var e=this.gids[t.gid];if(e){var i=e.getTileData(t.gid);if(i)return i.type}}},setTextureAndFrame:function(t,e,i,r){if(null===e&&this.gids&&void 0!==r.gid){var s=this.gids[r.gid];s&&(null===e&&void 0!==s.image&&(e=s.image.key),null===i&&(i=r.gid-s.firstgid),t.scene.textures.getFrame(e,i)||(e=null,i=null))}t.setTexture(e,i)},setPropertiesFromTiledObject:function(t,e){if(void 0!==this.gids&&void 0!==e.gid){var i=this.gids[e.gid];void 0!==i&&this.setFromJSON(t,i.getTileProperties(e.gid))}this.setFromJSON(t,e.properties)},setFromJSON:function(t,e){if(e)if(Array.isArray(e))for(var i=0;i<e.length;i++){var r=e[i];void 0!==t[r.name]?t[r.name]=r.value:t.setData(r.name,r.value)}else for(var s in e)void 0!==t[s]?t[s]=e[s]:t.setData(s,e[s])}});t.exports=r},31989(t,e,i){var r=i(80341),s=i(87010),n=i(46177),a=i(49075);t.exports=function(t,e,i,o,h,l,u,d){void 0===i&&(i=32),void 0===o&&(o=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===d&&(d=!1);var c=null;if(Array.isArray(u))c=n(void 0!==e?e:"map",r.ARRAY_2D,u,i,o,d);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?c=n(e,f.format,f.data,i,o,d):console.warn("No map data found for key "+e)}return null===c&&(c=new s({tileWidth:i,tileHeight:o,width:h,height:l})),new a(t,c)}},23029(t,e,i){var r=i(83419),s=i(31401),n=i(91907),a=i(62644),o=i(93232),h=i(84322),l=new r({Mixins:[s.AlphaSingle,s.Flip,s.Visible],initialize:function(t,e,i,r,s,n,a,o){this.layer=t,this.index=e,this.x=i,this.y=r,this.width=s,this.height=n,this.right,this.bottom,this.baseWidth=void 0!==a?a:s,this.baseHeight=void 0!==o?o:n,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.tintMode=h.MULTIPLY,this.physics={}},containsPoint:function(t,e){return!(t<this.pixelX||e<this.pixelY||t>this.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=a(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,r){return!(i<=this.pixelX||r<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,r,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===r&&(r=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=r,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=r,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,r){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==r&&(this.baseHeight=r),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e,i,r=this.layer.staggerAxis,s=this.layer.staggerIndex,a=this.layer.hexSideLength;"y"===r?(i=(this.baseHeight-a)/2+a,this.pixelX="odd"===s?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===r&&(e=(this.baseWidth-a)/2+a,this.pixelX=this.x*e,this.pixelY="odd"===s?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=l},49075(t,e,i){var r=i(84101),s=i(83419),n=i(39506),a=i(80341),o=i(95540),h=i(14977),l=i(27462),u=i(91907),d=i(36305),c=i(19133),f=i(68287),p=i(23029),g=i(81086),m=i(44731),v=i(53180),y=i(20442),x=i(33629),T=new s({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,s,n,o,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var d=u.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[c];return f?((i||s)&&f.setTileSize(i,s),(n||o)&&f.setSpacing(n,o),f.setImage(d),f):(void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new x(t,h,i,s,n,o,void 0,void 0,l)).setImage(d),this.tilesets.push(f),this.tiles=r(this),f)},copy:function(t,e,i,r,s,n,a,o){return null!==(o=this.getLayer(o))?(g.Copy(t,e,i,r,s,n,a,o),this):null},createBlankLayer:function(t,e,i,r,s,n,a,o){if(void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=this.width),void 0===n&&(n=this.height),void 0===a&&(a=this.tileWidth),void 0===o&&(o=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:a,tileHeight:o,width:s,height:n,orientation:this.orientation,hexSideLength:this.hexSideLength}),d=0;d<n;d++){l=[];for(var c=0;c<s;c++)l.push(new p(u,-1,c,d,a,o,this.tileWidth,this.tileHeight));u.data.push(l)}this.layers.push(u),this.currentLayerIndex=this.layers.length-1;var f=new y(this.scene,this,this.currentLayerIndex,e,i,r);return f.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(f),f},createLayer:function(t,e,i,r,s){var n=this.getLayerIndex(t);if(null===n)return console.warn("Invalid Tilemap Layer ID: "+t),"string"==typeof t&&console.warn("Valid tilelayer names: %o",this.getTileLayerNames()),null;var a,o=this.layers[n];return o.tilemapLayer?(console.warn("Tilemap Layer ID already exists:"+t),null):(this.currentLayerIndex=n,void 0===i&&(i=o.x),void 0===r&&(r=o.y),s?(Array.isArray(e)&&(e.length>1&&console.warn("TilemapGPULayer can only use one tileset. Using the first item given."),e=e[0]),a=new v(this.scene,this,n,e,i,r)):(a=new y(this.scene,this,n,e,i,r)).setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(a),a)},createFromObjects:function(t,e,i){void 0===i&&(i=!0);var r=[],s=this.getObjectLayer(t);if(!s)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),r;var a=new l(i?this.tilesets:void 0);Array.isArray(e)||(e=[e]);var h=s.objects;e.sortByY&&h.sort(function(t,e){return t.y>e.y?1:-1});for(var c=0;c<e.length;c++){var p,g=e[c],m=o(g,"id",null),v=o(g,"gid",null),y=o(g,"name",null),x=o(g,"type",null);a.enabled=!o(g,"ignoreTileset",null);for(var T=[],w=0;w<h.length;w++)p=h[w],(null===m&&null===v&&null===y&&null===x||null!==m&&p.id===m||null!==v&&p.gid===v||null!==y&&p.name===y||null!==x&&a.getTypeIncludingTile(p)===x)&&T.push(p);for(var b=o(g,"classType",f),S=o(g,"scene",this.scene),C=o(g,"container",null),E=o(g,"key",null),A=o(g,"frame",null),_=0;_<T.length;_++){p=T[_];var M=new b(S);if(M.setName(p.name),M.setPosition(p.x,p.y),a.setTextureAndFrame(M,E,A,p),p.width&&(M.displayWidth=p.width),p.height&&(M.displayHeight=p.height),this.orientation===u.ISOMETRIC){var R=this.tileWidth/this.tileHeight,P={x:M.x-M.y,y:(M.x+M.y)/R};M.x=P.x,M.y=P.y}var O={x:M.originX*p.width,y:(M.originY-(p.gid?1:0))*p.height};if(p.rotation){var L=n(p.rotation);d(O,L),M.rotation=L}M.x+=O.x,M.y+=O.y,void 0===p.flippedHorizontal&&void 0===p.flippedVertical||M.setFlip(p.flippedHorizontal,p.flippedVertical),p.visible||(M.visible=!1),a.setPropertiesFromTiledObject(M,p),C?C.add(M):S.add.existing(M),r.push(M)}}return r},createFromTiles:function(t,e,i,r,s,n){return null===(n=this.getLayer(n))?null:g.CreateFromTiles(t,e,i,r,s,n)},fill:function(t,e,i,r,s,n,a){return void 0===n&&(n=!0),null===(a=this.getLayer(a))?null:(g.Fill(t,e,i,r,s,n,a),this)},filterObjects:function(t,e,i){if("string"==typeof t){var r=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+r),null}return t.objects.filter(e,i)},filterTiles:function(t,e,i,r,s,n,a,o){return null===(o=this.getLayer(o))?null:g.FilterTiles(t,e,i,r,s,n,a,o)},findByIndex:function(t,e,i,r){return null===(r=this.getLayer(r))?null:g.FindByIndex(t,e,i,r)},findObject:function(t,e,i){if("string"==typeof t){var r=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+r),null}return t.objects.find(e,i)||null},findTile:function(t,e,i,r,s,n,a,o){return null===(o=this.getLayer(o))?null:g.FindTile(t,e,i,r,s,n,a,o)},forEachTile:function(t,e,i,r,s,n,a,o){return null===(o=this.getLayer(o))?null:(g.ForEachTile(t,e,i,r,s,n,a,o),this)},getImageIndex:function(t){return this.getIndex(this.images,t)},getImageLayerNames:function(){return this.images&&Array.isArray(this.images)?this.images.map(function(t){return t.name}):[]},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getObjectLayerNames:function(){return this.objects&&Array.isArray(this.objects)?this.objects.map(function(t){return t.name}):[]},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof m&&t.tilemap===this?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,r){return null===(r=this.getLayer(r))?null:g.GetTileAt(t,e,i,r)},getTileAtWorldXY:function(t,e,i,r,s){return null===(s=this.getLayer(s))?null:g.GetTileAtWorldXY(t,e,i,r,s)},getTileLayerNames:function(){return this.layers&&Array.isArray(this.layers)?this.layers.map(function(t){return t.name}):[]},getTilesWithin:function(t,e,i,r,s,n){return null===(n=this.getLayer(n))?null:g.GetTilesWithin(t,e,i,r,s,n)},getTilesWithinShape:function(t,e,i,r){return null===(r=this.getLayer(r))?null:g.GetTilesWithinShape(t,e,i,r)},getTilesWithinWorldXY:function(t,e,i,r,s,n,a){return null===(a=this.getLayer(a))?null:g.GetTilesWithinWorldXY(t,e,i,r,s,n,a)},getTileset:function(t){var e=this.getIndex(this.tilesets,t);return null!==e?this.tilesets[e]:null},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:g.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,r){return null===(r=this.getLayer(r))?null:g.HasTileAtWorldXY(t,e,i,r)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,r,s){return void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:g.PutTileAt(t,e,i,r,s)},putTileAtWorldXY:function(t,e,i,r,s,n){return void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:g.PutTileAtWorldXY(t,e,i,r,s,n)},putTilesAt:function(t,e,i,r,s){return void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:(g.PutTilesAt(t,e,i,r,s),this)},randomize:function(t,e,i,r,s,n){return null===(n=this.getLayer(n))?null:(g.Randomize(t,e,i,r,s,n),this)},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))?null:(g.CalculateFacesAt(t,e,i),this)},calculateFacesWithin:function(t,e,i,r,s){return null===(s=this.getLayer(s))?null:(g.CalculateFacesWithin(t,e,i,r,s),this)},removeLayer:function(t){var e=this.getLayerIndex(t);if(null!==e){c(this.layers,e);for(var i=e;i<this.layers.length;i++)this.layers[i].tilemapLayer&&this.layers[i].tilemapLayer.layerIndex--;return this.currentLayerIndex===e&&(this.currentLayerIndex=0),this}return null},destroyLayer:function(t){var e=this.getLayerIndex(t);return null!==e?((t=this.layers[e]).tilemapLayer.destroy(),c(this.layers,e),this.currentLayerIndex===e&&(this.currentLayerIndex=0),this):null},removeAllLayers:function(){for(var t=this.layers,e=0;e<t.length;e++)t[e].tilemapLayer&&t[e].tilemapLayer.destroy(!1);return t.length=0,this.currentLayerIndex=0,this},removeTile:function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=!0);var r=[];Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++){var n=t[s];r.push(this.removeTileAt(n.x,n.y,!0,i,n.tilemapLayer)),e>-1&&this.putTileAt(e,n.x,n.y,i,n.tilemapLayer)}return r},removeTileAt:function(t,e,i,r,s){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:g.RemoveTileAt(t,e,i,r,s)},removeTileAtWorldXY:function(t,e,i,r,s,n){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAtWorldXY(t,e,i,r,s,n)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,r=0;r<i.length;r++)g.RenderDebug(t,e,i[r]);return this},replaceByIndex:function(t,e,i,r,s,n,a){return null===(a=this.getLayer(a))?null:(g.ReplaceByIndex(t,e,i,r,s,n,a),this)},setCollision:function(t,e,i,r,s){return void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:(g.SetCollision(t,e,i,r,s),this)},setCollisionBetween:function(t,e,i,r,s){return void 0===i&&(i=!0),void 0===r&&(r=!0),null===(s=this.getLayer(s))?null:(g.SetCollisionBetween(t,e,i,r,s),this)},setCollisionByProperty:function(t,e,i,r){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(r=this.getLayer(r))?null:(g.SetCollisionByProperty(t,e,i,r),this)},setCollisionByExclusion:function(t,e,i,r){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(r=this.getLayer(r))?null:(g.SetCollisionByExclusion(t,e,i,r),this)},setCollisionFromCollisionGroup:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),null===(i=this.getLayer(i))?null:(g.SetCollisionFromCollisionGroup(t,e,i),this)},setTileIndexCallback:function(t,e,i,r){return null===(r=this.getLayer(r))?null:(g.SetTileIndexCallback(t,e,i,r),this)},setTileLocationCallback:function(t,e,i,r,s,n,a){return null===(a=this.getLayer(a))?null:(g.SetTileLocationCallback(t,e,i,r,s,n,a),this)},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=t,this.layers[i].baseTileHeight=e;for(var r=this.layers[i].data,s=this.layers[i].width,n=this.layers[i].height,a=0;a<n;a++)for(var o=0;o<s;o++){var h=r[a][o];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var r=i.data,s=i.width,n=i.height,a=0;a<n;a++)for(var o=0;o<s;o++){var h=r[a][o];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,r,s){return null===(s=this.getLayer(s))?null:(g.Shuffle(t,e,i,r,s),this)},swapByIndex:function(t,e,i,r,s,n,a){return null===(a=this.getLayer(a))?null:(g.SwapByIndex(t,e,i,r,s,n,a),this)},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,r,s){return null===(s=this.getLayer(s))?null:this._convert.TileToWorldXY(t,e,i,r,s)},getTileCorners:function(t,e,i,r){return null===(r=this.getLayer(r))?null:this._convert.GetTileCorners(t,e,i,r)},weightedRandomize:function(t,e,i,r,s,n){return null===(n=this.getLayer(n))?null:(g.WeightedRandomize(e,i,r,s,t,n),this)},worldToTileX:function(t,e,i,r){return null===(r=this.getLayer(r))?null:this._convert.WorldToTileX(t,e,i,r)},worldToTileY:function(t,e,i,r){return null===(r=this.getLayer(r))?null:this._convert.WorldToTileY(t,e,i,r)},worldToTileXY:function(t,e,i,r,s,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileXY(t,e,i,r,s,n)},destroy:function(){this.removeAllLayers(),this.tiles.length=0,this.tilesets.length=0,this.objects.length=0,this.scene=null}});t.exports=T},45939(t,e,i){var r=i(44603),s=i(31989);r.register("tilemap",function(t){var e=void 0!==t?t:{};return s(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)})},46029(t,e,i){var r=i(39429),s=i(31989);r.register("tilemap",function(t,e,i,r,n,a,o){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===r&&(r=void 0),null===n&&(n=void 0),s(this.scene,t,e,i,r,n,a,o)})},53180(t,e,i){var r=i(67743),s=i(83419),n=i(44731),a=i(57912),o=new s({Extends:n,Mixins:[a],initialize:function(t,e,i,r,s,a){n.call(this,"TilemapGPULayer",t,e,i,s,a),this.tileset=null,this.layerDataTexture=null,this.setTileset(r),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setTileset:function(t){"string"==typeof t&&(t=this.tilemap.getTileset(t)),this.tileset=t,this.generateLayerDataTexture()},generateLayerDataTexture:function(){for(var t=this.layer,e=this.tileset,i=e.firstgid,r=this.scene.renderer,s=e.getAnimationDataIndexMap(r),n=new Uint32Array(t.width*t.height),a=0;a<t.height;a++)for(var o=0;o<t.width;o++){var h=t.data[a][o],l=h.index-i,u=h.flipX,d=h.flipY,c=!1;s.has(l)&&(l=s.get(l),c=!0),u&&(l|=2147483648),d&&(l|=1073741824),c&&(l|=536870912),-1===h.index&&(l=268435456),n[a*t.width+o]=l}this.layerDataTexture&&this.layerDataTexture.destroy();var f=new Uint8Array(n.buffer);this.layerDataTexture=r.createUint8ArrayTexture(f,t.width,t.height,!1,!0)}});t.exports=o},57912(t,e,i){var r=i(29747),s=r,n=r;s=i(6736),t.exports={renderWebGL:s,renderCanvas:n}},6736(t){t.exports=function(t,e,i,r){(e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter).run(i,e,r)}},20442(t,e,i){var r=i(79317),s=i(83419),n=i(81086),a=i(19218),o=i(44731),h=i(84322),l=new s({Extends:o,Mixins:[a],initialize:function(t,e,i,r,s,a){o.call(this,"TilemapLayer",t,e,i,s,a),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=n.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.setTilesets(r),this.initRenderNodes(this._defaultRenderNodesMap)},_defaultRenderNodesMap:{get:function(){return r}},setTilesets:function(t){var e=[],i=[],r=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++){var n=t[s];if("string"==typeof n&&(n=r.getTileset(n)),n){i.push(n);for(var a=n.firstgid,o=0;o<n.total;o++)e[a+o]=n}}this.gidMap=e,this.tileset=i},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setTint:function(t,e,i,r,s,n){void 0===t&&(t=16777215);return this.forEachTile(function(e){e.tint=t},this,e,i,r,s,n)},setTintMode:function(t,e,i,r,s,n){void 0===t&&(t=h.MULTIPLY);return this.forEachTile(function(e){e.tintMode=t},this,e,i,r,s,n)},destroy:function(t){this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this,t)}});t.exports=l},44731(t,e,i){var r=i(83419),s=i(78389),n=i(31401),a=i(95643),o=i(81086),h=i(26099),l=new r({Extends:a,Mixins:[n.Alpha,n.BlendMode,n.ComputedSize,n.Depth,n.ElapseTimer,n.Flip,n.GetBounds,n.Lighting,n.Mask,n.Origin,n.RenderNodes,n.Transform,n.Visible,n.ScrollFactor,s],initialize:function(t,e,i,r,s,n){a.call(this,e,t),this.isTilemap=!0,this.tilemap=i,this.layerIndex=r,this.layer=i.layers[r],this.layer.tilemapLayer=this,this.gidMap=[],this.tempVec=new h,this.collisionCategory=1,this.collisionMask=1,this.setAlpha(this.layer.alpha),this.setPosition(s,n),this.setOrigin(0,0),this.setSize(i.tileWidth*this.layer.width,i.tileHeight*this.layer.height)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.updateTimer(t,e)},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,r){return o.CalculateFacesWithin(t,e,i,r,this.layer),this},createFromTiles:function(t,e,i,r,s){return o.CreateFromTiles(t,e,i,r,s,this.layer)},copy:function(t,e,i,r,s,n,a){return o.Copy(t,e,i,r,s,n,a,this.layer),this},fill:function(t,e,i,r,s,n){return o.Fill(t,e,i,r,s,n,this.layer),this},filterTiles:function(t,e,i,r,s,n,a){return o.FilterTiles(t,e,i,r,s,n,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,r,s,n,a){return o.FindTile(t,e,i,r,s,n,a,this.layer)},forEachTile:function(t,e,i,r,s,n,a){return o.ForEachTile(t,e,i,r,s,n,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,r){return o.GetTileAtWorldXY(t,e,i,r,this.layer)},getIsoTileAtWorldXY:function(t,e,i,r,s){void 0===i&&(i=!0);var n=this.tempVec;return o.IsometricWorldToTileXY(t,e,!0,n,s,this.layer,i),this.getTileAt(n.x,n.y,r)},getTilesWithin:function(t,e,i,r,s){return o.GetTilesWithin(t,e,i,r,s,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,r,s,n){return o.GetTilesWithinWorldXY(t,e,i,r,s,n,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,r){return o.PutTileAt(t,e,i,r,this.layer)},putTileAtWorldXY:function(t,e,i,r,s){return o.PutTileAtWorldXY(t,e,i,r,s,this.layer)},putTilesAt:function(t,e,i,r){return o.PutTilesAt(t,e,i,r,this.layer),this},randomize:function(t,e,i,r,s){return o.Randomize(t,e,i,r,s,this.layer),this},removeTileAt:function(t,e,i,r){return o.RemoveTileAt(t,e,i,r,this.layer)},removeTileAtWorldXY:function(t,e,i,r,s){return o.RemoveTileAtWorldXY(t,e,i,r,s,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,r,s,n){return o.ReplaceByIndex(t,e,i,r,s,n,this.layer),this},setCollision:function(t,e,i,r){return o.SetCollision(t,e,i,this.layer,r),this},setCollisionBetween:function(t,e,i,r){return o.SetCollisionBetween(t,e,i,r,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,r,s,n){return o.SetTileLocationCallback(t,e,i,r,s,n,this.layer),this},shuffle:function(t,e,i,r){return o.Shuffle(t,e,i,r,this.layer),this},swapByIndex:function(t,e,i,r,s,n){return o.SwapByIndex(t,e,i,r,s,n,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,r){return this.tilemap.tileToWorldXY(t,e,i,r,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,r,s){return o.WeightedRandomize(e,i,r,s,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,r,s){return this.tilemap.worldToTileXY(t,e,i,r,s,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});t.exports=l},16153(t,e,i){var r=i(61340),s=new r,n=new r,a=new r;t.exports=function(t,e,i,r){var o=e.cull(i),h=o.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){n.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var u=t.currentContext,d=e.gidMap;u.save(),s.copyWithScrollFactorFrom(i.matrixCombined,i.scrollX,i.scrollY,e.scrollFactorX,e.scrollFactorY),r&&s.multiply(r),s.multiply(n,a),a.setToContext(u),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var c=0;c<h;c++){var f=o[c],p=d[f.index];if(p){var g=p.image.getSourceImage(),m=p.getTileTextureCoordinates(f.index),v=p.tileWidth,y=p.tileHeight;if(null!==m&&0!==v&&0!==y){var x=.5*v,T=.5*y;m.x+=p.tileOffset.x,m.y+=p.tileOffset.y,u.save(),u.translate(f.pixelX+x,f.pixelY+T),0!==f.rotation&&u.rotate(f.rotation),(f.flipX||f.flipY)&&u.scale(f.flipX?-1:1,f.flipY?-1:1),u.globalAlpha=l*f.alpha,u.drawImage(g,m.x,m.y,v,y,-x,-T,v,y),u.restore()}}}u.restore()}}},19218(t,e,i){var r=i(29747),s=r,n=r;s=i(99558),n=i(16153),t.exports={renderWebGL:s,renderCanvas:n}},99558(t,e,i){var r=i(84322),s=i(70554).getTintAppendFloatAlpha,n={frame:{source:{glTexture:null}},uvSource:{u0:0,v0:0,u1:1,v1:1},frameWidth:0,frameHeight:0},a={tintEffect:r.MULTIPLY,tintTopLeft:0,tintTopRight:0,tintBottomLeft:0,tintBottomRight:0};t.exports=function(t,e,i,r){var o=i.camera,h=e.cull(o),l=h.length,u=e.alpha;if(!(0===l||u<=0))for(var d=e.gidMap,c=e.customRenderNodes.Submitter||e.defaultRenderNodes.Submitter,f=e.customRenderNodes.Transformer||e.defaultRenderNodes.Transformer,p=e.timeElapsed,g=0;g<l;g++){var m=h[g],v=d[m.index];if(v){var y=v.getAnimatedTileId(m.index,p);if(null!==y){var x=v.getTileTextureCoordinates(y),T=v.tileWidth,w=v.tileHeight;if(x&&0!==T&&0!==w){var b=v.glTexture,S=T,C=w,E=x.x,A=x.y,_=s(m.tint,u*m.alpha);n.frame.source.glTexture=v.glTexture,n.frameWidth=S,n.frameHeight=C,n.uvSource.u0=E/b.width,n.uvSource.v0=1-(A+C)/b.height,n.uvSource.u1=(E+S)/b.width,n.uvSource.v1=1-A/b.height,a.tintEffect=m.tintMode,a.tintTopLeft=_,a.tintTopRight=_,a.tintBottomLeft=_,a.tintBottomRight=_,c.run(i,e,r,m,n,f,a)}}}}}},33629(t,e,i){var r=i(83419),s=i(26099),n=new r({initialize:function(t,e,i,r,n,a,o,h,l){(void 0===i||i<=0)&&(i=32),(void 0===r||r<=0)&&(r=32),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=r,this.tileMargin=n,this.tileSpacing=a,this.tileProperties=o,this.tileData=h,this.tileOffset=new s,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[],this.animationSearchThreshold=64,this.maxAnimationLength=0,this._animationDataTexture=null,this._animationDataIndexMap=null},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},getAnimatedTileId:function(t,e){if(!this.containsTileIndex(t))return null;var i=this.getTileData(t);if(!i||!i.animation)return t;e%=i.animationDuration;for(var r=i.animation,s=null,n=0,a=r.length-1,o=0,h=0;n<=a;){if((h=(s=r[o=n+a>>>1]).startTime)<=e&&h+s.duration>e)return s.tileid+this.firstgid;h<e?n=o+1:a=o-1}return null},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){this.image=t;var e=t.get(),i=t.getFrameBounds();return this.glTexture=e.source.glTexture,e.width>i.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var s=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);s%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),s=Math.floor(s),n=Math.floor(n),this.rows=s,this.columns=n,this.total=s*n,this.texCoordinates.length=0;for(var a=this.tileMargin+i,o=this.tileMargin+r,h=0;h<this.rows;h++){for(var l=0;l<this.columns;l++)this.texCoordinates.push({x:a,y:o}),a+=this.tileWidth+this.tileSpacing;a=this.tileMargin+i,o+=this.tileHeight+this.tileSpacing}return this._animationDataTexture&&this.createAnimationDataTexture(),this},getAnimationDataTexture:function(t){return this._animationDataTexture||this.createAnimationDataTexture(t),this._animationDataTexture},getAnimationDataIndexMap:function(t){return this._animationDataIndexMap||this.createAnimationDataTexture(t),this._animationDataIndexMap},createAnimationDataTexture:function(t){for(var e=this.tileData,i=this.total,r=[],s=[],n=new Map,a=0,o=0;o<i;o++){var h=e[o];if(h&&h.animation){var l=h.animation,u=h.animationDuration;n.set(o,r.length),r.push([u,s.length]);for(var d=0;d<l.length;d++){var c=l[d];s.push([c.duration,c.tileid])}a=Math.max(a,l.length)}}var f=r.length+s.length;if(f>8388608)throw new Error("Tileset._animationDataTexture: too many animations - total number of animations plus animation frames is max 8388608, got "+f);var p=2*f,g=Math.min(p,4096),m=Math.ceil(p/4096),v=new Uint32Array(g*m),y=0,x=r.length;for(o=0;o<x;o++){var T=(l=r[o])[0],w=l[1];v[y++]=T,v[y++]=2*(w+x)}for(o=0;o<s.length;o++){var b=(c=s[o])[0],S=c[1];v[y++]=b,v[y++]=S}this._animationDataTexture&&this._animationDataTexture.destroy();var C=new Uint8Array(v.buffer);this._animationDataTexture=t.createUint8ArrayTexture(C,g,m,!1,!0),this._animationDataIndexMap=n,this.maxAnimationLength=a}});t.exports=n},72023(t,e,i){var r=i(7423);t.exports=function(t,e,i){var s=r(t,e,!0,i),n=r(t,e-1,!0,i),a=r(t,e+1,!0,i),o=r(t-1,e,!0,i),h=r(t+1,e,!0,i),l=s&&s.collides;return l&&(s.faceTop=!0,s.faceBottom=!0,s.faceLeft=!0,s.faceRight=!0),n&&n.collides&&(l&&(s.faceTop=!1),n.faceBottom=!l),a&&a.collides&&(l&&(s.faceBottom=!1),a.faceTop=!l),o&&o.collides&&(l&&(s.faceLeft=!1),o.faceRight=!l),h&&h.collides&&(l&&(s.faceRight=!1),h.faceLeft=!l),s&&!s.collides&&s.resetFaces(),s}},42573(t,e,i){var r=i(7423),s=i(7386);t.exports=function(t,e,i,n,a){for(var o=null,h=null,l=null,u=null,d=s(t,e,i,n,null,a),c=0;c<d.length;c++){var f=d[c];f&&(f.collides?(o=r(f.x,f.y-1,!0,a),h=r(f.x,f.y+1,!0,a),l=r(f.x-1,f.y,!0,a),u=r(f.x+1,f.y,!0,a),f.faceTop=!o||!o.collides,f.faceBottom=!h||!h.collides,f.faceLeft=!l||!l.collides,f.faceRight=!u||!u.collides):f.resetFaces())}}},33528(t,e,i){var r=new(i(26099));t.exports=function(t,e,i,s){var n=i.tilemapLayer,a=n.cullPaddingX,o=n.cullPaddingY,h=n.tilemap.tileToWorldXY(t,e,r,s,n);return h.x>s.worldView.x+n.scaleX*i.tileWidth*(-a-.5)&&h.x<s.worldView.right+n.scaleX*i.tileWidth*(a-.5)&&h.y>s.worldView.y+n.scaleY*i.tileHeight*(-o-1)&&h.y<s.worldView.bottom+n.scaleY*i.tileHeight*(o-.5)}},1785(t,e,i){var r=i(42573),s=i(7386),n=i(62991),a=i(23029);t.exports=function(t,e,i,o,h,l,u,d){void 0===u&&(u=!0);var c=s(t,e,i,o,null,d),f=[];c.forEach(function(t){var e=new a(t.layer,t.index,t.x,t.y,t.width,t.height,t.baseWidth,t.baseHeight);e.copy(t),f.push(e)});for(var p=h-t,g=l-e,m=0;m<f.length;m++){var v=f[m],y=v.x+p,x=v.y+g;n(y,x,d)&&d.data[x][y]&&(v.x=y,v.y=x,v.updatePixelXY(),d.data[x][y]=v)}u&&r(h-1,l-1,i+2,o+2,d),c.length=0,f.length=0}},78419(t,e,i){var r=i(62644),s=i(7386),n=i(27987);t.exports=function(t,e,i,a,o,h){i||(i={}),Array.isArray(t)||(t=[t]);var l=h.tilemapLayer;a||(a=l.scene),o||(o=a.cameras.main);var u,d=h.width,c=h.height,f=s(0,0,d,c,null,h),p=[],g=function(t,e,i){for(var r=0;r<i.length;r++){var s=i[r];t.hasOwnProperty(s)||(t[s]=e[s])}};for(u=0;u<f.length;u++){var m=f[u],v=r(i);if(-1!==t.indexOf(m.index)){var y=l.tileToWorldXY(m.x,m.y,void 0,o,h);v.x=y.x,v.y=y.y,g(v,m,["rotation","flipX","flipY","alpha","visible","tint"]),v.hasOwnProperty("origin")||(v.x+=.5*m.width,v.y+=.5*m.height),v.hasOwnProperty("useSpriteSheet")&&(v.key=m.tileset.image,v.frame=m.index-m.tileset.firstgid),p.push(a.make.sprite(v))}}if(Array.isArray(e))for(u=0;u<t.length;u++)n(t[u],e[u],0,0,d,c,h);else if(null!==e)for(u=0;u<t.length;u++)n(t[u],e,0,0,d,c,h);return p}},19545(t,e,i){var r=i(87841),s=i(63448),n=i(56583),a=new r;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),h=Math.floor(i.tileHeight*r.scaleY),l=n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,u=s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,d=n(e.worldView.y-r.y,h,0,!0)-r.cullPaddingY,c=s(e.worldView.bottom-r.y,h,0,!0)+r.cullPaddingY;return a.setTo(l,d,u-l,c-d)}},30003(t,e,i){var r=i(19545),s=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=r(t,e);return(a.skipCull||1!==a.scrollFactorX||1!==a.scrollFactorY)&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),s(t,o,n,i),i}},35137(t,e,i){var r=i(7386),s=i(42573),n=i(20576);t.exports=function(t,e,i,a,o,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),d=r(e,i,a,o,null,l),c=0;c<d.length;c++)d[c].index=t,n(d[c],u);h&&s(e-1,i-1,a+2,o+2,l)}},40253(t,e,i){var r=i(7386);t.exports=function(t,e,i,s,n,a,o,h){return r(i,s,n,a,o,h).filter(t,e)}},52692(t){t.exports=function(t,e,i,r){void 0===e&&(e=0),void 0===i&&(i=!1);var s,n,a,o=0;if(i){for(n=r.height-1;n>=0;n--)for(s=r.width-1;s>=0;s--)if((a=r.data[n][s])&&a.index===t){if(o===e)return a;o+=1}}else for(n=0;n<r.height;n++)for(s=0;s<r.width;s++)if((a=r.data[n][s])&&a.index===t){if(o===e)return a;o+=1}return null}},66151(t,e,i){var r=i(7386);t.exports=function(t,e,i,s,n,a,o,h){return r(i,s,n,a,o,h).find(t,e)||null}},97560(t,e,i){var r=i(7386);t.exports=function(t,e,i,s,n,a,o,h){r(i,s,n,a,o,h).forEach(t,e)}},43305(t,e,i){var r=i(91907),s=i(30003),n=i(9474),a=i(14018),o=i(29747),h=i(54503);t.exports=function(t){return t===r.ORTHOGONAL?s:t===r.HEXAGONAL?n:t===r.STAGGERED?h:t===r.ISOMETRIC?a:o}},7423(t,e,i){var r=i(62991);t.exports=function(t,e,i,s){if(r(t,e,s)){var n=s.data[e][t]||null;return n?-1===n.index?i?n:null:n:null}return null}},60540(t,e,i){var r=i(7423),s=new(i(26099));t.exports=function(t,e,i,n,a){return a.tilemapLayer.worldToTileXY(t,e,!0,s,n),r(s.x,s.y,i,a)}},55826(t,e,i){var r=i(26099);t.exports=function(t,e,i,s){var n=s.baseTileWidth,a=s.baseTileHeight,o=s.tilemapLayer,h=0,l=0;o&&(i||(i=o.scene.cameras.main),h=o.x+i.scrollX*(1-o.scrollFactorX),l=o.y+i.scrollY*(1-o.scrollFactorY),n*=o.scaleX,a*=o.scaleY);var u=h+t*n,d=l+e*a;return[new r(u,d),new r(u+n,d),new r(u+n,d+a),new r(u,d+a)]}},11758(t,e,i){var r=i(91907),s=i(27229),n=i(29747),a=i(55826);t.exports=function(t){return t===r.ORTHOGONAL?a:t===r.ISOMETRIC?n:t===r.HEXAGONAL?s:(r.STAGGERED,n)}},39167(t,e,i){var r=i(91907),s=i(29747),n=i(97281);t.exports=function(t){return t===r.ORTHOGONAL?n:s}},62e3(t,e,i){var r=i(91907),s=i(19951),n=i(14127),a=i(29747),o=i(97202),h=i(70326);t.exports=function(t){return t===r.ORTHOGONAL?h:t===r.ISOMETRIC?n:t===r.HEXAGONAL?s:t===r.STAGGERED?o:a}},5984(t,e,i){var r=i(91907),s=i(29747),n=i(28054),a=i(29650);t.exports=function(t){return t===r.ORTHOGONAL?a:t===r.STAGGERED?n:s}},7386(t,e,i){var r=i(95540);t.exports=function(t,e,i,s,n,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=a.width),void 0===s&&(s=a.height),n||(n={});var o=r(n,"isNotEmpty",!1),h=r(n,"isColliding",!1),l=r(n,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>a.width&&(i=Math.max(a.width-t,0)),e+s>a.height&&(s=Math.max(a.height-e,0));for(var u=[],d=e;d<e+s;d++)for(var c=t;c<t+i;c++){var f=a.data[d][c];if(null!==f){if(o&&-1===f.index)continue;if(h&&!f.collides)continue;if(l&&!f.hasInterestingFace)continue;u.push(f)}}return u}},91141(t,e,i){var r=i(55738),s=i(7386),n=i(91865),a=i(29747),o=i(26099),h=i(91907),l=function(t,e){return n.RectangleToTriangle(e,t)},u=new o,d=new o,c=new o;t.exports=function(t,e,i,o){if(o.orientation!==h.ORTHOGONAL)return console.warn("GetTilesWithinShape only works with orthogonal tilemaps"),[];if(void 0===t)return[];var f=a;t instanceof r.Circle?f=n.CircleToRectangle:t instanceof r.Rectangle?f=n.RectangleToRectangle:t instanceof r.Triangle?f=l:t instanceof r.Line&&(f=n.LineToRectangle),o.tilemapLayer.worldToTileXY(t.left,t.top,!0,d,i);var p=d.x,g=d.y;o.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,c,i);var m=Math.ceil(c.x),v=Math.ceil(c.y),y=Math.max(m-p,1),x=Math.max(v-g,1),T=s(p,g,y,x,e,o),w=o.tileWidth,b=o.tileHeight;o.tilemapLayer&&(w*=o.tilemapLayer.scaleX,b*=o.tilemapLayer.scaleY);for(var S=[],C=new r.Rectangle(0,0,w,b),E=0;E<T.length;E++){var A=T[E];o.tilemapLayer.tileToWorldXY(A.x,A.y,u,i),C.x=u.x,C.y=u.y,f(t,C)&&S.push(A)}return S}},96523(t,e,i){var r=i(7386),s=i(26099),n=new s,a=new s;t.exports=function(t,e,i,s,o,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,n,h,l);var d=n.x,c=n.y;u(t+i,e+s,!1,a,h,l);var f=Math.ceil(a.x),p=Math.ceil(a.y);return r(d,c,f-d,p-c,o,l)}},96113(t,e,i){var r=i(91907),s=i(20242),n=i(10095);t.exports=function(t){return t===r.ORTHOGONAL?n:s}},16926(t,e,i){var r=i(91907),s=i(86625),n=i(96897),a=i(29747),o=i(15108),h=i(85896);t.exports=function(t){return t===r.ORTHOGONAL?h:t===r.ISOMETRIC?n:t===r.HEXAGONAL?s:t===r.STAGGERED?o:a}},55762(t,e,i){var r=i(91907),s=i(20242),n=i(51900),a=i(63288);t.exports=function(t){return t===r.ORTHOGONAL?a:t===r.STAGGERED?n:s}},45091(t,e,i){var r=i(62991);t.exports=function(t,e,i){if(r(t,e,i)){var s=i.data[e][t];return null!==s&&s.index>-1}return!1}},24152(t,e,i){var r=i(45091),s=new(i(26099));t.exports=function(t,e,i,n){n.tilemapLayer.worldToTileXY(t,e,!0,s,i);var a=s.x,o=s.y;return r(a,o,n)}},90454(t,e,i){var r=i(63448),s=i(56583);t.exports=function(t,e){var i,n,a,o,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),d=Math.floor(h.tileHeight*l.scaleY),c=t.hexSideLength;if("y"===t.staggerAxis){var f=(d-c)/2+c;i=s(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-c)/2+c;i=s(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,n=r(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,a=s(e.worldView.y-l.y,d,0,!0)-l.cullPaddingY,o=r(e.worldView.bottom-l.y,d,0,!0)+l.cullPaddingY}return{left:i,right:n,top:a,bottom:o}}},9474(t,e,i){var r=i(90454),s=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=r(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),s(t,o,n,i),i}},27229(t,e,i){var r=i(19951),s=i(26099),n=new s;t.exports=function(t,e,i,a){var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(o*=l.scaleX,h*=l.scaleY);var u,d,c=r(t,e,n,i,a),f=[],p=.5773502691896257;"y"===a.staggerAxis?(u=p*o,d=h/2):(u=o/2,d=p*h);for(var g=0;g<6;g++){var m=2*Math.PI*(.5-g)/6;f.push(new s(c.x+u*Math.cos(m),c.y+d*Math.sin(m)))}return f}},19951(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),u=h.y+s.scrollY*(1-h.scrollFactorY),a*=h.scaleX,o*=h.scaleY);var d,c,f=a/2,p=o/2,g=n.staggerAxis,m=n.staggerIndex;return"y"===g?(d=l+a*t+a,c=u+1.5*e*p+p,e%2==0&&("odd"===m?d-=f:d+=f)):"x"===g&&"odd"===m&&(d=l+1.5*t*f+f,c=u+o*t+o,t%2==0&&("odd"===m?c-=p:c+=p)),i.set(d,c)}},86625(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a){s||(s=new r);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u,d,c,f,p,g=.5773502691896257,m=-.3333333333333333,v=.6666666666666666,y=o/2,x=h/2;"y"===a.staggerAxis?(c=g*(u=(t-y)/(g*o))+m*(d=(e-x)/x),f=0*u+v*d):(c=m*(u=(t-y)/y)+g*(d=(e-x)/(g*h)),f=v*u+0*d),p=-c-f;var T,w=Math.round(c),b=Math.round(f),S=Math.round(p),C=Math.abs(w-c),E=Math.abs(b-f),A=Math.abs(S-p);C>E&&C>A?w=-b-S:E>A&&(b=-w-S);var _=b;return T="odd"===a.staggerIndex?_%2==0?b/2+w:b/2+w-.5:_%2==0?b/2+w:b/2+w+.5,s.set(T,_)}},62991(t){t.exports=function(t,e,i){return t>=0&&t<i.width&&e>=0&&e<i.height}},14018(t,e,i){var r=i(33528);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var n,a,o,h=t.tilemapLayer,l=t.data,u=t.width,d=t.height,c=h.skipCull,f=u,p=d;if(0===s)for(a=0;a<p;a++)for(n=0;n<f;n++)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);else if(1===s)for(a=0;a<p;a++)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);else if(2===s)for(a=p;a>=0;a--)for(n=0;n<f;n++)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);else if(3===s)for(a=p;a>=0;a--)for(n=f;n>=0;n--)(o=l[a][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&(c||r(n,a,t,e))&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*d,i}},14127(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+a/2*(t-e),c=u+(t+e)*(o/2);return i.set(d,c)}},96897(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a,o){s||(s=new r);var h=a.baseTileWidth,l=a.baseTileHeight,u=a.tilemapLayer;u&&(n||(n=u.scene.cameras.main),e-=u.y+n.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+n.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var d=h/2,c=l/2;o||(e-=l);var f=.5*((t-=d)/d+e/c),p=.5*(-t/d+e/c);return i&&(f=Math.floor(f),p=Math.floor(p)),s.set(f,p)}},71558(t,e,i){var r=i(23029),s=i(62991),n=i(72023),a=i(20576);t.exports=function(t,e,i,o,h){if(void 0===o&&(o=!0),!s(e,i,h))return null;var l,u=h.data[i][e],d=u&&u.collides;t instanceof r?(null===h.data[i][e]&&(h.data[i][e]=new r(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new r(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var c=h.data[i][e],f=-1!==h.collideIndexes.indexOf(c.index);if(-1===(l=t instanceof r?t.index:t))c.width=h.tileWidth,c.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],m=p.tilesets[g];c.width=m.tileWidth,c.height=m.tileHeight}return a(c,f),o&&d!==c.collides&&n(e,i,h),c}},26303(t,e,i){var r=i(71558),s=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(e,i,!0,s,a,o),r(t,s.x,s.y,n,o)}},14051(t,e,i){var r=i(42573),s=i(71558);t.exports=function(t,e,i,n,a){if(void 0===n&&(n=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var o=t.length,h=t[0].length,l=0;l<o;l++)for(var u=0;u<h;u++){var d=t[l][u];s(d,e+u,i+l,!1,a)}n&&r(e-1,i-1,h+2,o+2,a)}},77389(t,e,i){var r=i(7386),s=i(26546);t.exports=function(t,e,i,n,a,o){var h,l=r(t,e,i,n,{},o);if(!a)for(a=[],h=0;h<l.length;h++)-1===a.indexOf(l[h].index)&&a.push(l[h].index);for(h=0;h<l.length;h++)l[h].index=s(a)}},63557(t,e,i){var r=i(23029),s=i(62991),n=i(72023);t.exports=function(t,e,i,a,o){if(void 0===i&&(i=!0),void 0===a&&(a=!0),!s(t,e,o))return null;var h=o.data[e][t];return h?(o.data[e][t]=i?null:new r(o,-1,t,e,o.tileWidth,o.tileHeight),a&&h&&h.collides&&n(t,e,o),h):null}},94178(t,e,i){var r=i(63557),s=new(i(26099));t.exports=function(t,e,i,n,a,o){return o.tilemapLayer.worldToTileXY(t,e,!0,s,a,o),r(s.x,s.y,i,n,o)}},15533(t,e,i){var r=i(7386),s=i(3956),n=new s(105,210,231,150),a=new s(243,134,48,200),o=new s(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var s=void 0!==e.tileColor?e.tileColor:n,h=void 0!==e.collidingTileColor?e.collidingTileColor:a,l=void 0!==e.faceColor?e.faceColor:o,u=r(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var d=0;d<u.length;d++){var c=u[d],f=c.tileset?c.tileset.tileOffset:{x:0,y:0},p=c.width,g=c.height,m=c.pixelX-f.x,v=c.pixelY-f.y,y=c.collides?h:s;null!==y&&(t.fillStyle(y.color,y.alpha/255),t.fillRect(m,v,p,g)),m+=1,v+=1,p-=2,g-=2,null!==l&&(t.lineStyle(1,l.color,l.alpha/255),c.faceTop&&t.lineBetween(m,v,m+p,v),c.faceRight&&t.lineBetween(m+p,v,m+p,v+g),c.faceBottom&&t.lineBetween(m,v+g,m+p,v+g),c.faceLeft&&t.lineBetween(m,v,m,v+g))}}},27987(t,e,i){var r=i(7386);t.exports=function(t,e,i,s,n,a,o){for(var h=r(i,s,n,a,null,o),l=0;l<h.length;l++)h[l]&&h[l].index===t&&(h[l].index=e)}},32483(t){t.exports=function(t,e,i,r){var s,n,a,o=t.data,h=t.width,l=t.height,u=t.tilemapLayer,d=Math.max(0,e.left),c=Math.min(h,e.right),f=Math.max(0,e.top),p=Math.min(l,e.bottom);if(0===i)for(n=f;n<p;n++)for(s=d;o[n]&&s<c;s++)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);else if(1===i)for(n=f;n<p;n++)for(s=c;o[n]&&s>=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);else if(2===i)for(n=p;n>=f;n--)for(s=d;o[n]&&s<c;s++)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);else if(3===i)for(n=p;n>=f;n--)for(s=c;o[n]&&s>=d;s--)(a=o[n][s])&&-1!==a.index&&a.visible&&0!==a.alpha&&r.push(a);return u.tilesDrawn=r.length,u.tilesTotal=h*l,r}},57068(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a,o){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===o&&(o=!0),Array.isArray(t)||(t=[t]);for(var h=0;h<t.length;h++)n(t[h],e,a);if(o)for(var l=0;l<a.height;l++)for(var u=0;u<a.width;u++){var d=a.data[l][u];d&&-1!==t.indexOf(d.index)&&r(d,e)}i&&s(0,0,a.width,a.height,a)}},37266(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a,o,h){if(void 0===i&&(i=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)n(l,i,o);if(h)for(var u=0;u<o.height;u++)for(var d=0;d<o.width;d++){var c=o.data[u][d];c&&c.index>=t&&c.index<=e&&r(c,i)}a&&s(0,0,o.width,o.height,o)}}},75661(t,e,i){var r=i(20576),s=i(42573),n=i(9589);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var o=0;o<a.height;o++)for(var h=0;h<a.width;h++){var l=a.data[o][h];l&&-1===t.indexOf(l.index)&&(r(l,e),n(l.index,e,a))}i&&s(0,0,a.width,a.height,a)}},64740(t,e,i){var r=i(20576),s=i(42573),n=i(97022);t.exports=function(t,e,i,a){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var o=0;o<a.height;o++)for(var h=0;h<a.width;h++){var l=a.data[o][h];if(l)for(var u in t)if(n(l.properties,u)){var d=t[u];Array.isArray(d)||(d=[d]);for(var c=0;c<d.length;c++)l.properties[u]===d[c]&&r(l,e)}}i&&s(0,0,a.width,a.height,a)}},63307(t,e,i){var r=i(20576),s=i(42573);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var n=0;n<i.height;n++)for(var a=0;a<i.width;a++){var o=i.data[n][a];if(o){var h=o.getCollisionGroup();h&&h.objects&&h.objects.length>0&&r(o,t)}}e&&s(0,0,i.width,i.height,i)}},9589(t){t.exports=function(t,e,i){var r=i.collideIndexes.indexOf(t);e&&-1===r?i.collideIndexes.push(t):e||-1===r||i.collideIndexes.splice(r,1)}},20576(t){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583(t){t.exports=function(t,e,i,r){if("number"==typeof t)r.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,n=t.length;s<n;s++)r.callbacks[t[s]]=null!==e?{callback:e,callbackContext:i}:void 0}},93254(t,e,i){var r=i(7386);t.exports=function(t,e,i,s,n,a,o){for(var h=r(t,e,i,s,null,o),l=0;l<h.length;l++)h[l].setCollisionCallback(n,a)}},32903(t,e,i){var r=i(7386),s=i(33680);t.exports=function(t,e,i,n,a){var o=r(t,e,i,n,null,a),h=o.map(function(t){return t.index});s(h);for(var l=0;l<o.length;l++)o[l].index=h[l]}},61325(t,e,i){var r=i(63448),s=i(56583);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,n=t.tilemapLayer,a=Math.floor(i.tileWidth*n.scaleX),o=Math.floor(i.tileHeight*n.scaleY);return{left:s(e.worldView.x-n.x,a,0,!0)-n.cullPaddingX,right:r(e.worldView.right-n.x,a,0,!0)+n.cullPaddingX,top:s(e.worldView.y-n.y,o/2,0,!0)-n.cullPaddingY,bottom:r(e.worldView.bottom-n.y,o/2,0,!0)+n.cullPaddingY}}},54503(t,e,i){var r=i(61325),s=i(32483);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var a=t.tilemapLayer,o=r(t,e);return a.skipCull&&1===a.scrollFactorX&&1===a.scrollFactorY&&(o.left=0,o.right=t.width,o.top=0,o.bottom=t.height),s(t,o,n,i),i}},97202(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){i||(i=new r);var a=n.baseTileWidth,o=n.baseTileHeight,h=n.tilemapLayer,l=0,u=0;h&&(s||(s=h.scene.cameras.main),l=h.x+s.scrollX*(1-h.scrollFactorX),a*=h.scaleX,u=h.y+s.scrollY*(1-h.scrollFactorY),o*=h.scaleY);var d=l+t*a+e%2*(a/2),c=u+e*(o/2);return i.set(d,c)}},28054(t){t.exports=function(t,e,i){var r=i.baseTileHeight,s=i.tilemapLayer,n=0;return s&&(void 0===e&&(e=s.scene.cameras.main),n=s.y+e.scrollY*(1-s.scrollFactorY),r*=s.scaleY),n+t*(r/2)+r}},15108(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a){s||(s=new r);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),e-=l.y+n.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+n.scrollX*(1-l.scrollFactorX),o*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),d=i?Math.floor((t+u%2*.5*o)/o):(t+u%2*.5*o)/o;return s.set(d,u)}},51900(t){t.exports=function(t,e,i,r){var s=r.baseTileHeight,n=r.tilemapLayer;return n&&(i||(i=n.scene.cameras.main),t-=n.y+i.scrollY*(1-n.scrollFactorY),s*=n.scaleY),e?Math.floor(t/(s/2)):t/(s/2)}},86560(t,e,i){var r=i(7386);t.exports=function(t,e,i,s,n,a,o){for(var h=r(i,s,n,a,null,o),l=0;l<h.length;l++)h[l]&&(h[l].index===t?h[l].index=e:h[l].index===e&&(h[l].index=t))}},97281(t){t.exports=function(t,e,i){var r=i.baseTileWidth,s=i.tilemapLayer,n=0;return s&&(e||(e=s.scene.cameras.main),n=s.x+e.scrollX*(1-s.scrollFactorX),r*=s.scaleX),n+t*r}},70326(t,e,i){var r=i(97281),s=i(29650),n=i(26099);t.exports=function(t,e,i,a,o){return i||(i=new n(0,0)),i.x=r(t,a,o),i.y=s(e,a,o),i}},29650(t){t.exports=function(t,e,i){var r=i.baseTileHeight,s=i.tilemapLayer,n=0;return s&&(e||(e=s.scene.cameras.main),n=s.y+e.scrollY*(1-s.scrollFactorY),r*=s.scaleY),n+t*r}},77366(t,e,i){var r=i(7386),s=i(75508);t.exports=function(t,e,i,n,a,o){if(a){var h,l=r(t,e,i,n,null,o),u=0;for(h=0;h<a.length;h++)u+=a[h].weight;if(!(u<=0))for(h=0;h<l.length;h++){for(var d=s.RND.frac()*u,c=0,f=-1,p=0;p<a.length;p++)if(d<=(c+=a[p].weight)){var g=a[p].index;f=Array.isArray(g)?g[Math.floor(s.RND.frac()*g.length)]:g;break}l[h].index=f}}}},10095(t,e,i){var r=i(85896),s=new(i(26099));t.exports=function(t,e,i,n){return r(t,0,e,s,i,n),s.x}},85896(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n,a){void 0===i&&(i=!0),s||(s=new r);var o=a.baseTileWidth,h=a.baseTileHeight,l=a.tilemapLayer;l&&(n||(n=l.scene.cameras.main),t-=l.x+n.scrollX*(1-l.scrollFactorX),e-=l.y+n.scrollY*(1-l.scrollFactorY),o*=l.scaleX,h*=l.scaleY);var u=t/o,d=e/h;return i&&(u=Math.floor(u),d=Math.floor(d)),s.set(u,d)}},63288(t,e,i){var r=i(85896),s=new(i(26099));t.exports=function(t,e,i,n){return r(0,t,e,s,i,n),s.y}},81086(t,e,i){t.exports={CalculateFacesAt:i(72023),CalculateFacesWithin:i(42573),CheckIsoBounds:i(33528),Copy:i(1785),CreateFromTiles:i(78419),CullBounds:i(19545),CullTiles:i(30003),Fill:i(35137),FilterTiles:i(40253),FindByIndex:i(52692),FindTile:i(66151),ForEachTile:i(97560),GetCullTilesFunction:i(43305),GetTileAt:i(7423),GetTileAtWorldXY:i(60540),GetTileCorners:i(55826),GetTileCornersFunction:i(11758),GetTilesWithin:i(7386),GetTilesWithinShape:i(91141),GetTilesWithinWorldXY:i(96523),GetTileToWorldXFunction:i(39167),GetTileToWorldXYFunction:i(62e3),GetTileToWorldYFunction:i(5984),GetWorldToTileXFunction:i(96113),GetWorldToTileXYFunction:i(16926),GetWorldToTileYFunction:i(55762),HasTileAt:i(45091),HasTileAtWorldXY:i(24152),HexagonalCullBounds:i(90454),HexagonalCullTiles:i(9474),HexagonalGetTileCorners:i(27229),HexagonalTileToWorldXY:i(19951),HexagonalWorldToTileXY:i(86625),IsInLayerBounds:i(62991),IsometricCullTiles:i(14018),IsometricTileToWorldXY:i(14127),IsometricWorldToTileXY:i(96897),PutTileAt:i(71558),PutTileAtWorldXY:i(26303),PutTilesAt:i(14051),Randomize:i(77389),RemoveTileAt:i(63557),RemoveTileAtWorldXY:i(94178),RenderDebug:i(15533),ReplaceByIndex:i(27987),RunCull:i(32483),SetCollision:i(57068),SetCollisionBetween:i(37266),SetCollisionByExclusion:i(75661),SetCollisionByProperty:i(64740),SetCollisionFromCollisionGroup:i(63307),SetLayerCollisionIndex:i(9589),SetTileCollision:i(20576),SetTileIndexCallback:i(79583),SetTileLocationCallback:i(93254),Shuffle:i(32903),StaggeredCullBounds:i(61325),StaggeredCullTiles:i(54503),StaggeredTileToWorldXY:i(97202),StaggeredTileToWorldY:i(28054),StaggeredWorldToTileXY:i(15108),StaggeredWorldToTileY:i(51900),SwapByIndex:i(86560),TileToWorldX:i(97281),TileToWorldXY:i(70326),TileToWorldY:i(29650),WeightedRandomize:i(77366),WorldToTileX:i(10095),WorldToTileXY:i(85896),WorldToTileY:i(63288)}},91907(t){t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829(t,e,i){var r={ORIENTATION:i(91907)};t.exports=r},62501(t,e,i){var r=i(79291),s=i(21829),n={Components:i(81086),Parsers:i(57442),Formats:i(80341),ImageCollection:i(16536),ParseToTilemap:i(31989),Tile:i(23029),Tilemap:i(49075),TilemapCreator:i(45939),TilemapFactory:i(46029),Tileset:i(33629),TilemapLayerBase:i(44731),TilemapLayer:i(20442),TilemapGPULayer:i(53180),Orientation:i(91907),LayerData:i(14977),MapData:i(87010),ObjectLayer:i(48700)};n=r(!1,n,s.ORIENTATION),t.exports=n},14977(t,e,i){var r=i(83419),s=i(91907),n=i(95540),a=new r({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","layer"),this.id=n(t,"id",0),this.x=n(t,"x",0),this.y=n(t,"y",0),this.width=n(t,"width",0),this.height=n(t,"height",0),this.tileWidth=n(t,"tileWidth",0),this.tileHeight=n(t,"tileHeight",0),this.baseTileWidth=n(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=n(t,"baseTileHeight",this.tileHeight),this.orientation=n(t,"orientation",s.ORTHOGONAL),this.widthInPixels=n(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=n(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=n(t,"alpha",1),this.visible=n(t,"visible",!0),this.properties=n(t,"properties",[]),this.indexes=n(t,"indexes",[]),this.collideIndexes=n(t,"collideIndexes",[]),this.callbacks=n(t,"callbacks",[]),this.bodies=n(t,"bodies",[]),this.data=n(t,"data",[]),this.tilemapLayer=n(t,"tilemapLayer",null),this.hexSideLength=n(t,"hexSideLength",0),this.staggerAxis=n(t,"staggerAxis","y"),this.staggerIndex=n(t,"staggerIndex","odd")}});t.exports=a},87010(t,e,i){var r=i(83419),s=i(91907),n=i(95540),a=new r({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","map"),this.width=n(t,"width",0),this.height=n(t,"height",0),this.infinite=n(t,"infinite",!1),this.tileWidth=n(t,"tileWidth",0),this.tileHeight=n(t,"tileHeight",0),this.widthInPixels=n(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=n(t,"heightInPixels",this.height*this.tileHeight),this.format=n(t,"format",null),this.orientation=n(t,"orientation",s.ORTHOGONAL),this.renderOrder=n(t,"renderOrder","right-down"),this.version=n(t,"version","1"),this.properties=n(t,"properties",{}),this.layers=n(t,"layers",[]),this.images=n(t,"images",[]),this.objects=n(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=n(t,"collision",{}),this.tilesets=n(t,"tilesets",[]),this.imageCollections=n(t,"imageCollections",[]),this.tiles=n(t,"tiles",[]),this.hexSideLength=n(t,"hexSideLength",0),this.staggerAxis=n(t,"staggerAxis","y"),this.staggerIndex=n(t,"staggerIndex","odd")}});t.exports=a},48700(t,e,i){var r=i(83419),s=i(95540),n=new r({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.id=s(t,"id",0),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});t.exports=n},6641(t,e,i){var r=i(91907);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?r.ISOMETRIC:"staggered"===t?r.STAGGERED:"hexagonal"===t?r.HEXAGONAL:r.ORTHOGONAL}},46177(t,e,i){var r=i(80341),s=i(2342),n=i(82593),a=i(46594),o=i(87021);t.exports=function(t,e,i,h,l,u){var d;switch(e){case r.ARRAY_2D:d=s(t,i,h,l,u);break;case r.CSV:d=n(t,i,h,l,u);break;case r.TILED_JSON:d=a(t,i,u);break;case r.WELTMEISTER:d=o(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),d=null}return d}},2342(t,e,i){var r=i(80341),s=i(14977),n=i(87010),a=i(23029);t.exports=function(t,e,i,o,h){for(var l=new s({tileWidth:i,tileHeight:o}),u=new n({name:t,tileWidth:i,tileHeight:o,format:r.ARRAY_2D,layers:[l]}),d=[],c=e.length,f=0,p=0;p<e.length;p++){d[p]=[];for(var g=e[p],m=0;m<g.length;m++){var v=parseInt(g[m],10);isNaN(v)||-1===v?d[p][m]=h?null:new a(l,-1,m,p,i,o):d[p][m]=new a(l,v,m,p,i,o)}0===f&&(f=g.length)}return u.width=l.width=f,u.height=l.height=c,u.widthInPixels=l.widthInPixels=f*i,u.heightInPixels=l.heightInPixels=c*o,l.data=d,u}},82593(t,e,i){var r=i(80341),s=i(2342);t.exports=function(t,e,i,n,a){var o=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,o,i,n,a);return h.format=r.CSV,h}},6656(t,e,i){var r=i(14977),s=i(23029);t.exports=function(t,e){for(var i=[],n=0;n<t.layer.length;n++){for(var a=t.layer[n],o=new r({name:a.name,width:a.width,height:a.height,tileWidth:a.tilesize,tileHeight:a.tilesize,visible:1===a.visible}),h=[],l=[],u=0;u<a.data.length;u++){for(var d=0;d<a.data[u].length;d++){var c,f=a.data[u][d]-1;c=f>-1?new s(o,f,d,u,a.tilesize,a.tilesize):e?null:new s(o,-1,d,u,a.tilesize,a.tilesize),h.push(c)}l.push(h),h=[]}o.data=l,i.push(o)}return i}},96483(t,e,i){var r=i(33629);t.exports=function(t){for(var e=[],i=[],s=0;s<t.layer.length;s++){var n=t.layer[s],a=n.tilesetName;""!==a&&-1===i.indexOf(a)&&(i.push(a),e.push(new r(a,0,n.tilesize,n.tilesize,0,0)))}return e}},87021(t,e,i){var r=i(80341),s=i(87010),n=i(6656),a=i(96483);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var o=0,h=0,l=0;l<e.layer.length;l++)e.layer[l].width>o&&(o=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:o,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:r.WELTMEISTER});return u.layers=n(e,i),u.tilesets=a(e),u}},52833(t,e,i){t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442(t,e,i){t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233(t,e,i){var r=i(79291);t.exports=function(t){for(var e,i,s,n,a,o=0;o<t.layers.length;o++){e=t.layers[o],n=null;for(var h=0;h<e.data.length;h++){a=e.data[h];for(var l=0;l<a.length;l++)null===(i=a[l])||i.index<0||(s=t.tiles[i.index][2],n=t.tilesets[s],i.width=n.tileWidth,i.height=n.tileHeight,n.tileProperties&&n.tileProperties[i.index-n.firstgid]&&(i.properties=r(i.properties,n.tileProperties[i.index-n.firstgid])))}}}},41868(t){t.exports=function(t){for(var e=window.atob(t),i=e.length,r=new Array(i/4),s=0;s<i;s+=4)r[s/4]=(e.charCodeAt(s)|e.charCodeAt(s+1)<<8|e.charCodeAt(s+2)<<16|e.charCodeAt(s+3)<<24)>>>0;return r}},84101(t,e,i){var r=i(33629);t.exports=function(t){var e,i,s=[];for(e=0;e<t.imageCollections.length;e++)for(var n=t.imageCollections[e].images,a=0;a<n.length;a++){var o=n[a],h={x:0,y:o.height-t.tileHeight};(i=new r(o.image,o.gid,o.width,o.height,0,0,void 0,void 0,h)).updateTileData(o.width,o.height),t.tilesets.push(i)}for(e=0;e<t.tilesets.length;e++)for(var l=(i=t.tilesets[e]).tileMargin,u=i.tileMargin,d=0,c=0,f=0,p=i.firstgid;p<i.firstgid+i.total&&(s[p]=[l,u,e],l+=i.tileWidth+i.tileSpacing,++d!==i.total)&&(++c!==i.columns||(l=i.tileMargin,u+=i.tileHeight+i.tileSpacing,c=0,++f!==i.rows));p++);return s}},79677(t,e,i){var r=i(95540);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var s=e.x+r(e,"startx",0)*t.tilewidth+r(e,"offsetx",0),n=e.y+r(e,"starty",0)*t.tileheight+r(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+s,y:i.y+n}}},29920(t){var e=2147483648,i=1073741824,r=536870912;t.exports=function(t){var s=Boolean(t&e),n=Boolean(t&i),a=Boolean(t&r);t&=536870911;var o=0,h=!1;return s&&n&&a?(o=Math.PI/2,h=!0):s&&n&&!a?(o=Math.PI,h=!1):s&&!n&&a?(o=Math.PI/2,h=!1):!s||n||a?!s&&n&&a?(o=3*Math.PI/2,h=!1):s||!n||a?s||n||!a?s||n||a||(o=0,h=!1):(o=3*Math.PI/2,h=!0):(o=Math.PI,h=!0):(o=0,h=!0),{gid:t,flippedHorizontal:s,flippedVertical:n,flippedAntiDiagonal:a,rotation:o,flipped:h}}},12635(t,e,i){var r=i(95540),s=i(79677);t.exports=function(t){for(var e=[],i=[],n=s(t);n.i<n.layers.length||i.length>0;)if(n.i>=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var a=n.layers[n.i];if(n.i++,"imagelayer"===a.type){var o=r(a,"offsetx",0)+r(a,"startx",0),h=r(a,"offsety",0)+r(a,"starty",0);e.push({name:n.name+a.name,image:a.image,x:n.x+o+a.x,y:n.y+h+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:r(a,"properties",{})})}else if("group"===a.type){var l=s(t,a,n);i.push(n),n=l}}return e}},46594(t,e,i){var r=i(51233),s=i(84101),n=i(91907),a=i(62644),o=i(80341),h=i(6641),l=i(87010),u=i(12635),d=i(22611),c=i(28200),f=i(24619);t.exports=function(t,e,i){var p=a(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:o.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});if(g.orientation===n.HEXAGONAL)if(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex,"y"===g.staggerAxis){var m=(g.tileHeight-g.hexSideLength)/2;g.widthInPixels=g.tileWidth*(g.width+.5),g.heightInPixels=g.height*(g.hexSideLength+m)+m}else{var v=(g.tileWidth-g.hexSideLength)/2;g.widthInPixels=g.width*(g.hexSideLength+v)+v,g.heightInPixels=g.tileHeight*(g.height+.5)}g.layers=c(p,i),g.images=u(p);var y=f(p);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=d(p),g.tiles=s(g),r(g),g}},52205(t,e,i){var r=i(18254),s=i(29920),n=function(t){return{x:t.x,y:t.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var o=r(t,a);if(o.x+=e,o.y+=i,t.gid){var h=s(t.gid);o.gid=h.gid,o.flippedHorizontal=h.flippedHorizontal,o.flippedVertical=h.flippedVertical,o.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?o.polyline=t.polyline.map(n):t.polygon?o.polygon=t.polygon.map(n):t.ellipse?o.ellipse=t.ellipse:t.text?o.text=t.text:t.point?o.point=!0:o.rectangle=!0;return o}},22611(t,e,i){var r=i(95540),s=i(52205),n=i(48700),a=i(79677);t.exports=function(t){for(var e=[],i=[],o=a(t);o.i<o.layers.length||i.length>0;)if(o.i>=o.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=i.pop()}else{var h=o.layers[o.i];if(o.i++,h.opacity*=o.opacity,h.visible=o.visible&&h.visible,"objectgroup"===h.type){h.name=o.name+h.name;for(var l=o.x+r(h,"startx",0)+r(h,"offsetx",0),u=o.y+r(h,"starty",0)+r(h,"offsety",0),d=[],c=0;c<h.objects.length;c++){var f=s(h.objects[c],l,u);d.push(f)}var p=new n(h);p.objects=d,e.push(p)}else if("group"===h.type){var g=a(t,h,o);i.push(o),o=g}}return e}},28200(t,e,i){var r=i(41868),s=i(91907),n=i(79677),a=i(6641),o=i(95540),h=i(14977),l=i(29920),u=i(23029);t.exports=function(t,e){for(var i=o(t,"infinite",!1),d=[],c=[],f=n(t);f.i<f.layers.length||c.length>0;)if(f.i>=f.layers.length){if(c.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=c.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g<p.chunks.length;g++)p.chunks[g].data=r(p.chunks[g].data);p.data&&(p.data=r(p.data)),delete p.encoding}var m,v,y,x,T,w,b=[],S=0;if(i){var C=o(p,"startx",0)+p.x,E=o(p,"starty",0)+p.y;(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+C*t.tilewidth,y:f.y+o(p,"offsety",0)+E*t.tileheight,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===s.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(T=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+T)+T):(w=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+w)+w,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var A=0;A<p.height;A++){b[A]=[null];for(var _=0;_<p.width;_++)b[A][_]=null}for(A=0,k=p.chunks.length;A<k;A++)for(var M=p.chunks[A],R=M.x-C,P=M.y-E,O=0,L=0,F=M.data.length;L<F;L++){var D=S+R,I=O+P;(v=l(M.data[L])).gid>0?((y=new u(m,v.gid,D,I,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[I][D]=y):(x=e?null:new u(m,-1,D,I,t.tilewidth,t.tileheight),b[I][D]=x),++S===M.width&&(O++,S=0)}}else{(m=new h({name:f.name+p.name,id:p.id,x:f.x+o(p,"offsetx",0)+p.x,y:f.y+o(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:o(p,"properties",[]),orientation:a(t.orientation)})).orientation===s.HEXAGONAL&&(m.hexSideLength=t.hexsidelength,m.staggerAxis=t.staggeraxis,m.staggerIndex=t.staggerindex,"y"===m.staggerAxis?(T=(m.tileHeight-m.hexSideLength)/2,m.widthInPixels=m.tileWidth*(m.width+.5),m.heightInPixels=m.height*(m.hexSideLength+T)+T):(w=(m.tileWidth-m.hexSideLength)/2,m.widthInPixels=m.width*(m.hexSideLength+w)+w,m.heightInPixels=m.tileHeight*(m.height+.5)));for(var N=[],B=0,k=p.data.length;B<k;B++)(v=l(p.data[B])).gid>0?((y=new u(m,v.gid,S,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,N.push(y)):(x=e?null:new u(m,-1,S,b.length,t.tilewidth,t.tileheight),N.push(x)),++S===p.width&&(b.push(N),S=0,N=[])}m.data=b,d.push(m)}else if("group"===p.type){var U=n(t,p,f);c.push(f),f=U}}return d}},24619(t,e,i){var r=i(33629),s=i(16536),n=i(52205),a=i(57880);t.exports=function(t){for(var e,i=[],o=[],h=null,l=0;l<t.tilesets.length;l++){var u=t.tilesets[l];if(u.source)console.warn("External tilesets unsupported. Use Embed Tileset and re-export");else if(u.image){var d=new r(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,void 0,void 0,u.tileoffset);if(t.version>1){var c=void 0,f=void 0;if(Array.isArray(u.tiles)){c=c||{},f=f||{};for(var p=0;p<u.tiles.length;p++){var g=u.tiles[p];if(g.properties){var m={};g.properties.forEach(function(t){m[t.name]=t.value}),f[g.id]=m}if(g.objectgroup&&((c[g.id]||(c[g.id]={})).objectgroup=g.objectgroup,g.objectgroup.objects)){var v=g.objectgroup.objects.map(function(t){return n(t)});c[g.id].objectgroup.objects=v}g.animation&&((c[g.id]||(c[g.id]={})).animation=g.animation),g.type&&((c[g.id]||(c[g.id]={})).type=g.type)}for(var y in c){var x=c[y].animation;if(x){for(var T=0,w=0;w<x.length;w++)x[w].startTime=T,T+=x[w].duration;c[y].animationDuration=T}}}Array.isArray(u.wangsets)&&(c=c||{},f=f||{},a(u.wangsets,c)),c&&(d.tileData=c,d.tileProperties=f)}else if(u.tileproperties&&(d.tileProperties=u.tileproperties),u.tiles)for(e in d.tileData=u.tiles,d.tileData){var b=d.tileData[e].objectgroup;if(b&&b.objects){var S=b.objects.map(function(t){return n(t)});d.tileData[e].objectgroup.objects=S}}d.updateTileData(u.imagewidth,u.imageheight),i.push(d)}else{var C=new s(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,u.properties),E=0;for(p=0;p<u.tiles.length;p++){var A=(g=u.tiles[p]).image,_=parseInt(g.id,10),M=u.firstgid+_,R=g.imagewidth,P=g.imageheight;C.addImage(M,A,R,P),E=Math.max(_,E)}C.maxId=E,o.push(C)}h&&(h.lastgid=u.firstgid-1),h=u}return{tilesets:i,imageCollections:o}}},57880(t){t.exports=function(t,e){for(var i=0;i<t.length;i++){var r=t[i],s=i;if(r.name&&""!==r.name&&(s=r.name),Array.isArray(r.wangtiles)&&r.wangtiles.length>0){var n,a,o,h={},l={};if(Array.isArray(r.edgecolors))for(n=0;n<r.edgecolors.length;n++)o=1+n,""!==(a=r.edgecolors[n]).name&&(h[o]=a.name);if(Array.isArray(r.cornercolors))for(n=0;n<r.cornercolors.length;n++)o=1+n,""!==(a=r.cornercolors[n]).name&&(l[o]=a.name);if(Array.isArray(r.colors))for(n=0;n<r.colors.length;n++)o=1+n,""!==(a=r.colors[n]).name&&(h[o]=l[o]=a.name);for(var u=[h,l,h,l,h,l,h,l],d=0;d<r.wangtiles.length;d++){var c=r.wangtiles[d],f=e[c.tileid]||(e[c.tileid]={});f=f.wangid||(f.wangid={});for(var p=[],g=0;g<Math.min(u.length,c.wangid.length);g++)if(0!==(a=c.wangid[g])){var m=u[g][a];void 0===m?p.push(a):p.push(m)}else p.push(void 0);f[s]=p}}}}},96761(t,e,i){t.exports={AssignTileProperties:i(51233),Base64Decode:i(41868),BuildTilesetIndex:i(84101),CreateGroupLayer:i(79677),ParseGID:i(29920),ParseImageLayers:i(12635),ParseJSONTiled:i(46594),ParseObject:i(52205),ParseObjectLayers:i(22611),ParseTileLayers:i(28200),ParseTilesets:i(24619)}},33385(t,e,i){var r=i(83419),s=i(37277),n=i(44594),a=i(94880),o=i(72905),h=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(n.BOOT,this.boot,this),t.sys.events.on(n.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(n.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var t=this.systems.events;t.on(n.PRE_UPDATE,this.preUpdate,this),t.on(n.UPDATE,this.update,this),t.once(n.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;if(t instanceof a){if(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat,e.delay<=0&&e.repeatCount>0)throw new Error("TimerEvent infinite loop created via zero delay")}else e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,r){return this.addEvent({delay:t,callback:e,args:i,callbackScope:r})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];o(this._pendingRemoval,i),o(this._pendingInsertion,i),o(this._active,i)}return this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,r;for(i=0;i<t;i++){r=this._pendingRemoval[i];var s=this._active.indexOf(r);s>-1&&this._active.splice(s,1),r.destroy()}for(i=0;i<e;i++)r=this._pendingInsertion[i],this._active.push(r);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var r=this._active[i];if(!r.paused&&(r.elapsed+=e*r.timeScale,r.elapsed>=r.delay)){var s=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--,s>=r.delay)for(;s>=r.delay&&r.repeatCount>0;)r.callback&&r.callback.apply(r.callbackScope,r.args),s-=r.delay,r.repeatCount--;r.elapsed=s,r.hasDispatched=!1}else r.hasDispatched&&this._pendingRemoval.push(r)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off(n.PRE_UPDATE,this.preUpdate,this),e.off(n.UPDATE,this.update,this),e.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(n.START,this.start,this),this.scene=null,this.systems=null}});s.register("Clock",h,"time"),t.exports=h},96120(t,e,i){var r=i(83419),s=i(50792),n=i(39429),a=i(95540),o=i(44594),h=i(89809),l=new r({Extends:s,initialize:function(t,e){s.call(this),this.scene=t,this.systems=t.sys,this.elapsed=0,this.timeScale=1,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var i=this.systems.events;i.on(o.PRE_UPDATE,this.preUpdate,this),i.on(o.UPDATE,this.update,this),i.once(o.SHUTDOWN,this.destroy,this),e&&this.add(e)},preUpdate:function(t,e){this.paused||(this.elapsed+=e*this.timeScale)},update:function(){if(!this.paused&&!this.complete){var t,e,i=this.events,r=!1,s=this.systems;for(t=0;t<i.length;t++){var n=i[t];if(!n.complete&&n.time<=this.elapsed){if(n.complete=!0,this.totalComplete++,e=n.target?n.target:this,n.if&&!n.if.call(e,n))continue;if(n.once&&(r=!0),n.set&&n.target)for(var a in n.set)n.target[a]=n.set[a];this.iteration&&n.repeat++,n.loop&&n.repeat&&n.loop.call(e),n.tween&&(n.tweenInstance=s.tweens.add(n.tween)),n.sound&&("string"==typeof n.sound?s.sound.play(n.sound):s.sound.play(n.sound.key,n.sound.config)),n.event&&this.emit(n.event,e),n.run&&n.run.call(e),n.stop&&this.stop()}}if(r)for(t=0;t<i.length;t++)i[t].complete&&i[t].once&&(i.splice(t,1),t--);var o=0;for(t=0;t<i.length;t++)i[t].complete||o++;0===o&&(i.length>0||this.totalComplete>0)&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){this.paused=!0;for(var t=this.events,e=0;e<t.length;e++){var i=t[e];i.tweenInstance&&(i.tweenInstance.paused=!0)}return this},repeat:function(t){return void 0!==t&&!0!==t||(t=-1),!1===t&&(t=0),this.loop=t,this},resume:function(){this.paused=!1;for(var t=this.events,e=0;e<t.length;e++){var i=t[e];i.tweenInstance&&(i.tweenInstance.paused=!1)}return this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(t){void 0===t&&(t=!1),this.elapsed=0,t||(this.iteration=0);for(var e=this.events,i=0;i<e.length;i++){var r=e[i];r.complete=!1,t||(r.repeat=0),r.tweenInstance&&r.tweenInstance.stop()}return this.play(!1)},add:function(t){Array.isArray(t)||(t=[t]);var e=this.events,i=0;e.length>0&&(i=e[e.length-1].time);for(var r=0;r<t.length;r++){var s=t[r],n=a(s,"at",0),o=a(s,"in",null);null!==o&&(n=this.elapsed+o);var h=a(s,"from",null);null!==h&&(n=i+h),e.push({complete:!1,time:n,repeat:0,if:a(s,"if",null),run:a(s,"run",null),loop:a(s,"loop",null),event:a(s,"event",null),target:a(s,"target",null),set:a(s,"set",null),tween:a(s,"tween",null),sound:a(s,"sound",null),once:a(s,"once",!1),stop:a(s,"stop",!1)}),i=n}return this.complete=!1,this},clear:function(){for(var t=this.events,e=0;e<t.length;e++){var i=t[e];i.tweenInstance&&i.tweenInstance.stop()}return t.length=0,this.elapsed=0,this.paused=!0,this},isPlaying:function(){return!this.paused&&!this.complete},getProgress:function(){return Math.min(this.totalComplete,this.events.length)/this.events.length},destroy:function(){var t=this.systems.events;t.off(o.PRE_UPDATE,this.preUpdate,this),t.off(o.UPDATE,this.update,this),t.off(o.SHUTDOWN,this.destroy,this),this.clear(),this.scene=null,this.systems=null}});n.register("timeline",function(t){return new l(this.scene,t)}),t.exports=l},94880(t,e,i){var r=i(83419),s=i(95540),n=new r({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){if(this.delay=s(t,"delay",0),this.repeat=s(t,"repeat",0),this.loop=s(t,"loop",!1),this.callback=s(t,"callback",void 0),this.callbackScope=s(t,"callbackScope",this),this.args=s(t,"args",[]),this.timeScale=s(t,"timeScale",1),this.startAt=s(t,"startAt",0),this.paused=s(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this.delay<=0&&this.repeatCount>0)throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=n},35945(t){t.exports="complete"},89809(t,e,i){t.exports={COMPLETE:i(35945)}},90291(t,e,i){t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382(t,e,i){var r=i(72905),s=i(83419),n=i(43491),a=i(88032),o=i(37277),h=i(44594),l=i(93109),u=i(8462),d=i(8357),c=i(43960),f=i(26012),p=new s({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i<t.length;i++){var r=t[i];r instanceof u||r instanceof c?e.push(r):Array.isArray(r.tweens)?e.push(f(this,r)):e.push(d(this,r))}return 1===e.length?e[0]:e},add:function(t){var e=t,i=this.tweens;return e instanceof u||e instanceof c||(e=Array.isArray(e.tweens)?f(this,e):d(this,e)),i.push(e.reset()),e},addMultiple:function(t){for(var e,i=[],r=this.tweens,s=0;s<t.length;s++)(e=t[s])instanceof u||e instanceof c||(e=Array.isArray(e.tweens)?f(this,e):d(this,e)),r.push(e.reset()),i.push(e);return i},chain:function(t){var e=f(this,t);return this.tweens.push(e.init()),e},getChainedTweens:function(t){return t.getChainedTweens()},has:function(t){return this.tweens.indexOf(t)>-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=a(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,r=i-this.nextTime,s=i-1e3*this.time;return r>0||t?(i/=1e3,this.time=i,this.nextTime+=r+(r>=this.gap?4:this.gap-r)):s=0,s},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,r;this.processing=!0;var s=[],n=this.tweens;for(i=0;i<n.length;i++)(r=n[i]).update(e)&&s.push(r);var a=s.length;if(a&&n.length>0){for(i=0;i<a;i++){r=s[i];var o=n.indexOf(r);o>-1&&(r.isPendingRemove()||r.isDestroyed())&&(n.splice(o,1),r.destroy())}s.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(r(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,r=[null];for(i=1;i<arguments.length;i++)r.push(arguments[i]);return this.tweens.forEach(function(i){r[0]=i,t.apply(e,r)}),this},getTweens:function(){return this.tweens.slice()},getTweensOf:function(t){for(var e=[],i=this.tweens,r=(t=Array.isArray(t)?n(t):[t]).length,s=0;s<i.length;s++)for(var a=i[s],o=0;o<r;o++)!a.isDestroyed()&&a.hasTarget(t[o])&&e.push(a);return e},getGlobalTimeScale:function(){return this.timeScale},setGlobalTimeScale:function(t){return this.timeScale=t,this},isTweening:function(t){for(var e,i=this.tweens,r=0;r<i.length;r++)if((e=i[r]).isPlaying()&&e.hasTarget(t))return!0;return!1},killAll:function(){for(var t=this.processing?this.getTweens():this.tweens,e=0;e<t.length;e++)t[e].destroy();return this.processing||(t.length=0),this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].destroy();return this},pauseAll:function(){return this.paused=!0,this},resumeAll:function(){return this.paused=!1,this},shutdown:function(){this.killAll(),this.tweens=[],this.events.off(h.UPDATE,this.update,this),this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.events=null}});o.register("TweenManager",p,"tweens"),t.exports=p},57355(t){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},6113(t,e,i){var r=i(62640),s=i(35355);t.exports=function(t,e){var i=r.Power0;if("string"==typeof t)if(r.hasOwnProperty(t))i=r[t];else{var n="";if(t.indexOf(".")){var a=(n=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===a?n="easeIn":"out"===a?n="easeOut":"inout"===a&&(n="easeInOut")}t=s(t.substring(0,t.indexOf(".")+1)+n),r.hasOwnProperty(t)&&(i=r[t])}else"function"==typeof t&&(i=t);if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},91389(t,e,i){var r=i(89318),s=i(77259),n={bezier:r,catmull:s,catmullrom:s,linear:i(28392)};t.exports=function(t){if(null===t)return null;var e=n.linear;return"string"==typeof t?n.hasOwnProperty(t)&&(e=n[t]):"function"==typeof t&&(e=t),e}},55292(t){t.exports=function(t,e,i){var r;t.hasOwnProperty(e)?r="function"===typeof t[e]?function(i,r,s,n,a,o){return t[e](i,r,s,n,a,o)}:function(){return t[e]}:r="function"==typeof i?i:function(){return i};return r}},82985(t,e,i){var r=i(81076);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===r.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},62329(t,e,i){var r=i(35154);t.exports=function(t){var e=r(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},17777(t,e,i){var r=i(30976),s=i(99472);function n(t){return!!t.getActive&&"function"==typeof t.getActive}function a(t){return!!t.getStart&&"function"==typeof t.getStart}function o(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},d=function(t,e,i){return i},c=null,f=typeof e;if("number"===f)u=function(){return e};else if(Array.isArray(e))d=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===f){var p=e.toLowerCase(),g="random"===p.substring(0,6),m="int"===p.substring(0,3);if(g||m){var v=p.indexOf("("),y=p.indexOf(")"),x=p.indexOf(",");if(!(v&&y&&x))throw new Error("invalid random() format");var T=parseFloat(p.substring(v+1,x)),w=parseFloat(p.substring(x+1,y));u=g?function(){return s(T,w)}:function(){return r(T,w)}}else{p=p[0];var b=parseFloat(e.substr(2));switch(p){case"+":u=function(t,e,i){return i+b};break;case"-":u=function(t,e,i){return i-b};break;case"*":u=function(t,e,i){return i*b};break;case"/":u=function(t,e,i){return i/b};break;default:u=function(){return parseFloat(e)}}}}else if("function"===f)u=e;else if("object"===f)if(a(l=e)||o(l)||n(l))n(e)&&(c=e.getActive),o(e)&&(u=e.getEnd),a(e)&&(d=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var S=e.hasOwnProperty("to"),C=e.hasOwnProperty("from"),E=e.hasOwnProperty("start");if(S&&(C||E)){if(i=h(t,e.to),E){var A=h(t,e.start);i.getActive=A.getEnd}if(C){var _=h(t,e.from);i.getStart=_.getEnd}}}return i||(i={getActive:c,getEnd:u,getStart:d}),i};t.exports=h},88032(t,e,i){var r=i(70402),s=i(69902),n=i(23568),a=i(57355),o=i(6113),h=i(95540),l=i(55292),u=i(35154),d=i(17777),c=i(269),f=i(8462);t.exports=function(t,e,i){if(e instanceof f)return e.parent=t,e;i=void 0===i?s:c(s,i);var p=h(e,"from",0),g=h(e,"to",1),m=[{value:p}],v=h(e,"delay",i.delay),y=h(e,"easeParams",i.easeParams),x=h(e,"ease",i.ease),T=d("value",g),w=new f(t,m),b=w.add(0,"value",T.getEnd,T.getStart,T.getActive,o(h(e,"ease",x),h(e,"easeParams",y)),l(e,"delay",v),h(e,"duration",i.duration),a(e,"yoyo",i.yoyo),h(e,"hold",i.hold),h(e,"repeat",i.repeat),h(e,"repeatDelay",i.repeatDelay),!1,!1);b.start=p,b.current=p,w.completeDelay=n(e,"completeDelay",0),w.loop=Math.round(n(e,"loop",0)),w.loopDelay=Math.round(n(e,"loopDelay",0)),w.paused=a(e,"paused",!1),w.persist=a(e,"persist",!1),w.isNumberTween=!0,w.callbackScope=u(e,"callbackScope",w);for(var S=r.TYPES,C=0;C<S.length;C++){var E=S[C],A=u(e,E,!1);if(A){var _=u(e,E+"Params",[]);w.setCallback(E,A,_)}}return w}},93109(t,e,i){var r=i(6113),s=i(35154),n=i(36383);t.exports=function(t,e){var i;void 0===e&&(e={});var a=s(e,"start",0),o=s(e,"ease",null),h=s(e,"grid",null),l=s(e,"from",0),u="first"===l,d="center"===l,c="last"===l,f="number"==typeof l,p=Array.isArray(t),g=p?parseFloat(t[0]):parseFloat(t),m=p?parseFloat(t[1]):0,v=Math.max(g,m);if(p&&(a+=g),h){var y=h[0],x=h[1],T=0,w=0,b=0,S=0,C=[];c?(T=y-1,w=x-1):f?(T=l%y,w=Math.floor(l/y)):d&&(T=(y-1)/2,w=(x-1)/2);for(var E=n.MIN_SAFE_INTEGER,A=0;A<x;A++){C[A]=[];for(var _=0;_<y;_++){b=T-_,S=w-A;var M=Math.sqrt(b*b+S*S);M>E&&(E=M),C[A][_]=M}}}var R=o?r(o):null;return i=h?function(t,e,i,r){var s,n=0,o=r%y,h=Math.floor(r/y);if(o>=0&&o<y&&h>=0&&h<x&&(n=C[h][o]),p){var l=m-g;s=R?n/E*l*R(n/E):n/E*l}else s=R?n*g*R(n/E):n*g;return s+a}:function(t,e,i,r,s){var n,o,h;(s--,u?n=r:d?n=Math.abs(s/2-r):c?n=s-r:f&&(n=Math.abs(l-r)),p)?(h=d?(m-g)/s*(2*n):(m-g)/s*n,o=R?h*R(n/s):h):o=R?s*v*R(n/s):n*g;return o+a},i}},8357(t,e,i){var r=i(70402),s=i(69902),n=i(23568),a=i(57355),o=i(6113),h=i(95540),l=i(91389),u=i(55292),d=i(82985),c=i(62329),f=i(35154),p=i(17777),g=i(269),m=i(8462);t.exports=function(t,e,i){if(e instanceof m)return e.parent=t,e;i=void 0===i?s:g(s,i);var v=c(e);!v&&i.targets&&(v=i.targets);for(var y=d(e),x=h(e,"delay",i.delay),T=h(e,"duration",i.duration),w=h(e,"easeParams",i.easeParams),b=h(e,"ease",i.ease),S=h(e,"hold",i.hold),C=h(e,"repeat",i.repeat),E=h(e,"repeatDelay",i.repeatDelay),A=a(e,"yoyo",i.yoyo),_=a(e,"flipX",i.flipX),M=a(e,"flipY",i.flipY),R=h(e,"interpolation",i.interpolation),P=function(t,e,i,r){if("texture"===i){var s=r,n=void 0;Array.isArray(r)?(s=r[0],n=r[1]):r.hasOwnProperty("value")?(s=r.value,Array.isArray(r.value)?(s=r.value[0],n=r.value[1]):"string"==typeof r.value&&(s=r.value)):"string"==typeof r&&(s=r),t.addFrame(e,s,n,u(r,"delay",x),h(r,"duration",T),h(r,"hold",S),h(r,"repeat",C),h(r,"repeatDelay",E),a(r,"flipX",_),a(r,"flipY",M))}else{var d=p(i,r),c=l(h(r,"interpolation",R));t.add(e,i,d.getEnd,d.getStart,d.getActive,o(h(r,"ease",b),h(r,"easeParams",w)),u(r,"delay",x),h(r,"duration",T),a(r,"yoyo",A),h(r,"hold",S),h(r,"repeat",C),h(r,"repeatDelay",E),a(r,"flipX",_),a(r,"flipY",M),c,c?r:null)}},O=new m(t,v),L=0;L<y.length;L++)for(var F=y[L].key,D=y[L].value,I=0;I<v.length;I++){v[I]&&("scale"!==F||v[I].hasOwnProperty("scale")?P(O,I,F,D):(P(O,I,"scaleX",D),P(O,I,"scaleY",D)))}O.completeDelay=n(e,"completeDelay",0),O.loop=Math.round(n(e,"loop",0)),O.loopDelay=Math.round(n(e,"loopDelay",0)),O.paused=a(e,"paused",!1),O.persist=a(e,"persist",!1),O.callbackScope=h(e,"callbackScope",O);for(var N=r.TYPES,B=0;B<N.length;B++){var k=N[B],U=f(e,k,!1);if(U){var z=f(e,k+"Params",[]);O.setCallback(k,U,z)}}return O}},26012(t,e,i){var r=i(70402),s=i(23568),n=i(57355),a=i(62329),o=i(35154),h=i(8357),l=i(43960);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=o(e,"delay",0),u.completeDelay=s(e,"completeDelay",0),u.loop=Math.round(s(e,"loop",o(e,"repeat",0))),u.loopDelay=Math.round(s(e,"loopDelay",o(e,"repeatDelay",0))),u.paused=n(e,"paused",!1),u.persist=n(e,"persist",!1),u.callbackScope=o(e,"callbackScope",u);var d=r.TYPES;for(i=0;i<d.length;i++){var c=d[i],f=o(e,c,!1);if(f){var p=o(e,c+"Params",[]);u.setCallback(c,f,p)}}var g=o(e,"tweens",null);if(Array.isArray(g)){var m=[],v=a(e),y=void 0;for(v&&(y={targets:v}),i=0;i<g.length;i++)m.push(h(u,g[i],y));u.add(m)}return u}},30231(t,e,i){t.exports={GetBoolean:i(57355),GetEaseFunction:i(6113),GetInterpolationFunction:i(91389),GetNewValue:i(55292),GetProps:i(82985),GetTargets:i(62329),GetValueOp:i(17777),NumberTweenBuilder:i(88032),StaggerBuilder:i(93109),TweenBuilder:i(8357)}},73685(t){t.exports="active"},98540(t){t.exports="complete"},67233(t){t.exports="loop"},2859(t){t.exports="pause"},98336(t){t.exports="repeat"},25764(t){t.exports="resume"},32193(t){t.exports="start"},84371(t){t.exports="stop"},70766(t){t.exports="update"},55659(t){t.exports="yoyo"},842(t,e,i){t.exports={TWEEN_ACTIVE:i(73685),TWEEN_COMPLETE:i(98540),TWEEN_LOOP:i(67233),TWEEN_PAUSE:i(2859),TWEEN_RESUME:i(25764),TWEEN_REPEAT:i(98336),TWEEN_START:i(32193),TWEEN_STOP:i(84371),TWEEN_UPDATE:i(70766),TWEEN_YOYO:i(55659)}},43066(t,e,i){var r={States:i(86353),Builders:i(30231),Events:i(842),TweenManager:i(40382),Tween:i(8462),TweenData:i(48177),TweenFrameData:i(42220),BaseTween:i(70402),TweenChain:i(43960)};t.exports=r},70402(t,e,i){var r=i(83419),s=i(50792),n=i(842),a=i(86353),o=new r({Extends:s,initialize:function(t){s.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(n.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(n.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(n.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(n.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(n.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE,this.hasStarted=!1},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(t){t.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});o.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=o},95042(t,e,i){var r=i(83419),s=i(842),n=i(86353),a=new r({initialize:function(t,e,i,r,s,n,a,o,h,l){this.tween=t,this.targetIndex=e,this.duration=r<=0?.01:r,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=s,this.hold=n,this.repeat=a,this.repeatDelay=o,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=n.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=n.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=n.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=n.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=n.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=n.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=n.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=n.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===n.CREATED},isDelayed:function(){return this.state===n.DELAY},isPendingRender:function(){return this.state===n.PENDING_RENDER},isPlayingForward:function(){return this.state===n.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===n.PLAYING_BACKWARD},isHolding:function(){return this.state===n.HOLD_DELAY},isRepeating:function(){return this.state===n.REPEAT_DELAY},isComplete:function(){return this.state===n.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,r=t.targets[i],s=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(r,s,0,i,e,t),this.repeatCounter=-1===this.repeat?n.MAX:this.repeat,this.setPendingRenderState();var a=this.duration+this.hold;this.yoyo&&(a+=this.duration);var o=a+this.repeatDelay;this.totalDuration=this.delay+a,-1===this.repeat?(this.totalDuration+=o*n.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=o*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay<t.startDelay&&(t.startDelay=this.delay),this.delay>0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var r=this.tween,n=r.totalTargets,a=this.targetIndex,o=r.targets[a],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&o.toggleFlipX(),this.flipY&&o.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(o,h,this.start,a,n,r)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(s.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(o,h,this.start,a,n,r)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,o[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(s.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=a},69902(t){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076(t){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},8462(t,e,i){var r=i(70402),s=i(83419),n=i(842),a=i(44603),o=i(39429),h=i(36383),l=i(86353),u=i(48177),d=i(42220),c=new s({Extends:r,initialize:function(t,e){r.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.isNumberTween=!1},add:function(t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m){var v=new u(this,t,e,i,r,s,n,a,o,h,l,d,c,f,p,g,m);return this.totalData=this.data.push(v),v},addFrame:function(t,e,i,r,s,n,a,o,h,l){var u=new d(this,t,e,i,r,s,n,a,o,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var r=0;r<this.totalData;r++){var s=this.data[r];s.key===t&&(s.isPlayingForward()||s.isPlayingBackward())&&(s.end=e,i&&(s.start=s.current))}return this},restart:function(){switch(this.state){case l.REMOVED:case l.FINISHED:this.seek(),this.parent.makeActive(this);break;case l.PENDING:case l.PENDING_REMOVE:this.parent.reset(this);break;case l.DESTROYED:console.warn("Cannot restart destroyed Tween",this);break;default:this.seek()}return this.paused=!1,this.hasStarted=!1,this},nextState:function(){if(this.loopCounter>0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(n.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,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(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive");var r=this.paused;if(this.paused=!1,t>0){for(var s=Math.floor(t/e),a=t-s*e,o=0;o<s;o++)this.update(e);a>0&&this.update(a)}return this.paused=r,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i<this.totalData;i++)e[i].reset(t);this.duration=Math.max(this.duration,.01);var r=this.duration,s=this.completeDelay,n=this.loopCounter,a=this.loopDelay;this.totalDuration=n>0?r+s+(r+a)*n:r+s},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(n.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(n.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,r=0;r<this.totalData;r++)i[r].update(t)&&(e=!0);this.elapsed+=t,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=t,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),e||this.nextState();var s=this.isPendingRemove();return s&&this.persist&&(this.setFinishedState(),s=!1),s},forward:function(t){return this.update(t),this},rewind:function(t){return this.update(-t),this},dispatchEvent:function(t,e){if(!this.isSeeking){if(this.emit(t,this,this.targets),!this.callbacks)return;var i=this.callbacks[e];i&&i.func.apply(this.callbackScope,[this,this.targets].concat(i.params))}},destroy:function(){r.prototype.destroy.call(this),this.targets=null}});o.register("tween",function(t){return this.scene.sys.tweens.add(t)}),a.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=c},43960(t,e,i){var r=i(72905),s=i(70402),n=i(83419),a=i(842),o=i(44603),h=i(39429),l=i(86353),u=new n({Extends:s,initialize:function(t){s.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,r=0;r<e.length;r++){var s=e[r];s.parent=this,i.push(s.reset())}return this.totalData=i.length,this},remove:function(t){return r(this.data,t),t.setRemovedState(),t===this.currentTween&&this.nextTween(),this.totalData=this.data.length,this},hasTarget:function(t){for(var e=this.data,i=0;i<this.totalData;i++)if(e[i].hasTarget(t))return!0;return!1},restart:function(){return this.isDestroyed()?(console.warn("Cannot restart destroyed TweenChain",this),this):(this.isRemoved()&&this.parent.makeActive(this),this.resetTweens(),this.paused=!1,this.init())},reset:function(t){return t.seek(),t.setActiveState(),this},makeActive:function(t){return t.reset(),t.setActiveState(),this},nextState:function(){if(this.loopCounter>0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i<e;i++)t[i].reset(!1);this.setCurrentTween(0)},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!this.persist||(this.setFinishedState(),!1);if(this.isFinished()||this.paused)return!1;if(t*=this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,"onStart"),t=0));var e=!1;return this.isActive()&&this.currentTween&&(this.currentTween.update(t)&&this.nextTween()&&this.nextState(),(e=this.isPendingRemove())&&this.persist&&(this.setFinishedState(),e=!1)),e},nextTween:function(){return this.currentIndex++,this.currentIndex===this.totalData||(this.setCurrentTween(this.currentIndex),!1)},setCurrentTween:function(t){this.currentIndex=t,this.currentTween=this.data[t],this.currentTween.setActiveState()},dispatchEvent:function(t,e){this.emit(t,this);var i=this.callbacks[e];i&&i.func.apply(this.callbackScope,[this].concat(i.params))},destroy:function(){s.prototype.destroy.call(this),this.currentTween=null}});h.register("tweenchain",function(t){return this.scene.sys.tweens.chain(t)}),o.register("tweenchain",function(t){return this.scene.sys.tweens.create(t)}),t.exports=u},48177(t,e,i){var r=i(95042),s=i(45319),n=i(83419),a=i(842),o=new n({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u,d,c,f,p,g,m,v){r.call(this,t,e,h,l,u,d,c,f,p,g),this.key=i,this.getActiveValue=a,this.getEndValue=s,this.getStartValue=n,this.ease=o,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=m,this.interpolationData=v},reset:function(t){r.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex],i=this.key;t&&(e[i]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(e[i]=this.getActiveValue(e,i,0))},update:function(t){var e=this.tween,i=e.totalTargets,r=this.targetIndex,n=e.targets[r],o=this.key;if(!n||n.isDestroyed)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(n,o,n[o],r,i,e),this.end=this.getEndValue(n,o,this.start,r,i,e),this.current=this.start,n[o]=this.start,this.setPlayingForwardState(),!0;var h=this.isPlayingForward(),l=this.isPlayingBackward();if(h||l){var u=this.elapsed,d=this.duration,c=0,f=!1;(u+=t)>=d?(c=u-d,u=d,f=!0):u<0&&(u=0);var p=s(u/d,0,1);this.elapsed=u,this.progress=p,this.previous=this.current,h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,n[o]=this.current,f&&(h?(e.isNumberTween&&(this.current=this.end,n[o]=this.current),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(c)):(e.isNumberTween&&(this.current=this.start,n[o]=this.current),this.setStateFromStart(c))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key,n=this.current,a=this.previous;i.emit(t,i,s,r,n,a);var o=i.callbacks[e];o&&o.func.apply(i.callbackScope,[i,r,s,n,a].concat(o.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=o},42220(t,e,i){var r=i(95042),s=i(45319),n=i(83419),a=i(842),o=new n({Extends:r,initialize:function(t,e,i,s,n,a,o,h,l,u,d){r.call(this,t,e,n,a,!1,o,h,l,u,d),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=s,this.yoyo=0!==h},reset:function(t){r.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,r=e.targets[i];if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&r.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var n=this.isPlayingForward(),o=this.isPlayingBackward();if(n||o){var h=this.elapsed,l=this.duration,u=0,d=!1;(h+=t)>=l?(u=h-l,h=l,d=!0):h<0&&(h=0);var c=s(h/l,0,1);this.elapsed=h,this.progress=c,d&&(n?(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(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var r=i.targets[this.targetIndex],s=this.key;i.emit(t,i,s,r);var n=i.callbacks[e];n&&n.func.apply(i.callbackScope,[i,r,s].concat(n.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=o},86353(t){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419(t){function e(t,e,i){var r=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&r.value&&"object"==typeof r.value&&(r=r.value),!(!r||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(r))&&(void 0===r.enumerable&&(r.enumerable=!0),void 0===r.configurable&&(r.configurable=!0),r)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function r(t,r,s,a){for(var o in r)if(r.hasOwnProperty(o)){var h=e(r,o,s);if(!1!==h){if(i((a||t).prototype,o)){if(n.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=r[o]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)r(t,e[i].prototype||e[i])}}function n(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var n=t.Extends;e=function(){n.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var a=null;return t.Mixins&&(a=t.Mixins,delete t.Mixins),s(e,a),r(e,t,!0,i),e}n.extend=r,n.mixin=s,n.ignoreFinals=!1,t.exports=n},29747(t){t.exports=function(){}},20242(t){t.exports=function(){return null}},71146(t){t.exports=function(t,e,i,r,s){if(void 0===s&&(s=t),i>0){var n=i-t.length;if(n<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),r&&r.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>n&&(e.splice(n),a=n);for(var o=0;o<a;o++){var h=e[o];t.push(h),r&&r.call(s,h)}return e}},51067(t){t.exports=function(t,e,i,r,s,n){if(void 0===i&&(i=0),void 0===n&&(n=t),r>0){var a=r-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;r>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(n,l)}return e}},66905(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},21612(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){void 0===s&&(s=0),void 0===n&&(n=t.length);var a=0;if(r(t,s,n))for(var o=s;o<n;o++){t[o][e]===i&&a++}return a}},95428(t){t.exports=function(t,e,i){var r,s=[null];for(r=3;r<arguments.length;r++)s.push(arguments[r]);for(r=0;r<t.length;r++)s[0]=t[r],e.apply(i,s);return t}},36914(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===s&&(s=0),void 0===n&&(n=t.length),r(t,s,n)){var a,o=[null];for(a=5;a<arguments.length;a++)o.push(arguments[a]);for(a=s;a<n;a++)o[0]=t[a],e.apply(i,o)}return t}},81957(t){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var r,s,n=1;if(i){if(t<e[0][i])return e[0];for(;e[n][i]<t;)n++}else for(;e[n]<t;)n++;return n>e.length&&(n=e.length),i?(r=e[n-1][i],(s=e[n][i])-t<=t-r?e[n]:e[n-1]):(r=e[n-1],(s=e[n])-t<=t-r?s:r)}},43491(t){var e=function(t,i){void 0===i&&(i=[]);for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],i):i.push(t[r]);return i};t.exports=e},46710(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){void 0===s&&(s=0),void 0===n&&(n=t.length);var a=[];if(r(t,s,n))for(var o=s;o<n;o++){var h=t[o];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&a.push(h)}return a}},58731(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){var a,o;if(void 0===s&&(s=0),void 0===n&&(n=t.length),-1!==s){if(r(t,s,n))for(a=s;a<n;a++)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o}else if(r(t,0,n))for(a=n;a>=0;a--)if(o=t[a],!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o;return null}},26546(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*(i-e));return void 0===t[r]?null:t[r]}},85835(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r>s||(t.splice(r,1),s=t.indexOf(i),t.splice(s+1,0,e)),t}},83371(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return r<s||(t.splice(r,1),0===s?t.unshift(e):t.splice(s,0,e)),t}},70864(t){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var r=t[i-1],s=t.indexOf(r);t[i]=r,t[s]=e}return t}},69693(t){t.exports=function(t,e,i){var r=t.indexOf(e);if(-1===r||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return r!==i&&(t.splice(r,1),t.splice(i,0,e)),e}},40853(t){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-1){var r=t[i+1],s=t.indexOf(r);t[i]=r,t[s]=e}return t}},20283(t){t.exports=function(t,e,i,r){var s,n=[],a=!1;if((i||r)&&(a=!0,i||(i=""),r||(r="")),e<t)for(s=t;s>=e;s--)a?n.push(i+s.toString()+r):n.push(s);else for(s=t;s<=e;s++)a?n.push(i+s.toString()+r):n.push(s);return n}},593(t,e,i){var r=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],n=Math.max(r((e-t)/(i||1)),0),a=0;a<n;a++)s.push(t),t+=i;return s}},43886(t){function e(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function i(t,e){return t<e?-1:t>e?1:0}var r=function(t,s,n,a,o){for(void 0===n&&(n=0),void 0===a&&(a=t.length-1),void 0===o&&(o=i);a>n;){if(a-n>600){var h=a-n+1,l=s-n+1,u=Math.log(h),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(h-d)/h)*(l-h/2<0?-1:1),f=Math.max(n,Math.floor(s-l*d/h+c)),p=Math.min(a,Math.floor(s+(h-l)*d/h+c));r(t,s,f,p,o)}var g=t[s],m=n,v=a;for(e(t,n,s),o(t[a],g)>0&&e(t,n,a);m<v;){for(e(t,m,v),m++,v--;o(t[m],g)<0;)m++;for(;o(t[v],g)>0;)v--}0===o(t[n],g)?e(t,n,v):e(t,++v,a),v<=s&&(n=v+1),s<=v&&(a=v-1)}};t.exports=r},88492(t,e,i){var r=i(35154),s=i(33680),n=function(t,e,i){for(var r=[],s=0;s<t.length;s++)for(var n=0;n<e.length;n++)for(var a=0;a<i;a++)r.push({a:t[s],b:e[n]});return r};t.exports=function(t,e,i){var a=r(i,"max",0),o=r(i,"qty",1),h=r(i,"random",!1),l=r(i,"randomB",!1),u=r(i,"repeat",0),d=r(i,"yoyo",!1),c=[];if(l&&s(e),-1===u)if(0===a)u=0;else{var f=t.length*e.length*o;d&&(f*=2),u=Math.ceil(a/f)}for(var p=0;p<=u;p++){var g=n(t,e,o);h&&s(g),c=c.concat(g),d&&(g.reverse(),c=c.concat(g))}return a&&c.splice(a),c}},72905(t,e,i){var r=i(19133);t.exports=function(t,e,i,s){var n;if(void 0===s&&(s=t),!Array.isArray(e))return-1!==(n=t.indexOf(e))?(r(t,n),i&&i.call(s,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(n=t.indexOf(h))&&(r(t,n),o.push(h),i&&i.call(s,h)),a--}return o}},60248(t,e,i){var r=i(19133);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var n=r(t,e);return i&&i.call(s,n),n}},81409(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===n&&(n=t),r(t,e,i)){var a=i-e,o=t.splice(e,a);if(s)for(var h=0;h<o.length;h++){var l=o[h];s.call(n,l)}return o}return[]}},31856(t,e,i){var r=i(19133);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return r(t,s)}},42169(t){t.exports=function(t,e,i){var r=t.indexOf(e),s=t.indexOf(i);return-1!==r&&-1===s&&(t[r]=i,!0)}},86003(t){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,r=0;r<e;r++)i=t.shift(),t.push(i);return i}},49498(t){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,r=0;r<e;r++)i=t.pop(),t.unshift(i);return i}},82011(t){t.exports=function(t,e,i,r){var s=t.length;if(e<0||e>=s||e>=i||i>s){if(r)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545(t){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810(t,e,i){var r=i(82011);t.exports=function(t,e,i,s,n){if(void 0===s&&(s=0),void 0===n&&(n=t.length),r(t,s,n))for(var a=s;a<n;a++){var o=t[a];o.hasOwnProperty(e)&&(o[e]=i)}return t}},33680(t){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}return t}},90126(t){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},19133(t){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,r=t[e],s=e;s<i;s++)t[s]=t[s+1];return t.length=i,r}}},19186(t,e,i){var r=i(82264);function s(t,e){return String(t).localeCompare(e)}function n(t,e,i,r){var s,n,a,o,h,l=t.length,u=0,d=2*i;for(s=0;s<l;s+=d)for(a=(n=s+i)+i,n>l&&(n=l),a>l&&(a=l),o=s,h=n;;)if(o<n&&h<a)e(t[o],t[h])<=0?r[u++]=t[o++]:r[u++]=t[h++];else if(o<n)r[u++]=t[o++];else{if(!(h<a))break;r[u++]=t[h++]}}t.exports=function(t,e){if(void 0===e&&(e=s),!t||t.length<2)return t;if(r.features.stableSort)return t.sort(e);var i=function(t,e){var i=t.length;if(i<=1)return t;for(var r=new Array(i),s=1;s<i;s*=2){n(t,e,s,r);var a=t;t=r,r=a}return t}(t,e);return i!==t&&n(i,null,t.length,t),t}},25630(t){t.exports=function(t,e,i){if(e===i)return t;var r=t.indexOf(e),s=t.indexOf(i);if(r<0||s<0)throw new Error("Supplied items must be elements of the same array");return t[r]=i,t[s]=e,t}},37105(t,e,i){t.exports={Matrix:i(54915),Add:i(71146),AddAt:i(51067),BringToTop:i(66905),CountAllMatching:i(21612),Each:i(95428),EachInRange:i(36914),FindClosestInSorted:i(81957),Flatten:i(43491),GetAll:i(46710),GetFirst:i(58731),GetRandom:i(26546),MoveDown:i(70864),MoveTo:i(69693),MoveUp:i(40853),MoveAbove:i(85835),MoveBelow:i(83371),NumberArray:i(20283),NumberArrayStep:i(593),QuickSelect:i(43886),Range:i(88492),Remove:i(72905),RemoveAt:i(60248),RemoveBetween:i(81409),RemoveRandomElement:i(31856),Replace:i(42169),RotateLeft:i(86003),RotateRight:i(49498),SafeRange:i(82011),SendToBack:i(89545),SetAll:i(17810),Shuffle:i(33680),SortByDigits:i(90126),SpliceOne:i(19133),StableSort:i(19186),Swap:i(25630)}},86922(t){t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},63362(t,e,i){var r=i(41836),s=i(86922);t.exports=function(t){var e="";if(!s(t))return e;for(var i=0;i<t.length;i++){for(var n=0;n<t[i].length;n++){var a=t[i][n].toString();e+="undefined"!==a?r(a,2):"?",n<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var o=0;o<t[i].length;o++)e+="---",o<t[i].length-1&&(e+="+");e+="\n"}}return e}},92598(t){t.exports=function(t){return t.reverse()}},21224(t){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},98717(t,e,i){var r=i(37829);t.exports=function(t){return r(t,180)}},44657(t,e,i){var r=i(37829);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i<e;i++)t=r(t,90);return t}},37829(t,e,i){var r=i(86922),s=i(2429);t.exports=function(t,e){if(void 0===e&&(e=90),!r(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},92632(t,e,i){var r=i(37829);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i<e;i++)t=r(t,-90);return t}},69512(t,e,i){var r=i(86003),s=i(49498);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?r(t,Math.abs(i)):s(t,i)),0!==e)for(var n=0;n<t.length;n++){var a=t[n];e<0?r(a,Math.abs(e)):s(a,e)}return t}},2429(t){t.exports=function(t){for(var e=t.length,i=t[0].length,r=new Array(i),s=0;s<i;s++){r[s]=new Array(e);for(var n=e-1;n>-1;n--)r[s][n]=t[n][s]}return r}},54915(t,e,i){t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var r=new Uint8Array(t),s=r.length,n=i?"data:"+i+";base64,":"",a=0;a<s;a+=3)n+=e[r[a]>>2],n+=e[(3&r[a])<<4|r[a+1]>>4],n+=e[(15&r[a+1])<<2|r[a+2]>>6],n+=e[63&r[a+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n}},53134(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),r=0;r<64;r++)i[e.charCodeAt(r)]=r;t.exports=function(t){var e,r,s,n,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var l=new ArrayBuffer(o),u=new Uint8Array(l),d=0;d<a;d+=4)e=i[t.charCodeAt(d)],r=i[t.charCodeAt(d+1)],s=i[t.charCodeAt(d+2)],n=i[t.charCodeAt(d+3)],u[h++]=e<<2|r>>4,u[h++]=(15&r)<<4|s>>2,u[h++]=(3&s)<<6|63&n;return l}},65839(t,e,i){t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799(t,e,i){t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786(t){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644(t){var e=function(t){var i,r,s;if("object"!=typeof t||null===t)return t;for(s in i=Array.isArray(t)?[]:{},t)r=t[s],i[s]=e(r);return i};t.exports=e},79291(t,e,i){var r=i(41212),s=function(){var t,e,i,n,a,o,h=arguments[0]||{},l=1,u=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(e in t)i=h[e],h!==(n=t[e])&&(d&&n&&(r(n)||(a=Array.isArray(n)))?(a?(a=!1,o=i&&Array.isArray(i)?i:[]):o=i&&r(i)?i:{},h[e]=s(d,o,n)):void 0!==n&&(h[e]=n));return h};t.exports=s},23568(t,e,i){var r=i(75508),s=i(35154);t.exports=function(t,e,i){var n=s(t,e,null);if(null===n)return i;if(Array.isArray(n))return r.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return r.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return r.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},95540(t){t.exports=function(t,e,i){var r=typeof t;return t&&"number"!==r&&"string"!==r&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},82840(t,e,i){var r=i(35154),s=i(45319);t.exports=function(t,e,i,n,a){void 0===a&&(a=i);var o=r(t,e,a);return s(o,i,n)}},35154(t){t.exports=function(t,e,i,r){if(!t&&!r||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(r&&r.hasOwnProperty(e))return r[e];if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,a=r,o=i,h=i,l=!0,u=!0,d=0;d<s.length;d++)n&&n.hasOwnProperty(s[d])?(o=n[s[d]],n=n[s[d]]):l=!1,a&&a.hasOwnProperty(s[d])?(h=a[s[d]],a=a[s[d]]):u=!1;return l?o:u?h:i}return i}},69036(t){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},1985(t){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},97022(t){t.exports=function(t,e){return t.hasOwnProperty(e)}},41212(t){t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},46975(t,e,i){var r=i(41786);t.exports=function(t,e){var i=r(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},269(t,e,i){var r=i(41786);t.exports=function(t,e){var i=r(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},18254(t,e,i){var r=i(97022);t.exports=function(t,e){for(var i={},s=0;s<e.length;s++){var n=e[s];r(t,n)&&(i[n]=t[n])}return i}},61622(t){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var r=e.split("."),s=t,n=t,a=0;a<r.length;a++){if(!s.hasOwnProperty(r[a]))return!1;n=s,s=s[r[a]]}return n[r[r.length-1]]=i,!0}return!1}},1183(t,e,i){t.exports={Clone:i(41786),DeepCopy:i(62644),Extend:i(79291),GetAdvancedValue:i(23568),GetFastValue:i(95540),GetMinMaxValue:i(82840),GetValue:i(35154),HasAll:i(69036),HasAny:i(1985),HasValue:i(97022),IsPlainObject:i(41212),Merge:i(46975),MergeRight:i(269),Pick:i(18254),SetValue:i(61622)}},27902(t){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},41836(t){t.exports=function(t,e,i,r){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===r&&(r=3);var s=0;if(e+1>=(t=t.toString()).length)switch(r){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var n=Math.ceil((s=e-t.length)/2);t=new Array(s-n+1).join(i)+t+new Array(n+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628(t){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e)+t.slice(e+1)}},27671(t){t.exports=function(t){return t.split("").reverse().join("")}},45650(t){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},35355(t){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749(t,e,i){t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,i),n.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(85454)})());
\ No newline at end of file diff --git a/2026/games/colinahscopy_/assets/background-1-SlB5T7V0.png b/2026/games_submissions/colinahscopy_/assets/background-1-SlB5T7V0.png Binary files differindex ad03485..ad03485 100644 --- a/2026/games/colinahscopy_/assets/background-1-SlB5T7V0.png +++ b/2026/games_submissions/colinahscopy_/assets/background-1-SlB5T7V0.png diff --git a/2026/games/colinahscopy_/assets/background-2-DMBXtXoc.png b/2026/games_submissions/colinahscopy_/assets/background-2-DMBXtXoc.png Binary files differindex 7d60b75..7d60b75 100644 --- a/2026/games/colinahscopy_/assets/background-2-DMBXtXoc.png +++ b/2026/games_submissions/colinahscopy_/assets/background-2-DMBXtXoc.png diff --git a/2026/games/colinahscopy_/assets/background-3-Bt_6Lr9w.png b/2026/games_submissions/colinahscopy_/assets/background-3-Bt_6Lr9w.png Binary files differindex 676a919..676a919 100644 --- a/2026/games/colinahscopy_/assets/background-3-Bt_6Lr9w.png +++ b/2026/games_submissions/colinahscopy_/assets/background-3-Bt_6Lr9w.png diff --git a/2026/games/colinahscopy_/assets/background-DVzvEgsh.png b/2026/games_submissions/colinahscopy_/assets/background-DVzvEgsh.png Binary files differindex 2968115..2968115 100644 --- a/2026/games/colinahscopy_/assets/background-DVzvEgsh.png +++ b/2026/games_submissions/colinahscopy_/assets/background-DVzvEgsh.png diff --git a/2026/games/colinahscopy_/assets/background-L-CJqd20tl.png b/2026/games_submissions/colinahscopy_/assets/background-L-CJqd20tl.png Binary files differindex 768e0a1..768e0a1 100644 --- a/2026/games/colinahscopy_/assets/background-L-CJqd20tl.png +++ b/2026/games_submissions/colinahscopy_/assets/background-L-CJqd20tl.png diff --git a/2026/games/colinahscopy_/assets/background-W-Cv3tso6C.png b/2026/games_submissions/colinahscopy_/assets/background-W-Cv3tso6C.png Binary files differindex 97e83d8..97e83d8 100644 --- a/2026/games/colinahscopy_/assets/background-W-Cv3tso6C.png +++ b/2026/games_submissions/colinahscopy_/assets/background-W-Cv3tso6C.png diff --git a/2026/games/colinahscopy_/assets/baseball-DzYmL4bE.png b/2026/games_submissions/colinahscopy_/assets/baseball-DzYmL4bE.png Binary files differindex faed04b..faed04b 100644 --- a/2026/games/colinahscopy_/assets/baseball-DzYmL4bE.png +++ b/2026/games_submissions/colinahscopy_/assets/baseball-DzYmL4bE.png diff --git a/2026/games/colinahscopy_/assets/bat-D8RTLMJr.png b/2026/games_submissions/colinahscopy_/assets/bat-D8RTLMJr.png Binary files differindex 9ed9060..9ed9060 100644 --- a/2026/games/colinahscopy_/assets/bat-D8RTLMJr.png +++ b/2026/games_submissions/colinahscopy_/assets/bat-D8RTLMJr.png diff --git a/2026/games/colinahscopy_/assets/favicon-CCb8yPOv.ico b/2026/games_submissions/colinahscopy_/assets/favicon-CCb8yPOv.ico Binary files differindex e892e9b..e892e9b 100644 --- a/2026/games/colinahscopy_/assets/favicon-CCb8yPOv.ico +++ b/2026/games_submissions/colinahscopy_/assets/favicon-CCb8yPOv.ico diff --git a/2026/games/colinahscopy_/assets/index-4txc88DM.css b/2026/games_submissions/colinahscopy_/assets/index-4txc88DM.css index 3ad0b11..3ad0b11 100644 --- a/2026/games/colinahscopy_/assets/index-4txc88DM.css +++ b/2026/games_submissions/colinahscopy_/assets/index-4txc88DM.css diff --git a/2026/games/colinahscopy_/assets/index-DtHs_pd8.js b/2026/games_submissions/colinahscopy_/assets/index-DtHs_pd8.js index 53f5303..53f5303 100644 --- a/2026/games/colinahscopy_/assets/index-DtHs_pd8.js +++ b/2026/games_submissions/colinahscopy_/assets/index-DtHs_pd8.js diff --git a/2026/games/colinahscopy_/index.html b/2026/games_submissions/colinahscopy_/index.html index d4fad62..d4fad62 100644 --- a/2026/games/colinahscopy_/index.html +++ b/2026/games_submissions/colinahscopy_/index.html diff --git a/2026/games_submissions/doceys/index.html b/2026/games_submissions/doceys/index.html new file mode 100644 index 0000000..9d86458 --- /dev/null +++ b/2026/games_submissions/doceys/index.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> + <title>DocEys's LCOLONQ Microjam 2k26 Entry</title> + <style> + * { + margin: 0px; + padding: 0px; + } + body { + font-size: 10px; + } + #game_canvas { + image-rendering: pixelated; + display: block; + } + #game_restart { + visibility: hidden; + } + </style> + <script src="runtime.js"></script> + </head> + + <body> + <canvas id="game_canvas" width="240" height="160"> + Canvas no worky )': + </canvas> + <button id="game_restart">Restart Game</button> + </body> +</html> diff --git a/2026/games_submissions/doceys/main.wasm b/2026/games_submissions/doceys/main.wasm Binary files differnew file mode 100755 index 0000000..5b510b5 --- /dev/null +++ b/2026/games_submissions/doceys/main.wasm diff --git a/2026/games_submissions/doceys/runtime.js b/2026/games_submissions/doceys/runtime.js new file mode 100644 index 0000000..7dc2ca7 --- /dev/null +++ b/2026/games_submissions/doceys/runtime.js @@ -0,0 +1,289 @@ +// Is the game running standalone or in the harness +let is_standalone = false; +// A global reference of the WASM’s memory area so that we can look up pointers +let allocated; +// Global Canvas Object +let canvas; +// Global Canvas Context +let ctx; +// Current Mouse Position in Canvas coordinates +let mouse_position = { + x: -1, + y: -1, +}; +let mouse_is_down = false; +// Global image cache +const image_cache = new Map(); + +function init_canvas() { + canvas = document.getElementById("game_canvas"); + ctx = canvas.getContext("2d"); + + canvas.addEventListener("mousemove", (event) => { + const rect = canvas.getBoundingClientRect(); + + // Mouse position relative to the canvas + const relative_x = (event.clientX - rect.left) / rect.width; + const relative_y = (event.clientY - rect.top) / rect.height; + + // Internal pixel position + mouse_position.x = Math.round(relative_x * canvas.width); + mouse_position.y = Math.round(relative_y * canvas.height); + }); + + canvas.onmousedown = (_) => { + mouse_is_down = true; + }; + canvas.onmouseup = (event) => { + mouse_is_down = false; + }; +} + +// These are all the functions that we declared as "#foreign" in our Jai code. +// They let you interact with the JS and DOM world from within Jai. +// If you forget to implement one, the Proxy below will log a nice error. +const exported_js_functions = { + signal_done: (win) => { + window.parent.postMessage({op: "done", win}); + }, + + draw_rect: (x, y, width, height, color_ptr) => { + // Needed to convert Jai's BigInts to numbers + [x, y, width, height] = [Number(x), Number(y), Number(width), Number(height)]; + const {r, g, b} = rgb_from_jai_color(color_ptr); + + ctx.fillStyle = `rgb(${r} ${g} ${b})`; + ctx.fillRect(x, y, width, height); + }, + + draw_image: (x, y, width, height, image_ptr) => { + [x, y, width, height] = [Number(x), Number(y), Number(width), Number(height)]; + const ptr = Number(image_ptr); + + const memory_view = new DataView(allocated.buffer); + const count = Number(memory_view.getBigInt64(ptr, true)); + const data_ptr = memory_view.getUint32(ptr + 8, true); + + if (count <= 0 || data_ptr === 0) return; + + // Load image from pointer if it isn't in the cache already + if (!image_cache.has(data_ptr)) { + // Create image and add it to the cache + const image_buffer = new Uint8Array(allocated.buffer, data_ptr, count); + const image_blob = new Blob([image_buffer], { type: "image/png" }); + const blob_url = URL.createObjectURL(image_blob); + + const image = new Image(); + image.src = blob_url; + image.is_ready = false; + image.onload = () => { + image.is_ready = true; + URL.revokeObjectURL(blob_url); + }; + + image_cache.set(data_ptr, image); + } + + const image = image_cache.get(data_ptr); + if (image && image.is_ready) { + ctx.drawImage(image, x, y, width, height); + } + }, + + draw_text: (x, y, font_size, text_ptr, color_ptr, max_width) => { + [x, y, font_size, max_width] = [Number(x), Number(y), Number(font_size), Number(max_width)]; + const text = js_string_from_jai_string(text_ptr); + const {r, g, b} = rgb_from_jai_color(color_ptr); + + ctx.fillStyle = `rgb(${r} ${g} ${b})`; + ctx.font = font_size + "px serif"; + ctx.fillText(text, x, y, max_width); + }, + + get_text_width: (font_size, text_ptr) => { + ctx.font = Number(font_size) + "px serif"; + const text_metrics = ctx.measureText(js_string_from_jai_string(text_ptr)); + return text_metrics.width; + }, + + clear_rect: (x, y, width, height) => { + [x, y, width, height] = [Number(x), Number(y), Number(width), Number(height)]; + ctx.clearRect(x, y, width, height); + }, + + clear_canvas: () => { + ctx.clearRect(0, 0, canvas.width, canvas.height); + }, + + // This function "returns" a Struct like the following: + // struct { width: s64; height: s64; } + get_canvas_size_struct: (struct_ptr) => { + const ptr = Number(struct_ptr); + + const memory_view = new DataView(allocated.buffer); + memory_view.setBigInt64(ptr + 0, BigInt(canvas.width), true); + memory_view.setBigInt64(ptr + 8, BigInt(canvas.height), true); + }, + + // Same "return" as with "get_canvas_size_struct" + get_mouse_position: (struct_ptr) => { + const ptr = Number(struct_ptr); + + const memory_view = new DataView(allocated.buffer); + memory_view.setBigInt64(ptr + 0, BigInt(mouse_position.x), true); + memory_view.setBigInt64(ptr + 8, BigInt(mouse_position.y), true); + }, + is_mouse_down: () => { + return mouse_is_down; + }, + + // These two need to be implemented for print/write_string and the debugger + wasm_write_string: (s_count, s_data, to_standard_error) => { + const string = js_string_from_jai_string_length(s_data, s_count); + write_to_console_log(string, to_standard_error); + }, + wasm_debug_break: () => { + debugger; + }, +} + +// Create the environment for the WASM file, +// which includes the exported JS functions for the WASM: +const imports = { + "env": new Proxy(exported_js_functions, { + get(target, prop, receiver) { + if (target.hasOwnProperty(prop)) { + return target[prop]; + } + + return () => { throw new Error("Missing function: " + prop); }; + }, + }), +} + +let last_time_ms = 0; +// Runs the exported frame function at 60 FPS +function frame(timestamp_ms) { + const delta_time_ms = timestamp_ms - last_time_ms; + last_time_ms = timestamp_ms; + + if (wasm_instance) { + wasm_instance.exports.frame(delta_time_ms, timestamp_ms); + } + + requestAnimationFrame(frame); +} + +function init_message_listener() { + window.addEventListener("message", (event) => { + switch (event.data.op) { + case "start": + wasm_instance.exports.on_signal_start(BigInt(event.data.difficulty)); + window.parent.postMessage({ op: "started", verb: "chinese gopher time (bad)" }); + break; + default: + console.log(`Unexpected event: ${event}`); + break; + } + }); +} + +// Load the WASM file we compiled and start the game. +WebAssembly.instantiateStreaming(fetch("main.wasm"), imports).then( + (obj) => { + wasm_instance = obj.instance; + allocated = obj.instance.exports.memory; + // Running standalone, outside the Jam harness + is_standalone = window.self === window.top; + + init_canvas(); + init_message_listener(); + + if (is_standalone) { + const restart_button = document.getElementById("game_restart"); + restart_button.addEventListener("click", (event) => { + wasm_instance.exports.main(0, BigInt(0)); + }); + restart_button.style.visibility = "visible"; + + wasm_instance.exports.main(0, BigInt(0)); + } + + window.parent.postMessage({ op: "ready" }); + requestAnimationFrame(frame); + } +); + +const text_decoder = new TextDecoder("utf-8"); +function js_string_from_jai_string_length(pointer, length) { + const u8 = new Uint8Array(allocated.buffer) + const bytes = u8.subarray(Number(pointer), Number(pointer) + Number(length)); + return text_decoder.decode(bytes); +} + +function js_string_from_jai_string(pointer) { + const ptr = Number(pointer); + + const memory_view = new DataView(allocated.buffer); + const length = Number(memory_view.getBigInt64(ptr, true)); + const data_ptr = memory_view.getUint32(ptr + 8, true); + + const u8 = new Uint8Array(allocated.buffer); + const bytes = u8.subarray(Number(data_ptr), Number(data_ptr) + Number(length)); + + return text_decoder.decode(bytes); +} + +function rgb_from_jai_color(color_ptr) { + const ptr = Number(color_ptr); + const memory_view = new DataView(allocated.buffer); + + // Read the colors from the pointer + const r = memory_view.getUint8(ptr + 0); + const g = memory_view.getUint8(ptr + 1); + const b = memory_view.getUint8(ptr + 2); + + return {r, g, b}; +} + +// console.log and console.error always add newlines so we need to buffer the output from write_string +// to simulate a more basic I/O behavior. We’ll flush it after a certain time so that you still +// see the last line if you forget to terminate it with a newline for some reason. +let console_buffer = ""; +let console_buffer_is_standard_error; +let console_timeout; +const FLUSH_CONSOLE_AFTER_MS = 3; + +function write_to_console_log(str, to_standard_error) { + if (console_buffer && console_buffer_is_standard_error != to_standard_error) { + flush_buffer(); + } + + console_buffer_is_standard_error = to_standard_error; + const lines = str.split("\n"); + for (let i = 0; i < lines.length - 1; i++) { + console_buffer += lines[i]; + flush_buffer(); + } + + console_buffer += lines[lines.length - 1]; + + clearTimeout(console_timeout); + if (console_buffer) { + console_timeout = setTimeout(() => { + flush_buffer(); + }, FLUSH_CONSOLE_AFTER_MS); + } + + function flush_buffer() { + if (!console_buffer) return; + + if (console_buffer_is_standard_error) { + console.error(console_buffer); + } else { + console.log(console_buffer); + } + + console_buffer = ""; + } +} diff --git a/2026/games_submissions/talon1024/assets/favicon.ico b/2026/games_submissions/talon1024/assets/favicon.ico Binary files differnew file mode 100644 index 0000000..c5dfeeb --- /dev/null +++ b/2026/games_submissions/talon1024/assets/favicon.ico diff --git a/2026/games_submissions/talon1024/assets/gfx/bg.png b/2026/games_submissions/talon1024/assets/gfx/bg.png Binary files differnew file mode 100644 index 0000000..1baf8bd --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/bg.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_1.png b/2026/games_submissions/talon1024/assets/gfx/explod_1.png Binary files differnew file mode 100644 index 0000000..55b22e1 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_1.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_2.png b/2026/games_submissions/talon1024/assets/gfx/explod_2.png Binary files differnew file mode 100644 index 0000000..5591d96 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_2.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_3.png b/2026/games_submissions/talon1024/assets/gfx/explod_3.png Binary files differnew file mode 100644 index 0000000..85d12c5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_3.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_4.png b/2026/games_submissions/talon1024/assets/gfx/explod_4.png Binary files differnew file mode 100644 index 0000000..37846b2 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_4.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_5.png b/2026/games_submissions/talon1024/assets/gfx/explod_5.png Binary files differnew file mode 100644 index 0000000..293916a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_5.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_6.png b/2026/games_submissions/talon1024/assets/gfx/explod_6.png Binary files differnew file mode 100644 index 0000000..c71b307 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_6.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_7.png b/2026/games_submissions/talon1024/assets/gfx/explod_7.png Binary files differnew file mode 100644 index 0000000..d5208de --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_7.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_8.png b/2026/games_submissions/talon1024/assets/gfx/explod_8.png Binary files differnew file mode 100644 index 0000000..69b37b1 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_8.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_9.png b/2026/games_submissions/talon1024/assets/gfx/explod_9.png Binary files differnew file mode 100644 index 0000000..7ff9028 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_9.png diff --git a/2026/games_submissions/talon1024/assets/gfx/explod_A.png b/2026/games_submissions/talon1024/assets/gfx/explod_A.png Binary files differnew file mode 100644 index 0000000..dfead88 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/explod_A.png diff --git a/2026/games_submissions/talon1024/assets/gfx/f_bomb.png b/2026/games_submissions/talon1024/assets/gfx/f_bomb.png Binary files differnew file mode 100644 index 0000000..6680ba3 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/f_bomb.png diff --git a/2026/games_submissions/talon1024/assets/gfx/f_enemy.png b/2026/games_submissions/talon1024/assets/gfx/f_enemy.png Binary files differnew file mode 100644 index 0000000..d396102 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/f_enemy.png diff --git a/2026/games_submissions/talon1024/assets/gfx/f_friend.png b/2026/games_submissions/talon1024/assets/gfx/f_friend.png Binary files differnew file mode 100644 index 0000000..4a5f659 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/f_friend.png diff --git a/2026/games_submissions/talon1024/assets/gfx/f_protect.png b/2026/games_submissions/talon1024/assets/gfx/f_protect.png Binary files differnew file mode 100644 index 0000000..31df792 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/f_protect.png diff --git a/2026/games_submissions/talon1024/assets/gfx/f_unknown.png b/2026/games_submissions/talon1024/assets/gfx/f_unknown.png Binary files differnew file mode 100644 index 0000000..c5716a9 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/f_unknown.png diff --git a/2026/games_submissions/talon1024/assets/gfx/fg_stars1.png b/2026/games_submissions/talon1024/assets/gfx/fg_stars1.png Binary files differnew file mode 100644 index 0000000..93245a1 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/fg_stars1.png diff --git a/2026/games_submissions/talon1024/assets/gfx/x_ghair.png b/2026/games_submissions/talon1024/assets/gfx/x_ghair.png Binary files differnew file mode 100644 index 0000000..ecfac8d --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/x_ghair.png diff --git a/2026/games_submissions/talon1024/assets/gfx/x_ohair.png b/2026/games_submissions/talon1024/assets/gfx/x_ohair.png Binary files differnew file mode 100644 index 0000000..0cd76cc --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/x_ohair.png diff --git a/2026/games_submissions/talon1024/assets/gfx/x_xhair.png b/2026/games_submissions/talon1024/assets/gfx/x_xhair.png Binary files differnew file mode 100644 index 0000000..49b0d33 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/gfx/x_xhair.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0021.png b/2026/games_submissions/talon1024/assets/minifont/0021.png Binary files differnew file mode 100644 index 0000000..65eceb2 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0021.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0022.png b/2026/games_submissions/talon1024/assets/minifont/0022.png Binary files differnew file mode 100644 index 0000000..a91e0b3 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0022.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0023.png b/2026/games_submissions/talon1024/assets/minifont/0023.png Binary files differnew file mode 100644 index 0000000..73ba591 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0023.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0024.png b/2026/games_submissions/talon1024/assets/minifont/0024.png Binary files differnew file mode 100644 index 0000000..3f36507 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0024.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0025.png b/2026/games_submissions/talon1024/assets/minifont/0025.png Binary files differnew file mode 100644 index 0000000..e8f3e13 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0025.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0026.png b/2026/games_submissions/talon1024/assets/minifont/0026.png Binary files differnew file mode 100644 index 0000000..fbc8078 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0026.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0027.png b/2026/games_submissions/talon1024/assets/minifont/0027.png Binary files differnew file mode 100644 index 0000000..8aeeaf4 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0027.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0028.png b/2026/games_submissions/talon1024/assets/minifont/0028.png Binary files differnew file mode 100644 index 0000000..d8692a3 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0028.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0029.png b/2026/games_submissions/talon1024/assets/minifont/0029.png Binary files differnew file mode 100644 index 0000000..a906897 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0029.png diff --git a/2026/games_submissions/talon1024/assets/minifont/002A.png b/2026/games_submissions/talon1024/assets/minifont/002A.png Binary files differnew file mode 100644 index 0000000..2fc19cb --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/002A.png diff --git a/2026/games_submissions/talon1024/assets/minifont/002B.png b/2026/games_submissions/talon1024/assets/minifont/002B.png Binary files differnew file mode 100644 index 0000000..d866abc --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/002B.png diff --git a/2026/games_submissions/talon1024/assets/minifont/002C.png b/2026/games_submissions/talon1024/assets/minifont/002C.png Binary files differnew file mode 100644 index 0000000..e3ff263 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/002C.png diff --git a/2026/games_submissions/talon1024/assets/minifont/002D.png b/2026/games_submissions/talon1024/assets/minifont/002D.png Binary files differnew file mode 100644 index 0000000..d80f4ed --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/002D.png diff --git a/2026/games_submissions/talon1024/assets/minifont/002E.png b/2026/games_submissions/talon1024/assets/minifont/002E.png Binary files differnew file mode 100644 index 0000000..009c048 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/002E.png diff --git a/2026/games_submissions/talon1024/assets/minifont/002F.png b/2026/games_submissions/talon1024/assets/minifont/002F.png Binary files differnew file mode 100644 index 0000000..8c4f975 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/002F.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0030.png b/2026/games_submissions/talon1024/assets/minifont/0030.png Binary files differnew file mode 100644 index 0000000..305dca1 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0030.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0031.png b/2026/games_submissions/talon1024/assets/minifont/0031.png Binary files differnew file mode 100644 index 0000000..79a4084 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0031.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0032.png b/2026/games_submissions/talon1024/assets/minifont/0032.png Binary files differnew file mode 100644 index 0000000..1af9c94 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0032.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0033.png b/2026/games_submissions/talon1024/assets/minifont/0033.png Binary files differnew file mode 100644 index 0000000..cd83714 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0033.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0034.png b/2026/games_submissions/talon1024/assets/minifont/0034.png Binary files differnew file mode 100644 index 0000000..3e552f4 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0034.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0035.png b/2026/games_submissions/talon1024/assets/minifont/0035.png Binary files differnew file mode 100644 index 0000000..89225d3 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0035.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0036.png b/2026/games_submissions/talon1024/assets/minifont/0036.png Binary files differnew file mode 100644 index 0000000..218c8b6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0036.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0037.png b/2026/games_submissions/talon1024/assets/minifont/0037.png Binary files differnew file mode 100644 index 0000000..186b4fa --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0037.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0038.png b/2026/games_submissions/talon1024/assets/minifont/0038.png Binary files differnew file mode 100644 index 0000000..95344e3 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0038.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0039.png b/2026/games_submissions/talon1024/assets/minifont/0039.png Binary files differnew file mode 100644 index 0000000..5345170 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0039.png diff --git a/2026/games_submissions/talon1024/assets/minifont/003A.png b/2026/games_submissions/talon1024/assets/minifont/003A.png Binary files differnew file mode 100644 index 0000000..7418284 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/003A.png diff --git a/2026/games_submissions/talon1024/assets/minifont/003B.png b/2026/games_submissions/talon1024/assets/minifont/003B.png Binary files differnew file mode 100644 index 0000000..195a35b --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/003B.png diff --git a/2026/games_submissions/talon1024/assets/minifont/003C.png b/2026/games_submissions/talon1024/assets/minifont/003C.png Binary files differnew file mode 100644 index 0000000..9eda68e --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/003C.png diff --git a/2026/games_submissions/talon1024/assets/minifont/003D.png b/2026/games_submissions/talon1024/assets/minifont/003D.png Binary files differnew file mode 100644 index 0000000..96e15c4 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/003D.png diff --git a/2026/games_submissions/talon1024/assets/minifont/003E.png b/2026/games_submissions/talon1024/assets/minifont/003E.png Binary files differnew file mode 100644 index 0000000..fb6b779 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/003E.png diff --git a/2026/games_submissions/talon1024/assets/minifont/003F.png b/2026/games_submissions/talon1024/assets/minifont/003F.png Binary files differnew file mode 100644 index 0000000..65126ef --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/003F.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0040.png b/2026/games_submissions/talon1024/assets/minifont/0040.png Binary files differnew file mode 100644 index 0000000..11e4274 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0040.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0041.png b/2026/games_submissions/talon1024/assets/minifont/0041.png Binary files differnew file mode 100644 index 0000000..ad8aebe --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0041.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0042.png b/2026/games_submissions/talon1024/assets/minifont/0042.png Binary files differnew file mode 100644 index 0000000..4df44e4 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0042.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0043.png b/2026/games_submissions/talon1024/assets/minifont/0043.png Binary files differnew file mode 100644 index 0000000..8009776 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0043.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0044.png b/2026/games_submissions/talon1024/assets/minifont/0044.png Binary files differnew file mode 100644 index 0000000..48a0420 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0044.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0045.png b/2026/games_submissions/talon1024/assets/minifont/0045.png Binary files differnew file mode 100644 index 0000000..cc42f4b --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0045.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0046.png b/2026/games_submissions/talon1024/assets/minifont/0046.png Binary files differnew file mode 100644 index 0000000..56364d5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0046.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0047.png b/2026/games_submissions/talon1024/assets/minifont/0047.png Binary files differnew file mode 100644 index 0000000..f04844c --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0047.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0048.png b/2026/games_submissions/talon1024/assets/minifont/0048.png Binary files differnew file mode 100644 index 0000000..1c699a5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0048.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0049.png b/2026/games_submissions/talon1024/assets/minifont/0049.png Binary files differnew file mode 100644 index 0000000..18a6f1a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0049.png diff --git a/2026/games_submissions/talon1024/assets/minifont/004A.png b/2026/games_submissions/talon1024/assets/minifont/004A.png Binary files differnew file mode 100644 index 0000000..c3118f7 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/004A.png diff --git a/2026/games_submissions/talon1024/assets/minifont/004B.png b/2026/games_submissions/talon1024/assets/minifont/004B.png Binary files differnew file mode 100644 index 0000000..0aacca9 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/004B.png diff --git a/2026/games_submissions/talon1024/assets/minifont/004C.png b/2026/games_submissions/talon1024/assets/minifont/004C.png Binary files differnew file mode 100644 index 0000000..31deb01 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/004C.png diff --git a/2026/games_submissions/talon1024/assets/minifont/004D.png b/2026/games_submissions/talon1024/assets/minifont/004D.png Binary files differnew file mode 100644 index 0000000..e6c8760 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/004D.png diff --git a/2026/games_submissions/talon1024/assets/minifont/004E.png b/2026/games_submissions/talon1024/assets/minifont/004E.png Binary files differnew file mode 100644 index 0000000..ee44b9b --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/004E.png diff --git a/2026/games_submissions/talon1024/assets/minifont/004F.png b/2026/games_submissions/talon1024/assets/minifont/004F.png Binary files differnew file mode 100644 index 0000000..6517d7c --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/004F.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0050.png b/2026/games_submissions/talon1024/assets/minifont/0050.png Binary files differnew file mode 100644 index 0000000..882d185 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0050.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0051.png b/2026/games_submissions/talon1024/assets/minifont/0051.png Binary files differnew file mode 100644 index 0000000..73cfc77 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0051.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0052.png b/2026/games_submissions/talon1024/assets/minifont/0052.png Binary files differnew file mode 100644 index 0000000..2f1c5d1 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0052.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0053.png b/2026/games_submissions/talon1024/assets/minifont/0053.png Binary files differnew file mode 100644 index 0000000..5d13556 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0053.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0054.png b/2026/games_submissions/talon1024/assets/minifont/0054.png Binary files differnew file mode 100644 index 0000000..03f8471 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0054.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0055.png b/2026/games_submissions/talon1024/assets/minifont/0055.png Binary files differnew file mode 100644 index 0000000..8d2c36a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0055.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0056.png b/2026/games_submissions/talon1024/assets/minifont/0056.png Binary files differnew file mode 100644 index 0000000..8f5a852 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0056.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0057.png b/2026/games_submissions/talon1024/assets/minifont/0057.png Binary files differnew file mode 100644 index 0000000..9b94204 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0057.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0058.png b/2026/games_submissions/talon1024/assets/minifont/0058.png Binary files differnew file mode 100644 index 0000000..7cb4a57 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0058.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0059.png b/2026/games_submissions/talon1024/assets/minifont/0059.png Binary files differnew file mode 100644 index 0000000..a8c49ae --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0059.png diff --git a/2026/games_submissions/talon1024/assets/minifont/005A.png b/2026/games_submissions/talon1024/assets/minifont/005A.png Binary files differnew file mode 100644 index 0000000..034afd5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/005A.png diff --git a/2026/games_submissions/talon1024/assets/minifont/005B.png b/2026/games_submissions/talon1024/assets/minifont/005B.png Binary files differnew file mode 100644 index 0000000..53fd9cd --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/005B.png diff --git a/2026/games_submissions/talon1024/assets/minifont/005C.png b/2026/games_submissions/talon1024/assets/minifont/005C.png Binary files differnew file mode 100644 index 0000000..5b39cdc --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/005C.png diff --git a/2026/games_submissions/talon1024/assets/minifont/005D.png b/2026/games_submissions/talon1024/assets/minifont/005D.png Binary files differnew file mode 100644 index 0000000..8624730 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/005D.png diff --git a/2026/games_submissions/talon1024/assets/minifont/005E.png b/2026/games_submissions/talon1024/assets/minifont/005E.png Binary files differnew file mode 100644 index 0000000..3bf1813 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/005E.png diff --git a/2026/games_submissions/talon1024/assets/minifont/005F.png b/2026/games_submissions/talon1024/assets/minifont/005F.png Binary files differnew file mode 100644 index 0000000..b0c4baf --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/005F.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0060.png b/2026/games_submissions/talon1024/assets/minifont/0060.png Binary files differnew file mode 100644 index 0000000..bb27762 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0060.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0061.png b/2026/games_submissions/talon1024/assets/minifont/0061.png Binary files differnew file mode 100644 index 0000000..b674ecb --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0061.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0062.png b/2026/games_submissions/talon1024/assets/minifont/0062.png Binary files differnew file mode 100644 index 0000000..52830ec --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0062.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0063.png b/2026/games_submissions/talon1024/assets/minifont/0063.png Binary files differnew file mode 100644 index 0000000..a1cbc7e --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0063.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0064.png b/2026/games_submissions/talon1024/assets/minifont/0064.png Binary files differnew file mode 100644 index 0000000..de253cf --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0064.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0065.png b/2026/games_submissions/talon1024/assets/minifont/0065.png Binary files differnew file mode 100644 index 0000000..fd819c2 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0065.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0066.png b/2026/games_submissions/talon1024/assets/minifont/0066.png Binary files differnew file mode 100644 index 0000000..9afdb68 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0066.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0067.png b/2026/games_submissions/talon1024/assets/minifont/0067.png Binary files differnew file mode 100644 index 0000000..24e46a5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0067.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0068.png b/2026/games_submissions/talon1024/assets/minifont/0068.png Binary files differnew file mode 100644 index 0000000..3b56f8b --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0068.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0069.png b/2026/games_submissions/talon1024/assets/minifont/0069.png Binary files differnew file mode 100644 index 0000000..86c042f --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0069.png diff --git a/2026/games_submissions/talon1024/assets/minifont/006A.png b/2026/games_submissions/talon1024/assets/minifont/006A.png Binary files differnew file mode 100644 index 0000000..27e4779 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/006A.png diff --git a/2026/games_submissions/talon1024/assets/minifont/006B.png b/2026/games_submissions/talon1024/assets/minifont/006B.png Binary files differnew file mode 100644 index 0000000..813d77d --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/006B.png diff --git a/2026/games_submissions/talon1024/assets/minifont/006C.png b/2026/games_submissions/talon1024/assets/minifont/006C.png Binary files differnew file mode 100644 index 0000000..a51f8b0 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/006C.png diff --git a/2026/games_submissions/talon1024/assets/minifont/006D.png b/2026/games_submissions/talon1024/assets/minifont/006D.png Binary files differnew file mode 100644 index 0000000..0ccaae7 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/006D.png diff --git a/2026/games_submissions/talon1024/assets/minifont/006E.png b/2026/games_submissions/talon1024/assets/minifont/006E.png Binary files differnew file mode 100644 index 0000000..ac4b488 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/006E.png diff --git a/2026/games_submissions/talon1024/assets/minifont/006F.png b/2026/games_submissions/talon1024/assets/minifont/006F.png Binary files differnew file mode 100644 index 0000000..a6132bf --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/006F.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0070.png b/2026/games_submissions/talon1024/assets/minifont/0070.png Binary files differnew file mode 100644 index 0000000..c6e4446 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0070.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0071.png b/2026/games_submissions/talon1024/assets/minifont/0071.png Binary files differnew file mode 100644 index 0000000..2a49110 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0071.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0072.png b/2026/games_submissions/talon1024/assets/minifont/0072.png Binary files differnew file mode 100644 index 0000000..60a244c --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0072.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0073.png b/2026/games_submissions/talon1024/assets/minifont/0073.png Binary files differnew file mode 100644 index 0000000..8fb05b7 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0073.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0074.png b/2026/games_submissions/talon1024/assets/minifont/0074.png Binary files differnew file mode 100644 index 0000000..b2e0234 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0074.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0075.png b/2026/games_submissions/talon1024/assets/minifont/0075.png Binary files differnew file mode 100644 index 0000000..4e209b6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0075.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0076.png b/2026/games_submissions/talon1024/assets/minifont/0076.png Binary files differnew file mode 100644 index 0000000..f6283ef --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0076.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0077.png b/2026/games_submissions/talon1024/assets/minifont/0077.png Binary files differnew file mode 100644 index 0000000..533ab56 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0077.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0078.png b/2026/games_submissions/talon1024/assets/minifont/0078.png Binary files differnew file mode 100644 index 0000000..e24f8b0 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0078.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0079.png b/2026/games_submissions/talon1024/assets/minifont/0079.png Binary files differnew file mode 100644 index 0000000..5bc67b4 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0079.png diff --git a/2026/games_submissions/talon1024/assets/minifont/007A.png b/2026/games_submissions/talon1024/assets/minifont/007A.png Binary files differnew file mode 100644 index 0000000..01055f8 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/007A.png diff --git a/2026/games_submissions/talon1024/assets/minifont/007B.png b/2026/games_submissions/talon1024/assets/minifont/007B.png Binary files differnew file mode 100644 index 0000000..79789dc --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/007B.png diff --git a/2026/games_submissions/talon1024/assets/minifont/007C.png b/2026/games_submissions/talon1024/assets/minifont/007C.png Binary files differnew file mode 100644 index 0000000..75f9a93 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/007C.png diff --git a/2026/games_submissions/talon1024/assets/minifont/007D.png b/2026/games_submissions/talon1024/assets/minifont/007D.png Binary files differnew file mode 100644 index 0000000..a9621a4 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/007D.png diff --git a/2026/games_submissions/talon1024/assets/minifont/007E.png b/2026/games_submissions/talon1024/assets/minifont/007E.png Binary files differnew file mode 100644 index 0000000..96bf2d2 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/007E.png diff --git a/2026/games_submissions/talon1024/assets/minifont/0080.png b/2026/games_submissions/talon1024/assets/minifont/0080.png Binary files differnew file mode 100644 index 0000000..bdfb00f --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/0080.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00A1.png b/2026/games_submissions/talon1024/assets/minifont/00A1.png Binary files differnew file mode 100644 index 0000000..45bca4b --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00A1.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00AA.png b/2026/games_submissions/talon1024/assets/minifont/00AA.png Binary files differnew file mode 100644 index 0000000..e440f79 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00AA.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00B0.png b/2026/games_submissions/talon1024/assets/minifont/00B0.png Binary files differnew file mode 100644 index 0000000..95bb4b5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00B0.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00BA.png b/2026/games_submissions/talon1024/assets/minifont/00BA.png Binary files differnew file mode 100644 index 0000000..95bb4b5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00BA.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00BF.png b/2026/games_submissions/talon1024/assets/minifont/00BF.png Binary files differnew file mode 100644 index 0000000..25a43fc --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00BF.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C0.png b/2026/games_submissions/talon1024/assets/minifont/00C0.png Binary files differnew file mode 100644 index 0000000..cb01c76 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C0.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C1.png b/2026/games_submissions/talon1024/assets/minifont/00C1.png Binary files differnew file mode 100644 index 0000000..a5a63b7 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C1.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C2.png b/2026/games_submissions/talon1024/assets/minifont/00C2.png Binary files differnew file mode 100644 index 0000000..7c634bf --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C2.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C3.png b/2026/games_submissions/talon1024/assets/minifont/00C3.png Binary files differnew file mode 100644 index 0000000..8c87b8a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C3.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C4.png b/2026/games_submissions/talon1024/assets/minifont/00C4.png Binary files differnew file mode 100644 index 0000000..5f4f9b6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C4.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C7.png b/2026/games_submissions/talon1024/assets/minifont/00C7.png Binary files differnew file mode 100644 index 0000000..cbb4fb6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C7.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C8.png b/2026/games_submissions/talon1024/assets/minifont/00C8.png Binary files differnew file mode 100644 index 0000000..b5ebe4d --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C8.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00C9.png b/2026/games_submissions/talon1024/assets/minifont/00C9.png Binary files differnew file mode 100644 index 0000000..3c14dc7 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00C9.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00CA.png b/2026/games_submissions/talon1024/assets/minifont/00CA.png Binary files differnew file mode 100644 index 0000000..f1bb711 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00CA.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00CB.png b/2026/games_submissions/talon1024/assets/minifont/00CB.png Binary files differnew file mode 100644 index 0000000..9767b22 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00CB.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00CC.png b/2026/games_submissions/talon1024/assets/minifont/00CC.png Binary files differnew file mode 100644 index 0000000..f71060e --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00CC.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00CD.png b/2026/games_submissions/talon1024/assets/minifont/00CD.png Binary files differnew file mode 100644 index 0000000..3a57950 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00CD.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00CE.png b/2026/games_submissions/talon1024/assets/minifont/00CE.png Binary files differnew file mode 100644 index 0000000..c9d7674 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00CE.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00CF.png b/2026/games_submissions/talon1024/assets/minifont/00CF.png Binary files differnew file mode 100644 index 0000000..8b04818 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00CF.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D1.png b/2026/games_submissions/talon1024/assets/minifont/00D1.png Binary files differnew file mode 100644 index 0000000..6a02dd6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D1.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D2.png b/2026/games_submissions/talon1024/assets/minifont/00D2.png Binary files differnew file mode 100644 index 0000000..7be0aab --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D2.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D3.png b/2026/games_submissions/talon1024/assets/minifont/00D3.png Binary files differnew file mode 100644 index 0000000..c261c66 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D3.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D4.png b/2026/games_submissions/talon1024/assets/minifont/00D4.png Binary files differnew file mode 100644 index 0000000..c08c83a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D4.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D5.png b/2026/games_submissions/talon1024/assets/minifont/00D5.png Binary files differnew file mode 100644 index 0000000..7b93b42 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D5.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D6.png b/2026/games_submissions/talon1024/assets/minifont/00D6.png Binary files differnew file mode 100644 index 0000000..d20bb1f --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D6.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00D9.png b/2026/games_submissions/talon1024/assets/minifont/00D9.png Binary files differnew file mode 100644 index 0000000..f300a76 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00D9.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00DA.png b/2026/games_submissions/talon1024/assets/minifont/00DA.png Binary files differnew file mode 100644 index 0000000..1dc5cd6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00DA.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00DB.png b/2026/games_submissions/talon1024/assets/minifont/00DB.png Binary files differnew file mode 100644 index 0000000..af31864 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00DB.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00DC.png b/2026/games_submissions/talon1024/assets/minifont/00DC.png Binary files differnew file mode 100644 index 0000000..fd816ad --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00DC.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00DD.png b/2026/games_submissions/talon1024/assets/minifont/00DD.png Binary files differnew file mode 100644 index 0000000..a4b32ab --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00DD.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00DF.png b/2026/games_submissions/talon1024/assets/minifont/00DF.png Binary files differnew file mode 100644 index 0000000..0628ac5 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00DF.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E0.png b/2026/games_submissions/talon1024/assets/minifont/00E0.png Binary files differnew file mode 100644 index 0000000..782271a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E0.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E1.png b/2026/games_submissions/talon1024/assets/minifont/00E1.png Binary files differnew file mode 100644 index 0000000..3301e05 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E1.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E2.png b/2026/games_submissions/talon1024/assets/minifont/00E2.png Binary files differnew file mode 100644 index 0000000..62277b9 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E2.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E3.png b/2026/games_submissions/talon1024/assets/minifont/00E3.png Binary files differnew file mode 100644 index 0000000..9088cb7 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E3.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E4.png b/2026/games_submissions/talon1024/assets/minifont/00E4.png Binary files differnew file mode 100644 index 0000000..723a832 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E4.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E7.png b/2026/games_submissions/talon1024/assets/minifont/00E7.png Binary files differnew file mode 100644 index 0000000..2a39b74 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E7.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E8.png b/2026/games_submissions/talon1024/assets/minifont/00E8.png Binary files differnew file mode 100644 index 0000000..bf9aa44 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E8.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00E9.png b/2026/games_submissions/talon1024/assets/minifont/00E9.png Binary files differnew file mode 100644 index 0000000..0a761ef --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00E9.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00EA.png b/2026/games_submissions/talon1024/assets/minifont/00EA.png Binary files differnew file mode 100644 index 0000000..e9d95ee --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00EA.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00EB.png b/2026/games_submissions/talon1024/assets/minifont/00EB.png Binary files differnew file mode 100644 index 0000000..1756465 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00EB.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00EC.png b/2026/games_submissions/talon1024/assets/minifont/00EC.png Binary files differnew file mode 100644 index 0000000..b4da228 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00EC.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00ED.png b/2026/games_submissions/talon1024/assets/minifont/00ED.png Binary files differnew file mode 100644 index 0000000..1d42aa8 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00ED.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00EE.png b/2026/games_submissions/talon1024/assets/minifont/00EE.png Binary files differnew file mode 100644 index 0000000..faef874 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00EE.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00EF.png b/2026/games_submissions/talon1024/assets/minifont/00EF.png Binary files differnew file mode 100644 index 0000000..15cbd35 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00EF.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F1.png b/2026/games_submissions/talon1024/assets/minifont/00F1.png Binary files differnew file mode 100644 index 0000000..ec44d82 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F1.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F2.png b/2026/games_submissions/talon1024/assets/minifont/00F2.png Binary files differnew file mode 100644 index 0000000..9c811e2 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F2.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F3.png b/2026/games_submissions/talon1024/assets/minifont/00F3.png Binary files differnew file mode 100644 index 0000000..95aa478 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F3.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F4.png b/2026/games_submissions/talon1024/assets/minifont/00F4.png Binary files differnew file mode 100644 index 0000000..c08c83a --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F4.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F5.png b/2026/games_submissions/talon1024/assets/minifont/00F5.png Binary files differnew file mode 100644 index 0000000..7b93b42 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F5.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F6.png b/2026/games_submissions/talon1024/assets/minifont/00F6.png Binary files differnew file mode 100644 index 0000000..60ad5ad --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F6.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00F9.png b/2026/games_submissions/talon1024/assets/minifont/00F9.png Binary files differnew file mode 100644 index 0000000..c3417e6 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00F9.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00FA.png b/2026/games_submissions/talon1024/assets/minifont/00FA.png Binary files differnew file mode 100644 index 0000000..5610869 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00FA.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00FB.png b/2026/games_submissions/talon1024/assets/minifont/00FB.png Binary files differnew file mode 100644 index 0000000..af31864 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00FB.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00FC.png b/2026/games_submissions/talon1024/assets/minifont/00FC.png Binary files differnew file mode 100644 index 0000000..f8496e1 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00FC.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00FD.png b/2026/games_submissions/talon1024/assets/minifont/00FD.png Binary files differnew file mode 100644 index 0000000..62e7e9d --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00FD.png diff --git a/2026/games_submissions/talon1024/assets/minifont/00FF.png b/2026/games_submissions/talon1024/assets/minifont/00FF.png Binary files differnew file mode 100644 index 0000000..e7ee753 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/minifont/00FF.png diff --git a/2026/games_submissions/talon1024/assets/sfx/sfx_weapon_shotgun1.wav b/2026/games_submissions/talon1024/assets/sfx/sfx_weapon_shotgun1.wav Binary files differnew file mode 100644 index 0000000..34173a0 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/sfx/sfx_weapon_shotgun1.wav diff --git a/2026/games_submissions/talon1024/assets/sfx/soft_explode.wav b/2026/games_submissions/talon1024/assets/sfx/soft_explode.wav Binary files differnew file mode 100644 index 0000000..310a3f9 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/sfx/soft_explode.wav diff --git a/2026/games_submissions/talon1024/assets/wip/assetswip.xcf b/2026/games_submissions/talon1024/assets/wip/assetswip.xcf Binary files differnew file mode 100644 index 0000000..4f778e9 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/wip/assetswip.xcf diff --git a/2026/games_submissions/talon1024/assets/wip/bombo.xcf b/2026/games_submissions/talon1024/assets/wip/bombo.xcf Binary files differnew file mode 100644 index 0000000..7aa39f9 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/wip/bombo.xcf diff --git a/2026/games_submissions/talon1024/assets/wip/enemyrocket.xcf b/2026/games_submissions/talon1024/assets/wip/enemyrocket.xcf Binary files differnew file mode 100644 index 0000000..964eb68 --- /dev/null +++ b/2026/games_submissions/talon1024/assets/wip/enemyrocket.xcf diff --git a/2026/games_submissions/talon1024/favicon.ico b/2026/games_submissions/talon1024/favicon.ico Binary files differnew file mode 100644 index 0000000..c5dfeeb --- /dev/null +++ b/2026/games_submissions/talon1024/favicon.ico diff --git a/2026/games_submissions/talon1024/index.html b/2026/games_submissions/talon1024/index.html new file mode 100644 index 0000000..cb0c045 --- /dev/null +++ b/2026/games_submissions/talon1024/index.html @@ -0,0 +1,160 @@ +<!doctype html> +<html lang="en-us"> +<!-- +Shoot It! (c) Copyright 2026 Talon1024 + +This file is part of Shoot It! + +Shoot It! is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. + +Shoot It! is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +Shoot It!. If not, see <https://www.gnu.org/licenses/>. + +Modified from https://github.com/emscripten-core/emscripten/blob/main/html/shell_minimal.html +Thanks for the help with this, @LCOLONQ! +--> + <head> + <meta charset="utf-8"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Emscripten-Generated Code</title> + <style> + body { margin: 0; } + .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; } + textarea.emscripten { font-family: monospace; width: 80%; } + div.emscripten { text-align: center; } + /* the canvas *must not* have any border or padding, or mouse coords will be wrong */ + canvas.emscripten { border: 0 none; background-color: black; } + + .emscripten_container { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + border: 0 none; + } + + .spinner { + height: 50px; + width: 50px; + margin: 0px auto; + -webkit-animation: rotation .8s linear infinite; + -moz-animation: rotation .8s linear infinite; + -o-animation: rotation .8s linear infinite; + animation: rotation 0.8s linear infinite; + border-left: 10px solid rgb(0,150,240); + border-right: 10px solid rgb(0,150,240); + border-bottom: 10px solid rgb(0,150,240); + border-top: 10px solid rgb(100,0,200); + border-radius: 100%; + background-color: rgb(200,100,250); + } + @-webkit-keyframes rotation { + from {-webkit-transform: rotate(0deg);} + to {-webkit-transform: rotate(360deg);} + } + @-moz-keyframes rotation { + from {-moz-transform: rotate(0deg);} + to {-moz-transform: rotate(360deg);} + } + @-o-keyframes rotation { + from {-o-transform: rotate(0deg);} + to {-o-transform: rotate(360deg);} + } + @keyframes rotation { + from {transform: rotate(0deg);} + to {transform: rotate(360deg);} + } + + </style> + </head> + <body> + <figure style="overflow:visible;" id="spinner"><div class="spinner"></div><center style="margin-top:0.5em"><strong>emscripten</strong></center></figure> + <div class="emscripten" id="status">Downloading...</div> + <div class="emscripten"> + <progress value="0" max="100" id="progress" hidden=1></progress> + </div> + <div class="emscripten_container"> + <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas> + </div> + <script type='text/javascript'> + var statusElement = document.getElementById('status'); + var progressElement = document.getElementById('progress'); + var spinnerElement = document.getElementById('spinner'); + var canvasElement = document.getElementById('canvas'); + // var outputElement = document.getElementById('output'); + // if (outputElement) outputElement.value = ''; // clear browser cache + + // As a default initial behavior, pop up an alert when webgl context is lost. To make your + // application robust, you may want to override this behavior before shipping! + // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2 + canvasElement.addEventListener("webglcontextlost", (e) => { + alert('WebGL context lost. You will need to reload the page.'); + e.preventDefault(); + }, false); + + function setStatus(text) { + if (!setStatus.last) setStatus.last = { time: Date.now(), text: '' }; + if (text === setStatus.last.text) return; + var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); + var now = Date.now(); + if (m && now - setStatus.last.time < 30) return; // if this is a progress update, skip it if too soon + setStatus.last.time = now; + setStatus.last.text = text; + if (m) { + text = m[1]; + progressElement.value = parseInt(m[2])*100; + progressElement.max = parseInt(m[4])*100; + progressElement.hidden = false; + spinnerElement.hidden = false; + } else { + progressElement.value = null; + progressElement.max = null; + progressElement.hidden = true; + if (!text) spinnerElement.hidden = true; + } + statusElement.innerHTML = text; + } + + var Module = { + print(...args) { + // These replacements are necessary if you render to raw HTML + //text = text.replace(/&/g, "&"); + //text = text.replace(/</g, "<"); + //text = text.replace(/>/g, ">"); + //text = text.replace('\n', '<br>', 'g'); + console.log(...args); + /* + if (outputElement) { + var text = args.join(' '); + outputElement.value += text + "\n"; + outputElement.scrollTop = outputElement.scrollHeight; // focus on bottom + } + */ + }, + canvas: canvasElement, + setStatus: setStatus, + totalDependencies: 0, + monitorRunDependencies(left) { + this.totalDependencies = Math.max(this.totalDependencies, left); + setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); + } + }; + setStatus('Downloading...'); + window.onerror = () => { + setStatus('Exception thrown, see JavaScript console'); + spinnerElement.style.display = 'none'; + setStatus = (text) => { + if (text) console.error('[post-exception status] ' + text); + }; + }; + </script> + <script async type="text/javascript" src="index.js"></script> + </body> +</html> diff --git a/2026/games_submissions/talon1024/index.js b/2026/games_submissions/talon1024/index.js new file mode 100644 index 0000000..e56a9c3 --- /dev/null +++ b/2026/games_submissions/talon1024/index.js @@ -0,0 +1,9508 @@ +// include: shell.js +// include: minimum_runtime_check.js +(function() { + // "30.0.0" -> 300000 + function humanReadableVersionToPacked(str) { + str = str.split('-')[0]; // Remove any trailing part from e.g. "12.53.3-alpha" + var vers = str.split('.').slice(0, 3); + while(vers.length < 3) vers.push('00'); + vers = vers.map((n, i, arr) => n.padStart(2, '0')); + return vers.join(''); + } + // 300000 -> "30.0.0" + var packedVersionToHumanReadable = n => [n / 10000 | 0, (n / 100 | 0) % 100, n % 100].join('.'); + + var TARGET_NOT_SUPPORTED = 2147483647; + + // Note: We use a typeof check here instead of optional chaining using + // globalThis because older browsers might not have globalThis defined. + var currentNodeVersion = typeof process !== 'undefined' && process.versions?.node ? humanReadableVersionToPacked(process.versions.node) : TARGET_NOT_SUPPORTED; + if (currentNodeVersion < 180300) { + throw new Error(`This emscripten-generated code requires node v${ packedVersionToHumanReadable(180300) } (detected v${packedVersionToHumanReadable(currentNodeVersion)})`); + } + + var userAgent = typeof navigator !== 'undefined' && navigator.userAgent; + if (!userAgent) { + return; + } + + var currentSafariVersion = userAgent.includes("Safari/") && !userAgent.includes("Chrome/") && userAgent.match(/Version\/(\d+\.?\d*\.?\d*)/) ? humanReadableVersionToPacked(userAgent.match(/Version\/(\d+\.?\d*\.?\d*)/)[1]) : TARGET_NOT_SUPPORTED; + if (currentSafariVersion < 150000) { + throw new Error(`This emscripten-generated code requires Safari v${ packedVersionToHumanReadable(150000) } (detected v${currentSafariVersion})`); + } + + var currentFirefoxVersion = userAgent.match(/Firefox\/(\d+(?:\.\d+)?)/) ? parseFloat(userAgent.match(/Firefox\/(\d+(?:\.\d+)?)/)[1]) : TARGET_NOT_SUPPORTED; + if (currentFirefoxVersion < 79) { + throw new Error(`This emscripten-generated code requires Firefox v79 (detected v${currentFirefoxVersion})`); + } + + var currentChromeVersion = userAgent.match(/Chrome\/(\d+(?:\.\d+)?)/) ? parseFloat(userAgent.match(/Chrome\/(\d+(?:\.\d+)?)/)[1]) : TARGET_NOT_SUPPORTED; + if (currentChromeVersion < 85) { + throw new Error(`This emscripten-generated code requires Chrome v85 (detected v${currentChromeVersion})`); + } +})(); + +// end include: minimum_runtime_check.js +// The Module object: Our interface to the outside world. We import +// and export values on it. There are various ways Module can be used: +// 1. Not defined. We create it here +// 2. A function parameter, function(moduleArg) => Promise<Module> +// 3. pre-run appended it, var Module = {}; ..generated code.. +// 4. External script tag defines var Module. +// We need to check if Module already exists (e.g. case 3 above). +// Substitution will be replaced with actual code on later stage of the build, +// this way Closure Compiler will not mangle it (e.g. case 4. above). +// Note that if you want to run closure, and also to use Module +// after the generated code, you will need to define var Module = {}; +// before the code. Then that object will be used in the code, and you +// can continue to use Module afterwards as well. +var Module = typeof Module != 'undefined' ? Module : {}; + +// Determine the runtime environment we are in. You can customize this by +// setting the ENVIRONMENT setting at compile time (see settings.js). + +// Attempt to auto-detect the environment +var ENVIRONMENT_IS_WEB = !!globalThis.window; +var ENVIRONMENT_IS_WORKER = !!globalThis.WorkerGlobalScope; +// N.b. Electron.js environment is simultaneously a NODE-environment, but +// also a web environment. +var ENVIRONMENT_IS_NODE = globalThis.process?.versions?.node && globalThis.process?.type != 'renderer'; +var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + +// --pre-jses are emitted after the Module integration code, so that they can +// refer to Module (if they choose; they can also define Module) +// include: /home/kevinc/misc/emsdk/upstream/emscripten/src/emrun_prejs.js +/** + * @license + * Copyright 2013 The Emscripten Authors + * SPDX-License-Identifier: MIT + * + * This file gets implicitly injected as a `--pre-js` file when + * emcc is run with `--emrun` + */ + +// Route URL GET parameters to argc+argv +if (globalThis.window) { + Module['arguments'] = window.location.search.slice(1).trim().split('&'); + for (let i = 0; i < Module['arguments'].length; ++i) { + Module['arguments'][i] = decodeURI(Module['arguments'][i]); + } + // If no args were passed arguments = [''], in which case kill the single empty string. + if (!Module['arguments'][0]) { + Module['arguments'] = []; + } +} +// end include: /home/kevinc/misc/emsdk/upstream/emscripten/src/emrun_prejs.js + + +var programArgs = []; +var thisProgram = './this.program'; +var quit_ = (status, toThrow) => { + throw toThrow; +}; + +// In MODULARIZE mode _scriptName needs to be captured already at the very top of the page immediately when the page is parsed, so it is generated there +// before the page load. In non-MODULARIZE modes generate it here. +var _scriptName = globalThis.document?.currentScript?.src; + +if (typeof __filename != 'undefined') { // Node + _scriptName = __filename; +} else +if (ENVIRONMENT_IS_WORKER) { + _scriptName = self.location.href; +} + +// `/` should be present at the end if `scriptDirectory` is not empty +var scriptDirectory = ''; +function locateFile(path) { + if (Module['locateFile']) { + return Module['locateFile'](path, scriptDirectory); + } + return scriptDirectory + path; +} + +// Hooks that are implemented differently in different runtime environments. +var readAsync, readBinary; + +if (ENVIRONMENT_IS_NODE) { + const isNode = globalThis.process?.versions?.node && globalThis.process?.type != 'renderer'; + if (!isNode) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)'); + + // These modules will usually be used on Node.js. Load them eagerly to avoid + // the complexity of lazy-loading. + var fs = require('node:fs'); + + scriptDirectory = __dirname + '/'; + +// include: node_shell_read.js +readBinary = (filename) => { + // We need to re-wrap `file://` strings to URLs. + filename = isFileURI(filename) ? new URL(filename) : filename; + var ret = fs.readFileSync(filename); + assert(Buffer.isBuffer(ret)); + return ret; +}; + +readAsync = async (filename, binary = true) => { + // See the comment in the `readBinary` function. + filename = isFileURI(filename) ? new URL(filename) : filename; + var ret = fs.readFileSync(filename, binary ? undefined : 'utf8'); + assert(binary ? Buffer.isBuffer(ret) : typeof ret == 'string'); + return ret; +}; +// end include: node_shell_read.js + if (process.argv.length > 1) { + thisProgram = process.argv[1].replace(/\\/g, '/'); + } + + programArgs = process.argv.slice(2); + + // MODULARIZE will export the module in the proper place outside, we don't need to export here + if (typeof module != 'undefined') { + module['exports'] = Module; + } + + quit_ = (status, toThrow) => { + process.exitCode = status; + throw toThrow; + }; + +} else +if (ENVIRONMENT_IS_SHELL) { + +} else + +// Note that this includes Node.js workers when relevant (pthreads is enabled). +// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and +// ENVIRONMENT_IS_NODE. +if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + try { + scriptDirectory = new URL('.', _scriptName).href; // includes trailing slash + } catch { + // Must be a `blob:` or `data:` URL (e.g. `blob:http://site.com/etc/etc`), we cannot + // infer anything from them. + } + + if (!(globalThis.window || globalThis.WorkerGlobalScope)) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)'); + + { +// include: web_or_worker_shell_read.js +if (ENVIRONMENT_IS_WORKER) { + readBinary = (url) => { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.responseType = 'arraybuffer'; + xhr.send(null); + return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response)); + }; + } + + readAsync = async (url) => { + // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url. + // See https://github.com/github/fetch/pull/92#issuecomment-140665932 + // Cordova or Electron apps are typically loaded from a file:// url. + // So use XHR on webview if URL is a file URL. + if (isFileURI(url)) { + return new Promise((resolve, reject) => { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'arraybuffer'; + xhr.onload = () => { + if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0 + resolve(xhr.response); + return; + } + reject(xhr.status); + }; + xhr.onerror = reject; + xhr.send(null); + }); + } + var response = await fetch(url, { credentials: 'same-origin' }); + if (response.ok) { + return response.arrayBuffer(); + } + throw new Error(response.status + ' : ' + response.url); + }; +// end include: web_or_worker_shell_read.js + } +} else +{ + throw new Error('environment detection error'); +} + +var out = console.log.bind(console); +var err = console.error.bind(console); + +var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js'; +var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js'; +var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js'; +var FETCHFS = 'FETCHFS is no longer included by default; build with -lfetchfs.js'; +var ICASEFS = 'ICASEFS is no longer included by default; build with -licasefs.js'; +var JSFILEFS = 'JSFILEFS is no longer included by default; build with -ljsfilefs.js'; +var OPFS = 'OPFS is no longer included by default; build with -lopfs.js'; + +var NODEFS = 'NODEFS is no longer included by default; build with -lnodefs.js'; + +// perform assertions in shell.js after we set up out() and err(), as otherwise +// if an assertion fails it cannot print the message + +assert(!ENVIRONMENT_IS_SHELL, 'shell environment detected but not enabled at build time (add `shell` to `-sENVIRONMENT` to enable)'); + +// end include: shell.js + +// include: preamble.js +// === Preamble library stuff === + +// Documentation for the public APIs defined in this file must be updated in: +// site/source/docs/api_reference/preamble.js.rst +// A prebuilt local version of the documentation is available at: +// site/build/text/docs/api_reference/preamble.js.txt +// You can also build docs locally as HTML or other formats in site/ +// An online HTML version (which may be of a different version of Emscripten) +// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html + +var wasmBinary; + +if (!globalThis.WebAssembly) { + err('no native wasm support detected'); +} + +// Wasm globals + +//======================================== +// Runtime essentials +//======================================== + +// whether we are quitting the application. no code should run after this. +// set in exit() and abort() +var ABORT = false; + +// set by exit() and abort(). Passed to 'onExit' handler. +// NOTE: This is also used as the process return code in shell environments +// but only when noExitRuntime is false. +var EXITSTATUS; + +// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we +// don't define it at all in release modes. This matches the behaviour of +// MINIMAL_RUNTIME. +// TODO(sbc): Make this the default even without STRICT enabled. +/** @type {function(*, string=)} */ +function assert(condition, text) { + if (!condition) { + abort('Assertion failed' + (text ? ': ' + text : '')); + } +} + +// We used to include malloc/free by default in the past. Show a helpful error in +// builds with assertions. +function _free() { + // Show a helpful error since we used to include free by default in the past. + abort('free() called but not included in the build - add `_free` to EXPORTED_FUNCTIONS'); +} + +/** + * Indicates whether filename is delivered via file protocol (as opposed to http/https) + * @noinline + */ +var isFileURI = (filename) => filename.startsWith('file://'); + +// include: runtime_common.js +// include: runtime_stack_check.js +// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode. +function writeStackCookie() { + var max = _emscripten_stack_get_end(); + assert((max & 3) == 0); + // If the stack ends at address zero we write our cookies 4 bytes into the + // stack. This prevents interference with SAFE_HEAP and ASAN which also + // monitor writes to address zero. + if (max == 0) { + max += 4; + } + // The stack grow downwards towards _emscripten_stack_get_end. + // We write cookies to the final two words in the stack and detect if they are + // ever overwritten. + HEAPU32[((max)>>2)] = 0x02135467; + HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE; + // Also test the global address 0 for integrity. + HEAPU32[((0)>>2)] = 1668509029; +} + +function checkStackCookie() { + if (ABORT) return; + var max = _emscripten_stack_get_end(); + // See writeStackCookie(). + if (max == 0) { + max += 4; + } + var cookie1 = HEAPU32[((max)>>2)]; + var cookie2 = HEAPU32[(((max)+(4))>>2)]; + if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) { + abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`); + } + // Also test the global address 0 for integrity. + if (HEAPU32[((0)>>2)] != 0x63736d65 /* 'emsc' */) { + abort('Runtime error: The application has corrupted its heap memory area (address zero)!'); + } +} +// end include: runtime_stack_check.js +// include: runtime_exceptions.js +// Base Emscripten EH error class +class EmscriptenEH {} + +class EmscriptenSjLj extends EmscriptenEH {} + +// end include: runtime_exceptions.js +// include: runtime_debug.js +var runtimeDebug = true; // Switch to false at runtime to disable logging at the right times + +// Used by XXXXX_DEBUG settings to output debug messages. +function dbg(...args) { + if (!runtimeDebug && typeof runtimeDebug != 'undefined') return; + // TODO(sbc): Make this configurable somehow. Its not always convenient for + // logging to show up as warnings. + console.warn(...args); +} + +// Endianness check +(() => { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 0x6373; + if (h8[0] !== 0x73 || h8[1] !== 0x63) abort('Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'); +})(); + +function consumedModuleProp(prop) { + if (!Object.getOwnPropertyDescriptor(Module, prop)) { + Object.defineProperty(Module, prop, { + configurable: true, + set() { + abort(`Attempt to set \`Module.${prop}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`); + + } + }); + } +} + +function makeInvalidEarlyAccess(name) { + return () => assert(false, `call to '${name}' via reference taken before Wasm module initialization`); + +} + +function ignoredModuleProp(prop) { + if (Object.getOwnPropertyDescriptor(Module, prop)) { + abort(`\`Module.${prop}\` was supplied but \`${prop}\` not included in INCOMING_MODULE_JS_API`); + } +} + +// forcing the filesystem exports a few things by default +function isExportedByForceFilesystem(name) { + return name === 'FS_createPath' || + name === 'FS_createDataFile' || + name === 'FS_createPreloadedFile' || + name === 'FS_preloadFile' || + name === 'FS_unlink' || + name === 'addRunDependency' || + // The old FS has some functionality that WasmFS lacks. + name === 'FS_createLazyFile' || + name === 'FS_createDevice' || + name === 'removeRunDependency'; +} + +/** + * Intercept access to a symbols in the global symbol. This enables us to give + * informative warnings/errors when folks attempt to use symbols they did not + * include in their build, or no symbols that no longer exist. + * + * We don't define this in MODULARIZE mode since in that mode emscripten symbols + * are never placed in the global scope. + */ +function hookGlobalSymbolAccess(sym, func) { + if (!Object.getOwnPropertyDescriptor(globalThis, sym)) { + Object.defineProperty(globalThis, sym, { + configurable: true, + get() { + func(); + return undefined; + } + }); + } +} + +function missingGlobal(sym, msg) { + hookGlobalSymbolAccess(sym, () => { + warnOnce(`\`${sym}\` is no longer defined by emscripten. ${msg}`); + }); +} + +missingGlobal('buffer', 'Please use HEAP8.buffer or wasmMemory.buffer'); +missingGlobal('asm', 'Please use wasmExports instead'); + +function missingLibrarySymbol(sym) { + hookGlobalSymbolAccess(sym, () => { + // Can't `abort()` here because it would break code that does runtime + // checks. e.g. `if (typeof SDL === 'undefined')`. + var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`; + // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in + // library.js, which means $name for a JS name with no prefix, or name + // for a JS name like _name. + var librarySymbol = sym; + if (!librarySymbol.startsWith('_')) { + librarySymbol = '$' + sym; + } + msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`; + if (isExportedByForceFilesystem(sym)) { + msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; + } + warnOnce(msg); + }); + + // Any symbol that is not included from the JS library is also (by definition) + // not exported on the Module object. + unexportedRuntimeSymbol(sym); +} + +function unexportedRuntimeSymbol(sym) { + if (!Object.getOwnPropertyDescriptor(Module, sym)) { + Object.defineProperty(Module, sym, { + configurable: true, + get() { + var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`; + if (isExportedByForceFilesystem(sym)) { + msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; + } + abort(msg); + }, + }); + } +} + +// end include: runtime_debug.js +// Memory management + +var runtimeInitialized = false; + +var runtimeExited = false; + + + +function updateMemoryViews() { + var b = wasmMemory.buffer; + HEAP8 = new Int8Array(b); + HEAP16 = new Int16Array(b); + HEAPU8 = new Uint8Array(b); + HEAPU16 = new Uint16Array(b); + HEAP32 = new Int32Array(b); + HEAPU32 = new Uint32Array(b); + HEAPF32 = new Float32Array(b); + HEAPF64 = new Float64Array(b); + HEAP64 = new BigInt64Array(b); + HEAPU64 = new BigUint64Array(b); +} + +// include: memoryprofiler.js +// end include: memoryprofiler.js +// end include: runtime_common.js +assert(globalThis.Int32Array && globalThis.Float64Array && Int32Array.prototype.subarray && Int32Array.prototype.set, + 'JS engine does not provide full typed array support'); + +function preRun() { + if (Module['preRun']) { + if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; + while (Module['preRun'].length) { + addOnPreRun(Module['preRun'].shift()); + } + } + consumedModuleProp('preRun'); + // Begin ATPRERUNS hooks + callRuntimeCallbacks(onPreRuns); + // End ATPRERUNS hooks +} + +function initRuntime() { + assert(!runtimeInitialized); + runtimeInitialized = true; + + checkStackCookie(); + + // Begin ATINITS hooks + if (!Module['noFSInit'] && !FS.initialized) FS.init(); +TTY.init(); + // End ATINITS hooks + + wasmExports['__wasm_call_ctors'](); + + // Begin ATPOSTCTORS hooks + FS.ignorePermissions = false; + // End ATPOSTCTORS hooks +} + +function preMain() { + checkStackCookie(); + // No ATMAINS hooks +} + +var runtimeExiting = false; + +function exitRuntime() { + assert(!runtimeExited); + assert(!runtimeExiting, 'Re-entrant call to exitRuntime()! This can happen if an atexit() registered callback throws an exception.'); + runtimeExiting = true; + checkStackCookie(); + ___funcs_on_exit(); // Native atexit() functions + // Begin ATEXITS hooks + callRuntimeCallbacks(onExits); +FS.quit(); +TTY.shutdown(); + // End ATEXITS hooks + runtimeExited = true; +} + +function postRun() { + checkStackCookie(); + // PThreads reuse the runtime from the main thread. + + if (Module['postRun']) { + if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; + while (Module['postRun'].length) { + addOnPostRun(Module['postRun'].shift()); + } + } + consumedModuleProp('postRun'); + + // Begin ATPOSTRUNS hooks + callRuntimeCallbacks(onPostRuns); + // End ATPOSTRUNS hooks +} + +/** + * @param {string|number=} what + */ +function abort(what) { + Module['onAbort']?.(what); + + what = `Aborted(${what})`; + // TODO(sbc): Should we remove printing and leave it up to whoever + // catches the exception? + err(what); + + ABORT = true; + + // Use a wasm runtime error, because a JS error might be seen as a foreign + // exception, which means we'd run destructors on it. We need the error to + // simply make the program stop. + // FIXME This approach does not work in Wasm EH because it currently does not assume + // all RuntimeErrors are from traps; it decides whether a RuntimeError is from + // a trap or not based on a hidden field within the object. So at the moment + // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that + // allows this in the wasm spec. + + // Suppress closure compiler warning here. Closure compiler's builtin extern + // definition for WebAssembly.RuntimeError claims it takes no arguments even + // though it can. + // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed. + /** @suppress {checkTypes} */ + var e = new WebAssembly.RuntimeError(what); + + // Throw the error whether or not MODULARIZE is set because abort is used + // in code paths apart from instantiation where an exception is expected + // to be thrown when abort is called. + throw e; +} + +function createExportWrapper(name, nargs) { + return (...args) => { + assert(runtimeInitialized, `native function \`${name}\` called before runtime initialization`); + assert(!runtimeExited, `native function \`${name}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`); + var f = wasmExports[name]; + assert(f, `exported native function \`${name}\` not found`); + // Only assert for too many arguments. Too few can be valid since the missing arguments will be zero filled. + assert(args.length <= nargs, `native function \`${name}\` called with ${args.length} args but expects ${nargs}`); + return f(...args); + }; +} + +var wasmBinaryFile; + +function findWasmBinary() { + return locateFile('index.wasm'); +} + +function getBinarySync(file) { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary); + } + if (readBinary) { + return readBinary(file); + } + // Throwing a plain string here, even though it not normally advisable since + // this gets turning into an `abort` in instantiateArrayBuffer. + throw 'both async and sync fetching of the wasm failed'; +} + +async function getWasmBinary(binaryFile) { + // If we don't have the binary yet, load it asynchronously using readAsync. + if (!wasmBinary) { + // Fetch the binary using readAsync + try { + var response = await readAsync(binaryFile); + return new Uint8Array(response); + } catch { + // Fall back to getBinarySync below; + } + } + + // Otherwise, getBinarySync should be able to get it synchronously + return getBinarySync(binaryFile); +} + +async function instantiateArrayBuffer(binaryFile, imports) { + try { + var binary = await getWasmBinary(binaryFile); + var instance = await WebAssembly.instantiate(binary, imports); + return instance; + } catch (reason) { + err(`failed to asynchronously prepare wasm: ${reason}`); + + // Warn on some common problems. + if (isFileURI(binaryFile)) { + err(`warning: Loading from a file URI (${binaryFile}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`); + } + abort(reason); + } +} + +async function instantiateAsync(binary, binaryFile, imports) { + if (!binary + // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously. + && !isFileURI(binaryFile) + // Avoid instantiateStreaming() on Node.js environment for now, as while + // Node.js v18.1.0 implements it, it does not have a full fetch() + // implementation yet. + // + // Reference: + // https://github.com/emscripten-core/emscripten/pull/16917 + && !ENVIRONMENT_IS_NODE + ) { + try { + var response = fetch(binaryFile, { credentials: 'same-origin' }); + var instantiationResult = await WebAssembly.instantiateStreaming(response, imports); + return instantiationResult; + } catch (reason) { + // We expect the most common failure cause to be a bad MIME type for the binary, + // in which case falling back to ArrayBuffer instantiation should work. + err(`wasm streaming compile failed: ${reason}`); + err('falling back to ArrayBuffer instantiation'); + // fall back of instantiateArrayBuffer below + }; + } + return instantiateArrayBuffer(binaryFile, imports); +} + +function getWasmImports() { + // prepare imports + var imports = { + 'env': wasmImports, + 'wasi_snapshot_preview1': wasmImports, + }; + return imports; +} + +// Create the wasm instance. +// Receives the wasm imports, returns the exports. +async function createWasm() { + // Load the wasm module and create an instance of using native support in the JS engine. + // handle a generated wasm instance, receiving its exports and + // performing other necessary setup + /** @param {WebAssembly.Module=} module*/ + function receiveInstance(instance, module) { + wasmExports = instance.exports; + + assignWasmExports(wasmExports); + + updateMemoryViews(); + + removeRunDependency('wasm-instantiate'); + return wasmExports; + } + addRunDependency('wasm-instantiate'); + + // Prefer streaming instantiation if available. + // Async compilation can be confusing when an error on the page overwrites Module + // (for example, if the order of elements is wrong, and the one defining Module is + // later), so we save Module and check it later. + var trueModule = Module; + function receiveInstantiationResult(result) { + // 'result' is a ResultObject object which has both the module and instance. + // receiveInstance() will swap in the exports (to Module.asm) so they can be called + assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'); + trueModule = null; + // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line. + // When the regression is fixed, can restore the above PTHREADS-enabled path. + return receiveInstance(result['instance']); + } + + var info = getWasmImports(); + + // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback + // to manually instantiate the Wasm module themselves. This allows pages to + // run the instantiation parallel to any other async startup actions they are + // performing. + // Also pthreads and wasm workers initialize the wasm instance through this + // path. + if (Module['instantiateWasm']) { + return new Promise((resolve, reject) => { + try { + Module['instantiateWasm'](info, (inst, mod) => { + resolve(receiveInstance(inst, mod)); + }); + } catch(e) { + err(`Module.instantiateWasm callback failed with error: ${e}`); + reject(e); + } + }); + } + + wasmBinaryFile ??= findWasmBinary(); + var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info); + var exports = receiveInstantiationResult(result); + return exports; +} + +// end include: preamble.js + +// Begin JS library code + + + class ExitStatus { + name = 'ExitStatus'; + constructor(status) { + this.message = `Program terminated with exit(${status})`; + this.status = status; + } + } + + /** @type {!Int16Array} */ + var HEAP16; + + /** @type {!Int32Array} */ + var HEAP32; + + /** not-@type {!BigInt64Array} */ + var HEAP64; + + /** @type {!Int8Array} */ + var HEAP8; + + /** @type {!Float32Array} */ + var HEAPF32; + + /** @type {!Float64Array} */ + var HEAPF64; + + /** @type {!Uint16Array} */ + var HEAPU16; + + /** @type {!Uint32Array} */ + var HEAPU32; + + /** not-@type {!BigUint64Array} */ + var HEAPU64; + + /** @type {!Uint8Array} */ + var HEAPU8; + + var callRuntimeCallbacks = (callbacks) => { + while (callbacks.length > 0) { + // Pass the module as the first argument. + callbacks.shift()(Module); + } + }; + var onExits = []; + var addOnExit = (cb) => onExits.push(cb); + + var onPostRuns = []; + var addOnPostRun = (cb) => onPostRuns.push(cb); + + var onPreRuns = []; + var addOnPreRun = (cb) => onPreRuns.push(cb); + + var runDependencies = 0; + + + var dependenciesFulfilled = null; + + var runDependencyTracking = { + }; + + var runDependencyWatcher = null; + var removeRunDependency = (id) => { + runDependencies--; + + Module['monitorRunDependencies']?.(runDependencies); + + assert(id, 'removeRunDependency requires an ID'); + assert(runDependencyTracking[id]); + delete runDependencyTracking[id]; + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); // can add another dependenciesFulfilled + } + } + }; + + + var addRunDependency = (id) => { + runDependencies++; + + Module['monitorRunDependencies']?.(runDependencies); + + assert(id, 'addRunDependency requires an ID') + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && globalThis.setInterval) { + // Check for missing dependencies every few seconds + runDependencyWatcher = setInterval(() => { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return; + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err('still waiting on run dependencies:'); + } + err(`dependency: ${dep}`); + } + if (shown) { + err('(end of list)'); + } + }, 10000); + // Prevent this timer from keeping the runtime alive if nothing + // else is. + runDependencyWatcher.unref?.() + } + }; + + + + /** + * @param {number} ptr + * @param {string} type + */ + function getValue(ptr, type = 'i8') { + if (type.endsWith('*')) type = '*'; + switch (type) { + case 'i1': return HEAP8[ptr]; + case 'i8': return HEAP8[ptr]; + case 'i16': return HEAP16[((ptr)>>1)]; + case 'i32': return HEAP32[((ptr)>>2)]; + case 'i64': return HEAP64[((ptr)>>3)]; + case 'float': return HEAPF32[((ptr)>>2)]; + case 'double': return HEAPF64[((ptr)>>3)]; + case '*': return HEAPU32[((ptr)>>2)]; + default: abort(`invalid type for getValue: ${type}`); + } + } + + var noExitRuntime = false; + + function ptrToString(ptr) { + assert(typeof ptr === 'number', `ptrToString expects a number, got ${typeof ptr}`); + // Convert to 32-bit unsigned value + ptr >>>= 0; + return '0x' + ptr.toString(16).padStart(8, '0'); + } + + + + /** + * @param {number} ptr + * @param {number} value + * @param {string} type + */ + function setValue(ptr, value, type = 'i8') { + if (type.endsWith('*')) type = '*'; + switch (type) { + case 'i1': HEAP8[ptr] = value; break; + case 'i8': HEAP8[ptr] = value; break; + case 'i16': HEAP16[((ptr)>>1)] = value; break; + case 'i32': HEAP32[((ptr)>>2)] = value; break; + case 'i64': HEAP64[((ptr)>>3)] = BigInt(value); break; + case 'float': HEAPF32[((ptr)>>2)] = value; break; + case 'double': HEAPF64[((ptr)>>3)] = value; break; + case '*': HEAPU32[((ptr)>>2)] = value; break; + default: abort(`invalid type for setValue: ${type}`); + } + } + + var stackRestore = (val) => __emscripten_stack_restore(val); + + var stackSave = () => _emscripten_stack_get_current(); + + var warnOnce = (text) => { + warnOnce.shown ||= {}; + if (!warnOnce.shown[text]) { + warnOnce.shown[text] = 1; + if (ENVIRONMENT_IS_NODE) text = 'warning: ' + text; + err(text); + } + }; + + + + var syscallGetVarargI = () => { + assert(SYSCALLS.varargs != undefined); + // the `+` prepended here is necessary to convince the JSCompiler that varargs is indeed a number. + var ret = HEAP32[((+SYSCALLS.varargs)>>2)]; + SYSCALLS.varargs += 4; + return ret; + }; + var syscallGetVarargP = syscallGetVarargI; + + + var PATH = { + isAbs:(path) => path.charAt(0) === '/', + splitPath:(filename) => { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1); + }, + normalizeArray:(parts, allowAboveRoot) => { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift('..'); + } + } + return parts; + }, + normalize:(path) => { + var isAbsolute = PATH.isAbs(path), + trailingSlash = path.slice(-1) === '/'; + // Normalize the path + path = PATH.normalizeArray(path.split('/').filter((p) => !!p), !isAbsolute).join('/'); + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + return (isAbsolute ? '/' : '') + path; + }, + dirname:(path) => { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.slice(0, -1); + } + return root + dir; + }, + basename:(path) => path && path.match(/([^\/]+|\/)\/*$/)[1], +join:(...paths) => PATH.normalize(paths.join('/')), +join2:(l, r) => PATH.normalize(l + '/' + r), +}; + +var initRandomFill = () => { + // This block is not needed on v19+ since crypto.getRandomValues is builtin + if (ENVIRONMENT_IS_NODE) { + var nodeCrypto = require('node:crypto'); + return (view) => nodeCrypto.randomFillSync(view); + } + + return (view) => (crypto.getRandomValues(view), 0); + }; +var randomFill = (view) => (randomFill = initRandomFill())(view); + + + +var PATH_FS = { +resolve:(...args) => { + var resolvedPath = '', + resolvedAbsolute = false; + for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? args[i] : FS.cwd(); + // Skip empty and invalid entries + if (typeof path != 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + return ''; // an invalid portion invalidates the whole thing + } + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = PATH.isAbs(path); + } + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter((p) => !!p), !resolvedAbsolute).join('/'); + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; + }, +relative:(from, to) => { + from = PATH_FS.resolve(from).slice(1); + to = PATH_FS.resolve(to).slice(1); + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join('/'); + }, +}; + + +var UTF8Decoder = globalThis.TextDecoder && new TextDecoder(); + +var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => { + var maxIdx = idx + maxBytesToRead; + if (ignoreNul) return maxIdx; + // TextDecoder needs to know the byte length in advance, it doesn't stop on + // null terminator by itself. + // As a tiny code save trick, compare idx against maxIdx using a negation, + // so that maxBytesToRead=undefined/NaN means Infinity. + while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx; + return idx; + }; + + + /** + * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given + * array that contains uint8 values, returns a copy of that string as a + * Javascript String object. + * heapOrArray is either a regular array, or a JavaScript typed array view. + * @param {number=} idx + * @param {number=} maxBytesToRead + * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character. + * @return {string} + */ + var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead, ignoreNul) => { + + var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul); + + // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it. + if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { + return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); + } + var str = ''; + while (idx < endPtr) { + // For UTF8 byte structure, see: + // http://en.wikipedia.org/wiki/UTF-8#Description + // https://www.ietf.org/rfc/rfc2279.txt + // https://tools.ietf.org/html/rfc3629 + var u0 = heapOrArray[idx++]; + if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; } + var u1 = heapOrArray[idx++] & 63; + if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; } + var u2 = heapOrArray[idx++] & 63; + if ((u0 & 0xF0) == 0xE0) { + u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; + } else { + if ((u0 & 0xF8) != 0xF0) warnOnce(`Invalid UTF-8 leading byte ${ptrToString(u0)} encountered when deserializing a UTF-8 string in wasm memory to a JS string!`); + u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63); + } + + if (u0 < 0x10000) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 0x10000; + str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF)); + } + } + return str; + }; + + var FS_stdin_getChar_buffer = []; + + var lengthBytesUTF8 = (str) => { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code + // unit, not a Unicode code point of the character! So decode + // UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var c = str.charCodeAt(i); // possibly a lead surrogate + if (c <= 0x7F) { + len++; + } else if (c <= 0x7FF) { + len += 2; + } else if (c >= 0xD800 && c <= 0xDFFF) { + len += 4; ++i; + } else { + len += 3; + } + } + return len; + }; + + var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => { + assert(typeof str === 'string', `stringToUTF8Array expects a string (got ${typeof str})`); + // Parameter maxBytesToWrite is not optional. Negative values, 0, null, + // undefined and false each don't write out any bytes. + if (!(maxBytesToWrite > 0)) + return 0; + + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator. + for (var i = 0; i < str.length; ++i) { + // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description + // and https://www.ietf.org/rfc/rfc2279.txt + // and https://tools.ietf.org/html/rfc3629 + var u = str.codePointAt(i); + if (u <= 0x7F) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u; + } else if (u <= 0x7FF) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 0xC0 | (u >> 6); + heap[outIdx++] = 0x80 | (u & 63); + } else if (u <= 0xFFFF) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 0xE0 | (u >> 12); + heap[outIdx++] = 0x80 | ((u >> 6) & 63); + heap[outIdx++] = 0x80 | (u & 63); + } else { + if (outIdx + 3 >= endIdx) break; + if (u > 0x10FFFF) warnOnce(`Invalid Unicode code point ${ptrToString(u)} encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).`); + heap[outIdx++] = 0xF0 | (u >> 18); + heap[outIdx++] = 0x80 | ((u >> 12) & 63); + heap[outIdx++] = 0x80 | ((u >> 6) & 63); + heap[outIdx++] = 0x80 | (u & 63); + // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16. + // We need to manually skip over the second code unit for correct iteration. + i++; + } + } + // Null-terminate the pointer to the buffer. + heap[outIdx] = 0; + return outIdx - startIdx; + }; + /** @type {function(string, boolean=, number=)} */ + var intArrayFromString = (stringy, dontAddNull, length) => { + var len = length > 0 ? length : lengthBytesUTF8(stringy)+1; + var u8array = new Array(len); + var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); + if (dontAddNull) u8array.length = numBytesWritten; + return u8array; + }; + var FS_stdin_getChar = () => { + if (!FS_stdin_getChar_buffer.length) { + var result = null; + if (ENVIRONMENT_IS_NODE) { + // we will read data by chunks of BUFSIZE + var BUFSIZE = 256; + var buf = Buffer.alloc(BUFSIZE); + var bytesRead = 0; + + // For some reason we must suppress a closure warning here, even though + // fd definitely exists on process.stdin, and is even the proper way to + // get the fd of stdin, + // https://github.com/nodejs/help/issues/2136#issuecomment-523649904 + // This started to happen after moving this logic out of library_tty.js, + // so it is related to the surrounding code in some unclear manner. + /** @suppress {missingProperties} */ + var fd = process.stdin.fd; + + try { + bytesRead = fs.readSync(fd, buf, 0, BUFSIZE); + } catch(e) { + // Cross-platform differences: on Windows, reading EOF throws an + // exception, but on other OSes, reading EOF returns 0. Uniformize + // behavior by treating the EOF exception to return 0. + if (e.toString().includes('EOF')) bytesRead = 0; + else throw e; + } + + if (bytesRead > 0) { + result = buf.slice(0, bytesRead).toString('utf-8'); + } + } else + if (globalThis.window?.prompt) { + // Browser. + result = window.prompt('Input: '); // returns null on cancel + if (result !== null) { + result += '\n'; + } + } else + {} + if (!result) { + return null; + } + FS_stdin_getChar_buffer = intArrayFromString(result, true); + } + return FS_stdin_getChar_buffer.shift(); + }; + var TTY = { + ttys:[], + init() { + // https://github.com/emscripten-core/emscripten/pull/1555 + // if (ENVIRONMENT_IS_NODE) { + // // currently, FS.init does not distinguish if process.stdin is a file or TTY + // // device, it always assumes it's a TTY device. because of this, we're forcing + // // process.stdin to UTF8 encoding to at least make stdin reading compatible + // // with text files until FS.init can be refactored. + // process.stdin.setEncoding('utf8'); + // } + }, + shutdown() { + // https://github.com/emscripten-core/emscripten/pull/1555 + // if (ENVIRONMENT_IS_NODE) { + // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)? + // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation + // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists? + // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle + // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call + // process.stdin.pause(); + // } + }, + register(dev, ops) { + TTY.ttys[dev] = { input: [], output: [], ops: ops }; + FS.registerDevice(dev, TTY.stream_ops); + }, + stream_ops:{ + open(stream) { + var tty = TTY.ttys[stream.node.rdev]; + if (!tty) { + throw new FS.ErrnoError(43); + } + stream.tty = tty; + stream.seekable = false; + }, + close(stream) { + // flush any pending line data + stream.tty.ops.fsync(stream.tty); + }, + fsync(stream) { + stream.tty.ops.fsync(stream.tty); + }, + read(stream, buffer, offset, length, pos /* ignored */) { + if (!stream.tty || !stream.tty.ops.get_char) { + throw new FS.ErrnoError(60); + } + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = stream.tty.ops.get_char(stream.tty); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === undefined && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === undefined) break; + bytesRead++; + buffer[offset+i] = result; + } + if (bytesRead) { + stream.node.atime = Date.now(); + } + return bytesRead; + }, + write(stream, buffer, offset, length, pos) { + if (!stream.tty || !stream.tty.ops.put_char) { + throw new FS.ErrnoError(60); + } + try { + for (var i = 0; i < length; i++) { + stream.tty.ops.put_char(stream.tty, buffer[offset+i]); + } + } catch (e) { + throw new FS.ErrnoError(29); + } + if (length) { + stream.node.mtime = stream.node.ctime = Date.now(); + } + return i; + }, + }, + default_tty_ops:{ + get_char(tty) { + return FS_stdin_getChar(); + }, + put_char(tty, val) { + if (val === null || val === 10) { + out(UTF8ArrayToString(tty.output)); + tty.output = []; + } else { + if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle. + } + }, + fsync(tty) { + if (tty.output?.length > 0) { + out(UTF8ArrayToString(tty.output)); + tty.output = []; + } + }, + ioctl_tcgets(tty) { + // typical setting + return { + c_iflag: 25856, + c_oflag: 5, + c_cflag: 191, + c_lflag: 35387, + c_cc: [ + 0x03, 0x1c, 0x7f, 0x15, 0x04, 0x00, 0x01, 0x00, 0x11, 0x13, 0x1a, 0x00, + 0x12, 0x0f, 0x17, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ] + }; + }, + ioctl_tcsets(tty, optional_actions, data) { + // currently just ignore + return 0; + }, + ioctl_tiocgwinsz(tty) { + return [24, 80]; + }, + }, + default_tty1_ops:{ + put_char(tty, val) { + if (val === null || val === 10) { + err(UTF8ArrayToString(tty.output)); + tty.output = []; + } else { + if (val != 0) tty.output.push(val); + } + }, + fsync(tty) { + if (tty.output?.length > 0) { + err(UTF8ArrayToString(tty.output)); + tty.output = []; + } + }, + }, + }; + + + var mmapAlloc = (size) => { + abort('internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported'); + }; + var MEMFS = { + ops_table:null, + mount(mount) { + return MEMFS.createNode(null, '/', 16895, 0); + }, + createNode(parent, name, mode, dev) { + if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { + // not supported + throw new FS.ErrnoError(63); + } + MEMFS.ops_table ||= { + dir: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + lookup: MEMFS.node_ops.lookup, + mknod: MEMFS.node_ops.mknod, + rename: MEMFS.node_ops.rename, + unlink: MEMFS.node_ops.unlink, + rmdir: MEMFS.node_ops.rmdir, + readdir: MEMFS.node_ops.readdir, + symlink: MEMFS.node_ops.symlink + }, + stream: { + llseek: MEMFS.stream_ops.llseek + } + }, + file: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: { + llseek: MEMFS.stream_ops.llseek, + read: MEMFS.stream_ops.read, + write: MEMFS.stream_ops.write, + mmap: MEMFS.stream_ops.mmap, + msync: MEMFS.stream_ops.msync + } + }, + link: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + readlink: MEMFS.node_ops.readlink + }, + stream: {} + }, + chrdev: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: FS.chrdev_stream_ops + } + }; + var node = FS.createNode(parent, name, mode, dev); + if (FS.isDir(node.mode)) { + node.node_ops = MEMFS.ops_table.dir.node; + node.stream_ops = MEMFS.ops_table.dir.stream; + node.contents = {}; + } else if (FS.isFile(node.mode)) { + node.node_ops = MEMFS.ops_table.file.node; + node.stream_ops = MEMFS.ops_table.file.stream; + // The actual number of bytes used in the typed array, as opposed to + // contents.length which gives the whole capacity. + node.usedBytes = 0; + // The byte data of the file is stored in a typed array. + // Note: typed arrays are not resizable like normal JS arrays are, so + // there is a small penalty involved for appending file writes that + // continuously grow a file similar to std::vector capacity vs used. + node.contents = MEMFS.emptyFileContents ??= new Uint8Array(0); + } else if (FS.isLink(node.mode)) { + node.node_ops = MEMFS.ops_table.link.node; + node.stream_ops = MEMFS.ops_table.link.stream; + } else if (FS.isChrdev(node.mode)) { + node.node_ops = MEMFS.ops_table.chrdev.node; + node.stream_ops = MEMFS.ops_table.chrdev.stream; + } + node.atime = node.mtime = node.ctime = Date.now(); + // add the new node to the parent + if (parent) { + parent.contents[name] = node; + parent.atime = parent.mtime = parent.ctime = node.atime; + } + return node; + }, + getFileDataAsTypedArray(node) { + assert(FS.isFile(node.mode), 'getFileDataAsTypedArray called on non-file'); + return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes. + }, + expandFileStorage(node, newCapacity) { + var prevCapacity = node.contents.length; + if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough. + // Don't expand strictly to the given requested limit if it's only a very + // small increase, but instead geometrically grow capacity. + // For small filesizes (<1MB), perform size*2 geometric increase, but for + // large sizes, do a much more conservative size*1.125 increase to avoid + // overshooting the allocation cap by a very large margin. + var CAPACITY_DOUBLING_MAX = 1024 * 1024; + newCapacity = Math.max(newCapacity, (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) >>> 0); + if (prevCapacity) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding. + var oldContents = MEMFS.getFileDataAsTypedArray(node); + node.contents = new Uint8Array(newCapacity); // Allocate new storage. + node.contents.set(oldContents); + }, + resizeFileStorage(node, newSize) { + if (node.usedBytes == newSize) return; + var oldContents = node.contents; + node.contents = new Uint8Array(newSize); // Allocate new storage. + node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); // Copy old data over to the new storage. + node.usedBytes = newSize; + }, + node_ops:{ + getattr(node) { + var attr = {}; + // device numbers reuse inode numbers. + attr.dev = FS.isChrdev(node.mode) ? node.id : 1; + attr.ino = node.id; + attr.mode = node.mode; + attr.nlink = 1; + attr.uid = 0; + attr.gid = 0; + attr.rdev = node.rdev; + if (FS.isDir(node.mode)) { + attr.size = 4096; + } else if (FS.isFile(node.mode)) { + attr.size = node.usedBytes; + } else if (FS.isLink(node.mode)) { + attr.size = node.link.length; + } else { + attr.size = 0; + } + attr.atime = new Date(node.atime); + attr.mtime = new Date(node.mtime); + attr.ctime = new Date(node.ctime); + // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize), + // but this is not required by the standard. + attr.blksize = 4096; + attr.blocks = Math.ceil(attr.size / attr.blksize); + return attr; + }, + setattr(node, attr) { + for (const key of ["mode", "atime", "mtime", "ctime"]) { + if (attr[key] != null) { + node[key] = attr[key]; + } + } + if (attr.size !== undefined) { + MEMFS.resizeFileStorage(node, attr.size); + } + }, + lookup(parent, name) { + throw new FS.ErrnoError(44); + }, + mknod(parent, name, mode, dev) { + return MEMFS.createNode(parent, name, mode, dev); + }, + rename(old_node, new_dir, new_name) { + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) {} + if (new_node) { + if (FS.isDir(old_node.mode)) { + // if we're overwriting a directory at new_name, make sure it's empty. + for (var i in new_node.contents) { + throw new FS.ErrnoError(55); + } + } + FS.hashRemoveNode(new_node); + } + // do the internal rewiring + delete old_node.parent.contents[old_node.name]; + new_dir.contents[new_name] = old_node; + old_node.name = new_name; + new_dir.ctime = new_dir.mtime = old_node.parent.ctime = old_node.parent.mtime = Date.now(); + }, + unlink(parent, name) { + delete parent.contents[name]; + parent.ctime = parent.mtime = Date.now(); + }, + rmdir(parent, name) { + var node = FS.lookupNode(parent, name); + for (var i in node.contents) { + throw new FS.ErrnoError(55); + } + delete parent.contents[name]; + parent.ctime = parent.mtime = Date.now(); + }, + readdir(node) { + return ['.', '..', ...Object.keys(node.contents)]; + }, + symlink(parent, newname, oldpath) { + var node = MEMFS.createNode(parent, newname, 0o777 | 40960, 0); + node.link = oldpath; + return node; + }, + readlink(node) { + if (!FS.isLink(node.mode)) { + throw new FS.ErrnoError(28); + } + return node.link; + }, + }, + stream_ops:{ + read(stream, buffer, offset, length, position) { + var contents = stream.node.contents; + if (position >= stream.node.usedBytes) return 0; + var size = Math.min(stream.node.usedBytes - position, length); + assert(size >= 0); + buffer.set(contents.subarray(position, position + size), offset); + return size; + }, + write(stream, buffer, offset, length, position, canOwn) { + assert(buffer.subarray, 'FS.write expects a TypedArray'); + // If the buffer is located in main memory (HEAP), and if + // memory can grow, we can't hold on to references of the + // memory buffer, as they may get invalidated. That means we + // need to copy its contents. + if (buffer.buffer === HEAP8.buffer) { + canOwn = false; + } + + if (!length) return 0; + var node = stream.node; + node.mtime = node.ctime = Date.now(); + + if (canOwn) { + assert(position === 0, 'canOwn must imply no weird position inside the file'); + node.contents = buffer.subarray(offset, offset + length); + node.usedBytes = length; + } else if (node.usedBytes === 0 && position === 0) { // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data. + node.contents = buffer.slice(offset, offset + length); + node.usedBytes = length; + } else { + MEMFS.expandFileStorage(node, position+length); + // Use typed array write which is available. + node.contents.set(buffer.subarray(offset, offset + length), position); + node.usedBytes = Math.max(node.usedBytes, position + length); + } + return length; + }, + llseek(stream, offset, whence) { + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + if (FS.isFile(stream.node.mode)) { + position += stream.node.usedBytes; + } + } + if (position < 0) { + throw new FS.ErrnoError(28); + } + return position; + }, + mmap(stream, length, position, prot, flags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + var ptr; + var allocated; + var contents = stream.node.contents; + // Only make a new copy when MAP_PRIVATE is specified. + if (!(flags & 2) && contents.buffer === HEAP8.buffer) { + // We can't emulate MAP_SHARED when the file is not backed by the + // buffer we're mapping to (e.g. the HEAP buffer). + allocated = false; + ptr = contents.byteOffset; + } else { + allocated = true; + ptr = mmapAlloc(length); + if (!ptr) { + throw new FS.ErrnoError(48); + } + if (contents) { + // Try to avoid unnecessary slices. + if (position > 0 || position + length < contents.length) { + if (contents.subarray) { + contents = contents.subarray(position, position + length); + } else { + contents = Array.prototype.slice.call(contents, position, position + length); + } + } + HEAP8.set(contents, ptr); + } + } + return { ptr, allocated }; + }, + msync(stream, buffer, offset, length, mmapFlags) { + MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false); + // should we check if bytesWritten and length are the same? + return 0; + }, + }, + }; + + var FS_modeStringToFlags = (str) => { + if (typeof str != 'string') return str; + var flagModes = { + 'r': 0, + 'r+': 2, + 'w': 512 | 64 | 1, + 'w+': 512 | 64 | 2, + 'a': 1024 | 64 | 1, + 'a+': 1024 | 64 | 2, + }; + var flags = flagModes[str]; + if (typeof flags == 'undefined') { + throw new Error(`Unknown file open mode: ${str}`); + } + return flags; + }; + + var FS_fileDataToTypedArray = (data) => { + if (typeof data == 'string') { + data = intArrayFromString(data, true); + } + if (!data.subarray) { + data = new Uint8Array(data); + } + return data; + }; + + var FS_getMode = (canRead, canWrite) => { + var mode = 0; + if (canRead) mode |= 292 | 73; + if (canWrite) mode |= 146; + return mode; + }; + + + + + /** + * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the + * emscripten HEAP, returns a copy of that string as a Javascript String object. + * + * @param {number} ptr + * @param {number=} maxBytesToRead - An optional length that specifies the + * maximum number of bytes to read. You can omit this parameter to scan the + * string until the first 0 byte. If maxBytesToRead is passed, and the string + * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the + * string will cut short at that byte index. + * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character. + * @return {string} + */ + var UTF8ToString = (ptr, maxBytesToRead, ignoreNul) => { + assert(typeof ptr == 'number', `UTF8ToString expects a number (got ${typeof ptr})`); + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : ''; + }; + + var strError = (errno) => UTF8ToString(_strerror(errno)); + + var ERRNO_CODES = { + 'EPERM': 63, + 'ENOENT': 44, + 'ESRCH': 71, + 'EINTR': 27, + 'EIO': 29, + 'ENXIO': 60, + 'E2BIG': 1, + 'ENOEXEC': 45, + 'EBADF': 8, + 'ECHILD': 12, + 'EAGAIN': 6, + 'EWOULDBLOCK': 6, + 'ENOMEM': 48, + 'EACCES': 2, + 'EFAULT': 21, + 'ENOTBLK': 105, + 'EBUSY': 10, + 'EEXIST': 20, + 'EXDEV': 75, + 'ENODEV': 43, + 'ENOTDIR': 54, + 'EISDIR': 31, + 'EINVAL': 28, + 'ENFILE': 41, + 'EMFILE': 33, + 'ENOTTY': 59, + 'ETXTBSY': 74, + 'EFBIG': 22, + 'ENOSPC': 51, + 'ESPIPE': 70, + 'EROFS': 69, + 'EMLINK': 34, + 'EPIPE': 64, + 'EDOM': 18, + 'ERANGE': 68, + 'ENOMSG': 49, + 'EIDRM': 24, + 'ECHRNG': 106, + 'EL2NSYNC': 156, + 'EL3HLT': 107, + 'EL3RST': 108, + 'ELNRNG': 109, + 'EUNATCH': 110, + 'ENOCSI': 111, + 'EL2HLT': 112, + 'EDEADLK': 16, + 'ENOLCK': 46, + 'EBADE': 113, + 'EBADR': 114, + 'EXFULL': 115, + 'ENOANO': 104, + 'EBADRQC': 103, + 'EBADSLT': 102, + 'EDEADLOCK': 16, + 'EBFONT': 101, + 'ENOSTR': 100, + 'ENODATA': 116, + 'ETIME': 117, + 'ENOSR': 118, + 'ENONET': 119, + 'ENOPKG': 120, + 'EREMOTE': 121, + 'ENOLINK': 47, + 'EADV': 122, + 'ESRMNT': 123, + 'ECOMM': 124, + 'EPROTO': 65, + 'EMULTIHOP': 36, + 'EDOTDOT': 125, + 'EBADMSG': 9, + 'ENOTUNIQ': 126, + 'EBADFD': 127, + 'EREMCHG': 128, + 'ELIBACC': 129, + 'ELIBBAD': 130, + 'ELIBSCN': 131, + 'ELIBMAX': 132, + 'ELIBEXEC': 133, + 'ENOSYS': 52, + 'ENOTEMPTY': 55, + 'ENAMETOOLONG': 37, + 'ELOOP': 32, + 'EOPNOTSUPP': 138, + 'EPFNOSUPPORT': 139, + 'ECONNRESET': 15, + 'ENOBUFS': 42, + 'EAFNOSUPPORT': 5, + 'EPROTOTYPE': 67, + 'ENOTSOCK': 57, + 'ENOPROTOOPT': 50, + 'ESHUTDOWN': 140, + 'ECONNREFUSED': 14, + 'EADDRINUSE': 3, + 'ECONNABORTED': 13, + 'ENETUNREACH': 40, + 'ENETDOWN': 38, + 'ETIMEDOUT': 73, + 'EHOSTDOWN': 142, + 'EHOSTUNREACH': 23, + 'EINPROGRESS': 26, + 'EALREADY': 7, + 'EDESTADDRREQ': 17, + 'EMSGSIZE': 35, + 'EPROTONOSUPPORT': 66, + 'ESOCKTNOSUPPORT': 137, + 'EADDRNOTAVAIL': 4, + 'ENETRESET': 39, + 'EISCONN': 30, + 'ENOTCONN': 53, + 'ETOOMANYREFS': 141, + 'EUSERS': 136, + 'EDQUOT': 19, + 'ESTALE': 72, + 'ENOTSUP': 138, + 'ENOMEDIUM': 148, + 'EILSEQ': 25, + 'EOVERFLOW': 61, + 'ECANCELED': 11, + 'ENOTRECOVERABLE': 56, + 'EOWNERDEAD': 62, + 'ESTRPIPE': 135, + }; + + var asyncLoad = async (url) => { + var arrayBuffer = await readAsync(url); + assert(arrayBuffer, `Loading data file "${url}" failed (no arrayBuffer).`); + return new Uint8Array(arrayBuffer); + }; + + + var FS_createDataFile = (...args) => FS.createDataFile(...args); + + var getUniqueRunDependency = (id) => { + var orig = id; + while (1) { + if (!runDependencyTracking[id]) return id; + id = orig + Math.random(); + } + }; + + + + var preloadPlugins = []; + var FS_handledByPreloadPlugin = async (byteArray, fullname) => { + // Ensure plugins are ready. + if (typeof Browser != 'undefined') Browser.init(); + + for (var plugin of preloadPlugins) { + if (plugin['canHandle'](fullname)) { + assert(plugin['handle'].constructor.name === 'AsyncFunction', 'Filesystem plugin handlers must be async functions (See #24914)') + return plugin['handle'](byteArray, fullname); + } + } + // If no plugin handled this file then return the original/unmodified + // byteArray. + return byteArray; + }; + var FS_preloadFile = async (parent, name, url, canRead, canWrite, dontCreateFile, canOwn, preFinish) => { + // TODO we should allow people to just pass in a complete filename instead + // of parent and name being that we just join them anyways + var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent; + var dep = getUniqueRunDependency(`cp ${fullname}`); // might have several active requests for the same fullname + addRunDependency(dep); + + try { + var byteArray = url; + if (typeof url == 'string') { + byteArray = await asyncLoad(url); + } + + byteArray = await FS_handledByPreloadPlugin(byteArray, fullname); + preFinish?.(); + if (!dontCreateFile) { + FS_createDataFile(parent, name, byteArray, canRead, canWrite, canOwn); + } + } finally { + removeRunDependency(dep); + } + }; + var FS_createPreloadedFile = (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) => { + FS_preloadFile(parent, name, url, canRead, canWrite, dontCreateFile, canOwn, preFinish).then(onload).catch(onerror); + }; + var FS = { + root:null, + mounts:[], + devices:{ + }, + streams:[], + nextInode:1, + nameTable:null, + currentPath:"/", + initialized:false, + ignorePermissions:true, + filesystems:null, + syncFSRequests:0, + ErrnoError:class extends Error { + name = 'ErrnoError'; + // We set the `name` property to be able to identify `FS.ErrnoError` + // - the `name` is a standard ECMA-262 property of error objects. Kind of good to have it anyway. + // - when using PROXYFS, an error can come from an underlying FS + // as different FS objects have their own FS.ErrnoError each, + // the test `err instanceof FS.ErrnoError` won't detect an error coming from another filesystem, causing bugs. + // we'll use the reliable test `err.name == "ErrnoError"` instead + constructor(errno) { + super(runtimeInitialized ? strError(errno) : ''); + this.errno = errno; + for (var key in ERRNO_CODES) { + if (ERRNO_CODES[key] === errno) { + this.code = key; + break; + } + } + } + }, + FSStream:class { + shared = {}; + get object() { + return this.node; + } + set object(val) { + this.node = val; + } + get isRead() { + return (this.flags & 2097155) !== 1; + } + get isWrite() { + return (this.flags & 2097155) !== 0; + } + get isAppend() { + return (this.flags & 1024); + } + get flags() { + return this.shared.flags; + } + set flags(val) { + this.shared.flags = val; + } + get position() { + return this.shared.position; + } + set position(val) { + this.shared.position = val; + } + }, + FSNode:class { + node_ops = {}; + stream_ops = {}; + readMode = 292 | 73; + writeMode = 146; + mounted = null; + constructor(parent, name, mode, rdev) { + if (!parent) { + parent = this; // root node sets parent to itself + } + this.parent = parent; + this.mount = parent.mount; + this.id = FS.nextInode++; + this.name = name; + this.mode = mode; + this.rdev = rdev; + this.atime = this.mtime = this.ctime = Date.now(); + } + get read() { + return (this.mode & this.readMode) === this.readMode; + } + set read(val) { + val ? this.mode |= this.readMode : this.mode &= ~this.readMode; + } + get write() { + return (this.mode & this.writeMode) === this.writeMode; + } + set write(val) { + val ? this.mode |= this.writeMode : this.mode &= ~this.writeMode; + } + get isFolder() { + return FS.isDir(this.mode); + } + get isDevice() { + return FS.isChrdev(this.mode); + } + }, + lookupPath(path, opts = {}) { + if (!path) { + throw new FS.ErrnoError(44); + } + opts.follow_mount ??= true + + if (!PATH.isAbs(path)) { + path = FS.cwd() + '/' + path; + } + + // limit max consecutive symlinks to SYMLOOP_MAX. + linkloop: for (var nlinks = 0; nlinks < 40; nlinks++) { + // split the absolute path + var parts = path.split('/').filter((p) => !!p); + + // start at the root + var current = FS.root; + var current_path = '/'; + + for (var i = 0; i < parts.length; i++) { + var islast = (i === parts.length-1); + if (islast && opts.parent) { + // stop resolving + break; + } + + if (parts[i] === '.') { + continue; + } + + if (parts[i] === '..') { + current_path = PATH.dirname(current_path); + if (FS.isRoot(current)) { + path = current_path + '/' + parts.slice(i + 1).join('/'); + // We're making progress here, don't let many consecutive ..'s + // lead to ELOOP + nlinks--; + continue linkloop; + } else { + current = current.parent; + } + continue; + } + + current_path = PATH.join2(current_path, parts[i]); + try { + current = FS.lookupNode(current, parts[i]); + } catch (e) { + // if noent_okay is true, suppress a ENOENT in the last component + // and return an object with an undefined node. This is needed for + // resolving symlinks in the path when creating a file. + if ((e?.errno === 44) && islast && opts.noent_okay) { + return { path: current_path }; + } + throw e; + } + + // jump to the mount's root node if this is a mountpoint + if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) { + current = current.mounted.root; + } + + // by default, lookupPath will not follow a symlink if it is the final path component. + // setting opts.follow = true will override this behavior. + if (FS.isLink(current.mode) && (!islast || opts.follow)) { + if (!current.node_ops.readlink) { + throw new FS.ErrnoError(52); + } + var link = current.node_ops.readlink(current); + if (!PATH.isAbs(link)) { + link = PATH.dirname(current_path) + '/' + link; + } + path = link + '/' + parts.slice(i + 1).join('/'); + continue linkloop; + } + } + return { path: current_path, node: current }; + } + throw new FS.ErrnoError(32); + }, + getPath(node) { + var path; + while (true) { + if (FS.isRoot(node)) { + var mount = node.mount.mountpoint; + if (!path) return mount; + return mount[mount.length-1] !== '/' ? `${mount}/${path}` : mount + path; + } + path = path ? `${node.name}/${path}` : node.name; + node = node.parent; + } + }, + hashName(parentid, name) { + var hash = 0; + + for (var i = 0; i < name.length; i++) { + hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0; + } + return ((parentid + hash) >>> 0) % FS.nameTable.length; + }, + hashAddNode(node) { + var hash = FS.hashName(node.parent.id, node.name); + node.name_next = FS.nameTable[hash]; + FS.nameTable[hash] = node; + }, + hashRemoveNode(node) { + var hash = FS.hashName(node.parent.id, node.name); + if (FS.nameTable[hash] === node) { + FS.nameTable[hash] = node.name_next; + } else { + var current = FS.nameTable[hash]; + while (current) { + if (current.name_next === node) { + current.name_next = node.name_next; + break; + } + current = current.name_next; + } + } + }, + lookupNode(parent, name) { + var errCode = FS.mayLookup(parent); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + var hash = FS.hashName(parent.id, name); + for (var node = FS.nameTable[hash]; node; node = node.name_next) { + var nodeName = node.name; + if (node.parent.id === parent.id && nodeName === name) { + return node; + } + } + // if we failed to find it in the cache, call into the VFS + return FS.lookup(parent, name); + }, + createNode(parent, name, mode, rdev) { + assert(typeof parent == 'object') + var node = new FS.FSNode(parent, name, mode, rdev); + + FS.hashAddNode(node); + + return node; + }, + destroyNode(node) { + FS.hashRemoveNode(node); + }, + isRoot(node) { + return node === node.parent; + }, + isMountpoint(node) { + return !!node.mounted; + }, + isFile(mode) { + return (mode & 61440) === 32768; + }, + isDir(mode) { + return (mode & 61440) === 16384; + }, + isLink(mode) { + return (mode & 61440) === 40960; + }, + isChrdev(mode) { + return (mode & 61440) === 8192; + }, + isBlkdev(mode) { + return (mode & 61440) === 24576; + }, + isFIFO(mode) { + return (mode & 61440) === 4096; + }, + isSocket(mode) { + return (mode & 49152) === 49152; + }, + flagsToPermissionString(flag) { + var perms = ['r', 'w', 'rw'][flag & 3]; + if ((flag & 512)) { + perms += 'w'; + } + return perms; + }, + nodePermissions(node, perms) { + if (FS.ignorePermissions) { + return 0; + } + // return 0 if any user, group or owner bits are set. + if (perms.includes('r') && !(node.mode & 292)) { + return 2; + } + if (perms.includes('w') && !(node.mode & 146)) { + return 2; + } + if (perms.includes('x') && !(node.mode & 73)) { + return 2; + } + return 0; + }, + mayLookup(dir) { + if (!FS.isDir(dir.mode)) return 54; + var errCode = FS.nodePermissions(dir, 'x'); + if (errCode) return errCode; + if (!dir.node_ops.lookup) return 2; + return 0; + }, + mayCreate(dir, name) { + if (!FS.isDir(dir.mode)) { + return 54; + } + try { + var node = FS.lookupNode(dir, name); + return 20; + } catch (e) { + } + return FS.nodePermissions(dir, 'wx'); + }, + mayDelete(dir, name, isdir) { + var node; + try { + node = FS.lookupNode(dir, name); + } catch (e) { + return e.errno; + } + var errCode = FS.nodePermissions(dir, 'wx'); + if (errCode) { + return errCode; + } + if (isdir) { + if (!FS.isDir(node.mode)) { + return 54; + } + if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { + return 10; + } + } else if (FS.isDir(node.mode)) { + return 31; + } + return 0; + }, + mayOpen(node, flags) { + if (!node) { + return 44; + } + if (FS.isLink(node.mode)) { + return 32; + } + var mode = FS.flagsToPermissionString(flags); + if (FS.isDir(node.mode)) { + // opening for write + // TODO: check for O_SEARCH? (== search for dir only) + if (mode !== 'r' || (flags & (512 | 64))) { + return 31; + } + } + return FS.nodePermissions(node, mode); + }, + checkOpExists(op, err) { + if (!op) { + throw new FS.ErrnoError(err); + } + return op; + }, + MAX_OPEN_FDS:4096, + nextfd() { + for (var fd = 0; fd <= FS.MAX_OPEN_FDS; fd++) { + if (!FS.streams[fd]) { + return fd; + } + } + throw new FS.ErrnoError(33); + }, + getStreamChecked(fd) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + return stream; + }, + getStream:(fd) => FS.streams[fd], + createStream(stream, fd = -1) { + assert(fd >= -1); + + // clone it, so we can return an instance of FSStream + stream = Object.assign(new FS.FSStream(), stream); + if (fd == -1) { + fd = FS.nextfd(); + } + stream.fd = fd; + FS.streams[fd] = stream; + return stream; + }, + closeStream(fd) { + FS.streams[fd] = null; + }, + dupStream(origStream, fd = -1) { + var stream = FS.createStream(origStream, fd); + stream.stream_ops?.dup?.(stream); + return stream; + }, + doSetAttr(stream, node, attr) { + var setattr = stream?.stream_ops.setattr; + var arg = setattr ? stream : node; + setattr ??= node.node_ops.setattr; + FS.checkOpExists(setattr, 63) + try { + setattr(arg, attr); + } catch (e) { + if (e instanceof RangeError) { + throw new FS.ErrnoError(22); + } + throw e; + } + }, + chrdev_stream_ops:{ + open(stream) { + var device = FS.getDevice(stream.node.rdev); + // override node's stream ops with the device's + stream.stream_ops = device.stream_ops; + // forward the open call + stream.stream_ops.open?.(stream); + }, + llseek() { + throw new FS.ErrnoError(70); + }, + }, + major:(dev) => ((dev) >> 8), + minor:(dev) => ((dev) & 0xff), + makedev:(ma, mi) => ((ma) << 8 | (mi)), + registerDevice(dev, ops) { + FS.devices[dev] = { stream_ops: ops }; + }, + getDevice:(dev) => FS.devices[dev], + getMounts(mount) { + var mounts = []; + var check = [mount]; + + while (check.length) { + var m = check.pop(); + + mounts.push(m); + + check.push(...m.mounts); + } + + return mounts; + }, + syncfs(populate, callback) { + if (typeof populate == 'function') { + callback = populate; + populate = false; + } + + FS.syncFSRequests++; + + if (FS.syncFSRequests > 1) { + err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`); + } + + var mounts = FS.getMounts(FS.root.mount); + var completed = 0; + + function doCallback(errCode) { + assert(FS.syncFSRequests > 0); + FS.syncFSRequests--; + return callback(errCode); + } + + function done(errCode) { + if (errCode) { + if (!done.errored) { + done.errored = true; + return doCallback(errCode); + } + return; + } + if (++completed >= mounts.length) { + doCallback(null); + } + }; + + // sync all mounts + for (var mount of mounts) { + if (mount.type.syncfs) { + mount.type.syncfs(mount, populate, done); + } else { + done(null); + } + } + }, + mount(type, opts, mountpoint) { + if (typeof type == 'string') { + // The filesystem was not included, and instead we have an error + // message stored in the variable. + throw type; + } + var root = mountpoint === '/'; + var pseudo = !mountpoint; + var node; + + if (root && FS.root) { + throw new FS.ErrnoError(10); + } else if (!root && !pseudo) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + + mountpoint = lookup.path; // use the absolute path + node = lookup.node; + + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + + if (!FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + } + + var mount = { + type, + opts, + mountpoint, + mounts: [] + }; + + // create a root node for the fs + var mountRoot = type.mount(mount); + mountRoot.mount = mount; + mount.root = mountRoot; + + if (root) { + FS.root = mountRoot; + } else if (node) { + // set as a mountpoint + node.mounted = mount; + + // add the new mount to the current mount's children + if (node.mount) { + node.mount.mounts.push(mount); + } + } + + return mountRoot; + }, + unmount(mountpoint) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + + if (!FS.isMountpoint(lookup.node)) { + throw new FS.ErrnoError(28); + } + + // destroy the nodes for this mount, and all its child mounts + var node = lookup.node; + var mount = node.mounted; + var mounts = FS.getMounts(mount); + + for (var [hash, current] of Object.entries(FS.nameTable)) { + while (current) { + var next = current.name_next; + + if (mounts.includes(current.mount)) { + FS.destroyNode(current); + } + + current = next; + } + } + + // no longer a mountpoint + node.mounted = null; + + // remove this mount from the child mounts + var idx = node.mount.mounts.indexOf(mount); + assert(idx !== -1); + node.mount.mounts.splice(idx, 1); + }, + lookup(parent, name) { + return parent.node_ops.lookup(parent, name); + }, + mknod(path, mode, dev) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + if (!name) { + throw new FS.ErrnoError(28); + } + if (name === '.' || name === '..') { + throw new FS.ErrnoError(20); + } + var errCode = FS.mayCreate(parent, name); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.mknod) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.mknod(parent, name, mode, dev); + }, + statfs(path) { + return FS.statfsNode(FS.lookupPath(path, {follow: true}).node); + }, + statfsStream(stream) { + // We keep a separate statfsStream function because noderawfs overrides + // it. In noderawfs, stream.node is sometimes null. Instead, we need to + // look at stream.path. + return FS.statfsNode(stream.node); + }, + statfsNode(node) { + // NOTE: None of the defaults here are true. We're just returning safe and + // sane values. Currently nodefs and rawfs replace these defaults, + // other file systems leave them alone. + var rtn = { + bsize: 4096, + frsize: 4096, + blocks: 1e6, + bfree: 5e5, + bavail: 5e5, + files: FS.nextInode, + ffree: FS.nextInode - 1, + fsid: 42, + flags: 2, + namelen: 255, + }; + + if (node.node_ops.statfs) { + Object.assign(rtn, node.node_ops.statfs(node.mount.opts.root)); + } + return rtn; + }, + create(path, mode = 0o666) { + mode &= 4095; + mode |= 32768; + return FS.mknod(path, mode, 0); + }, + mkdir(path, mode = 0o777) { + mode &= 511 | 512; + mode |= 16384; + return FS.mknod(path, mode, 0); + }, + mkdirTree(path, mode) { + var dirs = path.split('/'); + var d = ''; + for (var dir of dirs) { + if (!dir) continue; + if (d || PATH.isAbs(path)) d += '/'; + d += dir; + try { + FS.mkdir(d, mode); + } catch(e) { + if (e.errno != 20) throw e; + } + } + }, + mkdev(path, mode, dev) { + if (typeof dev == 'undefined') { + dev = mode; + mode = 0o666; + } + mode |= 8192; + return FS.mknod(path, mode, dev); + }, + symlink(oldpath, newpath) { + if (!PATH_FS.resolve(oldpath)) { + throw new FS.ErrnoError(44); + } + var lookup = FS.lookupPath(newpath, { parent: true }); + var parent = lookup.node; + if (!parent) { + throw new FS.ErrnoError(44); + } + var newname = PATH.basename(newpath); + var errCode = FS.mayCreate(parent, newname); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.symlink) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.symlink(parent, newname, oldpath); + }, + rename(old_path, new_path) { + var old_dirname = PATH.dirname(old_path); + var new_dirname = PATH.dirname(new_path); + var old_name = PATH.basename(old_path); + var new_name = PATH.basename(new_path); + // parents must exist + var lookup, old_dir, new_dir; + + // let the errors from non existent directories percolate up + lookup = FS.lookupPath(old_path, { parent: true }); + old_dir = lookup.node; + lookup = FS.lookupPath(new_path, { parent: true }); + new_dir = lookup.node; + + if (!old_dir || !new_dir) throw new FS.ErrnoError(44); + // need to be part of the same mount + if (old_dir.mount !== new_dir.mount) { + throw new FS.ErrnoError(75); + } + // source must exist + var old_node = FS.lookupNode(old_dir, old_name); + // old path should not be an ancestor of the new path + var relative = PATH_FS.relative(old_path, new_dirname); + if (relative.charAt(0) !== '.') { + throw new FS.ErrnoError(28); + } + // new path should not be an ancestor of the old path + relative = PATH_FS.relative(new_path, old_dirname); + if (relative.charAt(0) !== '.') { + throw new FS.ErrnoError(55); + } + // see if the new path already exists + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) { + // not fatal + } + // early out if nothing needs to change + if (old_node === new_node) { + return; + } + // we'll need to delete the old entry + var isdir = FS.isDir(old_node.mode); + var errCode = FS.mayDelete(old_dir, old_name, isdir); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + // need delete permissions if we'll be overwriting. + // need create permissions if new doesn't already exist. + errCode = new_node ? + FS.mayDelete(new_dir, new_name, isdir) : + FS.mayCreate(new_dir, new_name); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!old_dir.node_ops.rename) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) { + throw new FS.ErrnoError(10); + } + // if we are going to change the parent, check write permissions + if (new_dir !== old_dir) { + errCode = FS.nodePermissions(old_dir, 'w'); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + } + // remove the node from the lookup hash + FS.hashRemoveNode(old_node); + // do the underlying fs rename + try { + old_dir.node_ops.rename(old_node, new_dir, new_name); + // update old node (we do this here to avoid each backend + // needing to) + old_node.parent = new_dir; + } catch (e) { + throw e; + } finally { + // add the node back to the hash (in case node_ops.rename + // changed its name) + FS.hashAddNode(old_node); + } + }, + rmdir(path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var errCode = FS.mayDelete(parent, name, true); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.rmdir) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + parent.node_ops.rmdir(parent, name); + FS.destroyNode(node); + }, + readdir(path) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + var readdir = FS.checkOpExists(node.node_ops.readdir, 54); + return readdir(node); + }, + unlink(path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + if (!parent) { + throw new FS.ErrnoError(44); + } + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var errCode = FS.mayDelete(parent, name, false); + if (errCode) { + // According to POSIX, we should map EISDIR to EPERM, but + // we instead do what Linux does (and we must, as we use + // the musl linux libc). + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.unlink) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + parent.node_ops.unlink(parent, name); + FS.destroyNode(node); + }, + readlink(path) { + var lookup = FS.lookupPath(path); + var link = lookup.node; + if (!link) { + throw new FS.ErrnoError(44); + } + if (!link.node_ops.readlink) { + throw new FS.ErrnoError(28); + } + return link.node_ops.readlink(link); + }, + stat(path, dontFollow) { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var node = lookup.node; + var getattr = FS.checkOpExists(node.node_ops.getattr, 63); + return getattr(node); + }, + fstat(fd) { + var stream = FS.getStreamChecked(fd); + var node = stream.node; + var getattr = stream.stream_ops.getattr; + var arg = getattr ? stream : node; + getattr ??= node.node_ops.getattr; + FS.checkOpExists(getattr, 63) + return getattr(arg); + }, + lstat(path) { + return FS.stat(path, true); + }, + doChmod(stream, node, mode, dontFollow) { + FS.doSetAttr(stream, node, { + mode: (mode & 4095) | (node.mode & ~4095), + ctime: Date.now(), + dontFollow + }); + }, + chmod(path, mode, dontFollow) { + var node; + if (typeof path == 'string') { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + FS.doChmod(null, node, mode, dontFollow); + }, + lchmod(path, mode) { + FS.chmod(path, mode, true); + }, + fchmod(fd, mode) { + var stream = FS.getStreamChecked(fd); + FS.doChmod(stream, stream.node, mode, false); + }, + doChown(stream, node, dontFollow) { + FS.doSetAttr(stream, node, { + timestamp: Date.now(), + dontFollow + // we ignore the uid / gid for now + }); + }, + chown(path, uid, gid, dontFollow) { + var node; + if (typeof path == 'string') { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + FS.doChown(null, node, dontFollow); + }, + lchown(path, uid, gid) { + FS.chown(path, uid, gid, true); + }, + fchown(fd, uid, gid) { + var stream = FS.getStreamChecked(fd); + FS.doChown(stream, stream.node, false); + }, + doTruncate(stream, node, len) { + if (FS.isDir(node.mode)) { + throw new FS.ErrnoError(31); + } + if (!FS.isFile(node.mode)) { + throw new FS.ErrnoError(28); + } + var errCode = FS.nodePermissions(node, 'w'); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + FS.doSetAttr(stream, node, { + size: len, + timestamp: Date.now() + }); + }, + truncate(path, len) { + if (len < 0) { + throw new FS.ErrnoError(28); + } + var node; + if (typeof path == 'string') { + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + } else { + node = path; + } + FS.doTruncate(null, node, len); + }, + ftruncate(fd, len) { + var stream = FS.getStreamChecked(fd); + if (len < 0 || (stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(28); + } + FS.doTruncate(stream, stream.node, len); + }, + utime(path, atime, mtime) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + var setattr = FS.checkOpExists(node.node_ops.setattr, 63); + setattr(node, { + atime: atime, + mtime: mtime + }); + }, + open(path, flags, mode = 0o666) { + if (path === "") { + throw new FS.ErrnoError(44); + } + flags = FS_modeStringToFlags(flags); + if ((flags & 64)) { + mode = (mode & 4095) | 32768; + } else { + mode = 0; + } + var node; + var isDirPath; + if (typeof path == 'object') { + node = path; + } else { + isDirPath = path.endsWith("/"); + // noent_okay makes it so that if the final component of the path + // doesn't exist, lookupPath returns `node: undefined`. `path` will be + // updated to point to the target of all symlinks. + var lookup = FS.lookupPath(path, { + follow: !(flags & 131072), + noent_okay: true + }); + node = lookup.node; + path = lookup.path; + } + // perhaps we need to create the node + var created = false; + if ((flags & 64)) { + if (node) { + // if O_CREAT and O_EXCL are set, error out if the node already exists + if ((flags & 128)) { + throw new FS.ErrnoError(20); + } + } else if (isDirPath) { + throw new FS.ErrnoError(31); + } else { + // node doesn't exist, try to create it + // Ignore the permission bits here to ensure we can `open` this new + // file below. We use chmod below to apply the permissions once the + // file is open. + node = FS.mknod(path, mode | 0o777, 0); + created = true; + } + } + if (!node) { + throw new FS.ErrnoError(44); + } + // can't truncate a device + if (FS.isChrdev(node.mode)) { + flags &= ~512; + } + // if asked only for a directory, then this must be one + if ((flags & 65536) && !FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + // check permissions, if this is not a file we just created now (it is ok to + // create and write to a file with read-only permissions; it is read-only + // for later use) + if (!created) { + var errCode = FS.mayOpen(node, flags); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + } + // do truncation if necessary + if ((flags & 512) && !created) { + FS.truncate(node, 0); + } + // we've already handled these, don't pass down to the underlying vfs + flags &= ~(128 | 512 | 131072); + + // register the stream with the filesystem + var stream = FS.createStream({ + node, + path: FS.getPath(node), // we want the absolute path to the node + flags, + seekable: true, + position: 0, + stream_ops: node.stream_ops, + // used by the file family libc calls (fopen, fwrite, ferror, etc.) + ungotten: [], + error: false + }); + // call the new stream's open function + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + if (created) { + FS.chmod(node, mode & 0o777); + } + return stream; + }, + close(stream) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (stream.getdents) stream.getdents = null; // free readdir state + try { + if (stream.stream_ops.close) { + stream.stream_ops.close(stream); + } + } catch (e) { + throw e; + } finally { + FS.closeStream(stream.fd); + } + stream.fd = null; + }, + isClosed(stream) { + return stream.fd === null; + }, + llseek(stream, offset, whence) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (!stream.seekable || !stream.stream_ops.llseek) { + throw new FS.ErrnoError(70); + } + if (whence != 0 && whence != 1 && whence != 2) { + throw new FS.ErrnoError(28); + } + stream.position = stream.stream_ops.llseek(stream, offset, whence); + stream.ungotten = []; + return stream.position; + }, + read(stream, buffer, offset, length, position) { + assert(offset >= 0); + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.read) { + throw new FS.ErrnoError(28); + } + var seeking = typeof position != 'undefined'; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position); + if (!seeking) stream.position += bytesRead; + return bytesRead; + }, + write(stream, buffer, offset, length, position, canOwn) { + assert(offset >= 0); + assert(buffer.subarray, 'FS.write expects a TypedArray'); + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.write) { + throw new FS.ErrnoError(28); + } + if (stream.seekable && stream.flags & 1024) { + // seek to the end before writing in append mode + FS.llseek(stream, 0, 2); + } + var seeking = typeof position != 'undefined'; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn); + if (!seeking) stream.position += bytesWritten; + return bytesWritten; + }, + mmap(stream, length, position, prot, flags) { + // User requests writing to file (prot & PROT_WRITE != 0). + // Checking if we have permissions to write to the file unless + // MAP_PRIVATE flag is set. According to POSIX spec it is possible + // to write to file opened in read-only mode with MAP_PRIVATE flag, + // as all modifications will be visible only in the memory of + // the current process. + if ((prot & 2) !== 0 + && (flags & 2) === 0 + && (stream.flags & 2097155) !== 2) { + throw new FS.ErrnoError(2); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(2); + } + if (!stream.stream_ops.mmap) { + throw new FS.ErrnoError(43); + } + if (!length) { + throw new FS.ErrnoError(28); + } + return stream.stream_ops.mmap(stream, length, position, prot, flags); + }, + msync(stream, buffer, offset, length, mmapFlags) { + assert(offset >= 0); + if (!stream.stream_ops.msync) { + return 0; + } + return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags); + }, + ioctl(stream, cmd, arg) { + if (!stream.stream_ops.ioctl) { + throw new FS.ErrnoError(59); + } + return stream.stream_ops.ioctl(stream, cmd, arg); + }, + readFile(path, opts = {}) { + opts.flags = opts.flags ?? 0; + opts.encoding = opts.encoding ?? 'binary'; + if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') { + abort(`Invalid encoding type "${opts.encoding}"`); + } + var stream = FS.open(path, opts.flags); + var stat = FS.stat(path); + var length = stat.size; + var buf = new Uint8Array(length); + FS.read(stream, buf, 0, length, 0); + if (opts.encoding === 'utf8') { + buf = UTF8ArrayToString(buf); + } + FS.close(stream); + return buf; + }, + writeFile(path, data, opts = {}) { + opts.flags = opts.flags ?? 577; + var stream = FS.open(path, opts.flags, opts.mode); + data = FS_fileDataToTypedArray(data); + FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn); + FS.close(stream); + }, + cwd:() => FS.currentPath, + chdir(path) { + var lookup = FS.lookupPath(path, { follow: true }); + if (lookup.node === null) { + throw new FS.ErrnoError(44); + } + if (!FS.isDir(lookup.node.mode)) { + throw new FS.ErrnoError(54); + } + var errCode = FS.nodePermissions(lookup.node, 'x'); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + FS.currentPath = lookup.path; + }, + createDefaultDirectories() { + FS.mkdir('/tmp'); + FS.mkdir('/home'); + FS.mkdir('/home/web_user'); + }, + createDefaultDevices() { + // create /dev + FS.mkdir('/dev'); + // setup /dev/null + FS.registerDevice(FS.makedev(1, 3), { + read: () => 0, + write: (stream, buffer, offset, length, pos) => length, + llseek: () => 0, + }); + FS.mkdev('/dev/null', FS.makedev(1, 3)); + // setup /dev/tty and /dev/tty1 + // stderr needs to print output using err() rather than out() + // so we register a second tty just for it. + TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); + TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); + FS.mkdev('/dev/tty', FS.makedev(5, 0)); + FS.mkdev('/dev/tty1', FS.makedev(6, 0)); + // setup /dev/[u]random + // use a buffer to avoid overhead of individual crypto calls per byte + var randomBuffer = new Uint8Array(1024), randomLeft = 0; + var randomByte = () => { + if (randomLeft === 0) { + randomFill(randomBuffer); + randomLeft = randomBuffer.byteLength; + } + return randomBuffer[--randomLeft]; + }; + FS.createDevice('/dev', 'random', randomByte); + FS.createDevice('/dev', 'urandom', randomByte); + // we're not going to emulate the actual shm device, + // just create the tmp dirs that reside in it commonly + FS.mkdir('/dev/shm'); + FS.mkdir('/dev/shm/tmp'); + }, + createSpecialDirectories() { + // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the + // name of the stream for fd 6 (see test_unistd_ttyname) + FS.mkdir('/proc'); + var proc_self = FS.mkdir('/proc/self'); + FS.mkdir('/proc/self/fd'); + FS.mount({ + mount() { + var node = FS.createNode(proc_self, 'fd', 16895, 73); + node.stream_ops = { + llseek: MEMFS.stream_ops.llseek, + }; + node.node_ops = { + lookup(parent, name) { + var fd = +name; + var stream = FS.getStreamChecked(fd); + var ret = { + parent: null, + mount: { mountpoint: 'fake' }, + node_ops: { readlink: () => stream.path }, + id: fd + 1, + }; + ret.parent = ret; // make it look like a simple root node + return ret; + }, + readdir() { + return Array.from(FS.streams.entries()) + .filter(([k, v]) => v) + .map(([k, v]) => k.toString()); + } + }; + return node; + } + }, {}, '/proc/self/fd'); + }, + createStandardStreams(input, output, error) { + // TODO deprecate the old functionality of a single + // input / output callback and that utilizes FS.createDevice + // and instead require a unique set of stream ops + + // by default, we symlink the standard streams to the + // default tty devices. however, if the standard streams + // have been overwritten we create a unique device for + // them instead. + if (input) { + FS.createDevice('/dev', 'stdin', input); + } else { + FS.symlink('/dev/tty', '/dev/stdin'); + } + if (output) { + FS.createDevice('/dev', 'stdout', null, output); + } else { + FS.symlink('/dev/tty', '/dev/stdout'); + } + if (error) { + FS.createDevice('/dev', 'stderr', null, error); + } else { + FS.symlink('/dev/tty1', '/dev/stderr'); + } + + // open default streams for the stdin, stdout and stderr devices + var stdin = FS.open('/dev/stdin', 0); + var stdout = FS.open('/dev/stdout', 1); + var stderr = FS.open('/dev/stderr', 1); + assert(stdin.fd === 0, `invalid handle for stdin (${stdin.fd})`); + assert(stdout.fd === 1, `invalid handle for stdout (${stdout.fd})`); + assert(stderr.fd === 2, `invalid handle for stderr (${stderr.fd})`); + }, + staticInit() { + FS.nameTable = new Array(4096); + + FS.mount(MEMFS, {}, '/'); + + FS.createDefaultDirectories(); + FS.createDefaultDevices(); + FS.createSpecialDirectories(); + + FS.filesystems = { + 'MEMFS': MEMFS, + }; + }, + init(input, output, error) { + assert(!FS.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)'); + FS.initialized = true; + + // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here + input ??= Module['stdin']; + output ??= Module['stdout']; + error ??= Module['stderr']; + + FS.createStandardStreams(input, output, error); + }, + quit() { + FS.initialized = false; + // force-flush all streams, so we get musl std streams printed out + _fflush(0); + // close all of our streams + for (var stream of FS.streams) { + if (stream) { + FS.close(stream); + } + } + }, + findObject(path, dontResolveLastLink) { + var ret = FS.analyzePath(path, dontResolveLastLink); + if (!ret.exists) { + return null; + } + return ret.object; + }, + analyzePath(path, dontResolveLastLink) { + // operate from within the context of the symlink's target + try { + var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + path = lookup.path; + } catch (e) { + } + var ret = { + isRoot: false, exists: false, error: 0, name: null, path: null, object: null, + parentExists: false, parentPath: null, parentObject: null + }; + try { + var lookup = FS.lookupPath(path, { parent: true }); + ret.parentExists = true; + ret.parentPath = lookup.path; + ret.parentObject = lookup.node; + ret.name = PATH.basename(path); + lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + ret.exists = true; + ret.path = lookup.path; + ret.object = lookup.node; + ret.name = lookup.node.name; + ret.isRoot = lookup.path === '/'; + } catch (e) { + ret.error = e.errno; + }; + return ret; + }, + createPath(parent, path, canRead, canWrite) { + parent = typeof parent == 'string' ? parent : FS.getPath(parent); + var parts = path.split('/').reverse(); + while (parts.length) { + var part = parts.pop(); + if (!part) continue; + var current = PATH.join2(parent, part); + try { + FS.mkdir(current); + } catch (e) { + if (e.errno != 20) throw e; + } + parent = current; + } + return current; + }, + createFile(parent, name, properties, canRead, canWrite) { + var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name); + var mode = FS_getMode(canRead, canWrite); + return FS.create(path, mode); + }, + createDataFile(parent, name, data, canRead, canWrite, canOwn) { + var path = name; + if (parent) { + parent = typeof parent == 'string' ? parent : FS.getPath(parent); + path = name ? PATH.join2(parent, name) : parent; + } + var mode = FS_getMode(canRead, canWrite); + var node = FS.create(path, mode); + if (data) { + data = FS_fileDataToTypedArray(data); + // make sure we can write to the file + FS.chmod(node, mode | 146); + var stream = FS.open(node, 577); + FS.write(stream, data, 0, data.length, 0, canOwn); + FS.close(stream); + FS.chmod(node, mode); + } + }, + createDevice(parent, name, input, output) { + var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name); + var mode = FS_getMode(!!input, !!output); + FS.createDevice.major ??= 64; + var dev = FS.makedev(FS.createDevice.major++, 0); + // Create a fake device that a set of stream ops to emulate + // the old behavior. + FS.registerDevice(dev, { + open(stream) { + stream.seekable = false; + }, + close(stream) { + // flush any pending line data + if (output?.buffer?.length) { + output(10); + } + }, + read(stream, buffer, offset, length, pos /* ignored */) { + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = input(); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === undefined && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === undefined) break; + bytesRead++; + buffer[offset+i] = result; + } + if (bytesRead) { + stream.node.atime = Date.now(); + } + return bytesRead; + }, + write(stream, buffer, offset, length, pos) { + for (var i = 0; i < length; i++) { + try { + output(buffer[offset+i]); + } catch (e) { + throw new FS.ErrnoError(29); + } + } + if (length) { + stream.node.mtime = stream.node.ctime = Date.now(); + } + return i; + } + }); + return FS.mkdev(path, mode, dev); + }, + forceLoadFile(obj) { + if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true; + if (globalThis.XMLHttpRequest) { + abort("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."); + } else { // Command-line. + try { + obj.contents = readBinary(obj.url); + } catch (e) { + throw new FS.ErrnoError(29); + } + } + }, + createLazyFile(parent, name, url, canRead, canWrite) { + // Lazy chunked Uint8Array (implements get and length from Uint8Array). + // Actual getting is abstracted away for eventual reuse. + class LazyUint8Array { + lengthKnown = false; + chunks = []; // Loaded chunks. Index is the chunk number + get(idx) { + if (idx > this.length-1 || idx < 0) { + return undefined; + } + var chunkOffset = idx % this.chunkSize; + var chunkNum = (idx / this.chunkSize)|0; + return this.getter(chunkNum)[chunkOffset]; + } + setDataGetter(getter) { + this.getter = getter; + } + cacheLength() { + // Find length + var xhr = new XMLHttpRequest(); + xhr.open('HEAD', url, false); + xhr.send(null); + if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort("Couldn't load " + url + ". Status: " + xhr.status); + var datalength = Number(xhr.getResponseHeader("Content-length")); + var header; + var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes"; + var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip"; + + var chunkSize = 1024*1024; // Chunk size in bytes + + if (!hasByteServing) chunkSize = datalength; + + // Function to get a range from the remote URL. + var doXHR = (from, to) => { + if (from > to) abort(`invalid range (${from}, ${to}) or no bytes requested!`); + if (to > datalength-1) abort(`only ${datalength} bytes available! programmer error!`); + + // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available. + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to); + + // Some hints to the browser that we want binary data. + xhr.responseType = 'arraybuffer'; + if (xhr.overrideMimeType) { + xhr.overrideMimeType('text/plain; charset=x-user-defined'); + } + + xhr.send(null); + if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort("Couldn't load " + url + ". Status: " + xhr.status); + if (xhr.response !== undefined) { + return new Uint8Array(/** @type{Array<number>} */(xhr.response || [])); + } + return intArrayFromString(xhr.responseText ?? '', true); + }; + var lazyArray = this; + lazyArray.setDataGetter((chunkNum) => { + var start = chunkNum * chunkSize; + var end = (chunkNum+1) * chunkSize - 1; // including this byte + end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block + if (typeof lazyArray.chunks[chunkNum] == 'undefined') { + lazyArray.chunks[chunkNum] = doXHR(start, end); + } + if (typeof lazyArray.chunks[chunkNum] == 'undefined') abort('doXHR failed!'); + return lazyArray.chunks[chunkNum]; + }); + + if (usesGzip || !datalength) { + // if the server uses gzip or doesn't supply the length, we have to download the whole file to get the (uncompressed) length + chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file + datalength = this.getter(0).length; + chunkSize = datalength; + out("LazyFiles on gzip forces download of the whole file when length is accessed"); + } + + this._length = datalength; + this._chunkSize = chunkSize; + this.lengthKnown = true; + } + get length() { + if (!this.lengthKnown) { + this.cacheLength(); + } + return this._length; + } + get chunkSize() { + if (!this.lengthKnown) { + this.cacheLength(); + } + return this._chunkSize; + } + } + + if (globalThis.XMLHttpRequest) { + if (!ENVIRONMENT_IS_WORKER) abort('Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc'); + var lazyArray = new LazyUint8Array(); + var properties = { isDevice: false, contents: lazyArray }; + } else { + var properties = { isDevice: false, url: url }; + } + + var node = FS.createFile(parent, name, properties, canRead, canWrite); + // This is a total hack, but I want to get this lazy file code out of the + // core of MEMFS. If we want to keep this lazy file concept I feel it should + // be its own thin LAZYFS proxying calls to MEMFS. + if (properties.contents) { + node.contents = properties.contents; + } else if (properties.url) { + node.contents = null; + node.url = properties.url; + } + // Add a function that defers querying the file size until it is asked the first time. + Object.defineProperties(node, { + usedBytes: { + get: function() { return this.contents.length; } + } + }); + // override each stream op with one that tries to force load the lazy file first + var stream_ops = {}; + for (const [key, fn] of Object.entries(node.stream_ops)) { + stream_ops[key] = (...args) => { + FS.forceLoadFile(node); + return fn(...args); + }; + } + function writeChunks(stream, buffer, offset, length, position) { + var contents = stream.node.contents; + if (position >= contents.length) + return 0; + var size = Math.min(contents.length - position, length); + assert(size >= 0); + if (contents.slice) { // normal array + for (var i = 0; i < size; i++) { + buffer[offset + i] = contents[position + i]; + } + } else { + for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR + buffer[offset + i] = contents.get(position + i); + } + } + return size; + } + // use a custom read function + stream_ops.read = (stream, buffer, offset, length, position) => { + FS.forceLoadFile(node); + return writeChunks(stream, buffer, offset, length, position) + }; + // use a custom mmap function + stream_ops.mmap = (stream, length, position, prot, flags) => { + FS.forceLoadFile(node); + var ptr = mmapAlloc(length); + if (!ptr) { + throw new FS.ErrnoError(48); + } + writeChunks(stream, HEAP8, ptr, length, position); + return { ptr, allocated: true }; + }; + node.stream_ops = stream_ops; + return node; + }, + }; + + var SYSCALLS = { + currentUmask:18, + calculateAt(dirfd, path, allowEmpty) { + if (PATH.isAbs(path)) { + return path; + } + // relative path + var dir; + if (dirfd === -100) { + dir = FS.cwd(); + } else { + var dirstream = SYSCALLS.getStreamFromFD(dirfd); + dir = dirstream.path; + } + if (path.length == 0) { + if (!allowEmpty) { + throw new FS.ErrnoError(44);; + } + return dir; + } + return dir + '/' + path; + }, + writeStat(buf, stat) { + HEAPU32[((buf)>>2)] = stat.dev; + HEAPU32[(((buf)+(4))>>2)] = stat.mode; + HEAPU32[(((buf)+(8))>>2)] = stat.nlink; + HEAPU32[(((buf)+(12))>>2)] = stat.uid; + HEAPU32[(((buf)+(16))>>2)] = stat.gid; + HEAPU32[(((buf)+(20))>>2)] = stat.rdev; + HEAP64[(((buf)+(24))>>3)] = BigInt(stat.size); + HEAP32[(((buf)+(32))>>2)] = 4096; + HEAP32[(((buf)+(36))>>2)] = stat.blocks; + var atime = stat.atime.getTime(); + var mtime = stat.mtime.getTime(); + var ctime = stat.ctime.getTime(); + HEAP64[(((buf)+(40))>>3)] = BigInt(Math.floor(atime / 1000)); + HEAPU32[(((buf)+(48))>>2)] = (atime % 1000) * 1000 * 1000; + HEAP64[(((buf)+(56))>>3)] = BigInt(Math.floor(mtime / 1000)); + HEAPU32[(((buf)+(64))>>2)] = (mtime % 1000) * 1000 * 1000; + HEAP64[(((buf)+(72))>>3)] = BigInt(Math.floor(ctime / 1000)); + HEAPU32[(((buf)+(80))>>2)] = (ctime % 1000) * 1000 * 1000; + HEAP64[(((buf)+(88))>>3)] = BigInt(stat.ino); + return 0; + }, + writeStatFs(buf, stats) { + HEAPU32[(((buf)+(4))>>2)] = stats.bsize; + HEAPU32[(((buf)+(60))>>2)] = stats.bsize; + HEAP64[(((buf)+(8))>>3)] = BigInt(stats.blocks); + HEAP64[(((buf)+(16))>>3)] = BigInt(stats.bfree); + HEAP64[(((buf)+(24))>>3)] = BigInt(stats.bavail); + HEAP64[(((buf)+(32))>>3)] = BigInt(stats.files); + HEAP64[(((buf)+(40))>>3)] = BigInt(stats.ffree); + HEAPU32[(((buf)+(48))>>2)] = stats.fsid; + HEAPU32[(((buf)+(64))>>2)] = stats.flags; // ST_NOSUID + HEAPU32[(((buf)+(56))>>2)] = stats.namelen; + }, + doMsync(addr, stream, len, flags, offset) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (flags & 2) { + // MAP_PRIVATE calls need not to be synced back to underlying fs + return 0; + } + var buffer = HEAPU8.slice(addr, addr + len); + FS.msync(stream, buffer, offset, len, flags); + }, + getStreamFromFD(fd) { + var stream = FS.getStreamChecked(fd); + return stream; + }, + varargs:undefined, + getStr(ptr) { + var ret = UTF8ToString(ptr); + return ret; + }, + }; + function ___syscall_fcntl64(fd, cmd, varargs) { + SYSCALLS.varargs = varargs; + try { + + var stream = SYSCALLS.getStreamFromFD(fd); + switch (cmd) { + case 0: { + var arg = syscallGetVarargI(); + if (arg < 0) { + return -28; + } + while (FS.streams[arg]) { + arg++; + } + var newStream; + newStream = FS.dupStream(stream, arg); + return newStream.fd; + } + case 1: + case 2: + return 0; // FD_CLOEXEC makes no sense for a single process. + case 3: + return stream.flags; + case 4: { + var arg = syscallGetVarargI(); + var mask = 289792; + stream.flags = (stream.flags & ~mask) | (arg & mask); + return 0; + } + case 12: { + var arg = syscallGetVarargP(); + var offset = 0; + // We're always unlocked. + HEAP16[(((arg)+(offset))>>1)] = 2; + return 0; + } + case 13: + case 14: + // Pretend that the locking is successful. These are process-level locks, + // and Emscripten programs are a single process. If we supported linking a + // filesystem between programs, we'd need to do more here. + // See https://github.com/emscripten-core/emscripten/issues/23697 + return 0; + } + return -28; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_fdatasync(fd) { + try { + + var stream = SYSCALLS.getStreamFromFD(fd); + return 0; // we can't do anything synchronously; the in-memory FS is already synced to + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_fstat64(fd, buf) { + try { + + return SYSCALLS.writeStat(buf, FS.fstat(fd)); + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + + function ___syscall_ioctl(fd, op, varargs) { + SYSCALLS.varargs = varargs; + try { + + var stream = SYSCALLS.getStreamFromFD(fd); + switch (op) { + case 21509: { + if (!stream.tty) return -59; + return 0; + } + case 21505: { + if (!stream.tty) return -59; + if (stream.tty.ops.ioctl_tcgets) { + var termios = stream.tty.ops.ioctl_tcgets(stream); + var argp = syscallGetVarargP(); + HEAP32[((argp)>>2)] = termios.c_iflag || 0; + HEAP32[(((argp)+(4))>>2)] = termios.c_oflag || 0; + HEAP32[(((argp)+(8))>>2)] = termios.c_cflag || 0; + HEAP32[(((argp)+(12))>>2)] = termios.c_lflag || 0; + for (var i = 0; i < 32; i++) { + HEAP8[(argp + i)+(17)] = termios.c_cc[i] || 0; + } + return 0; + } + return 0; + } + case 21510: + case 21511: + case 21512: { + if (!stream.tty) return -59; + return 0; // no-op, not actually adjusting terminal settings + } + case 21506: + case 21507: + case 21508: { + if (!stream.tty) return -59; + if (stream.tty.ops.ioctl_tcsets) { + var argp = syscallGetVarargP(); + var c_iflag = HEAP32[((argp)>>2)]; + var c_oflag = HEAP32[(((argp)+(4))>>2)]; + var c_cflag = HEAP32[(((argp)+(8))>>2)]; + var c_lflag = HEAP32[(((argp)+(12))>>2)]; + var c_cc = [] + for (var i = 0; i < 32; i++) { + c_cc.push(HEAP8[(argp + i)+(17)]); + } + return stream.tty.ops.ioctl_tcsets(stream.tty, op, { c_iflag, c_oflag, c_cflag, c_lflag, c_cc }); + } + return 0; // no-op, not actually adjusting terminal settings + } + case 21519: { + if (!stream.tty) return -59; + var argp = syscallGetVarargP(); + HEAP32[((argp)>>2)] = 0; + return 0; + } + case 21520: { + if (!stream.tty) return -59; + return -28; // not supported + } + case 21537: + case 21531: { + var argp = syscallGetVarargP(); + return FS.ioctl(stream, op, argp); + } + case 21523: { + // TODO: in theory we should write to the winsize struct that gets + // passed in, but for now musl doesn't read anything on it + if (!stream.tty) return -59; + if (stream.tty.ops.ioctl_tiocgwinsz) { + var winsize = stream.tty.ops.ioctl_tiocgwinsz(stream.tty); + var argp = syscallGetVarargP(); + HEAP16[((argp)>>1)] = winsize[0]; + HEAP16[(((argp)+(2))>>1)] = winsize[1]; + } + return 0; + } + case 21524: { + // TODO: technically, this ioctl call should change the window size. + // but, since emscripten doesn't have any concept of a terminal window + // yet, we'll just silently throw it away as we do TIOCGWINSZ + if (!stream.tty) return -59; + return 0; + } + case 21515: { + if (!stream.tty) return -59; + return 0; + } + default: return -28; // not supported + } + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_lstat64(path, buf) { + try { + + path = SYSCALLS.getStr(path); + return SYSCALLS.writeStat(buf, FS.lstat(path)); + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_newfstatat(dirfd, path, buf, flags) { + try { + + path = SYSCALLS.getStr(path); + var nofollow = flags & 256; + var allowEmpty = flags & 4096; + flags = flags & (~6400); + assert(!flags, `unknown flags in __syscall_newfstatat: ${flags}`); + path = SYSCALLS.calculateAt(dirfd, path, allowEmpty); + return SYSCALLS.writeStat(buf, nofollow ? FS.lstat(path) : FS.stat(path)); + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + + function ___syscall_openat(dirfd, path, flags, varargs) { + SYSCALLS.varargs = varargs; + try { + + path = SYSCALLS.getStr(path); + path = SYSCALLS.calculateAt(dirfd, path); + var mode = varargs ? syscallGetVarargI() : 0; + if (flags & 64) { + mode &= ~SYSCALLS.currentUmask; + } + return FS.open(path, flags, mode).fd; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_rmdir(path) { + try { + + path = SYSCALLS.getStr(path); + FS.rmdir(path); + return 0; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_stat64(path, buf) { + try { + + path = SYSCALLS.getStr(path); + return SYSCALLS.writeStat(buf, FS.stat(path)); + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + function ___syscall_unlinkat(dirfd, path, flags) { + try { + + path = SYSCALLS.getStr(path); + path = SYSCALLS.calculateAt(dirfd, path); + if (!flags) { + FS.unlink(path); + } else if (flags === 512) { + FS.rmdir(path); + } else { + return -28; + } + return 0; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return -e.errno; + } + } + + + var __abort_js = () => + abort('native code called abort()'); + + + + var __emscripten_fs_load_embedded_files = (ptr) => { + do { + var name_addr = HEAPU32[((ptr)>>2)]; + ptr += 4; + var len = HEAPU32[((ptr)>>2)]; + ptr += 4; + var content = HEAPU32[((ptr)>>2)]; + ptr += 4; + var name = UTF8ToString(name_addr) + FS.createPath('/', PATH.dirname(name), true, true); + // canOwn this data in the filesystem, it is a slice of wasm memory that will never change + FS.createDataFile(name, null, HEAP8.subarray(content, content + len), true, true, /*canOwn=*/true); + } while (HEAPU32[((ptr)>>2)]); + }; + + var _emscripten_get_now = () => performance.now(); + + var _emscripten_date_now = () => Date.now(); + + var nowIsMonotonic = 1; + + var checkWasiClock = (clock_id) => clock_id >= 0 && clock_id <= 3; + + var INT53_MAX = 9007199254740992; + + var INT53_MIN = -9007199254740992; + var bigintToI53Checked = (num) => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num); + function _clock_time_get(clk_id, ignored_precision, ptime) { + ignored_precision = bigintToI53Checked(ignored_precision); + + + if (!checkWasiClock(clk_id)) { + return 28; + } + var now; + // all wasi clocks but realtime are monotonic + if (clk_id === 0) { + now = _emscripten_date_now(); + } else if (nowIsMonotonic) { + now = _emscripten_get_now(); + } else { + return 52; + } + // "now" is in ms, and wasi times are in ns. + var nsec = Math.round(now * 1000 * 1000); + HEAP64[((ptime)>>3)] = BigInt(nsec); + return 0; + ; + } + + var readEmAsmArgsArray = []; + var readEmAsmArgs = (sigPtr, buf) => { + // Nobody should have mutated _readEmAsmArgsArray underneath us to be something else than an array. + assert(Array.isArray(readEmAsmArgsArray)); + // The input buffer is allocated on the stack, so it must be stack-aligned. + assert(buf % 16 == 0); + readEmAsmArgsArray.length = 0; + var ch; + // Most arguments are i32s, so shift the buffer pointer so it is a plain + // index into HEAP32. + while (ch = HEAPU8[sigPtr++]) { + var chr = String.fromCharCode(ch); + var validChars = ['d', 'f', 'i', 'p']; + // In WASM_BIGINT mode we support passing i64 values as bigint. + validChars.push('j'); + assert(validChars.includes(chr), `Invalid character ${ch}("${chr}") in readEmAsmArgs! Use only [${validChars}], and do not specify "v" for void return argument.`); + // Floats are always passed as doubles, so all types except for 'i' + // are 8 bytes and require alignment. + var wide = (ch != 105); + wide &= (ch != 112); + buf += wide && (buf % 8) ? 4 : 0; + readEmAsmArgsArray.push( + // Special case for pointers under wasm64 or CAN_ADDRESS_2GB mode. + ch == 112 ? HEAPU32[((buf)>>2)] : + ch == 106 ? HEAP64[((buf)>>3)] : + ch == 105 ? + HEAP32[((buf)>>2)] : + HEAPF64[((buf)>>3)] + ); + buf += wide ? 8 : 4; + } + return readEmAsmArgsArray; + }; + var runMainThreadEmAsm = (emAsmAddr, sigPtr, argbuf, sync) => { + var args = readEmAsmArgs(sigPtr, argbuf); + assert(ASM_CONSTS.hasOwnProperty(emAsmAddr), `No EM_ASM constant found at address ${emAsmAddr}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`); + return ASM_CONSTS[emAsmAddr](...args); + }; + var _emscripten_asm_const_int_sync_on_main_thread = (emAsmAddr, sigPtr, argbuf) => runMainThreadEmAsm(emAsmAddr, sigPtr, argbuf, 1); + var _emscripten_asm_const_double_sync_on_main_thread = _emscripten_asm_const_int_sync_on_main_thread; + + var runEmAsmFunction = (code, sigPtr, argbuf) => { + var args = readEmAsmArgs(sigPtr, argbuf); + assert(ASM_CONSTS.hasOwnProperty(code), `No EM_ASM constant found at address ${code}. The loaded WebAssembly file is likely out of sync with the generated JavaScript.`); + return ASM_CONSTS[code](...args); + }; + var _emscripten_asm_const_int = (code, sigPtr, argbuf) => { + return runEmAsmFunction(code, sigPtr, argbuf); + }; + + + var _emscripten_asm_const_ptr_sync_on_main_thread = (emAsmAddr, sigPtr, argbuf) => runMainThreadEmAsm(emAsmAddr, sigPtr, argbuf, 1); + + + + var runtimeKeepaliveCounter = 0; + var runtimeKeepalivePush = () => { + runtimeKeepaliveCounter += 1; + }; + var _emscripten_set_main_loop_timing = (mode, value) => { + MainLoop.timingMode = mode; + MainLoop.timingValue = value; + + if (!MainLoop.func) { + err('emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.'); + return 1; // Return non-zero on failure, can't set timing mode when there is no main loop. + } + + if (!MainLoop.running) { + runtimeKeepalivePush(); + MainLoop.running = true; + } + if (mode == 0) { + MainLoop.scheduler = function MainLoop_scheduler_setTimeout() { + var timeUntilNextTick = Math.max(0, MainLoop.tickStartTime + value - _emscripten_get_now())|0; + setTimeout(MainLoop.runner, timeUntilNextTick); // doing this each time means that on exception, we stop + }; + } else if (mode == 1) { + MainLoop.scheduler = function MainLoop_scheduler_rAF() { + MainLoop.requestAnimationFrame(MainLoop.runner); + }; + } else { + assert(mode == 2); + if (!MainLoop.setImmediate) { + if (globalThis.scheduler) { + // Some modern browsers implement scheduler.postTask, but not all. + MainLoop.setImmediate = scheduler.postTask.bind(scheduler); + } else if (globalThis.setImmediate) { + MainLoop.setImmediate = setImmediate; + } else { + // Emulate setImmediate. (note: not a complete polyfill, we don't emulate clearImmediate() to keep code size to minimum, since not needed) + var setImmediates = []; + var emscriptenMainLoopMessageId = 'setimmediate'; + /** @param {Event} event */ + var MainLoop_setImmediate_messageHandler = (event) => { + if (event.data === emscriptenMainLoopMessageId) { + event.stopPropagation(); + setImmediates.shift()(); + } + }; + addEventListener("message", MainLoop_setImmediate_messageHandler, true); + MainLoop.setImmediate = /** @type{function(function(): ?, ...?): number} */((func) => { + setImmediates.push(func); + if (ENVIRONMENT_IS_WORKER) { + // The postMessge API in a Worker, sends message to the main + // thread and does not support the `targetOrigin` (*) argument. + postMessage(emscriptenMainLoopMessageId); + } else { + postMessage(emscriptenMainLoopMessageId, '*'); + } + }); + } + } + MainLoop.scheduler = function MainLoop_scheduler_setImmediate() { + MainLoop.setImmediate(MainLoop.runner); + }; + } + return 0; + }; + + + + var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0; + var _proc_exit = (code) => { + EXITSTATUS = code; + if (!keepRuntimeAlive()) { + Module['onExit']?.(code); + ABORT = true; + } + quit_(code, new ExitStatus(code)); + }; + + + /** @param {boolean|number=} implicit */ + var exitJS = (status, implicit) => { + EXITSTATUS = status; + + if (!keepRuntimeAlive()) { + exitRuntime(); + } + + // if exit() was called explicitly, warn the user if the runtime isn't actually being shut down + if (keepRuntimeAlive() && !implicit) { + var msg = `program exited (with status: ${status}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`; + err(msg); + } + + _proc_exit(status); + }; + var _exit = exitJS; + + var handleException = (e) => { + // Certain exception types we do not treat as errors since they are used for + // internal control flow. + // 1. ExitStatus, which is thrown by exit() + // 2. "unwind", which is thrown by emscripten_unwind_to_js_event_loop() and others + // that wish to return to JS event loop. + if (e instanceof ExitStatus || e == 'unwind') { + return EXITSTATUS; + } + checkStackCookie(); + if (e instanceof WebAssembly.RuntimeError) { + if (_emscripten_stack_get_current() <= 0) { + err('Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)'); + } + } + quit_(1, e); + }; + + var maybeExit = () => { + if (runtimeExited) { + return; + } + if (!keepRuntimeAlive()) { + try { + _exit(EXITSTATUS); + } catch (e) { + handleException(e); + } + } + }; + + var runtimeKeepalivePop = () => { + assert(runtimeKeepaliveCounter > 0); + runtimeKeepaliveCounter -= 1; + }; + + /** + * @param {number=} arg + * @param {boolean=} noSetTiming + */ + var setMainLoop = (iterFunc, fps, simulateInfiniteLoop, arg, noSetTiming) => { + assert(!MainLoop.func, 'emscripten_set_main_loop: there can only be one main loop function at once') + MainLoop.func = iterFunc; + MainLoop.arg = arg; + + var thisMainLoopId = MainLoop.currentlyRunningMainloop; + function checkIsRunning() { + if (thisMainLoopId < MainLoop.currentlyRunningMainloop) { + runtimeKeepalivePop(); + maybeExit(); + return false; + } + return true; + } + + // We create the loop runner here but it is not actually running until + // _emscripten_set_main_loop_timing is called (which might happen at a + // later time). This member signifies that the current runner has not + // yet been started so that we can call runtimeKeepalivePush when it + // gets its timing set for the first time. + MainLoop.running = false; + MainLoop.runner = function MainLoop_runner() { + if (ABORT) return; + if (MainLoop.queue.length > 0) { + var start = Date.now(); + var blocker = MainLoop.queue.shift(); + blocker.func(blocker.arg); + if (MainLoop.remainingBlockers) { + var remaining = MainLoop.remainingBlockers; + var next = remaining%1 == 0 ? remaining-1 : Math.floor(remaining); + if (blocker.counted) { + MainLoop.remainingBlockers = next; + } else { + // not counted, but move the progress along a tiny bit + next = next + 0.5; // do not steal all the next one's progress + MainLoop.remainingBlockers = (8*remaining + next)/9; + } + } + MainLoop.updateStatus(); + + // catches pause/resume main loop from blocker execution + if (!checkIsRunning()) return; + + setTimeout(MainLoop.runner, 0); + return; + } + + // catch pauses from non-main loop sources + if (!checkIsRunning()) return; + + // Implement very basic swap interval control + MainLoop.currentFrameNumber = MainLoop.currentFrameNumber + 1 | 0; + if (MainLoop.timingMode == 1 && MainLoop.timingValue > 1 && MainLoop.currentFrameNumber % MainLoop.timingValue != 0) { + // Not the scheduled time to render this frame - skip. + MainLoop.scheduler(); + return; + } else if (MainLoop.timingMode == 0) { + MainLoop.tickStartTime = _emscripten_get_now(); + if (Module['ctx']) { + warnOnce('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!'); + } + } + + MainLoop.runIter(iterFunc); + + // catch pauses from the main loop itself + if (!checkIsRunning()) return; + + MainLoop.scheduler(); + } + + if (!noSetTiming) { + if (fps > 0) { + _emscripten_set_main_loop_timing(0, 1000.0 / fps); + } else { + // Do rAF by rendering each frame (no decimating) + _emscripten_set_main_loop_timing(1, 1); + } + + MainLoop.scheduler(); + } + + if (simulateInfiniteLoop) { + throw 'unwind'; + } + }; + + + var callUserCallback = (func) => { + if (runtimeExited || ABORT) { + err('user callback triggered after runtime exited or application aborted. Ignoring.'); + return; + } + try { + return func(); + } catch (e) { + handleException(e); + } finally { + maybeExit(); + } + }; + + var MainLoop = { + running:false, + scheduler:null, + currentlyRunningMainloop:0, + func:null, + arg:0, + timingMode:0, + timingValue:0, + currentFrameNumber:0, + queue:[], + preMainLoop:[], + postMainLoop:[], + pause() { + MainLoop.scheduler = null; + // Incrementing this signals the previous main loop that it's now become old, and it must return. + MainLoop.currentlyRunningMainloop++; + }, + resume() { + MainLoop.currentlyRunningMainloop++; + var timingMode = MainLoop.timingMode; + var timingValue = MainLoop.timingValue; + var func = MainLoop.func; + MainLoop.func = null; + // do not set timing and call scheduler, we will do it on the next lines + setMainLoop(func, 0, false, MainLoop.arg, true); + _emscripten_set_main_loop_timing(timingMode, timingValue); + MainLoop.scheduler(); + }, + updateStatus() { + if (Module['setStatus']) { + var message = Module['statusMessage'] || 'Please wait...'; + var remaining = MainLoop.remainingBlockers ?? 0; + var expected = MainLoop.expectedBlockers ?? 0; + if (remaining) { + if (remaining < expected) { + Module['setStatus'](`{message} ({expected - remaining}/{expected})`); + } else { + Module['setStatus'](message); + } + } else { + Module['setStatus'](''); + } + } + }, + init() { + Module['preMainLoop'] && MainLoop.preMainLoop.push(Module['preMainLoop']); + Module['postMainLoop'] && MainLoop.postMainLoop.push(Module['postMainLoop']); + }, + runIter(func) { + if (ABORT) return; + for (var pre of MainLoop.preMainLoop) { + if (pre() === false) { + return; // |return false| skips a frame + } + } + callUserCallback(func); + for (var post of MainLoop.postMainLoop) { + post(); + } + checkStackCookie(); + }, + nextRAF:0, + fakeRequestAnimationFrame(func) { + // try to keep 60fps between calls to here + var now = Date.now(); + if (MainLoop.nextRAF === 0) { + MainLoop.nextRAF = now + 1000/60; + } else { + while (now + 2 >= MainLoop.nextRAF) { // fudge a little, to avoid timer jitter causing us to do lots of delay:0 + MainLoop.nextRAF += 1000/60; + } + } + var delay = Math.max(MainLoop.nextRAF - now, 0); + setTimeout(func, delay); + }, + requestAnimationFrame(func) { + if (globalThis.requestAnimationFrame) { + requestAnimationFrame(func); + } else { + MainLoop.fakeRequestAnimationFrame(func); + } + }, + }; + var _emscripten_cancel_main_loop = () => { + MainLoop.pause(); + MainLoop.func = null; + }; + + + var _emscripten_err = (str) => err(UTF8ToString(str)); + + var JSEvents = { + removeAllEventListeners() { + while (JSEvents.eventHandlers.length) { + JSEvents._removeHandler(JSEvents.eventHandlers.length - 1); + } + JSEvents.deferredCalls = []; + }, + registerRemoveEventListeners() { + if (!JSEvents.removeEventListenersRegistered) { + addOnExit(JSEvents.removeAllEventListeners); + JSEvents.removeEventListenersRegistered = true; + } + }, + inEventHandler:0, + deferredCalls:[], + deferCall(targetFunction, precedence, argsList) { + function arraysHaveEqualContent(arrA, arrB) { + if (arrA.length != arrB.length) return false; + + for (var i in arrA) { + if (arrA[i] != arrB[i]) return false; + } + return true; + } + // Test if the given call was already queued, and if so, don't add it again. + for (var call of JSEvents.deferredCalls) { + if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) { + return; + } + } + JSEvents.deferredCalls.push({ + targetFunction, + precedence, + argsList + }); + + JSEvents.deferredCalls.sort((x,y) => x.precedence - y.precedence); + }, + removeDeferredCalls(targetFunction) { + JSEvents.deferredCalls = JSEvents.deferredCalls.filter((call) => call.targetFunction != targetFunction); + }, + canPerformEventHandlerRequests() { + // Browsers that support navigator.userActivation.isActive: https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/isActive + if (navigator.userActivation) { + // Verify against transient activation status from UserActivation API + // whether it is possible to perform a request here without needing to defer. See + // https://developer.mozilla.org/en-US/docs/Web/Security/User_activation#transient_activation + // and https://caniuse.com/mdn-api_useractivation + return navigator.userActivation.isActive; + } + + return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls; + }, + runDeferredCalls() { + if (!JSEvents.canPerformEventHandlerRequests()) { + return; + } + var deferredCalls = JSEvents.deferredCalls; + JSEvents.deferredCalls = []; + for (var call of deferredCalls) { + call.targetFunction(...call.argsList); + } + }, + eventHandlers:[], + removeAllHandlersOnTarget:(target, eventTypeString) => { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == target && + (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + JSEvents._removeHandler(i--); + } + } + }, + _removeHandler(i) { + var h = JSEvents.eventHandlers[i]; + h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture); + JSEvents.eventHandlers.splice(i, 1); + }, + registerOrRemoveHandler(eventHandler) { + if (!eventHandler.target) { + err('registerOrRemoveHandler: the target element for event handler registration does not exist, when processing the following event handler registration:'); + console.dir(eventHandler); + return -4; + } + if (eventHandler.callbackfunc) { + eventHandler.eventListenerFunc = function(event) { + // Increment nesting count for the event handler. + ++JSEvents.inEventHandler; + JSEvents.currentEventHandler = eventHandler; + // Process any old deferred calls the user has placed. + JSEvents.runDeferredCalls(); + // Process the actual event, calls back to user C code handler. + eventHandler.handlerFunc(event); + // Process any new deferred calls that were placed right now from this event handler. + JSEvents.runDeferredCalls(); + // Out of event handler - restore nesting count. + --JSEvents.inEventHandler; + }; + + eventHandler.target.addEventListener(eventHandler.eventTypeString, + eventHandler.eventListenerFunc, + eventHandler.useCapture); + JSEvents.eventHandlers.push(eventHandler); + JSEvents.registerRemoveEventListeners(); + } else { + for (var i = 0; i < JSEvents.eventHandlers.length; ++i) { + if (JSEvents.eventHandlers[i].target == eventHandler.target + && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) { + JSEvents._removeHandler(i--); + } + } + } + return 0; + }, + removeSingleHandler(eventHandler) { + let success = false; + for (let i = 0; i < JSEvents.eventHandlers.length; ++i) { + const handler = JSEvents.eventHandlers[i]; + if (handler.target === eventHandler.target + && handler.eventTypeId === eventHandler.eventTypeId + && handler.callbackfunc === eventHandler.callbackfunc + && handler.userData === eventHandler.userData) { + // in some very rare cases (ex: Safari / fullscreen events), there is more than 1 handler (eventTypeString is different) + JSEvents._removeHandler(i--); + success = true; + } + } + return success ? 0 : -5; + }, + getNodeNameForTarget(target) { + if (target == window) return '#window'; + if (target == screen) return '#screen'; + return target?.nodeName ?? ''; + }, + fullscreenEnabled() { + return document.fullscreenEnabled + // Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitFullscreenEnabled. + // TODO: If Safari at some point ships with unprefixed version, update the version check above. + || document.webkitFullscreenEnabled + ; + }, + }; + + /** @type {Object} */ + var specialHTMLTargets = [0, globalThis.document ?? 0, globalThis.window ?? 0]; + + + var maybeCStringToJsString = (cString) => { + // "cString > 2" checks if the input is a number, and isn't of the special + // values we accept here, EMSCRIPTEN_EVENT_TARGET_* (which map to 0, 1, 2). + // In other words, if cString > 2 then it's a pointer to a valid place in + // memory, and points to a C string. + return cString > 2 ? UTF8ToString(cString) : cString; + }; + + var findEventTarget = (target) => { + target = maybeCStringToJsString(target); + var domElement = specialHTMLTargets[target] || globalThis.document?.querySelector(target); + return domElement; + }; + var findCanvasEventTarget = findEventTarget; + var _emscripten_get_canvas_element_size = (target, width, height) => { + var canvas = findCanvasEventTarget(target); + if (!canvas) return -4; + HEAP32[((width)>>2)] = canvas.width; + HEAP32[((height)>>2)] = canvas.height; + }; + + + + + var stringToUTF8 = (str, outPtr, maxBytesToWrite) => { + assert(typeof maxBytesToWrite == 'number', 'stringToUTF8 requires a third parameter that specifies the length of the output buffer'); + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); + }; + + var stackAlloc = (sz) => __emscripten_stack_alloc(sz); + var stringToUTF8OnStack = (str) => { + var size = lengthBytesUTF8(str) + 1; + var ret = stackAlloc(size); + stringToUTF8(str, ret, size); + return ret; + }; + var getCanvasElementSize = (target) => { + var sp = stackSave(); + var w = stackAlloc(8); + var h = w + 4; + + var targetInt = stringToUTF8OnStack(target.id); + var ret = _emscripten_get_canvas_element_size(targetInt, w, h); + var size = [HEAP32[((w)>>2)], HEAP32[((h)>>2)]]; + stackRestore(sp); + return size; + }; + + var _emscripten_set_canvas_element_size = (target, width, height) => { + var canvas = findCanvasEventTarget(target); + if (!canvas) return -4; + canvas.width = width; + canvas.height = height; + return 0; + }; + + + + var setCanvasElementSize = (target, width, height) => { + if (!target.controlTransferredOffscreen) { + target.width = width; + target.height = height; + } else { + // This function is being called from high-level JavaScript code instead of asm.js/Wasm, + // and it needs to synchronously proxy over to another thread, so marshal the string onto the heap to do the call. + var sp = stackSave(); + var targetInt = stringToUTF8OnStack(target.id); + _emscripten_set_canvas_element_size(targetInt, width, height); + stackRestore(sp); + } + }; + + var currentFullscreenStrategy = { + }; + + var wasmTableMirror = []; + + + var getWasmTableEntry = (funcPtr) => { + var func = wasmTableMirror[funcPtr]; + if (!func) { + /** @suppress {checkTypes} */ + wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr); + } + /** @suppress {checkTypes} */ + assert(wasmTable.get(funcPtr) == func, 'table mirror is out of date'); + return func; + }; + var registerRestoreOldStyle = (canvas) => { + var canvasSize = getCanvasElementSize(canvas); + var oldWidth = canvasSize[0]; + var oldHeight = canvasSize[1]; + var oldCssWidth = canvas.style.width; + var oldCssHeight = canvas.style.height; + var oldBackgroundColor = canvas.style.backgroundColor; // Chrome reads color from here. + var oldDocumentBackgroundColor = document.body.style.backgroundColor; // IE11 reads color from here. + // Firefox always has black background color. + var oldPaddingLeft = canvas.style.paddingLeft; // Chrome, FF, Safari + var oldPaddingRight = canvas.style.paddingRight; + var oldPaddingTop = canvas.style.paddingTop; + var oldPaddingBottom = canvas.style.paddingBottom; + var oldMarginLeft = canvas.style.marginLeft; // IE11 + var oldMarginRight = canvas.style.marginRight; + var oldMarginTop = canvas.style.marginTop; + var oldMarginBottom = canvas.style.marginBottom; + var oldDocumentBodyMargin = document.body.style.margin; + var oldDocumentOverflow = document.documentElement.style.overflow; // Chrome, Firefox + var oldDocumentScroll = document.body.scroll; // IE + var oldImageRendering = canvas.style.imageRendering; + + function restoreOldStyle() { + if (!getFullscreenElement()) { + document.removeEventListener('fullscreenchange', restoreOldStyle); + + // As of Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitfullscreenchange. TODO: revisit this check once Safari ships unprefixed version. + document.removeEventListener('webkitfullscreenchange', restoreOldStyle); + + setCanvasElementSize(canvas, oldWidth, oldHeight); + + canvas.style.width = oldCssWidth; + canvas.style.height = oldCssHeight; + canvas.style.backgroundColor = oldBackgroundColor; // Chrome + // IE11 hack: assigning 'undefined' or an empty string to document.body.style.backgroundColor has no effect, so first assign back the default color + // before setting the undefined value. Setting undefined value is also important, or otherwise we would later treat that as something that the user + // had explicitly set so subsequent fullscreen transitions would not set background color properly. + if (!oldDocumentBackgroundColor) document.body.style.backgroundColor = 'white'; + document.body.style.backgroundColor = oldDocumentBackgroundColor; // IE11 + canvas.style.paddingLeft = oldPaddingLeft; // Chrome, FF, Safari + canvas.style.paddingRight = oldPaddingRight; + canvas.style.paddingTop = oldPaddingTop; + canvas.style.paddingBottom = oldPaddingBottom; + canvas.style.marginLeft = oldMarginLeft; // IE11 + canvas.style.marginRight = oldMarginRight; + canvas.style.marginTop = oldMarginTop; + canvas.style.marginBottom = oldMarginBottom; + document.body.style.margin = oldDocumentBodyMargin; + document.documentElement.style.overflow = oldDocumentOverflow; // Chrome, Firefox + document.body.scroll = oldDocumentScroll; // IE + canvas.style.imageRendering = oldImageRendering; + if (canvas.GLctxObject) canvas.GLctxObject.GLctx.viewport(0, 0, oldWidth, oldHeight); + + if (currentFullscreenStrategy.canvasResizedCallback) { + getWasmTableEntry(currentFullscreenStrategy.canvasResizedCallback)(37, 0, currentFullscreenStrategy.canvasResizedCallbackUserData); + } + } + } + document.addEventListener('fullscreenchange', restoreOldStyle); + // As of Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitfullscreenchange. TODO: revisit this check once Safari ships unprefixed version. + document.addEventListener('webkitfullscreenchange', restoreOldStyle); + return restoreOldStyle; + }; + + + var setLetterbox = (element, topBottom, leftRight) => { + // Cannot use margin to specify letterboxes in FF or Chrome, since those ignore margins in fullscreen mode. + element.style.paddingLeft = element.style.paddingRight = leftRight + 'px'; + element.style.paddingTop = element.style.paddingBottom = topBottom + 'px'; + }; + + + var getBoundingClientRect = (e) => specialHTMLTargets.indexOf(e) < 0 ? e.getBoundingClientRect() : {'left':0,'top':0}; + var JSEvents_resizeCanvasForFullscreen = (target, strategy) => { + var restoreOldStyle = registerRestoreOldStyle(target); + var cssWidth = strategy.softFullscreen ? innerWidth : screen.width; + var cssHeight = strategy.softFullscreen ? innerHeight : screen.height; + var rect = getBoundingClientRect(target); + var windowedCssWidth = rect.width; + var windowedCssHeight = rect.height; + var canvasSize = getCanvasElementSize(target); + var windowedRttWidth = canvasSize[0]; + var windowedRttHeight = canvasSize[1]; + + if (strategy.scaleMode == 3) { + setLetterbox(target, (cssHeight - windowedCssHeight) / 2, (cssWidth - windowedCssWidth) / 2); + cssWidth = windowedCssWidth; + cssHeight = windowedCssHeight; + } else if (strategy.scaleMode == 2) { + if (cssWidth*windowedRttHeight < windowedRttWidth*cssHeight) { + var desiredCssHeight = windowedRttHeight * cssWidth / windowedRttWidth; + setLetterbox(target, (cssHeight - desiredCssHeight) / 2, 0); + cssHeight = desiredCssHeight; + } else { + var desiredCssWidth = windowedRttWidth * cssHeight / windowedRttHeight; + setLetterbox(target, 0, (cssWidth - desiredCssWidth) / 2); + cssWidth = desiredCssWidth; + } + } + + // If we are adding padding, must choose a background color or otherwise Chrome will give the + // padding a default white color. Do it only if user has not customized their own background color. + target.style.backgroundColor ||= 'black'; + // IE11 does the same, but requires the color to be set in the document body. + document.body.style.backgroundColor ||= 'black'; // IE11 + // Firefox always shows black letterboxes independent of style color. + + target.style.width = cssWidth + 'px'; + target.style.height = cssHeight + 'px'; + + if (strategy.filteringMode == 1) { + target.style.imageRendering = 'optimizeSpeed'; + target.style.imageRendering = '-moz-crisp-edges'; + target.style.imageRendering = '-o-crisp-edges'; + target.style.imageRendering = '-webkit-optimize-contrast'; + target.style.imageRendering = 'optimize-contrast'; + target.style.imageRendering = 'crisp-edges'; + target.style.imageRendering = 'pixelated'; + } + + var dpiScale = (strategy.canvasResolutionScaleMode == 2) ? devicePixelRatio : 1; + if (strategy.canvasResolutionScaleMode != 0) { + var newWidth = (cssWidth * dpiScale)|0; + var newHeight = (cssHeight * dpiScale)|0; + setCanvasElementSize(target, newWidth, newHeight); + if (target.GLctxObject) target.GLctxObject.GLctx.viewport(0, 0, newWidth, newHeight); + } + return restoreOldStyle; + }; + + var JSEvents_requestFullscreen = (target, strategy) => { + // EMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT + EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE is a mode where no extra logic is performed to the DOM elements. + if (strategy.scaleMode != 0 || strategy.canvasResolutionScaleMode != 0) { + JSEvents_resizeCanvasForFullscreen(target, strategy); + } + + if (target.requestFullscreen) { + target.requestFullscreen(); + } else if (target.webkitRequestFullscreen) { + target.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } else { + return JSEvents.fullscreenEnabled() ? -3 : -1; + } + + currentFullscreenStrategy = strategy; + + if (strategy.canvasResizedCallback) { + getWasmTableEntry(strategy.canvasResizedCallback)(37, 0, strategy.canvasResizedCallbackUserData); + } + + return 0; + }; + var _emscripten_exit_fullscreen = () => { + if (!JSEvents.fullscreenEnabled()) return -1; + // Make sure no queued up calls will fire after this. + JSEvents.removeDeferredCalls(JSEvents_requestFullscreen); + + var d = specialHTMLTargets[1]; + if (d.exitFullscreen) { + d.fullscreenElement && d.exitFullscreen(); + } else if (d.webkitExitFullscreen) { + d.webkitFullscreenElement && d.webkitExitFullscreen(); + } else { + return -1; + } + + return 0; + }; + + + var requestPointerLock = (target) => { + if (target.requestPointerLock) { + target.requestPointerLock(); + } else { + // document.body is known to accept pointer lock, so use that to differentiate if the user passed a bad element, + // or if the whole browser just doesn't support the feature. + if (document.body.requestPointerLock) { + return -3; + } + return -1; + } + return 0; + }; + var _emscripten_exit_pointerlock = () => { + // Make sure no queued up calls will fire after this. + JSEvents.removeDeferredCalls(requestPointerLock); + if (!document.exitPointerLock) return -1; + document.exitPointerLock(); + return 0; + }; + + var _emscripten_get_device_pixel_ratio = () => { + return globalThis.devicePixelRatio ?? 1.0; + }; + + + var _emscripten_get_element_css_size = (target, width, height) => { + target = findEventTarget(target); + if (!target) return -4; + + var rect = getBoundingClientRect(target); + HEAPF64[((width)>>3)] = rect.width; + HEAPF64[((height)>>3)] = rect.height; + + return 0; + }; + + + + + function getFullscreenElement() { + return document.fullscreenElement || document.mozFullScreenElement || + document.webkitFullscreenElement || document.webkitCurrentFullScreenElement || + document.msFullscreenElement; + } + var fillFullscreenChangeEventData = (eventStruct) => { + var fullscreenElement = getFullscreenElement(); + var isFullscreen = !!fullscreenElement; + // Assigning a boolean to HEAP32 with expected type coercion. + /** @suppress{checkTypes} */ + HEAP8[eventStruct] = isFullscreen; + HEAP8[(eventStruct)+(1)] = JSEvents.fullscreenEnabled(); + // If transitioning to fullscreen, report info about the element that is now fullscreen. + // If transitioning to windowed mode, report info about the element that just was fullscreen. + var reportedElement = isFullscreen ? fullscreenElement : JSEvents.previousFullscreenElement; + var nodeName = JSEvents.getNodeNameForTarget(reportedElement); + var id = reportedElement?.id ?? ''; + stringToUTF8(nodeName, eventStruct + 2, 128); + stringToUTF8(id, eventStruct + 130, 128); + HEAP32[(((eventStruct)+(260))>>2)] = reportedElement?.clientWidth ?? 0; + HEAP32[(((eventStruct)+(264))>>2)] = reportedElement?.clientHeight ?? 0; + HEAP32[(((eventStruct)+(268))>>2)] = screen.width; + HEAP32[(((eventStruct)+(272))>>2)] = screen.height; + if (isFullscreen) { + JSEvents.previousFullscreenElement = fullscreenElement; + } + }; + var _emscripten_get_fullscreen_status = (fullscreenStatus) => { + if (!JSEvents.fullscreenEnabled()) return -1; + fillFullscreenChangeEventData(fullscreenStatus); + return 0; + }; + + + var fillGamepadEventData = (eventStruct, e) => { + HEAPF64[((eventStruct)>>3)] = e.timestamp; + for (var i = 0; i < e.axes.length; ++i) { + HEAPF64[(((eventStruct+i*8)+(16))>>3)] = e.axes[i]; + } + for (var i = 0; i < e.buttons.length; ++i) { + if (typeof e.buttons[i] == 'object') { + HEAPF64[(((eventStruct+i*8)+(528))>>3)] = e.buttons[i].value; + } else { + HEAPF64[(((eventStruct+i*8)+(528))>>3)] = e.buttons[i]; + } + } + for (var i = 0; i < e.buttons.length; ++i) { + if (typeof e.buttons[i] == 'object') { + HEAP8[(eventStruct+i)+(1040)] = e.buttons[i].pressed; + } else { + // Assigning a boolean to HEAP32, that's ok, but Closure would like to warn about it: + /** @suppress {checkTypes} */ + HEAP8[(eventStruct+i)+(1040)] = e.buttons[i] == 1; + } + } + HEAP8[(eventStruct)+(1104)] = e.connected; + HEAP32[(((eventStruct)+(1108))>>2)] = e.index; + HEAP32[(((eventStruct)+(8))>>2)] = e.axes.length; + HEAP32[(((eventStruct)+(12))>>2)] = e.buttons.length; + stringToUTF8(e.id, eventStruct + 1112, 64); + stringToUTF8(e.mapping, eventStruct + 1176, 64); + }; + var _emscripten_get_gamepad_status = (index, gamepadState) => { + assert(JSEvents.lastGamepadState, 'emscripten_get_gamepad_status() called before emscripten_sample_gamepad_data()'); + // INVALID_PARAM is returned on a Gamepad index that never was there. + if (index < 0 || index >= JSEvents.lastGamepadState.length) return -5; + + // NO_DATA is returned on a Gamepad index that was removed. + // For previously disconnected gamepads there should be an empty slot (null/undefined/false) at the index. + // This is because gamepads must keep their original position in the array. + // For example, removing the first of two gamepads produces [null/undefined/false, gamepad]. + if (!JSEvents.lastGamepadState[index]) return -7; + + fillGamepadEventData(gamepadState, JSEvents.lastGamepadState[index]); + return 0; + }; + + var _emscripten_get_main_loop_timing = (mode, value) => { + if (mode) HEAP32[((mode)>>2)] = MainLoop.timingMode; + if (value) HEAP32[((value)>>2)] = MainLoop.timingValue; + }; + + + var _emscripten_get_num_gamepads = () => { + assert(JSEvents.lastGamepadState, 'emscripten_get_num_gamepads() called before emscripten_sample_gamepad_data()'); + // N.B. Do not call emscripten_get_num_gamepads() unless having first called emscripten_sample_gamepad_data(), and that has returned EMSCRIPTEN_RESULT_SUCCESS. + // Otherwise the following line will throw an exception. + return JSEvents.lastGamepadState.length; + }; + + + + + + /** @param {number=} timeout */ + var safeSetTimeout = (func, timeout) => { + runtimeKeepalivePush(); + return setTimeout(() => { + runtimeKeepalivePop(); + callUserCallback(func); + }, timeout); + }; + + + + var Browser = { + useWebGL:false, + isFullscreen:false, + pointerLock:false, + moduleContextCreatedCallbacks:[], + workers:[], + preloadedImages:{ + }, + preloadedAudios:{ + }, + getCanvas:() => Module['canvas'], + init() { + if (Browser.initted) return; + Browser.initted = true; + + // Support for plugins that can process preloaded files. You can add more of these to + // your app by creating and appending to preloadPlugins. + // + // Each plugin is asked if it can handle a file based on the file's name. If it can, + // it is given the file's raw data. When it is done, it calls a callback with the file's + // (possibly modified) data. For example, a plugin might decompress a file, or it + // might create some side data structure for use later (like an Image element, etc.). + + var imagePlugin = {}; + imagePlugin['canHandle'] = (name) => { + return !Module['noImageDecoding'] && /\.(jpg|jpeg|png|bmp|webp)$/i.test(name); + }; + imagePlugin['handle'] = async (byteArray, name) => { + var b = new Blob([byteArray], { type: Browser.getMimetype(name) }); + if (b.size !== byteArray.length) { // Safari bug #118630 + // Safari's Blob can only take an ArrayBuffer + b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) }); + } + var url = URL.createObjectURL(b); + return new Promise((resolve, reject) => { + var img = new Image(); + img.onload = () => { + assert(img.complete, `Image ${name} could not be decoded`); + var canvas = /** @type {!HTMLCanvasElement} */ (document.createElement('canvas')); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); + Browser.preloadedImages[name] = canvas; + URL.revokeObjectURL(url); + resolve(byteArray); + }; + img.onerror = (event) => { + err(`Image ${url} could not be decoded`); + reject(); + }; + img.src = url; + }); + }; + preloadPlugins.push(imagePlugin); + + var audioPlugin = {}; + audioPlugin['canHandle'] = (name) => { + return !Module['noAudioDecoding'] && name.slice(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 }; + }; + audioPlugin['handle'] = async (byteArray, name) => { + return new Promise((resolve, reject) => { + var done = false; + function finish(audio) { + if (done) return; + done = true; + Browser.preloadedAudios[name] = audio; + resolve(byteArray); + } + var b = new Blob([byteArray], { type: Browser.getMimetype(name) }); + var url = URL.createObjectURL(b); // XXX we never revoke this! + var audio = new Audio(); + audio.addEventListener('canplaythrough', () => finish(audio), false); // use addEventListener due to chromium bug 124926 + audio.onerror = (event) => { + if (done) return; + err(`warning: browser could not fully decode audio ${name}, trying slower base64 approach`); + function encode64(data) { + var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + var PAD = '='; + var ret = ''; + var leftchar = 0; + var leftbits = 0; + for (var i = 0; i < data.length; i++) { + leftchar = (leftchar << 8) | data[i]; + leftbits += 8; + while (leftbits >= 6) { + var curr = (leftchar >> (leftbits-6)) & 0x3f; + leftbits -= 6; + ret += BASE[curr]; + } + } + if (leftbits == 2) { + ret += BASE[(leftchar&3) << 4]; + ret += PAD + PAD; + } else if (leftbits == 4) { + ret += BASE[(leftchar&0xf) << 2]; + ret += PAD; + } + return ret; + } + audio.src = 'data:audio/x-' + name.slice(-3) + ';base64,' + encode64(byteArray); + finish(audio); // we don't wait for confirmation this worked - but it's worth trying + }; + audio.src = url; + // workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror + safeSetTimeout(() => { + finish(audio); // try to use it even though it is not necessarily ready to play + }, 10000); + }); + }; + preloadPlugins.push(audioPlugin); + + // Canvas event setup + + function pointerLockChange() { + var canvas = Browser.getCanvas(); + Browser.pointerLock = document.pointerLockElement === canvas; + } + var canvas = Browser.getCanvas(); + if (canvas) { + // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module + // Module['forcedAspectRatio'] = 4 / 3; + + document.addEventListener('pointerlockchange', pointerLockChange, false); + + if (Module['elementPointerLock']) { + canvas.addEventListener("click", (ev) => { + if (!Browser.pointerLock && Browser.getCanvas().requestPointerLock) { + Browser.getCanvas().requestPointerLock(); + ev.preventDefault(); + } + }, false); + } + } + }, + createContext(/** @type {HTMLCanvasElement} */ canvas, useWebGL, setInModule, webGLContextAttributes) { + if (useWebGL && Module['ctx'] && canvas == Browser.getCanvas()) return Module['ctx']; // no need to recreate GL context if it's already been created for this canvas. + + var ctx; + var contextHandle; + if (useWebGL) { + // For GLES2/desktop GL compatibility, adjust a few defaults to be different to WebGL defaults, so that they align better with the desktop defaults. + var contextAttributes = { + antialias: false, + alpha: false, + majorVersion: 1, + }; + + if (webGLContextAttributes) { + for (var attribute in webGLContextAttributes) { + contextAttributes[attribute] = webGLContextAttributes[attribute]; + } + } + + // This check of existence of GL is here to satisfy Closure compiler, which yells if variable GL is referenced below but GL object is not + // actually compiled in because application is not doing any GL operations. TODO: Ideally if GL is not being used, this function + // Browser.createContext() should not even be emitted. + if (typeof GL != 'undefined') { + contextHandle = GL.createContext(canvas, contextAttributes); + if (contextHandle) { + ctx = GL.getContext(contextHandle).GLctx; + } + } + } else { + ctx = canvas.getContext('2d'); + } + + if (!ctx) return null; + + if (setInModule) { + if (!useWebGL) assert(typeof GLctx == 'undefined', 'cannot set in module if GLctx is used, but we are a non-GL context that would replace it'); + Module['ctx'] = ctx; + if (useWebGL) GL.makeContextCurrent(contextHandle); + Browser.useWebGL = useWebGL; + Browser.moduleContextCreatedCallbacks.forEach((callback) => callback()); + Browser.init(); + } + return ctx; + }, + fullscreenHandlersInstalled:false, + lockPointer:undefined, + resizeCanvas:undefined, + requestFullscreen(lockPointer, resizeCanvas) { + Browser.lockPointer = lockPointer; + Browser.resizeCanvas = resizeCanvas; + if (typeof Browser.lockPointer == 'undefined') Browser.lockPointer = true; + if (typeof Browser.resizeCanvas == 'undefined') Browser.resizeCanvas = false; + + var canvas = Browser.getCanvas(); + function fullscreenChange() { + Browser.isFullscreen = false; + var canvasContainer = canvas.parentNode; + if (getFullscreenElement() === canvasContainer) { + canvas.exitFullscreen = Browser.exitFullscreen; + if (Browser.lockPointer) canvas.requestPointerLock(); + Browser.isFullscreen = true; + if (Browser.resizeCanvas) { + Browser.setFullscreenCanvasSize(); + } else { + Browser.updateCanvasDimensions(canvas); + } + } else { + // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen + canvasContainer.parentNode.insertBefore(canvas, canvasContainer); + canvasContainer.parentNode.removeChild(canvasContainer); + + if (Browser.resizeCanvas) { + Browser.setWindowedCanvasSize(); + } else { + Browser.updateCanvasDimensions(canvas); + } + } + Module['onFullScreen']?.(Browser.isFullscreen); + Module['onFullscreen']?.(Browser.isFullscreen); + } + + if (!Browser.fullscreenHandlersInstalled) { + Browser.fullscreenHandlersInstalled = true; + document.addEventListener('fullscreenchange', fullscreenChange, false); + document.addEventListener('mozfullscreenchange', fullscreenChange, false); + document.addEventListener('webkitfullscreenchange', fullscreenChange, false); + document.addEventListener('MSFullscreenChange', fullscreenChange, false); + } + + // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root + var canvasContainer = document.createElement("div"); + canvas.parentNode.insertBefore(canvasContainer, canvas); + canvasContainer.appendChild(canvas); + + // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size) + canvasContainer.requestFullscreen = canvasContainer['requestFullscreen'] || + canvasContainer['mozRequestFullScreen'] || + canvasContainer['msRequestFullscreen'] || + (canvasContainer['webkitRequestFullscreen'] ? () => canvasContainer['webkitRequestFullscreen'](Element['ALLOW_KEYBOARD_INPUT']) : null) || + (canvasContainer['webkitRequestFullScreen'] ? () => canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) : null); + + canvasContainer.requestFullscreen(); + }, + requestFullScreen() { + abort('Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)'); + }, + exitFullscreen() { + // This is workaround for chrome. Trying to exit from fullscreen + // not in fullscreen state will cause "TypeError: Document not active" + // in chrome. See https://github.com/emscripten-core/emscripten/pull/8236 + if (!Browser.isFullscreen) { + return false; + } + + var CFS = document['exitFullscreen'] || + document['cancelFullScreen'] || + document['mozCancelFullScreen'] || + document['msExitFullscreen'] || + document['webkitCancelFullScreen'] || + (() => {}); + CFS.apply(document, []); + return true; + }, + safeSetTimeout(func, timeout) { + // Legacy function, this is used by the SDL2 port so we need to keep it + // around at least until that is updated. + // See https://github.com/libsdl-org/SDL/pull/6304 + return safeSetTimeout(func, timeout); + }, + getMimetype(name) { + return { + 'jpg': 'image/jpeg', + 'jpeg': 'image/jpeg', + 'png': 'image/png', + 'bmp': 'image/bmp', + 'ogg': 'audio/ogg', + 'wav': 'audio/wav', + 'mp3': 'audio/mpeg' + }[name.slice(name.lastIndexOf('.')+1)]; + }, + getUserMedia(func) { + window.getUserMedia ||= navigator['getUserMedia'] || + navigator['mozGetUserMedia']; + window.getUserMedia(func); + }, + getMovementX(event) { + return event['movementX'] || + event['mozMovementX'] || + event['webkitMovementX'] || + 0; + }, + getMovementY(event) { + return event['movementY'] || + event['mozMovementY'] || + event['webkitMovementY'] || + 0; + }, + getMouseWheelDelta(event) { + var delta = 0; + switch (event.type) { + case 'DOMMouseScroll': + // 3 lines make up a step + delta = event.detail / 3; + break; + case 'mousewheel': + // 120 units make up a step + delta = event.wheelDelta / 120; + break; + case 'wheel': + delta = event.deltaY + switch (event.deltaMode) { + case 0: + // DOM_DELTA_PIXEL: 100 pixels make up a step + delta /= 100; + break; + case 1: + // DOM_DELTA_LINE: 3 lines make up a step + delta /= 3; + break; + case 2: + // DOM_DELTA_PAGE: A page makes up 80 steps + delta *= 80; + break; + default: + abort('unrecognized mouse wheel delta mode: ' + event.deltaMode); + } + break; + default: + abort('unrecognized mouse wheel event: ' + event.type); + } + return delta; + }, + mouseX:0, + mouseY:0, + mouseMovementX:0, + mouseMovementY:0, + touches:{ + }, + lastTouches:{ + }, + calculateMouseCoords(pageX, pageY) { + // Calculate the movement based on the changes + // in the coordinates. + var canvas = Browser.getCanvas(); + var rect = canvas.getBoundingClientRect(); + + var adjustedX = pageX - (window.scrollX + rect.left); + var adjustedY = pageY - (window.scrollY + rect.top); + + // the canvas might be CSS-scaled compared to its backbuffer; + // SDL-using content will want mouse coordinates in terms + // of backbuffer units. + adjustedX = adjustedX * (canvas.width / rect.width); + adjustedY = adjustedY * (canvas.height / rect.height); + + return { x: adjustedX, y: adjustedY }; + }, + setMouseCoords(pageX, pageY) { + const {x, y} = Browser.calculateMouseCoords(pageX, pageY); + Browser.mouseMovementX = x - Browser.mouseX; + Browser.mouseMovementY = y - Browser.mouseY; + Browser.mouseX = x; + Browser.mouseY = y; + }, + calculateMouseEvent(event) { // event should be mousemove, mousedown or mouseup + if (Browser.pointerLock) { + // When the pointer is locked, calculate the coordinates + // based on the movement of the mouse. + // Workaround for Firefox bug 764498 + if (event.type != 'mousemove' && + ('mozMovementX' in event)) { + Browser.mouseMovementX = Browser.mouseMovementY = 0; + } else { + Browser.mouseMovementX = Browser.getMovementX(event); + Browser.mouseMovementY = Browser.getMovementY(event); + } + + // add the mouse delta to the current absolute mouse position + Browser.mouseX += Browser.mouseMovementX; + Browser.mouseY += Browser.mouseMovementY; + } else { + if (event.type === 'touchstart' || event.type === 'touchend' || event.type === 'touchmove') { + var touch = event.touch; + if (touch === undefined) { + return; // the "touch" property is only defined in SDL + + } + var coords = Browser.calculateMouseCoords(touch.pageX, touch.pageY); + + if (event.type === 'touchstart') { + Browser.lastTouches[touch.identifier] = coords; + Browser.touches[touch.identifier] = coords; + } else if (event.type === 'touchend' || event.type === 'touchmove') { + var last = Browser.touches[touch.identifier]; + last ||= coords; + Browser.lastTouches[touch.identifier] = last; + Browser.touches[touch.identifier] = coords; + } + return; + } + + Browser.setMouseCoords(event.pageX, event.pageY); + } + }, + resizeListeners:[], + updateResizeListeners() { + var canvas = Browser.getCanvas(); + Browser.resizeListeners.forEach((listener) => listener(canvas.width, canvas.height)); + }, + setCanvasSize(width, height, noUpdates) { + var canvas = Browser.getCanvas(); + Browser.updateCanvasDimensions(canvas, width, height); + if (!noUpdates) Browser.updateResizeListeners(); + }, + windowedWidth:0, + windowedHeight:0, + setFullscreenCanvasSize() { + // check if SDL is available + if (typeof SDL != "undefined") { + var flags = HEAPU32[((SDL.screen)>>2)]; + flags = flags | 0x00800000; // set SDL_FULLSCREEN flag + HEAP32[((SDL.screen)>>2)] = flags; + } + Browser.updateCanvasDimensions(Browser.getCanvas()); + Browser.updateResizeListeners(); + }, + setWindowedCanvasSize() { + // check if SDL is available + if (typeof SDL != "undefined") { + var flags = HEAPU32[((SDL.screen)>>2)]; + flags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag + HEAP32[((SDL.screen)>>2)] = flags; + } + Browser.updateCanvasDimensions(Browser.getCanvas()); + Browser.updateResizeListeners(); + }, + updateCanvasDimensions(canvas, wNative, hNative) { + if (wNative && hNative) { + canvas.widthNative = wNative; + canvas.heightNative = hNative; + } else { + wNative = canvas.widthNative; + hNative = canvas.heightNative; + } + var w = wNative; + var h = hNative; + if (Module['forcedAspectRatio'] > 0) { + if (w/h < Module['forcedAspectRatio']) { + w = Math.round(h * Module['forcedAspectRatio']); + } else { + h = Math.round(w / Module['forcedAspectRatio']); + } + } + if ((getFullscreenElement() === canvas.parentNode) && (typeof screen != 'undefined')) { + var factor = Math.min(screen.width / w, screen.height / h); + w = Math.round(w * factor); + h = Math.round(h * factor); + } + if (Browser.resizeCanvas) { + if (canvas.width != w) canvas.width = w; + if (canvas.height != h) canvas.height = h; + if (typeof canvas.style != 'undefined') { + canvas.style.removeProperty( "width"); + canvas.style.removeProperty("height"); + } + } else { + if (canvas.width != wNative) canvas.width = wNative; + if (canvas.height != hNative) canvas.height = hNative; + if (typeof canvas.style != 'undefined') { + if (w != wNative || h != hNative) { + canvas.style.setProperty( "width", w + "px", "important"); + canvas.style.setProperty("height", h + "px", "important"); + } else { + canvas.style.removeProperty( "width"); + canvas.style.removeProperty("height"); + } + } + } + }, + }; + var _emscripten_get_screen_size = (width, height) => { + HEAP32[((width)>>2)] = screen.width; + HEAP32[((height)>>2)] = screen.height; + }; + + var GLctx; + + var webgl_enable_ANGLE_instanced_arrays = (ctx) => { + // Extension available in WebGL 1 from Firefox 26 and Google Chrome 30 onwards. Core feature in WebGL 2. + var ext = ctx.getExtension('ANGLE_instanced_arrays'); + // Because this extension is a core function in WebGL 2, assign the extension entry points in place of + // where the core functions will reside in WebGL 2. This way the calling code can call these without + // having to dynamically branch depending if running against WebGL 1 or WebGL 2. + if (ext) { + ctx['vertexAttribDivisor'] = (index, divisor) => ext['vertexAttribDivisorANGLE'](index, divisor); + ctx['drawArraysInstanced'] = (mode, first, count, primcount) => ext['drawArraysInstancedANGLE'](mode, first, count, primcount); + ctx['drawElementsInstanced'] = (mode, count, type, indices, primcount) => ext['drawElementsInstancedANGLE'](mode, count, type, indices, primcount); + return 1; + } + }; + + var webgl_enable_OES_vertex_array_object = (ctx) => { + // Extension available in WebGL 1 from Firefox 25 and WebKit 536.28/desktop Safari 6.0.3 onwards. Core feature in WebGL 2. + var ext = ctx.getExtension('OES_vertex_array_object'); + if (ext) { + ctx['createVertexArray'] = () => ext['createVertexArrayOES'](); + ctx['deleteVertexArray'] = (vao) => ext['deleteVertexArrayOES'](vao); + ctx['bindVertexArray'] = (vao) => ext['bindVertexArrayOES'](vao); + ctx['isVertexArray'] = (vao) => ext['isVertexArrayOES'](vao); + return 1; + } + }; + + var webgl_enable_WEBGL_draw_buffers = (ctx) => { + // Extension available in WebGL 1 from Firefox 28 onwards. Core feature in WebGL 2. + var ext = ctx.getExtension('WEBGL_draw_buffers'); + if (ext) { + ctx['drawBuffers'] = (n, bufs) => ext['drawBuffersWEBGL'](n, bufs); + return 1; + } + }; + + var webgl_enable_EXT_polygon_offset_clamp = (ctx) => + !!(ctx.extPolygonOffsetClamp = ctx.getExtension('EXT_polygon_offset_clamp')); + + var webgl_enable_EXT_clip_control = (ctx) => + !!(ctx.extClipControl = ctx.getExtension('EXT_clip_control')); + + var webgl_enable_WEBGL_polygon_mode = (ctx) => + !!(ctx.webglPolygonMode = ctx.getExtension('WEBGL_polygon_mode')); + + var webgl_enable_WEBGL_multi_draw = (ctx) => + // Closure is expected to be allowed to minify the '.multiDrawWebgl' property, so not accessing it quoted. + !!(ctx.multiDrawWebgl = ctx.getExtension('WEBGL_multi_draw')); + + var getEmscriptenSupportedExtensions = (ctx) => { + // Restrict the list of advertised extensions to those that we actually + // support. + var supportedExtensions = [ + // WebGL 1 extensions + 'ANGLE_instanced_arrays', + 'EXT_blend_minmax', + 'EXT_disjoint_timer_query', + 'EXT_frag_depth', + 'EXT_shader_texture_lod', + 'EXT_sRGB', + 'OES_element_index_uint', + 'OES_fbo_render_mipmap', + 'OES_standard_derivatives', + 'OES_texture_float', + 'OES_texture_half_float', + 'OES_texture_half_float_linear', + 'OES_vertex_array_object', + 'WEBGL_color_buffer_float', + 'WEBGL_depth_texture', + 'WEBGL_draw_buffers', + // WebGL 1 and WebGL 2 extensions + 'EXT_clip_control', + 'EXT_color_buffer_half_float', + 'EXT_depth_clamp', + 'EXT_float_blend', + 'EXT_polygon_offset_clamp', + 'EXT_texture_compression_bptc', + 'EXT_texture_compression_rgtc', + 'EXT_texture_filter_anisotropic', + 'KHR_parallel_shader_compile', + 'OES_texture_float_linear', + 'WEBGL_blend_func_extended', + 'WEBGL_compressed_texture_astc', + 'WEBGL_compressed_texture_etc', + 'WEBGL_compressed_texture_etc1', + 'WEBGL_compressed_texture_s3tc', + 'WEBGL_compressed_texture_s3tc_srgb', + 'WEBGL_debug_renderer_info', + 'WEBGL_debug_shaders', + 'WEBGL_lose_context', + 'WEBGL_multi_draw', + 'WEBGL_polygon_mode' + ]; + // .getSupportedExtensions() can return null if context is lost, so coerce to empty array. + return ctx.getSupportedExtensions()?.filter(ext => supportedExtensions.includes(ext)) ?? []; + }; + + + var GL = { + counter:1, + buffers:[], + programs:[], + framebuffers:[], + renderbuffers:[], + textures:[], + shaders:[], + vaos:[], + contexts:[], + offscreenCanvases:{ + }, + queries:[], + stringCache:{ + }, + unpackAlignment:4, + unpackRowLength:0, + recordError:(errorCode) => { + if (!GL.lastError) { + GL.lastError = errorCode; + } + }, + getNewId:(table) => { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null; + } + return ret; + }, + genObject:(n, buffers, createFunction, objectTable + ) => { + for (var i = 0; i < n; i++) { + var buffer = GLctx[createFunction](); + var id = buffer && GL.getNewId(objectTable); + if (buffer) { + buffer.name = id; + objectTable[id] = buffer; + } else { + GL.recordError(0x502 /* GL_INVALID_OPERATION */); + } + HEAP32[(((buffers)+(i*4))>>2)] = id; + } + }, + getSource:(shader, count, string, length) => { + var source = ''; + for (var i = 0; i < count; ++i) { + var len = length ? HEAPU32[(((length)+(i*4))>>2)] : undefined; + source += UTF8ToString(HEAPU32[(((string)+(i*4))>>2)], len); + } + return source; + }, + createContext:(/** @type {HTMLCanvasElement} */ canvas, webGLContextAttributes) => { + + // BUG: Workaround Safari WebGL issue: After successfully acquiring WebGL + // context on a canvas, calling .getContext() will always return that + // context independent of which 'webgl' or 'webgl2' + // context version was passed. See: + // https://webkit.org/b/222758 + // and: + // https://github.com/emscripten-core/emscripten/issues/13295. + // TODO: Once the bug is fixed and shipped in Safari, adjust the Safari + // version field in above check. + if (!canvas.getContextSafariWebGL2Fixed) { + canvas.getContextSafariWebGL2Fixed = canvas.getContext; + /** @type {function(this:HTMLCanvasElement, string, (Object|null)=): (Object|null)} */ + function fixedGetContext(ver, attrs) { + var gl = canvas.getContextSafariWebGL2Fixed(ver, attrs); + return ((ver == 'webgl') == (gl instanceof WebGLRenderingContext)) ? gl : null; + } + canvas.getContext = fixedGetContext; + } + + var ctx = + canvas.getContext("webgl", webGLContextAttributes); + + if (!ctx) return 0; + + var handle = GL.registerContext(ctx, webGLContextAttributes); + + return handle; + }, + registerContext:(ctx, webGLContextAttributes) => { + // without pthreads a context is just an integer ID + var handle = GL.getNewId(GL.contexts); + + var context = { + handle, + attributes: webGLContextAttributes, + version: webGLContextAttributes.majorVersion, + GLctx: ctx + }; + + // Store the created context object so that we can access the context + // given a canvas without having to pass the parameters again. + if (ctx.canvas) ctx.canvas.GLctxObject = context; + GL.contexts[handle] = context; + if (typeof webGLContextAttributes.enableExtensionsByDefault == 'undefined' || webGLContextAttributes.enableExtensionsByDefault) { + GL.initExtensions(context); + } + + return handle; + }, + makeContextCurrent:(contextHandle) => { + + // Active Emscripten GL layer context object. + GL.currentContext = GL.contexts[contextHandle]; + // Active WebGL context object. + Module['ctx'] = GLctx = GL.currentContext?.GLctx; + return !(contextHandle && !GLctx); + }, + getContext:(contextHandle) => { + return GL.contexts[contextHandle]; + }, + deleteContext:(contextHandle) => { + if (GL.currentContext === GL.contexts[contextHandle]) { + GL.currentContext = null; + } + if (typeof JSEvents == 'object') { + // Release all JS event handlers on the DOM element that the GL context is + // associated with since the context is now deleted. + JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); + } + // Make sure the canvas object no longer refers to the context object so + // there are no GC surprises. + if (GL.contexts[contextHandle]?.GLctx.canvas) { + GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; + } + GL.contexts[contextHandle] = null; + }, + initExtensions:(context) => { + // If this function is called without a specific context object, init the + // extensions of the currently active context. + context ||= GL.currentContext; + + if (context.initExtensionsDone) return; + context.initExtensionsDone = true; + + var GLctx = context.GLctx; + + // Detect the presence of a few extensions manually, since the GL interop + // layer itself will need to know if they exist. + + // Extensions that are available in both WebGL 1 and WebGL 2 + webgl_enable_WEBGL_multi_draw(GLctx); + webgl_enable_EXT_polygon_offset_clamp(GLctx); + webgl_enable_EXT_clip_control(GLctx); + webgl_enable_WEBGL_polygon_mode(GLctx); + // Extensions that are only available in WebGL 1 (the calls will be no-ops + // if called on a WebGL 2 context active) + webgl_enable_ANGLE_instanced_arrays(GLctx); + webgl_enable_OES_vertex_array_object(GLctx); + webgl_enable_WEBGL_draw_buffers(GLctx); + { + GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query"); + } + + for (var ext of getEmscriptenSupportedExtensions(GLctx)) { + // WEBGL_lose_context, WEBGL_debug_renderer_info and WEBGL_debug_shaders + // are not enabled by default. + if (!ext.includes('lose_context') && !ext.includes('debug')) { + // Call .getExtension() to enable that extension permanently. + GLctx.getExtension(ext); + } + } + }, + }; + var _emscripten_glActiveTexture = (x0) => GLctx.activeTexture(x0); + + var _emscripten_glAttachShader = (program, shader) => { + GLctx.attachShader(GL.programs[program], GL.shaders[shader]); + }; + + var _emscripten_glBeginQueryEXT = (target, id) => { + GLctx.disjointTimerQueryExt['beginQueryEXT'](target, GL.queries[id]); + }; + + + var _emscripten_glBindAttribLocation = (program, index, name) => { + GLctx.bindAttribLocation(GL.programs[program], index, UTF8ToString(name)); + }; + + var _emscripten_glBindBuffer = (target, buffer) => { + + GLctx.bindBuffer(target, GL.buffers[buffer]); + }; + + var _emscripten_glBindFramebuffer = (target, framebuffer) => { + + GLctx.bindFramebuffer(target, GL.framebuffers[framebuffer]); + + }; + + var _emscripten_glBindRenderbuffer = (target, renderbuffer) => { + GLctx.bindRenderbuffer(target, GL.renderbuffers[renderbuffer]); + }; + + var _emscripten_glBindTexture = (target, texture) => { + GLctx.bindTexture(target, GL.textures[texture]); + }; + + + var _emscripten_glBindVertexArray = (vao) => { + GLctx.bindVertexArray(GL.vaos[vao]); + }; + var _glBindVertexArray = _emscripten_glBindVertexArray; + var _emscripten_glBindVertexArrayOES = _glBindVertexArray; + + var _emscripten_glBlendColor = (x0, x1, x2, x3) => GLctx.blendColor(x0, x1, x2, x3); + + var _emscripten_glBlendEquation = (x0) => GLctx.blendEquation(x0); + + var _emscripten_glBlendEquationSeparate = (x0, x1) => GLctx.blendEquationSeparate(x0, x1); + + var _emscripten_glBlendFunc = (x0, x1) => GLctx.blendFunc(x0, x1); + + var _emscripten_glBlendFuncSeparate = (x0, x1, x2, x3) => GLctx.blendFuncSeparate(x0, x1, x2, x3); + + var _emscripten_glBufferData = (target, size, data, usage) => { + + // N.b. here first form specifies a heap subarray, second form an integer + // size, so the ?: code here is polymorphic. It is advised to avoid + // randomly mixing both uses in calling code, to avoid any potential JS + // engine JIT issues. + GLctx.bufferData(target, data ? HEAPU8.subarray(data, data+size) : size, usage); + }; + + var webglBufferSubData = (target, offset, size, data, src = HEAPU8) => { + GLctx.bufferSubData(target, offset, src.subarray(data, data + size)); + }; + + var _emscripten_glBufferSubData = (target, offset, size, data) => webglBufferSubData(target, offset, size, data); + + var _emscripten_glCheckFramebufferStatus = (x0) => GLctx.checkFramebufferStatus(x0); + + var _emscripten_glClear = (x0) => GLctx.clear(x0); + + var _emscripten_glClearColor = (x0, x1, x2, x3) => GLctx.clearColor(x0, x1, x2, x3); + + var _emscripten_glClearDepthf = (x0) => GLctx.clearDepth(x0); + + var _emscripten_glClearStencil = (x0) => GLctx.clearStencil(x0); + + var _emscripten_glClipControlEXT = (origin, depth) => { + GLctx.extClipControl['clipControlEXT'](origin, depth); + }; + + var _emscripten_glColorMask = (red, green, blue, alpha) => { + GLctx.colorMask(!!red, !!green, !!blue, !!alpha); + }; + + var _emscripten_glCompileShader = (shader) => { + GLctx.compileShader(GL.shaders[shader]); + }; + + var _emscripten_glCompressedTexImage2D = (target, level, internalFormat, width, height, border, imageSize, data) => { + // `data` may be null here, which means "allocate uninitialized space but + // don't upload" in GLES parlance, but `compressedTexImage2D` requires the + // final data parameter, so we simply pass a heap view starting at zero + // effectively uploading whatever happens to be near address zero. See + // https://github.com/emscripten-core/emscripten/issues/19300. + GLctx.compressedTexImage2D(target, level, internalFormat, width, height, border, HEAPU8.subarray((data), data+imageSize)); + }; + + var _emscripten_glCompressedTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, imageSize, data) => { + GLctx.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, HEAPU8.subarray((data), data+imageSize)); + }; + + var _emscripten_glCopyTexImage2D = (x0, x1, x2, x3, x4, x5, x6, x7) => GLctx.copyTexImage2D(x0, x1, x2, x3, x4, x5, x6, x7); + + var _emscripten_glCopyTexSubImage2D = (x0, x1, x2, x3, x4, x5, x6, x7) => GLctx.copyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7); + + var _emscripten_glCreateProgram = () => { + var id = GL.getNewId(GL.programs); + var program = GLctx.createProgram(); + // Store additional information needed for each shader program: + program.name = id; + // Lazy cache results of + // glGetProgramiv(GL_ACTIVE_UNIFORM_MAX_LENGTH/GL_ACTIVE_ATTRIBUTE_MAX_LENGTH/GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH) + program.maxUniformLength = program.maxAttributeLength = program.maxUniformBlockNameLength = 0; + program.uniformIdCounter = 1; + GL.programs[id] = program; + return id; + }; + + var _emscripten_glCreateShader = (shaderType) => { + var id = GL.getNewId(GL.shaders); + GL.shaders[id] = GLctx.createShader(shaderType); + + return id; + }; + + var _emscripten_glCullFace = (x0) => GLctx.cullFace(x0); + + var _emscripten_glDeleteBuffers = (n, buffers) => { + for (var i = 0; i < n; i++) { + var id = HEAP32[(((buffers)+(i*4))>>2)]; + var buffer = GL.buffers[id]; + + // From spec: "glDeleteBuffers silently ignores 0's and names that do not + // correspond to existing buffer objects." + if (!buffer) continue; + + GLctx.deleteBuffer(buffer); + buffer.name = 0; + GL.buffers[id] = null; + + } + }; + + var _emscripten_glDeleteFramebuffers = (n, framebuffers) => { + for (var i = 0; i < n; ++i) { + var id = HEAP32[(((framebuffers)+(i*4))>>2)]; + var framebuffer = GL.framebuffers[id]; + if (!framebuffer) continue; // GL spec: "glDeleteFramebuffers silently ignores 0s and names that do not correspond to existing framebuffer objects". + GLctx.deleteFramebuffer(framebuffer); + framebuffer.name = 0; + GL.framebuffers[id] = null; + } + }; + + var _emscripten_glDeleteProgram = (id) => { + if (!id) return; + var program = GL.programs[id]; + if (!program) { + // glDeleteProgram actually signals an error when deleting a nonexisting + // object, unlike some other GL delete functions. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + GLctx.deleteProgram(program); + program.name = 0; + GL.programs[id] = null; + }; + + var _emscripten_glDeleteQueriesEXT = (n, ids) => { + for (var i = 0; i < n; i++) { + var id = HEAP32[(((ids)+(i*4))>>2)]; + var query = GL.queries[id]; + if (!query) continue; // GL spec: "unused names in ids are ignored, as is the name zero." + GLctx.disjointTimerQueryExt['deleteQueryEXT'](query); + GL.queries[id] = null; + } + }; + + var _emscripten_glDeleteRenderbuffers = (n, renderbuffers) => { + for (var i = 0; i < n; i++) { + var id = HEAP32[(((renderbuffers)+(i*4))>>2)]; + var renderbuffer = GL.renderbuffers[id]; + if (!renderbuffer) continue; // GL spec: "glDeleteRenderbuffers silently ignores 0s and names that do not correspond to existing renderbuffer objects". + GLctx.deleteRenderbuffer(renderbuffer); + renderbuffer.name = 0; + GL.renderbuffers[id] = null; + } + }; + + var _emscripten_glDeleteShader = (id) => { + if (!id) return; + var shader = GL.shaders[id]; + if (!shader) { + // glDeleteShader actually signals an error when deleting a nonexisting + // object, unlike some other GL delete functions. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + GLctx.deleteShader(shader); + GL.shaders[id] = null; + }; + + var _emscripten_glDeleteTextures = (n, textures) => { + for (var i = 0; i < n; i++) { + var id = HEAP32[(((textures)+(i*4))>>2)]; + var texture = GL.textures[id]; + // GL spec: "glDeleteTextures silently ignores 0s and names that do not + // correspond to existing textures". + if (!texture) continue; + GLctx.deleteTexture(texture); + texture.name = 0; + GL.textures[id] = null; + } + }; + + + var _emscripten_glDeleteVertexArrays = (n, vaos) => { + for (var i = 0; i < n; i++) { + var id = HEAP32[(((vaos)+(i*4))>>2)]; + GLctx.deleteVertexArray(GL.vaos[id]); + GL.vaos[id] = null; + } + }; + var _glDeleteVertexArrays = _emscripten_glDeleteVertexArrays; + var _emscripten_glDeleteVertexArraysOES = _glDeleteVertexArrays; + + var _emscripten_glDepthFunc = (x0) => GLctx.depthFunc(x0); + + var _emscripten_glDepthMask = (flag) => { + GLctx.depthMask(!!flag); + }; + + var _emscripten_glDepthRangef = (x0, x1) => GLctx.depthRange(x0, x1); + + var _emscripten_glDetachShader = (program, shader) => { + GLctx.detachShader(GL.programs[program], GL.shaders[shader]); + }; + + var _emscripten_glDisable = (x0) => GLctx.disable(x0); + + var _emscripten_glDisableVertexAttribArray = (index) => { + GLctx.disableVertexAttribArray(index); + }; + + var _emscripten_glDrawArrays = (mode, first, count) => { + + GLctx.drawArrays(mode, first, count); + + }; + + + var _emscripten_glDrawArraysInstanced = (mode, first, count, primcount) => { + GLctx.drawArraysInstanced(mode, first, count, primcount); + }; + var _glDrawArraysInstanced = _emscripten_glDrawArraysInstanced; + var _emscripten_glDrawArraysInstancedANGLE = _glDrawArraysInstanced; + + + var tempFixedLengthArray = []; + + var _emscripten_glDrawBuffers = (n, bufs) => { + + var bufArray = tempFixedLengthArray[n]; + for (var i = 0; i < n; i++) { + bufArray[i] = HEAP32[(((bufs)+(i*4))>>2)]; + } + + GLctx.drawBuffers(bufArray); + }; + var _glDrawBuffers = _emscripten_glDrawBuffers; + var _emscripten_glDrawBuffersWEBGL = _glDrawBuffers; + + + var _emscripten_glDrawElements = (mode, count, type, indices) => { + + GLctx.drawElements(mode, count, type, indices); + + }; + + + var _emscripten_glDrawElementsInstanced = (mode, count, type, indices, primcount) => { + GLctx.drawElementsInstanced(mode, count, type, indices, primcount); + }; + var _glDrawElementsInstanced = _emscripten_glDrawElementsInstanced; + var _emscripten_glDrawElementsInstancedANGLE = _glDrawElementsInstanced; + + var _emscripten_glEnable = (x0) => GLctx.enable(x0); + + var _emscripten_glEnableVertexAttribArray = (index) => { + GLctx.enableVertexAttribArray(index); + }; + + var _emscripten_glEndQueryEXT = (target) => { + GLctx.disjointTimerQueryExt['endQueryEXT'](target); + }; + + var _emscripten_glFinish = () => GLctx.finish(); + + var _emscripten_glFlush = () => GLctx.flush(); + + var _emscripten_glFramebufferRenderbuffer = (target, attachment, renderbuffertarget, renderbuffer) => { + GLctx.framebufferRenderbuffer(target, attachment, renderbuffertarget, + GL.renderbuffers[renderbuffer]); + }; + + var _emscripten_glFramebufferTexture2D = (target, attachment, textarget, texture, level) => { + GLctx.framebufferTexture2D(target, attachment, textarget, + GL.textures[texture], level); + }; + + var _emscripten_glFrontFace = (x0) => GLctx.frontFace(x0); + + var _emscripten_glGenBuffers = (n, buffers) => { + GL.genObject(n, buffers, 'createBuffer', GL.buffers + ); + }; + + var _emscripten_glGenFramebuffers = (n, ids) => { + GL.genObject(n, ids, 'createFramebuffer', GL.framebuffers + ); + }; + + var _emscripten_glGenQueriesEXT = (n, ids) => { + for (var i = 0; i < n; i++) { + var query = GLctx.disjointTimerQueryExt['createQueryEXT'](); + if (!query) { + GL.recordError(0x502 /* GL_INVALID_OPERATION */); + while (i < n) HEAP32[(((ids)+(i++*4))>>2)] = 0; + return; + } + var id = GL.getNewId(GL.queries); + query.name = id; + GL.queries[id] = query; + HEAP32[(((ids)+(i*4))>>2)] = id; + } + }; + + var _emscripten_glGenRenderbuffers = (n, renderbuffers) => { + GL.genObject(n, renderbuffers, 'createRenderbuffer', GL.renderbuffers + ); + }; + + var _emscripten_glGenTextures = (n, textures) => { + GL.genObject(n, textures, 'createTexture', GL.textures + ); + }; + + + var _emscripten_glGenVertexArrays = (n, arrays) => { + GL.genObject(n, arrays, 'createVertexArray', GL.vaos + ); + }; + var _glGenVertexArrays = _emscripten_glGenVertexArrays; + var _emscripten_glGenVertexArraysOES = _glGenVertexArrays; + + var _emscripten_glGenerateMipmap = (x0) => GLctx.generateMipmap(x0); + + + var __glGetActiveAttribOrUniform = (funcName, program, index, bufSize, length, size, type, name) => { + program = GL.programs[program]; + var info = GLctx[funcName](program, index); + if (info) { + // If an error occurs, nothing will be written to length, size and type and name. + var numBytesWrittenExclNull = name && stringToUTF8(info.name, name, bufSize); + if (length) HEAP32[((length)>>2)] = numBytesWrittenExclNull; + if (size) HEAP32[((size)>>2)] = info.size; + if (type) HEAP32[((type)>>2)] = info.type; + } + }; + + var _emscripten_glGetActiveAttrib = (program, index, bufSize, length, size, type, name) => + __glGetActiveAttribOrUniform('getActiveAttrib', program, index, bufSize, length, size, type, name); + + + var _emscripten_glGetActiveUniform = (program, index, bufSize, length, size, type, name) => + __glGetActiveAttribOrUniform('getActiveUniform', program, index, bufSize, length, size, type, name); + + var _emscripten_glGetAttachedShaders = (program, maxCount, count, shaders) => { + var result = GLctx.getAttachedShaders(GL.programs[program]); + var len = result.length; + if (len > maxCount) { + len = maxCount; + } + HEAP32[((count)>>2)] = len; + for (var i = 0; i < len; ++i) { + var id = GL.shaders.indexOf(result[i]); + HEAP32[(((shaders)+(i*4))>>2)] = id; + } + }; + + + var _emscripten_glGetAttribLocation = (program, name) => + GLctx.getAttribLocation(GL.programs[program], UTF8ToString(name)); + + var readI53FromI64 = (ptr) => { + return HEAPU32[((ptr)>>2)] + HEAP32[(((ptr)+(4))>>2)] * 4294967296; + }; + + var readI53FromU64 = (ptr) => { + return HEAPU32[((ptr)>>2)] + HEAPU32[(((ptr)+(4))>>2)] * 4294967296; + }; + var writeI53ToI64 = (ptr, num) => { + HEAPU32[((ptr)>>2)] = num; + var lower = HEAPU32[((ptr)>>2)]; + HEAPU32[(((ptr)+(4))>>2)] = (num - lower)/4294967296; + var deserialized = (num >= 0) ? readI53FromU64(ptr) : readI53FromI64(ptr); + var offset = ((ptr)>>2); + if (deserialized != num) warnOnce(`writeI53ToI64() out of range: serialized JS Number ${num} to Wasm heap as bytes lo=${ptrToString(HEAPU32[offset])}, hi=${ptrToString(HEAPU32[offset+1])}, which deserializes back to ${deserialized} instead!`); + }; + + var emscriptenWebGLGet = (name_, p, type) => { + // Guard against user passing a null pointer. + // Note that GLES2 spec does not say anything about how passing a null + // pointer should be treated. Testing on desktop core GL 3, the application + // crashes on glGetIntegerv to a null pointer, but better to report an error + // instead of doing anything random. + if (!p) { + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + var ret = undefined; + switch (name_) { // Handle a few trivial GLES values + case 0x8DFA: // GL_SHADER_COMPILER + ret = 1; + break; + case 0x8DF8: // GL_SHADER_BINARY_FORMATS + if (type != 0 && type != 1) { + GL.recordError(0x500); // GL_INVALID_ENUM + } + // Do not write anything to the out pointer, since no binary formats are + // supported. + return; + case 0x8DF9: // GL_NUM_SHADER_BINARY_FORMATS + ret = 0; + break; + case 0x86A2: // GL_NUM_COMPRESSED_TEXTURE_FORMATS + // WebGL doesn't have GL_NUM_COMPRESSED_TEXTURE_FORMATS (it's obsolete + // since GL_COMPRESSED_TEXTURE_FORMATS returns a JS array that can be + // queried for length), so implement it ourselves to allow C++ GLES2 + // code to get the length. + var formats = GLctx.getParameter(0x86A3 /*GL_COMPRESSED_TEXTURE_FORMATS*/); + ret = formats ? formats.length : 0; + break; + + } + + if (ret === undefined) { + var result = GLctx.getParameter(name_); + switch (typeof result) { + case "number": + ret = result; + break; + case "boolean": + ret = result ? 1 : 0; + break; + case "string": + GL.recordError(0x500); // GL_INVALID_ENUM + return; + case "object": + if (result === null) { + // null is a valid result for some (e.g., which buffer is bound - + // perhaps nothing is bound), but otherwise can mean an invalid + // name_, which we need to report as an error + switch (name_) { + case 0x8894: // ARRAY_BUFFER_BINDING + case 0x8B8D: // CURRENT_PROGRAM + case 0x8895: // ELEMENT_ARRAY_BUFFER_BINDING + case 0x8CA6: // FRAMEBUFFER_BINDING or DRAW_FRAMEBUFFER_BINDING + case 0x8CA7: // RENDERBUFFER_BINDING + case 0x8069: // TEXTURE_BINDING_2D + case 0x85B5: // WebGL 2 GL_VERTEX_ARRAY_BINDING, or WebGL 1 extension OES_vertex_array_object GL_VERTEX_ARRAY_BINDING_OES + case 0x8514: { // TEXTURE_BINDING_CUBE_MAP + ret = 0; + break; + } + default: { + GL.recordError(0x500); // GL_INVALID_ENUM + return; + } + } + } else if (result instanceof Float32Array || + result instanceof Uint32Array || + result instanceof Int32Array || + result instanceof Array) { + for (var i = 0; i < result.length; ++i) { + switch (type) { + case 0: HEAP32[(((p)+(i*4))>>2)] = result[i]; break; + case 2: HEAPF32[(((p)+(i*4))>>2)] = result[i]; break; + case 4: HEAP8[(p)+(i)] = result[i] ? 1 : 0; break; + } + } + return; + } else { + try { + ret = result.name | 0; + } catch(e) { + GL.recordError(0x500); // GL_INVALID_ENUM + err(`GL_INVALID_ENUM in glGet${type}v: Unknown object returned from WebGL getParameter(${name_})! (error: ${e})`); + return; + } + } + break; + default: + GL.recordError(0x500); // GL_INVALID_ENUM + err(`GL_INVALID_ENUM in glGet${type}v: Native code calling glGet${type}v(${name_}) and it returns ${result} of type ${typeof(result)}!`); + return; + } + } + + switch (type) { + case 1: writeI53ToI64(p, ret); break; + case 0: HEAP32[((p)>>2)] = ret; break; + case 2: HEAPF32[((p)>>2)] = ret; break; + case 4: HEAP8[p] = ret ? 1 : 0; break; + } + }; + + var _emscripten_glGetBooleanv = (name_, p) => emscriptenWebGLGet(name_, p, 4); + + var _emscripten_glGetBufferParameteriv = (target, value, data) => { + if (!data) { + // GLES2 specification does not specify how to behave if data is a null + // pointer. Since calling this function does not make sense if data == + // null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + HEAP32[((data)>>2)] = GLctx.getBufferParameter(target, value); + }; + + var _emscripten_glGetError = () => { + var error = GLctx.getError() || GL.lastError; + GL.lastError = 0/*GL_NO_ERROR*/; + return error; + }; + + + var _emscripten_glGetFloatv = (name_, p) => emscriptenWebGLGet(name_, p, 2); + + var _emscripten_glGetFramebufferAttachmentParameteriv = (target, attachment, pname, params) => { + var result = GLctx.getFramebufferAttachmentParameter(target, attachment, pname); + if (result instanceof WebGLRenderbuffer || + result instanceof WebGLTexture) { + result = result.name | 0; + } + HEAP32[((params)>>2)] = result; + }; + + + var _emscripten_glGetIntegerv = (name_, p) => emscriptenWebGLGet(name_, p, 0); + + var _emscripten_glGetProgramInfoLog = (program, maxLength, length, infoLog) => { + var log = GLctx.getProgramInfoLog(GL.programs[program]); + if (log === null) log = '(unknown error)'; + var numBytesWrittenExclNull = (maxLength > 0 && infoLog) ? stringToUTF8(log, infoLog, maxLength) : 0; + if (length) HEAP32[((length)>>2)] = numBytesWrittenExclNull; + }; + + var _emscripten_glGetProgramiv = (program, pname, p) => { + if (!p) { + // GLES2 specification does not specify how to behave if p is a null + // pointer. Since calling this function does not make sense if p == null, + // issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + + if (program >= GL.counter) { + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + + program = GL.programs[program]; + + if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH + var log = GLctx.getProgramInfoLog(program); + if (log === null) log = '(unknown error)'; + HEAP32[((p)>>2)] = log.length + 1; + } else if (pname == 0x8B87 /* GL_ACTIVE_UNIFORM_MAX_LENGTH */) { + if (!program.maxUniformLength) { + var numActiveUniforms = GLctx.getProgramParameter(program, 0x8B86/*GL_ACTIVE_UNIFORMS*/); + for (var i = 0; i < numActiveUniforms; ++i) { + program.maxUniformLength = Math.max(program.maxUniformLength, GLctx.getActiveUniform(program, i).name.length+1); + } + } + HEAP32[((p)>>2)] = program.maxUniformLength; + } else if (pname == 0x8B8A /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */) { + if (!program.maxAttributeLength) { + var numActiveAttributes = GLctx.getProgramParameter(program, 0x8B89/*GL_ACTIVE_ATTRIBUTES*/); + for (var i = 0; i < numActiveAttributes; ++i) { + program.maxAttributeLength = Math.max(program.maxAttributeLength, GLctx.getActiveAttrib(program, i).name.length+1); + } + } + HEAP32[((p)>>2)] = program.maxAttributeLength; + } else if (pname == 0x8A35 /* GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */) { + if (!program.maxUniformBlockNameLength) { + var numActiveUniformBlocks = GLctx.getProgramParameter(program, 0x8A36/*GL_ACTIVE_UNIFORM_BLOCKS*/); + for (var i = 0; i < numActiveUniformBlocks; ++i) { + program.maxUniformBlockNameLength = Math.max(program.maxUniformBlockNameLength, GLctx.getActiveUniformBlockName(program, i).length+1); + } + } + HEAP32[((p)>>2)] = program.maxUniformBlockNameLength; + } else { + HEAP32[((p)>>2)] = GLctx.getProgramParameter(program, pname); + } + }; + + + var _emscripten_glGetQueryObjecti64vEXT = (id, pname, params) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense + // if p == null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + var query = GL.queries[id]; + var param; + { + param = GLctx.disjointTimerQueryExt['getQueryObjectEXT'](query, pname); + } + var ret; + if (typeof param == 'boolean') { + ret = param ? 1 : 0; + } else { + ret = param; + } + writeI53ToI64(params, ret); + }; + + var _emscripten_glGetQueryObjectivEXT = (id, pname, params) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense + // if p == null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + var query = GL.queries[id]; + var param = GLctx.disjointTimerQueryExt['getQueryObjectEXT'](query, pname); + var ret; + if (typeof param == 'boolean') { + ret = param ? 1 : 0; + } else { + ret = param; + } + HEAP32[((params)>>2)] = ret; + }; + + + var _glGetQueryObjecti64vEXT = _emscripten_glGetQueryObjecti64vEXT; + var _emscripten_glGetQueryObjectui64vEXT = _glGetQueryObjecti64vEXT; + + + var _glGetQueryObjectivEXT = _emscripten_glGetQueryObjectivEXT; + var _emscripten_glGetQueryObjectuivEXT = _glGetQueryObjectivEXT; + + var _emscripten_glGetQueryivEXT = (target, pname, params) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense + // if p == null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + HEAP32[((params)>>2)] = GLctx.disjointTimerQueryExt['getQueryEXT'](target, pname); + }; + + var _emscripten_glGetRenderbufferParameteriv = (target, pname, params) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null pointer. Since calling this function does not make sense + // if params == null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + HEAP32[((params)>>2)] = GLctx.getRenderbufferParameter(target, pname); + }; + + + var _emscripten_glGetShaderInfoLog = (shader, maxLength, length, infoLog) => { + var log = GLctx.getShaderInfoLog(GL.shaders[shader]); + if (log === null) log = '(unknown error)'; + var numBytesWrittenExclNull = (maxLength > 0 && infoLog) ? stringToUTF8(log, infoLog, maxLength) : 0; + if (length) HEAP32[((length)>>2)] = numBytesWrittenExclNull; + }; + + var _emscripten_glGetShaderPrecisionFormat = (shaderType, precisionType, range, precision) => { + var result = GLctx.getShaderPrecisionFormat(shaderType, precisionType); + HEAP32[((range)>>2)] = result.rangeMin; + HEAP32[(((range)+(4))>>2)] = result.rangeMax; + HEAP32[((precision)>>2)] = result.precision; + }; + + var _emscripten_glGetShaderSource = (shader, bufSize, length, source) => { + var result = GLctx.getShaderSource(GL.shaders[shader]); + if (!result) return; // If an error occurs, nothing will be written to length or source. + var numBytesWrittenExclNull = (bufSize > 0 && source) ? stringToUTF8(result, source, bufSize) : 0; + if (length) HEAP32[((length)>>2)] = numBytesWrittenExclNull; + }; + + var _emscripten_glGetShaderiv = (shader, pname, p) => { + if (!p) { + // GLES2 specification does not specify how to behave if p is a null + // pointer. Since calling this function does not make sense if p == null, + // issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH + var log = GLctx.getShaderInfoLog(GL.shaders[shader]); + if (log === null) log = '(unknown error)'; + // The GLES2 specification says that if the shader has an empty info log, + // a value of 0 is returned. Otherwise the log has a null char appended. + // (An empty string is falsey, so we can just check that instead of + // looking at log.length.) + var logLength = log ? log.length + 1 : 0; + HEAP32[((p)>>2)] = logLength; + } else if (pname == 0x8B88) { // GL_SHADER_SOURCE_LENGTH + var source = GLctx.getShaderSource(GL.shaders[shader]); + // source may be a null, or the empty string, both of which are falsey + // values that we report a 0 length for. + var sourceLength = source ? source.length + 1 : 0; + HEAP32[((p)>>2)] = sourceLength; + } else { + HEAP32[((p)>>2)] = GLctx.getShaderParameter(GL.shaders[shader], pname); + } + }; + + + + var stringToNewUTF8 = (str) => { + var size = lengthBytesUTF8(str) + 1; + var ret = _malloc(size); + if (ret) stringToUTF8(str, ret, size); + return ret; + }; + + + var webglGetExtensions = () => { + var exts = getEmscriptenSupportedExtensions(GLctx); + exts = exts.concat(exts.map((e) => "GL_" + e)); + return exts; + }; + + var _emscripten_glGetString = (name_) => { + var ret = GL.stringCache[name_]; + if (!ret) { + switch (name_) { + case 0x1F03 /* GL_EXTENSIONS */: + ret = stringToNewUTF8(webglGetExtensions().join(' ')); + break; + case 0x1F00 /* GL_VENDOR */: + case 0x1F01 /* GL_RENDERER */: + case 0x9245 /* UNMASKED_VENDOR_WEBGL */: + case 0x9246 /* UNMASKED_RENDERER_WEBGL */: + var s = GLctx.getParameter(name_); + if (!s) { + GL.recordError(0x500/*GL_INVALID_ENUM*/); + } + ret = s ? stringToNewUTF8(s) : 0; + break; + + case 0x1F02 /* GL_VERSION */: + var webGLVersion = GLctx.getParameter(0x1F02 /*GL_VERSION*/); + // return GLES version string corresponding to the version of the WebGL context + var glVersion = `OpenGL ES 2.0 (${webGLVersion})`; + ret = stringToNewUTF8(glVersion); + break; + case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */: + var glslVersion = GLctx.getParameter(0x8B8C /*GL_SHADING_LANGUAGE_VERSION*/); + // extract the version number 'N.M' from the string 'WebGL GLSL ES N.M ...' + var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/; + var ver_num = glslVersion.match(ver_re); + if (ver_num !== null) { + if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + '0'; // ensure minor version has 2 digits + glslVersion = `OpenGL ES GLSL ES ${ver_num[1]} (${glslVersion})`; + } + ret = stringToNewUTF8(glslVersion); + break; + default: + GL.recordError(0x500/*GL_INVALID_ENUM*/); + // fall through + } + GL.stringCache[name_] = ret; + } + return ret; + }; + + var _emscripten_glGetTexParameterfv = (target, pname, params) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null + // pointer. Since calling this function does not make sense if p == null, + // issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + HEAPF32[((params)>>2)] = GLctx.getTexParameter(target, pname); + }; + + var _emscripten_glGetTexParameteriv = (target, pname, params) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null + // pointer. Since calling this function does not make sense if p == null, + // issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + HEAP32[((params)>>2)] = GLctx.getTexParameter(target, pname); + }; + + /** @suppress {checkTypes} */ + var jstoi_q = (str) => parseInt(str); + + /** @noinline */ + var webglGetLeftBracePos = (name) => name.slice(-1) == ']' && name.lastIndexOf('['); + + var webglPrepareUniformLocationsBeforeFirstUse = (program) => { + var uniformLocsById = program.uniformLocsById, // Maps GLuint -> WebGLUniformLocation + uniformSizeAndIdsByName = program.uniformSizeAndIdsByName, // Maps name -> [uniform array length, GLuint] + i, j; + + // On the first time invocation of glGetUniformLocation on this shader program: + // initialize cache data structures and discover which uniforms are arrays. + if (!uniformLocsById) { + // maps GLint integer locations to WebGLUniformLocations + program.uniformLocsById = uniformLocsById = {}; + // maps integer locations back to uniform name strings, so that we can lazily fetch uniform array locations + program.uniformArrayNamesById = {}; + + var numActiveUniforms = GLctx.getProgramParameter(program, 0x8B86/*GL_ACTIVE_UNIFORMS*/); + for (i = 0; i < numActiveUniforms; ++i) { + var u = GLctx.getActiveUniform(program, i); + var nm = u.name; + var sz = u.size; + var lb = webglGetLeftBracePos(nm); + var arrayName = lb > 0 ? nm.slice(0, lb) : nm; + + // Assign a new location. + var id = program.uniformIdCounter; + program.uniformIdCounter += sz; + // Eagerly get the location of the uniformArray[0] base element. + // The remaining indices >0 will be left for lazy evaluation to + // improve performance. Those may never be needed to fetch, if the + // application fills arrays always in full starting from the first + // element of the array. + uniformSizeAndIdsByName[arrayName] = [sz, id]; + + // Store placeholder integers in place that highlight that these + // >0 index locations are array indices pending population. + for (j = 0; j < sz; ++j) { + uniformLocsById[id] = j; + program.uniformArrayNamesById[id++] = arrayName; + } + } + } + }; + + + + var _emscripten_glGetUniformLocation = (program, name) => { + + name = UTF8ToString(name); + + if (program = GL.programs[program]) { + webglPrepareUniformLocationsBeforeFirstUse(program); + var uniformLocsById = program.uniformLocsById; // Maps GLuint -> WebGLUniformLocation + var arrayIndex = 0; + var uniformBaseName = name; + + // Invariant: when populating integer IDs for uniform locations, we must + // maintain the precondition that arrays reside in contiguous addresses, + // i.e. for a 'vec4 colors[10];', colors[4] must be at location + // colors[0]+4. However, user might call glGetUniformLocation(program, + // "colors") for an array, so we cannot discover based on the user input + // arguments whether the uniform we are dealing with is an array. The only + // way to discover which uniforms are arrays is to enumerate over all the + // active uniforms in the program. + var leftBrace = webglGetLeftBracePos(name); + + // If user passed an array accessor "[index]", parse the array index off the accessor. + if (leftBrace > 0) { + arrayIndex = jstoi_q(name.slice(leftBrace + 1)) >>> 0; // "index]", coerce parseInt(']') with >>>0 to treat "foo[]" as "foo[0]" and foo[-1] as unsigned out-of-bounds. + uniformBaseName = name.slice(0, leftBrace); + } + + // Have we cached the location of this uniform before? + // A pair [array length, GLint of the uniform location] + var sizeAndId = program.uniformSizeAndIdsByName[uniformBaseName]; + + // If a uniform with this name exists, and if its index is within the + // array limits (if it's even an array), query the WebGLlocation, or + // return an existing cached location. + if (sizeAndId && arrayIndex < sizeAndId[0]) { + arrayIndex += sizeAndId[1]; // Add the base location of the uniform to the array index offset. + if ((uniformLocsById[arrayIndex] = uniformLocsById[arrayIndex] || GLctx.getUniformLocation(program, name))) { + return arrayIndex; + } + } + } + else { + // N.b. we are currently unable to distinguish between GL program IDs that + // never existed vs GL program IDs that have been deleted, so report + // GL_INVALID_VALUE in both cases. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + } + return -1; + }; + + + var webglGetProgramUniformLocation = (program, location) => { + + if (program) { + var webglLoc = program.uniformLocsById[location]; + // program.uniformLocsById[location] stores either an integer, or a + // WebGLUniformLocation. + // If an integer, we have not yet bound the location, so do it now. The + // integer value specifies the array index we should bind to. + if (typeof webglLoc == 'number') { + program.uniformLocsById[location] = webglLoc = GLctx.getUniformLocation(program, program.uniformArrayNamesById[location] + (webglLoc > 0 ? `[${webglLoc}]` : '')); + } + // Else an already cached WebGLUniformLocation, return it. + return webglLoc; + } else { + GL.recordError(0x502/*GL_INVALID_OPERATION*/); + } + }; + + + /** @suppress{checkTypes} */ + var emscriptenWebGLGetUniform = (program, location, params, type) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null + // pointer. Since calling this function does not make sense if params == + // null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + program = GL.programs[program]; + webglPrepareUniformLocationsBeforeFirstUse(program); + var data = GLctx.getUniform(program, webglGetProgramUniformLocation(program, location)); + if (typeof data == 'number' || typeof data == 'boolean') { + switch (type) { + case 0: HEAP32[((params)>>2)] = data; break; + case 2: HEAPF32[((params)>>2)] = data; break; + } + } else { + for (var i = 0; i < data.length; i++) { + switch (type) { + case 0: HEAP32[(((params)+(i*4))>>2)] = data[i]; break; + case 2: HEAPF32[(((params)+(i*4))>>2)] = data[i]; break; + } + } + } + }; + + var _emscripten_glGetUniformfv = (program, location, params) => { + emscriptenWebGLGetUniform(program, location, params, 2); + }; + + + var _emscripten_glGetUniformiv = (program, location, params) => { + emscriptenWebGLGetUniform(program, location, params, 0); + }; + + var _emscripten_glGetVertexAttribPointerv = (index, pname, pointer) => { + if (!pointer) { + // GLES2 specification does not specify how to behave if pointer is a null + // pointer. Since calling this function does not make sense if pointer == + // null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + HEAP32[((pointer)>>2)] = GLctx.getVertexAttribOffset(index, pname); + }; + + /** @suppress{checkTypes} */ + var emscriptenWebGLGetVertexAttrib = (index, pname, params, type) => { + if (!params) { + // GLES2 specification does not specify how to behave if params is a null + // pointer. Since calling this function does not make sense if params == + // null, issue a GL error to notify user about it. + GL.recordError(0x501 /* GL_INVALID_VALUE */); + return; + } + var data = GLctx.getVertexAttrib(index, pname); + if (pname == 0x889F/*VERTEX_ATTRIB_ARRAY_BUFFER_BINDING*/) { + HEAP32[((params)>>2)] = data && data["name"]; + } else if (typeof data == 'number' || typeof data == 'boolean') { + switch (type) { + case 0: HEAP32[((params)>>2)] = data; break; + case 2: HEAPF32[((params)>>2)] = data; break; + case 5: HEAP32[((params)>>2)] = Math.fround(data); break; + } + } else { + for (var i = 0; i < data.length; i++) { + switch (type) { + case 0: HEAP32[(((params)+(i*4))>>2)] = data[i]; break; + case 2: HEAPF32[(((params)+(i*4))>>2)] = data[i]; break; + case 5: HEAP32[(((params)+(i*4))>>2)] = Math.fround(data[i]); break; + } + } + } + }; + + var _emscripten_glGetVertexAttribfv = (index, pname, params) => { + // N.B. This function may only be called if the vertex attribute was + // specified using the function glVertexAttrib*f(), otherwise the results + // are undefined. (GLES3 spec 6.1.12) + emscriptenWebGLGetVertexAttrib(index, pname, params, 2); + }; + + + var _emscripten_glGetVertexAttribiv = (index, pname, params) => { + // N.B. This function may only be called if the vertex attribute was + // specified using the function glVertexAttrib*f(), otherwise the results + // are undefined. (GLES3 spec 6.1.12) + emscriptenWebGLGetVertexAttrib(index, pname, params, 5); + }; + + var _emscripten_glHint = (x0, x1) => GLctx.hint(x0, x1); + + var _emscripten_glIsBuffer = (buffer) => { + var b = GL.buffers[buffer]; + if (!b) return 0; + return GLctx.isBuffer(b); + }; + + var _emscripten_glIsEnabled = (x0) => GLctx.isEnabled(x0); + + var _emscripten_glIsFramebuffer = (framebuffer) => { + var fb = GL.framebuffers[framebuffer]; + if (!fb) return 0; + return GLctx.isFramebuffer(fb); + }; + + var _emscripten_glIsProgram = (program) => { + program = GL.programs[program]; + if (!program) return 0; + return GLctx.isProgram(program); + }; + + var _emscripten_glIsQueryEXT = (id) => { + var query = GL.queries[id]; + if (!query) return 0; + return GLctx.disjointTimerQueryExt['isQueryEXT'](query); + }; + + var _emscripten_glIsRenderbuffer = (renderbuffer) => { + var rb = GL.renderbuffers[renderbuffer]; + if (!rb) return 0; + return GLctx.isRenderbuffer(rb); + }; + + var _emscripten_glIsShader = (shader) => { + var s = GL.shaders[shader]; + if (!s) return 0; + return GLctx.isShader(s); + }; + + var _emscripten_glIsTexture = (id) => { + var texture = GL.textures[id]; + if (!texture) return 0; + return GLctx.isTexture(texture); + }; + + + var _emscripten_glIsVertexArray = (array) => { + + var vao = GL.vaos[array]; + if (!vao) return 0; + return GLctx.isVertexArray(vao); + }; + var _glIsVertexArray = _emscripten_glIsVertexArray; + var _emscripten_glIsVertexArrayOES = _glIsVertexArray; + + var _emscripten_glLineWidth = (x0) => GLctx.lineWidth(x0); + + var _emscripten_glLinkProgram = (program) => { + program = GL.programs[program]; + GLctx.linkProgram(program); + // Invalidate earlier computed uniform->ID mappings, those have now become stale + program.uniformLocsById = 0; // Mark as null-like so that glGetUniformLocation() knows to populate this again. + program.uniformSizeAndIdsByName = {}; + + }; + + var _emscripten_glPixelStorei = (pname, param) => { + if (pname == 3317) { + GL.unpackAlignment = param; + } else if (pname == 3314) { + GL.unpackRowLength = param; + } + GLctx.pixelStorei(pname, param); + }; + + var _emscripten_glPolygonModeWEBGL = (face, mode) => { + GLctx.webglPolygonMode['polygonModeWEBGL'](face, mode); + }; + + var _emscripten_glPolygonOffset = (x0, x1) => GLctx.polygonOffset(x0, x1); + + var _emscripten_glPolygonOffsetClampEXT = (factor, units, clamp) => { + GLctx.extPolygonOffsetClamp['polygonOffsetClampEXT'](factor, units, clamp); + }; + + var _emscripten_glQueryCounterEXT = (id, target) => { + GLctx.disjointTimerQueryExt['queryCounterEXT'](GL.queries[id], target); + }; + + var computeUnpackAlignedImageSize = (width, height, sizePerPixel) => { + function roundedToNextMultipleOf(x, y) { + return (x + y - 1) & -y; + } + var plainRowSize = (GL.unpackRowLength || width) * sizePerPixel; + var alignedRowSize = roundedToNextMultipleOf(plainRowSize, GL.unpackAlignment); + return height * alignedRowSize; + }; + + var colorChannelsInGlTextureFormat = (format) => { + // Micro-optimizations for size: map format to size by subtracting smallest + // enum value (0x1902) from all values first. Also omit the most common + // size value (1) from the list, which is assumed by formats not on the + // list. + var colorChannels = { + // 0x1902 /* GL_DEPTH_COMPONENT */ - 0x1902: 1, + // 0x1906 /* GL_ALPHA */ - 0x1902: 1, + 5: 3, + 6: 4, + // 0x1909 /* GL_LUMINANCE */ - 0x1902: 1, + 8: 2, + 29502: 3, + 29504: 4, + }; + return colorChannels[format - 0x1902]||1; + }; + + var heapObjectForWebGLType = (type) => { + // Micro-optimization for size: Subtract lowest GL enum number (0x1400/* GL_BYTE */) from type to compare + // smaller values for the heap, for shorter generated code size. + // Also the type HEAPU16 is not tested for explicitly, but any unrecognized type will return out HEAPU16. + // (since most types are HEAPU16) + type -= 0x1400; + + if (type == 1) return HEAPU8; + + if (type == 4) return HEAP32; + + if (type == 6) return HEAPF32; + + if (type == 5 + || type == 28922 + ) + return HEAPU32; + + return HEAPU16; + }; + + var toTypedArrayIndex = (pointer, heap) => + pointer >>> (31 - Math.clz32(heap.BYTES_PER_ELEMENT)); + + var emscriptenWebGLGetTexPixelData = (type, format, width, height, pixels) => { + var heap = heapObjectForWebGLType(type); + var sizePerPixel = colorChannelsInGlTextureFormat(format) * heap.BYTES_PER_ELEMENT; + var bytes = computeUnpackAlignedImageSize(width, height, sizePerPixel); + return heap.subarray(toTypedArrayIndex(pixels, heap), toTypedArrayIndex(pixels + bytes, heap)); + }; + + var _emscripten_glReadPixels = (x, y, width, height, format, type, pixels) => { + var pixelData = emscriptenWebGLGetTexPixelData(type, format, width, height, pixels); + if (!pixelData) { + GL.recordError(0x500/*GL_INVALID_ENUM*/); + return; + } + GLctx.readPixels(x, y, width, height, format, type, pixelData); + }; + + var _emscripten_glReleaseShaderCompiler = () => { + // NOP (as allowed by GLES 2.0 spec) + }; + + var _emscripten_glRenderbufferStorage = (x0, x1, x2, x3) => GLctx.renderbufferStorage(x0, x1, x2, x3); + + var _emscripten_glSampleCoverage = (value, invert) => { + GLctx.sampleCoverage(value, !!invert); + }; + + var _emscripten_glScissor = (x0, x1, x2, x3) => GLctx.scissor(x0, x1, x2, x3); + + var _emscripten_glShaderBinary = (count, shaders, binaryformat, binary, length) => { + GL.recordError(0x500/*GL_INVALID_ENUM*/); + }; + + var _emscripten_glShaderSource = (shader, count, string, length) => { + var source = GL.getSource(shader, count, string, length); + + GLctx.shaderSource(GL.shaders[shader], source); + }; + + var _emscripten_glStencilFunc = (x0, x1, x2) => GLctx.stencilFunc(x0, x1, x2); + + var _emscripten_glStencilFuncSeparate = (x0, x1, x2, x3) => GLctx.stencilFuncSeparate(x0, x1, x2, x3); + + var _emscripten_glStencilMask = (x0) => GLctx.stencilMask(x0); + + var _emscripten_glStencilMaskSeparate = (x0, x1) => GLctx.stencilMaskSeparate(x0, x1); + + var _emscripten_glStencilOp = (x0, x1, x2) => GLctx.stencilOp(x0, x1, x2); + + var _emscripten_glStencilOpSeparate = (x0, x1, x2, x3) => GLctx.stencilOpSeparate(x0, x1, x2, x3); + + + var _emscripten_glTexImage2D = (target, level, internalFormat, width, height, border, format, type, pixels) => { + var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels) : null; + GLctx.texImage2D(target, level, internalFormat, width, height, border, format, type, pixelData); + }; + + var _emscripten_glTexParameterf = (x0, x1, x2) => GLctx.texParameterf(x0, x1, x2); + + var _emscripten_glTexParameterfv = (target, pname, params) => { + var param = HEAPF32[((params)>>2)]; + GLctx.texParameterf(target, pname, param); + }; + + var _emscripten_glTexParameteri = (x0, x1, x2) => GLctx.texParameteri(x0, x1, x2); + + var _emscripten_glTexParameteriv = (target, pname, params) => { + var param = HEAP32[((params)>>2)]; + GLctx.texParameteri(target, pname, param); + }; + + + var _emscripten_glTexSubImage2D = (target, level, xoffset, yoffset, width, height, format, type, pixels) => { + var pixelData = pixels ? emscriptenWebGLGetTexPixelData(type, format, width, height, pixels) : null; + GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixelData); + }; + + + var webglGetUniformLocation = (location) => { + + return webglGetProgramUniformLocation(GLctx.currentProgram, location); + }; + + var _emscripten_glUniform1f = (location, v0) => { + GLctx.uniform1f(webglGetUniformLocation(location), v0); + }; + + + var miniTempWebGLFloatBuffers = []; + + var _emscripten_glUniform1fv = (location, count, value) => { + + if (count <= 288) { + // avoid allocation when uploading few enough uniforms + var view = miniTempWebGLFloatBuffers[count]; + for (var i = 0; i < count; ++i) { + view[i] = HEAPF32[(((value)+(4*i))>>2)]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*4)>>2)); + } + GLctx.uniform1fv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform1i = (location, v0) => { + GLctx.uniform1i(webglGetUniformLocation(location), v0); + }; + + + var miniTempWebGLIntBuffers = []; + + var _emscripten_glUniform1iv = (location, count, value) => { + + if (count <= 288) { + // avoid allocation when uploading few enough uniforms + var view = miniTempWebGLIntBuffers[count]; + for (var i = 0; i < count; ++i) { + view[i] = HEAP32[(((value)+(4*i))>>2)]; + } + } else + { + var view = HEAP32.subarray((((value)>>2)), ((value+count*4)>>2)); + } + GLctx.uniform1iv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform2f = (location, v0, v1) => { + GLctx.uniform2f(webglGetUniformLocation(location), v0, v1); + }; + + + + var _emscripten_glUniform2fv = (location, count, value) => { + + if (count <= 144) { + // avoid allocation when uploading few enough uniforms + count *= 2; + var view = miniTempWebGLFloatBuffers[count]; + for (var i = 0; i < count; i += 2) { + view[i] = HEAPF32[(((value)+(4*i))>>2)]; + view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*8)>>2)); + } + GLctx.uniform2fv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform2i = (location, v0, v1) => { + GLctx.uniform2i(webglGetUniformLocation(location), v0, v1); + }; + + + + var _emscripten_glUniform2iv = (location, count, value) => { + + if (count <= 144) { + // avoid allocation when uploading few enough uniforms + count *= 2; + var view = miniTempWebGLIntBuffers[count]; + for (var i = 0; i < count; i += 2) { + view[i] = HEAP32[(((value)+(4*i))>>2)]; + view[i+1] = HEAP32[(((value)+(4*i+4))>>2)]; + } + } else + { + var view = HEAP32.subarray((((value)>>2)), ((value+count*8)>>2)); + } + GLctx.uniform2iv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform3f = (location, v0, v1, v2) => { + GLctx.uniform3f(webglGetUniformLocation(location), v0, v1, v2); + }; + + + + var _emscripten_glUniform3fv = (location, count, value) => { + + if (count <= 96) { + // avoid allocation when uploading few enough uniforms + count *= 3; + var view = miniTempWebGLFloatBuffers[count]; + for (var i = 0; i < count; i += 3) { + view[i] = HEAPF32[(((value)+(4*i))>>2)]; + view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)]; + view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*12)>>2)); + } + GLctx.uniform3fv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform3i = (location, v0, v1, v2) => { + GLctx.uniform3i(webglGetUniformLocation(location), v0, v1, v2); + }; + + + + var _emscripten_glUniform3iv = (location, count, value) => { + + if (count <= 96) { + // avoid allocation when uploading few enough uniforms + count *= 3; + var view = miniTempWebGLIntBuffers[count]; + for (var i = 0; i < count; i += 3) { + view[i] = HEAP32[(((value)+(4*i))>>2)]; + view[i+1] = HEAP32[(((value)+(4*i+4))>>2)]; + view[i+2] = HEAP32[(((value)+(4*i+8))>>2)]; + } + } else + { + var view = HEAP32.subarray((((value)>>2)), ((value+count*12)>>2)); + } + GLctx.uniform3iv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform4f = (location, v0, v1, v2, v3) => { + GLctx.uniform4f(webglGetUniformLocation(location), v0, v1, v2, v3); + }; + + + + var _emscripten_glUniform4fv = (location, count, value) => { + + if (count <= 72) { + // avoid allocation when uploading few enough uniforms + var view = miniTempWebGLFloatBuffers[4*count]; + // hoist the heap out of the loop for size and for pthreads+growth. + var heap = HEAPF32; + value = ((value)>>2); + count *= 4; + for (var i = 0; i < count; i += 4) { + var dst = value + i; + view[i] = heap[dst]; + view[i + 1] = heap[dst + 1]; + view[i + 2] = heap[dst + 2]; + view[i + 3] = heap[dst + 3]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*16)>>2)); + } + GLctx.uniform4fv(webglGetUniformLocation(location), view); + }; + + + var _emscripten_glUniform4i = (location, v0, v1, v2, v3) => { + GLctx.uniform4i(webglGetUniformLocation(location), v0, v1, v2, v3); + }; + + + + var _emscripten_glUniform4iv = (location, count, value) => { + + if (count <= 72) { + // avoid allocation when uploading few enough uniforms + count *= 4; + var view = miniTempWebGLIntBuffers[count]; + for (var i = 0; i < count; i += 4) { + view[i] = HEAP32[(((value)+(4*i))>>2)]; + view[i+1] = HEAP32[(((value)+(4*i+4))>>2)]; + view[i+2] = HEAP32[(((value)+(4*i+8))>>2)]; + view[i+3] = HEAP32[(((value)+(4*i+12))>>2)]; + } + } else + { + var view = HEAP32.subarray((((value)>>2)), ((value+count*16)>>2)); + } + GLctx.uniform4iv(webglGetUniformLocation(location), view); + }; + + + + var _emscripten_glUniformMatrix2fv = (location, count, transpose, value) => { + + if (count <= 72) { + // avoid allocation when uploading few enough uniforms + count *= 4; + var view = miniTempWebGLFloatBuffers[count]; + for (var i = 0; i < count; i += 4) { + view[i] = HEAPF32[(((value)+(4*i))>>2)]; + view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)]; + view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)]; + view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*16)>>2)); + } + GLctx.uniformMatrix2fv(webglGetUniformLocation(location), !!transpose, view); + }; + + + + var _emscripten_glUniformMatrix3fv = (location, count, transpose, value) => { + + if (count <= 32) { + // avoid allocation when uploading few enough uniforms + count *= 9; + var view = miniTempWebGLFloatBuffers[count]; + for (var i = 0; i < count; i += 9) { + view[i] = HEAPF32[(((value)+(4*i))>>2)]; + view[i+1] = HEAPF32[(((value)+(4*i+4))>>2)]; + view[i+2] = HEAPF32[(((value)+(4*i+8))>>2)]; + view[i+3] = HEAPF32[(((value)+(4*i+12))>>2)]; + view[i+4] = HEAPF32[(((value)+(4*i+16))>>2)]; + view[i+5] = HEAPF32[(((value)+(4*i+20))>>2)]; + view[i+6] = HEAPF32[(((value)+(4*i+24))>>2)]; + view[i+7] = HEAPF32[(((value)+(4*i+28))>>2)]; + view[i+8] = HEAPF32[(((value)+(4*i+32))>>2)]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*36)>>2)); + } + GLctx.uniformMatrix3fv(webglGetUniformLocation(location), !!transpose, view); + }; + + + + var _emscripten_glUniformMatrix4fv = (location, count, transpose, value) => { + + if (count <= 18) { + // avoid allocation when uploading few enough uniforms + var view = miniTempWebGLFloatBuffers[16*count]; + // hoist the heap out of the loop for size and for pthreads+growth. + var heap = HEAPF32; + value = ((value)>>2); + count *= 16; + for (var i = 0; i < count; i += 16) { + var dst = value + i; + view[i] = heap[dst]; + view[i + 1] = heap[dst + 1]; + view[i + 2] = heap[dst + 2]; + view[i + 3] = heap[dst + 3]; + view[i + 4] = heap[dst + 4]; + view[i + 5] = heap[dst + 5]; + view[i + 6] = heap[dst + 6]; + view[i + 7] = heap[dst + 7]; + view[i + 8] = heap[dst + 8]; + view[i + 9] = heap[dst + 9]; + view[i + 10] = heap[dst + 10]; + view[i + 11] = heap[dst + 11]; + view[i + 12] = heap[dst + 12]; + view[i + 13] = heap[dst + 13]; + view[i + 14] = heap[dst + 14]; + view[i + 15] = heap[dst + 15]; + } + } else + { + var view = HEAPF32.subarray((((value)>>2)), ((value+count*64)>>2)); + } + GLctx.uniformMatrix4fv(webglGetUniformLocation(location), !!transpose, view); + }; + + var _emscripten_glUseProgram = (program) => { + program = GL.programs[program]; + GLctx.useProgram(program); + // Record the currently active program so that we can access the uniform + // mapping table of that program. + GLctx.currentProgram = program; + }; + + var _emscripten_glValidateProgram = (program) => { + GLctx.validateProgram(GL.programs[program]); + }; + + var _emscripten_glVertexAttrib1f = (x0, x1) => GLctx.vertexAttrib1f(x0, x1); + + var _emscripten_glVertexAttrib1fv = (index, v) => { + + GLctx.vertexAttrib1f(index, HEAPF32[v>>2]); + }; + + var _emscripten_glVertexAttrib2f = (x0, x1, x2) => GLctx.vertexAttrib2f(x0, x1, x2); + + var _emscripten_glVertexAttrib2fv = (index, v) => { + + GLctx.vertexAttrib2f(index, HEAPF32[v>>2], HEAPF32[v+4>>2]); + }; + + var _emscripten_glVertexAttrib3f = (x0, x1, x2, x3) => GLctx.vertexAttrib3f(x0, x1, x2, x3); + + var _emscripten_glVertexAttrib3fv = (index, v) => { + + GLctx.vertexAttrib3f(index, HEAPF32[v>>2], HEAPF32[v+4>>2], HEAPF32[v+8>>2]); + }; + + var _emscripten_glVertexAttrib4f = (x0, x1, x2, x3, x4) => GLctx.vertexAttrib4f(x0, x1, x2, x3, x4); + + var _emscripten_glVertexAttrib4fv = (index, v) => { + + GLctx.vertexAttrib4f(index, HEAPF32[v>>2], HEAPF32[v+4>>2], HEAPF32[v+8>>2], HEAPF32[v+12>>2]); + }; + + + var _emscripten_glVertexAttribDivisor = (index, divisor) => { + GLctx.vertexAttribDivisor(index, divisor); + }; + var _glVertexAttribDivisor = _emscripten_glVertexAttribDivisor; + var _emscripten_glVertexAttribDivisorANGLE = _glVertexAttribDivisor; + + var _emscripten_glVertexAttribPointer = (index, size, type, normalized, stride, ptr) => { + GLctx.vertexAttribPointer(index, size, type, !!normalized, stride, ptr); + }; + + var _emscripten_glViewport = (x0, x1, x2, x3) => GLctx.viewport(x0, x1, x2, x3); + + var _emscripten_has_asyncify = () => 0; + + + + var doRequestFullscreen = (target, strategy) => { + if (!JSEvents.fullscreenEnabled()) return -1; + target = findEventTarget(target); + if (!target) return -4; + + if (!target.requestFullscreen + && !target.webkitRequestFullscreen + ) { + return -3; + } + + // Queue this function call if we're not currently in an event handler and + // the user saw it appropriate to do so. + if (!JSEvents.canPerformEventHandlerRequests()) { + if (strategy.deferUntilInEventHandler) { + JSEvents.deferCall(JSEvents_requestFullscreen, 1 /* priority over pointer lock */, [target, strategy]); + return 1; + } + return -2; + } + + return JSEvents_requestFullscreen(target, strategy); + }; + var _emscripten_request_fullscreen_strategy = (target, deferUntilInEventHandler, fullscreenStrategy) => { + var strategy = { + scaleMode: HEAP32[((fullscreenStrategy)>>2)], + canvasResolutionScaleMode: HEAP32[(((fullscreenStrategy)+(4))>>2)], + filteringMode: HEAP32[(((fullscreenStrategy)+(8))>>2)], + deferUntilInEventHandler, + canvasResizedCallback: HEAP32[(((fullscreenStrategy)+(12))>>2)], + canvasResizedCallbackUserData: HEAP32[(((fullscreenStrategy)+(16))>>2)] + }; + + return doRequestFullscreen(target, strategy); + }; + + + + var _emscripten_request_pointerlock = (target, deferUntilInEventHandler) => { + target = findEventTarget(target); + if (!target) return -4; + if (!target.requestPointerLock) { + return -1; + } + + // Queue this function call if we're not currently in an event handler and + // the user saw it appropriate to do so. + if (!JSEvents.canPerformEventHandlerRequests()) { + if (deferUntilInEventHandler) { + JSEvents.deferCall(requestPointerLock, 2 /* priority below fullscreen */, [target]); + return 1; + } + return -2; + } + + return requestPointerLock(target); + }; + + var getHeapMax = () => + // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate + // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side + // for any code that deals with heap sizes, which would require special + // casing all heap size related code to treat 0 specially. + 2147483648; + + var alignMemory = (size, alignment) => { + assert(alignment, 'alignment argument is required'); + return Math.ceil(size / alignment) * alignment; + }; + + var growMemory = (size) => { + var oldHeapSize = wasmMemory.buffer.byteLength; + var pages = ((size - oldHeapSize + 65535) / 65536) | 0; + try { + // round size grow request up to wasm page size (fixed 64KB per spec) + wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size + updateMemoryViews(); + return 1 /*success*/; + } catch(e) { + err(`growMemory: Attempted to grow heap from ${oldHeapSize} bytes to ${size} bytes, but got error: ${e}`); + } + // implicit 0 return to save code size (caller will cast "undefined" into 0 + // anyhow) + }; + var _emscripten_resize_heap = (requestedSize) => { + var oldSize = HEAPU8.length; + // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned. + requestedSize >>>= 0; + // With multithreaded builds, races can happen (another thread might increase the size + // in between), so return a failure, and let the caller retry. + assert(requestedSize > oldSize); + + // Memory resize rules: + // 1. Always increase heap size to at least the requested size, rounded up + // to next page multiple. + // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap + // geometrically: increase the heap size according to + // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most + // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB). + // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap + // linearly: increase the heap size by at least + // MEMORY_GROWTH_LINEAR_STEP bytes. + // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by + // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest + // 4. If we were unable to allocate as much memory, it may be due to + // over-eager decision to excessively reserve due to (3) above. + // Hence if an allocation fails, cut down on the amount of excess + // growth, in an attempt to succeed to perform a smaller allocation. + + // A limit is set for how much we can grow. We should not exceed that + // (the wasm binary specifies it, so if we tried, we'd fail anyhow). + var maxHeapSize = getHeapMax(); + if (requestedSize > maxHeapSize) { + err(`Cannot enlarge memory, requested ${requestedSize} bytes, but the limit is ${maxHeapSize} bytes!`); + return false; + } + + // Loop through potential heap size increases. If we attempt a too eager + // reservation that fails, cut down on the attempted size and reserve a + // smaller bump instead. (max 3 times, chosen somewhat arbitrarily) + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth + // but limit overreserving (default to capping at +96MB overgrowth at most) + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296 ); + + var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536)); + + var replacement = growMemory(newSize); + if (replacement) { + + return true; + } + } + err(`Failed to grow the heap from ${oldSize} bytes to ${newSize} bytes, not enough memory!`); + return false; + }; + + /** @suppress {checkTypes} */ + var _emscripten_sample_gamepad_data = () => { + try { + if (navigator.getGamepads) return (JSEvents.lastGamepadState = navigator.getGamepads()) + ? 0 : -1; + } catch(e) { + err(`navigator.getGamepads() exists, but failed to execute with exception ${e}. Disabling Gamepad access.`); + navigator.getGamepads = null; // Disable getGamepads() so that it won't be attempted to be used again. + } + return -1; + }; + + + + + var registerBeforeUnloadEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) => { + var beforeUnloadEventHandlerFunc = (e) => { + // Note: This is always called on the main browser thread, since it needs synchronously return a value! + var confirmationMessage = getWasmTableEntry(callbackfunc)(eventTypeId, 0, userData); + + if (confirmationMessage) { + confirmationMessage = UTF8ToString(confirmationMessage); + } + if (confirmationMessage) { + e.preventDefault(); + e.returnValue = confirmationMessage; + return confirmationMessage; + } + }; + + var eventHandler = { + target: findEventTarget(target), + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: beforeUnloadEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + var _emscripten_set_beforeunload_callback_on_thread = (userData, callbackfunc, targetThread) => { + if (typeof onbeforeunload == 'undefined') return -1; + // beforeunload callback can only be registered on the main browser thread, because the page will go away immediately after returning from the handler, + // and there is no time to start proxying it anywhere. + if (targetThread !== 1) return -5; + return registerBeforeUnloadEventCallback(2, userData, true, callbackfunc, 28, "beforeunload"); + }; + + + + + + var registerFocusEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 256; + JSEvents.focusEvent ||= _malloc(eventSize); + + var focusEventHandlerFunc = (e) => { + var nodeName = JSEvents.getNodeNameForTarget(e.target); + var id = e.target.id ?? ''; + + var focusEvent = JSEvents.focusEvent; + stringToUTF8(nodeName, focusEvent + 0, 128); + stringToUTF8(id, focusEvent + 128, 128); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, focusEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target: findEventTarget(target), + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: focusEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + var _emscripten_set_blur_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => + registerFocusEventCallback(target, userData, useCapture, callbackfunc, 12, "blur", targetThread); + + + var _emscripten_set_element_css_size = (target, width, height) => { + target = findEventTarget(target); + if (!target) return -4; + + target.style.width = width + "px"; + target.style.height = height + "px"; + + return 0; + }; + + var _emscripten_set_focus_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => + registerFocusEventCallback(target, userData, useCapture, callbackfunc, 13, "focus", targetThread); + + + + + + var registerFullscreenChangeEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 276; + JSEvents.fullscreenChangeEvent ||= _malloc(eventSize); + + var fullscreenChangeEventHandlerFunc = (e) => { + var fullscreenChangeEvent = JSEvents.fullscreenChangeEvent; + fillFullscreenChangeEventData(fullscreenChangeEvent); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, fullscreenChangeEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: fullscreenChangeEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + + var _emscripten_set_fullscreenchange_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => { + if (!JSEvents.fullscreenEnabled()) return -1; + target = findEventTarget(target); + if (!target) return -4; + + // As of Safari 13.0.3 on macOS Catalina 10.15.1 still ships with prefixed webkitfullscreenchange. TODO: revisit this check once Safari ships unprefixed version. + // TODO: When this block is removed, also change test/test_html5_remove_event_listener.c test expectation on emscripten_set_fullscreenchange_callback(). + registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "webkitfullscreenchange", targetThread); + + return registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, 19, "fullscreenchange", targetThread); + }; + + + + + + var registerGamepadEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 1240; + JSEvents.gamepadEvent ||= _malloc(eventSize); + + var gamepadEventHandlerFunc = (e) => { + var gamepadEvent = JSEvents.gamepadEvent; + fillGamepadEventData(gamepadEvent, e["gamepad"]); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, gamepadEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target: findEventTarget(target), + allowsDeferredCalls: true, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: gamepadEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + + var _emscripten_set_gamepadconnected_callback_on_thread = (userData, useCapture, callbackfunc, targetThread) => { + if (_emscripten_sample_gamepad_data()) return -1; + return registerGamepadEventCallback(2, userData, useCapture, callbackfunc, 26, "gamepadconnected", targetThread); + }; + + + var _emscripten_set_gamepaddisconnected_callback_on_thread = (userData, useCapture, callbackfunc, targetThread) => { + if (_emscripten_sample_gamepad_data()) return -1; + return registerGamepadEventCallback(2, userData, useCapture, callbackfunc, 27, "gamepaddisconnected", targetThread); + }; + + + + + + var registerKeyEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 160; + JSEvents.keyEvent ||= _malloc(eventSize); + + var keyEventHandlerFunc = (e) => { + assert(e); + + var keyEventData = JSEvents.keyEvent; + HEAPF64[((keyEventData)>>3)] = e.timeStamp; + + var idx = ((keyEventData)>>2); + + HEAP32[idx + 2] = e.location; + HEAP8[keyEventData + 12] = e.ctrlKey; + HEAP8[keyEventData + 13] = e.shiftKey; + HEAP8[keyEventData + 14] = e.altKey; + HEAP8[keyEventData + 15] = e.metaKey; + HEAP8[keyEventData + 16] = e.repeat; + HEAP32[idx + 5] = e.charCode; + HEAP32[idx + 6] = e.keyCode; + HEAP32[idx + 7] = e.which; + stringToUTF8(e.key ?? '', keyEventData + 32, 32); + stringToUTF8(e.code ?? '', keyEventData + 64, 32); + stringToUTF8(e.char ?? '', keyEventData + 96, 32); + stringToUTF8(e.locale ?? '', keyEventData + 128, 32); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, keyEventData, userData)) e.preventDefault(); + }; + + var eventHandler = { + target: findEventTarget(target), + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: keyEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + var _emscripten_set_keydown_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => + registerKeyEventCallback(target, userData, useCapture, callbackfunc, 2, "keydown", targetThread); + + var _emscripten_set_keypress_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => + registerKeyEventCallback(target, userData, useCapture, callbackfunc, 1, "keypress", targetThread); + + var _emscripten_set_keyup_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => + registerKeyEventCallback(target, userData, useCapture, callbackfunc, 3, "keyup", targetThread); + + + var _emscripten_set_main_loop = (func, fps, simulateInfiniteLoop) => { + var iterFunc = getWasmTableEntry(func); + setMainLoop(iterFunc, fps, simulateInfiniteLoop); + }; + + + + var screenOrientation = () => { + if (!window.screen) return undefined; + return screen.orientation || screen['mozOrientation'] || screen['webkitOrientation']; + }; + var fillOrientationChangeEventData = (eventStruct) => { + // OrientationType enum + var orientationsType1 = ['portrait-primary', 'portrait-secondary', 'landscape-primary', 'landscape-secondary']; + // alternative selection from OrientationLockType enum + var orientationsType2 = ['portrait', 'portrait', 'landscape', 'landscape']; + + var orientationIndex = 0; + var orientationAngle = 0; + var screenOrientObj = screenOrientation(); + if (typeof screenOrientObj === 'object') { + orientationIndex = orientationsType1.indexOf(screenOrientObj.type); + if (orientationIndex < 0) { + orientationIndex = orientationsType2.indexOf(screenOrientObj.type); + } + if (orientationIndex >= 0) { + orientationIndex = 1 << orientationIndex; + } + orientationAngle = screenOrientObj.angle; + } + else { + // fallback for Safari earlier than 16.4 (March 2023) + orientationAngle = window.orientation; + } + + HEAP32[((eventStruct)>>2)] = orientationIndex; + HEAP32[(((eventStruct)+(4))>>2)] = orientationAngle; + }; + + + var registerOrientationChangeEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 8; + JSEvents.orientationChangeEvent ||= _malloc(eventSize); + + var orientationChangeEventHandlerFunc = (e) => { + var orientationChangeEvent = JSEvents.orientationChangeEvent; + fillOrientationChangeEventData(orientationChangeEvent); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, orientationChangeEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: orientationChangeEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + var _emscripten_set_orientationchange_callback_on_thread = (userData, useCapture, callbackfunc, targetThread) => { + if (!window.screen || !screen.orientation) return -1; + return registerOrientationChangeEventCallback(screen.orientation, userData, useCapture, callbackfunc, 18, 'change', targetThread); + }; + + + + var fillPointerlockChangeEventData = (eventStruct) => { + var pointerLockElement = document.pointerLockElement; + var isPointerlocked = !!pointerLockElement; + // Assigning a boolean to HEAP32 with expected type coercion. + /** @suppress{checkTypes} */ + HEAP8[eventStruct] = isPointerlocked; + var nodeName = JSEvents.getNodeNameForTarget(pointerLockElement); + var id = pointerLockElement?.id ?? ''; + stringToUTF8(nodeName, eventStruct + 1, 128); + stringToUTF8(id, eventStruct + 129, 128); + }; + + + var registerPointerlockChangeEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 257; + JSEvents.pointerlockChangeEvent ||= _malloc(eventSize); + + var pointerlockChangeEventHandlerFunc = (e) => { + var pointerlockChangeEvent = JSEvents.pointerlockChangeEvent; + fillPointerlockChangeEventData(pointerlockChangeEvent); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, pointerlockChangeEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: pointerlockChangeEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + + var _emscripten_set_pointerlockchange_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => { + if (!document.body?.requestPointerLock) { + return -1; + } + + target = findEventTarget(target); + if (!target) return -4; + return registerPointerlockChangeEventCallback(target, userData, useCapture, callbackfunc, 20, "pointerlockchange", targetThread); + }; + + + + + var registerUiEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 36; + JSEvents.uiEvent ||= _malloc(eventSize); + + target = findEventTarget(target); + + var uiEventHandlerFunc = (e) => { + if (e.target != target) { + // Never take ui events such as scroll via a 'bubbled' route, but always from the direct element that + // was targeted. Otherwise e.g. if app logs a message in response to a page scroll, the Emscripten log + // message box could cause to scroll, generating a new (bubbled) scroll message, causing a new log print, + // causing a new scroll, etc.. + return; + } + var b = document.body; // Take document.body to a variable, Closure compiler does not outline access to it on its own. + if (!b) { + // During a page unload 'body' can be null, with "Cannot read property 'clientWidth' of null" being thrown + return; + } + var uiEvent = JSEvents.uiEvent; + HEAP32[((uiEvent)>>2)] = 0; // always zero for resize and scroll + HEAP32[(((uiEvent)+(4))>>2)] = b.clientWidth; + HEAP32[(((uiEvent)+(8))>>2)] = b.clientHeight; + HEAP32[(((uiEvent)+(12))>>2)] = innerWidth; + HEAP32[(((uiEvent)+(16))>>2)] = innerHeight; + HEAP32[(((uiEvent)+(20))>>2)] = outerWidth; + HEAP32[(((uiEvent)+(24))>>2)] = outerHeight; + HEAP32[(((uiEvent)+(28))>>2)] = pageXOffset | 0; // scroll offsets are float + HEAP32[(((uiEvent)+(32))>>2)] = pageYOffset | 0; + if (getWasmTableEntry(callbackfunc)(eventTypeId, uiEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: uiEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + var _emscripten_set_resize_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => + registerUiEventCallback(target, userData, useCapture, callbackfunc, 10, "resize", targetThread); + + + var fillVisibilityChangeEventData = (eventStruct) => { + var visibilityStates = [ "hidden", "visible", "prerender", "unloaded" ]; + var visibilityState = visibilityStates.indexOf(document.visibilityState); + + // Assigning a boolean to HEAP32 with expected type coercion. + /** @suppress{checkTypes} */ + HEAP8[eventStruct] = document.hidden; + HEAP32[(((eventStruct)+(4))>>2)] = visibilityState; + }; + + + var registerVisibilityChangeEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 8; + JSEvents.visibilityChangeEvent ||= _malloc(eventSize); + + var visibilityChangeEventHandlerFunc = (e) => { + var visibilityChangeEvent = JSEvents.visibilityChangeEvent; + fillVisibilityChangeEventData(visibilityChangeEvent); + + if (getWasmTableEntry(callbackfunc)(eventTypeId, visibilityChangeEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: visibilityChangeEventHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + + var _emscripten_set_visibilitychange_callback_on_thread = (userData, useCapture, callbackfunc, targetThread) => { + if (!specialHTMLTargets[1]) { + return -4; + } + return registerVisibilityChangeEventCallback(specialHTMLTargets[1], userData, useCapture, callbackfunc, 21, "visibilitychange", targetThread); + }; + + + var fillMouseEventData = (eventStruct, e, target) => { + assert(eventStruct % 4 == 0); + HEAPF64[((eventStruct)>>3)] = e.timeStamp; + var idx = ((eventStruct)>>2); + HEAP32[idx + 2] = e.screenX; + HEAP32[idx + 3] = e.screenY; + HEAP32[idx + 4] = e.clientX; + HEAP32[idx + 5] = e.clientY; + HEAP8[eventStruct + 24] = e.ctrlKey; + HEAP8[eventStruct + 25] = e.shiftKey; + HEAP8[eventStruct + 26] = e.altKey; + HEAP8[eventStruct + 27] = e.metaKey; + HEAP16[idx*2 + 14] = e.button; + HEAP16[idx*2 + 15] = e.buttons; + + HEAP32[idx + 8] = e["movementX"]; + + HEAP32[idx + 9] = e["movementY"]; + + // Note: rect contains doubles (truncated to placate SAFE_HEAP, which is the same behaviour when writing to HEAP32 anyway) + var rect = getBoundingClientRect(target); + HEAP32[idx + 10] = e.clientX - (rect.left | 0); + HEAP32[idx + 11] = e.clientY - (rect.top | 0); + }; + + + var registerWheelEventCallback = (target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString, targetThread) => { + var eventSize = 96; + JSEvents.wheelEvent ||= _malloc(eventSize) + + // The DOM Level 3 events spec event 'wheel' + var wheelHandlerFunc = (e) => { + var wheelEvent = JSEvents.wheelEvent; + fillMouseEventData(wheelEvent, e, target); + HEAPF64[(((wheelEvent)+(64))>>3)] = e["deltaX"]; + HEAPF64[(((wheelEvent)+(72))>>3)] = e["deltaY"]; + HEAPF64[(((wheelEvent)+(80))>>3)] = e["deltaZ"]; + HEAP32[(((wheelEvent)+(88))>>2)] = e["deltaMode"]; + if (getWasmTableEntry(callbackfunc)(eventTypeId, wheelEvent, userData)) e.preventDefault(); + }; + + var eventHandler = { + target, + allowsDeferredCalls: true, + eventTypeString, + eventTypeId, + userData, + callbackfunc, + handlerFunc: wheelHandlerFunc, + useCapture + }; + return JSEvents.registerOrRemoveHandler(eventHandler); + }; + + var _emscripten_set_wheel_callback_on_thread = (target, userData, useCapture, callbackfunc, targetThread) => { + target = findEventTarget(target); + if (!target) return -4; + if (typeof target.onwheel != 'undefined') { + return registerWheelEventCallback(target, userData, useCapture, callbackfunc, 9, "wheel", targetThread); + } else { + return -1; + } + }; + + + var _emscripten_set_window_title = (title) => document.title = UTF8ToString(title); + + var _emscripten_sleep = () => { + abort('Please compile your program with async support in order to use asynchronous operations like emscripten_sleep'); + }; + + + var webglPowerPreferences = ["default","low-power","high-performance"]; + + + var _emscripten_webgl_do_create_context = (target, attributes) => { + assert(attributes); + var attr32 = ((attributes)>>2); + var powerPreference = HEAP32[attr32 + (8>>2)]; + var contextAttributes = { + 'alpha': !!HEAP8[attributes + 0], + 'depth': !!HEAP8[attributes + 1], + 'stencil': !!HEAP8[attributes + 2], + 'antialias': !!HEAP8[attributes + 3], + 'premultipliedAlpha': !!HEAP8[attributes + 4], + 'preserveDrawingBuffer': !!HEAP8[attributes + 5], + 'powerPreference': webglPowerPreferences[powerPreference], + 'failIfMajorPerformanceCaveat': !!HEAP8[attributes + 12], + // The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure. + majorVersion: HEAP32[attr32 + (16>>2)], + minorVersion: HEAP32[attr32 + (20>>2)], + enableExtensionsByDefault: HEAP8[attributes + 24], + explicitSwapControl: HEAP8[attributes + 25], + proxyContextToMainThread: HEAP32[attr32 + (28>>2)], + renderViaOffscreenBackBuffer: HEAP8[attributes + 32] + }; + + // TODO: Make these into hard errors at some point in the future + if (contextAttributes.majorVersion !== 1 && contextAttributes.majorVersion !== 2) { + err(`Invalid WebGL version requested: ${contextAttributes.majorVersion}`); + } + if (contextAttributes.majorVersion !== 1) { + err('WebGL 2 requested but only WebGL 1 is supported (set -sMAX_WEBGL_VERSION=2 to fix the problem)'); + } + + var canvas = findCanvasEventTarget(target); + + if (!canvas) { + return 0; + } + + if (contextAttributes.explicitSwapControl) { + return 0; + } + + var contextHandle = GL.createContext(canvas, contextAttributes); + return contextHandle; + }; + var _emscripten_webgl_create_context = _emscripten_webgl_do_create_context; + + var _emscripten_webgl_destroy_context = (contextHandle) => { + if (GL.currentContext == contextHandle) GL.currentContext = 0; + GL.deleteContext(contextHandle); + }; + + var _emscripten_webgl_make_context_current = (contextHandle) => { + var success = GL.makeContextCurrent(contextHandle); + return success ? 0 : -5; + }; + + var ENV = { + }; + + var getExecutableName = () => thisProgram; + var getEnvStrings = () => { + if (!getEnvStrings.strings) { + // Default values. + var lang = (globalThis.navigator?.language ?? 'C').replace('-', '_') + '.UTF-8'; + var env = { + 'USER': 'web_user', + 'LOGNAME': 'web_user', + 'PATH': '/', + 'PWD': '/', + 'HOME': '/home/web_user', + 'LANG': lang, + '_': getExecutableName() + }; + // Apply the user-provided values, if any. + for (var x in ENV) { + // x is a key in ENV; if ENV[x] is undefined, that means it was + // explicitly set to be so. We allow user code to do that to + // force variables with default values to remain unset. + if (ENV[x] === undefined) delete env[x]; + else env[x] = ENV[x]; + } + var strings = []; + for (var x in env) { + strings.push(`${x}=${env[x]}`); + } + getEnvStrings.strings = strings; + } + return getEnvStrings.strings; + }; + + var _environ_get = (__environ, environ_buf) => { + var bufSize = 0; + var envp = 0; + for (var string of getEnvStrings()) { + var ptr = environ_buf + bufSize; + HEAPU32[(((__environ)+(envp))>>2)] = ptr; + bufSize += stringToUTF8(string, ptr, Infinity) + 1; + envp += 4; + } + return 0; + }; + + + var _environ_sizes_get = (penviron_count, penviron_buf_size) => { + var strings = getEnvStrings(); + HEAPU32[((penviron_count)>>2)] = strings.length; + var bufSize = 0; + for (var string of strings) { + bufSize += lengthBytesUTF8(string) + 1; + } + HEAPU32[((penviron_buf_size)>>2)] = bufSize; + return 0; + }; + + + function _fd_close(fd) { + try { + + var stream = SYSCALLS.getStreamFromFD(fd); + FS.close(stream); + return 0; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return e.errno; + } + } + + + /** @param {number=} offset */ + var doReadv = (stream, iov, iovcnt, offset) => { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAPU32[((iov)>>2)]; + var len = HEAPU32[(((iov)+(4))>>2)]; + iov += 8; + var curr = FS.read(stream, HEAP8, ptr, len, offset); + if (curr < 0) return -1; + ret += curr; + if (curr < len) break; // nothing more to read + if (typeof offset != 'undefined') { + offset += curr; + } + } + return ret; + }; + + function _fd_read(fd, iov, iovcnt, pnum) { + try { + + var stream = SYSCALLS.getStreamFromFD(fd); + var num = doReadv(stream, iov, iovcnt); + HEAPU32[((pnum)>>2)] = num; + return 0; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return e.errno; + } + } + + + + function _fd_seek(fd, offset, whence, newOffset) { + offset = bigintToI53Checked(offset); + + + try { + + if (isNaN(offset)) return 22; + var stream = SYSCALLS.getStreamFromFD(fd); + FS.llseek(stream, offset, whence); + HEAP64[((newOffset)>>3)] = BigInt(stream.position); + if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state + return 0; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return e.errno; + } + ; + } + + /** @param {number=} offset */ + var doWritev = (stream, iov, iovcnt, offset) => { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAPU32[((iov)>>2)]; + var len = HEAPU32[(((iov)+(4))>>2)]; + iov += 8; + var curr = FS.write(stream, HEAP8, ptr, len, offset); + if (curr < 0) return -1; + ret += curr; + if (curr < len) { + // No more space to write. + break; + } + if (typeof offset != 'undefined') { + offset += curr; + } + } + return ret; + }; + + function _fd_write(fd, iov, iovcnt, pnum) { + try { + + var stream = SYSCALLS.getStreamFromFD(fd); + var num = doWritev(stream, iov, iovcnt); + HEAPU32[((pnum)>>2)] = num; + return 0; + } catch (e) { + if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; + return e.errno; + } + } + + + + + + var autoResumeAudioContext = (ctx) => { + for (var event of ['keydown', 'mousedown', 'touchstart']) { + for (var element of [document, document.getElementById('canvas')]) { + element?.addEventListener(event, () => { + if (ctx.state === 'suspended') ctx.resume(); + }, { 'once': true }); + } + } + }; + + var dynCall = (sig, ptr, args = [], promising = false) => { + assert(ptr, `null function pointer in dynCall`); + assert(!promising, 'async dynCall is not supported in this mode') + assert(getWasmTableEntry(ptr), `missing table entry in dynCall: ${ptr}`); + var func = getWasmTableEntry(ptr); + var rtn = func(...args); + + function convert(rtn) { + return rtn; + } + + return convert(rtn); + }; + + + + + + var writeArrayToMemory = (array, buffer) => { + assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)') + HEAP8.set(array, buffer); + }; + + + var FS_createPath = (...args) => FS.createPath(...args); + + + + var FS_unlink = (...args) => FS.unlink(...args); + + var FS_createLazyFile = (...args) => FS.createLazyFile(...args); + + var FS_createDevice = (...args) => FS.createDevice(...args); + + + + FS.createPreloadedFile = FS_createPreloadedFile; + FS.preloadFile = FS_preloadFile; + FS.staticInit();; + + Module['requestAnimationFrame'] = MainLoop.requestAnimationFrame; + Module['pauseMainLoop'] = MainLoop.pause; + Module['resumeMainLoop'] = MainLoop.resume; + MainLoop.init();; +for (let i = 0; i < 32; ++i) tempFixedLengthArray.push(new Array(i));; +var miniTempWebGLFloatBuffersStorage = new Float32Array(288); + // Create GL_POOL_TEMP_BUFFERS_SIZE+1 temporary buffers, for uploads of size 0 through GL_POOL_TEMP_BUFFERS_SIZE inclusive + for (/**@suppress{duplicate}*/var i = 0; i <= 288; ++i) { + miniTempWebGLFloatBuffers[i] = miniTempWebGLFloatBuffersStorage.subarray(0, i); + }; +var miniTempWebGLIntBuffersStorage = new Int32Array(288); + // Create GL_POOL_TEMP_BUFFERS_SIZE+1 temporary buffers, for uploads of size 0 through GL_POOL_TEMP_BUFFERS_SIZE inclusive + for (/**@suppress{duplicate}*/var i = 0; i <= 288; ++i) { + miniTempWebGLIntBuffers[i] = miniTempWebGLIntBuffersStorage.subarray(0, i); + }; +// End JS library code + +// include: postlibrary.js +// This file is included after the automatically-generated JS library code +// but before the wasm module is created. + +{ + + // Begin ATMODULES hooks + if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime']; +if (Module['preloadPlugins']) preloadPlugins = Module['preloadPlugins']; +if (Module['print']) out = Module['print']; +if (Module['printErr']) err = Module['printErr']; +if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; + // End ATMODULES hooks + + checkIncomingModuleAPI(); + + if (Module['arguments']) programArgs = Module['arguments']; + if (Module['thisProgram']) thisProgram = Module['thisProgram']; + + // Assertions on removed incoming Module JS APIs. + assert(typeof Module['memoryInitializerPrefixURL'] == 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'); + assert(typeof Module['pthreadMainPrefixURL'] == 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'); + assert(typeof Module['cdInitializerPrefixURL'] == 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'); + assert(typeof Module['filePackagePrefixURL'] == 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'); + assert(typeof Module['read'] == 'undefined', 'Module.read option was removed'); + assert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)'); + assert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)'); + assert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)'); + assert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'); + assert(typeof Module['ENVIRONMENT'] == 'undefined', 'Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)'); + assert(typeof Module['STACK_SIZE'] == 'undefined', 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time') + // If memory is defined in wasm, the user can't provide it, or set INITIAL_MEMORY + assert(typeof Module['wasmMemory'] == 'undefined', 'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'); + assert(typeof Module['INITIAL_MEMORY'] == 'undefined', 'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'); + + if (Module['preInit']) { + if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; + while (Module['preInit'].length > 0) { + Module['preInit'].shift()(); + } + } + consumedModuleProp('preInit'); +} + +// Begin runtime exports + Module['addRunDependency'] = addRunDependency; + Module['removeRunDependency'] = removeRunDependency; + Module['FS_preloadFile'] = FS_preloadFile; + Module['FS_unlink'] = FS_unlink; + Module['FS_createPath'] = FS_createPath; + Module['FS_createDevice'] = FS_createDevice; + Module['FS_createDataFile'] = FS_createDataFile; + Module['FS_createLazyFile'] = FS_createLazyFile; + var missingLibrarySymbols = [ + 'writeI53ToI64Clamped', + 'writeI53ToI64Signaling', + 'writeI53ToU64Clamped', + 'writeI53ToU64Signaling', + 'convertI32PairToI53', + 'convertI32PairToI53Checked', + 'convertU32PairToI53', + 'getTempRet0', + 'setTempRet0', + 'createNamedFunction', + 'zeroMemory', + 'withStackSave', + 'inetPton4', + 'inetNtop4', + 'inetPton6', + 'inetNtop6', + 'readSockaddr', + 'writeSockaddr', + 'getDynCaller', + 'asmjsMangle', + 'HandleAllocator', + 'addOnInit', + 'addOnPostCtor', + 'addOnPreMain', + 'STACK_SIZE', + 'STACK_ALIGN', + 'POINTER_SIZE', + 'ASSERTIONS', + 'ccall', + 'cwrap', + 'convertJsFunctionToWasm', + 'getEmptyTableSlot', + 'updateTableMap', + 'getFunctionAddress', + 'addFunction', + 'removeFunction', + 'intArrayToString', + 'AsciiToString', + 'stringToAscii', + 'UTF16ToString', + 'stringToUTF16', + 'lengthBytesUTF16', + 'UTF32ToString', + 'stringToUTF32', + 'lengthBytesUTF32', + 'registerMouseEventCallback', + 'fillDeviceOrientationEventData', + 'registerDeviceOrientationEventCallback', + 'fillDeviceMotionEventData', + 'registerDeviceMotionEventCallback', + 'hideEverythingExceptGivenElement', + 'restoreHiddenElements', + 'softFullscreenResizeWebGLRenderTarget', + 'registerPointerlockErrorEventCallback', + 'registerTouchEventCallback', + 'fillBatteryEventData', + 'registerBatteryEventCallback', + 'jsStackTrace', + 'getCallstack', + 'convertPCtoSourceLocation', + 'wasiRightsToMuslOFlags', + 'wasiOFlagsToMuslOFlags', + 'setImmediateWrapped', + 'safeRequestAnimationFrame', + 'clearImmediateWrapped', + 'registerPostMainLoop', + 'registerPreMainLoop', + 'getPromise', + 'makePromise', + 'addPromise', + 'idsToPromises', + 'makePromiseCallback', + 'ExceptionInfo', + 'findMatchingCatch', + 'incrementUncaughtExceptionCount', + 'decrementUncaughtExceptionCount', + 'Browser_asyncPrepareDataCounter', + 'isLeapYear', + 'ydayFromDate', + 'arraySum', + 'addDays', + 'getSocketFromFD', + 'getSocketAddress', + 'FS_mkdirTree', + '_setNetworkCallback', + 'writeGLArray', + 'registerWebGlEventCallback', + 'runAndAbortIfError', + 'ALLOC_NORMAL', + 'ALLOC_STACK', + 'allocate', + 'writeStringToMemory', + 'writeAsciiToMemory', + 'allocateUTF8', + 'allocateUTF8OnStack', + 'demangle', + 'stackTrace', + 'getNativeTypeSize', +]; +missingLibrarySymbols.forEach(missingLibrarySymbol) + + var unexportedSymbols = [ + 'run', + 'out', + 'err', + 'callMain', + 'abort', + 'wasmExports', + 'writeStackCookie', + 'checkStackCookie', + 'writeI53ToI64', + 'readI53FromI64', + 'readI53FromU64', + 'INT53_MAX', + 'INT53_MIN', + 'bigintToI53Checked', + 'HEAP8', + 'HEAPU8', + 'HEAP16', + 'HEAPU16', + 'HEAP32', + 'HEAPU32', + 'HEAPF32', + 'HEAPF64', + 'HEAP64', + 'HEAPU64', + 'stackSave', + 'stackRestore', + 'stackAlloc', + 'ptrToString', + 'exitJS', + 'getHeapMax', + 'growMemory', + 'ENV', + 'ERRNO_CODES', + 'strError', + 'DNS', + 'Protocols', + 'Sockets', + 'timers', + 'warnOnce', + 'readEmAsmArgsArray', + 'readEmAsmArgs', + 'runEmAsmFunction', + 'runMainThreadEmAsm', + 'jstoi_q', + 'getExecutableName', + 'autoResumeAudioContext', + 'dynCall', + 'handleException', + 'keepRuntimeAlive', + 'runtimeKeepalivePush', + 'runtimeKeepalivePop', + 'callUserCallback', + 'maybeExit', + 'asyncLoad', + 'alignMemory', + 'mmapAlloc', + 'wasmTable', + 'wasmMemory', + 'getUniqueRunDependency', + 'noExitRuntime', + 'addOnPreRun', + 'addOnExit', + 'addOnPostRun', + 'freeTableIndexes', + 'functionsInTableMap', + 'setValue', + 'getValue', + 'PATH', + 'PATH_FS', + 'UTF8Decoder', + 'UTF8ArrayToString', + 'UTF8ToString', + 'stringToUTF8Array', + 'stringToUTF8', + 'lengthBytesUTF8', + 'intArrayFromString', + 'UTF16Decoder', + 'stringToNewUTF8', + 'stringToUTF8OnStack', + 'writeArrayToMemory', + 'JSEvents', + 'registerKeyEventCallback', + 'specialHTMLTargets', + 'maybeCStringToJsString', + 'findEventTarget', + 'findCanvasEventTarget', + 'getBoundingClientRect', + 'fillMouseEventData', + 'registerWheelEventCallback', + 'registerUiEventCallback', + 'registerFocusEventCallback', + 'screenOrientation', + 'fillOrientationChangeEventData', + 'registerOrientationChangeEventCallback', + 'fillFullscreenChangeEventData', + 'registerFullscreenChangeEventCallback', + 'JSEvents_requestFullscreen', + 'JSEvents_resizeCanvasForFullscreen', + 'registerRestoreOldStyle', + 'setLetterbox', + 'currentFullscreenStrategy', + 'restoreOldWindowedStyle', + 'doRequestFullscreen', + 'fillPointerlockChangeEventData', + 'registerPointerlockChangeEventCallback', + 'requestPointerLock', + 'fillVisibilityChangeEventData', + 'registerVisibilityChangeEventCallback', + 'fillGamepadEventData', + 'registerGamepadEventCallback', + 'registerBeforeUnloadEventCallback', + 'setCanvasElementSize', + 'getCanvasElementSize', + 'UNWIND_CACHE', + 'ExitStatus', + 'getEnvStrings', + 'checkWasiClock', + 'doReadv', + 'doWritev', + 'initRandomFill', + 'randomFill', + 'safeSetTimeout', + 'emSetImmediate', + 'emClearImmediate_deps', + 'emClearImmediate', + 'promiseMap', + 'uncaughtExceptionCount', + 'exceptionCaught', + 'Browser', + 'requestFullscreen', + 'requestFullScreen', + 'setCanvasSize', + 'getUserMedia', + 'createContext', + 'getPreloadedImageData__data', + 'wget', + 'MONTH_DAYS_REGULAR', + 'MONTH_DAYS_LEAP', + 'MONTH_DAYS_REGULAR_CUMULATIVE', + 'MONTH_DAYS_LEAP_CUMULATIVE', + 'SYSCALLS', + 'preloadPlugins', + 'FS_createPreloadedFile', + 'FS_modeStringToFlags', + 'FS_getMode', + 'FS_fileDataToTypedArray', + 'FS_stdin_getChar_buffer', + 'FS_stdin_getChar', + 'FS_readFile', + 'FS', + 'FS_root', + 'FS_mounts', + 'FS_devices', + 'FS_streams', + 'FS_nextInode', + 'FS_nameTable', + 'FS_currentPath', + 'FS_initialized', + 'FS_ignorePermissions', + 'FS_filesystems', + 'FS_syncFSRequests', + 'FS_lookupPath', + 'FS_getPath', + 'FS_hashName', + 'FS_hashAddNode', + 'FS_hashRemoveNode', + 'FS_lookupNode', + 'FS_createNode', + 'FS_destroyNode', + 'FS_isRoot', + 'FS_isMountpoint', + 'FS_isFile', + 'FS_isDir', + 'FS_isLink', + 'FS_isChrdev', + 'FS_isBlkdev', + 'FS_isFIFO', + 'FS_isSocket', + 'FS_flagsToPermissionString', + 'FS_nodePermissions', + 'FS_mayLookup', + 'FS_mayCreate', + 'FS_mayDelete', + 'FS_mayOpen', + 'FS_checkOpExists', + 'FS_nextfd', + 'FS_getStreamChecked', + 'FS_getStream', + 'FS_createStream', + 'FS_closeStream', + 'FS_dupStream', + 'FS_doSetAttr', + 'FS_chrdev_stream_ops', + 'FS_major', + 'FS_minor', + 'FS_makedev', + 'FS_registerDevice', + 'FS_getDevice', + 'FS_getMounts', + 'FS_syncfs', + 'FS_mount', + 'FS_unmount', + 'FS_lookup', + 'FS_mknod', + 'FS_statfs', + 'FS_statfsStream', + 'FS_statfsNode', + 'FS_create', + 'FS_mkdir', + 'FS_mkdev', + 'FS_symlink', + 'FS_rename', + 'FS_rmdir', + 'FS_readdir', + 'FS_readlink', + 'FS_stat', + 'FS_fstat', + 'FS_lstat', + 'FS_doChmod', + 'FS_chmod', + 'FS_lchmod', + 'FS_fchmod', + 'FS_doChown', + 'FS_chown', + 'FS_lchown', + 'FS_fchown', + 'FS_doTruncate', + 'FS_truncate', + 'FS_ftruncate', + 'FS_utime', + 'FS_open', + 'FS_close', + 'FS_isClosed', + 'FS_llseek', + 'FS_read', + 'FS_write', + 'FS_mmap', + 'FS_msync', + 'FS_ioctl', + 'FS_writeFile', + 'FS_cwd', + 'FS_chdir', + 'FS_createDefaultDirectories', + 'FS_createDefaultDevices', + 'FS_createSpecialDirectories', + 'FS_createStandardStreams', + 'FS_staticInit', + 'FS_init', + 'FS_quit', + 'FS_findObject', + 'FS_analyzePath', + 'FS_createFile', + 'FS_forceLoadFile', + 'MEMFS', + 'TTY', + 'PIPEFS', + 'SOCKFS', + 'tempFixedLengthArray', + 'miniTempWebGLFloatBuffers', + 'miniTempWebGLIntBuffers', + 'heapObjectForWebGLType', + 'toTypedArrayIndex', + 'webgl_enable_ANGLE_instanced_arrays', + 'webgl_enable_OES_vertex_array_object', + 'webgl_enable_WEBGL_draw_buffers', + 'webgl_enable_WEBGL_multi_draw', + 'webgl_enable_EXT_polygon_offset_clamp', + 'webgl_enable_EXT_clip_control', + 'webgl_enable_WEBGL_polygon_mode', + 'GL', + 'emscriptenWebGLGet', + 'computeUnpackAlignedImageSize', + 'colorChannelsInGlTextureFormat', + 'emscriptenWebGLGetTexPixelData', + 'emscriptenWebGLGetUniform', + 'webglGetProgramUniformLocation', + 'webglGetUniformLocation', + 'webglPrepareUniformLocationsBeforeFirstUse', + 'webglGetLeftBracePos', + 'emscriptenWebGLGetVertexAttrib', + '__glGetActiveAttribOrUniform', + 'AL', + 'GLUT', + 'EGL', + 'GLEW', + 'IDBStore', + 'SDL', + 'SDL_gfx', + 'print', + 'printErr', + 'jstoi_s', +]; +unexportedSymbols.forEach(unexportedRuntimeSymbol); + + // End runtime exports + // Begin JS library exports + // End JS library exports + +// end include: postlibrary.js + +function checkIncomingModuleAPI() { + ignoredModuleProp('fetchSettings'); + ignoredModuleProp('logReadFiles'); + ignoredModuleProp('loadSplitModule'); + ignoredModuleProp('onMalloc'); + ignoredModuleProp('onRealloc'); + ignoredModuleProp('onFree'); + ignoredModuleProp('onSbrkGrow'); +} +var ASM_CONSTS = { + 221994: () => { if (typeof(Module['SDL3']) === 'undefined') { Module['SDL3'] = {}; } var SDL3 = Module['SDL3']; if (typeof(SDL3.JSVarToCPtr) === 'undefined') { SDL3.JSVarToCPtr = function(v) { return v; }; } if (typeof(SDL3.CPtrToHeap32Index) === 'undefined') { SDL3.CPtrToHeap32Index = function(ptr) { return ptr >>> 2; }; } }, + 222308: ($0) => { var str = UTF8ToString($0) + '\n\n' + 'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :'; var reply = window.prompt(str, "i"); if (reply === null) { reply = "i"; } return reply.length === 1 ? reply.charCodeAt(0) : -1; }, + 222523: () => { Module['SDL3'].camera = {}; }, + 222555: () => { return (navigator.mediaDevices === undefined) ? 0 : 1; }, + 222614: ($0, $1, $2, $3, $4) => { const device = $0; const w = $1; const h = $2; const framerate_numerator = $3; const framerate_denominator = $4; const outcome = Module._SDLEmscriptenCameraPermissionOutcome; const iterate = Module._SDLEmscriptenThreadIterate; const constraints = {}; if ((w <= 0) || (h <= 0)) { constraints.video = true; } else { constraints.video = {}; constraints.video.width = w; constraints.video.height = h; } if ((framerate_numerator > 0) && (framerate_denominator > 0)) { var fps = framerate_numerator / framerate_denominator; constraints.video.frameRate = { ideal: fps }; } function grabNextCameraFrame() { const SDL3 = Module['SDL3']; if ((typeof(SDL3) === 'undefined') || (typeof(SDL3.camera) === 'undefined') || (typeof(SDL3.camera.stream) === 'undefined')) { return; } const nextframems = SDL3.camera.next_frame_time; const now = performance.now(); if (now >= nextframems) { iterate(device); while (SDL3.camera.next_frame_time < now) { SDL3.camera.next_frame_time += SDL3.camera.fpsincrms; } } requestAnimationFrame(grabNextCameraFrame); } navigator.mediaDevices.getUserMedia(constraints) .then((stream) => { const settings = stream.getVideoTracks()[0].getSettings(); const actualw = settings.width; const actualh = settings.height; const actualfps = settings.frameRate; console.log("Camera is opened! Actual spec: (" + actualw + "x" + actualh + "), fps=" + actualfps); if (outcome(device, 1, actualw, actualh, actualfps)) { const video = document.createElement("video"); video.width = actualw; video.height = actualh; video.style.display = 'none'; video.srcObject = stream; const canvas = document.createElement("canvas"); canvas.width = actualw; canvas.height = actualh; canvas.style.display = 'none'; const ctx2d = canvas.getContext('2d'); const SDL3 = Module['SDL3']; SDL3.camera.width = actualw; SDL3.camera.height = actualh; SDL3.camera.fps = actualfps; SDL3.camera.fpsincrms = 1000.0 / actualfps; SDL3.camera.stream = stream; SDL3.camera.video = video; SDL3.camera.canvas = canvas; SDL3.camera.ctx2d = ctx2d; SDL3.camera.next_frame_time = performance.now(); video.play(); video.addEventListener('loadedmetadata', () => { grabNextCameraFrame(); }); } }) .catch((err) => { console.error("Tried to open camera but it threw an error! " + err.name + ": " + err.message); outcome(device, 0, 0, 0, 0); }); }, + 224920: () => { const SDL3 = Module['SDL3']; if ((typeof(SDL3) === 'undefined') || (typeof(SDL3.camera) === 'undefined') || (typeof(SDL3.camera.stream) === 'undefined')) { return; } SDL3.camera.stream.getTracks().forEach(track => track.stop()); SDL3.camera = {}; }, + 225171: ($0, $1, $2) => { const w = $0; const h = $1; const rgba = $2; const SDL3 = Module['SDL3']; if ((typeof(SDL3) === 'undefined') || (typeof(SDL3.camera) === 'undefined') || (typeof(SDL3.camera.ctx2d) === 'undefined')) { return 0; } SDL3.camera.ctx2d.drawImage(SDL3.camera.video, 0, 0, w, h); const imgrgba = SDL3.camera.ctx2d.getImageData(0, 0, w, h).data; HEAPU8.set(imgrgba, rgba); return 1; }, + 225549: () => { if (typeof(Module['SDL3']) !== 'undefined') { Module['SDL3'].camera = undefined; } }, + 225636: () => { Module['SDL3'].dummy_audio = {}; Module['SDL3'].dummy_audio.timers = []; Module['SDL3'].dummy_audio.timers[0] = undefined; Module['SDL3'].dummy_audio.timers[1] = undefined; }, + 225813: ($0, $1, $2, $3, $4) => { var a = Module['SDL3'].dummy_audio; if (a.timers[$0] !== undefined) { clearInterval(a.timers[$0]); } a.timers[$0] = setInterval(function() { dynCall('vi', $3, [$4]); }, ($1 / $2) * 1000); }, + 226005: ($0) => { var a = Module['SDL3'].dummy_audio; if (a.timers[$0] !== undefined) { clearInterval(a.timers[$0]); } a.timers[$0] = undefined; }, + 226136: () => { if (typeof(AudioContext) !== 'undefined') { return true; } else if (typeof(webkitAudioContext) !== 'undefined') { return true; } return false; }, + 226283: () => { if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) { return true; } else if (typeof(navigator.webkitGetUserMedia) !== 'undefined') { return true; } return false; }, + 226517: () => { var SDL3 = Module['SDL3']; if (typeof(SDL3.audio_playback) === 'undefined') { SDL3.audio_playback = {}; } if (typeof(SDL3.audio_recording) === 'undefined') { SDL3.audio_recording = {}; } if (!SDL3.audioContext) { if (typeof(AudioContext) !== 'undefined') { SDL3.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) !== 'undefined') { SDL3.audioContext = new webkitAudioContext(); } if (SDL3.audioContext) { if ((typeof navigator.userActivation) === 'undefined') { autoResumeAudioContext(SDL3.audioContext); } } } return (SDL3.audioContext !== undefined); }, + 227096: () => { return Module['SDL3'].audioContext.sampleRate; }, + 227147: ($0, $1, $2, $3) => { var SDL3 = Module['SDL3']; var have_microphone = function(stream) { if (SDL3.audio_recording.silenceTimer !== undefined) { clearInterval(SDL3.audio_recording.silenceTimer); SDL3.audio_recording.silenceTimer = undefined; SDL3.audio_recording.silenceBuffer = undefined } SDL3.audio_recording.mediaStreamNode = SDL3.audioContext.createMediaStreamSource(stream); SDL3.audio_recording.scriptProcessorNode = SDL3.audioContext.createScriptProcessor($1, $0, 1); SDL3.audio_recording.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { if ((SDL3 === undefined) || (SDL3.audio_recording === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL3.audio_recording.currentRecordingBuffer = audioProcessingEvent.inputBuffer; dynCall('ip', $2, [$3]); }; SDL3.audio_recording.mediaStreamNode.connect(SDL3.audio_recording.scriptProcessorNode); SDL3.audio_recording.scriptProcessorNode.connect(SDL3.audioContext.destination); SDL3.audio_recording.stream = stream; }; var no_microphone = function(error) { }; SDL3.audio_recording.silenceBuffer = SDL3.audioContext.createBuffer($0, $1, SDL3.audioContext.sampleRate); SDL3.audio_recording.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL3.audio_recording.currentRecordingBuffer = SDL3.audio_recording.silenceBuffer; dynCall('ip', $2, [$3]); }; SDL3.audio_recording.silenceTimer = setInterval(silence_callback, ($1 / SDL3.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); } else if (navigator.webkitGetUserMedia !== undefined) { navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone); } }, + 228988: ($0, $1, $2, $3) => { var SDL3 = Module['SDL3']; SDL3.audio_playback.scriptProcessorNode = SDL3.audioContext['createScriptProcessor']($1, 0, $0); SDL3.audio_playback.scriptProcessorNode['onaudioprocess'] = function (e) { if ((SDL3 === undefined) || (SDL3.audio_playback === undefined)) { return; } if (SDL3.audio_playback.silenceTimer !== undefined) { clearInterval(SDL3.audio_playback.silenceTimer); SDL3.audio_playback.silenceTimer = undefined; SDL3.audio_playback.silenceBuffer = undefined; } SDL3.audio_playback.currentPlaybackBuffer = e['outputBuffer']; dynCall('ip', $2, [$3]); }; SDL3.audio_playback.scriptProcessorNode['connect'](SDL3.audioContext['destination']); if (SDL3.audioContext.state === 'suspended') { SDL3.audio_playback.silenceBuffer = SDL3.audioContext.createBuffer($0, $1, SDL3.audioContext.sampleRate); SDL3.audio_playback.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { if ((typeof navigator.userActivation) !== 'undefined') { if (navigator.userActivation.hasBeenActive) { SDL3.audioContext.resume(); } } SDL3.audio_playback.currentPlaybackBuffer = SDL3.audio_playback.silenceBuffer; dynCall('ip', $2, [$3]); SDL3.audio_playback.currentPlaybackBuffer = undefined; }; SDL3.audio_playback.silenceTimer = setInterval(silence_callback, ($1 / SDL3.audioContext.sampleRate) * 1000); } }, + 230304: ($0) => { var SDL3 = Module['SDL3']; if ($0) { if (SDL3.audio_recording.silenceTimer !== undefined) { clearInterval(SDL3.audio_recording.silenceTimer); } if (SDL3.audio_recording.stream !== undefined) { var tracks = SDL3.audio_recording.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { SDL3.audio_recording.stream.removeTrack(tracks[i]); } } if (SDL3.audio_recording.scriptProcessorNode !== undefined) { SDL3.audio_recording.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; SDL3.audio_recording.scriptProcessorNode.disconnect(); } if (SDL3.audio_recording.mediaStreamNode !== undefined) { SDL3.audio_recording.mediaStreamNode.disconnect(); } SDL3.audio_recording = undefined; } else { if (SDL3.audio_playback.scriptProcessorNode != undefined) { SDL3.audio_playback.scriptProcessorNode.disconnect(); } if (SDL3.audio_playback.silenceTimer !== undefined) { clearInterval(SDL3.audio_playback.silenceTimer); } SDL3.audio_playback = undefined; } if ((SDL3.audioContext !== undefined) && (SDL3.audio_playback === undefined) && (SDL3.audio_recording === undefined)) { SDL3.audioContext.close(); SDL3.audioContext = undefined; } }, + 231460: ($0, $1) => { var SDL3 = Module['SDL3']; var buf = SDL3.CPtrToHeap32Index($0); var numChannels = SDL3.audio_playback.currentPlaybackBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { var channelData = SDL3.audio_playback.currentPlaybackBuffer['getChannelData'](c); if (channelData.length != $1) { throw 'Web Audio playback buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } for (var j = 0; j < $1; ++j) { channelData[j] = HEAPF32[buf + (j * numChannels + c)]; } } }, + 231993: ($0, $1) => { var SDL3 = Module['SDL3']; var numChannels = SDL3.audio_recording.currentRecordingBuffer.numberOfChannels; for (var c = 0; c < numChannels; ++c) { var channelData = SDL3.audio_recording.currentRecordingBuffer.getChannelData(c); if (channelData.length != $1) { throw 'Web Audio recording buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } if (numChannels == 1) { for (var j = 0; j < $1; ++j) { setValue($0 + (j * 4), channelData[j], 'float'); } } else { for (var j = 0; j < $1; ++j) { setValue($0 + (((j * numChannels) + c) * 4), channelData[j], 'float'); } } } }, + 232620: ($0) => { let gamepads = navigator['getGamepads'](); if (!gamepads) { return 0; } let gamepad = gamepads[$0]; if (!gamepad || !gamepad['vibrationActuator']) { return 0; } return 1; }, + 232795: ($0, $1, $2) => { let gamepads = navigator['getGamepads'](); if (!gamepads) { return 0; } let gamepad = gamepads[$0]; if (!gamepad || !gamepad['vibrationActuator']) { return 0; } gamepad['vibrationActuator']['playEffect']('dual-rumble', { 'startDelay': 0, 'duration': 3000, 'weakMagnitude': $2 / 0xFFFF, 'strongMagnitude': $1 / 0xFFFF, }); return 1; }, + 233131: ($0) => { var parms = new URLSearchParams(window.location.search); for (const [key, value] of parms) { if (key.startsWith("SDL_")) { var ckey = stringToNewUTF8(key); var cvalue = stringToNewUTF8(value); if ((ckey != 0) && (cvalue != 0)) { dynCall('iiii', $0, [ckey, cvalue, 1]); } _Emscripten_force_free(ckey); _Emscripten_force_free(cvalue); } } }, + 233472: ($0, $1, $2, $3) => { var w = $0; var h = $1; var pixels = $2; var canvasId = UTF8ToString($3); var canvas = document.querySelector(canvasId); var SDL3 = Module['SDL3']; if (SDL3.ctxCanvas !== canvas) { SDL3.ctx = Browser.createContext(canvas, false, true); if (!SDL3.ctx) { return false; } SDL3.ctxCanvas = canvas; } if (SDL3.w !== w || SDL3.h !== h || SDL3.imageCtx !== SDL3.ctx) { SDL3.image = SDL3.ctx.createImageData(w, h); SDL3.w = w; SDL3.h = h; SDL3.imageCtx = SDL3.ctx; } var data = SDL3.image.data; var src = pixels / 4; if (SDL3.data32Data !== data) { SDL3.data32 = new Int32Array(data.buffer); SDL3.data32Data = data; } var data32 = SDL3.data32; data32.set(HEAP32.subarray(src, src + data32.length)); SDL3.ctx.putImageData(SDL3.image, 0, 0); return true; }, + 234221: () => { var SDL3 = Module['SDL3']; SDL3['mouse_x'] = 0; SDL3['mouse_y'] = 0; SDL3['mouse_buttons'] = []; for (var i = 0; i < 5; ++i) { SDL3['mouse_buttons'][i] = false; } document.addEventListener('mousemove', function(e) { var SDL3 = Module['SDL3']; SDL3['mouse_x'] = e.clientX; SDL3['mouse_y'] = e.clientY; }); document.addEventListener('mousedown', function(e) { var SDL3 = Module['SDL3']; if (0 <= e.button && e.button < SDL3['mouse_buttons'].length) { SDL3['mouse_buttons'][e.button] = true; } }); document.addEventListener('mouseup', function(e) { var SDL3 = Module['SDL3']; if (0 <= e.button && e.button < SDL3['mouse_buttons'].length) { SDL3['mouse_buttons'][e.button] = false; } }); }, + 234909: ($0, $1, $2, $3, $4) => { var w = $0; var h = $1; var hot_x = $2; var hot_y = $3; var pixels = $4; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; var ctx = canvas.getContext("2d"); var image = ctx.createImageData(w, h); var data = image.data; var src = pixels / 4; var data32 = new Int32Array(data.buffer); data32.set(HEAP32.subarray(src, src + data32.length)); ctx.putImageData(image, 0, 0); var url = hot_x === 0 && hot_y === 0 ? "url(" + canvas.toDataURL() + "), auto" : "url(" + canvas.toDataURL() + ") " + hot_x + " " + hot_y + ", auto"; var urlBuf = _SDL_malloc(url.length + 1); stringToUTF8(url, urlBuf, url.length + 1); return urlBuf; }, + 235567: ($0) => { if (Module['canvas']) { Module['canvas'].style['cursor'] = UTF8ToString($0); } }, + 235650: () => { if (Module['canvas']) { Module['canvas'].style['cursor'] = 'none'; } }, + 235719: () => { return Module['SDL3']['mouse_x']; }, + 235757: () => { return Module['SDL3']['mouse_y']; }, + 235795: ($0) => { return Module['SDL3']['mouse_buttons'][$0]; }, + 235843: ($0) => { var data = $0; document.sdlEventHandlerLockKeysCheck = function(event) { if ((event.key != "CapsLock") && (event.key != "NumLock") && (event.key != "ScrollLock")) { _Emscripten_HandleLockKeysCheck(Module['SDL3'].JSVarToCPtr(data), event.getModifierState("CapsLock"), event.getModifierState("NumLock"), event.getModifierState("ScrollLock")); } }; document.addEventListener("keydown", document.sdlEventHandlerLockKeysCheck); }, + 236270: () => { document.removeEventListener("keydown", document.sdlEventHandlerLockKeysCheck); }, + 236354: ($0) => { var target = document; if (target) { target.sdlEventHandlerMouseButtonUpGlobal = function(event) { var SDL3 = Module['SDL3']; var d = SDL3.makePointerEventCStruct(0, 0, event); if (d != 0) { _Emscripten_HandleMouseButtonUpGlobal(SDL3.JSVarToCPtr($0), d); _SDL_free(d); } }; target.addEventListener("pointerup", target.sdlEventHandlerMouseButtonUpGlobal); } }, + 236715: ($0) => { var SDL3 = Module['SDL3']; if (SDL3.makePointerEventCStruct === undefined) { SDL3.makePointerEventCStruct = function(left, top, event) { var ptrtype = 0; if (event.pointerType == "mouse") { ptrtype = 1; } else if (event.pointerType == "touch") { ptrtype = 2; } else if (event.pointerType == "pen") { ptrtype = 3; } else { return 0; } var ptr = _SDL_malloc($0); if (ptr != 0) { var idx = SDL3.CPtrToHeap32Index(ptr); HEAP32[idx++] = ptrtype; HEAP32[idx++] = event.pointerId; HEAP32[idx++] = (typeof(event.button) !== "undefined") ? event.button : -1; HEAP32[idx++] = event.buttons; HEAP32[idx++] = (event.type == "pointerdown") ? 1 : 0; HEAPF32[idx++] = event.movementX; HEAPF32[idx++] = event.movementY; HEAPF32[idx++] = event.clientX - left; HEAPF32[idx++] = event.clientY - top; if (ptrtype == 3) { HEAPF32[idx++] = event.pressure; HEAPF32[idx++] = event.tangentialPressure; HEAPF32[idx++] = event.tiltX; HEAPF32[idx++] = event.tiltY; HEAPF32[idx++] = event.twist; } } return ptr; }; } }, + 237707: ($0) => { var id = UTF8ToString($0); try { var canvas = document.querySelector(id); if (canvas) { return canvas === document.activeElement; } } catch (e) { } return false; }, + 237873: () => { return document.hasFocus(); }, + 237905: () => { var target = document; if (target) { target.removeEventListener("pointerup", target.sdlEventHandlerMouseButtonUpGlobal); target.sdlEventHandlerMouseButtonUpGlobal = undefined; } }, + 238087: () => { return document.body.clientWidth; }, + 238125: () => { return document.body.clientHeight; }, + 238164: () => { return window.innerWidth; }, + 238194: () => { return window.innerHeight; }, + 238225: () => { return window.outerWidth; }, + 238255: () => { return window.outerHeight; }, + 238286: () => { return window.pageXOffset; }, + 238317: () => { return window.pageYOffset; }, + 238348: ($0, $1) => { var target = document.querySelector(UTF8ToString($1)); if (target) { var SDL3 = Module['SDL3']; var data = $0; target.sdlEventHandlerPointerEnter = function(event) { var rect = target.getBoundingClientRect(); var d = SDL3.makePointerEventCStruct(rect.left, rect.top, event); if (d != 0) { _Emscripten_HandlePointerEnter(SDL3.JSVarToCPtr(data), d); _SDL_free(d); } }; target.sdlEventHandlerPointerLeave = function(event) { var rect = target.getBoundingClientRect(); var d = SDL3.makePointerEventCStruct(rect.left, rect.top, event); if (d != 0) { _Emscripten_HandlePointerLeave(SDL3.JSVarToCPtr(data), d); _SDL_free(d); } }; target.sdlEventHandlerPointerGeneric = function(event) { var rect = target.getBoundingClientRect(); var d = SDL3.makePointerEventCStruct(rect.left, rect.top, event); if (d != 0) { _Emscripten_HandlePointerGeneric(SDL3.JSVarToCPtr(data), d); _SDL_free(d); } }; target.style.touchAction = "none"; target.addEventListener("pointerenter", target.sdlEventHandlerPointerEnter); target.addEventListener("pointerleave", target.sdlEventHandlerPointerLeave); target.addEventListener("pointercancel", target.sdlEventHandlerPointerLeave); target.addEventListener("pointerdown", target.sdlEventHandlerPointerGeneric); target.addEventListener("pointermove", target.sdlEventHandlerPointerGeneric); target.addEventListener("pointerup", target.sdlEventHandlerPointerGeneric); } }, + 239736: ($0, $1, $2) => { var target = document.querySelector(UTF8ToString($1)); if (target) { var data = $0; var SDL3 = Module['SDL3']; var makeDropEventCStruct = function(event) { var ptr = 0; ptr = _SDL_malloc($2); if (ptr != 0) { var idx = ptr >> 2; var rect = target.getBoundingClientRect(); HEAP32[idx++] = event.clientX - rect.left; HEAP32[idx++] = event.clientY - rect.top; } return ptr; }; SDL3.eventHandlerDropDragover = function(event) { event.preventDefault(); var d = makeDropEventCStruct(event); if (d != 0) { _Emscripten_SendDragEvent(data, d); _SDL_free(d); } }; target.addEventListener("dragover", SDL3.eventHandlerDropDragover); SDL3.drop_count = 0; try { FS.mkdir("/tmp/filedrop"); } catch (e) {} SDL3.eventHandlerDropDrop = function(event) { event.preventDefault(); if (event.dataTransfer.types.includes("text/plain")) { let plain_text = stringToNewUTF8(event.dataTransfer.getData("text/plain")); _Emscripten_SendDragTextEvent(data, plain_text); _Emscripten_force_free(plain_text); } else if (event.dataTransfer.types.includes("Files")) { let files_read = 0; const files_to_read = event.dataTransfer.files.length; for (let i = 0; i < files_to_read; i++) { const file = event.dataTransfer.files.item(i); const file_reader = new FileReader(); file_reader.readAsArrayBuffer(file); file_reader.onload = function(event) { const fs_dropdir = `/tmp/filedrop/${SDL3.drop_count}`; SDL3.drop_count += 1; const fs_filepath = `${fs_dropdir}/${file.name}`; const c_fs_filepath = stringToNewUTF8(fs_filepath); const contents_array8 = new Uint8Array(event.target.result); try { FS.mkdir(fs_dropdir); var stream = FS.open(fs_filepath, "w"); FS.write(stream, contents_array8, 0, contents_array8.length, 0); FS.close(stream); _Emscripten_SendDragFileEvent(data, c_fs_filepath); } catch (e) { } _Emscripten_force_free(c_fs_filepath); onFileRead(); }; file_reader.onerror = function(event) { onFileRead(); }; } function onFileRead() { ++files_read; if (files_read === files_to_read) { _Emscripten_SendDragCompleteEvent(data); } } } _Emscripten_SendDragCompleteEvent(data); }; target.addEventListener("drop", SDL3.eventHandlerDropDrop); SDL3.eventHandlerDropDragend = function(event) { event.preventDefault(); _Emscripten_SendDragCompleteEvent(data); }; target.addEventListener("dragend", SDL3.eventHandlerDropDragend); target.addEventListener("dragleave", SDL3.eventHandlerDropDragend); } }, + 242103: ($0) => { var target = document.querySelector(UTF8ToString($0)); if (target) { var SDL3 = Module['SDL3']; target.removeEventListener("dragleave", SDL3.eventHandlerDropDragend); target.removeEventListener("dragend", SDL3.eventHandlerDropDragend); target.removeEventListener("drop", SDL3.eventHandlerDropDrop); SDL3.drop_count = undefined; function recursive_remove(dirpath) { FS.readdir(dirpath).forEach((filename) => { const p = `${dirpath}/${filename}`; const p_s = FS.stat(p); if (FS.isFile(p_s.mode)) { FS.unlink(p); } else if (FS.isDir(p)) { recursive_remove(p); } }); FS.rmdir(dirpath); }("/tmp/filedrop"); FS.rmdir("/tmp/filedrop"); target.removeEventListener("dragover", SDL3.eventHandlerDropDragover); SDL3.eventHandlerDropDragover = undefined; SDL3.eventHandlerDropDrop = undefined; SDL3.eventHandlerDropDragend = undefined; } }, + 242933: ($0) => { var target = document.querySelector(UTF8ToString($0)); if (target) { target.removeEventListener("pointerenter", target.sdlEventHandlerPointerEnter); target.removeEventListener("pointerleave", target.sdlEventHandlerPointerLeave); target.removeEventListener("pointercancel", target.sdlEventHandlerPointerLeave); target.removeEventListener("pointerdown", target.sdlEventHandlerPointerGeneric); target.removeEventListener("pointermove", target.sdlEventHandlerPointerGeneric); target.removeEventListener("pointerup", target.sdlEventHandlerPointerGeneric); target.style.touchAction = ""; target.sdlEventHandlerPointerEnter = undefined; target.sdlEventHandlerPointerLeave = undefined; target.sdlEventHandlerPointerGeneric = undefined; } }, + 243667: () => { if (!window.matchMedia) { return -1; } if (window.matchMedia('(prefers-color-scheme: light)').matches) { return 0; } if (window.matchMedia('(prefers-color-scheme: dark)').matches) { return 1; } return -1; }, + 243876: () => { if (typeof(Module['SDL3']) !== 'undefined') { var SDL3 = Module['SDL3']; SDL3.themeChangedMatchMedia.removeEventListener('change', SDL3.eventHandlerThemeChanged); SDL3.themeChangedMatchMedia = undefined; SDL3.eventHandlerThemeChanged = undefined; } }, + 244129: () => { return window.innerWidth; }, + 244159: () => { return window.innerHeight; }, + 244190: ($0) => { Module['requestFullscreen'] = function(lockPointer, resizeCanvas) { _requestFullscreenThroughSDL($0); }; }, + 244299: ($0, $1) => { var pngData = HEAPU8.buffer instanceof ArrayBuffer ? HEAPU8.subarray($0, $0 + $1) : HEAPU8.slice($0, $0 + $1); var blob = new Blob([pngData], {type: 'image/png'}); var url = URL.createObjectURL(blob); var link = document.querySelector("link[rel~='icon']"); if (!link) { link = document.createElement('link'); link.rel = 'icon'; link.type = 'image/png'; document.head.appendChild(link); } if (link.href && link.href.startsWith('blob:')) { URL.revokeObjectURL(link.href); } link.href = url; }, + 244792: () => { Module['requestFullscreen'] = function(lockPointer, resizeCanvas) {}; }, + 244866: () => { return window.innerWidth; }, + 244896: () => { return window.innerHeight; }, + 244927: ($0) => { var canvas = document.querySelector(UTF8ToString($0)); canvas.SDL3_original_position = canvas.style.position; canvas.SDL3_original_top = canvas.style.top; canvas.SDL3_original_left = canvas.style.left; var div = document.createElement('div'); div.id = 'SDL3_fill_document_background_elements'; div.SDL3_canvas = canvas; div.SDL3_canvas_parent = canvas.parentNode; div.SDL3_canvas_nextsib = canvas.nextSibling; var children = Array.from(document.body.children); for (var child of children) { div.appendChild(child); } document.body.appendChild(div); div.style.display = 'none'; document.body.appendChild(canvas); canvas.style.position = 'fixed'; canvas.style.top = '0'; canvas.style.left = '0'; }, + 245625: () => { var div = document.getElementById('SDL3_fill_document_background_elements'); if (div) { if (div.SDL3_canvas_nextsib) { div.SDL3_canvas_parent.insertBefore(div.SDL3_canvas, div.SDL3_canvas_nextsib); } else { div.SDL3_canvas_parent.appendChild(div.SDL3_canvas); } while (div.firstChild) { document.body.insertBefore(div.firstChild, div); } div.SDL3_canvas.style.position = div.SDL3_canvas.SDL3_original_position; div.SDL3_canvas.style.top = div.SDL3_canvas.SDL3_original_top; div.SDL3_canvas.style.left = div.SDL3_canvas.SDL3_original_left; div.remove(); } }, + 246184: () => { if (window.matchMedia) { var SDL3 = Module['SDL3']; SDL3.eventHandlerThemeChanged = function(event) { _Emscripten_SendSystemThemeChangedEvent(); }; SDL3.themeChangedMatchMedia = window.matchMedia('(prefers-color-scheme: dark)'); SDL3.themeChangedMatchMedia.addEventListener('change', SDL3.eventHandlerThemeChanged); } }, + 246506: ($0, $1, $2, $3, $4) => { var title = UTF8ToString($0); var message = UTF8ToString($1); var background = UTF8ToString($2); var color = UTF8ToString($3); var id = UTF8ToString($4); var dialog = document.createElement("dialog"); dialog.classList.add("SDL3_messagebox"); dialog.id = id; dialog.style.color = color; dialog.style.backgroundColor = background; document.body.append(dialog); var h1 = document.createElement("h1"); h1.innerText = title; dialog.append(h1); var p = document.createElement("p"); p.innerText = message; dialog.append(p); dialog.showModal(); }, + 247047: ($0, $1, $2, $3, $4, $5, $6, $7) => { var dialog_id = UTF8ToString($0); var text = UTF8ToString($1); var responseId = $2; var clickOnReturn = $3; var clickOnEscape = $4; var border = UTF8ToString($5); var background = UTF8ToString($6); var hovered = UTF8ToString($7); var dialog = document.getElementById(dialog_id); if (!dialog) { return false; } var button = document.createElement("button"); button.innerText = text; button.style.borderColor = border; button.style.backgroundColor = background; dialog.addEventListener('keydown', function(e) { if (clickOnReturn && e.key === "Enter") { e.preventDefault(); button.click(); } else if (clickOnEscape && e.key === "Escape") { e.preventDefault(); button.click(); } }); dialog.addEventListener('cancel', function(e){ e.preventDefault(); }); button.onmouseenter = function(e){ button.style.backgroundColor = hovered; }; button.onmouseleave = function(e){ button.style.backgroundColor = background; }; button.onclick = function(e) { dialog.close(responseId); }; dialog.append(button); return true; }, + 248056: ($0) => { var dialog_id = UTF8ToString($0); var dialog = document.getElementById(dialog_id); if (!dialog) { return false; } return dialog.open; }, + 248194: ($0) => { var dialog_id = UTF8ToString($0); var dialog = document.getElementById(dialog_id); if (!dialog) { return 0; } try { return parseInt(dialog.returnValue); } catch(e) { return 0; } }, + 248376: ($0, $1) => { alert(UTF8ToString($0) + "\n\n" + UTF8ToString($1)); } +}; +function signalReady(pDifficulty,pNewGame) { window.parent.postMessage({op: "ready"}); window.addEventListener("message", ev => { if ("op" in ev.data) { switch(ev.data.op) { case "start": console.log("Difficulty set to", ev.data.difficulty); setValue(pDifficulty, ev.data.difficulty, "float"); setValue(pNewGame, 1, "i8"); break; } } }); } +function signalStart() { window.parent.postMessage({op: "started", verb: "Defend!"}); } +function signalDone(won) { window.parent.postMessage({op: "done", win: !!won}); } +function SDL_GetEmscriptenJoystickVendor(device_index) { let gamepad = navigator['getGamepads']()[device_index]; let vendor_str = 'Vendor: '; if (gamepad['id']['indexOf'](vendor_str) > 0) { let vendor_str_index = gamepad['id']['indexOf'](vendor_str) + vendor_str['length']; return parseInt(gamepad['id']['substr'](vendor_str_index, 4), 16); } let id_split = gamepad['id']['split']('-'); if (id_split['length'] > 1 && !isNaN(parseInt(id_split[0], 16))) { return parseInt(id_split[0], 16); } return 0; } +function SDL_GetEmscriptenJoystickProduct(device_index) { let gamepad = navigator['getGamepads']()[device_index]; let product_str = 'Product: '; if (gamepad['id']['indexOf'](product_str) > 0) { let product_str_index = gamepad['id']['indexOf'](product_str) + product_str['length']; return parseInt(gamepad['id']['substr'](product_str_index, 4), 16); } let id_split = gamepad['id']['split']('-'); if (id_split['length'] > 1 && !isNaN(parseInt(id_split[1], 16))) { return parseInt(id_split[1], 16); } return 0; } +function SDL_IsEmscriptenJoystickXInput(device_index) { let gamepad = navigator['getGamepads']()[device_index]; return gamepad['id']['toLowerCase']()['indexOf']('xinput') >= 0; } + +// Imports from the Wasm binary. +var _main = Module['_main'] = makeInvalidEarlyAccess('_main'); +var _SDL_free = Module['_SDL_free'] = makeInvalidEarlyAccess('_SDL_free'); +var _SDL_malloc = Module['_SDL_malloc'] = makeInvalidEarlyAccess('_SDL_malloc'); +var _SDL_calloc = Module['_SDL_calloc'] = makeInvalidEarlyAccess('_SDL_calloc'); +var _SDL_realloc = Module['_SDL_realloc'] = makeInvalidEarlyAccess('_SDL_realloc'); +var _SDLEmscriptenCameraPermissionOutcome = Module['_SDLEmscriptenCameraPermissionOutcome'] = makeInvalidEarlyAccess('_SDLEmscriptenCameraPermissionOutcome'); +var _SDLEmscriptenThreadIterate = Module['_SDLEmscriptenThreadIterate'] = makeInvalidEarlyAccess('_SDLEmscriptenThreadIterate'); +var _Emscripten_HandlePointerEnter = Module['_Emscripten_HandlePointerEnter'] = makeInvalidEarlyAccess('_Emscripten_HandlePointerEnter'); +var _Emscripten_HandlePointerLeave = Module['_Emscripten_HandlePointerLeave'] = makeInvalidEarlyAccess('_Emscripten_HandlePointerLeave'); +var _Emscripten_HandlePointerGeneric = Module['_Emscripten_HandlePointerGeneric'] = makeInvalidEarlyAccess('_Emscripten_HandlePointerGeneric'); +var _Emscripten_HandleMouseButtonUpGlobal = Module['_Emscripten_HandleMouseButtonUpGlobal'] = makeInvalidEarlyAccess('_Emscripten_HandleMouseButtonUpGlobal'); +var _Emscripten_SendDragEvent = Module['_Emscripten_SendDragEvent'] = makeInvalidEarlyAccess('_Emscripten_SendDragEvent'); +var _Emscripten_SendDragCompleteEvent = Module['_Emscripten_SendDragCompleteEvent'] = makeInvalidEarlyAccess('_Emscripten_SendDragCompleteEvent'); +var _Emscripten_SendDragTextEvent = Module['_Emscripten_SendDragTextEvent'] = makeInvalidEarlyAccess('_Emscripten_SendDragTextEvent'); +var _Emscripten_SendDragFileEvent = Module['_Emscripten_SendDragFileEvent'] = makeInvalidEarlyAccess('_Emscripten_SendDragFileEvent'); +var _Emscripten_HandleLockKeysCheck = Module['_Emscripten_HandleLockKeysCheck'] = makeInvalidEarlyAccess('_Emscripten_HandleLockKeysCheck'); +var _Emscripten_SendSystemThemeChangedEvent = Module['_Emscripten_SendSystemThemeChangedEvent'] = makeInvalidEarlyAccess('_Emscripten_SendSystemThemeChangedEvent'); +var _requestFullscreenThroughSDL = Module['_requestFullscreenThroughSDL'] = makeInvalidEarlyAccess('_requestFullscreenThroughSDL'); +var _strerror = makeInvalidEarlyAccess('_strerror'); +var _fflush = makeInvalidEarlyAccess('_fflush'); +var _malloc = makeInvalidEarlyAccess('_malloc'); +var _Emscripten_force_free = Module['_Emscripten_force_free'] = makeInvalidEarlyAccess('_Emscripten_force_free'); +var ___funcs_on_exit = makeInvalidEarlyAccess('___funcs_on_exit'); +var _emscripten_stack_get_end = makeInvalidEarlyAccess('_emscripten_stack_get_end'); +var _emscripten_stack_get_base = makeInvalidEarlyAccess('_emscripten_stack_get_base'); +var _emscripten_stack_init = makeInvalidEarlyAccess('_emscripten_stack_init'); +var _emscripten_stack_get_free = makeInvalidEarlyAccess('_emscripten_stack_get_free'); +var __emscripten_stack_restore = makeInvalidEarlyAccess('__emscripten_stack_restore'); +var __emscripten_stack_alloc = makeInvalidEarlyAccess('__emscripten_stack_alloc'); +var _emscripten_stack_get_current = makeInvalidEarlyAccess('_emscripten_stack_get_current'); +var memory = makeInvalidEarlyAccess('memory'); +var __indirect_function_table = makeInvalidEarlyAccess('__indirect_function_table'); +var wasmMemory = makeInvalidEarlyAccess('wasmMemory'); +var wasmTable = makeInvalidEarlyAccess('wasmTable'); + +function assignWasmExports(wasmExports) { + assert(typeof wasmExports['__main_argc_argv'] != 'undefined', 'missing Wasm export: __main_argc_argv'); + assert(typeof wasmExports['SDL_free'] != 'undefined', 'missing Wasm export: SDL_free'); + assert(typeof wasmExports['SDL_malloc'] != 'undefined', 'missing Wasm export: SDL_malloc'); + assert(typeof wasmExports['SDL_calloc'] != 'undefined', 'missing Wasm export: SDL_calloc'); + assert(typeof wasmExports['SDL_realloc'] != 'undefined', 'missing Wasm export: SDL_realloc'); + assert(typeof wasmExports['SDLEmscriptenCameraPermissionOutcome'] != 'undefined', 'missing Wasm export: SDLEmscriptenCameraPermissionOutcome'); + assert(typeof wasmExports['SDLEmscriptenThreadIterate'] != 'undefined', 'missing Wasm export: SDLEmscriptenThreadIterate'); + assert(typeof wasmExports['Emscripten_HandlePointerEnter'] != 'undefined', 'missing Wasm export: Emscripten_HandlePointerEnter'); + assert(typeof wasmExports['Emscripten_HandlePointerLeave'] != 'undefined', 'missing Wasm export: Emscripten_HandlePointerLeave'); + assert(typeof wasmExports['Emscripten_HandlePointerGeneric'] != 'undefined', 'missing Wasm export: Emscripten_HandlePointerGeneric'); + assert(typeof wasmExports['Emscripten_HandleMouseButtonUpGlobal'] != 'undefined', 'missing Wasm export: Emscripten_HandleMouseButtonUpGlobal'); + assert(typeof wasmExports['Emscripten_SendDragEvent'] != 'undefined', 'missing Wasm export: Emscripten_SendDragEvent'); + assert(typeof wasmExports['Emscripten_SendDragCompleteEvent'] != 'undefined', 'missing Wasm export: Emscripten_SendDragCompleteEvent'); + assert(typeof wasmExports['Emscripten_SendDragTextEvent'] != 'undefined', 'missing Wasm export: Emscripten_SendDragTextEvent'); + assert(typeof wasmExports['Emscripten_SendDragFileEvent'] != 'undefined', 'missing Wasm export: Emscripten_SendDragFileEvent'); + assert(typeof wasmExports['Emscripten_HandleLockKeysCheck'] != 'undefined', 'missing Wasm export: Emscripten_HandleLockKeysCheck'); + assert(typeof wasmExports['Emscripten_SendSystemThemeChangedEvent'] != 'undefined', 'missing Wasm export: Emscripten_SendSystemThemeChangedEvent'); + assert(typeof wasmExports['requestFullscreenThroughSDL'] != 'undefined', 'missing Wasm export: requestFullscreenThroughSDL'); + assert(typeof wasmExports['strerror'] != 'undefined', 'missing Wasm export: strerror'); + assert(typeof wasmExports['fflush'] != 'undefined', 'missing Wasm export: fflush'); + assert(typeof wasmExports['malloc'] != 'undefined', 'missing Wasm export: malloc'); + assert(typeof wasmExports['Emscripten_force_free'] != 'undefined', 'missing Wasm export: Emscripten_force_free'); + assert(typeof wasmExports['__funcs_on_exit'] != 'undefined', 'missing Wasm export: __funcs_on_exit'); + assert(typeof wasmExports['emscripten_stack_get_end'] != 'undefined', 'missing Wasm export: emscripten_stack_get_end'); + assert(typeof wasmExports['emscripten_stack_get_base'] != 'undefined', 'missing Wasm export: emscripten_stack_get_base'); + assert(typeof wasmExports['emscripten_stack_init'] != 'undefined', 'missing Wasm export: emscripten_stack_init'); + assert(typeof wasmExports['emscripten_stack_get_free'] != 'undefined', 'missing Wasm export: emscripten_stack_get_free'); + assert(typeof wasmExports['_emscripten_stack_restore'] != 'undefined', 'missing Wasm export: _emscripten_stack_restore'); + assert(typeof wasmExports['_emscripten_stack_alloc'] != 'undefined', 'missing Wasm export: _emscripten_stack_alloc'); + assert(typeof wasmExports['emscripten_stack_get_current'] != 'undefined', 'missing Wasm export: emscripten_stack_get_current'); + assert(typeof wasmExports['memory'] != 'undefined', 'missing Wasm export: memory'); + assert(typeof wasmExports['__indirect_function_table'] != 'undefined', 'missing Wasm export: __indirect_function_table'); + _main = Module['_main'] = createExportWrapper('__main_argc_argv', 2); + _SDL_free = Module['_SDL_free'] = createExportWrapper('SDL_free', 1); + _SDL_malloc = Module['_SDL_malloc'] = createExportWrapper('SDL_malloc', 1); + _SDL_calloc = Module['_SDL_calloc'] = createExportWrapper('SDL_calloc', 2); + _SDL_realloc = Module['_SDL_realloc'] = createExportWrapper('SDL_realloc', 2); + _SDLEmscriptenCameraPermissionOutcome = Module['_SDLEmscriptenCameraPermissionOutcome'] = createExportWrapper('SDLEmscriptenCameraPermissionOutcome', 5); + _SDLEmscriptenThreadIterate = Module['_SDLEmscriptenThreadIterate'] = createExportWrapper('SDLEmscriptenThreadIterate', 1); + _Emscripten_HandlePointerEnter = Module['_Emscripten_HandlePointerEnter'] = createExportWrapper('Emscripten_HandlePointerEnter', 2); + _Emscripten_HandlePointerLeave = Module['_Emscripten_HandlePointerLeave'] = createExportWrapper('Emscripten_HandlePointerLeave', 2); + _Emscripten_HandlePointerGeneric = Module['_Emscripten_HandlePointerGeneric'] = createExportWrapper('Emscripten_HandlePointerGeneric', 2); + _Emscripten_HandleMouseButtonUpGlobal = Module['_Emscripten_HandleMouseButtonUpGlobal'] = createExportWrapper('Emscripten_HandleMouseButtonUpGlobal', 2); + _Emscripten_SendDragEvent = Module['_Emscripten_SendDragEvent'] = createExportWrapper('Emscripten_SendDragEvent', 2); + _Emscripten_SendDragCompleteEvent = Module['_Emscripten_SendDragCompleteEvent'] = createExportWrapper('Emscripten_SendDragCompleteEvent', 1); + _Emscripten_SendDragTextEvent = Module['_Emscripten_SendDragTextEvent'] = createExportWrapper('Emscripten_SendDragTextEvent', 2); + _Emscripten_SendDragFileEvent = Module['_Emscripten_SendDragFileEvent'] = createExportWrapper('Emscripten_SendDragFileEvent', 2); + _Emscripten_HandleLockKeysCheck = Module['_Emscripten_HandleLockKeysCheck'] = createExportWrapper('Emscripten_HandleLockKeysCheck', 4); + _Emscripten_SendSystemThemeChangedEvent = Module['_Emscripten_SendSystemThemeChangedEvent'] = createExportWrapper('Emscripten_SendSystemThemeChangedEvent', 0); + _requestFullscreenThroughSDL = Module['_requestFullscreenThroughSDL'] = createExportWrapper('requestFullscreenThroughSDL', 1); + _strerror = createExportWrapper('strerror', 1); + _fflush = createExportWrapper('fflush', 1); + _malloc = createExportWrapper('malloc', 1); + _Emscripten_force_free = Module['_Emscripten_force_free'] = createExportWrapper('Emscripten_force_free', 1); + ___funcs_on_exit = createExportWrapper('__funcs_on_exit', 0); + _emscripten_stack_get_end = wasmExports['emscripten_stack_get_end']; + _emscripten_stack_get_base = wasmExports['emscripten_stack_get_base']; + _emscripten_stack_init = wasmExports['emscripten_stack_init']; + _emscripten_stack_get_free = wasmExports['emscripten_stack_get_free']; + __emscripten_stack_restore = wasmExports['_emscripten_stack_restore']; + __emscripten_stack_alloc = wasmExports['_emscripten_stack_alloc']; + _emscripten_stack_get_current = wasmExports['emscripten_stack_get_current']; + memory = wasmMemory = wasmExports['memory']; + __indirect_function_table = wasmTable = wasmExports['__indirect_function_table']; +} + +var wasmImports = { + /** @export */ + SDL_GetEmscriptenJoystickProduct, + /** @export */ + SDL_GetEmscriptenJoystickVendor, + /** @export */ + SDL_IsEmscriptenJoystickXInput, + /** @export */ + __syscall_fcntl64: ___syscall_fcntl64, + /** @export */ + __syscall_fdatasync: ___syscall_fdatasync, + /** @export */ + __syscall_fstat64: ___syscall_fstat64, + /** @export */ + __syscall_ioctl: ___syscall_ioctl, + /** @export */ + __syscall_lstat64: ___syscall_lstat64, + /** @export */ + __syscall_newfstatat: ___syscall_newfstatat, + /** @export */ + __syscall_openat: ___syscall_openat, + /** @export */ + __syscall_rmdir: ___syscall_rmdir, + /** @export */ + __syscall_stat64: ___syscall_stat64, + /** @export */ + __syscall_unlinkat: ___syscall_unlinkat, + /** @export */ + _abort_js: __abort_js, + /** @export */ + _emscripten_fs_load_embedded_files: __emscripten_fs_load_embedded_files, + /** @export */ + clock_time_get: _clock_time_get, + /** @export */ + emscripten_asm_const_double_sync_on_main_thread: _emscripten_asm_const_double_sync_on_main_thread, + /** @export */ + emscripten_asm_const_int: _emscripten_asm_const_int, + /** @export */ + emscripten_asm_const_int_sync_on_main_thread: _emscripten_asm_const_int_sync_on_main_thread, + /** @export */ + emscripten_asm_const_ptr_sync_on_main_thread: _emscripten_asm_const_ptr_sync_on_main_thread, + /** @export */ + emscripten_cancel_main_loop: _emscripten_cancel_main_loop, + /** @export */ + emscripten_date_now: _emscripten_date_now, + /** @export */ + emscripten_err: _emscripten_err, + /** @export */ + emscripten_exit_fullscreen: _emscripten_exit_fullscreen, + /** @export */ + emscripten_exit_pointerlock: _emscripten_exit_pointerlock, + /** @export */ + emscripten_get_device_pixel_ratio: _emscripten_get_device_pixel_ratio, + /** @export */ + emscripten_get_element_css_size: _emscripten_get_element_css_size, + /** @export */ + emscripten_get_fullscreen_status: _emscripten_get_fullscreen_status, + /** @export */ + emscripten_get_gamepad_status: _emscripten_get_gamepad_status, + /** @export */ + emscripten_get_main_loop_timing: _emscripten_get_main_loop_timing, + /** @export */ + emscripten_get_now: _emscripten_get_now, + /** @export */ + emscripten_get_num_gamepads: _emscripten_get_num_gamepads, + /** @export */ + emscripten_get_screen_size: _emscripten_get_screen_size, + /** @export */ + emscripten_glActiveTexture: _emscripten_glActiveTexture, + /** @export */ + emscripten_glAttachShader: _emscripten_glAttachShader, + /** @export */ + emscripten_glBeginQueryEXT: _emscripten_glBeginQueryEXT, + /** @export */ + emscripten_glBindAttribLocation: _emscripten_glBindAttribLocation, + /** @export */ + emscripten_glBindBuffer: _emscripten_glBindBuffer, + /** @export */ + emscripten_glBindFramebuffer: _emscripten_glBindFramebuffer, + /** @export */ + emscripten_glBindRenderbuffer: _emscripten_glBindRenderbuffer, + /** @export */ + emscripten_glBindTexture: _emscripten_glBindTexture, + /** @export */ + emscripten_glBindVertexArrayOES: _emscripten_glBindVertexArrayOES, + /** @export */ + emscripten_glBlendColor: _emscripten_glBlendColor, + /** @export */ + emscripten_glBlendEquation: _emscripten_glBlendEquation, + /** @export */ + emscripten_glBlendEquationSeparate: _emscripten_glBlendEquationSeparate, + /** @export */ + emscripten_glBlendFunc: _emscripten_glBlendFunc, + /** @export */ + emscripten_glBlendFuncSeparate: _emscripten_glBlendFuncSeparate, + /** @export */ + emscripten_glBufferData: _emscripten_glBufferData, + /** @export */ + emscripten_glBufferSubData: _emscripten_glBufferSubData, + /** @export */ + emscripten_glCheckFramebufferStatus: _emscripten_glCheckFramebufferStatus, + /** @export */ + emscripten_glClear: _emscripten_glClear, + /** @export */ + emscripten_glClearColor: _emscripten_glClearColor, + /** @export */ + emscripten_glClearDepthf: _emscripten_glClearDepthf, + /** @export */ + emscripten_glClearStencil: _emscripten_glClearStencil, + /** @export */ + emscripten_glClipControlEXT: _emscripten_glClipControlEXT, + /** @export */ + emscripten_glColorMask: _emscripten_glColorMask, + /** @export */ + emscripten_glCompileShader: _emscripten_glCompileShader, + /** @export */ + emscripten_glCompressedTexImage2D: _emscripten_glCompressedTexImage2D, + /** @export */ + emscripten_glCompressedTexSubImage2D: _emscripten_glCompressedTexSubImage2D, + /** @export */ + emscripten_glCopyTexImage2D: _emscripten_glCopyTexImage2D, + /** @export */ + emscripten_glCopyTexSubImage2D: _emscripten_glCopyTexSubImage2D, + /** @export */ + emscripten_glCreateProgram: _emscripten_glCreateProgram, + /** @export */ + emscripten_glCreateShader: _emscripten_glCreateShader, + /** @export */ + emscripten_glCullFace: _emscripten_glCullFace, + /** @export */ + emscripten_glDeleteBuffers: _emscripten_glDeleteBuffers, + /** @export */ + emscripten_glDeleteFramebuffers: _emscripten_glDeleteFramebuffers, + /** @export */ + emscripten_glDeleteProgram: _emscripten_glDeleteProgram, + /** @export */ + emscripten_glDeleteQueriesEXT: _emscripten_glDeleteQueriesEXT, + /** @export */ + emscripten_glDeleteRenderbuffers: _emscripten_glDeleteRenderbuffers, + /** @export */ + emscripten_glDeleteShader: _emscripten_glDeleteShader, + /** @export */ + emscripten_glDeleteTextures: _emscripten_glDeleteTextures, + /** @export */ + emscripten_glDeleteVertexArraysOES: _emscripten_glDeleteVertexArraysOES, + /** @export */ + emscripten_glDepthFunc: _emscripten_glDepthFunc, + /** @export */ + emscripten_glDepthMask: _emscripten_glDepthMask, + /** @export */ + emscripten_glDepthRangef: _emscripten_glDepthRangef, + /** @export */ + emscripten_glDetachShader: _emscripten_glDetachShader, + /** @export */ + emscripten_glDisable: _emscripten_glDisable, + /** @export */ + emscripten_glDisableVertexAttribArray: _emscripten_glDisableVertexAttribArray, + /** @export */ + emscripten_glDrawArrays: _emscripten_glDrawArrays, + /** @export */ + emscripten_glDrawArraysInstancedANGLE: _emscripten_glDrawArraysInstancedANGLE, + /** @export */ + emscripten_glDrawBuffersWEBGL: _emscripten_glDrawBuffersWEBGL, + /** @export */ + emscripten_glDrawElements: _emscripten_glDrawElements, + /** @export */ + emscripten_glDrawElementsInstancedANGLE: _emscripten_glDrawElementsInstancedANGLE, + /** @export */ + emscripten_glEnable: _emscripten_glEnable, + /** @export */ + emscripten_glEnableVertexAttribArray: _emscripten_glEnableVertexAttribArray, + /** @export */ + emscripten_glEndQueryEXT: _emscripten_glEndQueryEXT, + /** @export */ + emscripten_glFinish: _emscripten_glFinish, + /** @export */ + emscripten_glFlush: _emscripten_glFlush, + /** @export */ + emscripten_glFramebufferRenderbuffer: _emscripten_glFramebufferRenderbuffer, + /** @export */ + emscripten_glFramebufferTexture2D: _emscripten_glFramebufferTexture2D, + /** @export */ + emscripten_glFrontFace: _emscripten_glFrontFace, + /** @export */ + emscripten_glGenBuffers: _emscripten_glGenBuffers, + /** @export */ + emscripten_glGenFramebuffers: _emscripten_glGenFramebuffers, + /** @export */ + emscripten_glGenQueriesEXT: _emscripten_glGenQueriesEXT, + /** @export */ + emscripten_glGenRenderbuffers: _emscripten_glGenRenderbuffers, + /** @export */ + emscripten_glGenTextures: _emscripten_glGenTextures, + /** @export */ + emscripten_glGenVertexArraysOES: _emscripten_glGenVertexArraysOES, + /** @export */ + emscripten_glGenerateMipmap: _emscripten_glGenerateMipmap, + /** @export */ + emscripten_glGetActiveAttrib: _emscripten_glGetActiveAttrib, + /** @export */ + emscripten_glGetActiveUniform: _emscripten_glGetActiveUniform, + /** @export */ + emscripten_glGetAttachedShaders: _emscripten_glGetAttachedShaders, + /** @export */ + emscripten_glGetAttribLocation: _emscripten_glGetAttribLocation, + /** @export */ + emscripten_glGetBooleanv: _emscripten_glGetBooleanv, + /** @export */ + emscripten_glGetBufferParameteriv: _emscripten_glGetBufferParameteriv, + /** @export */ + emscripten_glGetError: _emscripten_glGetError, + /** @export */ + emscripten_glGetFloatv: _emscripten_glGetFloatv, + /** @export */ + emscripten_glGetFramebufferAttachmentParameteriv: _emscripten_glGetFramebufferAttachmentParameteriv, + /** @export */ + emscripten_glGetIntegerv: _emscripten_glGetIntegerv, + /** @export */ + emscripten_glGetProgramInfoLog: _emscripten_glGetProgramInfoLog, + /** @export */ + emscripten_glGetProgramiv: _emscripten_glGetProgramiv, + /** @export */ + emscripten_glGetQueryObjecti64vEXT: _emscripten_glGetQueryObjecti64vEXT, + /** @export */ + emscripten_glGetQueryObjectivEXT: _emscripten_glGetQueryObjectivEXT, + /** @export */ + emscripten_glGetQueryObjectui64vEXT: _emscripten_glGetQueryObjectui64vEXT, + /** @export */ + emscripten_glGetQueryObjectuivEXT: _emscripten_glGetQueryObjectuivEXT, + /** @export */ + emscripten_glGetQueryivEXT: _emscripten_glGetQueryivEXT, + /** @export */ + emscripten_glGetRenderbufferParameteriv: _emscripten_glGetRenderbufferParameteriv, + /** @export */ + emscripten_glGetShaderInfoLog: _emscripten_glGetShaderInfoLog, + /** @export */ + emscripten_glGetShaderPrecisionFormat: _emscripten_glGetShaderPrecisionFormat, + /** @export */ + emscripten_glGetShaderSource: _emscripten_glGetShaderSource, + /** @export */ + emscripten_glGetShaderiv: _emscripten_glGetShaderiv, + /** @export */ + emscripten_glGetString: _emscripten_glGetString, + /** @export */ + emscripten_glGetTexParameterfv: _emscripten_glGetTexParameterfv, + /** @export */ + emscripten_glGetTexParameteriv: _emscripten_glGetTexParameteriv, + /** @export */ + emscripten_glGetUniformLocation: _emscripten_glGetUniformLocation, + /** @export */ + emscripten_glGetUniformfv: _emscripten_glGetUniformfv, + /** @export */ + emscripten_glGetUniformiv: _emscripten_glGetUniformiv, + /** @export */ + emscripten_glGetVertexAttribPointerv: _emscripten_glGetVertexAttribPointerv, + /** @export */ + emscripten_glGetVertexAttribfv: _emscripten_glGetVertexAttribfv, + /** @export */ + emscripten_glGetVertexAttribiv: _emscripten_glGetVertexAttribiv, + /** @export */ + emscripten_glHint: _emscripten_glHint, + /** @export */ + emscripten_glIsBuffer: _emscripten_glIsBuffer, + /** @export */ + emscripten_glIsEnabled: _emscripten_glIsEnabled, + /** @export */ + emscripten_glIsFramebuffer: _emscripten_glIsFramebuffer, + /** @export */ + emscripten_glIsProgram: _emscripten_glIsProgram, + /** @export */ + emscripten_glIsQueryEXT: _emscripten_glIsQueryEXT, + /** @export */ + emscripten_glIsRenderbuffer: _emscripten_glIsRenderbuffer, + /** @export */ + emscripten_glIsShader: _emscripten_glIsShader, + /** @export */ + emscripten_glIsTexture: _emscripten_glIsTexture, + /** @export */ + emscripten_glIsVertexArrayOES: _emscripten_glIsVertexArrayOES, + /** @export */ + emscripten_glLineWidth: _emscripten_glLineWidth, + /** @export */ + emscripten_glLinkProgram: _emscripten_glLinkProgram, + /** @export */ + emscripten_glPixelStorei: _emscripten_glPixelStorei, + /** @export */ + emscripten_glPolygonModeWEBGL: _emscripten_glPolygonModeWEBGL, + /** @export */ + emscripten_glPolygonOffset: _emscripten_glPolygonOffset, + /** @export */ + emscripten_glPolygonOffsetClampEXT: _emscripten_glPolygonOffsetClampEXT, + /** @export */ + emscripten_glQueryCounterEXT: _emscripten_glQueryCounterEXT, + /** @export */ + emscripten_glReadPixels: _emscripten_glReadPixels, + /** @export */ + emscripten_glReleaseShaderCompiler: _emscripten_glReleaseShaderCompiler, + /** @export */ + emscripten_glRenderbufferStorage: _emscripten_glRenderbufferStorage, + /** @export */ + emscripten_glSampleCoverage: _emscripten_glSampleCoverage, + /** @export */ + emscripten_glScissor: _emscripten_glScissor, + /** @export */ + emscripten_glShaderBinary: _emscripten_glShaderBinary, + /** @export */ + emscripten_glShaderSource: _emscripten_glShaderSource, + /** @export */ + emscripten_glStencilFunc: _emscripten_glStencilFunc, + /** @export */ + emscripten_glStencilFuncSeparate: _emscripten_glStencilFuncSeparate, + /** @export */ + emscripten_glStencilMask: _emscripten_glStencilMask, + /** @export */ + emscripten_glStencilMaskSeparate: _emscripten_glStencilMaskSeparate, + /** @export */ + emscripten_glStencilOp: _emscripten_glStencilOp, + /** @export */ + emscripten_glStencilOpSeparate: _emscripten_glStencilOpSeparate, + /** @export */ + emscripten_glTexImage2D: _emscripten_glTexImage2D, + /** @export */ + emscripten_glTexParameterf: _emscripten_glTexParameterf, + /** @export */ + emscripten_glTexParameterfv: _emscripten_glTexParameterfv, + /** @export */ + emscripten_glTexParameteri: _emscripten_glTexParameteri, + /** @export */ + emscripten_glTexParameteriv: _emscripten_glTexParameteriv, + /** @export */ + emscripten_glTexSubImage2D: _emscripten_glTexSubImage2D, + /** @export */ + emscripten_glUniform1f: _emscripten_glUniform1f, + /** @export */ + emscripten_glUniform1fv: _emscripten_glUniform1fv, + /** @export */ + emscripten_glUniform1i: _emscripten_glUniform1i, + /** @export */ + emscripten_glUniform1iv: _emscripten_glUniform1iv, + /** @export */ + emscripten_glUniform2f: _emscripten_glUniform2f, + /** @export */ + emscripten_glUniform2fv: _emscripten_glUniform2fv, + /** @export */ + emscripten_glUniform2i: _emscripten_glUniform2i, + /** @export */ + emscripten_glUniform2iv: _emscripten_glUniform2iv, + /** @export */ + emscripten_glUniform3f: _emscripten_glUniform3f, + /** @export */ + emscripten_glUniform3fv: _emscripten_glUniform3fv, + /** @export */ + emscripten_glUniform3i: _emscripten_glUniform3i, + /** @export */ + emscripten_glUniform3iv: _emscripten_glUniform3iv, + /** @export */ + emscripten_glUniform4f: _emscripten_glUniform4f, + /** @export */ + emscripten_glUniform4fv: _emscripten_glUniform4fv, + /** @export */ + emscripten_glUniform4i: _emscripten_glUniform4i, + /** @export */ + emscripten_glUniform4iv: _emscripten_glUniform4iv, + /** @export */ + emscripten_glUniformMatrix2fv: _emscripten_glUniformMatrix2fv, + /** @export */ + emscripten_glUniformMatrix3fv: _emscripten_glUniformMatrix3fv, + /** @export */ + emscripten_glUniformMatrix4fv: _emscripten_glUniformMatrix4fv, + /** @export */ + emscripten_glUseProgram: _emscripten_glUseProgram, + /** @export */ + emscripten_glValidateProgram: _emscripten_glValidateProgram, + /** @export */ + emscripten_glVertexAttrib1f: _emscripten_glVertexAttrib1f, + /** @export */ + emscripten_glVertexAttrib1fv: _emscripten_glVertexAttrib1fv, + /** @export */ + emscripten_glVertexAttrib2f: _emscripten_glVertexAttrib2f, + /** @export */ + emscripten_glVertexAttrib2fv: _emscripten_glVertexAttrib2fv, + /** @export */ + emscripten_glVertexAttrib3f: _emscripten_glVertexAttrib3f, + /** @export */ + emscripten_glVertexAttrib3fv: _emscripten_glVertexAttrib3fv, + /** @export */ + emscripten_glVertexAttrib4f: _emscripten_glVertexAttrib4f, + /** @export */ + emscripten_glVertexAttrib4fv: _emscripten_glVertexAttrib4fv, + /** @export */ + emscripten_glVertexAttribDivisorANGLE: _emscripten_glVertexAttribDivisorANGLE, + /** @export */ + emscripten_glVertexAttribPointer: _emscripten_glVertexAttribPointer, + /** @export */ + emscripten_glViewport: _emscripten_glViewport, + /** @export */ + emscripten_has_asyncify: _emscripten_has_asyncify, + /** @export */ + emscripten_request_fullscreen_strategy: _emscripten_request_fullscreen_strategy, + /** @export */ + emscripten_request_pointerlock: _emscripten_request_pointerlock, + /** @export */ + emscripten_resize_heap: _emscripten_resize_heap, + /** @export */ + emscripten_sample_gamepad_data: _emscripten_sample_gamepad_data, + /** @export */ + emscripten_set_beforeunload_callback_on_thread: _emscripten_set_beforeunload_callback_on_thread, + /** @export */ + emscripten_set_blur_callback_on_thread: _emscripten_set_blur_callback_on_thread, + /** @export */ + emscripten_set_canvas_element_size: _emscripten_set_canvas_element_size, + /** @export */ + emscripten_set_element_css_size: _emscripten_set_element_css_size, + /** @export */ + emscripten_set_focus_callback_on_thread: _emscripten_set_focus_callback_on_thread, + /** @export */ + emscripten_set_fullscreenchange_callback_on_thread: _emscripten_set_fullscreenchange_callback_on_thread, + /** @export */ + emscripten_set_gamepadconnected_callback_on_thread: _emscripten_set_gamepadconnected_callback_on_thread, + /** @export */ + emscripten_set_gamepaddisconnected_callback_on_thread: _emscripten_set_gamepaddisconnected_callback_on_thread, + /** @export */ + emscripten_set_keydown_callback_on_thread: _emscripten_set_keydown_callback_on_thread, + /** @export */ + emscripten_set_keypress_callback_on_thread: _emscripten_set_keypress_callback_on_thread, + /** @export */ + emscripten_set_keyup_callback_on_thread: _emscripten_set_keyup_callback_on_thread, + /** @export */ + emscripten_set_main_loop: _emscripten_set_main_loop, + /** @export */ + emscripten_set_main_loop_timing: _emscripten_set_main_loop_timing, + /** @export */ + emscripten_set_orientationchange_callback_on_thread: _emscripten_set_orientationchange_callback_on_thread, + /** @export */ + emscripten_set_pointerlockchange_callback_on_thread: _emscripten_set_pointerlockchange_callback_on_thread, + /** @export */ + emscripten_set_resize_callback_on_thread: _emscripten_set_resize_callback_on_thread, + /** @export */ + emscripten_set_visibilitychange_callback_on_thread: _emscripten_set_visibilitychange_callback_on_thread, + /** @export */ + emscripten_set_wheel_callback_on_thread: _emscripten_set_wheel_callback_on_thread, + /** @export */ + emscripten_set_window_title: _emscripten_set_window_title, + /** @export */ + emscripten_sleep: _emscripten_sleep, + /** @export */ + emscripten_webgl_create_context: _emscripten_webgl_create_context, + /** @export */ + emscripten_webgl_destroy_context: _emscripten_webgl_destroy_context, + /** @export */ + emscripten_webgl_make_context_current: _emscripten_webgl_make_context_current, + /** @export */ + environ_get: _environ_get, + /** @export */ + environ_sizes_get: _environ_sizes_get, + /** @export */ + exit: _exit, + /** @export */ + fd_close: _fd_close, + /** @export */ + fd_read: _fd_read, + /** @export */ + fd_seek: _fd_seek, + /** @export */ + fd_write: _fd_write, + /** @export */ + signalDone, + /** @export */ + signalReady, + /** @export */ + signalStart +}; + + +// include: postamble.js +// === Auto-generated postamble setup entry stuff === + +var calledRun; + +function callMain(args = []) { + assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'); + assert(typeof onPreRuns === 'undefined' || onPreRuns.length == 0, 'cannot call main when preRun functions remain to be called'); + + var entryFunction = _main; + + args.unshift(thisProgram); + + var argc = args.length; + var argv = stackAlloc((argc + 1) * 4); + var argv_ptr = argv; + for (var arg of args) { + HEAPU32[((argv_ptr)>>2)] = stringToUTF8OnStack(arg); + argv_ptr += 4; + } + HEAPU32[((argv_ptr)>>2)] = 0; + + try { + + var ret = entryFunction(argc, argv); + + // if we're not running an evented main loop, it's time to exit + exitJS(ret, /* implicit = */ true); + return ret; + } catch (e) { + return handleException(e); + } +} + +function stackCheckInit() { + // This is normally called automatically during __wasm_call_ctors but need to + // get these values before even running any of the ctors so we call it redundantly + // here. + _emscripten_stack_init(); + // TODO(sbc): Move writeStackCookie to native to to avoid this. + writeStackCookie(); +} + +function run(args = programArgs) { + + if (runDependencies > 0) { + dependenciesFulfilled = run; + return; + } + + stackCheckInit(); + + preRun(); + + // a preRun added a dependency, run will be called later + if (runDependencies > 0) { + dependenciesFulfilled = run; + return; + } + + function doRun() { + // run may have just been called through dependencies being fulfilled just in this very frame, + // or while the async setStatus time below was happening + assert(!calledRun); + calledRun = true; + Module['calledRun'] = true; + + if (ABORT) return; + + initRuntime(); + + preMain(); + + Module['onRuntimeInitialized']?.(); + consumedModuleProp('onRuntimeInitialized'); + + var noInitialRun = Module['noInitialRun'] || false; + if (!noInitialRun) callMain(args); + + postRun(); + } + + if (Module['setStatus']) { + Module['setStatus']('Running...'); + setTimeout(() => { + setTimeout(() => Module['setStatus'](''), 1); + doRun(); + }, 1); + } else + { + doRun(); + } + checkStackCookie(); +} + +var wasmExports; + +// With async instantation wasmExports is assigned asynchronously when the +// instance is received. +createWasm(); + +run(); + +// end include: postamble.js + +// include: /home/kevinc/misc/emsdk/upstream/emscripten/src/emrun_postjs.js +/** + * @license + * Copyright 2013 The Emscripten Authors + * SPDX-License-Identifier: MIT + * + * This file gets implicitly injected as a `--post-js` file when + * emcc is run with `--emrun` + */ + +// POSTs the given binary data represented as a (typed) array data back to the +// emrun-based web server. +// To use from C code, call e.g: +// EM_ASM({emrun_file_dump("file.dat", HEAPU8.subarray($0, $0 + $1));}, my_data_pointer, my_data_pointer_byte_length); +// Note: this functions does nothing by default but gets redefined below +// in `emrun_register_handlers` when emrun is active, along with `out` and +// `err`. +var emrun_file_dump = (filename, data) => {}; + +if (globalThis.window && globalThis.document && (typeof ENVIRONMENT_IS_PTHREAD == 'undefined' || !ENVIRONMENT_IS_PTHREAD)) { + var emrun_register_handlers = () => { + // When C code exit()s, we may still have remaining stdout and stderr + // messages in flight. In that case, we can't close the browser until all + // those XHRs have finished, so the following state variables track that all + // communication is done, after which we can close. + var emrun_num_post_messages_in_flight = 0; + var emrun_should_close_itself = false; + var postExit = (msg) => { + var http = new XMLHttpRequest(); + // Don't do this immediately, this may race with the notification about + // the return code reaching the server. Send a *sync* xhr so that we know + // for sure that the server has gotten the return code before we continue. + http.open("POST", "stdio.html", false); + http.send(msg); + try { + // Try closing the current browser window, since it exit()ed itself. + // This can shut down the browser process and then emrun does not need + // to kill the whole browser process. + window.close(); + } catch(e) {} + }; + var post = (url, msg) => { + var http = new XMLHttpRequest(); + ++emrun_num_post_messages_in_flight; + http.onreadystatechange = () => { + if (http.readyState == 4 /*DONE*/) { + if (--emrun_num_post_messages_in_flight == 0 && emrun_should_close_itself) { + postExit('^exit^'+EXITSTATUS); + } + } + } + http.open("POST", url, true); + http.send(msg); + }; + // If the address contains localhost, or we are running the page from port + // 6931, we can assume we're running the test runner and should post stdout + // logs. + if (document.URL.search("localhost") != -1 || document.URL.search(":6931/") != -1) { + var emrun_http_sequence_number = 1; + var prevPrint = out; + var prevErr = err; + addOnExit(() => { + if (emrun_num_post_messages_in_flight == 0) { + postExit('^exit^'+EXITSTATUS); + } else { + emrun_should_close_itself = true; + } + }); + out = (text) => { + post('stdio.html', '^out^'+(emrun_http_sequence_number++)+'^'+encodeURIComponent(text)); + prevPrint(text); + }; + err = (text) => { + post('stdio.html', '^err^'+(emrun_http_sequence_number++)+'^'+encodeURIComponent(text)); + prevErr(text); + }; + emrun_file_dump = (filename, data) => { + out(`Dumping out file "${filename}" with ${data.length} bytes of data.`); + if (ArrayBuffer.isView(data) && typeof SharedArrayBuffer !== "undefined" && data.buffer instanceof SharedArrayBuffer) { + data = new data.constructor(data); // Make a clone of the typed array of the same type, since http.send() does not allow SharedArrayBuffer backing. + } + post("stdio.html?file=" + filename, data); + }; + + // Notify emrun web server that this browser has successfully launched the + // page. Note that we may need to wait for the server to be ready. + var tryToSendPageload = () => { + try { + post('stdio.html', '^pageload^'); + } catch (e) { + setTimeout(tryToSendPageload, 50); + } + }; + tryToSendPageload(); + } + }; + + emrun_register_handlers(); +} +// end include: /home/kevinc/misc/emsdk/upstream/emscripten/src/emrun_postjs.js + diff --git a/2026/games_submissions/talon1024/index.wasm b/2026/games_submissions/talon1024/index.wasm Binary files differnew file mode 100755 index 0000000..f5910f8 --- /dev/null +++ b/2026/games_submissions/talon1024/index.wasm diff --git a/2026/games_submissions/the0x539/.gitignore b/2026/games_submissions/the0x539/.gitignore new file mode 100644 index 0000000..845270b --- /dev/null +++ b/2026/games_submissions/the0x539/.gitignore @@ -0,0 +1 @@ +harness diff --git a/2026/games_submissions/the0x539/MinecraftStandard.otf b/2026/games_submissions/the0x539/MinecraftStandard.otf Binary files differnew file mode 100755 index 0000000..8fa0b3e --- /dev/null +++ b/2026/games_submissions/the0x539/MinecraftStandard.otf diff --git a/2026/games_submissions/the0x539/crafting.js b/2026/games_submissions/the0x539/crafting.js new file mode 100644 index 0000000..7a61cfc --- /dev/null +++ b/2026/games_submissions/the0x539/crafting.js @@ -0,0 +1,98 @@ +import { recipes, amounts } from './data.js'; + +export function getRecipeOutput() { + const input = readGrid(); + if (input.length === 0) return null; + + const mirroredInput = input.map(row => row.toReversed()); + + for (const [item, recipe] of Object.entries(recipes)) { + const isMatch = compare(input, recipe) || compare(mirroredInput, recipe); + if (!isMatch) continue; + + const amount = amounts[item] ?? 1; + return [item, amount]; + } + + return null; +} + +function last(arr) { + return arr[arr.length - 1]; +} + +function isSymmetric(grid) { + return grid.every(row => row[0] === last(row)); +} + +function readGrid() { + const cells = document.querySelectorAll('crafting-grid > inventory-cell'); + + const rows = []; + for (let y = 0; y < 3; y++) { + const row = []; + for (let x = 0; x < 3; x++) { + let item = null; + const stack = cells[3 * y + x].firstElementChild; + if (!!stack) { + item = stack.getAttribute('data-item'); + } + row.push(item); + } + rows.push(row); + } + + trimGrid(rows); + + return rows; +} + +function trimGrid(grid) { + if (grid.flat().every(v => v === null)) { + while (grid.length > 0) { + grid.pop(); + } + return; + } + + // it is now established that the grid is non-empty, + // so there will always be at least one row+col + + // trim blank rows from bottom + while (last(grid).every(v => v === null)) { + grid.pop(); + } + + // trim blank rows from top + while (grid[0].every(v => v === null)) { + grid.shift(); + } + + // trim blank columns from right + while (grid.every(row => last(row) === null)) { + for (const row of grid) { + row.pop(); + } + } + + // trim blank columns from left + while (grid.every(row => row[0] === null)) { + for (const row of grid) { + row.shift(); + } + } +} + +function compare(a, b) { + if (a.length !== b.length) return false; + + for (let y = 0; y < a.length; y++) { + if (a[y].length !== b[y].length) return false; + + for (let x = 0; x < a[y].length; x++) { + if (a[y][x] !== b[y][x]) return false; + } + } + + return true; +} diff --git a/2026/games_submissions/the0x539/data.js b/2026/games_submissions/the0x539/data.js new file mode 100644 index 0000000..dba5d6d --- /dev/null +++ b/2026/games_submissions/the0x539/data.js @@ -0,0 +1,95 @@ +const ingredients = { + i: 'ingot', + l: 'log', + p: 'plank', + s: 'stick', + d: 'dust', + c: 'cobble', + C: 'chest', + S: 'string', +} + +function recipe(...shape) { + return shape.map(line => Array.from(line).map(ch => { + if (ch === ' ') { + return null; + } else { + const item = ingredients[ch]; + console.assert(!!item); + return item; + } + })); +} + +export const recipes = { + helmet: recipe( + 'iii', + 'i i', + ), + chestplate: recipe( + 'i i', + 'iii', + 'iii', + ), + leggings: recipe( + 'iii', + 'i i', + 'i i', + ), + boots: recipe( + 'i i', + 'i i', + ), + plank: recipe( + 'l', + ), + stick: recipe( + 'p', + 'p', + ), + pickaxe: recipe( + 'ppp', + ' s ', + ' s ', + ), + piston: recipe( + 'ppp', + 'cic', + 'cdc', + ), + chest: recipe( + 'ppp', + 'p p', + 'ppp', + ), + hopper: recipe( + 'i i', + 'iCi', + ' i ', + ), + rod: recipe( + ' s', + ' sS', + 's S', + ), + bow: recipe( + ' sS', + 's S', + ' sS', + ), +}; + +export const amounts = { + plank: 4, + stick: 4, +} + +export const stackSizes = { + helmet: 1, + chestplate: 1, + leggings: 1, + boots: 1, + pickaxe: 1, + rod: 1, + bow: 1, +} diff --git a/2026/games_submissions/the0x539/index.html b/2026/games_submissions/the0x539/index.html new file mode 100644 index 0000000..5a073ed --- /dev/null +++ b/2026/games_submissions/the0x539/index.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8" /> + <script defer type="module" src="./main.js"></script> + <link rel="stylesheet" href="./screen.css" /> + </head> + <body> + <img class="background" src="./ui.png" /> + + <label for="todo-list">To do:</label> + <ul id="todo-list"></ul> + + <crafting-grid></crafting-grid> + <crafting-output></crafting-output> + <inventory-grid></inventory-grid> + <follow-cursor> + <item-tooltip></item-tooltip> + <grabbed-stack></grabbed-stack> + </follow-cursor> + + <audio src="./sfx/small-ding.ogg" id="small-ding" preload="auto"></audio> + <audio src="./sfx/big-ding.ogg" id="big-ding" preload="auto"></audio> + <audio src="./sfx/oof.ogg" id="oof" preload="auto"></audio> + </body> +</html> diff --git a/2026/games_submissions/the0x539/interaction.js b/2026/games_submissions/the0x539/interaction.js new file mode 100644 index 0000000..9c3cd37 --- /dev/null +++ b/2026/games_submissions/the0x539/interaction.js @@ -0,0 +1,581 @@ +import { stackSizes } from './data.js'; +import { getRecipeOutput } from './crafting.js'; + +class CraftEvent extends Event { + item; + constructor(item) { + super('craft'); + this.item = item; + } +} + +const grabbedStack = document.querySelector('grabbed-stack'); +const craftingGrid = document.querySelector('crafting-grid'); +const inventoryGrid = document.querySelector('inventory-grid'); +const outputCell = document.querySelector('crafting-output'); + +let state = 'idle'; + +const splitTargets = new Set(); + +export function resetInventory() { + for (const stack of document.querySelectorAll('item-stack')) { + stack.remove(); + } + splitTargets.clear(); + state = 'idle'; +} + +export function createItem(item, count) { + const elem = document.createElement('item-stack'); + elem.setAttribute('data-item', item); + elem.setAttribute('data-count', count); + const countElem = document.createElement('data'); + countElem.textContent = count.toString(); + elem.appendChild(countElem); + return elem; +} + +export function mouseDown(event) { + if (state !== 'idle') return; + if (event.button !== 0 && event.button !== 2) return; + + const cell = event.currentTarget; + + // Shift click: Transfer a full stack to the other place. + if (event.shiftKey) { + const sourceStack = cell.firstElementChild; + if (sourceStack) { + const targetGrid = cell.parentElement === inventoryGrid ? craftingGrid : inventoryGrid; + shiftClickTransfer(sourceStack, targetGrid); + } + state = 'shift-drag'; + return; + } + + const heldStack = grabbedStack.firstElementChild; + + // Click with empty cursor: pick up items + if (!heldStack) { + const sourceStack = cell.firstElementChild; + if (!sourceStack) { + return; + } + + if (event.button === 2) { + // Right click: take half the stack, rounded up + const sourceCount = getCount(sourceStack); + if (sourceCount === 1) { + grabbedStack.appendChild(sourceStack); + updateRecipeOutput(); + return; + } + + const takenCount = Math.ceil(sourceCount / 2); + const newCount = sourceCount - takenCount; + const item = sourceStack.getAttribute('data-item'); + setCount(sourceStack, newCount); + grabbedStack.appendChild(createItem(item, takenCount)); + } else { + // Left click: take the whole stack. Drag to pick up other stacks + grabbedStack.appendChild(sourceStack); + state = 'pickup-drag'; + updateRecipeOutput(); + } + } else { + // Click with items held: deposit items + + if (event.button === 2) { + // Right click: deposit one item. Drag to deposit one item in each cell + state = 'split-one'; + depositOne(cell); + } else { + // Left click: split stack evenly across all empty/compatible cells. + // If no compatible cells are dragged over, swap stack with the cell the mouse was released on. + // (In the common case, this is just what a "click" looks like on a cell with incompatible contents.) + heldStack.setAttribute('data-original-count', heldStack.getAttribute('data-count')); + state = 'split-evenly'; + addSplitTarget(cell); + } + } +} + +export function mouseEnter(event) { + const cell = event.currentTarget; + + switch (state) { + case 'shift-drag': { + const sourceStack = cell.firstElementChild; + if (!sourceStack) break; + const targetGrid = cell.parentElement === inventoryGrid ? craftingGrid : inventoryGrid; + shiftClickTransfer(sourceStack, targetGrid); + updateRecipeOutput(); + break; + } + + case 'pickup-drag': { + const sourceStack = cell.firstElementChild; + if (!sourceStack) break; + const heldStack = grabbedStack.firstElementChild; + const item = sourceStack.getAttribute('data-item'); + if (item !== heldStack.getAttribute('data-item')) return; + + const stackSize = stackSizes[item] ?? 64; + + const newCount = getCount(heldStack) + getCount(sourceStack); + if (newCount > stackSize) return; + + setCount(heldStack, newCount); + sourceStack.remove(); + updateRecipeOutput(); + break; + } + + case 'split-one': + depositOne(cell); + break; + + case 'split-evenly': + addSplitTarget(cell); + break; + + default: + break; + } +} + +export function mouseUp(event) { + switch (state) { + case 'split-evenly': + case 'split-exhausted': { + if (event.button !== 0) return; + + if (splitTargets.size <= 1) { + const targetCell = event.target.closest('inventory-cell'); + if (targetCell) { + depositAll(targetCell); + } + } else { + commitSplit(); + } + break; + } + + case 'pickup-drag': + if (event.button !== 0) return; + state = 'idle'; + break; + + case 'split-one': + if (event.button !== 2) return; + state = 'idle'; + break; + + case 'shift-drag': + // this could be either button. whatever. + state = 'idle'; + break; + + default: + break; + } +} + +export function craftClick(event) { + if (event.shiftKey) { + craftAll(); + } else { + craftOne(); + } +} + +function craftOne() { + const previewStack = outputCell.firstElementChild; + if (!previewStack) return; + + const item = previewStack.getAttribute('data-item'); + const craftCount = getCount(previewStack); + const stackSize = stackSizes[item] ?? 64; + + const heldStack = grabbedStack.firstElementChild; + if (heldStack !== null) { + if (heldStack.getAttribute('data-item') !== item) { + return; + } + + const heldCount = getCount(heldStack); + if (heldCount + craftCount > stackSize) { + return; + } + + setCount(heldStack, heldCount + craftCount); + } else { + grabbedStack.appendChild(createItem(item, craftCount)); + } + consumeIngredients(); + document.dispatchEvent(new CraftEvent(item)); +} + +function craftAll() { + const previewStack = outputCell.firstElementChild; + if (!previewStack) return; + + const item = previewStack.getAttribute('data-item'); + const craftCount = getCount(previewStack); + const stackSize = stackSizes[item] ?? 64; + + let success = false; + + do { + let unallocated = craftCount; + + const nonEmptyTargets = []; + let emptyTarget = null; + + for (const cell of inventoryGrid.children) { + const stack = cell.firstElementChild; + if (stack === null) { + // This slot is empty. + // All crafting outputs that don't fit into existing stacks + // will be deposited into the first empty slot. + emptyTarget ??= cell; + continue; + } + + if (stack.getAttribute('data-item') !== item) { + // This slot already contains a different item, + // so we can't add crafting outputs to it. + continue; + } + + const spareCapacity = stackSize - getCount(stack); + if (spareCapacity <= 0) { + // This slot contains the correct item, but is already full. + continue; + } + + const amountToAdd = Math.min(unallocated, spareCapacity); + unallocated -= amountToAdd; + nonEmptyTargets.push([stack, amountToAdd]); + + if (unallocated === 0) { + // All crafting outputs can fit into existing stacks of the item. + break; + } + } + + if (unallocated > 0 && emptyTarget === null) { + // The inventory is full: no slots are empty and existing stacks don't have enough room. + // Abort this attempt and conclude the loop. + break; + } + + // Add crafting output to existing stacks, to whatever extent possible. + for (const [stack, amountToAdd] of nonEmptyTargets) { + setCount(stack, getCount(stack) + amountToAdd); + } + + // Put any remaining items into the first empty slot. + if (unallocated > 0) { + emptyTarget.appendChild(createItem(item, unallocated)); + } + + success = true; + + // Consume one set of ingredients. + // Cease crafting if this causes the recipe output to change. + } while (!consumeIngredients()); + + if (success) { + document.dispatchEvent(new CraftEvent(item)); + } +} + +function consumeIngredients() { + let anyExhausted = false; + + for (const cell of craftingGrid.children) { + const stack = cell.firstElementChild; + if (!stack) continue; + + const count = getCount(stack); + if (count === 1) { + stack.remove(); + anyExhausted = true; + } else { + setCount(stack, count - 1); + } + } + + return anyExhausted && updateRecipeOutput(); +} + +// Returns whether the output actually changed +function updateRecipeOutput() { + const outputStack = outputCell.firstElementChild; + + const output = getRecipeOutput(); + if (output === null) { + if (outputStack === null) { + return false; + } else { + outputStack.remove(); + return true; + } + } + + const [item, count] = output; + if (outputStack === null) { + outputCell.appendChild(createItem(item, count)); + return true; + } + + if (outputStack.getAttribute('data-item') === item && getCount(outputStack) === count) { + return false; + } + + outputStack.setAttribute('data-item', item); + setCount(outputStack, count); + return true; +} + +export function consumeClock() { + if (state === 'split-exhausted') { + commitSplit(); + } + + if (state === 'split-evenly' && splitTargets.size > 1) { + // oh dear. this is a complicated situation + // first, let's try to search for uninvolved clocks + const uninvolved = document.querySelector('inventory-cell > item-stack[data-item="clock"]:not([data-original-count])'); + if (!!uninvolved) { + const count = getCount(uninvolved); + if (count === 1) { + uninvolved.remove(); + } else { + setCount(uninvolved, count - 1); + } + // phew + return; + } + + // okay so we will actually need to remove a clock from the items being split, ugh + // not a lot of code, but low confidence that it works properly + const heldStack = grabbedStack.firstElementChild; + const count = +heldStack.getAttribute('data-original-count'); + heldStack.setAttribute('data-original-count', count - 1); + updateSplitPreview(); + return; + } + + const stack = document.querySelector('item-stack[data-item="clock"][data-count]'); + const count = getCount(stack); + if (count === 1) { + if (stack.parentElement === grabbedStack) { + // conclude drag operations if they're done using a stack of clocks that gets deleted + state = 'idle'; + } + stack.remove(); + } else { + setCount(stack, count - 1); + } +} + +function getCount(itemStack) { + return +itemStack.getAttribute('data-count'); +} + +function setCount(itemStack, value) { + itemStack.setAttribute('data-count', value); + itemStack.firstElementChild.textContent = value.toString(); +} + +function depositOne(targetCell) { + const heldStack = grabbedStack.firstElementChild; + const item = heldStack.getAttribute('data-item'); + const heldCount = getCount(heldStack); + + const stackSize = stackSizes[item] ?? 64; + + const targetStack = targetCell.firstElementChild; + if (targetStack) { + if (targetStack.getAttribute('data-item') !== item) { + return; + } + + const targetCount = getCount(targetStack); + if (targetCount >= stackSize) return; + + setCount(targetStack, targetCount + 1); + } else { + targetCell.appendChild(createItem(item, 1)); + } + + if (heldCount === 1) { + heldStack.remove(); + state = 'idle'; + } else { + setCount(heldStack, heldCount - 1); + } + + updateRecipeOutput(); +} + +function shiftClickTransfer(sourceStack, targetGrid) { + const item = sourceStack.getAttribute('data-item'); + const stackSize = stackSizes[item] ?? 64; + let count = getCount(sourceStack); + + // First, search for existing stacks to add to + for (const cell of targetGrid.children) { + const targetStack = cell.firstElementChild; + if (!targetStack) continue; + if (targetStack.getAttribute('data-item') !== item) continue; + const curCount = getCount(targetStack); + const available = stackSize - curCount; + if (available === 0) continue; + + const transferSize = Math.min(count, available); + const newCount = curCount + transferSize; + setCount(targetStack, newCount); + + count -= transferSize; + if (count === 0) { + sourceStack.remove(); + updateRecipeOutput(); + return; + } else { + setCount(sourceStack, count); + } + } + + // Now, look for any empty slots to move whatever's left to + for (const cell of targetGrid.children) { + if (!cell.firstElementChild) { + cell.appendChild(sourceStack); + break; + } + } + + updateRecipeOutput(); +} + +function addSplitTarget(targetCell) { + const heldStack = grabbedStack.firstElementChild; + const item = heldStack.getAttribute('data-item'); + + const targetStack = targetCell.firstElementChild; + if (targetStack) { + if (targetStack.getAttribute('data-item') !== item) { + return; + } + } + + splitTargets.add(targetCell); + + if (splitTargets.size > 1) { + updateSplitPreview(); + } +} + +function updateSplitPreview() { + const heldStack = grabbedStack.firstElementChild; + const item = heldStack.getAttribute('data-item'); + const heldCount = +heldStack.getAttribute('data-original-count'); + + const stackSize = stackSizes[item] ?? 64; + + const splitCount = Math.max(1, Math.floor(heldCount / splitTargets.size)); + let remainder = heldCount; + + for (const targetCell of splitTargets) { + let targetStack = targetCell.firstElementChild; + if (!targetStack) { + targetStack = createItem(item, 0); + targetCell.appendChild(targetStack); + } + if (!targetStack.hasAttribute('data-original-count')) { + targetStack.setAttribute('data-original-count', targetStack.getAttribute('data-count')); + } + const targetCount = +targetStack.getAttribute('data-original-count'); + const available = stackSize - targetCount; + const transferSize = Math.min(splitCount, available); + setCount(targetStack, targetCount + transferSize); + remainder -= transferSize; + // TODO: give stacks yellow text if they're too full to accomodate their full share of the split + + if (remainder === 0) break; + } + + setCount(heldStack, remainder); + + if (splitCount === 1 && remainder === 0) { + state = 'split-exhausted'; + } +} + +function commitSplit() { + const heldStack = grabbedStack.firstElementChild; + const heldCount = getCount(heldStack); + + if (heldCount === 0) { + heldStack.remove(); + } else { + heldStack.removeAttribute('data-original-count'); + } + + for (const target of splitTargets) { + target.firstElementChild?.removeAttribute('data-original-count'); + } + + splitTargets.clear(); + + state = 'idle'; + + updateRecipeOutput(); +} + +function depositAll(targetCell) { + const heldStack = grabbedStack.firstElementChild; + const item = heldStack.getAttribute('data-item'); + const heldCount = getCount(heldStack); + + const stackSize = stackSizes[item] ?? 64; + + const targetStack = targetCell.firstElementChild; + if (!!targetStack && targetStack.getAttribute('data-item') !== item) { + // swap held and target stacks because they don't match + targetCell.appendChild(heldStack); + grabbedStack.appendChild(targetStack); + } else { + if (!targetStack) { + // deposit the full stack to the slot + targetCell.appendChild(heldStack); + } else { + // deposit as much as possible + const targetCount = getCount(targetStack); + const available = stackSize - targetCount; + const transferSize = Math.min(heldCount, available); + const newCount = targetCount + transferSize; + setCount(targetStack, newCount); + + if (transferSize < heldCount) { + setCount(heldStack, heldCount - transferSize); + } else { + heldStack.remove(); + } + } + } + + heldStack.removeAttribute('data-original-count'); + + for (const target of splitTargets) { + target.firstElementChild?.removeAttribute('data-original-count'); + } + + splitTargets.clear(); + + state = 'idle'; + + updateRecipeOutput(); +} diff --git a/2026/games_submissions/the0x539/items/boots.png b/2026/games_submissions/the0x539/items/boots.png Binary files differnew file mode 100755 index 0000000..ca6c33b --- /dev/null +++ b/2026/games_submissions/the0x539/items/boots.png diff --git a/2026/games_submissions/the0x539/items/bow.png b/2026/games_submissions/the0x539/items/bow.png Binary files differnew file mode 100755 index 0000000..6922e69 --- /dev/null +++ b/2026/games_submissions/the0x539/items/bow.png diff --git a/2026/games_submissions/the0x539/items/chest.png b/2026/games_submissions/the0x539/items/chest.png Binary files differnew file mode 100755 index 0000000..eb7f766 --- /dev/null +++ b/2026/games_submissions/the0x539/items/chest.png diff --git a/2026/games_submissions/the0x539/items/chestplate.png b/2026/games_submissions/the0x539/items/chestplate.png Binary files differnew file mode 100644 index 0000000..0cc9a63 --- /dev/null +++ b/2026/games_submissions/the0x539/items/chestplate.png diff --git a/2026/games_submissions/the0x539/items/clock.gif b/2026/games_submissions/the0x539/items/clock.gif Binary files differnew file mode 100755 index 0000000..d4a7698 --- /dev/null +++ b/2026/games_submissions/the0x539/items/clock.gif diff --git a/2026/games_submissions/the0x539/items/cobble.png b/2026/games_submissions/the0x539/items/cobble.png Binary files differnew file mode 100755 index 0000000..55dbc4f --- /dev/null +++ b/2026/games_submissions/the0x539/items/cobble.png diff --git a/2026/games_submissions/the0x539/items/dust.png b/2026/games_submissions/the0x539/items/dust.png Binary files differnew file mode 100755 index 0000000..9d17c14 --- /dev/null +++ b/2026/games_submissions/the0x539/items/dust.png diff --git a/2026/games_submissions/the0x539/items/helmet.png b/2026/games_submissions/the0x539/items/helmet.png Binary files differnew file mode 100755 index 0000000..850dac6 --- /dev/null +++ b/2026/games_submissions/the0x539/items/helmet.png diff --git a/2026/games_submissions/the0x539/items/hopper.png b/2026/games_submissions/the0x539/items/hopper.png Binary files differnew file mode 100644 index 0000000..9655818 --- /dev/null +++ b/2026/games_submissions/the0x539/items/hopper.png diff --git a/2026/games_submissions/the0x539/items/ingot.png b/2026/games_submissions/the0x539/items/ingot.png Binary files differnew file mode 100755 index 0000000..17e8aa8 --- /dev/null +++ b/2026/games_submissions/the0x539/items/ingot.png diff --git a/2026/games_submissions/the0x539/items/leggings.png b/2026/games_submissions/the0x539/items/leggings.png Binary files differnew file mode 100755 index 0000000..a28a10f --- /dev/null +++ b/2026/games_submissions/the0x539/items/leggings.png diff --git a/2026/games_submissions/the0x539/items/log.png b/2026/games_submissions/the0x539/items/log.png Binary files differnew file mode 100755 index 0000000..56d24f0 --- /dev/null +++ b/2026/games_submissions/the0x539/items/log.png diff --git a/2026/games_submissions/the0x539/items/pickaxe.png b/2026/games_submissions/the0x539/items/pickaxe.png Binary files differnew file mode 100755 index 0000000..9dea9e2 --- /dev/null +++ b/2026/games_submissions/the0x539/items/pickaxe.png diff --git a/2026/games_submissions/the0x539/items/piston.png b/2026/games_submissions/the0x539/items/piston.png Binary files differnew file mode 100755 index 0000000..f08618a --- /dev/null +++ b/2026/games_submissions/the0x539/items/piston.png diff --git a/2026/games_submissions/the0x539/items/plank.png b/2026/games_submissions/the0x539/items/plank.png Binary files differnew file mode 100644 index 0000000..863206a --- /dev/null +++ b/2026/games_submissions/the0x539/items/plank.png diff --git a/2026/games_submissions/the0x539/items/rod.png b/2026/games_submissions/the0x539/items/rod.png Binary files differnew file mode 100755 index 0000000..6610384 --- /dev/null +++ b/2026/games_submissions/the0x539/items/rod.png diff --git a/2026/games_submissions/the0x539/items/stick.png b/2026/games_submissions/the0x539/items/stick.png Binary files differnew file mode 100755 index 0000000..d32381d --- /dev/null +++ b/2026/games_submissions/the0x539/items/stick.png diff --git a/2026/games_submissions/the0x539/items/string.png b/2026/games_submissions/the0x539/items/string.png Binary files differnew file mode 100755 index 0000000..ad78eb4 --- /dev/null +++ b/2026/games_submissions/the0x539/items/string.png diff --git a/2026/games_submissions/the0x539/items/tooltip-backdrop.png b/2026/games_submissions/the0x539/items/tooltip-backdrop.png Binary files differnew file mode 100755 index 0000000..05c02cd --- /dev/null +++ b/2026/games_submissions/the0x539/items/tooltip-backdrop.png diff --git a/2026/games_submissions/the0x539/main.js b/2026/games_submissions/the0x539/main.js new file mode 100644 index 0000000..b89465e --- /dev/null +++ b/2026/games_submissions/the0x539/main.js @@ -0,0 +1,196 @@ +import { recipes, amounts } from './data.js'; +import { + createItem, + mouseDown, + mouseEnter, + mouseUp, + craftClick, + consumeClock, + resetInventory, +} from './interaction.js'; + +const followCursor = document.querySelector('follow-cursor'); +const tooltip = document.querySelector('item-tooltip'); +const craftingGrid = document.querySelector('crafting-grid'); +const inventoryGrid = document.querySelector('inventory-grid'); +const craftingOutput = document.querySelector('crafting-output'); +const todoList = document.getElementById('todo-list'); + +const desiredCrafts = new Set(); + +const playSound = { + playImpl(id, volume = 1.0, pitch = 1.0) { + const audio = document.getElementById(id); + + audio.currentTime = 0; + + const p = new Promise(resolve => { + const f = (event) => { + audio.removeEventListener('ended', f); + resolve(event); + }; + audio.addEventListener('ended', f); + }); + + audio.volume = volume; + audio.playbackRate = pitch; + audio.preservesPitch = false; + + audio.play(); + return p; + }, + + smallDing() { + return this.playImpl('small-ding', 0.1, 0.55 + 0.7 * Math.random()); + }, + + bigDing() { + return this.playImpl('big-ding', 0.75); + }, + + oof() { + return this.playImpl('oof', 0.75); + }, +}; + +function onCraft(event) { + const item = event.item; + if (desiredCrafts.has(item)) { + desiredCrafts.delete(item); + + document.querySelector(`#todo-list > li:has([data-item="${item}"])`)?.remove(); + + if (desiredCrafts.size > 0) { + playSound.smallDing(); + } else { + endGame(true); + } + } +} + +function handleMessage(msg) { + if (msg.op === 'start') { + startGame(msg.difficulty); + } +} + +function giveItem(item, count) { + const emptySlots = document.querySelectorAll('inventory-grid > inventory-cell:empty'); + const index = Math.floor(Math.random() * emptySlots.length); + emptySlots[index].appendChild(createItem(item, count)); +} + +let timerInterval = null; + +function timer() { + if (!document.querySelector('item-stack[data-item="clock"]')) { + // time's up! + endGame(false); + } else { + consumeClock(); + } +} + +function startGame(difficulty) { + document.body.classList.remove('failed'); + + resetInventory(); + + desiredCrafts.clear(); + desiredCrafts.add('helmet'); + desiredCrafts.add('chestplate'); + desiredCrafts.add('leggings'); + desiredCrafts.add('boots'); + + todoList.replaceChildren(); + for (const item of desiredCrafts) { + const listItem = document.createElement('li'); + + const stack = document.createElement('item-stack'); + stack.setAttribute('data-item', item); + listItem.append(stack); + + todoList.append(listItem); + } + + giveItem('log', 64); + giveItem('ingot', 64); + giveItem('clock', 12); + giveItem('dust', 16); + giveItem('cobble', 16); + + document.addEventListener('mousemove', onMouseMove); + timerInterval = setInterval(timer, 1000); + window.parent.postMessage({ op: 'started', verb: 'craft!' }); +} + +async function endGame(win) { + clearInterval(timerInterval); + timerInterval = null; + if (win) { + await playSound.bigDing(); + } else { + document.body.classList.add('failed'); + await playSound.oof(); + } + await new Promise(resolve => setTimeout(resolve, 500)); + document.removeEventListener('mousemove', onMouseMove); + window.parent.postMessage({ op: 'done', win }); +} + +function createCell() { + const elem = document.createElement('inventory-cell'); + elem.addEventListener('mousedown', mouseDown); + elem.addEventListener('mouseenter', mouseEnter); + return elem; +} + +function onMouseMove(event) { + followCursor.setAttribute('style', `left: ${event.clientX}px; top: ${event.clientY}px`); + + const hoverItem = document.querySelector('item-stack:hover'); + if (hoverItem !== null) { + const name = hoverItem.getAttribute('data-item'); + tooltip.textContent = name; + } else { + tooltip.textContent = ''; + } +} + +document.addEventListener('contextmenu', e => e.preventDefault()); + +const allItems = new Set(); +for (const [output, shape] of Object.entries(recipes)) { + allItems.add(output); + for (const item of shape.flat()) { + if (item) { + allItems.add(item); + } + } +} + +const stylesheet = document.styleSheets[0]; + +for (const item of allItems) { + stylesheet.insertRule(` + item-stack[data-item="${item}"]::before { + background-image: url("./items/${item}.png"); + } + `); +} + +for (let i = 0; i < 3 * 3; i++) { + craftingGrid.appendChild(createCell()); +} + +for (let i = 0; i < 12 * 3; i++) { + inventoryGrid.appendChild(createCell()); +} + +document.addEventListener('mouseup', mouseUp); +document.addEventListener('craft', onCraft); + +craftingOutput.addEventListener('click', craftClick); + +window.addEventListener('message', m => handleMessage(m.data)); +window.parent.postMessage({ op: 'ready' }); diff --git a/2026/games_submissions/the0x539/screen.css b/2026/games_submissions/the0x539/screen.css new file mode 100644 index 0000000..d9a6f72 --- /dev/null +++ b/2026/games_submissions/the0x539/screen.css @@ -0,0 +1,168 @@ +@font-face { + font-family: "Minecraft"; + src: url("./MinecraftStandard.otf") format("opentype"); +} + +* { + box-sizing: border-box; + user-select: none; + font-family: Minecraft; + font-smooth: never; + font-size: 6px; + text-rendering: geometricPrecision; + line-height: 1em; +} + +body { + margin: 0; +} + +crafting-grid, +inventory-grid { + position: absolute; + display: grid; + align-items: center; + justify-items: center; +} + +follow-cursor { + position: absolute; + pointer-events: none; +} + +grabbed-stack { + display: block; + translate: -50% -50%; + z-index: 10; + pointer-events: none; +} + +:root:has(grabbed-stack > item-stack) { + cursor: grabbing; +} + +inventory-cell, +crafting-output { + width: 16px; + height: 16px; + + &:hover, + &:has(> item-stack[data-original-count]) { + background-color: rgba(255, 255, 255, 0.5); + } + + &:has(> item-stack) { + cursor: grab; + } +} + +crafting-grid { + left: 62px; + top: 22px; + grid-template: repeat(3, 18px) / repeat(3, 18px); +} + +crafting-output { + position: absolute; + left: 157px; + top: 41px; +} + +inventory-grid { + left: 12px; + top: 94px; + grid-template: repeat(3, 18px) / repeat(12, 18px); +} + +item-stack { + display: block; + position: relative; + + & > data { + position: absolute; + color: #fcfcfc; + text-shadow: #3e3e3e 1px 1px; + bottom: 0; + right: 0; + translate: 1px -1px; + } + + &[data-count="0"] { + display: none; + } + + &[data-count="1"] > data { + display: none; + } + + &[data-item="clock"]::before { + background-image: url("./items/clock.gif"); + } + + &::before { + display: block; + width: 16px; + height: 16px; + content: ""; + background-size: 16px 16px; + } +} + +img { + pointer-events: none; +} + +item-tooltip { + display: block; + color: white; + border-style: solid; + border-width: 4px; + border-image-source: url("./tooltip-backdrop.png"); + border-image-slice: 4 fill; + text-shadow: gray 1px 1px; + height: 16px; + line-height: 1em; + color: #fcfcfc; + text-shadow: #3e3e3e 1px 1px; + translate: 8px -100%; + + &:empty, + &:has(+ * > item-stack) { + display: none; + } +} + +body.failed { + filter: brightness(0.8) sepia(75%) hue-rotate(-45deg); + cursor: not-allowed; + & > * { + pointer-events: none; + } +} + +label[for="todo-list"] { + position: absolute; + top: 12px; + left: 12px; + color: #3f3f3f; + + &:has(+ #todo-list:empty) { + display: none; + } +} + +#todo-list { + position: absolute; + left: 12px; + top: 24px; + margin: 0; + padding: 0; + display: flex; + width: 32px; + flex-wrap: wrap; + justify-content: center; + + & > li { + list-style: none; + } +} diff --git a/2026/games_submissions/the0x539/sfx/big-ding.ogg b/2026/games_submissions/the0x539/sfx/big-ding.ogg Binary files differnew file mode 100755 index 0000000..a3f4c0b --- /dev/null +++ b/2026/games_submissions/the0x539/sfx/big-ding.ogg diff --git a/2026/games_submissions/the0x539/sfx/oof.ogg b/2026/games_submissions/the0x539/sfx/oof.ogg Binary files differnew file mode 100755 index 0000000..10448dc --- /dev/null +++ b/2026/games_submissions/the0x539/sfx/oof.ogg diff --git a/2026/games_submissions/the0x539/sfx/small-ding.ogg b/2026/games_submissions/the0x539/sfx/small-ding.ogg Binary files differnew file mode 100755 index 0000000..a38b2cc --- /dev/null +++ b/2026/games_submissions/the0x539/sfx/small-ding.ogg diff --git a/2026/games_submissions/the0x539/tooltip-backdrop.png b/2026/games_submissions/the0x539/tooltip-backdrop.png Binary files differnew file mode 100755 index 0000000..893b468 --- /dev/null +++ b/2026/games_submissions/the0x539/tooltip-backdrop.png diff --git a/2026/games_submissions/the0x539/ui.png b/2026/games_submissions/the0x539/ui.png Binary files differnew file mode 100644 index 0000000..ab1873c --- /dev/null +++ b/2026/games_submissions/the0x539/ui.png diff --git a/2026/games/tyumici/index.apple-touch-icon.png b/2026/games_submissions/tyumici/index.apple-touch-icon.png Binary files differindex 37ab7c8..37ab7c8 100644 --- a/2026/games/tyumici/index.apple-touch-icon.png +++ b/2026/games_submissions/tyumici/index.apple-touch-icon.png diff --git a/2026/games/tyumici/index.apple-touch-icon.png.import b/2026/games_submissions/tyumici/index.apple-touch-icon.png.import index f632201..f632201 100644 --- a/2026/games/tyumici/index.apple-touch-icon.png.import +++ b/2026/games_submissions/tyumici/index.apple-touch-icon.png.import diff --git a/2026/games/tyumici/index.audio.position.worklet.js b/2026/games_submissions/tyumici/index.audio.position.worklet.js index 4e512c1..4e512c1 100644 --- a/2026/games/tyumici/index.audio.position.worklet.js +++ b/2026/games_submissions/tyumici/index.audio.position.worklet.js diff --git a/2026/games/tyumici/index.audio.worklet.js b/2026/games_submissions/tyumici/index.audio.worklet.js index 3b94cab..3b94cab 100644 --- a/2026/games/tyumici/index.audio.worklet.js +++ b/2026/games_submissions/tyumici/index.audio.worklet.js diff --git a/2026/games/tyumici/index.html b/2026/games_submissions/tyumici/index.html index 5d3bc5f..5d3bc5f 100644 --- a/2026/games/tyumici/index.html +++ b/2026/games_submissions/tyumici/index.html diff --git a/2026/games/tyumici/index.icon.png b/2026/games_submissions/tyumici/index.icon.png Binary files differindex 17d32d5..17d32d5 100644 --- a/2026/games/tyumici/index.icon.png +++ b/2026/games_submissions/tyumici/index.icon.png diff --git a/2026/games/tyumici/index.icon.png.import b/2026/games_submissions/tyumici/index.icon.png.import index 77aa29e..77aa29e 100644 --- a/2026/games/tyumici/index.icon.png.import +++ b/2026/games_submissions/tyumici/index.icon.png.import diff --git a/2026/games/tyumici/index.js b/2026/games_submissions/tyumici/index.js index d2d8134..d2d8134 100644 --- a/2026/games/tyumici/index.js +++ b/2026/games_submissions/tyumici/index.js diff --git a/2026/games/tyumici/index.pck b/2026/games_submissions/tyumici/index.pck Binary files differindex 970d35a..970d35a 100644 --- a/2026/games/tyumici/index.pck +++ b/2026/games_submissions/tyumici/index.pck diff --git a/2026/games/tyumici/index.png b/2026/games_submissions/tyumici/index.png Binary files differindex 766b0b6..766b0b6 100644 --- a/2026/games/tyumici/index.png +++ b/2026/games_submissions/tyumici/index.png diff --git a/2026/games/tyumici/index.png.import b/2026/games_submissions/tyumici/index.png.import index 78d6c67..78d6c67 100644 --- a/2026/games/tyumici/index.png.import +++ b/2026/games_submissions/tyumici/index.png.import diff --git a/2026/games/tyumici/index.wasm b/2026/games_submissions/tyumici/index.wasm Binary files differindex daae74f..daae74f 100644 --- a/2026/games/tyumici/index.wasm +++ b/2026/games_submissions/tyumici/index.wasm diff --git a/2026/submissions.org b/2026/submissions.org index 2fd32d4..125464e 100644 --- a/2026/submissions.org +++ b/2026/submissions.org @@ -2,7 +2,6 @@ - [X] PeetsEater - [X] MrROBUST - [X] Bytomancer -- rpc2dot0 - [X] gbjk - [X] lunaticlurker https://lunaticlurker.itch.io/clocktimesetter - [X] pralkarz https://codeberg.org/pralkarz/dzem @@ -17,12 +16,18 @@ - [X] liquidcake1 http://pub.colonq.computer/~liquidcake/liquidcake.zip - [X] astatinchan - [X] icefoxzettai -- novaliminal -- jack turps -- dreamdeckup -- threecoff +- [X] novaliminal +- [X] talon1024 +- [ ] owlkaline https://github.com/Owlkaline/JobHuntingGame (need event handling fixes) - [X] sleepytealcoder https://codeberg.org/SleepyTealCoder/LcolonqMicrojam2K26APaloozaSconesUpMicrogame - [X] captain_onosa https://github.com/MrOnosa/fast-fall-ball-game-lcolonq +- [ ] jack turps https://github.com/jackturps/cowboy-micro-game (need restart fixes) +- [ ] dreamdeckup (need restart fix) +- [ ] just__jane (need to make sure it's scaled correctly) +- [X] doceys +- [ ] threecoff https://codeberg.org/threecoff/clennis (needs emscripten build) +- [X] the0x539 +- mankeymaster18 https://github.com/mankeymaster/ratmanity - asrael? - captinbaptin? - yurcheeg? @@ -31,5 +36,4 @@ - ctrl_o? - janetacarr? - bigbookofbug? -- the0x539? -- doceys? +- rpc2dot0? diff --git a/2026/submissions/cammymoop/dice-battle-micro-main.zip b/2026/submissions/cammymoop/dice-battle-micro-main.zip Binary files differdeleted file mode 100644 index e2368cf..0000000 --- a/2026/submissions/cammymoop/dice-battle-micro-main.zip +++ /dev/null diff --git a/2026/submissions/doceys/doceys.zip b/2026/submissions/doceys/doceys.zip Binary files differnew file mode 100644 index 0000000..116a9ad --- /dev/null +++ b/2026/submissions/doceys/doceys.zip diff --git a/2026/submissions/doceys/source.zip b/2026/submissions/doceys/source.zip Binary files differnew file mode 100644 index 0000000..a0ffc17 --- /dev/null +++ b/2026/submissions/doceys/source.zip diff --git a/2026/submissions/dreamdeckup/bubbles.tar.gz b/2026/submissions/dreamdeckup/bubbles.tar.gz Binary files differnew file mode 100644 index 0000000..b3e2978 --- /dev/null +++ b/2026/submissions/dreamdeckup/bubbles.tar.gz diff --git a/2026/submissions/jack_turps/colonq-export.zip b/2026/submissions/jack_turps/colonq-export.zip Binary files differnew file mode 100644 index 0000000..82fca51 --- /dev/null +++ b/2026/submissions/jack_turps/colonq-export.zip diff --git a/2026/submissions/just__jane/sakura-samurai.tar.gz b/2026/submissions/just__jane/sakura-samurai.tar.gz Binary files differnew file mode 100644 index 0000000..f07a317 --- /dev/null +++ b/2026/submissions/just__jane/sakura-samurai.tar.gz diff --git a/2026/submissions/owlkalinevt/JobHuntingHtml.zip b/2026/submissions/owlkalinevt/JobHuntingHtml.zip Binary files differnew file mode 100644 index 0000000..4f61d95 --- /dev/null +++ b/2026/submissions/owlkalinevt/JobHuntingHtml.zip diff --git a/2026/submissions/talon1024/ShootIt.zip b/2026/submissions/talon1024/ShootIt.zip Binary files differnew file mode 100644 index 0000000..1153182 --- /dev/null +++ b/2026/submissions/talon1024/ShootIt.zip diff --git a/2026/submissions/the0x539/trunk.zip b/2026/submissions/the0x539/trunk.zip Binary files differnew file mode 100644 index 0000000..e0eaaa2 --- /dev/null +++ b/2026/submissions/the0x539/trunk.zip |
