kiwiengine 0.0.1-alpha → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +550 -0
- package/README.md +575 -4
- package/examples/auto-battle/assets/bgm/battle.mp3 +0 -0
- package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/auto-battle/assets/joystick/joystick.png +0 -0
- package/examples/auto-battle/assets/joystick/knob.png +0 -0
- package/examples/auto-battle/assets/sfx/hero/die/die.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/die/die.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/auto-battle/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/auto-battle/assets/spritesheets/hero.png +0 -0
- package/examples/auto-battle/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/auto-battle/assets/spritesheets/orc.png +0 -0
- package/examples/auto-battle/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/auto-battle/assets/spritesheets/potion.png +0 -0
- package/examples/auto-battle/dist/game.js +2 -0
- package/examples/auto-battle/dist/game.js.LICENSE.txt +35 -0
- package/examples/auto-battle/hud/damage-text.ts +46 -0
- package/examples/auto-battle/hud/heal-text.ts +46 -0
- package/examples/auto-battle/hud/hp-bar.ts +38 -0
- package/examples/auto-battle/index.ts +41 -0
- package/examples/auto-battle/objects/character.ts +95 -0
- package/examples/auto-battle/objects/hero.ts +119 -0
- package/examples/auto-battle/objects/orc.ts +107 -0
- package/examples/auto-battle/objects/potion.ts +27 -0
- package/examples/auto-battle/stage.ts +366 -0
- package/examples/battle-benchmark-matterjs/assets/bgm/battle.mp3 +0 -0
- package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/joystick/joystick.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/joystick/knob.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/die/die.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/die/die.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/hero.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/orc.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/potion.png +0 -0
- package/examples/battle-benchmark-matterjs/dist/game.js +2 -0
- package/examples/battle-benchmark-matterjs/dist/game.js.LICENSE.txt +35 -0
- package/examples/battle-benchmark-matterjs/hud/damage-text.ts +46 -0
- package/examples/battle-benchmark-matterjs/hud/heal-text.ts +46 -0
- package/examples/battle-benchmark-matterjs/hud/hp-bar.ts +38 -0
- package/examples/battle-benchmark-matterjs/index.html +24 -0
- package/examples/battle-benchmark-matterjs/index.ts +41 -0
- package/examples/battle-benchmark-matterjs/objects/character.ts +95 -0
- package/examples/battle-benchmark-matterjs/objects/hero.ts +111 -0
- package/examples/battle-benchmark-matterjs/objects/orc.ts +107 -0
- package/examples/battle-benchmark-matterjs/objects/potion.ts +27 -0
- package/examples/battle-benchmark-matterjs/stage.ts +177 -0
- package/examples/battle-benchmark-separation/assets/bgm/battle.mp3 +0 -0
- package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/battle-benchmark-separation/assets/joystick/joystick.png +0 -0
- package/examples/battle-benchmark-separation/assets/joystick/knob.png +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/die/die.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/die/die.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/hero.png +0 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/orc.png +0 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/potion.png +0 -0
- package/examples/battle-benchmark-separation/dist/game.js +2 -0
- package/examples/battle-benchmark-separation/dist/game.js.LICENSE.txt +35 -0
- package/examples/battle-benchmark-separation/hud/damage-text.ts +46 -0
- package/examples/battle-benchmark-separation/hud/heal-text.ts +46 -0
- package/examples/battle-benchmark-separation/hud/hp-bar.ts +38 -0
- package/examples/battle-benchmark-separation/index.html +24 -0
- package/examples/battle-benchmark-separation/index.ts +41 -0
- package/examples/battle-benchmark-separation/objects/character.ts +225 -0
- package/examples/battle-benchmark-separation/objects/hero.ts +110 -0
- package/examples/battle-benchmark-separation/objects/orc.ts +213 -0
- package/examples/battle-benchmark-separation/objects/potion.ts +27 -0
- package/examples/battle-benchmark-separation/stage.ts +178 -0
- package/examples/battle-benchmark-separation2/assets/bgm/battle.mp3 +0 -0
- package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/battle-benchmark-separation2/assets/joystick/joystick.png +0 -0
- package/examples/battle-benchmark-separation2/assets/joystick/knob.png +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/die/die.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/die/die.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/hero.png +0 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/orc.png +0 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/potion.png +0 -0
- package/examples/battle-benchmark-separation2/dist/game.js +2 -0
- package/examples/battle-benchmark-separation2/dist/game.js.LICENSE.txt +35 -0
- package/examples/battle-benchmark-separation2/hud/damage-text.ts +46 -0
- package/examples/battle-benchmark-separation2/hud/heal-text.ts +46 -0
- package/examples/battle-benchmark-separation2/hud/hp-bar.ts +38 -0
- package/examples/battle-benchmark-separation2/index.html +24 -0
- package/examples/battle-benchmark-separation2/index.ts +41 -0
- package/examples/battle-benchmark-separation2/objects/character.ts +195 -0
- package/examples/battle-benchmark-separation2/objects/hero.ts +110 -0
- package/examples/battle-benchmark-separation2/objects/orc.ts +213 -0
- package/examples/battle-benchmark-separation2/objects/potion.ts +27 -0
- package/examples/battle-benchmark-separation2/stage.ts +178 -0
- package/examples/collision-test/assets/cat.png +0 -0
- package/examples/collision-test/dist/game.js +2 -0
- package/examples/collision-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/collision-test/index.html +24 -0
- package/examples/collision-test/index.ts +30 -0
- package/examples/dom-particle-test/assets/bird.png +0 -0
- package/examples/dom-particle-test/dist/game.js +2 -0
- package/examples/dom-particle-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/dom-particle-test/index.html +24 -0
- package/examples/dom-particle-test/index.ts +27 -0
- package/examples/dom-sprite-test/assets/bird.png +0 -0
- package/examples/dom-sprite-test/assets/fire.png +0 -0
- package/examples/dom-sprite-test/assets/run.png +0 -0
- package/examples/dom-sprite-test/dist/game.js +2 -0
- package/examples/dom-sprite-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/dom-sprite-test/index.html +24 -0
- package/examples/dom-sprite-test/index.ts +35 -0
- package/examples/dom-test/dist/game.js +2 -0
- package/examples/dom-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/dom-test/index.html +24 -0
- package/examples/dom-test/index.ts +22 -0
- package/examples/particle-test/assets/bird.png +0 -0
- package/examples/particle-test/dist/game.js +2 -0
- package/examples/particle-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/particle-test/index.html +24 -0
- package/examples/particle-test/index.ts +30 -0
- package/examples/renderer-test/dist/game.js +2 -0
- package/examples/renderer-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/renderer-test/index.html +24 -0
- package/examples/renderer-test/index.ts +9 -0
- package/examples/simple-battle/assets/bgm/battle.mp3 +0 -0
- package/examples/simple-battle/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/simple-battle/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/simple-battle/assets/joystick/joystick.png +0 -0
- package/examples/simple-battle/assets/joystick/knob.png +0 -0
- package/examples/simple-battle/assets/sfx/hero/die/die.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/simple-battle/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/die/die.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/simple-battle/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/simple-battle/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/simple-battle/assets/spritesheets/hero.png +0 -0
- package/examples/simple-battle/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/simple-battle/assets/spritesheets/orc.png +0 -0
- package/examples/simple-battle/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/simple-battle/assets/spritesheets/potion.png +0 -0
- package/examples/simple-battle/dist/game.js +2 -0
- package/examples/simple-battle/dist/game.js.LICENSE.txt +35 -0
- package/examples/simple-battle/hud/damage-text.ts +46 -0
- package/examples/simple-battle/hud/heal-text.ts +46 -0
- package/examples/simple-battle/hud/hp-bar.ts +38 -0
- package/examples/simple-battle/index.html +24 -0
- package/examples/simple-battle/index.ts +41 -0
- package/examples/simple-battle/objects/character.ts +95 -0
- package/examples/simple-battle/objects/hero.ts +111 -0
- package/examples/simple-battle/objects/orc.ts +107 -0
- package/examples/simple-battle/objects/potion.ts +27 -0
- package/examples/simple-battle/stage.ts +174 -0
- package/examples/spine-test/assets/spine/spineboy.atlas +95 -0
- package/examples/spine-test/assets/spine/spineboy.png +0 -0
- package/examples/spine-test/assets/spine/spineboy.skel +0 -0
- package/examples/spine-test/dist/game.js +2 -0
- package/examples/spine-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/spine-test/index.html +24 -0
- package/examples/spine-test/index.ts +29 -0
- package/examples/sprite-test/assets/bird.png +0 -0
- package/examples/sprite-test/assets/fire.png +0 -0
- package/examples/sprite-test/dist/game.js +2 -0
- package/examples/sprite-test/dist/game.js.LICENSE.txt +35 -0
- package/examples/sprite-test/index.html +24 -0
- package/examples/sprite-test/index.ts +38 -0
- package/examples/tsconfig.json +2 -1
- package/examples/webpack.config.js +17 -3
- package/jest.config.ts +10 -0
- package/lib/asset/audio.js +47 -11
- package/lib/asset/audio.js.map +1 -1
- package/lib/asset/loaders/audio.js +7 -4
- package/lib/asset/loaders/audio.js.map +1 -1
- package/lib/asset/loaders/binary.js +7 -4
- package/lib/asset/loaders/binary.js.map +1 -1
- package/lib/asset/loaders/bitmap-font.js +74 -0
- package/lib/asset/loaders/bitmap-font.js.map +1 -0
- package/lib/asset/loaders/font.js +4 -1
- package/lib/asset/loaders/font.js.map +1 -1
- package/lib/asset/loaders/loader.js +17 -12
- package/lib/asset/loaders/loader.js.map +1 -1
- package/lib/asset/loaders/spritesheet.js +18 -8
- package/lib/asset/loaders/spritesheet.js.map +1 -1
- package/lib/asset/loaders/text.js +6 -3
- package/lib/asset/loaders/text.js.map +1 -1
- package/lib/asset/loaders/texture.js +22 -26
- package/lib/asset/loaders/texture.js.map +1 -1
- package/lib/asset/preload.js +60 -56
- package/lib/asset/preload.js.map +1 -1
- package/lib/collision/check-collision.js +804 -0
- package/lib/collision/check-collision.js.map +1 -0
- package/lib/collision/check-collision.test.js +300 -0
- package/lib/collision/check-collision.test.js.map +1 -0
- package/lib/collision/colliders.js +8 -0
- package/lib/collision/colliders.js.map +1 -0
- package/lib/debug.js.map +1 -0
- package/lib/dom/dom-animated-sprite.js +106 -0
- package/lib/dom/dom-animated-sprite.js.map +1 -0
- package/lib/dom/dom-game-object.js +108 -0
- package/lib/dom/dom-game-object.js.map +1 -0
- package/lib/dom/dom-particle.js +105 -0
- package/lib/dom/dom-particle.js.map +1 -0
- package/lib/dom/dom-preload.js +43 -0
- package/lib/dom/dom-preload.js.map +1 -0
- package/lib/dom/dom-sprite.js +40 -0
- package/lib/dom/dom-sprite.js.map +1 -0
- package/lib/dom/dom-texture-loader.js +36 -0
- package/lib/dom/dom-texture-loader.js.map +1 -0
- package/lib/dom/dom-utils.js +20 -0
- package/lib/dom/dom-utils.js.map +1 -0
- package/lib/index copy.js +16 -0
- package/lib/index copy.js.map +1 -0
- package/lib/index.js +36 -10
- package/lib/index.js.map +1 -1
- package/lib/input/joystick.js +262 -0
- package/lib/input/joystick.js.map +1 -0
- package/lib/node/core/dirty-number.js +19 -0
- package/lib/node/core/dirty-number.js.map +1 -0
- package/lib/node/core/game-node.js +63 -0
- package/lib/node/core/game-node.js.map +1 -0
- package/lib/node/core/game-object.js +8 -0
- package/lib/node/core/game-object.js.map +1 -0
- package/lib/node/core/renderable.js +59 -0
- package/lib/node/core/renderable.js.map +1 -0
- package/lib/node/core/transform.js +70 -0
- package/lib/node/core/transform.js.map +1 -0
- package/lib/node/core/transformable.js +85 -0
- package/lib/node/core/transformable.js.map +1 -0
- package/lib/node/ext/animated-sprite.js +77 -0
- package/lib/node/ext/animated-sprite.js.map +1 -0
- package/lib/node/ext/bitmap-text.js +93 -0
- package/lib/node/ext/bitmap-text.js.map +1 -0
- package/lib/node/ext/circle.js +43 -0
- package/lib/node/ext/circle.js.map +1 -0
- package/lib/node/ext/deplay.js +22 -0
- package/lib/node/ext/deplay.js.map +1 -0
- package/lib/node/ext/dom-container.js +51 -0
- package/lib/node/ext/dom-container.js.map +1 -0
- package/lib/node/ext/interval.js +22 -0
- package/lib/node/ext/interval.js.map +1 -0
- package/lib/node/ext/particle.js +98 -0
- package/lib/node/ext/particle.js.map +1 -0
- package/lib/node/ext/rectangle.js +52 -0
- package/lib/node/ext/rectangle.js.map +1 -0
- package/lib/node/ext/spine.js +272 -0
- package/lib/node/ext/spine.js.map +1 -0
- package/lib/node/ext/sprite.js +42 -0
- package/lib/node/ext/sprite.js.map +1 -0
- package/lib/node/physics/physics-object.js +92 -0
- package/lib/node/physics/physics-object.js.map +1 -0
- package/lib/node/physics/physics-world.js +29 -0
- package/lib/node/physics/physics-world.js.map +1 -0
- package/lib/node/physics/rigidbodies.js +7 -0
- package/lib/node/physics/rigidbodies.js.map +1 -0
- package/lib/renderer/camera.js +19 -0
- package/lib/renderer/camera.js.map +1 -0
- package/lib/renderer/container-manager.js +29 -0
- package/lib/renderer/container-manager.js.map +1 -0
- package/lib/renderer/fps-display.js +18 -0
- package/lib/renderer/fps-display.js.map +1 -0
- package/lib/renderer/layer.js +12 -0
- package/lib/renderer/layer.js.map +1 -0
- package/lib/renderer/renderer.js +146 -0
- package/lib/renderer/renderer.js.map +1 -0
- package/lib/renderer/ticker.js +56 -0
- package/lib/renderer/ticker.js.map +1 -0
- package/lib/renderer/ticker.test.js +241 -0
- package/lib/renderer/ticker.test.js.map +1 -0
- package/lib/types/animation-atlas.js +2 -0
- package/lib/types/animation-atlas.js.map +1 -0
- package/lib/types/asset/audio.d.ts +5 -4
- package/lib/types/asset/audio.d.ts.map +1 -1
- package/lib/types/asset/loaders/audio.d.ts +2 -1
- package/lib/types/asset/loaders/audio.d.ts.map +1 -1
- package/lib/types/asset/loaders/binary.d.ts +2 -1
- package/lib/types/asset/loaders/binary.d.ts.map +1 -1
- package/lib/types/asset/loaders/bitmap-font.d.ts +17 -0
- package/lib/types/asset/loaders/bitmap-font.d.ts.map +1 -0
- package/lib/types/asset/loaders/font.d.ts +2 -1
- package/lib/types/asset/loaders/font.d.ts.map +1 -1
- package/lib/types/asset/loaders/loader.d.ts +6 -6
- package/lib/types/asset/loaders/loader.d.ts.map +1 -1
- package/lib/types/asset/loaders/spritesheet.d.ts +14 -6
- package/lib/types/asset/loaders/spritesheet.d.ts.map +1 -1
- package/lib/types/asset/loaders/text.d.ts +2 -1
- package/lib/types/asset/loaders/text.d.ts.map +1 -1
- package/lib/types/asset/loaders/texture.d.ts +2 -2
- package/lib/types/asset/loaders/texture.d.ts.map +1 -1
- package/lib/types/asset/preload.d.ts +7 -5
- package/lib/types/asset/preload.d.ts.map +1 -1
- package/lib/types/atlas copy.js +2 -0
- package/lib/types/atlas copy.js.map +1 -0
- package/lib/types/atlas.js +2 -0
- package/lib/types/atlas.js.map +1 -0
- package/lib/types/bitmap-font.js +2 -0
- package/lib/types/bitmap-font.js.map +1 -0
- package/lib/types/collision/check-collision.d.ts +4 -0
- package/lib/types/collision/check-collision.d.ts.map +1 -0
- package/lib/types/collision/check-collision.test.d.ts +2 -0
- package/lib/types/collision/check-collision.test.d.ts.map +1 -0
- package/lib/types/collision/colliders.d.ts +34 -0
- package/lib/types/collision/colliders.d.ts.map +1 -0
- package/lib/types/debug.d.ts.map +1 -0
- package/lib/types/dom/dom-animated-sprite.d.ts +23 -0
- package/lib/types/dom/dom-animated-sprite.d.ts.map +1 -0
- package/lib/types/dom/dom-game-object.d.ts +44 -0
- package/lib/types/dom/dom-game-object.d.ts.map +1 -0
- package/lib/types/dom/dom-particle.d.ts +30 -0
- package/lib/types/dom/dom-particle.d.ts.map +1 -0
- package/lib/types/dom/dom-preload.d.ts +2 -0
- package/lib/types/dom/dom-preload.d.ts.map +1 -0
- package/lib/types/dom/dom-sprite.d.ts +13 -0
- package/lib/types/dom/dom-sprite.d.ts.map +1 -0
- package/lib/types/dom/dom-texture-loader.d.ts +8 -0
- package/lib/types/dom/dom-texture-loader.d.ts.map +1 -0
- package/lib/types/dom/dom-utils.d.ts +3 -0
- package/lib/types/dom/dom-utils.d.ts.map +1 -0
- package/lib/types/index copy.d.ts +16 -0
- package/lib/types/index copy.d.ts.map +1 -0
- package/lib/types/index.d.ts +26 -11
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/input/joystick.d.ts +28 -0
- package/lib/types/input/joystick.d.ts.map +1 -0
- package/lib/types/node/core/dirty-number.d.ts +9 -0
- package/lib/types/node/core/dirty-number.d.ts.map +1 -0
- package/lib/types/node/core/game-node.d.ts +16 -0
- package/lib/types/node/core/game-node.d.ts.map +1 -0
- package/lib/types/node/core/game-object.d.ts +8 -0
- package/lib/types/node/core/game-object.d.ts.map +1 -0
- package/lib/types/node/core/renderable.d.ts +23 -0
- package/lib/types/node/core/renderable.d.ts.map +1 -0
- package/lib/types/node/core/transform.d.ts +27 -0
- package/lib/types/node/core/transform.d.ts.map +1 -0
- package/lib/types/node/core/transformable.d.ts +44 -0
- package/lib/types/node/core/transformable.d.ts.map +1 -0
- package/lib/types/node/ext/animated-sprite.d.ts +22 -0
- package/lib/types/node/ext/animated-sprite.d.ts.map +1 -0
- package/lib/types/node/ext/bitmap-text.d.ts +14 -0
- package/lib/types/node/ext/bitmap-text.d.ts.map +1 -0
- package/lib/types/node/ext/circle.d.ts +19 -0
- package/lib/types/node/ext/circle.d.ts.map +1 -0
- package/lib/types/node/ext/deplay.d.ts +8 -0
- package/lib/types/node/ext/deplay.d.ts.map +1 -0
- package/lib/types/node/ext/dom-container.d.ts +12 -0
- package/lib/types/node/ext/dom-container.d.ts.map +1 -0
- package/lib/types/node/ext/interval.d.ts +9 -0
- package/lib/types/node/ext/interval.d.ts.map +1 -0
- package/lib/types/node/ext/particle.d.ts +30 -0
- package/lib/types/node/ext/particle.d.ts.map +1 -0
- package/lib/types/node/ext/rectangle.d.ts +22 -0
- package/lib/types/node/ext/rectangle.d.ts.map +1 -0
- package/lib/types/node/ext/spine.d.ts +36 -0
- package/lib/types/node/ext/spine.d.ts.map +1 -0
- package/lib/types/node/ext/sprite.d.ts +13 -0
- package/lib/types/node/ext/sprite.d.ts.map +1 -0
- package/lib/types/node/physics/physics-object.d.ts +38 -0
- package/lib/types/node/physics/physics-object.d.ts.map +1 -0
- package/lib/types/node/physics/physics-world.d.ts +18 -0
- package/lib/types/node/physics/physics-world.d.ts.map +1 -0
- package/lib/types/node/physics/rigidbodies.d.ts +23 -0
- package/lib/types/node/physics/rigidbodies.d.ts.map +1 -0
- package/lib/types/renderer/camera.d.ts +13 -0
- package/lib/types/renderer/camera.d.ts.map +1 -0
- package/lib/types/renderer/container-manager.d.ts +9 -0
- package/lib/types/renderer/container-manager.d.ts.map +1 -0
- package/lib/types/renderer/fps-display.d.ts +7 -0
- package/lib/types/renderer/fps-display.d.ts.map +1 -0
- package/lib/types/renderer/layer.d.ts +7 -0
- package/lib/types/renderer/layer.d.ts.map +1 -0
- package/lib/types/renderer/renderer.d.ts +40 -0
- package/lib/types/renderer/renderer.d.ts.map +1 -0
- package/lib/types/renderer/ticker.d.ts +6 -0
- package/lib/types/renderer/ticker.d.ts.map +1 -0
- package/lib/types/renderer/ticker.test.d.ts +40 -0
- package/lib/types/renderer/ticker.test.d.ts.map +1 -0
- package/lib/types/sprite-atlas.js +2 -0
- package/lib/types/sprite-atlas.js.map +1 -0
- package/lib/types/types/animation-atlas.d.ts +14 -0
- package/lib/types/types/animation-atlas.d.ts.map +1 -0
- package/lib/types/types/atlas copy.d.ts +12 -0
- package/lib/types/types/atlas copy.d.ts.map +1 -0
- package/lib/types/types/atlas.d.ts +16 -0
- package/lib/types/types/atlas.d.ts.map +1 -0
- package/lib/types/types/bitmap-font.d.ts +18 -0
- package/lib/types/types/bitmap-font.d.ts.map +1 -0
- package/lib/types/types/sprite-atlas.d.ts +13 -0
- package/lib/types/types/sprite-atlas.d.ts.map +1 -0
- package/lib/types/utils/device.d.ts +2 -0
- package/lib/types/utils/device.d.ts.map +1 -0
- package/lib/utils/device.js +2 -0
- package/lib/utils/device.js.map +1 -0
- package/package.json +8 -7
- package/src/asset/audio.ts +134 -90
- package/src/asset/loaders/audio.ts +23 -20
- package/src/asset/loaders/binary.ts +20 -16
- package/src/asset/loaders/bitmap-font.ts +91 -0
- package/src/asset/loaders/font.ts +18 -14
- package/src/asset/loaders/loader.ts +27 -23
- package/src/asset/loaders/spritesheet.ts +47 -36
- package/src/asset/loaders/text.ts +19 -15
- package/src/asset/loaders/texture.ts +30 -37
- package/src/asset/preload.ts +71 -64
- package/src/collision/check-collision.test.ts +349 -0
- package/src/collision/check-collision.ts +821 -0
- package/src/collision/colliders.ts +19 -0
- package/src/debug.ts +5 -0
- package/src/dom/dom-animated-sprite.ts +132 -0
- package/src/dom/dom-game-object.ts +134 -0
- package/src/dom/dom-particle.ts +151 -0
- package/src/dom/dom-preload.ts +54 -0
- package/src/dom/dom-sprite.ts +50 -0
- package/src/dom/dom-texture-loader.ts +44 -0
- package/src/dom/dom-utils.ts +19 -0
- package/src/index.ts +47 -13
- package/src/input/joystick.ts +316 -0
- package/src/node/core/dirty-number.ts +21 -0
- package/src/node/core/game-node.ts +74 -0
- package/src/node/core/game-object.ts +11 -0
- package/src/node/core/renderable.ts +72 -0
- package/src/node/core/transform.ts +82 -0
- package/src/node/core/transformable.ts +111 -0
- package/src/node/ext/animated-sprite.ts +103 -0
- package/src/node/ext/bitmap-text.ts +113 -0
- package/src/node/ext/circle.ts +55 -0
- package/src/node/ext/deplay.ts +25 -0
- package/src/node/ext/dom-container.ts +62 -0
- package/src/node/ext/interval.ts +25 -0
- package/src/node/ext/particle.ts +142 -0
- package/src/node/ext/rectangle.ts +71 -0
- package/src/node/ext/spine.ts +323 -0
- package/src/node/ext/sprite.ts +53 -0
- package/src/node/physics/physics-object.ts +127 -0
- package/src/node/physics/physics-world.ts +41 -0
- package/src/node/physics/rigidbodies.ts +14 -0
- package/src/renderer/camera.ts +25 -0
- package/src/renderer/container-manager.ts +36 -0
- package/src/renderer/fps-display.ts +21 -0
- package/src/renderer/layer.ts +15 -0
- package/src/renderer/renderer.ts +181 -0
- package/src/renderer/ticker.test.ts +325 -0
- package/src/renderer/ticker.ts +54 -0
- package/src/types/atlas.ts +17 -0
- package/src/types/bitmap-font.ts +19 -0
- package/src/utils/device.ts +1 -0
- package/examples/test-dom/index.ts +0 -21
- package/lib/game-object/game-object-physics.js +0 -188
- package/lib/game-object/game-object-physics.js.map +0 -1
- package/lib/game-object/game-object-rendering.js +0 -35
- package/lib/game-object/game-object-rendering.js.map +0 -1
- package/lib/game-object/game-object.js +0 -162
- package/lib/game-object/game-object.js.map +0 -1
- package/lib/game-object/transform.js +0 -118
- package/lib/game-object/transform.js.map +0 -1
- package/lib/game-object-ext/animated-sprite.js +0 -117
- package/lib/game-object-ext/animated-sprite.js.map +0 -1
- package/lib/game-object-ext/dom-container.js +0 -56
- package/lib/game-object-ext/dom-container.js.map +0 -1
- package/lib/game-object-ext/rect.js +0 -30
- package/lib/game-object-ext/rect.js.map +0 -1
- package/lib/game-object-ext/spine.js +0 -206
- package/lib/game-object-ext/spine.js.map +0 -1
- package/lib/game-object-ext/sprite.js +0 -46
- package/lib/game-object-ext/sprite.js.map +0 -1
- package/lib/game-object-ext/text.js +0 -68
- package/lib/game-object-ext/text.js.map +0 -1
- package/lib/game-object-ext/tiling-sprite.js +0 -64
- package/lib/game-object-ext/tiling-sprite.js.map +0 -1
- package/lib/types/game-object/game-object-physics.d.ts +0 -42
- package/lib/types/game-object/game-object-physics.d.ts.map +0 -1
- package/lib/types/game-object/game-object-rendering.d.ts +0 -15
- package/lib/types/game-object/game-object-rendering.d.ts.map +0 -1
- package/lib/types/game-object/game-object.d.ts +0 -81
- package/lib/types/game-object/game-object.d.ts.map +0 -1
- package/lib/types/game-object/transform.d.ts +0 -43
- package/lib/types/game-object/transform.d.ts.map +0 -1
- package/lib/types/game-object-ext/animated-sprite.d.ts +0 -29
- package/lib/types/game-object-ext/animated-sprite.d.ts.map +0 -1
- package/lib/types/game-object-ext/dom-container.d.ts +0 -16
- package/lib/types/game-object-ext/dom-container.d.ts.map +0 -1
- package/lib/types/game-object-ext/rect.d.ts +0 -17
- package/lib/types/game-object-ext/rect.d.ts.map +0 -1
- package/lib/types/game-object-ext/spine.d.ts +0 -35
- package/lib/types/game-object-ext/spine.d.ts.map +0 -1
- package/lib/types/game-object-ext/sprite.d.ts +0 -14
- package/lib/types/game-object-ext/sprite.d.ts.map +0 -1
- package/lib/types/game-object-ext/text.d.ts +0 -26
- package/lib/types/game-object-ext/text.d.ts.map +0 -1
- package/lib/types/game-object-ext/tiling-sprite.d.ts +0 -20
- package/lib/types/game-object-ext/tiling-sprite.d.ts.map +0 -1
- package/lib/types/utils/debug.d.ts.map +0 -1
- package/lib/types/utils/go.d.ts +0 -26
- package/lib/types/utils/go.d.ts.map +0 -1
- package/lib/types/world/world-debug.d.ts +0 -11
- package/lib/types/world/world-debug.d.ts.map +0 -1
- package/lib/types/world/world-physics.d.ts +0 -16
- package/lib/types/world/world-physics.d.ts.map +0 -1
- package/lib/types/world/world-rendering.d.ts +0 -28
- package/lib/types/world/world-rendering.d.ts.map +0 -1
- package/lib/types/world/world.d.ts +0 -38
- package/lib/types/world/world.d.ts.map +0 -1
- package/lib/utils/debug.js.map +0 -1
- package/lib/utils/go.js +0 -33
- package/lib/utils/go.js.map +0 -1
- package/lib/world/world-debug.js +0 -89
- package/lib/world/world-debug.js.map +0 -1
- package/lib/world/world-physics.js +0 -45
- package/lib/world/world-physics.js.map +0 -1
- package/lib/world/world-rendering.js +0 -123
- package/lib/world/world-rendering.js.map +0 -1
- package/lib/world/world.js +0 -147
- package/lib/world/world.js.map +0 -1
- package/src/game-object/game-object-physics.ts +0 -191
- package/src/game-object/game-object-rendering.ts +0 -27
- package/src/game-object/game-object.ts +0 -190
- package/src/game-object/transform.ts +0 -164
- package/src/game-object-ext/animated-sprite.ts +0 -140
- package/src/game-object-ext/dom-container.ts +0 -67
- package/src/game-object-ext/rect.ts +0 -40
- package/src/game-object-ext/spine.ts +0 -235
- package/src/game-object-ext/sprite.ts +0 -55
- package/src/game-object-ext/text.ts +0 -83
- package/src/game-object-ext/tiling-sprite.ts +0 -73
- package/src/utils/debug.ts +0 -5
- package/src/utils/go.ts +0 -53
- package/src/world/world-debug.ts +0 -114
- package/src/world/world-physics.ts +0 -52
- package/src/world/world-rendering.ts +0 -145
- package/src/world/world.ts +0 -171
- /package/examples/{test-dom → auto-battle}/index.html +0 -0
- /package/lib/{utils/debug.js → debug.js} +0 -0
- /package/lib/types/{utils/debug.d.ts → debug.d.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see game.js.LICENSE.txt */
|
|
2
|
+
(()=>{var t,e,r,s,i,n={59:(t,e,r)=>{"use strict";r.d(e,{b:()=>s});class s{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new s(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return i.x=0,i.y=0,i}}const i=new s},159:(t,e,r)=>{"use strict";r.d(e,{q:()=>s});class s{name;order;skinRequired;constructor(t,e,r){this.name=t,this.order=e,this.skinRequired=r}}},166:(t,e,r)=>{"use strict";r.d(e,{A1g:()=>k.A,AeT:()=>G.A,AgS:()=>n.Ag,Dl5:()=>R.D,FFI:()=>x.F,Ivi:()=>g.I,M_G:()=>f.M,Mtr:()=>C.M,PDq:()=>y.P,Q1f:()=>d.Q,RvI:()=>O.R,Sdw:()=>T.S,T9C:()=>l.T,V23:()=>A.V,WOU:()=>c.W,Whu:()=>S.W,XOh:()=>n.XO,Y8S:()=>u.Y,_1d:()=>y._,a4b:()=>x.a,b3l:()=>v.b,eBH:()=>p.e,gPd:()=>E.g,hpe:()=>w.h,i4V:()=>m.i,kxk:()=>B.k,l2R:()=>o.l,lZB:()=>I.l,mcf:()=>M.mc,mx8:()=>v.m,n2X:()=>b.n,q5F:()=>_.q,sP:()=>a.s,v9C:()=>P.v,vfs:()=>g.v,xR6:()=>h.x,zo6:()=>F.z});var s=r(3472),i=r(9836),n=r(1065),a=(r(2542),r(2517),r(7455)),o=r(2445),l=r(3463),h=r(2027),c=r(4173),u=r(9279),d=r(6675),p=r(5423),f=r(9390),m=r(656),g=r(9677),x=r(2305),y=r(1570),v=r(7335),_=r(6863),b=r(2478),w=r(1579),T=r(9798),S=r(9062),A=r(8337),C=r(1657),P=r(4269),E=r(9739),M=(r(7935),r(4687)),k=r(4454),R=r(7903),B=r(4242),I=r(4543),F=r(2043),O=r(3651),G=(r(4872),r(8869));n.XO.add(s.I,i.S)},192:(t,e,r)=>{"use strict";r.d(e,{R:()=>i});var s=r(2432);class i extends s.b{#t;children=[];paused=!1;set parent(t){this.#t=t}get parent(){return this.#t}add(...t){for(const e of t){if(e.#t){const t=e.#t.children.indexOf(e);-1!==t&&e.#t.children.splice(t,1)}e.parent=this,this.children.push(e)}}remove(){if(super.remove(),this.#t){const t=this.#t.children.indexOf(this);-1!==t&&this.#t.children.splice(t,1),this.#t=void 0}for(const t of this.children)t.parent=void 0,t.remove();this.children.length=0}pause(){this.paused=!0;for(const t of this.children)t.pause()}resume(){this.paused=!1;for(const t of this.children)t.resume()}update(t){if(!this.paused){for(const e of this.children)e.paused||e.update(t);this.emit("update",t)}}}},275:(t,e,r)=>{"use strict";function s(t,e){if(t)return Object.assign(t.style,e),t}r.d(e,{e:()=>s})},432:(t,e,r)=>{"use strict";r.d(e,{Lw:()=>n.Lw,MR:()=>n.MR,Rt:()=>i.R,mI:()=>n.mI,qd:()=>n.qd,t7:()=>n.t7,yE:()=>s.yE}),r(6093),r(3916),r(3394),r(564),r(9031);var s=r(9155),i=(r(5851),r(6836)),n=r(8034)},498:(t,e,r)=>{"use strict";r.d(e,{q:()=>n});var s=r(7694),i=r(4988);function n(t,e){for(const r in t.attributes){const i=t.attributes[r],n=e[r];n?(i.format??(i.format=n.format),i.offset??(i.offset=n.offset),i.instance??(i.instance=n.instance)):(0,s.R)(`Attribute ${r} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}!function(t){const{buffers:e,attributes:r}=t,s={},n={};for(const t in e){const r=e[t];s[r.uid]=0,n[r.uid]=0}for(const t in r){const e=r[t];s[e.buffer.uid]+=(0,i.m)(e.format).stride}for(const t in r){const e=r[t];e.stride??(e.stride=s[e.buffer.uid]),e.start??(e.start=n[e.buffer.uid]),n[e.buffer.uid]+=(0,i.m)(e.format).stride}}(t)}},499:(t,e,r)=>{"use strict";r.d(e,{W:()=>n});var s=r(166),i=r(2437);class n extends i.N{constructor(t){super(new s.mcf({sortableChildren:!0})),this._pixiContainer.zIndex=t,this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty()}}},528:(t,e,r)=>{"use strict";r.d(e,{c:()=>n});var s=r(946),i=r(1347);class n{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0;r<t.bones.length;r++){let s=e.findBone(t.bones[r].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[r].name}`);this.bones.push(s)}let r=e.findBone(t.target.name);if(!r)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=r,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(0==this.mix)return;let e=this.target,r=this.bones;switch(r.length){case 1:this.apply1(r[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(r[0],r[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}apply1(t,e,r,n,a,o,l){let h=t.parent;if(!h)throw new Error("IK bone must have parent.");let c=h.a,u=h.b,d=h.c,p=h.d,f=-t.ashearX-t.arotation,m=0,g=0;switch(t.inherit){case s.u.OnlyTranslation:m=(e-t.worldX)*i.cj.signum(t.skeleton.scaleX),g=(r-t.worldY)*i.cj.signum(t.skeleton.scaleY);break;case s.u.NoRotationOrReflection:let n=Math.abs(c*p-u*d)/Math.max(1e-4,c*c+d*d),a=c/t.skeleton.scaleX,o=d/t.skeleton.scaleY;u=-o*n*t.skeleton.scaleX,p=a*n*t.skeleton.scaleY,f+=Math.atan2(o,a)*i.cj.radDeg;default:let l=e-h.worldX,x=r-h.worldY,y=c*p-u*d;Math.abs(y)<=1e-4?(m=0,g=0):(m=(l*p-x*u)/y-t.ax,g=(x*c-l*d)/y-t.ay)}f+=Math.atan2(g,m)*i.cj.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=t.ascaleX,y=t.ascaleY;if(n||a){switch(t.inherit){case s.u.NoScale:case s.u.NoScaleOrReflection:m=e-t.worldX,g=r-t.worldY}const i=t.data.length*x;if(i>1e-4){const t=m*m+g*g;if(n&&t<i*i||a&&t>i*i){const e=(Math.sqrt(t)/i-1)*l+1;x*=e,o&&(y*=e)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*l,x,y,t.ashearX,t.ashearY)}apply2(t,e,r,n,a,o,l,h,c){if(t.inherit!=s.u.Normal||e.inherit!=s.u.Normal)return;let u=t.ax,d=t.ay,p=t.ascaleX,f=t.ascaleY,m=p,g=f,x=e.ascaleX,y=0,v=0,_=0;p<0?(p=-p,y=180,_=-1):(y=0,_=1),f<0&&(f=-f,_=-_),x<0?(x=-x,v=180):v=0;let b=e.ax,w=0,T=0,S=0,A=t.a,C=t.b,P=t.c,E=t.d,M=Math.abs(p-f)<=1e-4;!M||o?(w=0,T=A*b+t.worldX,S=P*b+t.worldY):(w=e.ay,T=A*b+C*w+t.worldX,S=P*b+E*w+t.worldY);let k=t.parent;if(!k)throw new Error("IK parent must itself have a parent.");A=k.a,C=k.b,P=k.c,E=k.d;let R=A*E-C*P,B=T-k.worldX,I=S-k.worldY;R=Math.abs(R)<=1e-4?0:1/R;let F,O,G=(B*E-I*C)*R-u,D=(I*A-B*P)*R-d,U=Math.sqrt(G*G+D*D),L=e.data.length*x;if(U<1e-4)return this.apply1(t,r,n,!1,o,!1,c),void e.updateWorldTransformWith(b,w,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);B=r-k.worldX,I=n-k.worldY;let N=(B*E-I*C)*R-u,X=(I*A-B*P)*R-d,V=N*N+X*X;if(0!=h){h*=p*(x+1)*.5;let t=Math.sqrt(V),e=t-U-L*p+h;if(e>0){let r=Math.min(1,e/(2*h))-1;r=(e-h*(1-r*r))/t,N-=r*N,X-=r*X,V=N*N+X*X}}t:if(M){L*=p;let t=(V-U*U-L*L)/(2*U*L);t<-1?(t=-1,O=Math.PI*a):t>1?(t=1,O=0,o&&(A=(Math.sqrt(V)/(U+L)-1)*c+1,m*=A,l&&(g*=A))):O=Math.acos(t)*a,A=U+L*t,C=L*Math.sin(O),F=Math.atan2(X*A-N*C,N*A+X*C)}else{A=p*L,C=f*L;let t=A*A,e=C*C,r=Math.atan2(X,N);P=e*U*U+t*V-t*e;let s=-2*e*U,n=e-t;if(E=s*s-4*n*P,E>=0){let t=Math.sqrt(E);s<0&&(t=-t),t=.5*-(s+t);let e=t/n,i=P/t,o=Math.abs(e)<Math.abs(i)?e:i;if(e=V-o*o,e>=0){I=Math.sqrt(e)*a,F=r-Math.atan2(I,o),O=Math.atan2(I/f,(o-U)/p);break t}}let o=i.cj.PI,l=U-A,h=l*l,c=0,u=0,d=U+A,m=d*d,g=0;P=-A*U/(t-e),P>=-1&&P<=1&&(P=Math.acos(P),B=A*Math.cos(P)+U,I=C*Math.sin(P),E=B*B+I*I,E<h&&(o=P,h=E,l=B,c=I),E>m&&(u=P,m=E,d=B,g=I)),V<=.5*(h+m)?(F=r-Math.atan2(c*a,l),O=o*a):(F=r-Math.atan2(g*a,d),O=u*a)}let Y=Math.atan2(w,b)*_,z=t.arotation;F=(F-Y)*i.cj.radDeg+y-z,F>180?F-=360:F<-180&&(F+=360),t.updateWorldTransformWith(u,d,z+F*c,m,g,0,0),z=e.arotation,O=((O+Y)*i.cj.radDeg-e.ashearX)*_+v-z,O>180?O-=360:O<-180&&(O+=360),e.updateWorldTransformWith(b,w,z+O*c,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}},564:(t,e,r)=>{"use strict";var s=r(166),i=r(6679),n=r(8826);let a=null;class o extends s.i4V{static extension={type:[s.AgS.Batcher],name:"darkTint"};geometry=new i.A;shader=a||(a=new n.f(this.maxTextures));name=o.extension.name;vertexSize=7;packAttributes(t,e,r,i,n){const a=n<<16|65535&t.roundPixels,o=t.transform,l=o.a,h=o.b,c=o.c,u=o.d,d=o.tx,p=o.ty,{positions:f,uvs:m}=t,g=t.color,x=(g>>24&255)/255,y=s.Q1f.shared.setValue(t.darkColor).premultiply(x,!0).toPremultiplied(1,!1),v=t.attributeOffset,_=v+t.attributeSize;for(let t=v;t<_;t++){const s=2*t,n=f[s],o=f[s+1];e[i++]=l*n+c*o+d,e[i++]=u*o+h*n+p,e[i++]=m[s],e[i++]=m[s+1],r[i++]=g,r[i++]=y,r[i++]=a}}packQuadAttributes(t,e,r,s,i){const n=t.texture,a=t.transform,o=a.a,l=a.b,h=a.c,c=a.d,u=a.tx,d=a.ty,p=t.bounds,f=p.maxX,m=p.minX,g=p.maxY,x=p.minY,y=n.uvs,v=t.color,_=t.darkColor,b=i<<16|65535&t.roundPixels;e[s+0]=o*m+h*x+u,e[s+1]=c*x+l*m+d,e[s+2]=y.x0,e[s+3]=y.y0,r[s+4]=v,r[s+5]=_,r[s+6]=b,e[s+7]=o*f+h*x+u,e[s+8]=c*x+l*f+d,e[s+9]=y.x1,e[s+10]=y.y1,r[s+11]=v,r[s+12]=_,r[s+13]=b,e[s+14]=o*f+h*g+u,e[s+15]=c*g+l*f+d,e[s+16]=y.x2,e[s+17]=y.y2,r[s+18]=v,r[s+19]=_,r[s+20]=b,e[s+21]=o*m+h*g+u,e[s+22]=c*g+l*m+d,e[s+23]=y.x3,e[s+24]=y.y3,r[s+25]=v,r[s+26]=_,r[s+27]=b}}s.XOh.add(o)},592:(t,e,r)=>{"use strict";r.d(e,{U:()=>h});var s=r(8147),i=r(192),n=r(2437),a=r(6121),o=r(275);class l extends i.R{worldTransform=new a.Z;worldAlpha=new s.w(1);constructor(){super(),this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty()}}class h extends i.R{el=document.createElement("div");#e=new a.U;worldTransform=new a.Z;alpha=1;worldAlpha=new s.w(1);#r=!1;constructor(t){super(),(0,o.e)(this.el,{position:"absolute",left:"50%",top:"50%",zIndex:"1",transform:"translate(-50%, -50%)"}),t&&(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.scaleX&&(this.scaleX=t.scaleX),void 0!==t.scaleY&&(this.scaleY=t.scaleY),void 0!==t.pivotX&&(this.pivotX=t.pivotX),void 0!==t.pivotY&&(this.pivotY=t.pivotY),void 0!==t.rotation&&(this.rotation=t.rotation),void 0!==t.alpha&&(this.alpha=t.alpha),this.#r=t.useYSort??!1)}render(t){this.update(t),this._updateWorldTransform()}_updateWorldTransform(){const t=this.parent;if(t&&(0,n.l)(t)&&(this.worldTransform.update(t.worldTransform,this.#e),this.worldAlpha.v=t.worldAlpha.v*this.alpha),this.worldTransform.dirty){const t=this.worldTransform;this.el.style.transform=`\n translate(\n calc(-50% + ${t.x.v}px),\n calc(-50% + ${t.y.v}px)\n )\n scale(${t.scaleX.v}, ${t.scaleY.v})\n rotate(${t.rotation.v}rad)\n `}this.worldAlpha.dirty&&(this.el.style.opacity=this.worldAlpha.v.toString());for(const t of this.children)(0,n.l)(t)&&t._updateWorldTransform();this.worldTransform.resetDirty()}attachTo(t){return t.appendChild(this.el),this.parent=new l,this._updateWorldTransform(),this}set x(t){this.#e.x=t}get x(){return this.#e.x}set y(t){this.#e.y=t}get y(){return this.#e.y}set scale(t){this.#e.scaleX=t,this.#e.scaleY=t}get scale(){return this.#e.scaleX}set scaleX(t){this.#e.scaleX=t}get scaleX(){return this.#e.scaleX}set scaleY(t){this.#e.scaleY=t}get scaleY(){return this.#e.scaleY}set pivotX(t){this.#e.pivotX=t}get pivotX(){return this.#e.pivotX}set pivotY(t){this.#e.pivotY=t}get pivotY(){return this.#e.pivotY}set rotation(t){this.#e.rotation=t}get rotation(){return this.#e.rotation}}},605:(t,e,r)=>{"use strict";r(166),r(7249).X},646:(t,e,r)=>{"use strict";r.d(e,{gd:()=>n,l8:()=>a,zu:()=>s});var s,i=r(1347);class n{static _nextID=0;id=n.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new n(this.regions.length);return i.Aq.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let r=t.sequenceIndex;-1==r&&(r=this.setupIndex),r>=this.regions.length&&(r=this.regions.length-1);let s=this.regions[r];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let r=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)r+="0";return r+=s,r}static nextID(){return n._nextID++}}!function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(s||(s={}));const a=[s.hold,s.once,s.loop,s.pingpong,s.onceReverse,s.loopReverse,s.pingpongReverse]},656:(t,e,r)=>{"use strict";r.d(e,{i:()=>_});var s=r(9375),i=r(4142),n=r(4696),a=r(1753),o=r(9062),l=r(3769),h=r(8574),c=r(6890);let u=null;class d{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class p{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new d,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}}const f=[];let m=0;function g(){return m>0?f[--m]:new p}function x(t){f[m++]=t}a.L.register({clear:()=>{if(f.length>0)for(const t of f)t&&t.destroy();f.length=0,m=0}});let y=0;const v=class t{constructor(e){this.uid=(0,s.L)("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],(e={...t.defaultOptions,...e}).maxTextures||((0,n.t6)("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=function(){if(u)return u;const t=(0,h.W)();return u=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=(0,c.u)(u,t),t.getExtension("WEBGL_lose_context")?.loseContext(),u}());const{maxTextures:r,attributesInitialSize:a,indicesInitialSize:o}=e;this.attributeBuffer=new i.u(4*a),this.indexBuffer=new Uint16Array(o),this.maxTextures=r}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)x(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const r=t._batch.textures.ids[e._source.uid];return!(!r&&0!==r||(t._textureId=r,t.texture=e,0))}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let r=g(),s=r.textures;s.clear();const i=e[this.elementStart];let n=(0,l.i)(i.blendMode,i.texture._source),a=i.topology;4*this.attributeSize>this.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const o=this.attributeBuffer.float32View,h=this.attributeBuffer.uint32View,c=this.indexBuffer;let u=this._batchIndexSize,d=this._batchIndexStart,p="startBatch";const f=this.maxTextures;for(let i=this.elementStart;i<this.elementSize;++i){const m=e[i];e[i]=null;const x=m.texture._source,v=(0,l.i)(m.blendMode,x),_=n!==v||a!==m.topology;x._batchTick!==y||_?(x._batchTick=y,(s.count>=f||_)&&(this._finishBatch(r,d,u-d,s,n,a,t,p),p="renderBatch",d=u,n=v,a=m.topology,r=g(),s=r.textures,s.clear(),++y),m._textureId=x._textureBindLocation=s.count,s.ids[x.uid]=s.count,s.textures[s.count++]=x,m._batch=r,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,o,h,m._attributeStart,m._textureId),this.packQuadIndex(c,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,o,h,m._attributeStart,m._textureId),this.packIndex(m,c,m._indexStart,m._attributeStart/this.vertexSize))):(m._textureId=x._textureBindLocation,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,o,h,m._attributeStart,m._textureId),this.packQuadIndex(c,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,o,h,m._attributeStart,m._textureId),this.packIndex(m,c,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=r)}s.count>0&&(this._finishBatch(r,d,u-d,s,n,a,t,p),d=u,++y),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=u}_finishBatch(t,e,r,s,i,n,a,o){t.gpuBindGroup=null,t.bindGroup=null,t.action=o,t.batcher=this,t.textures=s,t.blendMode=i,t.topology=n,t.start=e,t.size=r,++y,this.batches[this.batchIndex++]=t,a.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){4*t<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*t)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,2*this.attributeBuffer.size),r=new i.u(e);(0,o.W)(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(t){const e=this.indexBuffer;let r=Math.max(t,1.5*e.length);r+=r%2;const s=r>65535?new Uint32Array(r):new Uint16Array(r);if(s.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let t=0;t<e.length;t++)s[t]=e[t];else(0,o.W)(e.buffer,s.buffer);this.indexBuffer=s}packQuadIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}packIndex(t,e,r,s){const i=t.indices,n=t.indexSize,a=t.indexOffset,o=t.attributeOffset;for(let t=0;t<n;t++)e[r++]=s+i[t+a]-o}destroy(){if(null!==this.batches){for(let t=0;t<this.batches.length;t++)x(this.batches[t]);this.batches=null;for(let t=0;t<this._elements.length;t++)this._elements[t]&&(this._elements[t]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};v.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let _=v},743:(t,e,r)=>{"use strict";r.a(t,async(t,e)=>{try{var s=r(4968);(0,s.Nw)(),await(0,s.uv)(["assets/bird.png"]);const t=new s.A4(document.body,{logicalWidth:800,logicalHeight:600,backgroundColor:"#304C79"}),i=new s.ok({texture:"assets/bird.png",count:{min:5,max:10},lifespan:{min:.5,max:1.5},angle:{min:0,max:2*Math.PI},velocity:{min:50,max:100},particleScale:{min:.5,max:1},fadeRate:-1,orientToVelocity:!0,startAlpha:1,blendMode:"screen"});t.add(i),window.addEventListener("click",e=>{const{x:r,y:s}=t.screenToWorld(e.clientX,e.clientY);i.burst({x:r,y:s})}),e()}catch(t){e(t)}},1)},761:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var s=r(1753);class i{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return e=this._index>0?this._pool[--this._index]:new this._classType,e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}const n=new class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new i(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const r=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[r]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}};s.L.register(n)},769:(t,e,r)=>{"use strict";r.d(e,{E:()=>u});var s=r(5199);const i=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],n=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],o=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],h=[],c=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];l.push(e);for(let r=0;r<16;r++){const s=c(i[t]*i[r]+a[t]*n[r]),l=c(n[t]*i[r]+o[t]*n[r]),h=c(i[t]*a[r]+a[t]*o[r]),u=c(n[t]*a[r]+o[t]*o[r]);for(let t=0;t<16;t++)if(i[t]===s&&n[t]===l&&a[t]===h&&o[t]===u){e.push(t);break}}}for(let t=0;t<16;t++){const e=new s.u;e.set(i[t],n[t],a[t],o[t],0,0),h.push(e)}}();const u={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>i[t],uY:t=>n[t],vX:t=>a[t],vY:t=>o[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>l[t][e],sub:(t,e)=>l[t][u.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?u.S:u.N:2*Math.abs(e)<=Math.abs(t)?t>0?u.E:u.W:e>0?t>0?u.SE:u.SW:t>0?u.NE:u.NW,matrixAppendRotationInv:(t,e,r=0,s=0)=>{const i=h[u.inv(e)];i.tx=r,i.ty=s,t.append(i)},transformRectCoords:(t,e,r,s)=>{const{x:i,y:n,width:a,height:o}=t,{x:l,y:h,width:c,height:d}=e;return r===u.E?(s.set(i+l,n+h,a,o),s):r===u.S?s.set(c-n-o+l,i+h,o,a):r===u.W?s.set(c-i-a+l,d-n-o+h,a,o):r===u.N?s.set(n+l,d-i-a+h,o,a):s.set(i+l,n+h,a,o)}}},791:(t,e,r)=>{"use strict";r.d(e,{S:()=>a});var s=r(6793),i=r(7635);class n extends s.a{#s=new Map;async doLoad(t,e){this.#s.set(t,e);const r=(async()=>{const r=await i.V.load(e);if(!r)return void console.error(`Failed to load texture: ${e}`);const s=await fetch(t);if(s.ok)try{const n=await s.text(),a=(new DOMParser).parseFromString(n,"application/xml"),o=a.getElementsByTagName("info")[0],l=a.getElementsByTagName("common")[0],h=a.getElementsByTagName("char"),c=parseInt(o.getAttribute("size")||"16",10),u=parseInt(l.getAttribute("lineHeight")||"32",10),d={};for(let t=0;t<h.length;t++){const e=h[t],r=parseInt(e.getAttribute("id"),10),s=parseInt(e.getAttribute("x"),10),i=parseInt(e.getAttribute("y"),10),n=parseInt(e.getAttribute("width"),10),a=parseInt(e.getAttribute("height"),10),o=parseInt(e.getAttribute("xoffset"),10),l=parseInt(e.getAttribute("yoffset"),10),c=parseInt(e.getAttribute("xadvance"),10);d[r]={x:s,y:i,width:n,height:a,xoffset:o,yoffset:l,xadvance:c}}this.loadingPromises.delete(t);const p={src:e,chars:d,texture:r,size:c,lineHeight:u};if(this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,p),p;i.V.release(e),console.error(`Bitmap font already exists: ${t}`)}else i.V.release(e)}catch(e){console.error(`Failed to decode font xml: ${t}`,e),this.loadingPromises.delete(t)}else console.error(`Failed to load font xml: ${t}`)})();return this.loadingPromises.set(t,r),await r}cleanup(t){const e=this.#s.get(t);e&&i.V.release(e)}}const a=new n},792:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function s(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new i(s,n||t,a),l=r?r+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),o.prototype.eventNames=function(){var t,s,i=[];if(0===this._eventsCount)return i;for(s in t=this._events)e.call(t,s)&&i.push(r?s.slice(1):s);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=r?r+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,n=s.length,a=new Array(n);i<n;i++)a[i]=s[i].fn;return a},o.prototype.listenerCount=function(t){var e=r?r+t:t,s=this._events[e];return s?s.fn?1:s.length:0},o.prototype.emit=function(t,e,s,i,n,a){var o=r?r+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,s),!0;case 4:return c.fn.call(c.context,e,s,i),!0;case 5:return c.fn.call(c.context,e,s,i,n),!0;case 6:return c.fn.call(c.context,e,s,i,n,a),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,s);break;case 4:c[h].fn.call(c[h].context,e,s,i);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,r){return n(this,t,e,r,!1)},o.prototype.once=function(t,e,r){return n(this,t,e,r,!0)},o.prototype.removeListener=function(t,e,s,i){var n=r?r+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||i&&!o.once||s&&o.context!==s||a(this,n);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||i&&!o[l].once||s&&o[l].context!==s)&&h.push(o[l]);h.length?this._events[n]=1===h.length?h[0]:h:a(this,n)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&a(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o},796:(t,e,r)=>{"use strict";r.d(e,{e:()=>x});var s=r(5423),i=r(1065),n=r(7694),a=r(8869),o=r(2445),l=r(3761),h=r(4173),c=r(3463);const u=["normal","bold","100","200","300","400","500","600","700","800","900"],d=[".ttf",".otf",".woff",".woff2"],p=["font/ttf","font/otf","font/woff","font/woff2"],f=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i,m=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function g(t){return m.test(t)?t:encodeURI(t)}const x={extension:{type:i.Ag.LoadParser,priority:c.T.Low},name:"loadWebFont",id:"web-font",test:t=>(0,l.s)(t,p)||(0,h.W)(t,d),async load(t,e){const r=s.e.get().getFontFaceSet();if(r){const s=[],i=e.data?.family??function(t){const e=a.A.extname(t),r=a.A.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1));let s=r.length>0;for(const t of r)if(!t.match(f)){s=!1;break}let i=r.join(" ");return s||(i=`"${i.replace(/[\\"]/g,"\\$&")}"`),i}(t),n=e.data?.weights?.filter(t=>u.includes(t))??["normal"],l=e.data??{};for(let e=0;e<n.length;e++){const a=n[e],o=new FontFace(i,`url(${g(t)})`,{...l,weight:a});await o.load(),r.add(o),s.push(o)}return o.l.has(`${i}-and-url`)?o.l.get(`${i}-and-url`).entries.push({url:t,faces:s}):o.l.set(`${i}-and-url`,{entries:[{url:t,faces:s}]}),1===s.length?s[0]:s}return(0,n.R)("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){const e=Array.isArray(t)?t:[t],r=e[0].family,i=o.l.get(`${r}-and-url`),n=i.entries.find(t=>t.faces.some(t=>-1!==e.indexOf(t)));n.faces=n.faces.filter(t=>-1===e.indexOf(t)),0===n.faces.length&&(i.entries=i.entries.filter(t=>t!==n)),e.forEach(t=>{s.e.get().getFontFaceSet().delete(t)}),0===i.entries.length&&o.l.remove(`${r}-and-url`)}}},826:(t,e,r)=>{"use strict";r.d(e,{R:()=>s});class s{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(t){this.name=t}}},903:(t,e,r)=>{"use strict";r.d(e,{V:()=>n});var s=r(5423);let i;async function n(t={}){return void 0!==i||(i=await(async()=>{const e=s.e.get().getNavigator().gpu;if(!e)return!1;try{const r=await e.requestAdapter(t);return await r.requestDevice(),!0}catch(t){return!1}})()),i}},946:(t,e,r)=>{"use strict";r.d(e,{h:()=>n,u:()=>s});var s,i=r(1347);class n{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=s.Normal;skinRequired=!1;color=new i.Q1;icon;visible=!1;constructor(t,e,r){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=r}}!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(s||(s={}))},966:(t,e,r)=>{"use strict";var s=r(1065),i=r(2445),n=r(4454),a=r(7926),o=r(5199),l=r(9677),h=r(2305),c=r(1570),u=r(7335),d=r(2478),p=r(1657),f=r(4449);const m={name:"local-uniform-msdf-bit",vertex:{header:"\n struct LocalUniforms {\n uColor:vec4<f32>,\n uTransformMatrix:mat3x3<f32>,\n uDistance: f32,\n uRound:f32,\n }\n\n @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ",main:"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ",end:"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:"\n struct LocalUniforms {\n uColor:vec4<f32>,\n uTransformMatrix:mat3x3<f32>,\n uDistance: f32\n }\n\n @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ",main:"\n outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));\n "}},g={name:"local-uniform-msdf-bit",vertex:{header:"\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ",main:"\n vColor *= uColor;\n modelMatrix *= uTransformMatrix;\n ",end:"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:"\n uniform float uDistance;\n ",main:"\n outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));\n "}},x={name:"msdf-bit",fragment:{header:"\n fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {\n\n // MSDF\n var median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n\n // SDF\n median = min(median, msdfColor.a);\n\n var screenPxDistance = distance * (median - 0.5);\n var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));\n var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);\n var coverage: f32 = pow(shapeColor.a * alpha, gamma);\n\n return coverage;\n\n }\n "}},y={name:"msdf-bit",fragment:{header:"\n float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {\n\n // MSDF\n float median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n\n // SDF\n median = min(median, msdfColor.a);\n\n float screenPxDistance = distance * (median - 0.5);\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n\n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));\n float gamma = mix(1.0, 1.0 / 2.2, luma);\n float coverage = pow(shapeColor.a * alpha, gamma);\n\n return coverage;\n }\n "}};let v,_;class b extends p.M{constructor(t){const e=new f.k({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new o.u,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});v??(v=(0,l.v)({name:"sdf-shader",bits:[h.F,(0,c._)(t),m,x,u.b]})),_??(_=(0,l.I)({name:"sdf-shader",bits:[h.a,(0,c.P)(t),g,y,u.m]})),super({glProgram:_,gpuProgram:v,resources:{localUniforms:e,batchSamplers:(0,d.n)(t)}})}}var w=r(8598),T=r(5353);class S extends n.A{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}}class A{constructor(t){this._renderer=t}validateRenderable(t){const e=this._getGpuBitmapText(t);return this._renderer.renderPipes.graphics.validateRenderable(e)}addRenderable(t,e){const r=this._getGpuBitmapText(t);C(t,r),t._didTextUpdate&&(t._didTextUpdate=!1,this._updateContext(t,r)),this._renderer.renderPipes.graphics.addRenderable(r,e),r.context.customShader&&this._updateDistanceField(t)}updateRenderable(t){const e=this._getGpuBitmapText(t);C(t,e),this._renderer.renderPipes.graphics.updateRenderable(e),e.context.customShader&&this._updateDistanceField(t)}_updateContext(t,e){const{context:r}=e,s=w.c.getFont(t.text,t._style);r.clear(),"none"!==s.distanceField.type&&(r.customShader||(r.customShader=new b(this._renderer.limits.maxBatchableTextures)));const i=a.P.graphemeSegmenter(t.text),n=t._style;let o=s.baseLineOffset;const l=(0,T.Z)(i,n,s,!0),h=n.padding,c=l.scale;let u=l.width,d=l.height+l.offsetY;n._stroke&&(u+=n._stroke.width/c,d+=n._stroke.width/c),r.translate(-t._anchor._x*u-h,-t._anchor._y*d-h).scale(c,c);const p=s.applyFillAsTint?n._fill.color:16777215;let f=s.fontMetrics.fontSize,m=s.lineHeight;n.lineHeight&&(f=n.fontSize/c,m=n.lineHeight/c);let g=(m-f)/2;g-s.baseLineOffset<0&&(g=0);for(let t=0;t<l.lines.length;t++){const e=l.lines[t];for(let t=0;t<e.charPositions.length;t++){const i=e.chars[t],n=s.chars[i];if(n?.texture){const s=n.texture;r.texture(s,p||"black",Math.round(e.charPositions[t]+n.xOffset),Math.round(o+n.yOffset+g),s.orig.width,s.orig.height)}}o+=m}}_getGpuBitmapText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new S;return t._gpuData[this._renderer.uid]=e,this._updateContext(t,e),e}_updateDistanceField(t){const e=this._getGpuBitmapText(t).context,r=t._style.fontFamily,s=i.l.get(`${r}-bitmap`),{a:n,b:a,c:o,d:l}=t.groupTransform,h=Math.sqrt(n*n+a*a),c=Math.sqrt(o*o+l*l),u=(Math.abs(h)+Math.abs(c))/2,d=s.baseRenderedFontSize/t._style.fontSize,p=u*s.distanceField.range*(1/d);e.customShader.resources.localUniforms.uniforms.uDistance=p}destroy(){this._renderer=null}}function C(t,e){e.groupTransform=t.groupTransform,e.groupColorAlpha=t.groupColorAlpha,e.groupColor=t.groupColor,e.groupBlendMode=t.groupBlendMode,e.globalDisplayStatus=t.globalDisplayStatus,e.groupTransform=t.groupTransform,e.localDisplayStatus=t.localDisplayStatus,e.groupAlpha=t.groupAlpha,e._roundPixels=t._roundPixels}A.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"bitmapText"},s.XO.add(A)},992:(t,e,r)=>{"use strict";r.d(e,{R:()=>s,i:()=>i});const s={name:"color-bit",vertex:{header:"\n @in aDarkColor: vec4<f32>;\n @out vDarkColor: vec4<f32>;\n ",main:"\n vDarkColor = aDarkColor;\n "},fragment:{header:"\n @in vDarkColor: vec4<f32>;\n ",end:"\n\n let alpha = outColor.a * vColor.a;\n let rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;\n\n finalColor = vec4<f32>(rgb, alpha);\n\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aDarkColor;\n out vec4 vDarkColor;\n ",main:"\n vDarkColor = aDarkColor;\n "},fragment:{header:"\n in vec4 vDarkColor;\n ",end:"\n\n finalColor.a = outColor.a * vColor.a;\n finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;\n "}}},1009:(t,e,r)=>{"use strict";r.d(e,{W:()=>a});var s=r(8883),i=r(1579),n=r(9798);class a{constructor(t){this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()}_systemCheck(){if(!(0,s.f)())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(t){const e=this.getUniformGroupData(t);t.buffer||(t.buffer=new i.h({data:new Float32Array(e.layout.size/4),usage:n.S.UNIFORM|n.S.COPY_DST}))}getUniformGroupData(t){return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)}_initUniformGroup(t){const e=t._signature;let r=this._syncFunctionHash[e];if(!r){const s=Object.keys(t.uniformStructures).map(e=>t.uniformStructures[e]),i=this._adaptor.createUboElements(s),n=this._generateUboSync(i.uboElements);r=this._syncFunctionHash[e]={layout:i,syncFunction:n}}return this._syncFunctionHash[e]}_generateUboSync(t){return this._adaptor.generateUboSync(t)}syncUniformGroup(t,e,r){const s=this.getUniformGroupData(t);t.buffer||(t.buffer=new i.h({data:new Float32Array(s.layout.size/4),usage:n.S.UNIFORM|n.S.COPY_DST}));let a=null;return e||(e=t.buffer.data,a=t.buffer.dataInt32),r||(r=0),s.syncFunction(t.uniforms,e,a,r),!0}updateUniformGroup(t){if(t.isStatic&&!t._dirtyId)return!1;t._dirtyId=0;const e=this.syncUniformGroup(t);return t.buffer.update(),e}destroy(){this._syncFunctionHash=null}}},1055:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});let s=null;class i{constructor(){s||(s=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n async function loadImageBitmap(url, alphaMode) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const imageBlob = await response.blob();\n return alphaMode === "premultiplied-alpha" ? createImageBitmap(imageBlob, { premultiplyAlpha: "none" }) : createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(s)}}i.revokeObjectURL=function(){s&&(URL.revokeObjectURL(s),s=null)}},1065:(t,e,r)=>{"use strict";r.d(e,{Ag:()=>s,XO:()=>a});var s=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(s||{});const i=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},n=(t,e)=>i(t).priority??e,a={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(i).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...t){return t.map(i).forEach(t=>{t.type.forEach(e=>{const r=this._addHandlers,s=this._queue;r[e]?r[e]?.(t):(s[e]=s[e]||[],s[e]?.push(t))})}),this},handle(t,e,r){const s=this._addHandlers,i=this._removeHandlers;if(s[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);s[t]=e,i[t]=r;const n=this._queue;return n[t]&&(n[t]?.forEach(t=>e(t)),delete n[t]),this},handleByMap(t,e){return this.handle(t,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByNamedList(t,e,r=-1){return this.handle(t,t=>{e.findIndex(e=>e.name===t.name)>=0||(e.push({name:t.name,value:t.ref}),e.sort((t,e)=>n(e.value,r)-n(t.value,r)))},t=>{const r=e.findIndex(e=>e.name===t.name);-1!==r&&e.splice(r,1)})},handleByList(t,e,r=-1){return this.handle(t,t=>{e.includes(t.ref)||(e.push(t.ref),e.sort((t,e)=>n(e,r)-n(t,r)))},t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)})},mixin(t,...e){for(const r of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(r))}}},1143:(t,e,r)=>{"use strict";r.d(e,{s:()=>n});var s=r(5423),i=r(3212);const n={test:t=>!("string"!=typeof t||!t.includes("<font>"))&&i.f.test(s.e.get().parseXML(t)),parse:t=>i.f.parse(s.e.get().parseXML(t))}},1174:(t,e,r)=>{"use strict";r.d(e,{u:()=>l});var s=r(1579),i=r(9798),n=r(8337),a=r(4696);const o=class t extends n.V{constructor(...e){let r=e[0]??{};r instanceof Float32Array&&((0,a.t6)(a.lj,"use new MeshGeometry({ positions, uvs, indices }) instead"),r={positions:r,uvs:e[1],indices:e[2]}),r={...t.defaultOptions,...r};const n=r.positions||new Float32Array([0,0,1,0,1,1,0,1]);let o=r.uvs;o||(o=r.positions?new Float32Array(n.length):new Float32Array([0,0,1,0,1,1,0,1]));const l=r.indices||new Uint32Array([0,1,2,0,2,3]),h=r.shrinkBuffersToFit;super({attributes:{aPosition:{buffer:new s.h({data:n,label:"attribute-mesh-positions",shrinkToFit:h,usage:i.S.VERTEX|i.S.COPY_DST}),format:"float32x2",stride:8,offset:0},aUV:{buffer:new s.h({data:o,label:"attribute-mesh-uvs",shrinkToFit:h,usage:i.S.VERTEX|i.S.COPY_DST}),format:"float32x2",stride:8,offset:0}},indexBuffer:new s.h({data:l,label:"index-mesh-buffer",shrinkToFit:h,usage:i.S.INDEX|i.S.COPY_DST}),topology:r.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(t){this.attributes.aPosition.buffer.data=t}get uvs(){return this.attributes.aUV.buffer.data}set uvs(t){this.attributes.aUV.buffer.data=t}get indices(){return this.indexBuffer.data}set indices(t){this.indexBuffer.data=t}};o.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let l=o},1228:(t,e,r)=>{"use strict";r.d(e,{U:()=>s});class s{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(t){this._topology=t}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}setTexture(t){this.texture!==t&&(this.texture=t,this._textureMatrixUpdateId=-1)}get uvs(){const t=this.geometry.getBuffer("aUV"),e=t.data;let r=e;const s=this.texture.textureMatrix;return s.isSimple||(r=this._transformedUvs,this._textureMatrixUpdateId===s._updateID&&this._uvUpdateId===t._updateID||((!r||r.length<e.length)&&(r=this._transformedUvs=new Float32Array(e.length)),this._textureMatrixUpdateId=s._updateID,this._uvUpdateId=t._updateID,s.multiplyUvs(e,r))),r}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}},1268:(t,e,r)=>{"use strict";r.d(e,{M:()=>n});var s=r(8851);const i=new(r(6170).c);function n(t,e,r,n){const a=i;a.minX=0,a.minY=0,a.maxX=t.width/n|0,a.maxY=t.height/n|0;const o=s.W.getOptimalTexture(a.width,a.height,n,!1);return o.source.uploadMethodId="image",o.source.resource=t,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=e/n,o.frame.height=r/n,o.source.emit("update",o.source),o.updateUvs(),o}},1274:(t,e,r)=>{"use strict";r(5242),new Map},1298:(t,e,r)=>{"use strict";r.d(e,{K:()=>n});var s=r(9087),i=r.n(s);class n{#i;constructor(t){const e=new(i());e.dom.style.position="absolute",e.showPanel(0),t.appendChild(e.dom),this.#i=e}update(){this.#i.update()}remove(){this.#i.dom.remove()}}},1347:(t,e,r)=>{"use strict";r.d(e,{Aq:()=>a,I9:()=>l,Q1:()=>i,bC:()=>o,cj:()=>n,eE:()=>s});class s{entries={};size=0;add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var r=0,s=t.length;r<s;r++)this.add(t[r]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}class i{r;g;b;a;static WHITE=new i(1,1,1,1);static RED=new i(1,0,0,1);static GREEN=new i(0,1,0,1);static BLUE=new i(0,0,1,1);static MAGENTA=new i(1,0,1,1);constructor(t=0,e=0,r=0,s=0){this.r=t,this.g=e,this.b=r,this.a=s}set(t,e,r,s){return this.r=t,this.g=e,this.b=r,this.a=s,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,r,s){return this.r+=t,this.g+=e,this.b+=r,this.a+=s,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}toRgb888(){const t=t=>("0"+(255*t).toString(16)).slice(-2);return Number("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new i){return e.setFromString(t)}}class n{static PI=3.1415927;static PI2=2*n.PI;static invPI2=1/n.PI2;static radiansToDegrees=180/n.PI;static radDeg=n.radiansToDegrees;static degreesToRadians=n.PI/180;static degRad=n.degreesToRadians;static clamp(t,e,r){return t<e?e:t>r?r:t}static cosDeg(t){return Math.cos(t*n.degRad)}static sinDeg(t){return Math.sin(t*n.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*n.degRad}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return n.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,r){let s=Math.random(),i=e-t;return s<=(r-t)/i?t+Math.sqrt(s*i*(r-t)):e-Math.sqrt((1-s)*i*(e-r))}static isPowerOfTwo(t){return t&&!(t&t-1)}}class a{static SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;static arrayCopy(t,e,r,s,i){for(let n=e,a=s;n<e+i;n++,a++)r[a]=t[n]}static arrayFill(t,e,r,s){for(let i=e;i<r;i++)t[i]=s}static setArraySize(t,e,r=0){let s=t.length;if(s==e)return t;if(t.length=e,s<e)for(let i=s;i<e;i++)t[i]=r;return t}static ensureArrayCapacity(t,e,r=0){return t.length>=e?t:a.setArraySize(t,e,r)}static newArray(t,e){let r=new Array(t);for(let s=0;s<t;s++)r[s]=e;return r}static newFloatArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return a.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return a.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,r=!0){for(var s=0;s<t.length;s++)if(t[s]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}class o{items=new Array;instantiator;constructor(t){this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class l{x;y;constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}},1351:(t,e,r)=>{"use strict";r.d(e,{M:()=>n});var s=r(1065);const i=["png","jpg","jpeg"],n={extension:{type:s.Ag.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...i],remove:async t=>t.filter(t=>!i.includes(t))}},1386:(t,e,r)=>{"use strict";r.d(e,{q:()=>a});var s=r(5423),i=r(1065),n=r(4269);class a extends n.v{constructor(t){t.resource||(t.resource=s.e.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),this.resource.width===this.pixelWidth&&this.resource.height===this.pixelHeight||(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,r=this._resolution){const s=super.resize(t,e,r);return s&&this.resizeCanvas(),s}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}a.extension=i.Ag.TextureSource},1422:(t,e,r)=>{"use strict";r.d(e,{m:()=>a});var s=r(5199),i=r(4582),n=r(8851);class a{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new s.u,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new i.L,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let t=0;t<e.length;t++){const r=e[t];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(n.W.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup)return void this.addRenderGroupChild(t.renderGroup);t._onRender&&this.addOnRender(t);const e=t.children;for(let t=0;t<e.length;t++)this.addChild(e[t])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup)return void this._removeRenderGroupChild(t.renderGroup);const e=t.children;for(let t=0;t<e.length;t++)this.removeChild(e[t])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return 7===this.root.localDisplayStatus&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let r=0;r<e.length;r++)this._getChildren(e[r],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const r=t.children;for(let t=0;t<r.length;t++)this._getChildren(r[t],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return 1&this._matrixDirty?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new s.u),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return 2&this._matrixDirty?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new s.u),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(4&this._matrixDirty))return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new s.u),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}},1566:(t,e,r)=>{"use strict";r.d(e,{N:()=>a});var s=r(5423),i=r(9437),n=r(1753);const a=new class{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){const r=s.e.get().createCanvas();r.width=t,r.height=e;const i=r.getContext("2d");return{canvas:r,context:i}}getOptimalCanvasAndContext(t,e,r=1){t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6);const s=((t=(0,i.U5)(t))<<17)+((e=(0,i.U5)(e))<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(t,e)),n}returnCanvasAndContext(t){const e=t.canvas,{width:r,height:s}=e,i=(r<<17)+(s<<1);t.context.resetTransform(),t.context.clearRect(0,0,r,s),this._canvasPool[i].push(t)}clear(){this._canvasPool={}}};n.L.register(a)},1570:(t,e,r)=>{"use strict";r.d(e,{P:()=>h,_:()=>a});const s={};function i(t){const e=[];if(1===t)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let r=0;for(let s=0;s<t;s++)e.push(`@group(1) @binding(${r++}) var textureSource${s+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${r++}) var textureSampler${s+1}: sampler;`)}return e.join("\n")}function n(t){const e=[];if(1===t)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let r=0;r<t;r++)r===t-1?e.push(" default:{"):e.push(` case ${r}:{`),e.push(` outColor = textureSampleGrad(textureSource${r+1}, textureSampler${r+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join("\n")}function a(t){return s[t]||(s[t]={name:"texture-batch-bit",vertex:{header:"\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:`\n @in @interpolate(flat) vTextureId: u32;\n\n ${i(t)}\n `,main:`\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${n(t)}\n `}}),s[t]}const o={};function l(t){const e=[];for(let r=0;r<t;r++)r>0&&e.push("else"),r<t-1&&e.push(`if(vTextureId < ${r}.5)`),e.push("{"),e.push(`\toutColor = texture(uTextures[${r}], vUV);`),e.push("}");return e.join("\n")}function h(t){return o[t]||(o[t]={name:"texture-batch-bit",vertex:{header:"\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:`\n in float vTextureId;\n\n uniform sampler2D uTextures[${t}];\n\n `,main:`\n\n ${l(t)}\n `}}),o[t]}},1579:(t,e,r)=>{"use strict";r.d(e,{h:()=>a});var s=r(4872),i=r(9375),n=r(9798);class a extends s.A{constructor(t){let{data:e,size:r}=t;const{usage:s,label:n,shrinkToFit:a}=t;super(),this.uid=(0,i.L)("buffer"),this._resourceType="buffer",this._resourceId=(0,i.L)("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,r??(r=e?.byteLength);const o=!!e;this.descriptor={size:r,usage:s,mappedAtCreation:o,label:n},this.shrinkToFit=a??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&n.S.STATIC)}set static(t){t?this.descriptor.usage|=n.S.STATIC:this.descriptor.usage&=~n.S.STATIC}setDataWithSize(t,e,r){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t)return void(r&&this.emit("update",this));const s=this._data;this._data=t,this._dataInt32=null,s&&s.length===t.length||!this.shrinkToFit&&s&&t.byteLength<s.byteLength?r&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=(0,i.L)("resource"),this.emit("change",this))}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}},1657:(t,e,r)=>{"use strict";r.d(e,{M:()=>c});var s=r(4872),i=r(9375),n=r(5007),a=r(3655),o=r(1790),l=r(5153),h=r(4449);class c extends s.A{constructor(t){super(),this.uid=(0,i.L)("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:r,groups:s,resources:n,compatibleRenderers:o,groupMap:c}=t;this.gpuProgram=e,this.glProgram=r,void 0===o&&(o=0,e&&(o|=l.W.WEBGPU),r&&(o|=l.W.WEBGL)),this.compatibleRenderers=o;const u={};if(n||s||(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&s&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&s&&c)for(const t in c)for(const e in c[t]){const r=c[t][e];u[r]={group:t,binding:e,name:r}}else if(e&&s&&!c){const t=e.structsAndGroups.groups;c={},t.forEach(t=>{c[t.group]=c[t.group]||{},c[t.group][t.binding]=t.name,u[t.name]=t})}else if(n){s={},c={},e&&e.structsAndGroups.groups.forEach(t=>{c[t.group]=c[t.group]||{},c[t.group][t.binding]=t.name,u[t.name]=t});let t=0;for(const e in n)u[e]||(s[99]||(s[99]=new a.T,this._ownedBindGroups.push(s[99])),u[e]={group:99,binding:t,name:e},c[99]=c[99]||{},c[99][t]=e,t++);for(const t in n){const e=t;let r=n[t];r.source||r._resourceType||(r=new h.k(r));const i=u[e];i&&(s[i.group]||(s[i.group]=new a.T,this._ownedBindGroups.push(s[i.group])),s[i.group].setResource(r,i.binding))}}this.groups=s,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(s,u)}addResource(t,e,r){var s,i;(s=this._uniformBindMap)[e]||(s[e]={}),(i=this._uniformBindMap[e])[r]||(i[r]=t),this.groups[e]||(this.groups[e]=new a.T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const s in e){const i=e[s];Object.defineProperty(r,i.name,{get:()=>t[i.group].getResource(i.binding),set(e){t[i.group].setResource(e,i.binding)}})}return r}destroy(t=!1){this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:r,...s}=t;let i,a;return e&&(i=o.B.from(e)),r&&(a=n.M.from(r)),new c({gpuProgram:i,glProgram:a,...s})}}},1673:(t,e,r)=>{"use strict";r.d(e,{f:()=>Ut,i:()=>Dt});var s=r(1065);class i{constructor(t){this._renderer=t}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}i.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"customRender"};var n=r(5199),a=r(761),o=r(3412);function l(t,e){const r=t.instructionSet,s=r.instructions;for(let t=0;t<r.instructionSize;t++){const r=s[t];e[r.renderPipeId].execute(r)}}const h=new n.u;class c{constructor(t){this._renderer=t}addRenderGroup(t,e){t.isCachedAsTexture?this._addRenderableCacheAsTexture(t,e):this._addRenderableDirect(t,e)}execute(t){t.isRenderable&&(t.isCachedAsTexture?this._executeCacheAsTexture(t):this._executeDirect(t))}destroy(){this._renderer=null}_addRenderableDirect(t,e){this._renderer.renderPipes.batch.break(e),t._batchableRenderGroup&&(a.Z.return(t._batchableRenderGroup),t._batchableRenderGroup=null),e.add(t)}_addRenderableCacheAsTexture(t,e){const r=t._batchableRenderGroup??(t._batchableRenderGroup=a.Z.get(o.K));r.renderable=t.root,r.transform=t.root.relativeGroupTransform,r.texture=t.texture,r.bounds=t._textureBounds,e.add(t),this._renderer.renderPipes.blendMode.pushBlendMode(t,t.root.groupBlendMode,e),this._renderer.renderPipes.batch.addToBatch(r,e),this._renderer.renderPipes.blendMode.popBlendMode(e)}_executeCacheAsTexture(t){if(t.textureNeedsUpdate){t.textureNeedsUpdate=!1;const e=h.identity().translate(-t._textureBounds.x,-t._textureBounds.y);this._renderer.renderTarget.push(t.texture,!0,null,t.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:e,worldColor:4294967295,offset:{x:0,y:0}}),l(t,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}t._batchableRenderGroup._batcher.updateElement(t._batchableRenderGroup),t._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(t){this._renderer.globalUniforms.push({worldTransformMatrix:t.inverseParentTextureTransform,worldColor:t.worldColorAlpha}),l(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}}c.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"renderGroup"};var u=r(8851),d=r(8896),p=r(6170);function f(t,e){e||(e=0);for(let r=e;r<t.length&&t[r];r++)t[r]=null}var m=r(4687),g=r(6851);const x=new m.mc,y=m.fR|m.ig|m.u;function v(t,e=!1){!function(t){const e=t.root;let r;if(t.renderGroupParent){const s=t.renderGroupParent;t.worldTransform.appendFrom(e.relativeGroupTransform,s.worldTransform),t.worldColor=(0,g.j)(e.groupColor,s.worldColor),r=e.groupAlpha*s.worldAlpha}else t.worldTransform.copyFrom(e.localTransform),t.worldColor=e.localColor,r=e.localAlpha;r=r<0?0:r>1?1:r,t.worldAlpha=r,t.worldColorAlpha=t.worldColor+(255*r<<24)}(t);const r=t.childrenToUpdate,s=t.updateTick++;for(const e in r){const i=Number(e),n=r[e],a=n.list,o=n.index;for(let e=0;e<o;e++){const r=a[e];r.parentRenderGroup===t&&r.relativeRenderGroupDepth===i&&_(r,s,0)}f(a,o),n.index=0}if(e)for(let r=0;r<t.renderGroupChildren.length;r++)v(t.renderGroupChildren[r],e)}function _(t,e,r){if(e===t.updateTick)return;t.updateTick=e,t.didChange=!1;const s=t.localTransform;t.updateLocalTransform();const i=t.parent;if(i&&!i.renderGroup?(r|=t._updateFlags,t.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),r&y&&b(t,i,r)):(r=t._updateFlags,t.relativeGroupTransform.copyFrom(s),r&y&&b(t,x,r)),!t.renderGroup){const s=t.children,i=s.length;for(let t=0;t<i;t++)_(s[t],e,r);const n=t.parentRenderGroup,a=t;a.renderPipeId&&!n.structureDidChange&&n.updateRenderable(a)}}function b(t,e,r){if(r&m.ig){t.groupColor=(0,g.j)(t.localColor,e.groupColor);let r=t.localAlpha*e.groupAlpha;r=r<0?0:r>1?1:r,t.groupAlpha=r,t.groupColorAlpha=t.groupColor+(255*r<<24)}r&m.u&&(t.groupBlendMode="inherit"===t.localBlendMode?e.groupBlendMode:t.localBlendMode),r&m.fR&&(t.globalDisplayStatus=t.localDisplayStatus&e.globalDisplayStatus),t._updateFlags=0}const w=new n.u;class T{constructor(t){this._renderer=t}render({container:t,transform:e}){const r=t.parent,s=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const i=this._renderer,n=w;e&&(n.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const a=i.renderPipes;this._updateCachedRenderGroups(t.renderGroup,null),this._updateRenderGroups(t.renderGroup),i.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),l(t.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(n),t.parent=r,t.renderGroup.renderGroupParent=s}destroy(){this._renderer=null}_updateCachedRenderGroups(t,e){if(t._parentCacheAsTextureRenderGroup=e,t.isCachedAsTexture){if(!t.textureNeedsUpdate)return;e=t}for(let r=t.renderGroupChildren.length-1;r>=0;r--)this._updateCachedRenderGroups(t.renderGroupChildren[r],e);if(t.invalidateMatrices(),t.isCachedAsTexture){if(t.textureNeedsUpdate){const e=t.root.getLocalBounds();e.ceil();const r=t.texture;t.texture&&u.W.returnTexture(t.texture,!0);const s=this._renderer,i=t.textureOptions.resolution||s.view.resolution,n=t.textureOptions.antialias??s.view.antialias,a=t.textureOptions.scaleMode??"linear",o=u.W.getOptimalTexture(e.width,e.height,i,n);o._source.style=new d.n({scaleMode:a}),t.texture=o,t._textureBounds||(t._textureBounds=new p.c),t._textureBounds.copyFrom(e),r!==t.texture&&t.renderGroupParent&&(t.renderGroupParent.structureDidChange=!0)}}else t.texture&&(u.W.returnTexture(t.texture,!0),t.texture=null)}_updateRenderGroups(t){const e=this._renderer,r=e.renderPipes;if(t.runOnRender(e),t.instructionSet.renderPipes=r,t.structureDidChange?f(t.childrenRenderablesToUpdate.list,0):function(t,e){const{list:r,index:s}=t.childrenRenderablesToUpdate;let i=!1;for(let t=0;t<s;t++){const s=r[t];if(i=e[s.renderPipeId].validateRenderable(s),i)break}t.structureDidChange=i}(t,r),v(t),t.structureDidChange?(t.structureDidChange=!1,this._buildInstructions(t,e)):this._updateRenderables(t),t.childrenRenderablesToUpdate.index=0,e.renderPipes.batch.upload(t.instructionSet),!t.isCachedAsTexture||t.textureNeedsUpdate)for(let e=0;e<t.renderGroupChildren.length;e++)this._updateRenderGroups(t.renderGroupChildren[e])}_updateRenderables(t){const{list:e,index:r}=t.childrenRenderablesToUpdate;for(let s=0;s<r;s++){const r=e[s];r.didViewUpdate&&t.updateRenderable(r)}f(e,r)}_buildInstructions(t,e){const r=t.root,s=t.instructionSet;s.reset();const i=e.renderPipes?e:e.batch.renderer,n=i.renderPipes;n.batch.buildStart(s),n.blendMode.buildStart(),n.colorMask.buildStart(),r.sortableChildren&&r.sortChildren(),r.collectRenderablesWithEffects(s,i,null),n.batch.buildEnd(s),n.blendMode.buildEnd(s)}}T.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"renderGroup"};class S{constructor(t){this._renderer=t}addRenderable(t,e){const r=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,r),this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){const e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.bounds=t.visualBounds,e.texture=t._texture}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=new o.K;return e.renderable=t,e.transform=t.groupTransform,e.texture=t._texture,e.bounds=t.visualBounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}}S.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"sprite"},r(4872);const A="8.13.1";s.Ag.Application;class C{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,A)}destroy(){this._renderer=null}}C.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"initHook",priority:-10};var P=r(7433),E=r(4404);const M=class t{constructor(t,e){this.state=P.U.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=t,this._adaptor=e,this._adaptor.init?.(this)}static getBatcher(t){return new this._availableBatchers[t]}buildStart(t){let e=this._batchersByInstructionSet[t.uid];e||(e=this._batchersByInstructionSet[t.uid]=Object.create(null),e.default||(e.default=new E.J({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=e,this._activeBatch=this._activeBatches.default;for(const t in this._activeBatches)this._activeBatches[t].begin()}addToBatch(e,r){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(r);let s=this._activeBatches[e.batcherName];s||(s=this._activeBatches[e.batcherName]=t.getBatcher(e.batcherName),s.begin()),this._activeBatch=s}this._activeBatch.add(e)}break(t){this._activeBatch.break(t)}buildEnd(t){this._activeBatch.break(t);const e=this._activeBatches;for(const t in e){const r=e[t],s=r.geometry;s.indexBuffer.setDataWithSize(r.indexBuffer,r.indexSize,!0),s.buffers[0].setDataWithSize(r.attributeBuffer.float32View,r.attributeSize,!1)}}upload(t){const e=this._batchersByInstructionSet[t.uid];for(const t in e){const r=e[t],s=r.geometry;r.dirty&&(r.dirty=!1,s.buffers[0].update(4*r.attributeSize))}}execute(t){if("startBatch"===t.action){const e=t.batcher,r=e.geometry,s=e.shader;this._adaptor.start(this,r,s)}this._adaptor.execute(this,t)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(const t in this._activeBatches)this._activeBatches[t].destroy();this._activeBatches=null}};M.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"batch"},M._availableBatchers=Object.create(null);let k=M;s.XO.handleByMap(s.Ag.Batcher,k._availableBatchers),s.XO.add(E.J);var R=r(4403),B=r(5007),I=r(1790),F=r(4449),O=r(1734),G=r(1657);const D=class t extends G.M{constructor(e){super(e={...t.defaultOptions,...e}),this.enabled=!0,this._state=P.U.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,"boolean"==typeof e.antialias?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(t,e,r,s){t.applyFilter(this,e,r,s)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(e){const{gpu:r,gl:s,...i}=e;let n,a;return r&&(n=I.B.from(r)),s&&(a=B.M.from(s)),new t({gpuProgram:n,glProgram:a,...i})}};D.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let U=D;var L="struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct MaskUniforms {\n uFilterMatrix:mat3x3<f32>,\n uMaskClamp:vec4<f32>,\n uAlpha:f32,\n uInverse:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;\n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : vec2<f32>,\n};\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);\n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>,\n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n getFilterCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var maskClamp = filterUniforms.uMaskClamp;\n var uAlpha = filterUniforms.uAlpha;\n\n var clip = step(3.5,\n step(maskClamp.x, filterUv.x) +\n step(maskClamp.y, filterUv.y) +\n step(filterUv.x, maskClamp.z) +\n step(filterUv.y, maskClamp.w));\n\n var mask = textureSample(uMaskTexture, uSampler, filterUv);\n var source = textureSample(uTexture, uSampler, uv);\n var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);\n\n var a: f32 = alphaMul * mask.r * uAlpha * clip;\n\n if (filterUniforms.uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n return source * a;\n}\n";class N extends U{constructor(t){const{sprite:e,...r}=t,s=new O.N(e.texture),i=new F.k({uFilterMatrix:{value:new n.u,type:"mat3x3<f32>"},uMaskClamp:{value:s.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:t.inverse?1:0,type:"f32"}});super({...r,gpuProgram:I.B.from({vertex:{source:L,entryPoint:"mainVertex"},fragment:{source:L,entryPoint:"mainFragment"}}),glProgram:B.M.from({vertex:"in vec2 aPosition;\n\nout vec2 vTextureCoord;\nout vec2 vMaskCoord;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition( vec2 aPosition )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( vec2 aPosition )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( vec2 aPosition )\n{\n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n} \n\nvoid main(void)\n{\n gl_Position = filterVertexPosition(aPosition);\n vTextureCoord = filterTextureCoord(aPosition);\n vMaskCoord = getFilterCoord(aPosition);\n}\n",fragment:"in vec2 vMaskCoord;\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMaskTexture;\n\nuniform float uAlpha;\nuniform vec4 uMaskClamp;\nuniform float uInverse;\n\nout vec4 finalColor;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(uMaskClamp.x, vMaskCoord.x) +\n step(uMaskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, uMaskClamp.z) +\n step(vMaskCoord.y, uMaskClamp.w));\n\n // TODO look into why this is needed\n float npmAlpha = uAlpha;\n vec4 original = texture(uTexture, vTextureCoord);\n vec4 masky = texture(uMaskTexture, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n float a = alphaMul * masky.r * npmAlpha * clip;\n\n if (uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n finalColor = original * a;\n}\n",name:"mask-filter"}),clipToViewport:!1,resources:{filterUniforms:i,uMaskTexture:e.texture.source}}),this.sprite=e,this._textureMatrix=s}set inverse(t){this.resources.filterUniforms.uniforms.uInverse=t?1:0}get inverse(){return 1===this.resources.filterUniforms.uniforms.uInverse}apply(t,e,r,s){this._textureMatrix.texture=this.sprite.texture,t.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,t.applyFilter(this,e,r,s)}}var X=r(9565),V=r(4242),Y=r(9739),z=r(5153);const W=new p.c;class H extends R.a{constructor(){super(),this.filters=[new N({sprite:new V.k(Y.g.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(t){this.filters[0].sprite=t}get inverse(){return this.filters[0].inverse}set inverse(t){this.filters[0].inverse=t}}class j{constructor(t){this._activeMaskStage=[],this._renderer=t}push(t,e,r){const s=this._renderer;if(s.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1,maskedContainer:e}),t.inverse=e._maskOptions.inverse,t.renderMaskToTexture){const e=t.mask;e.includeInBuild=!0,e.collectRenderables(r,s,null),e.includeInBuild=!1}s.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:t,maskedContainer:e,inverse:e._maskOptions.inverse,canBundle:!1})}pop(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}execute(t){const e=this._renderer,r=t.mask.renderMaskToTexture;if("pushMaskBegin"===t.action){const s=a.Z.get(H);if(s.inverse=t.inverse,r){t.mask.mask.measurable=!0;const r=(0,X.f)(t.mask.mask,!0,W);t.mask.mask.measurable=!1,r.ceil();const i=e.renderTarget.renderTarget.colorTexture.source,n=u.W.getOptimalTexture(r.width,r.height,i._resolution,i.antialias);e.renderTarget.push(n,!0),e.globalUniforms.push({offset:r,worldColor:4294967295});const a=s.sprite;a.texture=n,a.worldTransform.tx=r.minX,a.worldTransform.ty=r.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:t.maskedContainer,filterTexture:n})}else s.sprite=t.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:t.maskedContainer})}else if("pushMaskEnd"===t.action){const t=this._activeMaskStage[this._activeMaskStage.length-1];r&&(e.type===z.W.WEBGL&&e.renderTarget.finishRenderPass(),e.renderTarget.pop(),e.globalUniforms.pop()),e.filter.push({renderPipeId:"filter",action:"pushFilter",container:t.maskedContainer,filterEffect:t.filterEffect,canBundle:!1})}else if("popMaskEnd"===t.action){e.filter.pop();const t=this._activeMaskStage.pop();r&&u.W.returnTexture(t.filterTexture),a.Z.return(t.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}j.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"alphaMask"};class q{constructor(t){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(t,e,r){this._renderer.renderPipes.batch.break(r);const s=this._colorStack;s[this._colorStackIndex]=s[this._colorStackIndex-1]&t.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(t,e,r){this._renderer.renderPipes.batch.break(r);const s=this._colorStack;this._colorStackIndex--;const i=s[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(t){this._renderer.colorMask.setMask(t.colorMask)}destroy(){this._renderer=null,this._colorStack=null}}q.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"colorMask"};var $=r(1711),K=r(8271);class Q{constructor(t){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=t}push(t,e,r){var s;const i=t,n=this._renderer;n.renderPipes.batch.break(r),n.renderPipes.blendMode.setBlendMode(i.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});const a=i.mask;a.includeInBuild=!0,this._maskHash.has(i)||this._maskHash.set(i,{instructionsStart:0,instructionsLength:0});const o=this._maskHash.get(i);o.instructionsStart=r.instructionSize,a.collectRenderables(r,n,null),a.includeInBuild=!1,n.renderPipes.batch.break(r),r.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});const l=r.instructionSize-o.instructionsStart-1;o.instructionsLength=l;const h=n.renderTarget.renderTarget.uid;(s=this._maskStackHash)[h]??(s[h]=0)}pop(t,e,r){const s=t,i=this._renderer;i.renderPipes.batch.break(r),i.renderPipes.blendMode.setBlendMode(s.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:e._maskOptions.inverse,canBundle:!1});const n=this._maskHash.get(t);for(let t=0;t<n.instructionsLength;t++)r.instructions[r.instructionSize++]=r.instructions[n.instructionsStart++];r.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(t){var e;const r=this._renderer,s=r.renderTarget.renderTarget.uid;let i=(e=this._maskStackHash)[s]??(e[s]=0);"pushMaskBegin"===t.action?(r.renderTarget.ensureDepthStencil(),r.stencil.setStencilMode(K.K.RENDERING_MASK_ADD,i),i++,r.colorMask.setMask(0)):"pushMaskEnd"===t.action?(t.inverse?r.stencil.setStencilMode(K.K.INVERSE_MASK_ACTIVE,i):r.stencil.setStencilMode(K.K.MASK_ACTIVE,i),r.colorMask.setMask(15)):"popMaskBegin"===t.action?(r.colorMask.setMask(0),0!==i?r.stencil.setStencilMode(K.K.RENDERING_MASK_REMOVE,i):(r.renderTarget.clear(null,$.u.STENCIL),r.stencil.setStencilMode(K.K.DISABLED,i)),i--):"popMaskEnd"===t.action&&(t.inverse?r.stencil.setStencilMode(K.K.INVERSE_MASK_ACTIVE,i):r.stencil.setStencilMode(K.K.MASK_ACTIVE,i),r.colorMask.setMask(15)),this._maskStackHash[s]=i}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}Q.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"stencilMask"};var Z=r(6675),J=r(7694);const tt=class t{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Z.Q(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...t.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){Z.Q.shared.setValue(t).alpha<1&&1===this._backgroundColor.alpha&&(0,J.R)("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};tt.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"background",priority:0},tt.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let et=tt;var rt=r(1422);const st={};s.XO.handle(s.Ag.BlendMode,t=>{if(!t.name)throw new Error("BlendMode extension must have a name property");st[t.name]=t.ref},t=>{delete st[t.name]});class it{constructor(t){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(t,e,r){this._blendModeStack.push(e),this.setBlendMode(t,e,r)}popBlendMode(t){this._blendModeStack.pop();const e=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,e,t)}setBlendMode(t,e,r){const s=t instanceof rt.m;this._activeBlendMode!==e?(this._isAdvanced&&this._endAdvancedBlendMode(r),this._activeBlendMode=e,t&&(this._isAdvanced=!!st[e],this._isAdvanced&&this._beginAdvancedBlendMode(t,r))):this._isAdvanced&&t&&!s&&this._renderableList?.push(t)}_beginAdvancedBlendMode(t,e){this._renderer.renderPipes.batch.break(e);const r=this._activeBlendMode;if(!st[r])return void(0,J.R)(`Unable to assign BlendMode: '${r}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);const s=this._ensureFilterEffect(r),i=t instanceof rt.m,n={renderPipeId:"filter",action:"pushFilter",filterEffect:s,renderables:i?null:[t],container:i?t.root:null,canBundle:!1};this._renderableList=n.renderables,e.add(n)}_ensureFilterEffect(t){let e=this._filterHash[t];return e||(e=this._filterHash[t]=new R.a,e.filters=[new st[t]]),e}_endAdvancedBlendMode(t){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}it.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"blendMode"};var nt=r(5423);const at={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},ot=class t{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof m.mc||t instanceof Y.g?{target:t,...e}:{...e,...t}}async image(t){const e=nt.e.get().createImage();return e.src=await this.base64(t),e}async base64(e){e=this._normalizeOptions(e,t.defaultImageOptions);const{format:r,quality:s}=e,i=this.canvas(e);if(void 0!==i.toBlob)return new Promise((t,e)=>{i.toBlob(r=>{if(!r)return void e(new Error("ICanvas.toBlob failed!"));const s=new FileReader;s.onload=()=>t(s.result),s.onerror=e,s.readAsDataURL(r)},at[r],s)});if(void 0!==i.toDataURL)return i.toDataURL(at[r],s);if(void 0!==i.convertToBlob){const t=await i.convertToBlob({type:at[r],quality:s});return new Promise((e,r)=>{const s=new FileReader;s.onload=()=>e(s.result),s.onerror=r,s.readAsDataURL(t)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){const e=(t=this._normalizeOptions(t)).target,r=this._renderer;if(e instanceof Y.g)return r.texture.generateCanvas(e);const s=r.textureGenerator.generateTexture(t),i=r.texture.generateCanvas(s);return s.destroy(!0),i}pixels(t){const e=(t=this._normalizeOptions(t)).target,r=this._renderer,s=e instanceof Y.g?e:r.textureGenerator.generateTexture(t),i=r.texture.getPixels(s);return e instanceof m.mc&&s.destroy(!0),i}texture(t){return(t=this._normalizeOptions(t)).target instanceof Y.g?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){t=this._normalizeOptions(t);const e=this.canvas(t),r=document.createElement("a");r.download=t.filename??"image.png",r.href=e.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(t){const e=t.width??200;t=this._normalizeOptions(t);const r=this.canvas(t),s=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const i=["font-size: 1px;",`padding: ${e}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",i)}destroy(){this._renderer=null}};ot.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"extract"},ot.defaultImageOptions={format:"png",quality:1};let lt=ot;var ht=r(9390),ct=r(2071),ut=r(4269);class dt extends Y.g{static create(t){return new dt({source:new ut.v(t)})}resize(t,e,r){return this.source.resize(t,e,r),this}}const pt=new ht.M,ft=new p.c,mt=[0,0,0,0];class gt{constructor(t){this._renderer=t}generateTexture(t){t instanceof m.mc&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const e=t.resolution||this._renderer.resolution,r=t.antialias||this._renderer.view.antialias,s=t.target;let i=t.clearColor;i=i?Array.isArray(i)&&4===i.length?i:Z.Q.shared.setValue(i).toArray():mt;const a=t.frame?.copyTo(pt)||(0,ct.n)(s,ft).rectangle;a.width=0|Math.max(a.width,1/e),a.height=0|Math.max(a.height,1/e);const o=dt.create({...t.textureSourceOptions,width:a.width,height:a.height,resolution:e,antialias:r}),l=n.u.shared.translate(-a.x,-a.y);return this._renderer.render({container:s,transform:l,target:o,clearColor:i}),o.source.updateMipmaps(),o}destroy(){this._renderer=null}}gt.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"textureGenerator"};var xt=r(59),yt=r(9482),vt=r(3655);class _t{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:r,worldColor:s,offset:i}){const a=this._renderer.renderTarget.renderTarget,o=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:a,worldTransformMatrix:new n.u,worldColor:4294967295,offset:new xt.b},l={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||a.size,worldTransformMatrix:r||o.worldTransformMatrix,worldColor:s||o.worldColor,offset:i||o.offset,bindGroup:null},h=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(h);const c=h.uniforms;let u;c.uProjectionMatrix=l.projectionMatrix,c.uResolution=l.resolution,c.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix),c.uWorldTransformMatrix.tx-=l.offset.x,c.uWorldTransformMatrix.ty-=l.offset.y,(0,yt.V)(l.worldColor,c.uWorldColorAlpha,0),h.update(),this._renderer.renderPipes.uniformBatch?u=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(h,!1):(u=this._bindGroupPool.pop()||new vt.T,this._activeBindGroups.push(u),u.setResource(h,0)),l.bindGroup=u,this._currentGlobalUniformData=l}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===z.W.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new F.k({uProjectionMatrix:{value:new n.u,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new n.u,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}}_t.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"globalUniforms"};var bt=r(3651);let wt=1;class Tt{constructor(){this._tasks=[],this._offset=0}init(){bt.R.system.add(this._update,this)}repeat(t,e,r=!0){const s=wt++;let i=0;return r&&(this._offset+=1e3,i=this._offset),this._tasks.push({func:t,duration:e,start:performance.now(),offset:i,last:performance.now(),repeat:!0,id:s}),s}cancel(t){for(let e=0;e<this._tasks.length;e++)if(this._tasks[e].id===t)return void this._tasks.splice(e,1)}_update(){const t=performance.now();for(let e=0;e<this._tasks.length;e++){const r=this._tasks[e];if(t-r.offset-r.last>=r.duration){const e=t-r.start;r.func(e),r.last=t}}}destroy(){bt.R.system.remove(this._update,this),this._tasks.length=0}}Tt.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"scheduler",priority:0};let St=!1;class At{constructor(t){this._renderer=t}init(t){if(t.hello){let t=this._renderer.name;this._renderer.type===z.W.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),function(t){if(!St){if(nt.e.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${A} (${t}) http://www.pixijs.com/\n\n`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${A} - ${t} - http://www.pixijs.com/`);St=!0}}(t)}}}function Ct(t){let e=!1;for(const r in t)if(null==t[r]){e=!0;break}if(!e)return t;const r=Object.create(null);for(const e in t){const s=t[e];s&&(r[e]=s)}return r}function Pt(t){let e=0;for(let r=0;r<t.length;r++)null==t[r]?e++:t[r-e]=t[r];return t.length-=e,t}At.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"hello",priority:-2},At.defaultOptions={hello:!1};let Et=0;const Mt=class t{constructor(t){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=t}init(e){e={...t.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive}get enabled(){return!!this._handler}set enabled(t){this.enabled!==t&&(t?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedHashes)t.context[t.hash]=Ct(t.context[t.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedArrays)Pt(t.context[t.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(t,e){this._managedHashes.push({context:t,hash:e})}addManagedArray(t,e){this._managedArrays.push({context:t,hash:e})}prerender({container:t}){this._now=performance.now(),t.renderGroup.gcTick=Et++,this._updateInstructionGCTick(t.renderGroup,t.renderGroup.gcTick)}addRenderable(t){this.enabled&&(-1===t._lastUsed&&(this._managedRenderables.push(t),t.once("destroyed",this._removeRenderable,this)),t._lastUsed=this._now)}run(){const t=this._now,e=this._managedRenderables,r=this._renderer.renderPipes;let s=0;for(let i=0;i<e.length;i++){const n=e[i];if(null===n){s++;continue}const a=n.renderGroup??n.parentRenderGroup,o=a?.instructionSet?.gcTick??-1;if((a?.gcTick??0)===o&&(n._lastUsed=t),t-n._lastUsed>this.maxUnusedTime){if(!n.destroyed){const t=r;a&&(a.structureDidChange=!0),t[n.renderPipeId].destroyRenderable(n)}n._lastUsed=-1,s++,n.off("destroyed",this._removeRenderable,this)}else e[i-s]=n}e.length-=s}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(t){const e=this._managedRenderables.indexOf(t);e>=0&&(t.off("destroyed",this._removeRenderable,this),this._managedRenderables[e]=null)}_updateInstructionGCTick(t,e){t.instructionSet.gcTick=e;for(const r of t.renderGroupChildren)this._updateInstructionGCTick(r,e)}};Mt.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"renderableGC",priority:0},Mt.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let kt=Mt;const Rt=class t{constructor(t){this._renderer=t,this.count=0,this.checkCount=0}init(e){e={...t.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this._renderer.texture.managedTextures;for(let e=0;e<t.length;e++){const r=t[e];r.autoGarbageCollect&&r.resource&&r._touched>-1&&this.count-r._touched>this.maxIdle&&(r._touched=-1,r.unload())}}destroy(){this._renderer=null}};Rt.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"textureGC"},Rt.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};let Bt=Rt;var It=r(4696),Ft=r(2277),Ot=r(8955);const Gt=class t{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(t){this.texture.source.autoDensity=t}get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(e){(e={...t.defaultOptions,...e}).view&&((0,It.t6)(It.lj,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new ht.M(0,0,e.width,e.height),this.canvas=e.canvas||nt.e.get().createCanvas(),this.antialias=!!e.antialias,this.texture=(0,Ot.c)(this.canvas,e),this.renderTarget=new Ft.O({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution}resize(t,e,r){this.texture.source.resize(t,e,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(t=!1){("boolean"==typeof t?t:!!t?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};Gt.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"view",priority:0},Gt.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};const Dt=[et,_t,At,Gt,T,Bt,gt,lt,C,kt,Tt],Ut=[it,k,S,c,j,Q,q,i]},1711:(t,e,r)=>{"use strict";r.d(e,{u:()=>s});var s=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(s||{})},1734:(t,e,r)=>{"use strict";r.d(e,{N:()=>n});var s=r(5199);const i=new s.u;class n{constructor(t,e){this.mapCoord=new s.u,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?t.width<10?0:.5:e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let s=0;s<t.length;s+=2){const i=t[s],n=t[s+1];e[s]=i*r.a+n*r.c+r.tx,e[s+1]=i*r.b+n*r.d+r.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const r=t.orig,s=t.trim;s&&(i.set(r.width/s.width,0,0,r.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(i));const n=t.source,a=this.uClampFrame,o=this.clampMargin/n._resolution,l=this.clampOffset/n._resolution;return a[0]=(t.frame.x+o+l)/n.width,a[1]=(t.frame.y+o+l)/n.height,a[2]=(t.frame.x+t.frame.width-o+l)/n.width,a[3]=(t.frame.y+t.frame.height-o+l)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&0===t.rotate,!0}}},1753:(t,e,r)=>{"use strict";r.d(e,{L:()=>s});const s={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}}},1790:(t,e,r)=>{"use strict";r.d(e,{B:()=>h});var s=r(8642),i=r(4988);const n={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function a(t){const e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,s=/var(<[^>]+>)? (\w+)/,i=/:\s*(\w+)/,n=/(\w+)\s*:\s*([\w\<\>]+)/g,a=/struct\s+(\w+)/,o=t.match(/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g)?.map(t=>({group:parseInt(t.match(e)[1],10),binding:parseInt(t.match(r)[1],10),name:t.match(s)[2],isUniform:"<uniform>"===t.match(s)[1],type:t.match(i)[1]}));if(!o)return{groups:[],structs:[]};const l=t.match(/struct\s+(\w+)\s*{([^}]+)}/g)?.map(t=>{const e=t.match(a)[1],r=t.match(n).reduce((t,e)=>{const[r,s]=e.split(":");return t[r.trim()]=s.trim(),t},{});return r?{name:e,members:r}:null}).filter(({name:t})=>o.some(e=>e.type===t))??[];return{groups:o,structs:l}}var o=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(o||{});const l=Object.create(null);class h{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:r,layout:s,gpuLayout:i,name:n}=t;if(this.name=n,this.fragment=e,this.vertex=r,e.source===r.source){const t=a(e.source);this.structsAndGroups=t}else{const t=a(r.source),s=a(e.source);this.structsAndGroups=function(t,e){const r=new Set,s=new Set;return{structs:[...t.structs,...e.structs].filter(t=>!r.has(t.name)&&(r.add(t.name),!0)),groups:[...t.groups,...e.groups].filter(t=>{const e=`${t.name}-${t.binding}`;return!s.has(e)&&(s.add(e),!0)})}}(t,s)}this.layout=s??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const s=t[r];e[s.group]||(e[s.group]={}),e[s.group][s.name]=s.binding}return e}(this.structsAndGroups),this.gpuLayout=i??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const s=t[r];e[s.group]||(e[s.group]=[]),s.isUniform?e[s.group].push({binding:s.binding,visibility:o.VERTEX|o.FRAGMENT,buffer:{type:"uniform"}}):"sampler"===s.type?e[s.group].push({binding:s.binding,visibility:o.FRAGMENT,sampler:{type:"filtering"}}):"texture_2d"===s.type&&e[s.group].push({binding:s.binding,visibility:o.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return e}(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===this.layout[0]?.globalUniforms),this.autoAssignLocalUniforms=!(void 0===this.layout[1]?.localUniforms),this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=(0,s.X)(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=function({source:t,entryPoint:e}){const r={},s=t.indexOf(`fn ${e}`);if(-1!==s){const e=t.indexOf("->",s);if(-1!==e){const a=t.substring(s,e),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let l;for(;null!==(l=o.exec(a));){const t=n[l[3]]??"float32";r[l[2]]={location:parseInt(l[1],10),format:t,stride:(0,i.m)(t).stride,offset:0,instance:!1,start:0}}}}return r}(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,l[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return l[e]||(l[e]=new h(t),l[e]._cacheKey=e),l[e]}}},1886:(t,e,r)=>{"use strict";r.d(e,{K:()=>a});var s=r(7761),i=r(6793);class n extends i.a{async doLoad(t){const e=(async()=>{const e=await fetch(t);if(!e.ok)return void console.error(`Failed to load audio data: ${t}`);const r=await e.arrayBuffer();try{const e=await s.es.decodeAudioData(r);if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,e),e;console.error(`Audio buffer already exists: ${t}`)}}catch(e){console.error(`Failed to decode audio data: ${t}`,e),this.loadingPromises.delete(t)}})();return this.loadingPromises.set(t,e),await e}}const a=new n},1984:(t,e,r)=>{"use strict";r.d(e,{$4:()=>X,$l:()=>b,Di:()=>C,EP:()=>A,Ev:()=>E,GU:()=>g,I6:()=>U,Kf:()=>c,Kn:()=>I,Ms:()=>Y,NQ:()=>f,So:()=>v,Sr:()=>m,To:()=>O,UJ:()=>z,X5:()=>l,_Y:()=>P,eP:()=>T,fT:()=>M,g:()=>W,hd:()=>S,i9:()=>y,jQ:()=>R,jx:()=>w,lJ:()=>j,lP:()=>q,mj:()=>i,nS:()=>x,oc:()=>N,pA:()=>F,pR:()=>_,qU:()=>s,qs:()=>B,vl:()=>D,vz:()=>G,yJ:()=>H,yz:()=>V,zK:()=>k});var s,i,n=r(4382),a=r(1347),o=r(646);class l{name;timelines=[];timelineIds=new a.eE;duration;constructor(t,e,r){if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=r}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,r,s,i,n,a,o){if(!t)throw new Error("skeleton cannot be null.");s&&0!=this.duration&&(r%=this.duration,e>0&&(e%=this.duration));let l=this.timelines;for(let s=0,h=l.length;s<h;s++)l[s].apply(t,e,r,i,n,a,o)}}!function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(s||(s={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i||(i={}));const h={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28};class c{propertyIds;frames;constructor(t,e){this.propertyIds=e,this.frames=a.Aq.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let r=t.length;for(let s=1;s<r;s++)if(t[s]>e)return s-1;return r-1}static search(t,e,r){let s=t.length;for(let i=r;i<s;i+=r)if(t[i]>e)return i-r;return s-r}}class u extends c{curves;constructor(t,e,r){super(t,r),this.curves=a.Aq.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=a.Aq.newFloatArray(e);a.Aq.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,r,s,i,n,a,o,l,h,c){let u=this.curves,d=this.getFrameCount()+18*t;0==r&&(u[e]=2+d);let p=.03*(s-2*n+o),f=.03*(i-2*a+l),m=.006*(3*(n-o)-s+h),g=.006*(3*(a-l)-i+c),x=2*p+m,y=2*f+g,v=.3*(n-s)+p+.16666667*m,_=.3*(a-i)+f+.16666667*g,b=s+v,w=i+_;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=w,v+=x,_+=y,x+=m,y+=g,b+=v,w+=_}getBezierValue(t,e,r,s){let i=this.curves;if(i[s]>t){let n=this.frames[e],a=this.frames[e+r];return a+(t-n)/(i[s]-n)*(i[s+1]-a)}let n=s+18;for(s+=2;s<n;s+=2)if(i[s]>=t){let e=i[s-2],r=i[s-1];return r+(t-e)/(i[s]-e)*(i[s+1]-r)}e+=this.getFrameEntries();let a=i[n-2],o=i[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+r]-o)}}class d extends u{constructor(t,e,r){super(t,e,[r])}getFrameEntries(){return 2}setFrame(t,e,r){t<<=1,this.frames[t]=e,this.frames[t+1]=r}getCurveValue(t){let e=this.frames,r=e.length-2;for(let s=2;s<=r;s+=2)if(e[s]>t){r=s-2;break}let s=this.curves[r>>1];switch(s){case 0:let s=e[r],i=e[r+1];return i+(t-s)/(e[r+2]-s)*(e[r+2+1]-i);case 1:return e[r+1]}return this.getBezierValue(t,r,1,s-2)}getRelativeValue(t,e,r,i,n){if(t<this.frames[0]){switch(r){case s.setup:return n;case s.first:return i+(n-i)*e}return i}let a=this.getCurveValue(t);switch(r){case s.setup:return n+a*e;case s.first:case s.replace:a+=n-i}return i+a*e}getAbsoluteValue(t,e,r,i,n){if(t<this.frames[0]){switch(r){case s.setup:return n;case s.first:return i+(n-i)*e}return i}let a=this.getCurveValue(t);return r==s.setup?n+(a-n)*e:i+(a-i)*e}getAbsoluteValue2(t,e,r,i,n,a){if(t<this.frames[0]){switch(r){case s.setup:return n;case s.first:return i+(n-i)*e}return i}return r==s.setup?n+(a-n)*e:i+(a-i)*e}getScaleValue(t,e,r,n,o,l){if(t<this.frames[0]){switch(r){case s.setup:return l;case s.first:return o+(l-o)*e}return o}let h=this.getCurveValue(t)*l;if(1==e)return r==s.add?o+h-l:h;if(n==i.mixOut)switch(r){case s.setup:return l+(Math.abs(h)*a.cj.signum(l)-l)*e;case s.first:case s.replace:return o+(Math.abs(h)*a.cj.signum(o)-o)*e}else{let t=0;switch(r){case s.setup:return t=Math.abs(l)*a.cj.signum(h),t+(h-t)*e;case s.first:case s.replace:return t=Math.abs(o)*a.cj.signum(h),t+(h-t)*e}}return o+(h-l)*e}}class p extends u{constructor(t,e,r,s){super(t,e,[r,s])}getFrameEntries(){return 3}setFrame(t,e,r,s){t*=3,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=s}}class f extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.rotate+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(r,i,n,o.rotation,o.data.rotation))}}class m extends p{boneIndex=0;constructor(t,e,r){super(t,e,h.x+"|"+r,h.y+"|"+r),this.boneIndex=r}apply(t,e,r,i,n,a,o){let l=t.bones[this.boneIndex];if(!l.active)return;let h=this.frames;if(r<h[0]){switch(a){case s.setup:return l.x=l.data.x,void(l.y=l.data.y);case s.first:l.x+=(l.data.x-l.x)*n,l.y+=(l.data.y-l.y)*n}return}let u=0,d=0,p=c.search(h,r,3),f=this.curves[p/3];switch(f){case 0:let t=h[p];u=h[p+1],d=h[p+2];let e=(r-t)/(h[p+3]-t);u+=(h[p+3+1]-u)*e,d+=(h[p+3+2]-d)*e;break;case 1:u=h[p+1],d=h[p+2];break;default:u=this.getBezierValue(r,p,1,f-2),d=this.getBezierValue(r,p,2,f+18-2)}switch(a){case s.setup:l.x=l.data.x+u*n,l.y=l.data.y+d*n;break;case s.first:case s.replace:l.x+=(l.data.x+u-l.x)*n,l.y+=(l.data.y+d-l.y)*n;break;case s.add:l.x+=u*n,l.y+=d*n}}}class g extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.x+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(r,i,n,o.x,o.data.x))}}class x extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.y+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(r,i,n,o.y,o.data.y))}}class y extends p{boneIndex=0;constructor(t,e,r){super(t,e,h.scaleX+"|"+r,h.scaleY+"|"+r),this.boneIndex=r}apply(t,e,r,n,o,l,h){let u=t.bones[this.boneIndex];if(!u.active)return;let d,p,f=this.frames;if(r<f[0]){switch(l){case s.setup:return u.scaleX=u.data.scaleX,void(u.scaleY=u.data.scaleY);case s.first:u.scaleX+=(u.data.scaleX-u.scaleX)*o,u.scaleY+=(u.data.scaleY-u.scaleY)*o}return}let m=c.search(f,r,3),g=this.curves[m/3];switch(g){case 0:let t=f[m];d=f[m+1],p=f[m+2];let e=(r-t)/(f[m+3]-t);d+=(f[m+3+1]-d)*e,p+=(f[m+3+2]-p)*e;break;case 1:d=f[m+1],p=f[m+2];break;default:d=this.getBezierValue(r,m,1,g-2),p=this.getBezierValue(r,m,2,g+18-2)}if(d*=u.data.scaleX,p*=u.data.scaleY,1==o)l==s.add?(u.scaleX+=d-u.data.scaleX,u.scaleY+=p-u.data.scaleY):(u.scaleX=d,u.scaleY=p);else{let t=0,e=0;if(h==i.mixOut)switch(l){case s.setup:t=u.data.scaleX,e=u.data.scaleY,u.scaleX=t+(Math.abs(d)*a.cj.signum(t)-t)*o,u.scaleY=e+(Math.abs(p)*a.cj.signum(e)-e)*o;break;case s.first:case s.replace:t=u.scaleX,e=u.scaleY,u.scaleX=t+(Math.abs(d)*a.cj.signum(t)-t)*o,u.scaleY=e+(Math.abs(p)*a.cj.signum(e)-e)*o;break;case s.add:u.scaleX+=(d-u.data.scaleX)*o,u.scaleY+=(p-u.data.scaleY)*o}else switch(l){case s.setup:t=Math.abs(u.data.scaleX)*a.cj.signum(d),e=Math.abs(u.data.scaleY)*a.cj.signum(p),u.scaleX=t+(d-t)*o,u.scaleY=e+(p-e)*o;break;case s.first:case s.replace:t=Math.abs(u.scaleX)*a.cj.signum(d),e=Math.abs(u.scaleY)*a.cj.signum(p),u.scaleX=t+(d-t)*o,u.scaleY=e+(p-e)*o;break;case s.add:u.scaleX+=(d-u.data.scaleX)*o,u.scaleY+=(p-u.data.scaleY)*o}}}}class v extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.scaleX+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(r,i,n,a,o.scaleX,o.data.scaleX))}}class _ extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.scaleY+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(r,i,n,a,o.scaleY,o.data.scaleY))}}class b extends p{boneIndex=0;constructor(t,e,r){super(t,e,h.shearX+"|"+r,h.shearY+"|"+r),this.boneIndex=r}apply(t,e,r,i,n,a,o){let l=t.bones[this.boneIndex];if(!l.active)return;let h=this.frames;if(r<h[0]){switch(a){case s.setup:return l.shearX=l.data.shearX,void(l.shearY=l.data.shearY);case s.first:l.shearX+=(l.data.shearX-l.shearX)*n,l.shearY+=(l.data.shearY-l.shearY)*n}return}let u=0,d=0,p=c.search(h,r,3),f=this.curves[p/3];switch(f){case 0:let t=h[p];u=h[p+1],d=h[p+2];let e=(r-t)/(h[p+3]-t);u+=(h[p+3+1]-u)*e,d+=(h[p+3+2]-d)*e;break;case 1:u=h[p+1],d=h[p+2];break;default:u=this.getBezierValue(r,p,1,f-2),d=this.getBezierValue(r,p,2,f+18-2)}switch(a){case s.setup:l.shearX=l.data.shearX+u*n,l.shearY=l.data.shearY+d*n;break;case s.first:case s.replace:l.shearX+=(l.data.shearX+u-l.shearX)*n,l.shearY+=(l.data.shearY+d-l.shearY)*n;break;case s.add:l.shearX+=u*n,l.shearY+=d*n}}}class w extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.shearX+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(r,i,n,o.shearX,o.data.shearX))}}class T extends d{boneIndex=0;constructor(t,e,r){super(t,e,h.shearY+"|"+r),this.boneIndex=r}apply(t,e,r,s,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(r,i,n,o.shearY,o.data.shearY))}}class S extends c{boneIndex=0;constructor(t,e){super(t,[h.inherit+"|"+e]),this.boneIndex=e}getFrameEntries(){return 2}setFrame(t,e,r){t*=2,this.frames[t]=e,this.frames[t+1]=r}apply(t,e,r,n,a,o,l){let h=t.bones[this.boneIndex];if(!h.active)return;if(l==i.mixOut)return void(o==s.setup&&(h.inherit=h.data.inherit));let u=this.frames;r<u[0]?o!=s.setup&&o!=s.first||(h.inherit=h.data.inherit):h.inherit=this.frames[c.search(u,r,2)+1]}}class A extends u{slotIndex=0;constructor(t,e,r){super(t,e,[h.rgb+"|"+r,h.alpha+"|"+r]),this.slotIndex=r}getFrameEntries(){return 5}setFrame(t,e,r,s,i,n){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=s,this.frames[t+3]=i,this.frames[t+4]=n}apply(t,e,r,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color;if(r<h[0]){let t=l.data.color;switch(a){case s.setup:return void u.setFromColor(t);case s.first:u.add((t.r-u.r)*n,(t.g-u.g)*n,(t.b-u.b)*n,(t.a-u.a)*n)}return}let d=0,p=0,f=0,m=0,g=c.search(h,r,5),x=this.curves[g/5];switch(x){case 0:let t=h[g];d=h[g+1],p=h[g+2],f=h[g+3],m=h[g+4];let e=(r-t)/(h[g+5]-t);d+=(h[g+5+1]-d)*e,p+=(h[g+5+2]-p)*e,f+=(h[g+5+3]-f)*e,m+=(h[g+5+4]-m)*e;break;case 1:d=h[g+1],p=h[g+2],f=h[g+3],m=h[g+4];break;default:d=this.getBezierValue(r,g,1,x-2),p=this.getBezierValue(r,g,2,x+18-2),f=this.getBezierValue(r,g,3,x+36-2),m=this.getBezierValue(r,g,4,x+54-2)}1==n?u.set(d,p,f,m):(a==s.setup&&u.setFromColor(l.data.color),u.add((d-u.r)*n,(p-u.g)*n,(f-u.b)*n,(m-u.a)*n))}}class C extends u{slotIndex=0;constructor(t,e,r){super(t,e,[h.rgb+"|"+r]),this.slotIndex=r}getFrameEntries(){return 4}setFrame(t,e,r,s,i){t<<=2,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=s,this.frames[t+3]=i}apply(t,e,r,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color;if(r<h[0]){let t=l.data.color;switch(a){case s.setup:return u.r=t.r,u.g=t.g,void(u.b=t.b);case s.first:u.r+=(t.r-u.r)*n,u.g+=(t.g-u.g)*n,u.b+=(t.b-u.b)*n}return}let d=0,p=0,f=0,m=c.search(h,r,4),g=this.curves[m>>2];switch(g){case 0:let t=h[m];d=h[m+1],p=h[m+2],f=h[m+3];let e=(r-t)/(h[m+4]-t);d+=(h[m+4+1]-d)*e,p+=(h[m+4+2]-p)*e,f+=(h[m+4+3]-f)*e;break;case 1:d=h[m+1],p=h[m+2],f=h[m+3];break;default:d=this.getBezierValue(r,m,1,g-2),p=this.getBezierValue(r,m,2,g+18-2),f=this.getBezierValue(r,m,3,g+36-2)}if(1==n)u.r=d,u.g=p,u.b=f;else{if(a==s.setup){let t=l.data.color;u.r=t.r,u.g=t.g,u.b=t.b}u.r+=(d-u.r)*n,u.g+=(p-u.g)*n,u.b+=(f-u.b)*n}}}class P extends d{slotIndex=0;constructor(t,e,r){super(t,e,h.alpha+"|"+r),this.slotIndex=r}apply(t,e,r,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(r<this.frames[0]){let t=l.data.color;switch(a){case s.setup:return void(h.a=t.a);case s.first:h.a+=(t.a-h.a)*n}return}let c=this.getCurveValue(r);1==n?h.a=c:(a==s.setup&&(h.a=l.data.color.a),h.a+=(c-h.a)*n)}}class E extends u{slotIndex=0;constructor(t,e,r){super(t,e,[h.rgb+"|"+r,h.alpha+"|"+r,h.rgb2+"|"+r]),this.slotIndex=r}getFrameEntries(){return 8}setFrame(t,e,r,s,i,n,a,o,l){t<<=3,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=s,this.frames[t+3]=i,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o,this.frames[t+7]=l}apply(t,e,r,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(r<h[0]){let t=l.data.color,e=l.data.darkColor;switch(a){case s.setup:return u.setFromColor(t),d.r=e.r,d.g=e.g,void(d.b=e.b);case s.first:u.add((t.r-u.r)*n,(t.g-u.g)*n,(t.b-u.b)*n,(t.a-u.a)*n),d.r+=(e.r-d.r)*n,d.g+=(e.g-d.g)*n,d.b+=(e.b-d.b)*n}return}let p=0,f=0,m=0,g=0,x=0,y=0,v=0,_=c.search(h,r,8),b=this.curves[_>>3];switch(b){case 0:let t=h[_];p=h[_+1],f=h[_+2],m=h[_+3],g=h[_+4],x=h[_+5],y=h[_+6],v=h[_+7];let e=(r-t)/(h[_+8]-t);p+=(h[_+8+1]-p)*e,f+=(h[_+8+2]-f)*e,m+=(h[_+8+3]-m)*e,g+=(h[_+8+4]-g)*e,x+=(h[_+8+5]-x)*e,y+=(h[_+8+6]-y)*e,v+=(h[_+8+7]-v)*e;break;case 1:p=h[_+1],f=h[_+2],m=h[_+3],g=h[_+4],x=h[_+5],y=h[_+6],v=h[_+7];break;default:p=this.getBezierValue(r,_,1,b-2),f=this.getBezierValue(r,_,2,b+18-2),m=this.getBezierValue(r,_,3,b+36-2),g=this.getBezierValue(r,_,4,b+54-2),x=this.getBezierValue(r,_,5,b+72-2),y=this.getBezierValue(r,_,6,b+90-2),v=this.getBezierValue(r,_,7,b+108-2)}if(1==n)u.set(p,f,m,g),d.r=x,d.g=y,d.b=v;else{if(a==s.setup){u.setFromColor(l.data.color);let t=l.data.darkColor;d.r=t.r,d.g=t.g,d.b=t.b}u.add((p-u.r)*n,(f-u.g)*n,(m-u.b)*n,(g-u.a)*n),d.r+=(x-d.r)*n,d.g+=(y-d.g)*n,d.b+=(v-d.b)*n}}}class M extends u{slotIndex=0;constructor(t,e,r){super(t,e,[h.rgb+"|"+r,h.rgb2+"|"+r]),this.slotIndex=r}getFrameEntries(){return 7}setFrame(t,e,r,s,i,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=s,this.frames[t+3]=i,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,r,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(r<h[0]){let t=l.data.color,e=l.data.darkColor;switch(a){case s.setup:return u.r=t.r,u.g=t.g,u.b=t.b,d.r=e.r,d.g=e.g,void(d.b=e.b);case s.first:u.r+=(t.r-u.r)*n,u.g+=(t.g-u.g)*n,u.b+=(t.b-u.b)*n,d.r+=(e.r-d.r)*n,d.g+=(e.g-d.g)*n,d.b+=(e.b-d.b)*n}return}let p=0,f=0,m=0,g=0,x=0,y=0,v=c.search(h,r,7),_=this.curves[v/7];switch(_){case 0:let t=h[v];p=h[v+1],f=h[v+2],m=h[v+3],g=h[v+4],x=h[v+5],y=h[v+6];let e=(r-t)/(h[v+7]-t);p+=(h[v+7+1]-p)*e,f+=(h[v+7+2]-f)*e,m+=(h[v+7+3]-m)*e,g+=(h[v+7+4]-g)*e,x+=(h[v+7+5]-x)*e,y+=(h[v+7+6]-y)*e;break;case 1:p=h[v+1],f=h[v+2],m=h[v+3],g=h[v+4],x=h[v+5],y=h[v+6];break;default:p=this.getBezierValue(r,v,1,_-2),f=this.getBezierValue(r,v,2,_+18-2),m=this.getBezierValue(r,v,3,_+36-2),g=this.getBezierValue(r,v,4,_+54-2),x=this.getBezierValue(r,v,5,_+72-2),y=this.getBezierValue(r,v,6,_+90-2)}if(1==n)u.r=p,u.g=f,u.b=m,d.r=g,d.g=x,d.b=y;else{if(a==s.setup){let t=l.data.color,e=l.data.darkColor;u.r=t.r,u.g=t.g,u.b=t.b,d.r=e.r,d.g=e.g,d.b=e.b}u.r+=(p-u.r)*n,u.g+=(f-u.g)*n,u.b+=(m-u.b)*n,d.r+=(g-d.r)*n,d.g+=(x-d.g)*n,d.b+=(y-d.b)*n}}}class k extends c{slotIndex=0;attachmentNames;constructor(t,e){super(t,[h.attachment+"|"+e]),this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,r){this.frames[t]=e,this.attachmentNames[t]=r}apply(t,e,r,n,a,o,l){let h=t.slots[this.slotIndex];h.bone.active&&(l!=i.mixOut?r<this.frames[0]?o!=s.setup&&o!=s.first||this.setAttachment(t,h,h.data.attachmentName):this.setAttachment(t,h,this.attachmentNames[c.search1(this.frames,r)]):o==s.setup&&this.setAttachment(t,h,h.data.attachmentName))}setAttachment(t,e,r){e.setAttachment(r?t.getAttachment(this.slotIndex,r):null)}}class R extends u{slotIndex=0;attachment;vertices;constructor(t,e,r,s){super(t,e,[h.deform+"|"+r+"|"+s.id]),this.slotIndex=r,this.attachment=s,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,r){this.frames[t]=e,this.vertices[t]=r}setBezier(t,e,r,s,i,n,a,o,l,h,c){let u=this.curves,d=this.getFrameCount()+18*t;0==r&&(u[e]=2+d);let p=.03*(s-2*n+o),f=.03*l-.06*a,m=.006*(3*(n-o)-s+h),g=.018*(a-l+.33333333),x=2*p+m,y=2*f+g,v=.3*(n-s)+p+.16666667*m,_=.3*a+f+.16666667*g,b=s+v,w=_;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=w,v+=x,_+=y,x+=m,y+=g,b+=v,w+=_}getCurvePercent(t,e){let r=this.curves,s=r[e];switch(s){case 0:let r=this.frames[e];return(t-r)/(this.frames[e+this.getFrameEntries()]-r);case 1:return 0}if(s-=2,r[s]>t){let i=this.frames[e];return r[s+1]*(t-i)/(r[s]-i)}let i=s+18;for(s+=2;s<i;s+=2)if(r[s]>=t){let e=r[s-2],i=r[s-1];return i+(t-e)/(r[s]-e)*(r[s+1]-i)}let n=r[i-2],a=r[i-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,r,i,o,l,h){let u=t.slots[this.slotIndex];if(!u.bone.active)return;let d=u.getAttachment();if(!d)return;if(!(d instanceof n.e)||d.timelineAttachment!=this.attachment)return;let p=u.deform;0==p.length&&(l=s.setup);let f=this.vertices,m=f[0].length,g=this.frames;if(r<g[0]){switch(l){case s.setup:return void(p.length=0);case s.first:if(1==o)return void(p.length=0);p.length=m;let t=d;if(t.bones)for(o=1-o,x=0;x<m;x++)p[x]*=o;else{let e=t.vertices;for(var x=0;x<m;x++)p[x]+=(e[x]-p[x])*o}}return}if(p.length=m,r>=g[g.length-1]){let t=f[g.length-1];if(1==o)if(l==s.add){let e=d;if(e.bones)for(let e=0;e<m;e++)p[e]+=t[e];else{let r=e.vertices;for(let e=0;e<m;e++)p[e]+=t[e]-r[e]}}else a.Aq.arrayCopy(t,0,p,0,m);else switch(l){case s.setup:{let e=d;if(e.bones)for(let e=0;e<m;e++)p[e]=t[e]*o;else{let r=e.vertices;for(let e=0;e<m;e++){let s=r[e];p[e]=s+(t[e]-s)*o}}break}case s.first:case s.replace:for(let e=0;e<m;e++)p[e]+=(t[e]-p[e])*o;break;case s.add:let e=d;if(e.bones)for(let e=0;e<m;e++)p[e]+=t[e]*o;else{let r=e.vertices;for(let e=0;e<m;e++)p[e]+=(t[e]-r[e])*o}}return}let y=c.search1(g,r),v=this.getCurvePercent(r,y),_=f[y],b=f[y+1];if(1==o)if(l==s.add){let t=d;if(t.bones)for(let t=0;t<m;t++){let e=_[t];p[t]+=e+(b[t]-e)*v}else{let e=t.vertices;for(let t=0;t<m;t++){let r=_[t];p[t]+=r+(b[t]-r)*v-e[t]}}}else for(let t=0;t<m;t++){let e=_[t];p[t]=e+(b[t]-e)*v}else switch(l){case s.setup:{let t=d;if(t.bones)for(let t=0;t<m;t++){let e=_[t];p[t]=(e+(b[t]-e)*v)*o}else{let e=t.vertices;for(let t=0;t<m;t++){let r=_[t],s=e[t];p[t]=s+(r+(b[t]-r)*v-s)*o}}break}case s.first:case s.replace:for(let t=0;t<m;t++){let e=_[t];p[t]+=(e+(b[t]-e)*v-p[t])*o}break;case s.add:let t=d;if(t.bones)for(let t=0;t<m;t++){let e=_[t];p[t]+=(e+(b[t]-e)*v)*o}else{let e=t.vertices;for(let t=0;t<m;t++){let r=_[t];p[t]+=(r+(b[t]-r)*v-e[t])*o}}}}}class B extends c{static propertyIds=[""+h.event];events;constructor(t){super(t,B.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,r,s,i,n,a){if(!s)return;let o=this.frames,l=this.frames.length;if(e>r)this.apply(t,e,Number.MAX_VALUE,s,i,n,a),e=-1;else if(e>=o[l-1])return;if(r<o[0])return;let h=0;if(e<o[0])h=0;else{h=c.search1(o,e)+1;let t=o[h];for(;h>0&&o[h-1]==t;)h--}for(;h<l&&r>=o[h];h++)s.push(this.events[h])}}class I extends c{static propertyIds=[""+h.drawOrder];drawOrders;constructor(t){super(t,I.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,r){this.frames[t]=e,this.drawOrders[t]=r}apply(t,e,r,n,o,l,h){if(h==i.mixOut)return void(l==s.setup&&a.Aq.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(r<this.frames[0])return void(l!=s.setup&&l!=s.first||a.Aq.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let u=c.search1(this.frames,r),d=this.drawOrders[u];if(d){let e=t.drawOrder,r=t.slots;for(let t=0,s=d.length;t<s;t++)e[t]=r[d[t]]}else a.Aq.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)}}class F extends u{constraintIndex=0;constructor(t,e,r){super(t,e,[h.ikConstraint+"|"+r]),this.constraintIndex=r}getFrameEntries(){return 6}setFrame(t,e,r,s,i,n,a){t*=6,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=s,this.frames[t+3]=i,this.frames[t+4]=n?1:0,this.frames[t+5]=a?1:0}apply(t,e,r,n,a,o,l){let h=t.ikConstraints[this.constraintIndex];if(!h.active)return;let u=this.frames;if(r<u[0]){switch(o){case s.setup:return h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,void(h.stretch=h.data.stretch);case s.first:h.mix+=(h.data.mix-h.mix)*a,h.softness+=(h.data.softness-h.softness)*a,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}let d=0,p=0,f=c.search(u,r,6),m=this.curves[f/6];switch(m){case 0:let t=u[f];d=u[f+1],p=u[f+2];let e=(r-t)/(u[f+6]-t);d+=(u[f+6+1]-d)*e,p+=(u[f+6+2]-p)*e;break;case 1:d=u[f+1],p=u[f+2];break;default:d=this.getBezierValue(r,f,1,m-2),p=this.getBezierValue(r,f,2,m+18-2)}o==s.setup?(h.mix=h.data.mix+(d-h.data.mix)*a,h.softness=h.data.softness+(p-h.data.softness)*a,l==i.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=u[f+3],h.compress=0!=u[f+4],h.stretch=0!=u[f+5])):(h.mix+=(d-h.mix)*a,h.softness+=(p-h.softness)*a,l==i.mixIn&&(h.bendDirection=u[f+3],h.compress=0!=u[f+4],h.stretch=0!=u[f+5]))}}class O extends u{constraintIndex=0;constructor(t,e,r){super(t,e,[h.transformConstraint+"|"+r]),this.constraintIndex=r}getFrameEntries(){return 7}setFrame(t,e,r,s,i,n,a,o){let l=this.frames;l[t*=7]=e,l[t+1]=r,l[t+2]=s,l[t+3]=i,l[t+4]=n,l[t+5]=a,l[t+6]=o}apply(t,e,r,i,n,a,o){let l=t.transformConstraints[this.constraintIndex];if(!l.active)return;let h,u,d,p,f,m,g=this.frames;if(r<g[0]){let t=l.data;switch(a){case s.setup:return l.mixRotate=t.mixRotate,l.mixX=t.mixX,l.mixY=t.mixY,l.mixScaleX=t.mixScaleX,l.mixScaleY=t.mixScaleY,void(l.mixShearY=t.mixShearY);case s.first:l.mixRotate+=(t.mixRotate-l.mixRotate)*n,l.mixX+=(t.mixX-l.mixX)*n,l.mixY+=(t.mixY-l.mixY)*n,l.mixScaleX+=(t.mixScaleX-l.mixScaleX)*n,l.mixScaleY+=(t.mixScaleY-l.mixScaleY)*n,l.mixShearY+=(t.mixShearY-l.mixShearY)*n}return}let x=c.search(g,r,7),y=this.curves[x/7];switch(y){case 0:let t=g[x];h=g[x+1],u=g[x+2],d=g[x+3],p=g[x+4],f=g[x+5],m=g[x+6];let e=(r-t)/(g[x+7]-t);h+=(g[x+7+1]-h)*e,u+=(g[x+7+2]-u)*e,d+=(g[x+7+3]-d)*e,p+=(g[x+7+4]-p)*e,f+=(g[x+7+5]-f)*e,m+=(g[x+7+6]-m)*e;break;case 1:h=g[x+1],u=g[x+2],d=g[x+3],p=g[x+4],f=g[x+5],m=g[x+6];break;default:h=this.getBezierValue(r,x,1,y-2),u=this.getBezierValue(r,x,2,y+18-2),d=this.getBezierValue(r,x,3,y+36-2),p=this.getBezierValue(r,x,4,y+54-2),f=this.getBezierValue(r,x,5,y+72-2),m=this.getBezierValue(r,x,6,y+90-2)}if(a==s.setup){let t=l.data;l.mixRotate=t.mixRotate+(h-t.mixRotate)*n,l.mixX=t.mixX+(u-t.mixX)*n,l.mixY=t.mixY+(d-t.mixY)*n,l.mixScaleX=t.mixScaleX+(p-t.mixScaleX)*n,l.mixScaleY=t.mixScaleY+(f-t.mixScaleY)*n,l.mixShearY=t.mixShearY+(m-t.mixShearY)*n}else l.mixRotate+=(h-l.mixRotate)*n,l.mixX+=(u-l.mixX)*n,l.mixY+=(d-l.mixY)*n,l.mixScaleX+=(p-l.mixScaleX)*n,l.mixScaleY+=(f-l.mixScaleY)*n,l.mixShearY+=(m-l.mixShearY)*n}}class G extends d{constraintIndex=0;constructor(t,e,r){super(t,e,h.pathConstraintPosition+"|"+r),this.constraintIndex=r}apply(t,e,r,s,i,n,a){let o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(r,i,n,o.position,o.data.position))}}class D extends d{constraintIndex=0;constructor(t,e,r){super(t,e,h.pathConstraintSpacing+"|"+r),this.constraintIndex=r}apply(t,e,r,s,i,n,a){let o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(r,i,n,o.spacing,o.data.spacing))}}class U extends u{constraintIndex=0;constructor(t,e,r){super(t,e,[h.pathConstraintMix+"|"+r]),this.constraintIndex=r}getFrameEntries(){return 4}setFrame(t,e,r,s,i){let n=this.frames;n[t<<=2]=e,n[t+1]=r,n[t+2]=s,n[t+3]=i}apply(t,e,r,i,n,a,o){let l=t.pathConstraints[this.constraintIndex];if(!l.active)return;let h,u,d,p=this.frames;if(r<p[0]){switch(a){case s.setup:return l.mixRotate=l.data.mixRotate,l.mixX=l.data.mixX,void(l.mixY=l.data.mixY);case s.first:l.mixRotate+=(l.data.mixRotate-l.mixRotate)*n,l.mixX+=(l.data.mixX-l.mixX)*n,l.mixY+=(l.data.mixY-l.mixY)*n}return}let f=c.search(p,r,4),m=this.curves[f>>2];switch(m){case 0:let t=p[f];h=p[f+1],u=p[f+2],d=p[f+3];let e=(r-t)/(p[f+4]-t);h+=(p[f+4+1]-h)*e,u+=(p[f+4+2]-u)*e,d+=(p[f+4+3]-d)*e;break;case 1:h=p[f+1],u=p[f+2],d=p[f+3];break;default:h=this.getBezierValue(r,f,1,m-2),u=this.getBezierValue(r,f,2,m+18-2),d=this.getBezierValue(r,f,3,m+36-2)}if(a==s.setup){let t=l.data;l.mixRotate=t.mixRotate+(h-t.mixRotate)*n,l.mixX=t.mixX+(u-t.mixX)*n,l.mixY=t.mixY+(d-t.mixY)*n}else l.mixRotate+=(h-l.mixRotate)*n,l.mixX+=(u-l.mixX)*n,l.mixY+=(d-l.mixY)*n}}class L extends d{constraintIndex=0;constructor(t,e,r,s){super(t,e,s+"|"+r),this.constraintIndex=r}apply(t,e,r,s,i,n,a){let o;if(-1==this.constraintIndex){const e=r>=this.frames[0]?this.getCurveValue(r):0;for(const s of t.physicsConstraints)s.active&&this.global(s.data)&&this.set(s,this.getAbsoluteValue2(r,i,n,this.get(s),this.setup(s),e))}else o=t.physicsConstraints[this.constraintIndex],o.active&&this.set(o,this.getAbsoluteValue(r,i,n,this.get(o),this.setup(o)))}}class N extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintInertia)}setup(t){return t.data.inertia}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}}class X extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintStrength)}setup(t){return t.data.strength}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}}class V extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintDamping)}setup(t){return t.data.damping}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}}class Y extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintMass)}setup(t){return 1/t.data.massInverse}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}}class z extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintWind)}setup(t){return t.data.wind}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}}class W extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintGravity)}setup(t){return t.data.gravity}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}}class H extends L{constructor(t,e,r){super(t,e,r,h.physicsConstraintMix)}setup(t){return t.data.mix}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}}class j extends c{static propertyIds=[h.physicsConstraintReset.toString()];constraintIndex;constructor(t,e){super(t,j.propertyIds),this.constraintIndex=e}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e}apply(t,e,r,s,i,n,a){let o;if(-1!=this.constraintIndex&&(o=t.physicsConstraints[this.constraintIndex],!o.active))return;const l=this.frames;if(e>r)this.apply(t,e,Number.MAX_VALUE,[],i,n,a),e=-1;else if(e>=l[l.length-1])return;if(!(r<l[0])&&(e<l[0]||r>=l[c.search1(l,e)+1]))if(null!=o)o.reset();else for(const e of t.physicsConstraints)e.active&&e.reset()}}class q extends c{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,e,r){super(t,[h.sequence+"|"+e+"|"+r.sequence.id]),this.slotIndex=e,this.attachment=r}getFrameEntries(){return q.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,r,s,i){let n=this.frames;n[t*=q.ENTRIES]=e,n[t+q.MODE]=r|s<<4,n[t+q.DELAY]=i}apply(t,e,r,a,l,h,u){let d=t.slots[this.slotIndex];if(!d.bone.active)return;let p=d.attachment,f=this.attachment;if(!(p==f||p instanceof n.e&&p.timelineAttachment==f))return;if(u==i.mixOut)return void(h==s.setup&&(d.sequenceIndex=-1));let m=this.frames;if(r<m[0])return void(h!=s.setup&&h!=s.first||(d.sequenceIndex=-1));let g=c.search(m,r,q.ENTRIES),x=m[g],y=m[g+q.MODE],v=m[g+q.DELAY];if(!this.attachment.sequence)return;let _=y>>4,b=this.attachment.sequence.regions.length,w=o.l8[15&y];if(w!=o.zu.hold)switch(_+=(r-x)/v+1e-5|0,w){case o.zu.once:_=Math.min(b-1,_);break;case o.zu.loop:_%=b;break;case o.zu.pingpong:{let t=(b<<1)-2;_=0==t?0:_%t,_>=b&&(_=t-_);break}case o.zu.onceReverse:_=Math.max(b-1-_,0);break;case o.zu.loopReverse:_=b-1-_%b;break;case o.zu.pingpongReverse:{let t=(b<<1)-2;_=0==t?0:(_+b-1)%t,_>=b&&(_=t-_)}}d.sequenceIndex=_}}},1990:(t,e,r)=>{"use strict";r.d(e,{r:()=>c});var s=r(6675),i=r(5199),n=r(9739),a=r(7694),o=r(6406),l=r(9776);const h=1e5;function c(t,e,r,c=0){if(t.texture===n.g.WHITE&&!t.fill)return s.Q.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(!t.fill){const r=e.createPattern(t.texture.source.resource,"repeat"),s=t.matrix.copyTo(i.u.shared);return s.scale(t.texture.frame.width,t.texture.frame.height),r.setTransform(s),r}if(t.fill instanceof l.m){const r=t.fill,s=e.createPattern(r.texture.source.resource,"repeat"),n=r.transform.copyTo(i.u.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}if(t.fill instanceof o._){const i=t.fill,n="linear"===i.type,a="local"===i.textureSpace;let o,l=1,u=1;a&&r&&(l=r.width+c,u=r.height+c);let d=!1;if(n){const{start:t,end:r}=i;o=e.createLinearGradient(t.x*l,t.y*u,r.x*l,r.y*u),d=Math.abs(r.x-t.x)<Math.abs(.1*(r.y-t.y))}else{const{center:t,innerRadius:r,outerCenter:s,outerRadius:n}=i;o=e.createRadialGradient(t.x*l,t.y*u,r*l,s.x*l,s.y*u,n*l)}if(d&&a&&r){const t=r.lineHeight/u;for(let e=0;e<r.lines.length;e++){const n=(e*r.lineHeight+c/2)/u;i.colorStops.forEach(e=>{const r=n+e.offset*t;o.addColorStop(Math.floor(r*h)/h,s.Q.shared.setValue(e.color).toHex())})}}else i.colorStops.forEach(t=>{o.addColorStop(t.offset,s.Q.shared.setValue(t.color).toHex())});return o}return(0,a.R)("FillStyle not recognised",t),"red"}},2015:(t,e,r)=>{"use strict";r.d(e,{d:()=>n});var s=r(4872),i=r(9375);class n extends s.A{constructor({buffer:t,offset:e,size:r}){super(),this.uid=(0,i.L)("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=(0,i.L)("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=0|e,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=(0,i.L)("resource"),this.emit("change",this)}destroy(t=!1){this.destroyed=!0,t&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}}},2027:(t,e,r)=>{"use strict";r.d(e,{x:()=>h});var s=r(7694),i=r(8869),n=r(8064);function a(t,e,r,s,i){const n=e[r];for(let o=0;o<n.length;o++){const l=n[o];r<e.length-1?a(t.replace(s[r],l),e,r+1,s,i):i.push(t.replace(s[r],l))}}function o(t){const e=t.match(/\{(.*?)\}/g),r=[];if(e){const s=[];e.forEach(t=>{const e=t.substring(1,t.length-1).split(",");s.push(e)}),a(t,s,0,e,r)}else r.push(t);return r}var l=r(2843);class h{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}}getAlias(t){const{alias:e,src:r}=t;return(0,n.z)(e||r,t=>"string"==typeof t?t:Array.isArray(t)?t.map(t=>t?.src??t):t?.src?t.src:t,!0)}addManifest(t){this._manifest&&(0,s.R)("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(t,e){const r=[];let s=e;Array.isArray(e)||(s=Object.entries(e).map(([t,e])=>"string"==typeof e||Array.isArray(e)?{alias:t,src:e}:{alias:t,...e})),s.forEach(e=>{const s=e.src,i=e.alias;let n;if("string"==typeof i){const e=this._createBundleAssetId(t,i);r.push(e),n=[i,e]}else{const e=i.map(e=>this._createBundleAssetId(t,e));r.push(...e),n=[...i,...e]}this.add({...e,alias:n,src:s})}),this._bundles[t]=r}add(t){const e=[];let r;Array.isArray(t)?e.push(...t):e.push(t),r=t=>{this.hasKey(t)&&(0,s.R)(`[Resolver] already has key: ${t} overwriting`)},(0,n.z)(e).forEach(t=>{const{src:e}=t;let{data:s,format:i,loadParser:a,parser:l}=t;const h=(0,n.z)(e).map(t=>"string"==typeof t?o(t):Array.isArray(t)?t:[t]),c=this.getAlias(t);Array.isArray(c)?c.forEach(r):r(c);const u=[];h.forEach(t=>{t.forEach(t=>{let e={};if("object"!=typeof t){e.src=t;for(let r=0;r<this._parsers.length;r++){const s=this._parsers[r];if(s.test(t)){e=s.parse(t);break}}}else s=t.data??s,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,l=t.parser??l),e={...e,...t};if(!c)throw new Error(`[Resolver] alias is undefined for this asset: ${e.src}`);e=this._buildResolvedAsset(e,{aliases:c,data:s,format:i,loadParser:a,parser:l}),u.push(e)})}),c.forEach(t=>{this._assetMap[t]=u})})}resolveBundle(t){const e=(0,l.a)(t);t=(0,n.z)(t);const r={};return t.forEach(t=>{const e=this._bundles[t];if(e){const s=this.resolve(e),i={};for(const e in s){const r=s[e];i[this._extractAssetIdFromBundle(t,e)]=r}r[t]=i}}),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=(0,l.a)(t);t=(0,n.z)(t);const r={};return t.forEach(t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=this._getPreferredOrder(e);r?.priority.forEach(t=>{r.params[t].forEach(r=>{const s=e.filter(e=>!!e[t]&&e[t]===r);s.length&&(e=s)})}),this._resolverHash[t]=e[0]}else this._resolverHash[t]=this._buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]}),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const r=t[e],s=this._preferredOrder.find(t=>t.params.format.includes(r.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(t){return this._defaultSearchParams?`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`:t}_buildResolvedAsset(t,e){const{aliases:r,data:s,loadParser:n,parser:a,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=i.A.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...s||{},...t.data},t.loadParser=n??t.loadParser,t.parser=a??t.parser,t.format=o??t.format??t.src.split(".").pop().split("?").shift().split("#").shift(),t}}h.RETINA_PREFIX=/@([0-9\.]+)x/},2043:(t,e,r)=>{"use strict";r.d(e,{z:()=>o});var s=r(9390),i=r(4269),n=r(9739);const a=class t{constructor(t,e){this.linkedSheets=[];let r=t;t?.source instanceof i.v&&(r={texture:t,data:e});const{texture:s,data:a,cachePrefix:o=""}=r;this.cachePrefix=o,this._texture=s instanceof n.g?s:null,this.textureSource=s.source,this.textures={},this.animations={},this.data=a;const l=parseFloat(a.meta.scale);l?(this.resolution=l,s.source.resolution=this.resolution):this.resolution=s.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let r=e;const i=t.BATCH_SIZE;for(;r-e<i&&r<this._frameKeys.length;){const t=this._frameKeys[r],e=this._frames[t],i=e.frame;if(i){let r=null,a=null;const o=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,l=new s.M(0,0,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution);r=e.rotated?new s.M(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.h)/this.resolution,Math.floor(i.w)/this.resolution):new s.M(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(a=new s.M(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution)),this.textures[t]=new n.g({source:this.textureSource,frame:r,orig:l,trim:a,rotate:e.rotated?2:0,defaultAnchor:e.anchor,defaultBorders:e.borders,label:t.toString()})}r++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const s=t[e][r];this.animations[e].push(this.textures[s])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};a.BATCH_SIZE=1e3;let o=a},2071:(t,e,r)=>{"use strict";r.d(e,{n:()=>n});var s=r(5199),i=r(7882);function n(t,e,r){return e.clear(),r||(r=s.u.IDENTITY),a(t,e,r,t,!0),e.isValid||e.set(0,0,0,0),e}function a(t,e,r,n,o){let l;if(o)l=i.u.get(),l=r.copyTo(l);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const e=t.localTransform;l=i.u.get(),l.appendFrom(e,r)}const h=e,c=!!t.effects.length;if(c&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,l);else{t.renderPipeId&&(e.matrix=l,e.addBounds(t.bounds));const r=t.children;for(let t=0;t<r.length;t++)a(r[t],e,l,n,!1)}if(c){for(let r=0;r<t.effects.length;r++)t.effects[r].addLocalBounds?.(e,n);h.addBounds(e,s.u.IDENTITY),i.o.return(e)}i.u.return(l)}},2101:(t,e,r)=>{"use strict";r.d(e,{O$:()=>i,QL:()=>a,gP:()=>s,w3:()=>n});class s{_image;constructor(t){this._image=t}getImage(){return this._image}}var i,n;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(i||(i={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n||(n={}));class a{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0}},2155:(t,e,r)=>{"use strict";r.d(e,{Q:()=>i});var s=r(159);class i extends s.q{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(t){super(t,0,!1)}}},2255:(t,e,r)=>{"use strict";r.d(e,{C:()=>s});class s{constructor(t){this.items=[],this._name=t}emit(t,e,r,s,i,n,a,o){const{name:l,items:h}=this;for(let c=0,u=h.length;c<u;c++)h[c][l](t,e,r,s,i,n,a,o);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&this.items.splice(e,1),this}contains(t){return-1!==this.items.indexOf(t)}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}},2276:(t,e,r)=>{"use strict";r.d(e,{$:()=>s});const s=[{type:"mat3x3<f32>",test:t=>void 0!==t.value.a,ubo:"\n var matrix = uv[name].toArray(true);\n data[offset] = matrix[0];\n data[offset + 1] = matrix[1];\n data[offset + 2] = matrix[2];\n data[offset + 4] = matrix[3];\n data[offset + 5] = matrix[4];\n data[offset + 6] = matrix[5];\n data[offset + 8] = matrix[6];\n data[offset + 9] = matrix[7];\n data[offset + 10] = matrix[8];\n ",uniform:"\n gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));\n "},{type:"vec4<f32>",test:t=>"vec4<f32>"===t.type&&1===t.size&&void 0!==t.value.width,ubo:"\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n data[offset + 2] = v.width;\n data[offset + 3] = v.height;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);\n }\n "},{type:"vec2<f32>",test:t=>"vec2<f32>"===t.type&&1===t.size&&void 0!==t.value.x,ubo:"\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y) {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud[name].location, v.x, v.y);\n }\n "},{type:"vec4<f32>",test:t=>"vec4<f32>"===t.type&&1===t.size&&void 0!==t.value.red,ubo:"\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n data[offset + 3] = v.alpha;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);\n }\n "},{type:"vec3<f32>",test:t=>"vec3<f32>"===t.type&&1===t.size&&void 0!==t.value.red,ubo:"\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n gl.uniform3f(ud[name].location, v.red, v.green, v.blue);\n }\n "}]},2277:(t,e,r)=>{"use strict";r.d(e,{O:()=>o});var s=r(9375),i=r(4269),n=r(9739);const a=class t{constructor(e={}){if(this.uid=(0,s.L)("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...t.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,"number"==typeof e.colorTextures){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new i.v({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(t=>t.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof n.g||e.depthStencilTexture instanceof i.v?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const t=this._size;return t[0]=this.pixelWidth,t[1]=this.pixelHeight,t}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(t){this.resize(t.width,t.height,t._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new i.v({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(t,e,r=this.resolution,s=!1){this.dirtyId++,this.colorTextures.forEach((i,n)=>{s&&0===n||i.source.resize(t,e,r)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(t,e,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(t=>{t.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};a.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let o=a},2288:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const s=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function i(t){const e="number"==typeof t.fontSize?`${t.fontSize}px`:t.fontSize;let r=t.fontFamily;Array.isArray(t.fontFamily)||(r=t.fontFamily.split(","));for(let t=r.length-1;t>=0;t--){let e=r[t].trim();/([\"\'])[^\'\"]+\1/.test(e)||s.includes(e)||(e=`"${e}"`),r[t]=e}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${r.join(",")}`}},2305:(t,e,r)=>{"use strict";r.d(e,{F:()=>s,a:()=>i});const s={name:"color-bit",vertex:{header:"\n @in aColor: vec4<f32>;\n ",main:"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aColor;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}}},2337:(t,e,r)=>{"use strict";r.d(e,{E:()=>i});var s=r(2276);function i(t,e,r,i){const n=["\n var v = null;\n var v2 = null;\n var t = 0;\n var index = 0;\n var name = null;\n var arrayOffset = null;\n "];let a=0;for(let o=0;o<t.length;o++){const l=t[o],h=l.data.name;let c=!1,u=0;for(let t=0;t<s.$.length;t++)if(s.$[t].test(l.data)){u=l.offset/4,n.push(`name = "${h}";`,`offset += ${u-a};`,s.$[t][e]||s.$[t].ubo),c=!0;break}if(!c)if(l.data.size>1)u=l.offset/4,n.push(r(l,u-a));else{const t=i[l.data.type];u=l.offset/4,n.push(`\n v = uv.${h};\n offset += ${u-a};\n ${t};\n `)}a=u}const o=n.join("\n");return new Function("uv","data","dataInt32","offset",o)}},2414:(t,e,r)=>{"use strict";r.d(e,{R:()=>i});var s=r(1347);class i{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new s.bC(()=>new Array);polygonIndicesPool=new s.bC(()=>new Array);triangulate(t){let e=t,r=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t<r;t++)s[t]=t;let n=this.isConcaveArray;n.length=0;for(let t=0,a=r;t<a;++t)n[t]=i.isConcave(t,r,e,s);let a=this.triangles;for(a.length=0;r>3;){let t=r-1,o=0,l=1;for(;;){t:if(!n[o]){let a=s[t]<<1,h=s[o]<<1,c=s[l]<<1,u=e[a],d=e[a+1],p=e[h],f=e[h+1],m=e[c],g=e[c+1];for(let a=(l+1)%r;a!=t;a=(a+1)%r){if(!n[a])continue;let t=s[a]<<1,r=e[t],o=e[t+1];if(i.positiveArea(m,g,u,d,r,o)&&i.positiveArea(u,d,p,f,r,o)&&i.positiveArea(p,f,m,g,r,o))break t}break}if(0==l){do{if(!n[o])break;o--}while(o>0);break}t=o,o=l,l=(l+1)%r}a.push(s[(r+o-1)%r]),a.push(s[o]),a.push(s[(o+1)%r]),s.splice(o,1),n.splice(o,1),r--;let h=(r+o-1)%r,c=o==r?0:o;n[h]=i.isConcave(h,r,e,s),n[c]=i.isConcave(c,r,e,s)}return 3==r&&(a.push(s[2]),a.push(s[0]),a.push(s[1])),a}decompose(t,e){let r=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let l=-1,h=0;for(let t=0,c=e.length;t<c;t+=3){let c=e[t]<<1,u=e[t+1]<<1,d=e[t+2]<<1,p=r[c],f=r[c+1],m=r[u],g=r[u+1],x=r[d],y=r[d+1],v=!1;if(l==c){let t=o.length-4,e=i.winding(o[t],o[t+1],o[t+2],o[t+3],x,y),r=i.winding(x,y,o[0],o[1],o[2],o[3]);e==h&&r==h&&(o.push(x),o.push(y),a.push(d),v=!0)}v||(o.length>0?(s.push(o),n.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),o=this.polygonPool.obtain(),o.length=0,o.push(p),o.push(f),o.push(m),o.push(g),o.push(x),o.push(y),a=this.polygonIndicesPool.obtain(),a.length=0,a.push(c),a.push(u),a.push(d),h=i.winding(p,f,m,g,x,y),l=c)}o.length>0&&(s.push(o),n.push(a));for(let t=0,e=s.length;t<e;t++){if(a=n[t],0==a.length)continue;let r=a[0],l=a[a.length-1];o=s[t];let h=o.length-4,c=o[h],u=o[h+1],d=o[h+2],p=o[h+3],f=o[0],m=o[1],g=o[2],x=o[3],y=i.winding(c,u,d,p,f,m);for(let h=0;h<e;h++){if(h==t)continue;let e=n[h];if(3!=e.length)continue;let v=e[0],_=e[1],b=e[2],w=s[h],T=w[w.length-2],S=w[w.length-1];if(v!=r||_!=l)continue;let A=i.winding(c,u,d,p,T,S),C=i.winding(T,S,f,m,g,x);A==y&&C==y&&(w.length=0,e.length=0,o.push(T),o.push(S),a.push(b),c=d,u=p,d=T,p=S,h=0)}}for(let t=s.length-1;t>=0;t--)o=s[t],0==o.length&&(s.splice(t,1),this.polygonPool.free(o),a=n[t],n.splice(t,1),this.polygonIndicesPool.free(a));return s}static isConcave(t,e,r,s){let i=s[(e+t-1)%e]<<1,n=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(r[i],r[i+1],r[n],r[n+1],r[a],r[a+1])}static positiveArea(t,e,r,s,i,n){return t*(n-s)+r*(e-n)+i*(s-e)>=0}static winding(t,e,r,s,i,n){let a=r-t,o=s-e;return i*o-n*a+a*e-t*o>=0?1:-1}}},2432:(t,e,r)=>{"use strict";r.d(e,{b:()=>s});class s{#n={};on(t,e){return this.#n[t]||(this.#n[t]=[]),this.#n[t].push({listener:e}),this}once(t,e){return this.#n[t]||(this.#n[t]=[]),this.#n[t].push({listener:e,once:!0}),this}off(t,e){const r=this.#n[t];return r?(this.#n[t]=r.filter(t=>t.listener!==e),0===this.#n[t].length&&delete this.#n[t],this):this}async emit(t,...e){const r=this.#n[t];if(!r)return[];const s=[],i=[];for(const n of r){const r=n.listener(...e);n.once&&this.off(t,n.listener),r instanceof Promise?i.push(r):s.push(r)}return s.concat(await Promise.all(i))}#a=[];bindTo(t,e,r){this.on(e,r);const s=()=>{this.off(e,r);const s=this.#a.findIndex(s=>s.target===t&&s.key===e&&s.listener===r);-1!==s&&this.#a.splice(s,1)};return t.on("remove",s),this.#a.push({key:e,target:t,listener:r,removeHandler:s}),this}remove(){this.emit("remove");for(const t of this.#a)t.target.off("remove",t.removeHandler);this.#a.length=0}}},2437:(t,e,r)=>{"use strict";r.d(e,{N:()=>o,l:()=>a});var s=r(8147),i=r(192),n=r(6121);function a(t){return void 0!==t.worldTransform}class o extends i.R{#o;_pixiContainer;worldTransform=new n.Z;worldAlpha=new s.w(1);constructor(t){super(),this._pixiContainer=t}set renderer(t){this.#o=t;for(const e of this.children)a(e)&&(e.renderer=t)}get renderer(){return this.#o}add(...t){super.add(...t);for(const e of t)a(e)&&(this._pixiContainer.addChild(e._pixiContainer),this.#o&&(e.renderer=this.#o))}remove(){this._pixiContainer.destroy({children:!0}),super.remove()}_updateWorldTransform(){for(const t of this.children)a(t)&&t._updateWorldTransform();this.worldTransform.resetDirty()}set tint(t){this._pixiContainer.tint=t}get tint(){return this._pixiContainer.tint}}},2445:(t,e,r)=>{"use strict";r.d(e,{l:()=>n});var s=r(7694),i=r(8064);const n=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||(0,s.R)(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=(0,i.z)(t);let n;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];if(s.test(e)){n=s.getCacheableAssets(r,e);break}}const a=new Map(Object.entries(n||{}));n||r.forEach(t=>{a.set(t,e)});const o=[...a.keys()],l={cacheKeys:o,keys:r};r.forEach(t=>{this._cacheMap.set(t,l)}),o.forEach(t=>{const r=n?n[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&(0,s.R)("[Cache] already has key:",t),this._cache.set(t,a.get(t))})}remove(t){if(!this._cacheMap.has(t))return void(0,s.R)(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach(t=>{this._cache.delete(t)}),e.keys.forEach(t=>{this._cacheMap.delete(t)})}get parsers(){return this._parsers}}},2454:(t,e,r)=>{"use strict";r.d(e,{F:()=>s});const s=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)},2478:(t,e,r)=>{"use strict";r.d(e,{n:()=>n});var s=r(4449);const i={};function n(t){let e=i[t];if(e)return e;const r=new Int32Array(t);for(let e=0;e<t;e++)r[e]=e;return e=i[t]=new s.k({uTextures:{value:r,type:"i32",size:t}},{isStatic:!0}),e}},2517:(t,e,r)=>{"use strict";var s=r(1065),i=r(3463),n=r(2027),a=r(9279),o=r(9739),l=r(8869),h=r(2043);const c=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function u(t,e,r){const s={};if(t.forEach(t=>{s[t]=e}),Object.keys(e.textures).forEach(t=>{s[`${e.cachePrefix}${t}`]=e.textures[t]}),!r){const r=l.A.dirname(t[0]);e.linkedSheets.forEach((t,i)=>{const n=u([`${r}/${e.data.meta.related_multi_packs[i]}`],t,!0);Object.assign(s,n)})}return s}const d={extension:s.Ag.Asset,cache:{test:t=>t instanceof h.z,getCacheableAssets:(t,e)=>u(t,e,!1)},resolver:{extension:{type:s.Ag.ResolveParser,name:"resolveSpritesheet"},test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),s=e.pop();return"json"===r&&c.includes(s)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(n.x.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:s.Ag.LoadParser,priority:i.T.Normal,name:"spritesheetLoader"},testParse:async(t,e)=>".json"===l.A.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:s,imageFilename:i,textureOptions:n,cachePrefix:c}=e?.data??{};let u,d=l.A.dirname(e.src);if(d&&d.lastIndexOf("/")!==d.length-1&&(d+="/"),s instanceof o.g)u=s;else{const s=(0,a.Y)(d+(i??t.meta.image),e.src);u=(await r.load([{src:s,data:n}]))[s]}const p=new h.z({texture:u.source,data:t,cachePrefix:c});await p.parse();const f=t?.meta?.related_multi_packs;if(Array.isArray(f)){const t=[];for(const s of f){if("string"!=typeof s)continue;let i=d+s;e.data?.ignoreMultiPack||(i=(0,a.Y)(i,e.src),t.push(r.load({src:i,data:{textureOptions:n,ignoreMultiPack:!0}})))}const s=await Promise.all(t);p.linkedSheets=s,s.forEach(t=>{t.linkedSheets=[p].concat(p.linkedSheets.filter(e=>e!==t))})}return p},async unload(t,e,r){await r.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};s.XO.add(d)},2542:(t,e,r)=>{"use strict";var s=r(1065),i=r(4242),n=r(6170),a=r(9565);const o=new n.c;function l(t,e,r){const s=o;t.measurable=!0,(0,a.f)(t,r,s),e.addBoundsMask(s),t.measurable=!1}var h=r(2071),c=r(7882),u=r(7694);function d(t,e,r){const s=c.o.get();t.measurable=!0;const i=c.u.get().identity(),n=p(t,r,i);(0,h.n)(t,s,n),t.measurable=!1,e.addBoundsMask(s),c.u.return(i),c.o.return(s)}function p(t,e,r){return t?(t!==e&&(p(t.parent,e,r),t.updateLocalTransform(),r.append(t.localTransform)),r):((0,u.R)("Mask bounds, renderable is not inside the root container"),r)}class f{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof i.k),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){this.inverse||l(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof i.k}}f.extension=s.Ag.MaskEffect;class m{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return"number"==typeof t}}m.extension=s.Ag.MaskEffect;var g=r(4687);class x{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){l(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof g.mc}}x.extension=s.Ag.MaskEffect;var y=r(6185),v=r(1386),_=r(5947),b=r(5749);r(7935),s.XO.add(f,m,x,b.$,_.b,v.q,y.P)},2577:(t,e,r)=>{"use strict";r.d(e,{R:()=>s,m:()=>i});const s={name:"texture-bit",vertex:{header:"\n\n struct TextureUniforms {\n uTextureMatrix:mat3x3<f32>,\n }\n\n @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;\n ",main:"\n uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;\n "},fragment:{header:"\n @group(2) @binding(0) var uTexture: texture_2d<f32>;\n @group(2) @binding(1) var uSampler: sampler;\n\n\n ",main:"\n outColor = textureSample(uTexture, uSampler, vUV);\n "}},i={name:"texture-bit",vertex:{header:"\n uniform mat3 uTextureMatrix;\n ",main:"\n uv = (uTextureMatrix * vec3(uv, 1.0)).xy;\n "},fragment:{header:"\n uniform sampler2D uTexture;\n\n\n ",main:"\n outColor = texture(uTexture, vUV);\n "}}},2585:(t,e,r)=>{"use strict";r.d(e,{a:()=>s});class s{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const t=this.data.color,e=this.renderable.groupColor,r=this.renderable.groupAlpha;let s;const i=t.a*r*255;if(16777215!==e){const r=e>>16&255,n=e>>8&255,a=255&e,o=t.r*a,l=t.g*n;s=i<<24|t.b*r<<16|l<<8|o}else s=i<<24|255*t.b<<16|255*t.g<<8|255*t.r;return s}get darkColor(){const t=this.data.darkColor;return 255*t.b<<16|255*t.g<<8|255*t.r}get groupTransform(){return this.renderable.groupTransform}setData(t,e,r,s){if(this.renderable=t,this.transform=t.groupTransform,this.data=e,e.clipped){const t=e.clippedData;this.indexSize=t.indicesCount,this.attributeSize=t.vertexCount,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs}else this.indexSize=e.indices.length,this.attributeSize=e.vertices.length/2,this.positions=e.vertices,this.indices=e.indices,this.uvs=e.uvs;this.texture=e.texture,this.roundPixels=s,this.blendMode=r,this.batcherName=e.darkTint?"darkTint":"default"}}},2619:(t,e,r)=>{"use strict";r.d(e,{n:()=>n});var s=r(6793);class i extends s.a{async doLoad(t){const e=(async()=>{if("fonts"in document)try{return await document.fonts.load(`1em ${t}`),await document.fonts.ready,this.loadingPromises.delete(t),!0}catch(e){console.error(`Failed to load font: ${t}`,e),this.loadingPromises.delete(t)}else console.warn("This browser does not support the Font Loading API"),this.loadingPromises.delete(t)})();return this.loadingPromises.set(t,e),await e}}const n=new i},2791:(t,e,r)=>{"use strict";r.d(e,{w:()=>a});var s=r(3655),i=r(9739);const n={};function a(t,e,r){let a=2166136261;for(let r=0;r<e;r++)a^=t[r].uid,a=Math.imul(a,16777619),a>>>=0;return n[a]||function(t,e,r,a){const o={};let l=0;for(let r=0;r<a;r++){const s=r<e?t[r]:i.g.EMPTY.source;o[l++]=s.source,o[l++]=s.style}const h=new s.T(o);return n[r]=h,h}(t,e,a,r)}},2806:()=>{"use strict";var t;void 0===Math.fround&&(Math.fround=(t=new Float32Array(1),function(e){return t[0]=e,t[0]}))},2839:(t,e,r)=>{"use strict";r.d(e,{_:()=>n});var s=r(166),i=r(7249);class n extends i.X{constructor(t){super(new s.mcf({sortableChildren:!0}),t??{})}}},2843:(t,e,r)=>{"use strict";r.d(e,{a:()=>s});const s=t=>!Array.isArray(t)},2866:(t,e,r)=>{"use strict";r.d(e,{$:()=>n});var s=r(946),i=r(1347);class n{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=s.u.Normal;sorted=!1;active=!1;constructor(t,e,r){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=r,this.setToSetupPose()}isActive(){return this.active}update(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,r,n,a,o,l){this.ax=t,this.ay=e,this.arotation=r,this.ascaleX=n,this.ascaleY=a,this.ashearX=o,this.ashearY=l;let h=this.parent;if(!h){let s=this.skeleton;const h=s.scaleX,c=s.scaleY,u=(r+o)*i.cj.degRad,d=(r+90+l)*i.cj.degRad;return this.a=Math.cos(u)*n*h,this.b=Math.cos(d)*a*h,this.c=Math.sin(u)*n*c,this.d=Math.sin(d)*a*c,this.worldX=t*h+s.x,void(this.worldY=e*c+s.y)}let c=h.a,u=h.b,d=h.c,p=h.d;switch(this.worldX=c*t+u*e+h.worldX,this.worldY=d*t+p*e+h.worldY,this.inherit){case s.u.Normal:{const t=(r+o)*i.cj.degRad,e=(r+90+l)*i.cj.degRad,s=Math.cos(t)*n,h=Math.cos(e)*a,f=Math.sin(t)*n,m=Math.sin(e)*a;return this.a=c*s+u*f,this.b=c*h+u*m,this.c=d*s+p*f,void(this.d=d*h+p*m)}case s.u.OnlyTranslation:{const t=(r+o)*i.cj.degRad,e=(r+90+l)*i.cj.degRad;this.a=Math.cos(t)*n,this.b=Math.cos(e)*a,this.c=Math.sin(t)*n,this.d=Math.sin(e)*a;break}case s.u.NoRotationOrReflection:{let t=1/this.skeleton.scaleX,e=1/this.skeleton.scaleY;c*=t,d*=e;let s=c*c+d*d,h=0;s>1e-4?(s=Math.abs(c*p*e-u*t*d)/s,u=d*s,p=c*s,h=Math.atan2(d,c)*i.cj.radDeg):(c=0,d=0,h=90-Math.atan2(p,u)*i.cj.radDeg);const f=(r+o-h)*i.cj.degRad,m=(r+l-h+90)*i.cj.degRad,g=Math.cos(f)*n,x=Math.cos(m)*a,y=Math.sin(f)*n,v=Math.sin(m)*a;this.a=c*g-u*y,this.b=c*x-u*v,this.c=d*g+p*y,this.d=d*x+p*v;break}case s.u.NoScale:case s.u.NoScaleOrReflection:{r*=i.cj.degRad;const t=Math.cos(r),e=Math.sin(r);let h=(c*t+u*e)/this.skeleton.scaleX,f=(d*t+p*e)/this.skeleton.scaleY,m=Math.sqrt(h*h+f*f);m>1e-5&&(m=1/m),h*=m,f*=m,m=Math.sqrt(h*h+f*f),this.inherit==s.u.NoScale&&c*p-u*d<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(m=-m),r=Math.PI/2+Math.atan2(f,h);const g=Math.cos(r)*m,x=Math.sin(r)*m;o*=i.cj.degRad,l=(90+l)*i.cj.degRad;const y=Math.cos(o)*n,v=Math.cos(l)*a,_=Math.sin(o)*n,b=Math.sin(l)*a;this.a=h*y+g*_,this.b=h*v+g*b,this.c=f*y+x*_,this.d=f*v+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*i.cj.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*i.cj.radDeg);let e,r,n,a,o=t.a,l=t.b,h=t.c,c=t.d,u=1/(o*c-l*h),d=c*u,p=l*u,f=h*u,m=o*u,g=this.worldX-t.worldX,x=this.worldY-t.worldY;if(this.ax=g*d-x*p,this.ay=x*m-g*f,this.inherit==s.u.OnlyTranslation)e=this.a,r=this.b,n=this.c,a=this.d;else{switch(this.inherit){case s.u.NoRotationOrReflection:{let t=Math.abs(o*c-l*h)/(o*o+h*h);l=-h*this.skeleton.scaleX*t/this.skeleton.scaleY,c=o*this.skeleton.scaleY*t/this.skeleton.scaleX,u=1/(o*c-l*h),d=c*u,p=l*u;break}case s.u.NoScale:case s.u.NoScaleOrReflection:let t=i.cj.cosDeg(this.rotation),e=i.cj.sinDeg(this.rotation);o=(o*t+l*e)/this.skeleton.scaleX,h=(h*t+c*e)/this.skeleton.scaleY;let r=Math.sqrt(o*o+h*h);r>1e-5&&(r=1/r),o*=r,h*=r,r=Math.sqrt(o*o+h*h),this.inherit==s.u.NoScale&&u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(r=-r);let n=i.cj.PI/2+Math.atan2(h,o);l=Math.cos(n)*r,c=Math.sin(n)*r,u=1/(o*c-l*h),d=c*u,p=l*u,f=h*u,m=o*u}e=d*this.a-p*this.c,r=d*this.b-p*this.d,n=m*this.c-f*this.a,a=m*this.d-f*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(e*e+n*n),this.ascaleX>1e-4){let t=e*a-r*n;this.ascaleY=t/this.ascaleX,this.ashearY=-Math.atan2(e*r+n*a,t)*i.cj.radDeg,this.arotation=Math.atan2(n,e)*i.cj.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(r*r+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,r)*i.cj.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*i.cj.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*i.cj.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),r=t.x-this.worldX,s=t.y-this.worldY;return t.x=r*this.d*e-s*this.b*e,t.y=s*this.a*e-r*this.c*e,t}localToWorld(t){let e=t.x,r=t.y;return t.x=e*this.a+r*this.b+this.worldX,t.y=e*this.c+r*this.d+this.worldY,t}worldToParent(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)}parentToWorld(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)}worldToLocalRotation(t){let e=i.cj.sinDeg(t),r=i.cj.cosDeg(t);return Math.atan2(this.a*e-this.c*r,this.d*r-this.b*e)*i.cj.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=i.cj.sinDeg(t),r=i.cj.cosDeg(t);return Math.atan2(r*this.c+e*this.d,r*this.a+e*this.b)*i.cj.radDeg}rotateWorld(t){t*=i.cj.degRad;const e=Math.sin(t),r=Math.cos(t),s=this.a,n=this.b;this.a=r*s-e*this.c,this.b=r*n-e*this.d,this.c=e*s+r*this.c,this.d=e*n+r*this.d}}},2885:(t,e,r)=>{"use strict";r.d(e,{v:()=>i});var s=r(2027);function i(t,e=1){const r=s.x.RETINA_PREFIX?.exec(t);return r?parseFloat(r[1]):e}},3046:(t,e,r)=>{"use strict";var s=r(1065);class i{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this._cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:s}=this._resizeTo;t=r,e=s}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}i.extension=s.Ag.Application;var n=r(3880),a=r(3651);class o{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,n.d.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?a.R.shared:new a.R,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}o.extension=s.Ag.Application,s.XO.add(i),s.XO.add(o)},3050:(t,e,r)=>{"use strict";var s=r(1065),i=r(6364),n=r(7433),a=r(761),o=r(9482),l=r(5008);class h{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{a.Z.return(t)}),this.batches.length=0}}class c{constructor(t,e){this.state=n.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this)}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const e=t.context,r=!!t._gpuData,s=this.renderer.graphicsContext.updateGpuContext(e);return!(!s.isBatchable&&r===s.isBatchable)}addRenderable(t,e){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const e=this._getGpuDataForRenderable(t).batches;for(let t=0;t<e.length;t++){const r=e[t];r._batcher.updateElement(r)}}execute(t){if(!t.isRenderable)return;const e=this.renderer,r=t.context;if(!e.graphicsContext.getGpuContext(r).batches.length)return;const s=r.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const i=s.resources.localUniforms.uniforms;i.uTransformMatrix=t.groupTransform,i.uRound=e._roundPixels|t._roundPixels,(0,o.V)(t.groupColorAlpha,i.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const e=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){const r=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(t).batches;for(let t=0;t<s.length;t++){const i=s[t];r.addToBatch(i,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const e=new h;return t._gpuData[this.renderer.uid]=e,e}_updateBatchesForRenderable(t,e){const r=t.context,s=this.renderer.graphicsContext.getGpuContext(r),i=this.renderer._roundPixels|t._roundPixels;e.batches=s.batches.map(e=>{const r=a.Z.get(l.G);return e.copyTo(r),r.renderable=t,r.roundPixels=i,r})}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}c.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"graphics"},s.XO.add(c),s.XO.add(i.GH)},3051:(t,e,r)=>{"use strict";r.d(e,{Y:()=>n});var s=r(1065),i=r(6257);const n={extension:{type:s.Ag.DetectionParser,priority:0},test:async()=>(0,i.P)("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter(t=>"webp"!==t)}},3198:(t,e,r)=>{"use strict";r.d(e,{u:()=>p});var s=r(1886),i=r(8847),n=r(791),a=r(2619),o=r(4132),l=r(3645),h=r(7635);const c=[{check:t=>t.endsWith(".json")||t.endsWith(".atlas"),loader:l.R},{check:t=>t.endsWith(".skel"),loader:i.j},{check:t=>/\.(png|jpe?g|gif|webp)$/.test(t),loader:h.V},{check:t=>/\.(mp3|wav|ogg)$/.test(t),loader:s.K},{check:t=>!t.includes("."),loader:a.n}];function u(t){return c.find(({check:e})=>e(t))?.loader}function d(t){if("string"==typeof t){const e=u(t);if(!e)return void console.warn(`No loader found for asset: ${t}`);e.release(t)}else if("atlas"in t){const e=(0,o.t)(t.src,t.atlas);o.i.release(e)}else"fnt"in t?n.S.release(t.fnt):console.warn(`Unknown asset type: ${t}`)}async function p(t,e){let r=0;const s=t.length;return await Promise.all(t.map(async t=>{try{await async function(t){if("string"==typeof t){const e=u(t);if(!e)return void console.warn(`No loader found for asset: ${t}`);await e.load(t)}else if("atlas"in t){const e=(0,o.t)(t.src,t.atlas);await o.i.load(e,t.src,t.atlas)}else"fnt"in t?await n.S.load(t.fnt,t.src):console.warn(`Unknown asset type: ${t}`)}(t),r++,e?.(r/s)}catch(e){console.error("Failed to load asset:",t,e)}})),()=>t.forEach(d)}},3212:(t,e,r)=>{"use strict";r.d(e,{f:()=>s});const s={test(t){const e=t;return"string"!=typeof e&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},parse(t){const e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},r=t.getElementsByTagName("info")[0],s=t.getElementsByTagName("common")[0],i=t.getElementsByTagName("distanceField")[0];i&&(e.distanceField={type:i.getAttribute("fieldType"),range:parseInt(i.getAttribute("distanceRange"),10)});const n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning");e.fontSize=parseInt(r.getAttribute("size"),10),e.fontFamily=r.getAttribute("face"),e.lineHeight=parseInt(s.getAttribute("lineHeight"),10);for(let t=0;t<n.length;t++)e.pages.push({id:parseInt(n[t].getAttribute("id"),10)||0,file:n[t].getAttribute("file")});const l={};e.baseLineOffset=e.lineHeight-parseInt(s.getAttribute("base"),10);for(let t=0;t<a.length;t++){const r=a[t],s=parseInt(r.getAttribute("id"),10);let i=r.getAttribute("letter")??r.getAttribute("char")??String.fromCharCode(s);"space"===i&&(i=" "),l[s]=i,e.chars[i]={id:s,page:parseInt(r.getAttribute("page"),10)||0,x:parseInt(r.getAttribute("x"),10),y:parseInt(r.getAttribute("y"),10),width:parseInt(r.getAttribute("width"),10),height:parseInt(r.getAttribute("height"),10),xOffset:parseInt(r.getAttribute("xoffset"),10),yOffset:parseInt(r.getAttribute("yoffset"),10),xAdvance:parseInt(r.getAttribute("xadvance"),10),kerning:{}}}for(let t=0;t<o.length;t++){const r=parseInt(o[t].getAttribute("first"),10),s=parseInt(o[t].getAttribute("second"),10),i=parseInt(o[t].getAttribute("amount"),10);e.chars[l[s]].kerning[l[r]]=i}return e}}},3289:(t,e,r)=>{"use strict";r.d(e,{f:()=>l});var s=r(5423),i=r(1065),n=r(3761),a=r(4173),o=r(3463);const l={name:"loadTxt",id:"text",extension:{type:i.Ag.LoadParser,priority:o.T.Low,name:"loadTxt"},test:t=>(0,n.s)(t,"text/plain")||(0,a.W)(t,".txt"),async load(t){const e=await s.e.get().fetch(t);return await e.text()}}},3385:(t,e,r)=>{"use strict";r.d(e,{a:()=>o});var s=r(7694),i=r(8869),n=r(8064),a=r(2843);class o{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,r)=>(this._parsersValidated=!1,t[e]=r,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const r={promise:null,parser:null};return r.promise=(async()=>{let i=null,n=null;if((e.parser||e.loadParser)&&(n=this._parserHash[e.parser||e.loadParser],e.loadParser&&(0,s.R)(`[Assets] "loadParser" is deprecated, use "parser" instead for ${t}`),n||(0,s.R)(`[Assets] specified load parser "${e.parser||e.loadParser}" not found while loading ${t}`)),!n){for(let r=0;r<this.parsers.length;r++){const s=this.parsers[r];if(s.load&&s.test?.(t,e,this)){n=s;break}}if(!n)return(0,s.R)(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await n.load(t,e,this),r.parser=n;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];s.parse&&s.parse&&await(s.testParse?.(i,e,this))&&(i=await s.parse(i,e,this)||i,r.parser=s)}return i})(),r}async load(t,e){this._parsersValidated||this._validateParsers();let r=0;const s={},o=(0,a.a)(t),l=(0,n.z)(t,t=>({alias:[t],src:t,data:{}})),h=l.length,c=l.map(async t=>{const n=i.A.toAbsolute(t.src);if(!s[t.src])try{this.promiseCache[n]||(this.promiseCache[n]=this._getLoadPromiseAndParser(n,t)),s[t.src]=await this.promiseCache[n].promise,e&&e(++r/h)}catch(e){throw delete this.promiseCache[n],delete s[t.src],new Error(`[Loader.load] Failed to load ${n}.\n${e}`)}});return await Promise.all(c),o?s[l[0].src]:s}async unload(t){const e=(0,n.z)(t,t=>({alias:[t],src:t})).map(async t=>{const e=i.A.toAbsolute(t.src),r=this.promiseCache[e];if(r){const s=await r.promise;delete this.promiseCache[e],await(r.parser?.unload?.(s,t,this))}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name||t.id).reduce((t,e)=>(e.name||e.id?(t[e.name]||t[e.id])&&(0,s.R)(`[Assets] parser id conflict "${e.id}"`):(0,s.R)("[Assets] parser should have an id"),t[e.name]=e,e.id&&(t[e.id]=e),t),{})}}},3394:(t,e,r)=>{"use strict";var s=r(166);const i="spineSkeletonLoader",n={extension:s.AgS.Asset,loader:{id:i,name:i,extension:{type:s.AgS.LoadParser,priority:s.T9C.Normal,name:i},test:t=>(0,s.WOU)(t,".skel"),async load(t){const e=await s.eBH.get().fetch(t);return new Uint8Array(await e.arrayBuffer())},testParse(t,e){const r=(0,s.WOU)(e.src,".json")&&(n=t,Object.prototype.hasOwnProperty.call(n,"bones"));var n;const a=(0,s.WOU)(e.src,".skel")&&function(t){return t instanceof Uint8Array}(t),o=e.parser===i||e.loadParser===i;return Promise.resolve(r||a||o)}}};s.XOh.add(n)},3412:(t,e,r)=>{"use strict";r.d(e,{K:()=>s});class s{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){}}},3450:(t,e,r)=>{"use strict";r.d(e,{J:()=>s});class s{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(t,e){if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}}},3463:(t,e,r)=>{"use strict";r.d(e,{T:()=>s});var s=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(s||{})},3472:(t,e,r)=>{"use strict";r.d(e,{I:()=>s});const s={extension:{type:r(1065).Ag.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then(r.bind(r,8675))}}},3590:(t,e,r)=>{"use strict";function s(t,e,r){const{width:s,height:i}=r.orig,n=r.trim;if(n){const r=n.width,a=n.height;t.minX=n.x-e._x*s,t.maxX=t.minX+r,t.minY=n.y-e._y*i,t.maxY=t.minY+a}else t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*i,t.maxY=t.minY+i}r.d(e,{y:()=>s})},3643:(t,e,r)=>{"use strict";r.d(e,{Q:()=>s});class s{skeletonData;animationToMixTime={};defaultMix=0;constructor(t){if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,r){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let i=this.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);this.setMixWith(s,i,r)}setMixWith(t,e,r){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=r}getMix(t,e){let r=t.name+"."+e.name,s=this.animationToMixTime[r];return void 0===s?this.defaultMix:s}}},3645:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});var s=r(6793);class i extends s.a{async doLoad(t){const e=(async()=>{const e=await fetch(t);if(!e.ok)return void console.error(`Failed to load text: ${t}`);const r=await e.text();if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,r),r;console.error(`Text already exists: ${t}`)}})();return this.loadingPromises.set(t,e),await e}}const n=new i},3648:(t,e,r)=>{"use strict";r.d(e,{Dr:()=>n,pw:()=>s,r9:()=>i,rX:()=>o});var s,i,n,a=r(159);class o extends a.q{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=s.Fixed;spacingMode=i.Fixed;rotateMode=n.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(t){super(t,0,!1)}}!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(s||(s={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(i||(i={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(n||(n={}))},3651:(t,e,r)=>{"use strict";r.d(e,{R:()=>a});var s=r(3880);class i{constructor(t,e=null,r=0,s=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=r,this._once=s}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const n=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new i(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=s.d.NORMAL){return this._addListener(new i(t,e,r))}addOnce(t,e,r=s.d.NORMAL){return this._addListener(new i(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const s=this._head;let i=s.next;for(;i;)i=i.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const r=Math.min(this.maxFPS,e),s=Math.min(Math.max(0,r)/1e3,t.targetFPMS);this._maxElapsedMS=1/s}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};n.targetFPMS=.06;let a=n},3655:(t,e,r)=>{"use strict";r.d(e,{T:()=>s});class s{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const r in t){const s=t[r];this.setResource(s,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const r in this.resources)t[e++]=this.resources[r]._resourceId;this._key=t.join("|")}setResource(t,e){const r=this.resources[e];t!==r&&(r&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const r in e)e[r]._touched=t}destroy(){const t=this.resources;for(const e in t){const r=t[e];r.off?.("change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const r in e)e[r]===t&&(e[r]=null)}else this._updateKey()}}},3761:(t,e,r)=>{"use strict";function s(t,e){if(Array.isArray(e)){for(const r of e)if(t.startsWith(`data:${r}`))return!0;return!1}return t.startsWith(`data:${e}`)}r.d(e,{s:()=>s})},3762:(t,e,r)=>{"use strict";var s;r(8630),function(t){t[t.None=0]="None",t[t.Ellipse=1]="Ellipse",t[t.OBB=2]="OBB",t[t.Circle=3]="Circle",t[t.Poly=4]="Poly",t[t.PolyLocal=5]="PolyLocal"}(s||(s={}))},3769:(t,e,r)=>{"use strict";r.d(e,{i:()=>i});var s=r(8271);function i(t,e){return"no-premultiply-alpha"===e.alphaMode&&s.Q[t]||t}},3798:(t,e,r)=>{"use strict";r.d(e,{j:()=>a});var s=r(1065),i=r(9586),n=r(2027);const a={extension:{type:s.Ag.ResolveParser,name:"resolveTexture"},test:i.P.test,parse:t=>({resolution:parseFloat(n.x.RETINA_PREFIX.exec(t)?.[1]??"1"),format:t.split(".").pop(),src:t})}},3809:(t,e,r)=>{"use strict";r.d(e,{B:()=>l});var s=r(769),i=r(9390),n=r(9739),a=r(9359),o=r(8598);class l extends a.v{constructor(t,e){super();const{textures:r,data:a}=t;Object.keys(a.pages).forEach(t=>{const e=a.pages[parseInt(t,10)],s=r[e.id];this.pages.push({texture:s})}),Object.keys(a.chars).forEach(t=>{const e=a.chars[t],{frame:o,source:l,rotate:h}=r[e.page],c=s.E.transformRectCoords(e,o,h,new i.M),u=new n.g({frame:c,orig:new i.M(0,0,e.width,e.height),source:l,rotate:h});this.chars[t]={id:t.codePointAt(0),xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,kerning:e.kerning??{},texture:u}}),this.baseRenderedFontSize=a.fontSize,this.baseMeasurementFontSize=a.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:a.fontSize},this.baseLineOffset=a.baseLineOffset,this.lineHeight=a.lineHeight,this.fontFamily=a.fontFamily,this.distanceField=a.distanceField??{type:"none",range:0},this.url=e}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){const{texture:e}=this.pages[t];e.destroy(!0)}this.pages=null}static install(t){o.c.install(t)}static uninstall(t){o.c.uninstall(t)}}},3880:(t,e,r)=>{"use strict";r.d(e,{d:()=>s});var s=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(s||{})},3916:(t,e,r)=>{"use strict";var s=r(8034),i=r(166),n=r(6836);const a="spineTextureAtlasLoader",o={extension:i.AgS.Asset,resolver:{test:t=>(0,i.WOU)(t,".atlas"),parse:t=>{const e=t.split(".");return{resolution:parseFloat(i.xR6.RETINA_PREFIX?.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{id:a,name:a,extension:{type:i.AgS.LoadParser,priority:i.T9C.Normal,name:a},test:t=>(0,i.WOU)(t,".atlas"),async load(t){const e=await i.eBH.get().fetch(t);return await e.text()},testParse(t,e){const r=(0,i.WOU)(e.src,".atlas"),s="string"==typeof t,n=e.parser===a||e.loadParser===a;return Promise.resolve((r||n)&&s)},unload(t){t.dispose()},async parse(t,e,r){const a=e.data||{};let o=i.AeT.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");const l=new s.Lw(t);if(a.images instanceof i.v9C||"string"==typeof a.images){const t=a.images;a.images={},a.images[l.pages[0].name]=t}const h=[];for(const t of l.pages){const s=t.name,l=a?.images?a.images[s]:void 0;if(l instanceof i.v9C)t.setTexture(n.R.from(l));else{const c=l??i.AeT.normalize([...o.split(i.AeT.sep),s].join(i.AeT.sep)),u={src:(0,i.Y8S)(c,e.src),data:{...a.imageMetadata,alphaMode:t.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"}},d=r.load(u).then(e=>{t.setTexture(n.R.from(e.source))});h.push(d)}}return await Promise.all(h),l}}};i.XOh.add(o)},4025:(t,e,r)=>{"use strict";function s(t,e,r){const s=t.length;let i;if(e>=s||0===r)return;const n=s-(r=e+r>s?s-e:r);for(i=e;i<n;++i)t[i]=t[i+r];t.length=n}r.d(e,{d:()=>s})},4102:(t,e,r)=>{"use strict";r.d(e,{p:()=>n});var s=r(1065),i=r(5031);const n={extension:{type:s.Ag.DetectionParser,priority:0},test:async()=>(0,i.b)("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter(t=>"mp4"!==t&&"m4v"!==t)}},4132:(t,e,r)=>{"use strict";r.d(e,{i:()=>c,t:()=>l});var s=r(166),i=r(6793),n=r(7635);const a=new WeakMap;let o=0;function l(t,e){let r=a.get(e);return r||(r=new Map,a.set(e,r)),r.has(t)||r.set(t,`${t}#${o++}`),r.get(t)}class h extends i.a{#l=new Map;async doLoad(t,e,r){this.#l.set(t,e);const i=(async()=>{const i=await n.V.load(e);if(!i)return void console.error(`Failed to load texture: ${e}`);const a=new s.zo6(i,r);if(await a.parse(),this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,a),a;n.V.release(e),console.error(`Spritesheet already exists: ${e}`)}else n.V.release(e)})();return this.loadingPromises.set(t,i),await i}cleanup(t,e){e.destroy();const r=this.#l.get(t);r&&n.V.release(r)}}const c=new h},4142:(t,e,r)=>{"use strict";r.d(e,{u:()=>s});class s{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}},4173:(t,e,r)=>{"use strict";r.d(e,{W:()=>i});var s=r(8869);function i(t,e){const r=t.split("?")[0],i=s.A.extname(r).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}},4219:(t,e,r)=>{"use strict";r.d(e,{Qj:()=>f});var s=r(1065),i=r(5749),n=r(5180),a=r(2885),o=r(5031),l=r(3761),h=r(4173),c=r(9521);const u=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"];let d,p;const f={name:"loadVideo",id:"video",extension:{type:s.Ag.LoadParser,name:"loadVideo"},test(t){if(!d||!p){const{validVideoExtensions:t,validVideoMime:e}=function(){const t=[],e=[];for(const r of u){const s=i.$.MIME_TYPES[r.substring(1)]||`video/${r.substring(1)}`;(0,o.b)(s)&&(t.push(r),e.includes(s)||e.push(s))}return{validVideoExtensions:t,validVideoMime:e}}();d=t,p=e}const e=(0,l.s)(t,p),r=(0,h.W)(t,d);return e||r},async load(t,e,r){const s={...i.$.defaultOptions,resolution:e.data?.resolution||(0,a.v)(t),alphaMode:e.data?.alphaMode||await(0,n.C)(),...e.data},o=document.createElement("video"),l={preload:!1!==s.autoLoad?"auto":void 0,"webkit-playsinline":!1!==s.playsinline?"":void 0,playsinline:!1!==s.playsinline?"":void 0,muted:!0===s.muted?"":void 0,loop:!0===s.loop?"":void 0,autoplay:!1!==s.autoPlay?"":void 0};Object.keys(l).forEach(t=>{const e=l[t];void 0!==e&&o.setAttribute(t,e)}),!0===s.muted&&(o.muted=!0),function(t,e,r){void 0!==r||e.startsWith("data:")?!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous"):t.crossOrigin=function(t,e=globalThis.location){if(t.startsWith("data:"))return"";e||(e=globalThis.location);const r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}(e)}(o,t,s.crossorigin);const h=document.createElement("source");let u;if(s.mime)u=s.mime;else if(t.startsWith("data:"))u=t.slice(5,t.indexOf(";"));else if(!t.startsWith("blob:")){const e=t.split("?")[0].slice(t.lastIndexOf(".")+1).toLowerCase();u=i.$.MIME_TYPES[e]||`video/${e}`}return h.src=t,u&&(h.type=u),new Promise(n=>{const a=async()=>{const l=new i.$({...s,resource:o});var h;o.removeEventListener("canplay",a),e.data.preload&&await(h=o,new Promise((t,e)=>{function r(){i(),t()}function s(t){i(),e(t)}function i(){h.removeEventListener("canplaythrough",r),h.removeEventListener("error",s)}h.addEventListener("canplaythrough",r),h.addEventListener("error",s),h.load()})),n((0,c.s)(l,r,t))};s.preload&&!s.autoPlay&&o.load(),o.addEventListener("canplay",a),o.appendChild(h)})},unload(t){t.destroy(!0)}}},4242:(t,e,r)=>{"use strict";r.d(e,{k:()=>l});var s=r(7898),i=r(9739),n=r(3590),a=r(4696),o=r(4543);class l extends o.l{constructor(t=i.g.EMPTY){t instanceof i.g&&(t={texture:t});const{texture:e=i.g.EMPTY,anchor:r,roundPixels:n,width:a,height:o,...l}=t;super({label:"Sprite",...l}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new s.o({_onUpdate:()=>{this.onViewUpdate()}}),r?this.anchor=r:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=n??!1,void 0!==a&&(this.width=a),void 0!==o&&(this.height=o)}static from(t,e=!1){return t instanceof i.g?new l(t):new l(i.g.from(t,e))}set texture(t){t||(t=i.g.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return(0,n.y)(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return(0,a.t6)("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,r=this._bounds,{width:s,height:i}=e.orig;r.minX=-t._x*s,r.maxX=r.minX+s,r.minY=-t._y*i,r.maxY=r.minY+i}destroy(t=!1){if(super.destroy(t),"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._texture.destroy(e)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this._texture.orig.width),void 0!==e&&this._setHeight(e,this._texture.orig.height)}}},4269:(t,e,r)=>{"use strict";r.d(e,{v:()=>h});var s=r(4872),i=r(9437),n=r(7604),a=r(9375),o=r(8896);const l=class t extends s.A{constructor(e={}){super(),this.options=e,this.uid=(0,a.L)("textureSource"),this._resourceType="textureSource",this._resourceId=(0,a.L)("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...t.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new o.n((0,n.S)(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=(0,a.L)("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,r){r||(r=this._resolution),t||(t=this.width),e||(e=this.height);const s=Math.round(t*r),i=Math.round(e*r);return this.width=s/r,this.height=i/r,this._resolution=r,(this.pixelWidth!==s||this.pixelHeight!==i)&&(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=i,this.emit("resize",this),this._resourceId=(0,a.L)("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=(0,i.f3)(this.pixelWidth)&&(0,i.f3)(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};l.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let h=l},4336:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});var s=r(5423),i=r(1065),n=r(5947),a=r(4386),o=r(2885),l=r(3761),h=r(4173),c=r(3463),u=r(9521);const d={extension:{type:i.Ag.LoadParser,priority:c.T.Low,name:"loadSVG"},name:"loadSVG",id:"svg",config:{crossOrigin:"anonymous",parseAsGraphicsContext:!1},test:t=>(0,l.s)(t,"image/svg+xml")||(0,h.W)(t,".svg"),async load(t,e,r){return e.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?async function(t){const e=await s.e.get().fetch(t),r=await e.text(),i=new a.T;return i.svg(r),i}(t):async function(t,e,r,i){const a=await s.e.get().fetch(t),l=s.e.get().createImage();l.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await a.text())}`,l.crossOrigin=i,await l.decode();const h=e.data?.width??l.width,c=e.data?.height??l.height,d=e.data?.resolution||(0,o.v)(t),p=Math.ceil(h*d),f=Math.ceil(c*d),m=s.e.get().createCanvas(p,f),g=m.getContext("2d");g.imageSmoothingEnabled=!0,g.imageSmoothingQuality="high",g.drawImage(l,0,0,h*d,c*d);const{parseAsGraphicsContext:x,...y}=e.data??{},v=new n.b({resource:m,alphaMode:"premultiply-alpha-on-upload",resolution:d,...y});return(0,u.s)(v,r,t)}(t,e,r,this.config.crossOrigin)},unload(t){t.destroy(!0)}}},4364:(t,e,r)=>{"use strict";function s(t,e){return`\n for (let i = 0; i < ${t*e}; i++) {\n data[offset + (((i / ${t})|0) * 4) + (i % ${t})] = v[i];\n }\n `}r.d(e,{_:()=>n,g:()=>i});const i={f32:"\n data[offset] = v;",i32:"\n dataInt32[offset] = v;","vec2<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];","vec3<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];","vec4<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];","vec2<i32>":"\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];","vec3<i32>":"\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];\n dataInt32[offset + 2] = v[2];","vec4<i32>":"\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];\n dataInt32[offset + 2] = v[2];\n dataInt32[offset + 3] = v[3];","mat2x2<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 4] = v[2];\n data[offset + 5] = v[3];","mat3x3<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];","mat4x4<f32>":"\n for (let i = 0; i < 16; i++) {\n data[offset + i] = v[i];\n }","mat3x2<f32>":s(3,2),"mat4x2<f32>":s(4,2),"mat2x3<f32>":s(2,3),"mat4x3<f32>":s(4,3),"mat2x4<f32>":s(2,4),"mat3x4<f32>":s(3,4)},n={...i,"mat2x2<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];\n "}},4382:(t,e,r)=>{"use strict";r.d(e,{e:()=>n,o:()=>i});var s=r(1347);class i{name;constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}class n extends i{static nextID=0;id=n.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,e,r,s,i,n){r=i+(r>>1)*n;let a=t.bone.skeleton,o=t.deform,l=this.vertices,h=this.bones;if(!h){o.length>0&&(l=o);let a=t.bone,h=a.worldX,c=a.worldY,u=a.a,d=a.b,p=a.c,f=a.d;for(let t=e,a=i;a<r;t+=2,a+=n){let e=l[t],r=l[t+1];s[a]=e*u+r*d+h,s[a+1]=e*p+r*f+c}return}let c=0,u=0;for(let t=0;t<e;t+=2){let t=h[c];c+=t+1,u+=t}let d=a.bones;if(0==o.length)for(let t=i,e=3*u;t<r;t+=n){let r=0,i=0,n=h[c++];for(n+=c;c<n;c++,e+=3){let t=d[h[c]],s=l[e],n=l[e+1],a=l[e+2];r+=(s*t.a+n*t.b+t.worldX)*a,i+=(s*t.c+n*t.d+t.worldY)*a}s[t]=r,s[t+1]=i}else{let t=o;for(let e=i,a=3*u,o=u<<1;e<r;e+=n){let r=0,i=0,n=h[c++];for(n+=c;c<n;c++,a+=3,o+=2){let e=d[h[c]],s=l[a]+t[o],n=l[a+1]+t[o+1],u=l[a+2];r+=(s*e.a+n*e.b+e.worldX)*u,i+=(s*e.c+n*e.d+e.worldY)*u}s[e]=r,s[e+1]=i}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),s.Aq.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=s.Aq.newFloatArray(this.vertices.length),s.Aq.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}}},4386:(t,e,r)=>{"use strict";r.d(e,{T:()=>Q});var s=r(4872),i=r(6675),n=r(5199),a=r(59),o=r(9739),l=r(9375),h=r(4696),c=r(6170),u=r(7694),d=r(6929),p=r(9390);class f{constructor(t=0,e=0,r=0){this.type="circle",this.x=t,this.y=e,this.radius=r}clone(){return new f(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let s=this.x-t,i=this.y-e;return s*=s,i*=i,s+i<=r}strokeContains(t,e,r,s=.5){if(0===this.radius)return!1;const i=this.x-t,n=this.y-e,a=this.radius,o=(1-s)*r,l=Math.sqrt(i*i+n*n);return l<=a+o&&l>a-(r-o)}getBounds(t){return t||(t=new p.M),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class m{constructor(t=0,e=0,r=0,s=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=r,this.halfHeight=s}clone(){return new m(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let r=(t-this.x)/this.halfWidth,s=(e-this.y)/this.halfHeight;return r*=r,s*=s,r+s<=1}strokeContains(t,e,r,s=.5){const{halfWidth:i,halfHeight:n}=this;if(i<=0||n<=0)return!1;const a=r*(1-s),o=r-a,l=i-o,h=n-o,c=i+a,u=n+a,d=t-this.x,p=e-this.y;return d*d/(l*l)+p*p/(h*h)>1&&d*d/(c*c)+p*p/(u*u)<=1}getBounds(t){return t||(t=new p.M),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=2*this.halfWidth,t.height=2*this.halfHeight,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function g(t,e,r,s,i,n){const a=i-r,o=n-s,l=a*a+o*o;let h,c,u=-1;0!==l&&(u=((t-r)*a+(e-s)*o)/l),u<0?(h=r,c=s):u>1?(h=i,c=n):(h=r+u*a,c=s+u*o);const d=t-h,p=e-c;return d*d+p*p}class x{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,r=e.length;for(let s=0;s<r;s+=2){const i=e[s],n=e[s+1];t+=(e[(s+2)%r]-i)*(e[(s+3)%r]+n)}return t<0}containsPolygon(t){const e=this.getBounds(void 0),r=t.getBounds(void 0);if(!e.containsRect(r))return!1;const s=t.points;for(let t=0;t<s.length;t+=2){const e=s[t],r=s[t+1];if(!this.contains(e,r))return!1}return!0}clone(){const t=this.points.slice(),e=new x(t);return e.closePath=this.closePath,e}contains(t,e){let r=!1;const s=this.points.length/2;for(let i=0,n=s-1;i<s;n=i++){const s=this.points[2*i],a=this.points[2*i+1],o=this.points[2*n],l=this.points[2*n+1];a>e!=l>e&&t<(e-a)/(l-a)*(o-s)+s&&(r=!r)}return r}strokeContains(t,e,r,s=.5){const i=r*r,n=i*(1-s),a=i-n,{points:o}=this,l=o.length-(this.closePath?0:2);for(let r=0;r<l;r+=2){const s=o[r],i=o[r+1],l=o[(r+2)%o.length],h=o[(r+3)%o.length];if(g(t,e,s,i,l,h)<=(Math.sign((l-s)*(e-i)-(h-i)*(t-s))<0?a:n))return!0}return!1}getBounds(t){t||(t=new p.M);const e=this.points;let r=1/0,s=-1/0,i=1/0,n=-1/0;for(let t=0,a=e.length;t<a;t+=2){const a=e[t],o=e[t+1];r=a<r?a:r,s=a>s?a:s,i=o<i?o:i,n=o>n?o:n}return t.x=r,t.width=s-r,t.y=i,t.height=n-i,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return(0,h.t6)("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return(0,h.t6)("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const y=(t,e,r,s,i,n,a)=>{const o=t-r,l=e-s,h=Math.sqrt(o*o+l*l);return h>=i-n&&h<=i+a};class v{constructor(t=0,e=0,r=0,s=0,i=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=r,this.height=s,this.radius=i}getBounds(t){return t||(t=new p.M),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new v(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;let s=t-(this.x+r),i=e-(this.y+r);const n=r*r;if(s*s+i*i<=n)return!0;if(s=t-(this.x+this.width-r),s*s+i*i<=n)return!0;if(i=e-(this.y+this.height-r),s*s+i*i<=n)return!0;if(s=t-(this.x+r),s*s+i*i<=n)return!0}return!1}strokeContains(t,e,r,s=.5){const{x:i,y:n,width:a,height:o,radius:l}=this,h=r*(1-s),c=r-h,u=i+l,d=n+l,p=i+a,f=n+o;return(t>=i-h&&t<=i+c||t>=p-c&&t<=p+h)&&e>=d&&e<=d+(o-2*l)||(e>=n-h&&e<=n+c||e>=f-c&&e<=f+h)&&t>=u&&t<=u+(a-2*l)||t<u&&e<d&&y(t,e,u,d,l,c,h)||t>p-l&&e<d&&y(t,e,p-l,d,l,c,h)||t>p-l&&e>f-l&&y(t,e,p-l,f-l,l,c,h)||t<u&&e>f-l&&y(t,e,u,f-l,l,c,h)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}var _=r(6364);const b=1.1920929e-7;function w(t,e,r,s,i,n,a,o,l,h){let c=(1-Math.min(.99,Math.max(0,h??_.GH.defaultOptions.bezierSmoothness)))/1;return c*=c,function(t,e,r,s,i,n,a,o,l,h){T(t,e,r,s,i,n,a,o,l,h,0),l.push(a,o)}(e,r,s,i,n,a,o,l,t,c),t}function T(t,e,r,s,i,n,a,o,l,h,c){if(c>8)return;Math.PI;const u=(t+r)/2,d=(e+s)/2,p=(r+i)/2,f=(s+n)/2,m=(i+a)/2,g=(n+o)/2,x=(u+p)/2,y=(d+f)/2,v=(p+m)/2,_=(f+g)/2,w=(x+v)/2,S=(y+_)/2;if(c>0){let c=a-t,u=o-e;const d=Math.abs((r-a)*u-(s-o)*c),p=Math.abs((i-a)*u-(n-o)*c);if(d>b&&p>b){if((d+p)*(d+p)<=h*(c*c+u*u))return void l.push(w,S)}else if(d>b){if(d*d<=h*(c*c+u*u))return void l.push(w,S)}else if(p>b){if(p*p<=h*(c*c+u*u))return void l.push(w,S)}else if(c=w-(t+a)/2,u=S-(e+o)/2,c*c+u*u<=h)return void l.push(w,S)}T(t,e,u,d,x,y,w,S,l,h,c+1),T(w,S,v,_,m,g,a,o,l,h,c+1)}function S(t,e,r,s,i,n,a,o){let l=(1-Math.min(.99,Math.max(0,o??_.GH.defaultOptions.bezierSmoothness)))/1;return l*=l,function(t,e,r,s,i,n,a,o){A(a,t,e,r,s,i,n,o,0),a.push(i,n)}(e,r,s,i,n,a,t,l),t}function A(t,e,r,s,i,n,a,o,l){if(l>8)return;Math.PI;const h=(e+s)/2,c=(r+i)/2,u=(s+n)/2,d=(i+a)/2,p=(h+u)/2,f=(c+d)/2;let m=n-e,g=a-r;const x=Math.abs((s-n)*g-(i-a)*m);if(x>1.1920929e-7){if(x*x<=o*(m*m+g*g))return void t.push(p,f)}else if(m=p-(e+n)/2,g=f-(r+a)/2,m*m+g*g<=o)return void t.push(p,f);A(t,e,r,h,c,p,f,o,l+1),A(t,p,f,u,d,n,a,o,l+1)}function C(t,e,r,s,i,n,a,o){let l=Math.abs(i-n);(!a&&i>n||a&&n>i)&&(l=2*Math.PI-l),o||(o=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(l/Math.PI))));let h=l/(o=Math.max(o,3)),c=i;h*=a?-1:1;for(let i=0;i<o+1;i++){const i=e+Math.cos(c)*s,n=r+Math.sin(c)*s;t.push(i,n),c+=h}}const P=2*Math.PI,E={centerX:0,centerY:0,ang1:0,ang2:0},M=({x:t,y:e},r,s,i,n,a,o,l)=>{const h=i*(t*=r)-n*(e*=s),c=n*t+i*e;return l.x=h+a,l.y=c+o,l};function k(t,e){const r=-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),s=1.5707963267948966===e?.551915024494:r,i=Math.cos(t),n=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:i-n*s,y:n+i*s},{x:a+o*s,y:o-a*s},{x:a,y:o}]}const R=(t,e,r,s)=>{let i=t*r+e*s;return i>1&&(i=1),i<-1&&(i=-1),(t*s-e*r<0?-1:1)*Math.acos(i)};const B=new p.M;class I{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new c.c,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const r=this._currentPoly.points,s=r[r.length-2],i=r[r.length-1];return s===t&&i===e||r.push(t,e),this}arc(t,e,r,s,i,n){return this._ensurePoly(!1),C(this._currentPoly.points,t,e,r,s,i,n),this}arcTo(t,e,r,s,i){return this._ensurePoly(),function(t,e,r,s,i,n){const a=t[t.length-2],o=t[t.length-1]-r,l=a-e,h=i-r,c=s-e,u=Math.abs(o*c-l*h);if(u<1e-8||0===n)return void(t[t.length-2]===e&&t[t.length-1]===r||t.push(e,r));const d=o*o+l*l,p=h*h+c*c,f=o*h+l*c,m=n*Math.sqrt(d)/u,g=n*Math.sqrt(p)/u,x=m*f/d,y=g*f/p,v=m*c+g*l,_=m*h+g*o,b=l*(g+x),w=o*(g+x),T=c*(m+y),S=h*(m+y);C(t,v+e,_+r,n,Math.atan2(w-_,b-v),Math.atan2(S-_,T-v),l*h>c*o)}(this._currentPoly.points,t,e,r,s,i),this}arcToSvg(t,e,r,s,i,n,a){return function(t,e,r,s,i,n,a,o=0,l=0,h=0){if(0===n||0===a)return;const c=Math.sin(o*P/360),u=Math.cos(o*P/360),d=u*(e-s)/2+c*(r-i)/2,p=-c*(e-s)/2+u*(r-i)/2;if(0===d&&0===p)return;n=Math.abs(n),a=Math.abs(a);const f=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(a,2);f>1&&(n*=Math.sqrt(f),a*=Math.sqrt(f)),((t,e,r,s,i,n,a,o,l,h,c,u,d)=>{const p=Math.pow(i,2),f=Math.pow(n,2),m=Math.pow(c,2),g=Math.pow(u,2);let x=p*f-p*g-f*m;x<0&&(x=0),x/=p*g+f*m,x=Math.sqrt(x)*(a===o?-1:1);const y=x*i/n*u,v=x*-n/i*c,_=h*y-l*v+(t+r)/2,b=l*y+h*v+(e+s)/2,w=(c-y)/i,T=(u-v)/n,S=(-c-y)/i,A=(-u-v)/n,C=R(1,0,w,T);let E=R(w,T,S,A);0===o&&E>0&&(E-=P),1===o&&E<0&&(E+=P),d.centerX=_,d.centerY=b,d.ang1=C,d.ang2=E})(e,r,s,i,n,a,l,h,c,u,d,p,E);let{ang1:m,ang2:g}=E;const{centerX:x,centerY:y}=E;let v=Math.abs(g)/(P/4);Math.abs(1-v)<1e-7&&(v=1);const _=Math.max(Math.ceil(v),1);g/=_;let b=t[t.length-2],T=t[t.length-1];const S={x:0,y:0};for(let e=0;e<_;e++){const e=k(m,g),{x:r,y:s}=M(e[0],n,a,u,c,x,y,S),{x:i,y:o}=M(e[1],n,a,u,c,x,y,S),{x:l,y:h}=M(e[2],n,a,u,c,x,y,S);w(t,b,T,r,s,i,o,l,h),b=l,T=h,m+=g}}(this._currentPoly.points,this._currentPoly.lastX,this._currentPoly.lastY,n,a,t,e,r,s,i),this}bezierCurveTo(t,e,r,s,i,n,a){this._ensurePoly();const o=this._currentPoly;return w(this._currentPoly.points,o.lastX,o.lastY,t,e,r,s,i,n,a),this}quadraticCurveTo(t,e,r,s,i){this._ensurePoly();const n=this._currentPoly;return S(this._currentPoly.points,n.lastX,n.lastY,t,e,r,s,i),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0)).transform(e);const r=this.shapePrimitives,s=r.length;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}if(t.checkForHoles&&r.length-s>1){let t=null;for(let e=s;e<r.length;e++){const s=r[e];if("polygon"===s.shape.type){const i=s.shape,n=t?.shape;n&&n.containsPolygon(i)?(t.holes||(t.holes=[]),t.holes.push(s),r.copyWithin(e,e+1),r.length--,e--):t=s}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,r,s,i){return this.drawShape(new p.M(t,e,r,s),i),this}circle(t,e,r,s){return this.drawShape(new f(t,e,r),s),this}poly(t,e,r){const s=new x(t);return s.closePath=e,this.drawShape(s,r),this}regularPoly(t,e,r,s,i=0,n){s=Math.max(0|s,3);const a=-1*Math.PI/2+i,o=2*Math.PI/s,l=[];for(let i=0;i<s;i++){const s=a-i*o;l.push(t+r*Math.cos(s),e+r*Math.sin(s))}return this.poly(l,!0,n),this}roundPoly(t,e,r,s,i,n=0,a){if(s=Math.max(0|s,3),i<=0)return this.regularPoly(t,e,r,s,n);const o=r*Math.sin(Math.PI/s)-.001;i=Math.min(i,o);const l=-1*Math.PI/2+n,h=2*Math.PI/s,c=(s-2)*Math.PI/s/2;for(let n=0;n<s;n++){const s=n*h+l,o=t+r*Math.cos(s),u=e+r*Math.sin(s),d=s+Math.PI+c,p=s-Math.PI-c,f=o+i*Math.cos(d),m=u+i*Math.sin(d),g=o+i*Math.cos(p),x=u+i*Math.sin(p);0===n?this.moveTo(f,m):this.lineTo(f,m),this.quadraticCurveTo(o,u,g,x,a)}return this.closePath()}roundShape(t,e,r=!1,s){return t.length<3?this:(r?function(t,e,r,s){const i=(t,e)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),n=(t,e,r)=>({x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}),a=e.length;for(let o=0;o<a;o++){const l=e[(o+1)%a],h=l.radius??r;if(h<=0){0===o?t.moveTo(l.x,l.y):t.lineTo(l.x,l.y);continue}const c=e[o],u=e[(o+2)%a],d=i(c,l);let p;p=d<1e-4?l:n(l,c,Math.min(d/2,h)/d);const f=i(u,l);let m;m=f<1e-4?l:n(l,u,Math.min(f/2,h)/f),0===o?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y),t.quadraticCurveTo(l.x,l.y,m.x,m.y,s)}}(this,t,e,s):function(t,e,r){const s=(t,e)=>{const r=e.x-t.x,s=e.y-t.y,i=Math.sqrt(r*r+s*s);return{len:i,nx:r/i,ny:s/i}},i=(e,r)=>{0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)};let n=e[e.length-1];for(let a=0;a<e.length;a++){const o=e[a%e.length],l=o.radius??r;if(l<=0){i(a,o),n=o;continue}const h=e[(a+1)%e.length],c=s(o,n),u=s(o,h);if(c.len<1e-4||u.len<1e-4){i(a,o),n=o;continue}let d=Math.asin(c.nx*u.ny-c.ny*u.nx),p=1,f=!1;c.nx*u.nx-c.ny*-u.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,p=-1,f=!0):d>0&&(p=-1,f=!0);const m=d/2;let g,x=Math.abs(Math.cos(m)*l/Math.sin(m));x>Math.min(c.len/2,u.len/2)?(x=Math.min(c.len/2,u.len/2),g=Math.abs(x*Math.sin(m)/Math.cos(m))):g=l;const y=o.x+u.nx*x+-u.ny*g*p,v=o.y+u.ny*x+u.nx*g*p,_=Math.atan2(c.ny,c.nx)+Math.PI/2*p,b=Math.atan2(u.ny,u.nx)-Math.PI/2*p;0===a&&t.moveTo(y+Math.cos(_)*g,v+Math.sin(_)*g),t.arc(y,v,g,_,b,f),n=o}}(this,t,e),this.closePath())}filletRect(t,e,r,s,i){if(0===i)return this.rect(t,e,r,s);const n=Math.min(r,s)/2,a=Math.min(n,Math.max(-n,i)),o=t+r,l=e+s,h=a<0?-a:0,c=Math.abs(a);return this.moveTo(t,e+c).arcTo(t+h,e+h,t+c,e,c).lineTo(o-c,e).arcTo(o-h,e+h,o,e+c,c).lineTo(o,l-c).arcTo(o-h,l-h,t+r-c,l,c).lineTo(t+c,l).arcTo(t+h,l-h,t,l-c,c).closePath()}chamferRect(t,e,r,s,i,n){if(i<=0)return this.rect(t,e,r,s);const a=Math.min(i,Math.min(r,s)/2),o=t+r,l=e+s,h=[t+a,e,o-a,e,o,e+a,o,l-a,o-a,l,t+a,l,t,l-a,t,e+a];for(let t=h.length-1;t>=2;t-=2)h[t]===h[t-2]&&h[t-1]===h[t-3]&&h.splice(t-1,2);return this.poly(h,!0,n)}ellipse(t,e,r,s,i){return this.drawShape(new m(t,e,r,s),i),this}roundRect(t,e,r,s,i,n){return this.drawShape(new v(t,e,r,s,i),n),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let r=this._currentPoly;return r&&this.endPoly(),r=new x,r.points.push(t,e),this._currentPoly=r,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new x,t)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let e=t.shape.x,r=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const s=t.transform,i=e;e=s.a*e+s.c*r+s.tx,r=s.b*i+s.d*r+s.ty}this._currentPoly.points.push(e,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let r=0;r<e.length;r++){const s=e[r],i=s.shape.getBounds(B);s.transform?t.addRect(i,s.transform):t.addRect(i)}return t}}class F{constructor(t,e=!1){this.instructions=[],this.uid=(0,l.L)("graphicsPath"),this._dirty=!0,this.checkForHoles=e,"string"==typeof t?function(t,e){const r=d(t),s=[];let i=null,n=0,a=0;for(let t=0;t<r.length;t++){const o=r[t],l=o[0],h=o;switch(l){case"M":n=h[1],a=h[2],e.moveTo(n,a);break;case"m":n+=h[1],a+=h[2],e.moveTo(n,a);break;case"H":n=h[1],e.lineTo(n,a);break;case"h":n+=h[1],e.lineTo(n,a);break;case"V":a=h[1],e.lineTo(n,a);break;case"v":a+=h[1],e.lineTo(n,a);break;case"L":n=h[1],a=h[2],e.lineTo(n,a);break;case"l":n+=h[1],a+=h[2],e.lineTo(n,a);break;case"C":n=h[5],a=h[6],e.bezierCurveTo(h[1],h[2],h[3],h[4],n,a);break;case"c":e.bezierCurveTo(n+h[1],a+h[2],n+h[3],a+h[4],n+h[5],a+h[6]),n+=h[5],a+=h[6];break;case"S":n=h[3],a=h[4],e.bezierCurveToShort(h[1],h[2],n,a);break;case"s":e.bezierCurveToShort(n+h[1],a+h[2],n+h[3],a+h[4]),n+=h[3],a+=h[4];break;case"Q":n=h[3],a=h[4],e.quadraticCurveTo(h[1],h[2],n,a);break;case"q":e.quadraticCurveTo(n+h[1],a+h[2],n+h[3],a+h[4]),n+=h[3],a+=h[4];break;case"T":n=h[1],a=h[2],e.quadraticCurveToShort(n,a);break;case"t":n+=h[1],a+=h[2],e.quadraticCurveToShort(n,a);break;case"A":n=h[6],a=h[7],e.arcToSvg(h[1],h[2],h[3],h[4],h[5],n,a);break;case"a":n+=h[6],a+=h[7],e.arcToSvg(h[1],h[2],h[3],h[4],h[5],n,a);break;case"Z":case"z":e.closePath(),s.length>0&&(i=s.pop(),i?(n=i.startX,a=i.startY):(n=0,a=0)),i=null;break;default:(0,u.R)(`Unknown SVG path command: ${l}`)}"Z"!==l&&"z"!==l&&null===i&&(i={startX:n,startY:a},s.push(i))}}(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new I(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,r,s,i){const n=this.instructions[this.instructions.length-1],o=this.getLastPoint(a.b.shared);let l=0,h=0;if(n&&"bezierCurveTo"===n.action){l=n.data[2],h=n.data[3];const t=o.x,e=o.y;l=t+(t-l),h=e+(e-h)}else l=o.x,h=o.y;return this.instructions.push({action:"bezierCurveTo",data:[l,h,t,e,r,s,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,r){const s=this.instructions[this.instructions.length-1],i=this.getLastPoint(a.b.shared);let n=0,o=0;if(s&&"quadraticCurveTo"===s.action){n=s.data[0],o=s.data[1];const t=i.x,e=i.y;n=t+(t-n),o=e+(e-o)}else n=i.x,o=i.y;return this.instructions.push({action:"quadraticCurveTo",data:[n,o,t,e,r]}),this._dirty=!0,this}rect(t,e,r,s,i){return this.instructions.push({action:"rect",data:[t,e,r,s,i]}),this._dirty=!0,this}circle(t,e,r,s){return this.instructions.push({action:"circle",data:[t,e,r,s]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,r,s,i,n,a){i||(i=s/2);const o=-1*Math.PI/2+n,l=2*r,h=2*Math.PI/l,c=[];for(let r=0;r<l;r++){const n=r%2?i:s,a=r*h+o;c.push(t+n*Math.cos(a),e+n*Math.sin(a))}return this.poly(c,!0,a),this}clone(t=!1){const e=new F;if(e.checkForHoles=this.checkForHoles,t)for(let t=0;t<this.instructions.length;t++){const r=this.instructions[t];e.instructions.push({action:r.action,data:r.data.slice()})}else e.instructions=this.instructions.slice();return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,r=t.b,s=t.c,i=t.d,n=t.tx,a=t.ty;let o=0,l=0,h=0,c=0,d=0,p=0,f=0,m=0;for(let g=0;g<this.instructions.length;g++){const x=this.instructions[g],y=x.data;switch(x.action){case"moveTo":case"lineTo":o=y[0],l=y[1],y[0]=e*o+s*l+n,y[1]=r*o+i*l+a;break;case"bezierCurveTo":h=y[0],c=y[1],d=y[2],p=y[3],o=y[4],l=y[5],y[0]=e*h+s*c+n,y[1]=r*h+i*c+a,y[2]=e*d+s*p+n,y[3]=r*d+i*p+a,y[4]=e*o+s*l+n,y[5]=r*o+i*l+a;break;case"quadraticCurveTo":h=y[0],c=y[1],o=y[2],l=y[3],y[0]=e*h+s*c+n,y[1]=r*h+i*c+a,y[2]=e*o+s*l+n,y[3]=r*o+i*l+a;break;case"arcToSvg":o=y[5],l=y[6],f=y[0],m=y[1],y[0]=e*f+s*m,y[1]=r*f+i*m,y[5]=e*o+s*l+n,y[6]=r*o+i*l+a;break;case"circle":y[4]=O(y[3],t);break;case"rect":y[4]=O(y[4],t);break;case"ellipse":y[8]=O(y[8],t);break;case"roundRect":y[5]=O(y[5],t);break;case"addPath":y[0].transform(t);break;case"poly":y[2]=O(y[2],t);break;default:(0,u.R)("unknown transform action",x.action)}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,r=this.instructions[e];if(!r)return t.x=0,t.y=0,t;for(;"closePath"===r.action;){if(e--,e<0)return t.x=0,t.y=0,t;r=this.instructions[e]}switch(r.action){case"moveTo":case"lineTo":t.x=r.data[0],t.y=r.data[1];break;case"quadraticCurveTo":t.x=r.data[2],t.y=r.data[3];break;case"bezierCurveTo":t.x=r.data[4],t.y=r.data[5];break;case"arc":case"arcToSvg":t.x=r.data[5],t.y=r.data[6];break;case"addPath":r.data[0].getLastPoint(t)}return t}}function O(t,e){return t?t.prepend(e):e.clone()}var G=r(6406);function D(t,e,r){const s=t.getAttribute(e);return s?Number(s):r}function U(t){const e=D(t,"x1",0),r=D(t,"y1",0),s=D(t,"x2",1),n=D(t,"y2",0),a=t.getAttribute("gradientUnits")||"objectBoundingBox",o=new G._(e,r,s,n,"objectBoundingBox"===a?"local":"global");for(let e=0;e<t.children.length;e++){const r=t.children[e],s=D(r,"offset",0),n=i.Q.shared.setValue(r.getAttribute("stop-color")).toNumber();o.addColorStop(s,n)}return o}function L(t){return(0,u.R)("[SVG Parser] Radial gradients are not yet supported"),new G._(0,0,1,0)}function N(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const X={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function V(t,e){const r=t.getAttribute("style"),s={},i={},n={strokeStyle:s,fillStyle:i,useFill:!1,useStroke:!1};for(const r in X){const s=t.getAttribute(r);s&&Y(e,n,r,s.trim())}if(r){const t=r.split(";");for(let r=0;r<t.length;r++){const s=t[r].trim(),[i,a]=s.split(":");X[i]&&Y(e,n,i,a.trim())}}return{strokeStyle:n.useStroke?s:null,fillStyle:n.useFill?i:null,useFill:n.useFill,useStroke:n.useStroke}}function Y(t,e,r,s){switch(r){case"stroke":if("none"!==s){if(s.startsWith("url(")){const r=N(s);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=i.Q.shared.setValue(s).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(s);break;case"fill":if("none"!==s){if(s.startsWith("url(")){const r=N(s);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=i.Q.shared.setValue(s).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(s);break;case"stroke-opacity":e.strokeStyle.alpha=Number(s);break;case"opacity":e.fillStyle.alpha=Number(s),e.strokeStyle.alpha=Number(s)}}function z(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const r=e.map(Number),s=[],i=[];for(let t=0;t<r.length;t+=2)t+1<r.length&&(s.push(r[t]),i.push(r[t+1]));if(0===s.length||0===i.length)return 0;const n=Math.min(...s),a=Math.max(...s),o=Math.min(...i);return(a-n)*(Math.max(...i)-o)}function W(t,e){const r=new F(t,!1);for(const t of r.instructions)e.instructions.push(t)}function H(t,e,r,s){const i=t.children,{fillStyle:n,strokeStyle:a}=V(t,e);n&&r?r={...r,...n}:n&&(r=n),a&&s?s={...s,...a}:a&&(s=a);const o=!r&&!s;let l,h,c,d,p,f,m,g,x,y,v,_,b,w,T,S,A;switch(o&&(r={color:0}),t.nodeName.toLowerCase()){case"path":{w=t.getAttribute("d");const i=t.getAttribute("fill-rule"),n=w.split(/(?=[Mm])/).filter(t=>t.trim().length>0),a="evenodd"===i,o=n.length>1;if(a&&o){const t=n.map(t=>({path:t,area:z(t)}));t.sort((t,e)=>e.area-t.area);const i=n.length>3||!function(t){if(t.length<=2)return!0;const e=t.map(t=>t.area).sort((t,e)=>e-t),[r,s]=e,i=e[e.length-1];return!(r/s>3&&s/i<2)}(t);if(i)for(let i=0;i<t.length;i++){const n=t[i],a=0===i;e.context.beginPath();const o=new F(void 0,!0);W(n.path,o),e.context.path(o),a?(r&&e.context.fill(r),s&&e.context.stroke(s)):e.context.cut()}else for(let i=0;i<t.length;i++){const n=t[i],a=i%2==1;e.context.beginPath();const o=new F(void 0,!0);W(n.path,o),e.context.path(o),a?e.context.cut():(r&&e.context.fill(r),s&&e.context.stroke(s))}}else T=new F(w,!i||"evenodd"===i),e.context.path(T),r&&e.context.fill(r),s&&e.context.stroke(s);break}case"circle":m=D(t,"cx",0),g=D(t,"cy",0),x=D(t,"r",0),e.context.ellipse(m,g,x,x),r&&e.context.fill(r),s&&e.context.stroke(s);break;case"rect":l=D(t,"x",0),h=D(t,"y",0),S=D(t,"width",0),A=D(t,"height",0),y=D(t,"rx",0),v=D(t,"ry",0),y||v?e.context.roundRect(l,h,S,A,y||v):e.context.rect(l,h,S,A),r&&e.context.fill(r),s&&e.context.stroke(s);break;case"ellipse":m=D(t,"cx",0),g=D(t,"cy",0),y=D(t,"rx",0),v=D(t,"ry",0),e.context.beginPath(),e.context.ellipse(m,g,y,v),r&&e.context.fill(r),s&&e.context.stroke(s);break;case"line":c=D(t,"x1",0),d=D(t,"y1",0),p=D(t,"x2",0),f=D(t,"y2",0),e.context.beginPath(),e.context.moveTo(c,d),e.context.lineTo(p,f),s&&e.context.stroke(s);break;case"polygon":b=t.getAttribute("points"),_=b.match(/\d+/g).map(t=>parseInt(t,10)),e.context.poly(_,!0),r&&e.context.fill(r),s&&e.context.stroke(s);break;case"polyline":b=t.getAttribute("points"),_=b.match(/\d+/g).map(t=>parseInt(t,10)),e.context.poly(_,!1),s&&e.context.stroke(s);break;case"g":case"svg":break;default:(0,u.R)(`[SVG parser] <${t.nodeName}> elements unsupported`)}o&&(r=null);for(let t=0;t<i.length;t++)H(i[t],e,r,s)}var j=r(5024);const q=new a.b,$=new n.u,K=class t extends s.A{constructor(){super(...arguments),this.uid=(0,l.L)("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new F,this._transform=new n.u,this._fillStyle={...t.defaultFillStyle},this._strokeStyle={...t.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new c.c,this._boundsDirty=!0}clone(){const e=new t;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=(0,j.w)(e,t.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=(0,j.T)(e,t.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=(0,j.w)(e,t.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=(0,j.w)(e,t.defaultStrokeStyle),this}texture(t,e,r,s,n,a){return this.instructions.push({action:"texture",data:{image:t,dx:r||0,dy:s||0,dw:n||t.frame.width,dh:a||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e?i.Q.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new F,this}fill(e,r){let s;const i=this.instructions[this.instructions.length-1];return s=0===this._tick&&i&&"stroke"===i.action?i.data.path:this._activePath.clone(),s?(null!=e&&(void 0!==r&&"number"==typeof e&&((0,h.t6)(h.lj,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:r}),this._fillStyle=(0,j.w)(e,t.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(a.b.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(e){let r;const s=this.instructions[this.instructions.length-1];return r=0===this._tick&&s&&"fill"===s.action?s.data.path:this._activePath.clone(),r?(null!=e&&(this._strokeStyle=(0,j.T)(e,t.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],r=this._activePath.clone();if(e&&("stroke"===e.action||"fill"===e.action)){if(!e.data.hole){e.data.hole=r;break}e.data.hole.addPath(r)}}return this._initNextPathLocation(),this}arc(t,e,r,s,i,n){this._tick++;const a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,r,s,i,n),this}arcTo(t,e,r,s,i){this._tick++;const n=this._transform;return this._activePath.arcTo(n.a*t+n.c*e+n.tx,n.b*t+n.d*e+n.ty,n.a*r+n.c*s+n.tx,n.b*r+n.d*s+n.ty,i),this}arcToSvg(t,e,r,s,i,n,a){this._tick++;const o=this._transform;return this._activePath.arcToSvg(t,e,r,s,i,o.a*n+o.c*a+o.tx,o.b*n+o.d*a+o.ty),this}bezierCurveTo(t,e,r,s,i,n,a){this._tick++;const o=this._transform;return this._activePath.bezierCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*r+o.c*s+o.tx,o.b*r+o.d*s+o.ty,o.a*i+o.c*n+o.tx,o.b*i+o.d*n+o.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,r,s){return this._tick++,this._activePath.ellipse(t,e,r,s,this._transform.clone()),this}circle(t,e,r){return this._tick++,this._activePath.circle(t,e,r,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const r=this._transform;return this._activePath.lineTo(r.a*t+r.c*e+r.tx,r.b*t+r.d*e+r.ty),this}moveTo(t,e){this._tick++;const r=this._transform,s=this._activePath.instructions,i=r.a*t+r.c*e+r.tx,n=r.b*t+r.d*e+r.ty;return 1===s.length&&"moveTo"===s[0].action?(s[0].data[0]=i,s[0].data[1]=n,this):(this._activePath.moveTo(i,n),this)}quadraticCurveTo(t,e,r,s,i){this._tick++;const n=this._transform;return this._activePath.quadraticCurveTo(n.a*t+n.c*e+n.tx,n.b*t+n.d*e+n.ty,n.a*r+n.c*s+n.tx,n.b*r+n.d*s+n.ty,i),this}rect(t,e,r,s){return this._tick++,this._activePath.rect(t,e,r,s,this._transform.clone()),this}roundRect(t,e,r,s,i){return this._tick++,this._activePath.roundRect(t,e,r,s,i,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,r,s,i=0,n){return this._tick++,this._activePath.regularPoly(t,e,r,s,i,n),this}roundPoly(t,e,r,s,i,n){return this._tick++,this._activePath.roundPoly(t,e,r,s,i,n),this}roundShape(t,e,r,s){return this._tick++,this._activePath.roundShape(t,e,r,s),this}filletRect(t,e,r,s,i){return this._tick++,this._activePath.filletRect(t,e,r,s,i),this}chamferRect(t,e,r,s,i,n){return this._tick++,this._activePath.chamferRect(t,e,r,s,i,n),this}star(t,e,r,s,i=0,n=0){return this._tick++,this._activePath.star(t,e,r,s,i,n,this._transform.clone()),this}svg(t){return this._tick++,function(t,e){if("string"==typeof t){const e=document.createElement("div");e.innerHTML=t.trim(),t=e.querySelector("svg")}const r={context:e,defs:{},path:new F};!function(t,e){const r=t.querySelectorAll("defs");for(let t=0;t<r.length;t++){const s=r[t];for(let t=0;t<s.children.length;t++){const r=s.children[t];switch(r.nodeName.toLowerCase()){case"lineargradient":e.defs[r.id]=U(r);break;case"radialgradient":e.defs[r.id]=L()}}}}(t,r);const s=t.children,{fillStyle:i,strokeStyle:n}=V(t,r);for(let t=0;t<s.length;t++){const e=s[t];"defs"!==e.nodeName.toLowerCase()&&H(e,r,i,n)}}(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,r,s,i,a){return t instanceof n.u?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,r,s,i,a),this)}transform(t,e,r,s,i,a){return t instanceof n.u?(this._transform.append(t),this):($.set(t,e,r,s,i,a),this._transform.append($),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=!0,this._boundsDirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const r=this.instructions[e],s=r.action;if("fill"===s){const e=r.data;t.addBounds(e.path.bounds)}else if("texture"===s){const e=r.data;t.addFrame(e.dx,e.dy,e.dx+e.dw,e.dy+e.dh,e.transform)}if("stroke"===s){const e=r.data,s=e.style.alignment,i=e.style.width*(1-s),n=e.path.bounds;t.addFrame(n.minX-i,n.minY-i,n.maxX+i,n.maxY+i)}}return t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let r=!1;for(let s=0;s<e.length;s++){const i=e[s],n=i.data,a=n.path;if(!i.action||!a)continue;const o=n.style,l=a.shapePath.shapePrimitives;for(let e=0;e<l.length;e++){const s=l[e].shape;if(!o||!s)continue;const a=l[e].transform,h=a?a.applyInverse(t,q):t;if("fill"===i.action)r=s.contains(h.x,h.y);else{const t=o;r=s.strokeContains(h.x,h.y,t.width,t.alignment)}const c=n.hole;if(c){const t=c.shapePath?.shapePrimitives;if(t)for(let e=0;e<t.length;e++)t[e].shape.contains(h.x,h.y)&&(r=!1)}if(r)return!0}}return r}destroy(t=!1){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(e)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(e))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};K.defaultFillStyle={color:16777215,alpha:1,texture:o.g.WHITE,matrix:null,fill:null,textureSpace:"local"},K.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:o.g.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Q=K},4403:(t,e,r)=>{"use strict";r.d(e,{a:()=>s});class s{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}},4404:(t,e,r)=>{"use strict";r.d(e,{J:()=>_});var s=r(1065),i=r(656),n=r(1579),a=r(9798),o=r(8337);const l=new Float32Array(1),h=new Uint32Array(1);class c extends o.V{constructor(){const t=new n.h({data:l,label:"attribute-batch-buffer",usage:a.S.VERTEX|a.S.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:24,offset:0},aUV:{buffer:t,format:"float32x2",stride:24,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:24,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:24,offset:20}},indexBuffer:new n.h({data:h,label:"index-batch-buffer",usage:a.S.INDEX|a.S.COPY_DST,shrinkToFit:!1})})}}var u=r(9677),d=r(2305),p=r(1570),f=r(7335),m=r(2478),g=r(1657);class x extends g.M{constructor(t){super({glProgram:(0,u.I)({name:"batch",bits:[d.a,(0,p.P)(t),f.m]}),gpuProgram:(0,u.v)({name:"batch",bits:[d.F,(0,p._)(t),f.b]}),resources:{batchSamplers:(0,m.n)(t)}})}}let y=null;const v=class t extends i.i{constructor(e){super(e),this.geometry=new c,this.name=t.extension.name,this.vertexSize=6,y??(y=new x(e.maxTextures)),this.shader=y}packAttributes(t,e,r,s,i){const n=i<<16|65535&t.roundPixels,a=t.transform,o=a.a,l=a.b,h=a.c,c=a.d,u=a.tx,d=a.ty,{positions:p,uvs:f}=t,m=t.color,g=t.attributeOffset,x=g+t.attributeSize;for(let t=g;t<x;t++){const i=2*t,a=p[i],g=p[i+1];e[s++]=o*a+h*g+u,e[s++]=c*g+l*a+d,e[s++]=f[i],e[s++]=f[i+1],r[s++]=m,r[s++]=n}}packQuadAttributes(t,e,r,s,i){const n=t.texture,a=t.transform,o=a.a,l=a.b,h=a.c,c=a.d,u=a.tx,d=a.ty,p=t.bounds,f=p.maxX,m=p.minX,g=p.maxY,x=p.minY,y=n.uvs,v=t.color,_=i<<16|65535&t.roundPixels;e[s+0]=o*m+h*x+u,e[s+1]=c*x+l*m+d,e[s+2]=y.x0,e[s+3]=y.y0,r[s+4]=v,r[s+5]=_,e[s+6]=o*f+h*x+u,e[s+7]=c*x+l*f+d,e[s+8]=y.x1,e[s+9]=y.y1,r[s+10]=v,r[s+11]=_,e[s+12]=o*f+h*g+u,e[s+13]=c*g+l*f+d,e[s+14]=y.x2,e[s+15]=y.y2,r[s+16]=v,r[s+17]=_,e[s+18]=o*m+h*g+u,e[s+19]=c*g+l*m+d,e[s+20]=y.x3,e[s+21]=y.y3,r[s+22]=v,r[s+23]=_}};v.extension={type:[s.Ag.Batcher],name:"default"};let _=v},4405:(t,e,r)=>{"use strict";r.d(e,{Ls:()=>s,_Q:()=>i,mA:()=>n});const s={name:"local-uniform-bit",vertex:{header:"\n\n struct LocalUniforms {\n uTransformMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n }\n\n @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ",main:"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ",end:"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "}},i={...s,vertex:{...s.vertex,header:s.vertex.header.replace("group(1)","group(2)")}},n={name:"local-uniform-bit",vertex:{header:"\n\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ",main:"\n vColor *= uColor;\n modelMatrix = uTransformMatrix;\n ",end:"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "}}},4419:(t,e,r)=>{"use strict";r.d(e,{oA:()=>a});var s,i=r(1984),n=r(1347);class a{static _emptyAnimation=new i.X5("<empty>",[],0);static emptyAnimation(){return a._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new l(this);propertyIDs=new n.eE;animationsChanged=!1;trackEntryPool=new n.bC(()=>new o);constructor(t){this.data=t}update(t){t*=this.timeScale;let e=this.tracks;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(!s)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let i=t*s.timeScale;if(s.delay>0){if(s.delay-=i,s.delay>0)continue;i=-s.delay,s.delay=0}let n=s.next;if(n){let e=s.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*n.timeScale,s.trackTime+=i,this.setCurrent(r,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[r]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=i}this.queue.drain()}updateMixingFrom(t,e){let r=t.mixingFrom;if(!r)return!0;let s=this.updateMixingFrom(r,e);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,-1!=t.nextTrackLast&&t.mixTime>=t.mixDuration?(0!=r.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=r.mixingFrom,null!=r.mixingFrom&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),s):(r.trackTime+=e*r.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,r=this.tracks,s=!1;for(let o=0,l=r.length;o<l;o++){let l=r[o];if(!l||l.delay>0)continue;s=!0;let c=0==o?i.qU.first:l.mixBlend,u=l.alpha;l.mixingFrom?u*=this.applyMixingFrom(l,t,c):l.trackTime>=l.trackEnd&&!l.next&&(u=0);let d=u>=l.alphaAttachmentThreshold,p=l.animationLast,f=l.getAnimationTime(),m=f,g=e;l.reverse&&(m=l.animation.duration-m,g=null);let x=l.animation.timelines,y=x.length;if(0==o&&1==u||c==i.qU.add){0==o&&(d=!0);for(let e=0;e<y;e++){n.Aq.webkit602BugfixHelper(u,c);var a=x[e];a instanceof i.zK?this.applyAttachmentTimeline(a,t,m,c,d):a.apply(t,p,m,g,u,c,i.mj.mixIn)}}else{let e=l.timelineMode,r=l.shortestRotation,s=!r&&l.timelinesRotation.length!=y<<1;s&&(l.timelinesRotation.length=y<<1);for(let a=0;a<y;a++){let o=x[a],f=e[a]==h?c:i.qU.setup;!r&&o instanceof i.NQ?this.applyRotateTimeline(o,t,m,u,f,l.timelinesRotation,a<<1,s):o instanceof i.zK?this.applyAttachmentTimeline(o,t,m,c,d):(n.Aq.webkit602BugfixHelper(u,c),o.apply(t,p,m,g,u,f,i.mj.mixIn))}}this.queueEvents(l,f),e.length=0,l.nextAnimationLast=f,l.nextTrackLast=l.trackTime}for(var o=this.unkeyedState+f,l=t.slots,c=0,u=t.slots.length;c<u;c++){var d=l[c];if(d.attachmentState==o){var p=d.data.attachmentName;d.setAttachment(p?t.getAttachment(d.data.index,p):null)}}return this.unkeyedState+=2,this.queue.drain(),s}applyMixingFrom(t,e,r){let s=t.mixingFrom;s.mixingFrom&&this.applyMixingFrom(s,e,r);let a=0;0==t.mixDuration?(a=1,r==i.qU.first&&(r=i.qU.setup)):(a=t.mixTime/t.mixDuration,a>1&&(a=1),r!=i.qU.first&&(r=s.mixBlend));let o=a<s.mixAttachmentThreshold,l=a<s.mixDrawOrderThreshold,p=s.animation.timelines,f=p.length,m=s.alpha*t.interruptAlpha,g=m*(1-a),x=s.animationLast,y=s.getAnimationTime(),v=y,_=null;if(s.reverse?v=s.animation.duration-v:a<s.eventThreshold&&(_=this.events),r==i.qU.add)for(let t=0;t<f;t++)p[t].apply(e,x,v,_,g,r,i.mj.mixOut);else{let t=s.timelineMode,a=s.timelineHoldMix,y=s.shortestRotation,b=!y&&s.timelinesRotation.length!=f<<1;b&&(s.timelinesRotation.length=f<<1),s.totalAlpha=0;for(let w=0;w<f;w++){let f,T=p[w],S=i.mj.mixOut,A=0;switch(t[w]){case h:if(!l&&T instanceof i.Kn)continue;f=r,A=g;break;case c:f=i.qU.setup,A=g;break;case u:f=r,A=m;break;case d:f=i.qU.setup,A=m;break;default:f=i.qU.setup;let t=a[w];A=m*Math.max(0,1-t.mixTime/t.mixDuration)}s.totalAlpha+=A,!y&&T instanceof i.NQ?this.applyRotateTimeline(T,e,v,A,f,s.timelinesRotation,w<<1,b):T instanceof i.zK?this.applyAttachmentTimeline(T,e,v,f,o&&A>=s.alphaAttachmentThreshold):(n.Aq.webkit602BugfixHelper(A,r),l&&T instanceof i.Kn&&f==i.qU.setup&&(S=i.mj.mixIn),T.apply(e,x,v,_,A,f,S))}}return t.mixDuration>0&&this.queueEvents(s,y),this.events.length=0,s.nextAnimationLast=y,s.nextTrackLast=s.trackTime,a}applyAttachmentTimeline(t,e,r,s,n){var a=e.slots[t.slotIndex];a.bone.active&&(r<t.frames[0]?s!=i.qU.setup&&s!=i.qU.first||this.setAttachment(e,a,a.data.attachmentName,n):this.setAttachment(e,a,t.attachmentNames[i.Kf.search1(t.frames,r)],n),a.attachmentState<=this.unkeyedState&&(a.attachmentState=this.unkeyedState+f))}setAttachment(t,e,r,s){e.setAttachment(r?t.getAttachment(e.data.index,r):null),s&&(e.attachmentState=this.unkeyedState+m)}applyRotateTimeline(t,e,r,s,a,o,l,h){if(h&&(o[l]=0),1==s)return void t.apply(e,0,r,null,1,a,i.mj.mixIn);let c=e.bones[t.boneIndex];if(!c.active)return;let u=0,d=0;if(r<t.frames[0])switch(a){case i.qU.setup:c.rotation=c.data.rotation;default:return;case i.qU.first:u=c.rotation,d=c.data.rotation}else u=a==i.qU.setup?c.data.rotation:c.rotation,d=c.data.rotation+t.getCurveValue(r);let p=0,f=d-u;if(f-=360*Math.ceil(f/360-.5),0==f)p=o[l];else{let t=0,e=0;h?(t=0,e=f):(t=o[l],e=o[l+1]);let r=t-t%360;p=f+r;let s=f>=0,i=t>=0;Math.abs(e)<=90&&n.cj.signum(e)!=n.cj.signum(f)&&(Math.abs(t-r)>180?(p+=360*n.cj.signum(t),i=s):0!=r?p-=360*n.cj.signum(t):i=s),i!=s&&(p+=360*n.cj.signum(t)),o[l]=p}o[l+1]=f,c.rotation=u+p*s}queueEvents(t,e){let r=t.animationStart,s=t.animationEnd,i=s-r,n=t.trackLast%i,a=this.events,o=0,l=a.length;for(;o<l;o++){let e=a[o];if(e.time<n)break;e.time>s||this.queue.event(t,e)}let h=!1;if(t.loop)if(0==i)h=!0;else{const e=Math.floor(t.trackTime/i);h=e>0&&e>Math.floor(t.trackLast/i)}else h=e>=s&&t.animationLast<s;for(h&&this.queue.complete(t);o<l;o++){let e=a[o];e.time<r||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let r=e;for(;;){let t=r.mixingFrom;if(!t)break;this.queue.end(t),r.mixingFrom=null,r.mixingTo=null,r=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,r){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(r&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,r=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,r)}setAnimationWith(t,e,r=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,i=this.expandToIndex(t);i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.clearNext(i),i=i.mixingFrom,s=!1):this.clearNext(i));let n=this.trackEntry(t,e,r,i);return this.setCurrent(t,n,s),this.queue.drain(),n}addAnimation(t,e,r=!1,s=0){let i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,r,s)}addAnimationWith(t,e,r=!1,s=0){if(!e)throw new Error("animation cannot be null.");let i=this.expandToIndex(t);if(i)for(;i.next;)i=i.next;let n=this.trackEntry(t,e,r,i);return i?(i.next=n,n.previous=i,s<=0&&(s=Math.max(s+i.getTrackComplete()-n.mixDuration,0))):(this.setCurrent(t,n,!0),this.queue.drain(),s<0&&(s=0)),n.delay=s,n}setEmptyAnimation(t,e=0){let r=this.setAnimationWith(t,a.emptyAnimation(),!1);return r.mixDuration=e,r.trackEnd=e,r}addEmptyAnimation(t,e=0,r=0){let s=this.addAnimationWith(t,a.emptyAnimation(),!1,r);return r<=0&&(s.delay=Math.max(s.delay+s.mixDuration-e,0)),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,r=this.tracks.length;e<r;e++){let r=this.tracks[e];r&&this.setEmptyAnimation(r.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(n.Aq.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,r,s){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=r,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=s?this.data.getMix(s.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=i.qU.replace,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r){for(;r.mixingFrom;)r=r.mixingFrom;do{r.mixingTo&&r.mixBlend==i.qU.add||this.computeHold(r),r=r.mixingTo}while(r)}}}computeHold(t){let e=t.mixingTo,r=t.animation.timelines,s=t.animation.timelines.length,n=t.timelineMode;n.length=s;let a=t.timelineHoldMix;a.length=0;let o=this.propertyIDs;if(e&&e.holdPrevious)for(let t=0;t<s;t++)n[t]=o.addAll(r[t].getPropertyIds())?d:u;else t:for(let l=0;l<s;l++){let s=r[l],u=s.getPropertyIds();if(o.addAll(u))if(!e||s instanceof i.zK||s instanceof i.Kn||s instanceof i.qs||!e.animation.hasTimeline(u))n[l]=c;else{for(let r=e.mixingTo;r;r=r.mixingTo)if(!r.animation.hasTimeline(u)){if(t.mixDuration>0){n[l]=p,a[l]=r;continue t}break}n[l]=d}else n[l]=h}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}class o{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(t){this._mixDuration=t}setMixDurationWithDelay(t,e){this._mixDuration=t,e<=0&&(e=null!=this.previous?Math.max(e+this.previous.getTrackComplete()-t,0):0),this.delay=e}mixBlend=i.qU.replace;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}wasApplied(){return-1!=this.nextTrackLast}isNextReady(){return null!=this.next&&this.nextTrackLast-this.next.delay>=0}}class l{objects=[];drainDisabled=!1;animState;constructor(t){this.animState=t}start(t){this.objects.push(s.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(s.interrupt),this.objects.push(t)}end(t){this.objects.push(s.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(s.dispose),this.objects.push(t)}complete(t){this.objects.push(s.complete),this.objects.push(t)}event(t,e){this.objects.push(s.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let r=0;r<t.length;r+=2){let i=t[r],n=t[r+1];switch(i){case s.start:n.listener&&n.listener.start&&n.listener.start(n);for(let t=0;t<e.length;t++){let r=e[t];r.start&&r.start(n)}break;case s.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let t=0;t<e.length;t++){let r=e[t];r.interrupt&&r.interrupt(n)}break;case s.end:n.listener&&n.listener.end&&n.listener.end(n);for(let t=0;t<e.length;t++){let r=e[t];r.end&&r.end(n)}case s.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let t=0;t<e.length;t++){let r=e[t];r.dispose&&r.dispose(n)}this.animState.trackEntryPool.free(n);break;case s.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let t=0;t<e.length;t++){let r=e[t];r.complete&&r.complete(n)}break;case s.event:let i=t[2+r++];n.listener&&n.listener.event&&n.listener.event(n,i);for(let t=0;t<e.length;t++){let r=e[t];r.event&&r.event(n,i)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}!function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(s||(s={}));const h=0,c=1,u=2,d=3,p=4,f=1,m=2},4449:(t,e,r)=>{"use strict";r.d(e,{k:()=>h});var s=r(9375),i=r(8642);const n=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],a=n.reduce((t,e)=>(t[e]=!0,t),{});function o(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const l=class t{constructor(e,r){this._touched=0,this.uid=(0,s.L)("uniform"),this._resourceType="uniformGroup",this._resourceId=(0,s.L)("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,r={...t.defaultOptions,...r},this.uniformStructures=e;const l={};for(const t in e){const r=e[t];if(r.name=t,r.size=r.size??1,!a[r.type]){const t=r.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(t){const[,e,s]=t;throw new Error(`Uniform type ${r.type} is not supported. Use type: '${e}', size: ${s} instead.`)}throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${n.join(", ")}`)}r.value??(r.value=o(r.type,r.size)),l[t]=r.value}this.uniforms=l,this._dirtyId=1,this.ubo=r.ubo,this.isStatic=r.isStatic,this._signature=(0,i.X)(Object.keys(l).map(t=>`${t}-${e[t].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};l.defaultOptions={ubo:!1,isStatic:!1};let h=l},4454:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var s=r(4696),i=r(4543),n=r(4386);class a extends i.l{constructor(t){t instanceof n.T&&(t={context:t});const{context:e,roundPixels:r,...s}=t||{};super({label:"Graphics",...s}),this.renderPipeId="graphics",this._context=e||(this._ownedContext=new n.T),this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=r??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):!0!==t&&!0!==t?.context||this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new a(this._context.clone()):(this._ownedContext=null,new a(this._context))}lineStyle(t,e,r){(0,s.t6)(s.lj,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const i={};return t&&(i.width=t),e&&(i.color=e),r&&(i.alpha=r),this.context.strokeStyle=i,this}beginFill(t,e){(0,s.t6)(s.lj,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const r={};return void 0!==t&&(r.color=t),void 0!==e&&(r.alpha=e),this.context.fillStyle=r,this}endFill(){(0,s.t6)(s.lj,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return t.width===n.T.defaultStrokeStyle.width&&t.color===n.T.defaultStrokeStyle.color&&t.alpha===n.T.defaultStrokeStyle.alpha||this.context.stroke(),this}drawCircle(...t){return(0,s.t6)(s.lj,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return(0,s.t6)(s.lj,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return(0,s.t6)(s.lj,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return(0,s.t6)(s.lj,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return(0,s.t6)(s.lj,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return(0,s.t6)(s.lj,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}},4543:(t,e,r)=>{"use strict";r.d(e,{l:()=>n});var s=r(6170),i=r(4687);class n extends i.mc{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new s.c(0,1,0,0),this._boundsDirty=!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:r,y:s}=t;return r>=e.minX&&r<=e.maxX&&s>=e.minY&&s<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}destroy(t){super.destroy(t),this._bounds=null;for(const t in this._gpuData)this._gpuData[t].destroy?.();this._gpuData=null}collectRenderablesSimple(t,e,r){const{renderPipes:s}=e;s.blendMode.pushBlendMode(this,this.groupBlendMode,t),s[this.renderPipeId].addRenderable(this,t),this.didViewUpdate=!1;const i=this.children,n=i.length;for(let s=0;s<n;s++)i[s].collectRenderables(t,e,r);s.blendMode.popBlendMode(t)}}},4550:(t,e,r)=>{"use strict";var s=r(1065),i=r(1228),n=r(4696),a=r(1174);const o=class t extends a.u{constructor(...t){super({});let e=t[0]??{};"number"==typeof e&&((0,n.t6)(n.lj,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e)}build(e){e={...t.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const r=this.verticesX*this.verticesY,s=[],i=[],n=[],a=this.verticesX-1,o=this.verticesY-1,l=this.width/a,h=this.height/o;for(let t=0;t<r;t++){const e=t%this.verticesX,r=t/this.verticesX|0;s.push(e*l,r*h),i.push(e/a,r/o)}const c=a*o;for(let t=0;t<c;t++){const e=t%a,r=t/a|0,s=r*this.verticesX+e,i=r*this.verticesX+e+1,o=(r+1)*this.verticesX+e,l=(r+1)*this.verticesX+e+1;n.push(s,i,o,i,l,o)}this.buffers[0].data=new Float32Array(s),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};o.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let l=o;const h=class t extends l{constructor(e={}){super({width:(e={...t.defaultOptions,...e}).width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(t){this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=t.anchor?.x,this._anchorY=t.anchor?.y,this.updateUvs(),this.updatePositions()}updatePositions(){const t=this.positions,{width:e,height:r,_leftWidth:s,_rightWidth:i,_topHeight:n,_bottomHeight:a,_anchorX:o,_anchorY:l}=this,h=s+i,c=e>h?1:e/h,u=n+a,d=r>u?1:r/u,p=Math.min(c,d),f=o*e,m=l*r;t[0]=t[8]=t[16]=t[24]=-f,t[2]=t[10]=t[18]=t[26]=s*p-f,t[4]=t[12]=t[20]=t[28]=e-i*p-f,t[6]=t[14]=t[22]=t[30]=e-f,t[1]=t[3]=t[5]=t[7]=-m,t[9]=t[11]=t[13]=t[15]=n*p-m,t[17]=t[19]=t[21]=t[23]=r-a*p-m,t[25]=t[27]=t[29]=t[31]=r-m,this.getBuffer("aPosition").update()}updateUvs(){const t=this.uvs;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1;const e=1/this._originalWidth,r=1/this._originalHeight;t[2]=t[10]=t[18]=t[26]=e*this._leftWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[4]=t[12]=t[20]=t[28]=1-e*this._rightWidth,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};h.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let c=h;class u extends i.U{constructor(){super(),this.geometry=new c}destroy(){this.geometry.destroy()}}class d{constructor(t){this._renderer=t}addRenderable(t,e){const r=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,r),this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){const e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture)}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=t._gpuData[this._renderer.uid]=new u,r=e;return r.renderable=t,r.transform=t.groupTransform,r.texture=t._texture,r.roundPixels=this._renderer._roundPixels|t._roundPixels,t.didViewUpdate||this._updateBatchableSprite(t,r),e}destroy(){this._renderer=null}}d.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"nineSliceSprite"},s.XO.add(d)},4566:(t,e,r)=>{"use strict";r.d(e,{D:()=>s});const s={test:t=>"string"==typeof t&&t.startsWith("info face="),parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const t in e){const s=e[t].match(/^[a-z]+/gm)[0],i=e[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const t in i){const e=i[t].split("="),r=e[0],s=e[1].replace(/"/gm,""),a=parseFloat(s),o=isNaN(a)?s:a;n[r]=o}r[s].push(n)}const s={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[i]=r.info,[n]=r.common,[a]=r.distanceField??[];a&&(s.distanceField={range:parseInt(a.distanceRange,10),type:a.fieldType}),s.fontSize=parseInt(i.size,10),s.fontFamily=i.face,s.lineHeight=parseInt(n.lineHeight,10);const o=r.page;for(let t=0;t<o.length;t++)s.pages.push({id:parseInt(o[t].id,10)||0,file:o[t].file});const l={};s.baseLineOffset=s.lineHeight-parseInt(n.base,10);const h=r.char;for(let t=0;t<h.length;t++){const e=h[t],r=parseInt(e.id,10);let i=e.letter??e.char??String.fromCharCode(r);"space"===i&&(i=" "),l[r]=i,s.chars[i]={id:r,page:parseInt(e.page,10)||0,x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xOffset:parseInt(e.xoffset,10),yOffset:parseInt(e.yoffset,10),xAdvance:parseInt(e.xadvance,10),kerning:{}}}const c=r.kerning||[];for(let t=0;t<c.length;t++){const e=parseInt(c[t].first,10),r=parseInt(c[t].second,10),i=parseInt(c[t].amount,10);s.chars[l[r]].kerning[l[e]]=i}return s}}},4582:(t,e,r)=>{"use strict";r.d(e,{L:()=>i});var s=r(9375);class i{constructor(){this.uid=(0,s.L)("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}},4614:(t,e,r)=>{"use strict";r.d(e,{TO:()=>s,Td:()=>n,bO:()=>i});const s=2*Math.PI,i=180/Math.PI,n=Math.PI/180},4687:(t,e,r)=>{"use strict";r.d(e,{mc:()=>H,u:()=>z,ig:()=>Y,fR:()=>W});var s=r(4872),i=r(6675),n=r(1065),a=r(5199),o=r(4614),l=r(7898),h=r(9375),c=r(4696),u=r(7694),d=r(761);const p={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(t){"boolean"==typeof t&&!1===t?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(!0===t?{}:t))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){(0,c.t6)("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};var f=r(4025);const m={allowChildren:!0,removeChildren(t=0,e){const r=e??this.children.length,s=r-t,i=[];if(s>0&&s<=r){for(let e=r-1;e>=t;e--){const t=this.children[e];t&&(i.push(t),t.parent=null)}(0,f.d)(this.children,t,r);const e=this.renderGroup||this.parentRenderGroup;e&&e.removeChildren(i);for(let t=0;t<i.length;++t){const e=i[t];e.parentRenderLayer?.detach(e),this.emit("childRemoved",e,this,t),i[t].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}if(0===s&&0===this.children.length)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||(0,c.t6)(c.lj,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:r}=this;if(e<0||e>r.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${r.length}`);if(t.parent){const r=t.parent.children.indexOf(t);if(t.parent===this&&r===e)return t;-1!==r&&t.parent.children.splice(r,1)}e===r.length?r.push(t):r.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const s=this.renderGroup||this.parentRenderGroup;return s&&s.addChild(t),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",t,this,e),t.emit("added",this),t},swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),s=this.getChildIndex(e);this.children[r]=e,this.children[s]=t;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...t){return 1===t.length?this.reparentChildAt(t[0],this.children.length):(t.forEach(t=>this.reparentChildAt(t,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const r=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const s=this.worldTransform.clone();return s.invert(),r.prepend(s),t.setFromMatrix(r),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},g={collectRenderables(t,e,r){this.parentRenderLayer&&this.parentRenderLayer!==r||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,r):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,r))},collectRenderablesSimple(t,e,r){const s=this.children,i=s.length;for(let n=0;n<i;n++)s[n].collectRenderables(t,e,r)},collectRenderablesWithEffects(t,e,r){const{renderPipes:s}=e;for(let e=0;e<this.effects.length;e++){const r=this.effects[e];s[r.pipe].push(r,this,t)}this.collectRenderablesSimple(t,e,r);for(let e=this.effects.length-1;e>=0;e--){const r=this.effects[e];s[r.pipe].pop(r,this,t)}}};var x=r(4403);const y=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const r=this._tests[e];if(r.test(t))return d.Z.get(r.maskClass,t)}return t}returnMaskEffect(t){d.Z.return(t)}};n.XO.handleByList(n.Ag.MaskEffect,y._effectClasses);const v={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){-1===this.effects.indexOf(t)&&(this.effects.push(t),this.effects.sort((t,e)=>t.priority-e.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);-1!==e&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;e?.mask!==t&&(e&&(this.removeEffect(e),y.returnMaskEffect(e),this._maskEffect=null),null!=t&&(this._maskEffect=y.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new x.a),r=t?.length>0,s=r!==e.filters?.length>0;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),s&&(r?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){return this._filterEffect?.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new x.a),this._filterEffect.filterArea=t},get filterArea(){return this._filterEffect?.filterArea}},_={label:null,get name(){return(0,c.t6)(c.lj,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){(0,c.t6)(c.lj,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const r=this.children;for(let e=0;e<r.length;e++){const s=r[e];if(s.label===t||t instanceof RegExp&&t.test(s.label))return s}if(e)for(let e=0;e<r.length;e++){const s=r[e].getChildByLabel(t,!0);if(s)return s}return null},getChildrenByLabel(t,e=!1,r=[]){const s=this.children;for(let e=0;e<s.length;e++){const i=s[e];(i.label===t||t instanceof RegExp&&t.test(i.label))&&r.push(i)}if(e)for(let e=0;e<s.length;e++)s[e].getChildrenByLabel(t,!0,r);return r}};var b=r(6170),w=r(7882);const T=new a.u,S={getFastGlobalBounds(t,e){e||(e=new b.c),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const r=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(r.worldTransform),e},_getGlobalBoundsRecursive(t,e,r){let s=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==r)return;if(7!==this.localDisplayStatus||!this.measurable)return;const i=!!this.effects.length;if((this.renderGroup||i)&&(s=w.o.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const t=this.bounds;s.addFrame(t.minX,t.minY,t.maxX,t.maxY,this.groupTransform)}const e=this.children;for(let i=0;i<e.length;i++)e[i]._getGlobalBoundsRecursive(t,s,r)}if(i){let t=!1;const r=this.renderGroup||this.parentRenderGroup;for(let e=0;e<this.effects.length;e++)this.effects[e].addBounds&&(t||(t=!0,s.applyMatrix(r.worldTransform)),this.effects[e].addBounds(s,!0));t&&s.applyMatrix(r.worldTransform.copyTo(T).invert()),e.addBounds(s),w.o.return(s)}else this.renderGroup&&(e.addBounds(s,this.relativeGroupTransform),w.o.return(s))}};var A=r(9565),C=r(6851);function P(t){return((255&t)<<16)+(65280&t)+(t>>16&255)}const E={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,r=this.parent;for(;r;)e*=r.alpha,r=r.parent;return e},getGlobalTransform(t=new a.u,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const r=(0,A.E)(this,w.u.get().identity());return t.appendFrom(this.localTransform,r),w.u.return(r),t},getGlobalTint(t){if(t)return this.renderGroup?P(this.renderGroup.worldColor):this.parentRenderGroup?P((0,C.j)(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,r=this.parent;for(;r;)e=(0,C.j)(e,r.localColor),r=r.parent;return P(e)}};var M=r(2071);function k(t,e){const r=t.children;for(let t=0;t<r.length;t++){const s=r[t],i=s.uid,n=(65535&s._didViewChangeTick)<<16|65535&s._didContainerChangeTick,a=e.index;e.data[a]===i&&e.data[a+1]===n||(e.data[e.index]=i,e.data[e.index+1]=n,e.didChange=!0),e.index=a+2,s.children.length&&k(s,e)}return e.didChange}const R=new a.u,B={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const r=Math.sign(this.scale.x)||1;this.scale.x=0!==e?t/e*r:r},_setHeight(t,e){const r=Math.sign(this.scale.y)||1;this.scale.y=0!==e?t/e*r:r},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new b.c});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),k(this,t),t.didChange&&(0,M.n)(this,t.localBounds,R),t.localBounds},getBounds(t,e){return(0,A.f)(this,t,e||new b.c)}},I={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t)return this._onRender&&e?.removeOnRender(this),void(this._onRender=null);this._onRender||e?.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},F={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(O))}};function O(t,e){return t._zIndex-e._zIndex}var G=r(59);const D={getGlobalPosition(t=new G.b,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,r=!1){const s=this.getGlobalTransform(w.u.get(),r);return e=s.apply(t,e),w.u.return(s),e},toLocal(t,e,r,s){e&&(t=e.toGlobal(t,r,s));const i=this.getGlobalTransform(w.u.get(),s);return r=i.applyInverse(t,r),w.u.return(i),r}};var U=r(1422);const L=new l.o(null),N=new l.o(null),X=new l.o(null,1,1),V=new l.o(null),Y=1,z=2,W=4;class H extends s.A{constructor(t={}){super(),this.uid=(0,h.L)("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.updateTick=-1,this.localTransform=new a.u,this.relativeGroupTransform=new a.u,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new l.o(this,0,0),this._scale=X,this._pivot=N,this._origin=V,this._skew=L,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],function(t,e,r={}){for(const s in e)r[s]||void 0===e[s]||(t[s]=e[s])}(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(t=>this.addChild(t)),t.parent?.addChild(this)}static mixin(t){(0,c.t6)("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),n.XO.mixin(H,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=4095&t}get _didChangeId(){return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12}addChild(...t){if(this.allowChildren||(0,c.t6)(c.lj,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let e=0;e<t.length;e++)this.addChild(t[e]);return t[0]}const e=t[0],r=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),r&&(r.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,r&&r.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,0!==e._zIndex&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let e=0;e<t.length;e++)this.removeChild(t[e]);return t[0]}const e=t[0],r=this.children.indexOf(e);return r>-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,r),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=d.Z.get(U.m,this),this.groupTransform=a.u.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),d.Z.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&0===this.effects.length}get worldTransform(){return this._worldTransform||(this._worldTransform=new a.u),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*o.bO}set angle(t){this.rotation=t*o.Td}get pivot(){return this._pivot===N&&(this._pivot=new l.o(this,0,0)),this._pivot}set pivot(t){this._pivot===N&&(this._pivot=new l.o(this,0,0),this._origin!==V&&(0,u.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===L&&(this._skew=new l.o(this,0,0)),this._skew}set skew(t){this._skew===L&&(this._skew=new l.o(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===X&&(this._scale=new l.o(this,1,1)),this._scale}set scale(t){this._scale===X&&(this._scale=new l.o(this,0,0)),"string"==typeof t&&(t=parseFloat(t)),"number"==typeof t?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===V&&(this._origin=new l.o(this,0,0)),this._origin}set origin(t){this._origin===V&&(this._origin=new l.o(this,0,0),this._pivot!==N&&(0,u.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const r=this.getLocalBounds();"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,r.width),void 0!==e&&this._setHeight(e,r.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set("number"==typeof t.x?t.x:this.position.x,"number"==typeof t.y?t.y:this.position.y),this.scale.set("number"==typeof t.scaleX?t.scaleX||1:this.scale.x,"number"==typeof t.scaleY?t.scaleY||1:this.scale.y),this.rotation="number"==typeof t.rotation?t.rotation:this.rotation,this.skew.set("number"==typeof t.skewX?t.skewX:this.skew.x,"number"==typeof t.skewY?t.skewY:this.skew.y),this.pivot.set("number"==typeof t.pivotX?t.pivotX:this.pivot.x,"number"==typeof t.pivotY?t.pivotY:this.pivot.y),this.origin.set("number"==typeof t.originX?t.originX:this.origin.x,"number"==typeof t.originY?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,r=this._scale,s=this._pivot,i=this._origin,n=this._position,a=r._x,o=r._y,l=s._x,h=s._y,c=-i._x,u=-i._y;e.a=this._cx*a,e.b=this._sx*a,e.c=this._cy*o,e.d=this._sy*o,e.tx=n._x-(l*e.a+h*e.c)+(c*e.a+u*e.c)-c,e.ty=n._y-(l*e.b+h*e.d)+(c*e.b+u*e.d)-u}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=Y,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const e=i.Q.shared.setValue(t??16777215).toBgrNumber();e!==this.localColor&&(this.localColor=e,this._updateFlags|=Y,this._onUpdate())}get tint(){return P(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=z,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(2&this.localDisplayStatus)}set visible(t){const e=t?2:0;(2&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=W,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(4&this.localDisplayStatus)}set culled(t){const e=t?0:4;(4&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=W,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(1&this.localDisplayStatus)}set renderable(t){const e=t?1:0;(1&this.localDisplayStatus)!==e&&(this._updateFlags|=W,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return 7===this.localDisplayStatus&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;let e;if(this.destroyed=!0,this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),("boolean"==typeof t?t:t?.children)&&e)for(let r=0;r<e.length;++r)e[r].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}n.XO.mixin(H,m,S,D,I,B,v,_,F,{cullArea:null,cullable:!1,cullableChildren:!0},p,E,g)},4696:(t,e,r)=>{"use strict";r.d(e,{Ek:()=>n,lj:()=>i,t6:()=>o});const s=new Set,i="8.0.0",n="8.3.4",a={quiet:!1,noColor:!1},o=(t,e,r=3)=>{if(a.quiet||s.has(e))return;let i=(new Error).stack;const n=`${e}\nDeprecated since v${t}`,o="function"==typeof console.groupCollapsed&&!a.noColor;void 0===i?console.warn("PixiJS Deprecation Warning: ",n):(i=i.split("\n").splice(r).join("\n"),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",n),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",n),console.warn(i))),s.add(e)};Object.defineProperties(o,{quiet:{get:()=>a.quiet,set:t=>{a.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>a.noColor,set:t=>{a.noColor=t},enumerable:!0,configurable:!1}})},4872:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});const s=r(792)},4889:(t,e,r)=>{"use strict";var s=r(592);r(9317),r(275),s.U},4968:(t,e,r)=>{"use strict";r.d(e,{A4:()=>s.A,Nw:()=>a.N,ok:()=>n.o,uv:()=>i.u}),r(2839);var s=r(5259),i=(r(7761),r(3198)),n=(r(3762),r(8630),r(4980),r(5896),r(605),r(8016),r(9935),r(8840),r(5611)),a=(r(5892),r(8742),r(7448),r(5604),r(6763),r(7879),r(6042),r(8099),r(4889),r(8533),r(2454),r(9067))},4980:(t,e,r)=>{"use strict";r(166),r(4132),r(2839)._},4988:(t,e,r)=>{"use strict";r.d(e,{m:()=>i});const s={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function i(t){return s[t]??s.float32}},5007:(t,e,r)=>{"use strict";r.d(e,{M:()=>d});var s=r(8642),i=r(8574);let n;function a(){if(!n){n="mediump";const t=(0,i.W)();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);n=e.precision?"highp":"mediump"}}return n}const o={},l={},h={stripVersion:function(t,e){return e?t.replace("#version 300 es",""):t},ensurePrecision:function(t,e,r){const s=r?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if("precision"!==t.substring(0,9)){let i=r?e.requestedFragmentPrecision:e.requestedVertexPrecision;return"highp"===i&&"highp"!==s&&(i="mediump"),`precision ${i} float;\n${t}`}return"highp"!==s&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t},addProgramDefines:function(t,e,r){return e?t:r?`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${t=t.replace("out vec4 finalColor;","")}\n `:`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${t}\n `},setProgramName:function(t,{name:e="pixi-program"},r=!0){e=e.replace(/\s+/g,"-");const s=r?o:l;return s[e+=r?"-fragment":"-vertex"]?(s[e]++,e+=`-${s[e]}`):s[e]=1,-1!==t.indexOf("#define SHADER_NAME")?t:`#define SHADER_NAME ${e}\n${t}`},insertVersion:function(t,e){return e?`#version 300 es\n${t}`:t}},c=Object.create(null),u=class t{constructor(e){const r=-1!==(e={...t.defaultOptions,...e}).fragment.indexOf("#version 300 es"),i={stripVersion:r,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:a()},setProgramName:{name:e.name},addProgramDefines:r,insertVersion:r};let n=e.fragment,o=e.vertex;Object.keys(h).forEach(t=>{const e=i[t];n=h[t](n,e,!0),o=h[t](o,e,!1)}),this.fragment=n,this.vertex=o,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=(0,s.X)(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,c[this._cacheKey]=null}static from(e){const r=`${e.vertex}:${e.fragment}`;return c[r]||(c[r]=new t(e),c[r]._cacheKey=r),c[r]}};u.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let d=u},5008:(t,e,r)=>{"use strict";r.d(e,{G:()=>a});var s=r(5199),i=r(5946);const n=new s.u;class a{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,e=t>>16|65280&t|(255&t)<<16,r=this.renderable;return r?(0,i.u)(e,r.groupColor)+(this.alpha*r.groupAlpha*255<<24):e+(255*this.alpha<<24)}get transform(){return this.renderable?.groupTransform||n}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher.destroy(),this._batcher=null,this._batch.destroy(),this._batch=null}}},5024:(t,e,r)=>{"use strict";r.d(e,{T:()=>d,w:()=>u});var s=r(6675),i=r(9739),n=r(6406),a=r(9776);function o(t){return t instanceof a.m}function l(t){return t instanceof n._}function h(t,e,r){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...r,...t}}function c(t,e,r){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...r,...t}}function u(t,e){if(null==t)return null;const r={},n=t;return function(t){return s.Q.isColorLike(t)}(t)?function(t,e,r){const n=s.Q.shared.setValue(e??0);return t.color=n.toNumber(),t.alpha=1===n.alpha?r.alpha:n.alpha,t.texture=i.g.WHITE,{...r,...t}}(r,t,e):function(t){return t instanceof i.g}(t)?function(t,e,r){return t.texture=e,{...r,...t}}(r,t,e):o(t)?h(r,t,e):l(t)?c(r,t,e):n.fill&&o(n.fill)?h(n,n.fill,e):n.fill&&l(n.fill)?c(n,n.fill,e):function(t,e){const r={...e,...t},i=s.Q.shared.setValue(r.color);return r.alpha*=i.alpha,r.color=i.toNumber(),r}(n,e)}function d(t,e){const{width:r,alignment:s,miterLimit:i,cap:n,join:a,pixelLine:o,...l}=e,h=u(t,l);return h?{width:r,alignment:s,miterLimit:i,cap:n,join:a,pixelLine:o,...h}:null}},5031:(t,e,r)=>{"use strict";r.d(e,{b:()=>i});const s="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function i(t){return!s&&""!==document.createElement("video").canPlayType(t)}},5105:(t,e,r)=>{"use strict";r.d(e,{x:()=>p});var s=r(4872),i=r(6675),n=r(9375),a=r(4696),o=r(7694),l=r(6406),h=r(9776),c=r(4386),u=r(5024);const d=class t extends s.A{constructor(e={}){super(),this.uid=(0,n.L)("textStyle"),this._tick=0,function(t){const e=t;if("boolean"==typeof e.dropShadow&&e.dropShadow){const r=p.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??r.alpha,angle:e.dropShadowAngle??r.angle,blur:e.dropShadowBlur??r.blur,color:e.dropShadowColor??r.color,distance:e.dropShadowDistance??r.distance}}if(void 0!==e.strokeThickness){(0,a.t6)(a.lj,"strokeThickness is now a part of stroke");const r=e.stroke;let s={};if(i.Q.isColorLike(r))s.color=r;else if(r instanceof l._||r instanceof h.m)s.fill=r;else{if(!Object.hasOwnProperty.call(r,"color")&&!Object.hasOwnProperty.call(r,"fill"))throw new Error("Invalid stroke value.");s=r}t.stroke={...s,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if((0,a.t6)(a.lj,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||0===e.fill.length)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&(0,o.R)("The number of fill colors must match the number of fill gradient stops.");const r=new l._({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),s=e.fillGradientStops.slice(),n=e.fill.map(t=>i.Q.shared.setValue(t).toNumber());s.forEach((t,e)=>{r.addColorStop(t,n[e])}),t.fill={fill:r}}}(e);const r={...t.defaultTextStyle,...e};for(const t in r)this[t]=r[t];this.update(),this._tick=0}get align(){return this._align}set align(t){this._align=t,this.update()}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords=t,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow=null!==e&&"object"==typeof e?this._createProxy({...t.defaultDropShadow,...e}):e?this._createProxy({...t.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.update()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize="string"==typeof t?parseInt(t,10):t,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t.toLowerCase(),this.update()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.update()}get leading(){return this._leading}set leading(t){this._leading=t,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing=t,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.update()}get padding(){return this._padding}set padding(t){this._padding=t,this.update()}get filters(){return this._filters}set filters(t){this._filters=Object.freeze(t),this.update()}get trim(){return this._trim}set trim(t){this._trim=t,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace=t,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap=t,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth=t,this.update()}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...c.T.defaultFillStyle,...t},()=>{this._fill=(0,u.w)({...this._originalFill},c.T.defaultFillStyle)})),this._fill=(0,u.w)(0===t?"black":t,c.T.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...c.T.defaultStrokeStyle,...t},()=>{this._stroke=(0,u.T)({...this._originalStroke},c.T.defaultStrokeStyle)})),this._stroke=(0,u.T)(t,c.T.defaultStrokeStyle),this.update())}update(){this._tick++,this.emit("update",this)}reset(){const e=t.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return`${this.uid}-${this._tick}`}clone(){return new t({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let t=0;if(this._filters)for(let e=0;e<this._filters.length;e++)t+=this._filters[e].padding;return Math.max(this._padding,t)}destroy(t=!1){if(this.removeAllListeners(),"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fill?.texture&&this._fill.texture.destroy(e),this._originalFill?.texture&&this._originalFill.texture.destroy(e),this._stroke?.texture&&this._stroke.texture.destroy(e),this._originalStroke?.texture&&this._originalStroke.texture.destroy(e)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(t,r,s)=>(t[r]=s,e?.(r,s),this.update(),!0)})}_isFillStyle(t){return null!==(t??null)&&!(i.Q.isColorLike(t)||t instanceof l._||t instanceof h.m)}};d.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},d.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let p=d},5153:(t,e,r)=>{"use strict";r.d(e,{W:()=>s});var s=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.BOTH=3]="BOTH",t))(s||{})},5180:(t,e,r)=>{"use strict";r.d(e,{C:()=>n});var s=r(5423);let i;async function n(){return i??(i=(async()=>{const t=s.e.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()});if(!e)return"premultiply-alpha-on-upload";const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),i}},5199:(t,e,r)=>{"use strict";r.d(e,{u:()=>n});var s=r(4614),i=r(59);class n{constructor(t=1,e=0,r=0,s=1,i=0,n=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=s,this.tx=i,this.ty=n}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,r,s,i,n){return this.a=t,this.b=e,this.c=r,this.d=s,this.tx=i,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new i.b;const r=t.x,s=t.y;return e.x=this.a*r+this.c*s+this.tx,e.y=this.b*r+this.d*s+this.ty,e}applyInverse(t,e){e=e||new i.b;const r=this.a,s=this.b,n=this.c,a=this.d,o=this.tx,l=this.ty,h=1/(r*a+n*-s),c=t.x,u=t.y;return e.x=a*h*c+-n*h*u+(l*n-o*a)*h,e.y=r*h*u+-s*h*c+(-l*r+o*s)*h,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),s=this.a,i=this.c,n=this.tx;return this.a=s*e-this.b*r,this.b=s*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=n*e-this.ty*r,this.ty=n*r+this.ty*e,this}append(t){const e=this.a,r=this.b,s=this.c,i=this.d;return this.a=t.a*e+t.b*s,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*s,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this}appendFrom(t,e){const r=t.a,s=t.b,i=t.c,n=t.d,a=t.tx,o=t.ty,l=e.a,h=e.b,c=e.c,u=e.d;return this.a=r*l+s*c,this.b=r*h+s*u,this.c=i*l+n*c,this.d=i*h+n*u,this.tx=a*l+o*c+e.tx,this.ty=a*h+o*u+e.ty,this}setTransform(t,e,r,s,i,n,a,o,l){return this.a=Math.cos(a+l)*i,this.b=Math.sin(a+l)*i,this.c=-Math.sin(a-o)*n,this.d=Math.cos(a-o)*n,this.tx=t-(r*this.a+s*this.c),this.ty=e-(r*this.b+s*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,r=this.b,i=this.c,n=this.d,a=t.pivot,o=-Math.atan2(-i,n),l=Math.atan2(r,e),h=Math.abs(o+l);return h<1e-5||Math.abs(s.TO-h)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=l),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(a.x*e+a.y*i),t.position.y=this.ty+(a.x*r+a.y*n),t}invert(){const t=this.a,e=this.b,r=this.c,s=this.d,i=this.tx,n=t*s-e*r;return this.a=s/n,this.b=-e/n,this.c=-r/n,this.d=t/n,this.tx=(r*this.ty-s*i)/n,this.ty=-(t*this.ty-e*i)/n,this}isIdentity(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new n;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return o.identity()}static get shared(){return a.identity()}}const a=new n,o=new n},5229:(t,e,r)=>{"use strict";r.d(e,{M:()=>a});var s=r(7399),i=r(1347);class n{slotIndex;name;attachment;constructor(t=0,e,r){this.slotIndex=t,this.name=e,this.attachment=r}}class a{name;attachments=new Array;bones=Array();constraints=new Array;color=new i.Q1(.99607843,.61960787,.30980393,1);constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,r){if(!r)throw new Error("attachment cannot be null.");let s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=r}addSkin(t){for(let e=0;e<t.bones.length;e++){let r=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==r){s=!0;break}s||this.bones.push(r)}for(let e=0;e<t.constraints.length;e++){let r=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==r){s=!0;break}s||this.constraints.push(r)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var r=e[t];this.setAttachment(r.slotIndex,r.name,r.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){let r=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==r){s=!0;break}s||this.bones.push(r)}for(let e=0;e<t.constraints.length;e++){let r=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==r){s=!0;break}s||this.constraints.push(r)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var r=e[t];r.attachment&&(r.attachment instanceof s.f?(r.attachment=r.attachment.newLinkedMesh(),this.setAttachment(r.slotIndex,r.name,r.attachment)):(r.attachment=r.attachment.copy(),this.setAttachment(r.slotIndex,r.name,r.attachment)))}}getAttachment(t,e){let r=this.attachments[t];return r?r[e]:null}removeAttachment(t,e){let r=this.attachments[t];r&&delete r[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let r=this.attachments[e];if(r)for(let s in r){let i=r[s];i&&t.push(new n(e,s,i))}}return t}getAttachmentsForSlot(t,e){let r=this.attachments[t];if(r)for(let s in r){let i=r[s];i&&e.push(new n(t,s,i))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let r=0;for(let s=0;s<t.slots.length;s++){let i=t.slots[s],n=i.getAttachment();if(n&&r<e.attachments.length){let t=e.attachments[r];for(let e in t)if(n==t[e]){let t=this.getAttachment(r,e);t&&i.setAttachment(t);break}}r++}}}},5242:(t,e,r)=>{"use strict";r.d(e,{Lw:()=>n,TE:()=>l});var s=r(2101),i=r(1347);class n{pages=new Array;regions=new Array;constructor(t){let e=new a(t),r=new Array(4),n={size:t=>{t.width=parseInt(r[1]),t.height=parseInt(r[2])},format:()=>{},filter:t=>{t.minFilter=i.Aq.enumValue(s.O$,r[1]),t.magFilter=i.Aq.enumValue(s.O$,r[2])},repeat:t=>{-1!=r[1].indexOf("x")&&(t.uWrap=s.w3.Repeat),-1!=r[1].indexOf("y")&&(t.vWrap=s.w3.Repeat)},pma:t=>{t.pma="true"==r[1]}};var h={xy:t=>{t.x=parseInt(r[1]),t.y=parseInt(r[2])},size:t=>{t.width=parseInt(r[1]),t.height=parseInt(r[2])},bounds:t=>{t.x=parseInt(r[1]),t.y=parseInt(r[2]),t.width=parseInt(r[3]),t.height=parseInt(r[4])},offset:t=>{t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2])},orig:t=>{t.originalWidth=parseInt(r[1]),t.originalHeight=parseInt(r[2])},offsets:t=>{t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2]),t.originalWidth=parseInt(r[3]),t.originalHeight=parseInt(r[4])},rotate:t=>{let e=r[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(r[1])}};let c=e.readLine();for(;c&&0==c.trim().length;)c=e.readLine();for(;c&&0!=c.trim().length&&0!=e.readEntry(r,c);)c=e.readLine();let u=null,d=null,p=null;for(;null!==c;)if(0==c.trim().length)u=null,c=e.readLine();else if(u){let t=new l(u,c);for(;;){let s=e.readEntry(r,c=e.readLine());if(0==s)break;let i=h[r[0]];if(i)i(t);else{d||(d=[]),p||(p=[]),d.push(r[0]);let t=[];for(let e=0;e<s;e++)t.push(parseInt(r[e+1]));p.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),d&&d.length>0&&p&&p.length>0&&(t.names=d,t.values=p,d=null,p=null),t.u=t.x/u.width,t.v=t.y/u.height,90==t.degrees?(t.u2=(t.x+t.height)/u.width,t.v2=(t.y+t.width)/u.height):(t.u2=(t.x+t.width)/u.width,t.v2=(t.y+t.height)/u.height),this.regions.push(t)}else{for(u=new o(c.trim());0!=e.readEntry(r,c=e.readLine());){let t=n[r[0]];t&&t(u)}this.pages.push(u)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let r of this.pages)r.setTexture(t.get(e+r.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture?.dispose()}}class a{lines;index=0;constructor(t){this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let r=e.indexOf(":");if(-1==r)return 0;t[0]=e.substr(0,r).trim();for(let s=1,i=r+1;;s++){let r=e.indexOf(",",i);if(-1==r)return t[s]=e.substr(i).trim(),s;if(t[s]=e.substr(i,r-i).trim(),i=r+1,4==s)return 4}}}class o{name;minFilter=s.O$.Nearest;magFilter=s.O$.Nearest;uWrap=s.w3.ClampToEdge;vWrap=s.w3.ClampToEdge;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(t){this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}}class l extends s.QL{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(t,e){super(),this.page=t,this.name=e,t.regions.push(this)}}},5254:(t,e,r)=>{"use strict";r.d(e,{R:()=>i});var s=r(9067);class i{#h;#c=0;constructor(t){let e=0,r=0;const i=s=>{const n=(s-e)/1e3;if(n>0){const i=this.#h;if(void 0!==i&&i>0){r+=n;const e=1/i;r>=e&&(t(e),r>=2*e?(t(n),r=0):r-=e)}else t(n);e=s}this.#c=requestAnimationFrame(i)};this.#c=requestAnimationFrame(i),s.p&&(document.hasFocus()||(this.#h=6),window.addEventListener("blur",this.#u),window.addEventListener("focus",this.#d),window.addEventListener("pageshow",this.#p))}#u=()=>{this.#h=6};#d=()=>{this.#h=void 0};#p=t=>{t.persisted&&(this.#h=void 0)};remove(){cancelAnimationFrame(this.#c),window.removeEventListener("blur",this.#u),window.removeEventListener("focus",this.#d),window.removeEventListener("pageshow",this.#p)}}},5259:(t,e,r)=>{"use strict";r.d(e,{A:()=>d});var s=r(166),i=r(9067),n=r(275),a=r(2437),o=r(7955),l=r(6499),h=r(1298),c=r(499),u=r(5254);class d extends a.N{container;#f;#m=new u.R(t=>this.#g(t));camera=new o.i;fpsDisplay;#x;#y;#v;#_;#b={};_isSizeDirty=!1;canvasWidth=0;canvasHeight=0;canvasLeft=0;canvasTop=0;viewportScale=1;centerX=0;centerY=0;constructor(t,e){if(super(new s.mcf({sortableChildren:!0})),this.container=t,this.renderer=this,this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty(),this.#f=new l.W(t),this.#f.on("resize",(t,e)=>this.#w(t,e)),this.camera.on("positionChanged",()=>this.#T()),this.camera.on("scaleChanged",()=>this.#T()),e&&(void 0!==e.logicalWidth&&(this.#x=e.logicalWidth),void 0!==e.logicalHeight&&(this.#y=e.logicalHeight),void 0!==e.backgroundColor&&(this.#v=e.backgroundColor),e.layers))for(const t of e.layers){const e=new c.W(t.drawOrder);this._pixiContainer.addChild(e._pixiContainer),this.#b[t.name]=e}i.p&&(this.fpsDisplay=new h.K(t));const r=this.container.getBoundingClientRect();this.#w(r.width,r.height),this.init()}async init(){const t=await(0,s.q5F)({width:this.#x,height:this.#y,backgroundColor:this.#v,eventMode:"none",resolution:window.devicePixelRatio});(0,n.e)(t.canvas,{position:"absolute",touchAction:"auto"}),this.container.appendChild(t.canvas),this.#_=t}#T(){const t=this.camera.scale;this._pixiContainer.scale=t,this._pixiContainer.position.set(this.centerX-this.camera.x*t,this.centerY-this.camera.y*t)}#w(t,e){const r=this.#x??t,s=this.#y??e;this.canvasWidth=r,this.canvasHeight=s,this.centerX=r/2,this.centerY=s/2,this.#T();const i=Math.min(t/r,e/s);this.viewportScale=i;const a=r*i,o=s*i,l=(t-a)/2,h=(e-o)/2;this.canvasLeft=l,this.canvasTop=h,this.#_&&(this.#_.resize(r,s),(0,n.e)(this.#_.canvas,{width:`${a}px`,height:`${o}px`,left:`${l}px`,top:`${h}px`}),this.emit("resize",r,s)),this._isSizeDirty=!0}#g(t){this._isSizeDirty=!1,this.update(t),this._updateWorldTransform(),this.#_?.render(this._pixiContainer),this.fpsDisplay?.update()}_addToLayer(t,e){const r=this.#b[e];if(!r)throw new Error(`Layer ${e} does not exist.`);r._pixiContainer.addChild(t._pixiContainer)}remove(){this.#f.remove(),this.#m.remove(),this.#_?.destroy(),this.fpsDisplay?.remove(),super.remove()}screenToWorld(t,e){return{x:(t-this.canvasLeft)/this.viewportScale-this.canvasWidth/2,y:(e-this.canvasTop)/this.viewportScale-this.canvasHeight/2}}}},5331:(t,e,r)=>{"use strict";r.d(e,{b:()=>n});var s=r(1347),i=r(4382);class n extends i.e{color=new s.Q1(1,1,1,1);constructor(t){super(t)}copy(){let t=new n(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}},5353:(t,e,r)=>{"use strict";function s(t,e,r,s){const i={width:0,height:0,offsetY:0,scale:e.fontSize/r.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};i.offsetY=r.baseLineOffset;let n=i.lines[0],a=null,o=!0;const l={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},h=r.baseMeasurementFontSize/e.fontSize,c=e.letterSpacing*h,u=e.wordWrapWidth*h,d=e.lineHeight?e.lineHeight*h:r.lineHeight,p=e.wordWrap&&e.breakWords,f=t=>{const e=n.width;for(let r=0;r<l.index;r++){const s=t.positions[r];n.chars.push(t.chars[r]),n.charPositions.push(s+e)}n.width+=t.width,o=!1,l.width=0,l.index=0,l.chars.length=0},m=()=>{let t=n.chars.length-1;if(s){let e=n.chars[t];for(;" "===e;)n.width-=r.chars[e].xAdvance,e=n.chars[--t]}i.width=Math.max(i.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},o=!0,i.lines.push(n),i.height+=d},g=t=>t-c>u;for(let s=0;s<t.length+1;s++){let i;const h=s===t.length;h||(i=t[s]);const u=r.chars[i]||r.chars[" "];if(/(?:\s)/.test(i)||"\r"===i||"\n"===i||h){if(!o&&e.wordWrap&&g(n.width+l.width)?(m(),f(l),h||n.charPositions.push(0)):(l.start=n.width,f(l),h||n.charPositions.push(0)),"\r"===i||"\n"===i)m();else if(!h){const t=u.xAdvance+(u.kerning[a]||0)+c;n.width+=t,n.spaceWidth=t,n.spacesIndex.push(n.charPositions.length),n.chars.push(i)}}else{const t=u.kerning[a]||0,e=u.xAdvance+t+c;p&&g(n.width+l.width+e)&&(f(l),m()),l.positions[l.index++]=l.width+t,l.chars.push(i),l.width+=e}a=i}return m(),"center"===e.align?function(t){for(let e=0;e<t.lines.length;e++){const r=t.lines[e],s=t.width/2-r.width/2;for(let t=0;t<r.charPositions.length;t++)r.charPositions[t]+=s}}(i):"right"===e.align?function(t){for(let e=0;e<t.lines.length;e++){const r=t.lines[e],s=t.width-r.width;for(let t=0;t<r.charPositions.length;t++)r.charPositions[t]+=s}}(i):"justify"===e.align&&function(t){const e=t.width;for(let r=0;r<t.lines.length;r++){const s=t.lines[r];let i=0,n=s.spacesIndex[i++],a=0;const o=s.spacesIndex.length,l=(e-s.width)/o;for(let t=0;t<s.charPositions.length;t++)t===n&&(n=s.spacesIndex[i++],a+=l),s.charPositions[t]+=a}}(i),i}r.d(e,{Z:()=>s})},5423:(t,e,r)=>{"use strict";r.d(e,{e:()=>i});let s={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")};const i={get:()=>s,set(t){s=t}}},5556:(t,e,r)=>{"use strict";r.d(e,{P:()=>i});var s=r(159);class i extends s.q{_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(t){super(t,0,!1)}}},5604:(t,e,r)=>{"use strict";r(8714),r(166),r(8630);var s=r(2437);r(6121),r(6763),s.N},5611:(t,e,r)=>{"use strict";r.d(e,{o:()=>o});var s=r(166),i=r(7635),n=r(2839);function a(t,e){return Math.random()*(e-t)+t}class o extends n._{#S;#A;#C;#P;#E;#M;#k;#R;#B;#I;#F;#O;#G=[];constructor(t){super(t),this.#S=t.texture,this.#A=t.count,this.#C=t.lifespan,this.#P=t.angle,this.#E=t.velocity,this.#M=t.particleScale,this.#k=t.startAlpha,this.#R=t.fadeRate,this.#B=t.orientToVelocity,this.#I=t.blendMode,this.#O=this.#D()}async#D(){i.V.checkCached(this.#S)?this.#F=i.V.getCached(this.#S):(console.info(`Texture not preloaded. Loading now: ${this.#S}`),this.#F=await i.V.load(this.#S))}async burst({x:t,y:e}){this.#F||await this.#O;const r=a(this.#A.min,this.#A.max);for(let i=0;i<r;i++){const r=a(this.#C.min,this.#C.max),i=a(this.#P.min,this.#P.max),n=Math.sin(i),o=Math.cos(i),l=a(this.#E.min,this.#E.max),h=a(this.#M.min,this.#M.max),c=new s.kxk({x:t,y:e,texture:this.#F,anchor:{x:.5,y:.5},scale:{x:h,y:h},alpha:this.#k,blendMode:this.#I,rotation:this.#B?i:void 0});this.#G.push({sprite:c,age:0,lifespan:r,velocityX:l*o,velocityY:l*n,fadeRate:this.#R}),this._pixiContainer.addChild(c)}}update(t){super.update(t);const e=this.#G;for(let r=0;r<e.length;r++){const s=e[r],i=s.sprite;s.age+=t,s.age>s.lifespan?(i.destroy({children:!0}),e.splice(r,1),r--):(i.x+=s.velocityX*t,i.y+=s.velocityY*t,i.alpha+=s.fadeRate*t)}}remove(){i.V.release(this.#S),super.remove()}}},5671:(t,e,r)=>{"use strict";r.d(e,{G:()=>n});var s=r(1065),i=r(5031);const n={extension:{type:s.Ag.DetectionParser,priority:0},test:async()=>(0,i.b)("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter(t=>"ogv"!==t)}},5749:(t,e,r)=>{"use strict";r.d(e,{$:()=>l});var s=r(1065),i=r(3651),n=r(5180),a=r(4269);const o=class t extends a.v{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...t.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==e.autoPlay,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==e.autoLoad&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=i.R.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await(0,n.C)(),this._load=new Promise((r,s)=>{this.isValid?r(this):(this._resolve=r,this._reject=s,void 0!==e.preloadTimeoutMs&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(i.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(i.R.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(i.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};o.extension=s.Ag.TextureSource,o.defaultOptions={...a.v.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},o.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let l=o},5809:(t,e,r)=>{"use strict";r.d(e,{Q:()=>n});var s=r(1065),i=r(6257);const n={extension:{type:s.Ag.DetectionParser,priority:1},test:async()=>(0,i.P)("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter(t=>"avif"!==t)}},5851:(t,e,r)=>{"use strict";r(166),r(8034)},5892:(t,e,r)=>{"use strict";r(166),r(7249).X},5896:(t,e,r)=>{"use strict";r(166),r(791),r(2839)._},5946:(t,e,r)=>{"use strict";function s(t,e){return 16777215!==t&&e?16777215!==e&&t?((t>>16&255)*(e>>16&255)/255<<16)+((t>>8&255)*(e>>8&255)/255<<8)+((255&t)*(255&e)/255|0):t:e}r.d(e,{u:()=>s})},5947:(t,e,r)=>{"use strict";r.d(e,{b:()=>n});var s=r(1065),i=r(4269);class n extends i.v{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}n.extension=s.Ag.TextureSource},6042:(t,e,r)=>{"use strict";var s=r(592);r(9317),r(275),s.U},6068:(t,e,r)=>{"use strict";r.d(e,{D:()=>n});var s=r(4382),i=r(1347);class n{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new i.Q1,this.darkColor=t.darkColor?new i.Q1:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof s.e&&this.attachment instanceof s.e&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}},6093:()=>{"use strict";if("undefined"!=typeof window&&window.PIXI){const t=window.require;window.require=e=>t?t(e):e.startsWith("@pixi/")||e.startsWith("pixi.js")?window.PIXI:void 0}},6108:(t,e,r)=>{"use strict";r.d(e,{N:()=>n});var s=r(9107),i=r(1347);class n{data;_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(t,e){this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(t){const e=this.mix;if(0==e)return;const r=this.data.x>0,n=this.data.y>0,a=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,l=this.bone,h=l.data.length;switch(t){case s.A.none:return;case s.A.reset:this.reset();case s.A.update:const t=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=t.time;const u=l.worldX,d=l.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let p=this.remaining,f=this.inertia,m=this.data.step,g=this.skeleton.data.referenceScale,x=-1,y=this.data.limit*c,v=y*Math.abs(t.scaleY);if(y*=Math.abs(t.scaleX),r||n){if(r){const t=(this.ux-u)*f;this.xOffset+=t>y?y:t<-y?-y:t,this.ux=u}if(n){const t=(this.uy-d)*f;this.yOffset+=t>v?v:t<-v?-v:t,this.uy=d}if(p>=m){x=Math.pow(this.damping,60*m);const e=this.massInverse*m,s=this.strength,i=this.wind*g*t.scaleX,a=this.gravity*g*t.scaleY;do{r&&(this.xVelocity+=(i-this.xOffset*s)*e,this.xOffset+=this.xVelocity*m,this.xVelocity*=x),n&&(this.yVelocity-=(a+this.yOffset*s)*e,this.yOffset+=this.yVelocity*m,this.yVelocity*=x),p-=m}while(p>=m)}r&&(l.worldX+=this.xOffset*e*this.data.x),n&&(l.worldY+=this.yOffset*e*this.data.y)}if(a||o){let t=Math.atan2(l.c,l.a),r=0,n=0,c=0,u=this.cx-l.worldX,d=this.cy-l.worldY;if(u>y?u=y:u<-y&&(u=-y),d>v?d=v:d<-v&&(d=-v),a){c=(this.data.rotate+this.data.shearX)*e;let s=Math.atan2(d+this.ty,u+this.tx)-t-this.rotateOffset*c;this.rotateOffset+=(s-Math.ceil(s*i.cj.invPI2-.5)*i.cj.PI2)*f,s=this.rotateOffset*c+t,r=Math.cos(s),n=Math.sin(s),o&&(s=h*l.getWorldScaleX(),s>0&&(this.scaleOffset+=(u*r+d*n)*f/s))}else{r=Math.cos(t),n=Math.sin(t);const e=h*l.getWorldScaleX();e>0&&(this.scaleOffset+=(u*r+d*n)*f/e)}if(p=this.remaining,p>=m){-1==x&&(x=Math.pow(this.damping,60*m));const e=this.massInverse*m,i=this.strength,l=this.wind,u=s.E.yDown?-this.gravity:this.gravity,d=h/g;for(;;)if(p-=m,o&&(this.scaleVelocity+=(l*r-u*n-this.scaleOffset*i)*e,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=x),a){if(this.rotateVelocity-=((l*n+u*r)*d+this.rotateOffset*i)*e,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=x,p<m)break;const s=this.rotateOffset*c+t;r=Math.cos(s),n=Math.sin(s)}else if(p<m)break}}this.remaining=p}this.cx=l.worldX,this.cy=l.worldY;break;case s.A.pose:r&&(l.worldX+=this.xOffset*e*this.data.x),n&&(l.worldY+=this.yOffset*e*this.data.y)}if(a){let t=this.rotateOffset*e,r=0,s=0,i=0;if(this.data.shearX>0){let e=0;this.data.rotate>0&&(e=t*this.data.rotate,r=Math.sin(e),s=Math.cos(e),i=l.b,l.b=s*i-r*l.d,l.d=r*i+s*l.d),e+=t*this.data.shearX,r=Math.sin(e),s=Math.cos(e),i=l.a,l.a=s*i-r*l.c,l.c=r*i+s*l.c}else t*=this.data.rotate,r=Math.sin(t),s=Math.cos(t),i=l.a,l.a=s*i-r*l.c,l.c=r*i+s*l.c,i=l.b,l.b=s*i-r*l.d,l.d=r*i+s*l.d}if(o){const t=1+this.scaleOffset*e*this.data.scaleX;l.a*=t,l.c*=t}t!=s.A.pose&&(this.tx=h*l.a,this.ty=h*l.c),l.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(t,e,r){const s=r*i.cj.degRad,n=Math.cos(s),a=Math.sin(s),o=this.cx-t,l=this.cy-e;this.translate(o*n-l*a-o,o*a+l*n-l)}}},6114:(t,e,r)=>{"use strict";r.d(e,{k:()=>g});var s=r(6675),i=r(1065);const n=[];i.XO.handleByNamedList(i.Ag.Environment,n);var a=r(4687),o=r(8883),l=r(9375),h=r(4696),c=r(1753),u=r(1711),d=r(2255),p=r(4872);const f=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],m=class t extends p.A{constructor(t){super(),this.uid=(0,l.L)("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...f,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(e={}){const r=!0===e.skipExtensionImports||!1===e.manageImports;await async function(t){if(!t)for(let t=0;t<n.length;t++){const e=n[t];if(e.value.test())return void await e.value.load()}}(r),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const t in this._systemsHash)e={...this._systemsHash[t].constructor.defaultOptions,...e};e={...t.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let t=0;t<this.runners.init.items.length;t++)await this.runners.init.items[t].init(e);this._initOptions=e}render(t,e){let r=t;if(r instanceof a.mc&&(r={container:r},e&&((0,h.t6)(h.lj,"passing a second argument is deprecated, please use render options instead"),r.target=e.renderTexture)),r.target||(r.target=this.view.renderTarget),r.target===this.view.renderTarget&&(this._lastObjectRendered=r.container,r.clearColor??(r.clearColor=this.background.colorRgba),r.clear??(r.clear=this.background.clearBeforeRender)),r.clearColor){const t=Array.isArray(r.clearColor)&&4===r.clearColor.length;r.clearColor=t?r.clearColor:s.Q.shared.setValue(r.clearColor).toArray()}r.transform||(r.container.updateLocalTransform(),r.transform=r.container.localTransform),r.container.visible&&(r.container.enableRenderGroup(),this.runners.prerender.emit(r),this.runners.renderStart.emit(r),this.runners.render.emit(r),this.runners.renderEnd.emit(r),this.runners.postrender.emit(r))}resize(t,e,r){const s=this.view.resolution;this.view.resize(t,e,r),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),void 0!==r&&r!==s&&this.runners.resolutionChange.emit(r)}clear(t={}){t.target||(t.target=this.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=u.u.ALL);const{clear:e,clearColor:r,target:i}=t;s.Q.shared.setValue(r??this.background.colorRgba),this.renderTarget.clear(i,e,s.Q.shared.toArray())}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(t=>{this.runners[t]=new d.C(t)})}_addSystems(t){let e;for(e in t){const r=t[e];this._addSystem(r.value,r.name)}}_addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}_addPipes(t,e){const r=e.reduce((t,e)=>(t[e.name]=e.value,t),{});t.forEach(t=>{const e=t.value,s=t.name,i=r[s];this.renderPipes[s]=new e(this,i?new i:null),this.runners.destroy.add(this.renderPipes[s])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(t=>{t.destroy()}),(!0===t||"object"==typeof t&&t.releaseGlobalResources)&&c.L.release(),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!(0,o.f)())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};m.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let g=m},6121:(t,e,r)=>{"use strict";r.d(e,{U:()=>i,Z:()=>n});var s=r(8147);class i{x=0;y=0;scaleX=1;scaleY=1;pivotX=0;pivotY=0;#U=0;#L=1;#N=0;get cos(){return this.#L}get sin(){return this.#N}get rotation(){return this.#U}set rotation(t){this.#U!==t&&(this.#U=t,this.#L=Math.cos(t),this.#N=Math.sin(t))}}class n{x=new s.w(Number.NEGATIVE_INFINITY);y=new s.w(Number.NEGATIVE_INFINITY);scaleX=new s.w(1);scaleY=new s.w(1);rotation=new s.m(0);update(t,e){const r=e.x*t.scaleX.v,s=e.y*t.scaleY.v,i=t.rotation.cos,n=t.rotation.sin;this.scaleX.v=t.scaleX.v*e.scaleX,this.scaleY.v=t.scaleY.v*e.scaleY;const a=e.pivotX*this.scaleX.v,o=e.pivotY*this.scaleY.v,l=e.cos,h=e.sin;this.x.v=t.x.v+(r*i-s*n)-(a*l-o*h),this.y.v=t.y.v+(r*n+s*i)-(a*h+o*l),this.rotation.v=t.rotation.v+e.rotation}get dirty(){return this.x.dirty||this.y.dirty||this.scaleX.dirty||this.scaleY.dirty||this.rotation.dirty}resetDirty(){this.x.resetDirty(),this.y.resetDirty(),this.scaleX.resetDirty(),this.scaleY.resetDirty(),this.rotation.resetDirty()}}},6131:(t,e,r)=>{"use strict";var s=r(1065);class i{execute(t,e){const r=t.state,s=t.renderer,i=e.shader||t.defaultShader;i.resources.uTexture=e.texture._source,i.resources.uniforms=t.localUniforms;const n=s.gl,a=t.getBuffers(e);s.shader.bind(i),s.state.set(r),s.geometry.bind(a.geometry,i.glProgram);const o=2===a.geometry.indexBuffer.data.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;n.drawElements(n.TRIANGLES,6*e.particleChildren.length,o,0)}}var n=r(5199),a=r(4449),o=r(3769),l=r(7433),h=r(9482),c=r(1579),u=r(9798),d=r(8337),p=r(4988),f=r(4142);function m(t,e=null){const r=6*t;if(r>65535?e||(e=new Uint32Array(r)):e||(e=new Uint16Array(r)),e.length!==r)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${r}`);for(let t=0,s=0;t<r;t+=6,s+=4)e[t+0]=s+0,e[t+1]=s+1,e[t+2]=s+2,e[t+3]=s+0,e[t+4]=s+2,e[t+5]=s+3;return e}function g(t,e){const r=[];r.push("\n\n var index = 0;\n\n for (let i = 0; i < ps.length; ++i)\n {\n const p = ps[i];\n\n ");let s=0;for(const i in t){const n=t[i];e===n.dynamic&&(r.push(`offset = index + ${s}`),r.push(n.code),s+=(0,p.m)(n.format).stride/4)}r.push("\n index += stride * 4;\n }\n "),r.unshift(`\n var stride = ${s};\n `);const i=r.join("\n");return new Function("ps","f32v","u32v",i)}class x{constructor(t){this._size=0,this._generateParticleUpdateCache={};const e=this._size=t.size??1e3,r=t.properties;let s=0,i=0;for(const t in r){const e=r[t],n=(0,p.m)(e.format);e.dynamic?i+=n.stride:s+=n.stride}this._dynamicStride=i/4,this._staticStride=s/4,this.staticAttributeBuffer=new f.u(4*e*s),this.dynamicAttributeBuffer=new f.u(4*e*i),this.indexBuffer=m(e);const n=new d.V;let a=0,o=0;this._staticBuffer=new c.h({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:!1,usage:u.S.VERTEX|u.S.COPY_DST}),this._dynamicBuffer=new c.h({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:!1,usage:u.S.VERTEX|u.S.COPY_DST});for(const t in r){const e=r[t],s=(0,p.m)(e.format);e.dynamic?(n.addAttribute(e.attributeName,{buffer:this._dynamicBuffer,stride:4*this._dynamicStride,offset:4*a,format:e.format}),a+=s.size):(n.addAttribute(e.attributeName,{buffer:this._staticBuffer,stride:4*this._staticStride,offset:4*o,format:e.format}),o+=s.size)}n.addIndex(this.indexBuffer);const l=this.getParticleUpdate(r);this._dynamicUpload=l.dynamicUpdate,this._staticUpload=l.staticUpdate,this.geometry=n}getParticleUpdate(t){const e=function(t){const e=[];for(const r in t){const s=t[r];e.push(r,s.code,s.dynamic?"d":"s")}return e.join("_")}(t);return this._generateParticleUpdateCache[e]||(this._generateParticleUpdateCache[e]=this.generateParticleUpdate(t)),this._generateParticleUpdateCache[e]}generateParticleUpdate(t){return function(t){return{dynamicUpdate:g(t,!0),staticUpdate:g(t,!1)}}(t)}update(t,e){t.length>this._size&&(e=!0,this._size=Math.max(t.length,1.5*this._size|0),this.staticAttributeBuffer=new f.u(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new f.u(this._size*this._dynamicStride*4*4),this.indexBuffer=m(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const r=this.dynamicAttributeBuffer;if(this._dynamicUpload(t,r.float32View,r.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,t.length*this._dynamicStride*4,!0),e){const e=this.staticAttributeBuffer;this._staticUpload(t,e.float32View,e.uint32View),this._staticBuffer.setDataWithSize(e.float32View,t.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}var y=r(6675),v=r(5007),_=r(1790),b=r(1657),w=r(9739),T=r(8896),S="\nstruct ParticleUniforms {\n uTranslationMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n uResolution:vec2<f32>,\n};\n\nfn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n{\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\n@group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;\n\n@group(1) @binding(0) var uTexture: texture_2d<f32>;\n@group(1) @binding(1) var uSampler : sampler;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) color : vec4<f32>,\n };\n@vertex\nfn mainVertex(\n @location(0) aVertex: vec2<f32>,\n @location(1) aPosition: vec2<f32>,\n @location(2) aUV: vec2<f32>,\n @location(3) aColor: vec4<f32>,\n @location(4) aRotation: f32,\n) -> VSOutput {\n \n let v = vec2(\n aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),\n aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)\n ) + aPosition;\n\n var position = vec4((uniforms.uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n if(uniforms.uRound == 1.0) {\n position = vec4(roundPixels(position.xy, uniforms.uResolution), position.zw);\n }\n\n let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;\n\n return VSOutput(\n position,\n aUV,\n vColor,\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) color: vec4<f32>,\n @builtin(position) position: vec4<f32>,\n) -> @location(0) vec4<f32> {\n\n var sample = textureSample(uTexture, uSampler, uv) * color;\n \n return sample;\n}";class A extends b.M{constructor(){super({glProgram:v.M.from({vertex:"attribute vec2 aVertex;\nattribute vec2 aUV;\nattribute vec4 aColor;\n\nattribute vec2 aPosition;\nattribute float aRotation;\n\nuniform mat3 uTranslationMatrix;\nuniform float uRound;\nuniform vec2 uResolution;\nuniform vec4 uColor;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n\nvec2 roundPixels(vec2 position, vec2 targetSize)\n{ \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void){\n float cosRotation = cos(aRotation);\n float sinRotation = sin(aRotation);\n float x = aVertex.x * cosRotation - aVertex.y * sinRotation;\n float y = aVertex.x * sinRotation + aVertex.y * cosRotation;\n\n vec2 v = vec2(x, y);\n v = v + aPosition;\n\n gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n if(uRound == 1.0)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n\n vUV = aUV;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;\n}\n",fragment:"varying vec2 vUV;\nvarying vec4 vColor;\n\nuniform sampler2D uTexture;\n\nvoid main(void){\n vec4 color = texture2D(uTexture, vUV) * vColor;\n gl_FragColor = color;\n}"}),gpuProgram:_.B.from({fragment:{source:S,entryPoint:"mainFragment"},vertex:{source:S,entryPoint:"mainVertex"}}),resources:{uTexture:w.g.WHITE.source,uSampler:new T.n({}),uniforms:{uTranslationMatrix:{value:new n.u,type:"mat3x3<f32>"},uColor:{value:new y.Q(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}})}}class C{constructor(t,e){this.state=l.U.for2d(),this.localUniforms=new a.k({uTranslationMatrix:{value:new n.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=t,this.adaptor=e,this.defaultShader=new A,this.state=l.U.for2d()}validateRenderable(t){return!1}addRenderable(t,e){this.renderer.renderPipes.batch.break(e),e.add(t)}getBuffers(t){return t._gpuData[this.renderer.uid]||this._initBuffer(t)}_initBuffer(t){return t._gpuData[this.renderer.uid]=new x({size:t.particleChildren.length,properties:t._properties}),t._gpuData[this.renderer.uid]}updateRenderable(t){}execute(t){const e=t.particleChildren;if(0===e.length)return;const r=this.renderer,s=this.getBuffers(t);t.texture||(t.texture=e[0].texture);const i=this.state;s.update(e,t._childrenDirty),t._childrenDirty=!1,i.blendMode=(0,o.i)(t.blendMode,t.texture._source);const n=this.localUniforms.uniforms,a=n.uTranslationMatrix;t.worldTransform.copyTo(a),a.prepend(r.globalUniforms.globalUniformData.projectionMatrix),n.uResolution=r.globalUniforms.globalUniformData.resolution,n.uRound=r._roundPixels|t._roundPixels,(0,h.V)(t.groupColorAlpha,n.uColor,0),this.adaptor.execute(this,t)}destroy(){this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class P extends C{constructor(t){super(t,new i)}}P.extension={type:[s.Ag.WebGLPipes],name:"particle"};class E{execute(t,e){const r=t.renderer,s=e.shader||t.defaultShader;s.groups[0]=r.renderPipes.uniformBatch.getUniformBindGroup(t.localUniforms,!0),s.groups[1]=r.texture.getTextureBindGroup(e.texture);const i=t.state,n=t.getBuffers(e);r.encoder.draw({geometry:n.geometry,shader:e.shader||t.defaultShader,state:i,size:6*e.particleChildren.length})}}class M extends C{constructor(t){super(t,new E)}}M.extension={type:[s.Ag.WebGPUPipes],name:"particle"},s.XO.add(P),s.XO.add(M)},6147:(t,e,r)=>{"use strict";r.d(e,{q:()=>h});var s=r(5331),i=r(6552),n=r(7399),a=r(6861),o=r(9064),l=r(7786);class h{atlas;constructor(t){this.atlas=t}loadSequence(t,e,r){let s=r.regions;for(let i=0,n=s.length;i<n;i++){let n=r.getPath(e,i),a=this.atlas.findRegion(n);if(null==a)throw new Error("Region not found in atlas: "+n+" (sequence: "+t+")");s[i]=a}}newRegionAttachment(t,e,r,s){let i=new l.Q(e,r);if(null!=s)this.loadSequence(e,r,s);else{let t=this.atlas.findRegion(r);if(!t)throw new Error("Region not found in atlas: "+r+" (region attachment: "+e+")");i.region=t}return i}newMeshAttachment(t,e,r,s){let i=new n.f(e,r);if(null!=s)this.loadSequence(e,r,s);else{let t=this.atlas.findRegion(r);if(!t)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+e+")");i.region=t}return i}newBoundingBoxAttachment(t,e){return new s.b(e)}newPathAttachment(t,e){return new a.H(e)}newPointAttachment(t,e){return new o.Y(e)}newClippingAttachment(t,e){return new i.K(e)}}},6170:(t,e,r)=>{"use strict";r.d(e,{c:()=>a});var s=r(5199),i=r(9390);const n=new s.u;class a{constructor(t=1/0,e=1/0,r=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=n,this.minX=t,this.minY=e,this.maxX=r,this.maxY=s}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new i.M);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=n,this}set(t,e,r,s){this.minX=t,this.minY=e,this.maxX=r,this.maxY=s}addFrame(t,e,r,s,i){i||(i=this.matrix);const n=i.a,a=i.b,o=i.c,l=i.d,h=i.tx,c=i.ty;let u=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=n*t+o*e+h,g=a*t+l*e+c;m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),m=n*r+o*e+h,g=a*r+l*e+c,m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),m=n*t+o*s+h,g=a*t+l*s+c,m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),m=n*r+o*s+h,g=a*r+l*s+c,m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),this.minX=u,this.minY=d,this.maxX=p,this.maxY=f}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,r=this.minY,s=this.maxX,i=this.maxY,{a:n,b:a,c:o,d:l,tx:h,ty:c}=t;let u=n*e+o*r+h,d=a*e+l*r+c;this.minX=u,this.minY=d,this.maxX=u,this.maxY=d,u=n*s+o*r+h,d=a*s+l*r+c,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY,u=n*e+o*i+h,d=a*e+l*i+c,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY,u=n*s+o*i+h,d=a*s+l*i+c,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,r,s){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<r&&(this.minY=r),this.maxY>s&&(this.maxY=s),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new a(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,r,s){let i=this.minX,n=this.minY,a=this.maxX,o=this.maxY;s||(s=this.matrix);const l=s.a,h=s.b,c=s.c,u=s.d,d=s.tx,p=s.ty;for(let s=e;s<r;s+=2){const e=t[s],r=t[s+1],f=l*e+c*r+d,m=h*e+u*r+p;i=f<i?f:i,n=m<n?m:n,a=f>a?f:a,o=m>o?m:o}this.minX=i,this.minY=n,this.maxX=a,this.maxY=o}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}},6184:(t,e,r)=>{"use strict";r.d(e,{v:()=>a});var s=r(6861),i=r(3648),n=r(1347);class a{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0,s=t.bones.length;r<s;r++){let s=e.findBone(t.bones[r].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[r].name}.`);this.bones.push(s)}let r=e.findSlot(t.target.name);if(!r)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=r,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let e=this.target.getAttachment();if(!(e instanceof s.H))return;let r=this.mixRotate,o=this.mixX,l=this.mixY;if(0==r&&0==o&&0==l)return;let h=this.data,c=h.rotateMode==i.Dr.Tangent,u=h.rotateMode==i.Dr.ChainScale,d=this.bones,p=d.length,f=c?p:p+1,m=n.Aq.setArraySize(this.spaces,f),g=u?this.lengths=n.Aq.setArraySize(this.lengths,p):[],x=this.spacing;switch(h.spacingMode){case i.r9.Percent:if(u)for(let t=0,e=f-1;t<e;t++){let e=d[t],r=e.data.length,s=r*e.a,i=r*e.c;g[t]=Math.sqrt(s*s+i*i)}n.Aq.arrayFill(m,1,f,x);break;case i.r9.Proportional:let t=0;for(let e=0,r=f-1;e<r;){let r=d[e],s=r.data.length;if(s<a.epsilon)u&&(g[e]=0),m[++e]=x;else{let i=s*r.a,n=s*r.c,a=Math.sqrt(i*i+n*n);u&&(g[e]=a),m[++e]=a,t+=a}}if(t>0){t=f/t*x;for(let e=1;e<f;e++)m[e]*=t}break;default:let e=h.spacingMode==i.r9.Length;for(let t=0,r=f-1;t<r;){let r=d[t],s=r.data.length;if(s<a.epsilon)u&&(g[t]=0),m[++t]=x;else{let i=s*r.a,n=s*r.c,a=Math.sqrt(i*i+n*n);u&&(g[t]=a),m[++t]=(e?s+x:x)*a/s}}}let y=this.computeWorldPositions(e,f,c),v=y[0],_=y[1],b=h.offsetRotation,w=!1;if(0==b)w=h.rotateMode==i.Dr.Chain;else{w=!1;let t=this.target.bone;b*=t.a*t.d-t.b*t.c>0?n.cj.degRad:-n.cj.degRad}for(let t=0,e=3;t<p;t++,e+=3){let s=d[t];s.worldX+=(v-s.worldX)*o,s.worldY+=(_-s.worldY)*l;let i=y[e],a=y[e+1],h=i-v,p=a-_;if(u){let e=g[t];if(0!=e){let t=(Math.sqrt(h*h+p*p)/e-1)*r+1;s.a*=t,s.c*=t}}if(v=i,_=a,r>0){let i=s.a,a=s.b,o=s.c,l=s.d,u=0,d=0,f=0;if(u=c?y[e-1]:0==m[t+1]?y[e+2]:Math.atan2(p,h),u-=Math.atan2(o,i),w){d=Math.cos(u),f=Math.sin(u);let t=s.data.length;v+=(t*(d*i-f*o)-h)*r,_+=(t*(f*i+d*o)-p)*r}else u+=b;u>n.cj.PI?u-=n.cj.PI2:u<-n.cj.PI&&(u+=n.cj.PI2),u*=r,d=Math.cos(u),f=Math.sin(u),s.a=d*i-f*o,s.b=d*a-f*l,s.c=f*i+d*o,s.d=f*a+d*l}s.updateAppliedTransform()}}computeWorldPositions(t,e,r){let s=this.target,o=this.position,l=this.spaces,h=n.Aq.setArraySize(this.positions,3*e+2),c=this.world,u=t.closed,d=t.worldVerticesLength,p=d/6,f=a.NONE;if(!t.constantSpeed){let m=t.lengths;p-=u?1:2;let g,x=m[p];switch(this.data.positionMode==i.pw.Percent&&(o*=x),this.data.spacingMode){case i.r9.Percent:g=x;break;case i.r9.Proportional:g=x/e;break;default:g=1}c=n.Aq.setArraySize(this.world,8);for(let i=0,n=0,y=0;i<e;i++,n+=3){let e=l[i]*g;o+=e;let v=o;if(u)v%=x,v<0&&(v+=x),y=0;else{if(v<0){f!=a.BEFORE&&(f=a.BEFORE,t.computeWorldVertices(s,2,4,c,0,2)),this.addBeforePosition(v,c,0,h,n);continue}if(v>x){f!=a.AFTER&&(f=a.AFTER,t.computeWorldVertices(s,d-6,4,c,0,2)),this.addAfterPosition(v-x,c,0,h,n);continue}}for(;;y++){let t=m[y];if(!(v>t)){if(0==y)v/=t;else{let e=m[y-1];v=(v-e)/(t-e)}break}}y!=f&&(f=y,u&&y==p?(t.computeWorldVertices(s,d-4,4,c,0,2),t.computeWorldVertices(s,0,4,c,4,2)):t.computeWorldVertices(s,6*y+2,8,c,0,2)),this.addCurvePosition(v,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],h,n,r||i>0&&0==e)}return h}u?(d+=2,c=n.Aq.setArraySize(this.world,d),t.computeWorldVertices(s,2,d-4,c,0,2),t.computeWorldVertices(s,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=n.Aq.setArraySize(this.world,d),t.computeWorldVertices(s,2,d,c,0,2));let m,g=n.Aq.setArraySize(this.curves,p),x=0,y=c[0],v=c[1],_=0,b=0,w=0,T=0,S=0,A=0,C=0,P=0,E=0,M=0,k=0,R=0,B=0,I=0;for(let t=0,e=2;t<p;t++,e+=6)_=c[e],b=c[e+1],w=c[e+2],T=c[e+3],S=c[e+4],A=c[e+5],C=.1875*(y-2*_+w),P=.1875*(v-2*b+T),E=.09375*(3*(_-w)-y+S),M=.09375*(3*(b-T)-v+A),k=2*C+E,R=2*P+M,B=.75*(_-y)+C+.16666667*E,I=.75*(b-v)+P+.16666667*M,x+=Math.sqrt(B*B+I*I),B+=k,I+=R,k+=E,R+=M,x+=Math.sqrt(B*B+I*I),B+=k,I+=R,x+=Math.sqrt(B*B+I*I),B+=k+E,I+=R+M,x+=Math.sqrt(B*B+I*I),g[t]=x,y=S,v=A;switch(this.data.positionMode==i.pw.Percent&&(o*=x),this.data.spacingMode){case i.r9.Percent:m=x;break;case i.r9.Proportional:m=x/e;break;default:m=1}let F=this.segments,O=0;for(let t=0,s=0,i=0,n=0;t<e;t++,s+=3){let e=l[t]*m;o+=e;let a=o;if(u)a%=x,a<0&&(a+=x),i=0;else{if(a<0){this.addBeforePosition(a,c,0,h,s);continue}if(a>x){this.addAfterPosition(a-x,c,d-4,h,s);continue}}for(;;i++){let t=g[i];if(!(a>t)){if(0==i)a/=t;else{let e=g[i-1];a=(a-e)/(t-e)}break}}if(i!=f){f=i;let t=6*i;for(y=c[t],v=c[t+1],_=c[t+2],b=c[t+3],w=c[t+4],T=c[t+5],S=c[t+6],A=c[t+7],C=.03*(y-2*_+w),P=.03*(v-2*b+T),E=.006*(3*(_-w)-y+S),M=.006*(3*(b-T)-v+A),k=2*C+E,R=2*P+M,B=.3*(_-y)+C+.16666667*E,I=.3*(b-v)+P+.16666667*M,O=Math.sqrt(B*B+I*I),F[0]=O,t=1;t<8;t++)B+=k,I+=R,k+=E,R+=M,O+=Math.sqrt(B*B+I*I),F[t]=O;B+=k,I+=R,O+=Math.sqrt(B*B+I*I),F[8]=O,B+=k+E,I+=R+M,O+=Math.sqrt(B*B+I*I),F[9]=O,n=0}for(a*=O;;n++){let t=F[n];if(!(a>t)){if(0==n)a/=t;else{let e=F[n-1];a=n+(a-e)/(t-e)}break}}this.addCurvePosition(.1*a,y,v,_,b,w,T,S,A,h,s,r||t>0&&0==e)}return h}addBeforePosition(t,e,r,s,i){let n=e[r],a=e[r+1],o=e[r+2]-n,l=e[r+3]-a,h=Math.atan2(l,o);s[i]=n+t*Math.cos(h),s[i+1]=a+t*Math.sin(h),s[i+2]=h}addAfterPosition(t,e,r,s,i){let n=e[r+2],a=e[r+3],o=n-e[r],l=a-e[r+1],h=Math.atan2(l,o);s[i]=n+t*Math.cos(h),s[i+1]=a+t*Math.sin(h),s[i+2]=h}addCurvePosition(t,e,r,s,i,n,a,o,l,h,c,u){if(0==t||isNaN(t))return h[c]=e,h[c+1]=r,void(h[c+2]=Math.atan2(i-r,s-e));let d=t*t,p=d*t,f=1-t,m=f*f,g=m*f,x=f*t,y=3*x,v=f*y,_=y*t,b=e*g+s*v+n*_+o*p,w=r*g+i*v+a*_+l*p;h[c]=b,h[c+1]=w,u&&(h[c+2]=t<.001?Math.atan2(i-r,s-e):Math.atan2(w-(r*m+i*x*2+a*d),b-(e*m+s*x*2+n*d)))}}},6185:(t,e,r)=>{"use strict";r.d(e,{P:()=>n});var s=r(1065),i=r(4269);class n extends i.v{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let r=t.format;r||(r=e instanceof Float32Array?"rgba32float":e instanceof Int32Array||e instanceof Uint32Array?"rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({...t,resource:e,format:r}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}n.extension=s.Ag.TextureSource},6212:(t,e,r)=>{"use strict";r.d(e,{P:()=>n});var s=r(1065),i=r(9739);const n={extension:{type:s.Ag.CacheParser,name:"cacheTextureArray"},test:t=>Array.isArray(t)&&t.every(t=>t instanceof i.g),getCacheableAssets:(t,e)=>{const r={};return t.forEach(t=>{e.forEach((e,s)=>{r[t+(0===s?"":s+1)]=e})}),r}}},6257:(t,e,r)=>{"use strict";async function s(t){if("Image"in globalThis)return new Promise(e=>{const r=new Image;r.onload=()=>{e(!0)},r.onerror=()=>{e(!1)},r.src=t});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch(t){return!1}return!0}return!1}r.d(e,{P:()=>s})},6297:(t,e,r)=>{"use strict";r.d(e,{m:()=>g});var s=r(1984),i=r(946),n=r(826),a=r(3450),o=r(2155),l=r(3648),h=r(6571),c=r(5229),u=r(9212),d=r(7285),p=r(1347),f=r(646),m=r(5556);class g{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,r=new h.Y,s="string"==typeof t?JSON.parse(t):t,a=s.skeleton;if(a&&(r.hash=a.hash,r.version=a.spine,r.x=a.x,r.y=a.y,r.width=a.width,r.height=a.height,r.referenceScale=b(a,"referenceScale",100)*e,r.fps=a.fps,r.imagesPath=a.images??null,r.audioPath=a.audio??null),s.bones)for(let t=0;t<s.bones.length;t++){let n=s.bones[t],a=null,o=b(n,"parent",null);o&&(a=r.findBone(o));let l=new i.h(r.bones.length,n.name,a);l.length=b(n,"length",0)*e,l.x=b(n,"x",0)*e,l.y=b(n,"y",0)*e,l.rotation=b(n,"rotation",0),l.scaleX=b(n,"scaleX",1),l.scaleY=b(n,"scaleY",1),l.shearX=b(n,"shearX",0),l.shearY=b(n,"shearY",0),l.inherit=p.Aq.enumValue(i.u,b(n,"inherit","Normal")),l.skinRequired=b(n,"skin",!1);let h=b(n,"color",null);h&&l.color.setFromString(h),r.bones.push(l)}if(s.slots)for(let t=0;t<s.slots.length;t++){let e=s.slots[t],i=e.name,n=r.findBone(e.bone);if(!n)throw new Error(`Couldn't find bone ${e.bone} for slot ${i}`);let a=new u.P(r.slots.length,i,n),o=b(e,"color",null);o&&a.color.setFromString(o);let l=b(e,"dark",null);l&&(a.darkColor=p.Q1.fromString(l)),a.attachmentName=b(e,"attachment",null),a.blendMode=p.Aq.enumValue(u.N,b(e,"blend","normal")),a.visible=b(e,"visible",!0),r.slots.push(a)}if(s.ik)for(let t=0;t<s.ik.length;t++){let i=s.ik[t],n=new o.Q(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);for(let t=0;t<i.bones.length;t++){let e=r.findBone(i.bones[t]);if(!e)throw new Error(`Couldn't find bone ${i.bones[t]} for IK constraint ${i.name}.`);n.bones.push(e)}let a=r.findBone(i.target);if(!a)throw new Error(`Couldn't find target bone ${i.target} for IK constraint ${i.name}.`);n.target=a,n.mix=b(i,"mix",1),n.softness=b(i,"softness",0)*e,n.bendDirection=b(i,"bendPositive",!0)?1:-1,n.compress=b(i,"compress",!1),n.stretch=b(i,"stretch",!1),n.uniform=b(i,"uniform",!1),r.ikConstraints.push(n)}if(s.transform)for(let t=0;t<s.transform.length;t++){let i=s.transform[t],n=new d._(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);for(let t=0;t<i.bones.length;t++){let e=i.bones[t],s=r.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for transform constraint ${i.name}.`);n.bones.push(s)}let a=i.target,o=r.findBone(a);if(!o)throw new Error(`Couldn't find target bone ${a} for transform constraint ${i.name}.`);n.target=o,n.local=b(i,"local",!1),n.relative=b(i,"relative",!1),n.offsetRotation=b(i,"rotation",0),n.offsetX=b(i,"x",0)*e,n.offsetY=b(i,"y",0)*e,n.offsetScaleX=b(i,"scaleX",0),n.offsetScaleY=b(i,"scaleY",0),n.offsetShearY=b(i,"shearY",0),n.mixRotate=b(i,"mixRotate",1),n.mixX=b(i,"mixX",1),n.mixY=b(i,"mixY",n.mixX),n.mixScaleX=b(i,"mixScaleX",1),n.mixScaleY=b(i,"mixScaleY",n.mixScaleX),n.mixShearY=b(i,"mixShearY",1),r.transformConstraints.push(n)}if(s.path)for(let t=0;t<s.path.length;t++){let i=s.path[t],n=new l.rX(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);for(let t=0;t<i.bones.length;t++){let e=i.bones[t],s=r.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for path constraint ${i.name}.`);n.bones.push(s)}let a=i.target,o=r.findSlot(a);if(!o)throw new Error(`Couldn't find target slot ${a} for path constraint ${i.name}.`);n.target=o,n.positionMode=p.Aq.enumValue(l.pw,b(i,"positionMode","Percent")),n.spacingMode=p.Aq.enumValue(l.r9,b(i,"spacingMode","Length")),n.rotateMode=p.Aq.enumValue(l.Dr,b(i,"rotateMode","Tangent")),n.offsetRotation=b(i,"rotation",0),n.position=b(i,"position",0),n.positionMode==l.pw.Fixed&&(n.position*=e),n.spacing=b(i,"spacing",0),n.spacingMode!=l.r9.Length&&n.spacingMode!=l.r9.Fixed||(n.spacing*=e),n.mixRotate=b(i,"mixRotate",1),n.mixX=b(i,"mixX",1),n.mixY=b(i,"mixY",n.mixX),r.pathConstraints.push(n)}if(s.physics)for(let t=0;t<s.physics.length;t++){const i=s.physics[t],n=new m.P(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);const a=i.bone,o=r.findBone(a);if(null==o)throw new Error("Physics bone not found: "+a);n.bone=o,n.x=b(i,"x",0),n.y=b(i,"y",0),n.rotate=b(i,"rotate",0),n.scaleX=b(i,"scaleX",0),n.shearX=b(i,"shearX",0),n.limit=b(i,"limit",5e3)*e,n.step=1/b(i,"fps",60),n.inertia=b(i,"inertia",1),n.strength=b(i,"strength",100),n.damping=b(i,"damping",1),n.massInverse=1/b(i,"mass",1),n.wind=b(i,"wind",0),n.gravity=b(i,"gravity",0),n.mix=b(i,"mix",1),n.inertiaGlobal=b(i,"inertiaGlobal",!1),n.strengthGlobal=b(i,"strengthGlobal",!1),n.dampingGlobal=b(i,"dampingGlobal",!1),n.massGlobal=b(i,"massGlobal",!1),n.windGlobal=b(i,"windGlobal",!1),n.gravityGlobal=b(i,"gravityGlobal",!1),n.mixGlobal=b(i,"mixGlobal",!1),r.physicsConstraints.push(n)}if(s.skins)for(let t=0;t<s.skins.length;t++){let e=s.skins[t],i=new c.M(e.name);if(e.bones)for(let t=0;t<e.bones.length;t++){let s=e.bones[t],n=r.findBone(s);if(!n)throw new Error(`Couldn't find bone ${s} for skin ${e.name}.`);i.bones.push(n)}if(e.ik)for(let t=0;t<e.ik.length;t++){let s=e.ik[t],n=r.findIkConstraint(s);if(!n)throw new Error(`Couldn't find IK constraint ${s} for skin ${e.name}.`);i.constraints.push(n)}if(e.transform)for(let t=0;t<e.transform.length;t++){let s=e.transform[t],n=r.findTransformConstraint(s);if(!n)throw new Error(`Couldn't find transform constraint ${s} for skin ${e.name}.`);i.constraints.push(n)}if(e.path)for(let t=0;t<e.path.length;t++){let s=e.path[t],n=r.findPathConstraint(s);if(!n)throw new Error(`Couldn't find path constraint ${s} for skin ${e.name}.`);i.constraints.push(n)}if(e.physics)for(let t=0;t<e.physics.length;t++){let s=e.physics[t],n=r.findPhysicsConstraint(s);if(!n)throw new Error(`Couldn't find physics constraint ${s} for skin ${e.name}.`);i.constraints.push(n)}for(let t in e.attachments){let s=r.findSlot(t);if(!s)throw new Error(`Couldn't find slot ${t} for skin ${e.name}.`);let n=e.attachments[t];for(let t in n){let e=this.readAttachment(n[t],i,s.index,t,r);e&&i.setAttachment(s.index,t,e)}}r.skins.push(i),"default"==i.name&&(r.defaultSkin=i)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=e.skin?r.findSkin(e.skin):r.defaultSkin;if(!s)throw new Error(`Skin not found: ${e.skin}`);let i=s.getAttachment(e.slotIndex,e.parent);if(!i)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?i:e.mesh,e.mesh.setParentMesh(i),null!=e.mesh.region&&e.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(let t in s.events){let e=s.events[t],i=new n.R(t);i.intValue=b(e,"int",0),i.floatValue=b(e,"float",0),i.stringValue=b(e,"string",""),i.audioPath=b(e,"audio",null),i.audioPath&&(i.volume=b(e,"volume",1),i.balance=b(e,"balance",0)),r.events.push(i)}if(s.animations)for(let t in s.animations){let e=s.animations[t];this.readAnimation(e,t,r)}return r}readAttachment(t,e,r,s,i){let n=this.scale;switch(s=b(t,"name",s),b(t,"type","region")){case"region":{let r=b(t,"path",s),i=this.readSequence(b(t,"sequence",null)),a=this.attachmentLoader.newRegionAttachment(e,s,r,i);if(!a)return null;a.path=r,a.x=b(t,"x",0)*n,a.y=b(t,"y",0)*n,a.scaleX=b(t,"scaleX",1),a.scaleY=b(t,"scaleY",1),a.rotation=b(t,"rotation",0),a.width=t.width*n,a.height=t.height*n,a.sequence=i;let o=b(t,"color",null);return o&&a.color.setFromString(o),null!=a.region&&a.updateRegion(),a}case"boundingbox":{let r=this.attachmentLoader.newBoundingBoxAttachment(e,s);if(!r)return null;this.readVertices(t,r,t.vertexCount<<1);let i=b(t,"color",null);return i&&r.color.setFromString(i),r}case"mesh":case"linkedmesh":{let i=b(t,"path",s),a=this.readSequence(b(t,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(e,s,i,a);if(!o)return null;o.path=i;let l=b(t,"color",null);l&&o.color.setFromString(l),o.width=b(t,"width",0)*n,o.height=b(t,"height",0)*n,o.sequence=a;let h=b(t,"parent",null);if(h)return this.linkedMeshes.push(new x(o,b(t,"skin",null),r,h,b(t,"timelines",!0))),o;let c=t.uvs;return this.readVertices(t,o,c.length),o.triangles=t.triangles,o.regionUVs=c,null!=o.region&&o.updateRegion(),o.edges=b(t,"edges",null),o.hullLength=2*b(t,"hull",0),o}case"path":{let r=this.attachmentLoader.newPathAttachment(e,s);if(!r)return null;r.closed=b(t,"closed",!1),r.constantSpeed=b(t,"constantSpeed",!0);let i=t.vertexCount;this.readVertices(t,r,i<<1);let a=p.Aq.newArray(i/3,0);for(let e=0;e<t.lengths.length;e++)a[e]=t.lengths[e]*n;r.lengths=a;let o=b(t,"color",null);return o&&r.color.setFromString(o),r}case"point":{let r=this.attachmentLoader.newPointAttachment(e,s);if(!r)return null;r.x=b(t,"x",0)*n,r.y=b(t,"y",0)*n,r.rotation=b(t,"rotation",0);let i=b(t,"color",null);return i&&r.color.setFromString(i),r}case"clipping":{let r=this.attachmentLoader.newClippingAttachment(e,s);if(!r)return null;let n=b(t,"end",null);n&&(r.endSlot=i.findSlot(n));let a=t.vertexCount;this.readVertices(t,r,a<<1);let o=b(t,"color",null);return o&&r.color.setFromString(o),r}}return null}readSequence(t){if(null==t)return null;let e=new f.gd(b(t,"count",0));return e.start=b(t,"start",1),e.digits=b(t,"digits",0),e.setupIndex=b(t,"setup",0),e}readVertices(t,e,r){let s=this.scale;e.worldVerticesLength=r;let i=t.vertices;if(r==i.length){let t=p.Aq.toFloatArray(i);if(1!=s)for(let e=0,r=i.length;e<r;e++)t[e]*=s;return void(e.vertices=t)}let n=new Array,a=new Array;for(let t=0,e=i.length;t<e;){let e=i[t++];a.push(e);for(let r=t+4*e;t<r;t+=4)a.push(i[t]),n.push(i[t+1]*s),n.push(i[t+2]*s),n.push(i[t+3])}e.bones=a,e.vertices=p.Aq.toFloatArray(n)}readAnimation(t,e,r){let n=this.scale,o=new Array;if(t.slots)for(let e in t.slots){let i=t.slots[e],n=r.findSlot(e);if(!n)throw new Error("Slot not found: "+e);let a=n.index;for(let t in i){let e=i[t];if(!e)continue;let r=e.length;if("attachment"==t){let t=new s.zK(r,a);for(let s=0;s<r;s++){let r=e[s];t.setFrame(s,b(r,"time",0),b(r,"name",null))}o.push(t)}else if("rgba"==t){let t=new s.EP(r,r<<2,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.color);for(let r=0,s=0;;r++){t.setFrame(r,n,l.r,l.g,l.b,l.a);let a=e[r+1];if(!a){t.shrink(s);break}let o=b(a,"time",0),h=p.Q1.fromString(a.color),c=i.curve;c&&(s=_(c,t,s,r,0,n,o,l.r,h.r,1),s=_(c,t,s,r,1,n,o,l.g,h.g,1),s=_(c,t,s,r,2,n,o,l.b,h.b,1),s=_(c,t,s,r,3,n,o,l.a,h.a,1)),n=o,l=h,i=a}o.push(t)}else if("rgb"==t){let t=new s.Di(r,3*r,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.color);for(let r=0,s=0;;r++){t.setFrame(r,n,l.r,l.g,l.b);let a=e[r+1];if(!a){t.shrink(s);break}let o=b(a,"time",0),h=p.Q1.fromString(a.color),c=i.curve;c&&(s=_(c,t,s,r,0,n,o,l.r,h.r,1),s=_(c,t,s,r,1,n,o,l.g,h.g,1),s=_(c,t,s,r,2,n,o,l.b,h.b,1)),n=o,l=h,i=a}o.push(t)}else if("alpha"==t)o.push(y(e,new s._Y(r,r,a),0,1));else if("rgba2"==t){let t=new s.Ev(r,7*r,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.light),h=p.Q1.fromString(i.dark);for(let r=0,s=0;;r++){t.setFrame(r,n,l.r,l.g,l.b,l.a,h.r,h.g,h.b);let a=e[r+1];if(!a){t.shrink(s);break}let o=b(a,"time",0),c=p.Q1.fromString(a.light),u=p.Q1.fromString(a.dark),d=i.curve;d&&(s=_(d,t,s,r,0,n,o,l.r,c.r,1),s=_(d,t,s,r,1,n,o,l.g,c.g,1),s=_(d,t,s,r,2,n,o,l.b,c.b,1),s=_(d,t,s,r,3,n,o,l.a,c.a,1),s=_(d,t,s,r,4,n,o,h.r,u.r,1),s=_(d,t,s,r,5,n,o,h.g,u.g,1),s=_(d,t,s,r,6,n,o,h.b,u.b,1)),n=o,l=c,h=u,i=a}o.push(t)}else if("rgb2"==t){let t=new s.fT(r,6*r,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.light),h=p.Q1.fromString(i.dark);for(let r=0,s=0;;r++){t.setFrame(r,n,l.r,l.g,l.b,h.r,h.g,h.b);let a=e[r+1];if(!a){t.shrink(s);break}let o=b(a,"time",0),c=p.Q1.fromString(a.light),u=p.Q1.fromString(a.dark),d=i.curve;d&&(s=_(d,t,s,r,0,n,o,l.r,c.r,1),s=_(d,t,s,r,1,n,o,l.g,c.g,1),s=_(d,t,s,r,2,n,o,l.b,c.b,1),s=_(d,t,s,r,3,n,o,h.r,u.r,1),s=_(d,t,s,r,4,n,o,h.g,u.g,1),s=_(d,t,s,r,5,n,o,h.b,u.b,1)),n=o,l=c,h=u,i=a}o.push(t)}}}if(t.bones)for(let e in t.bones){let a=t.bones[e],l=r.findBone(e);if(!l)throw new Error("Bone not found: "+e);let h=l.index;for(let t in a){let e=a[t],r=e.length;if(0!=r)if("rotate"===t)o.push(y(e,new s.NQ(r,r,h),0,1));else if("translate"===t){let t=new s.Sr(r,r<<1,h);o.push(v(e,t,"x","y",0,n))}else if("translatex"===t){let t=new s.GU(r,r,h);o.push(y(e,t,0,n))}else if("translatey"===t){let t=new s.nS(r,r,h);o.push(y(e,t,0,n))}else if("scale"===t){let t=new s.i9(r,r<<1,h);o.push(v(e,t,"x","y",1,1))}else if("scalex"===t){let t=new s.So(r,r,h);o.push(y(e,t,1,1))}else if("scaley"===t){let t=new s.pR(r,r,h);o.push(y(e,t,1,1))}else if("shear"===t){let t=new s.$l(r,r<<1,h);o.push(v(e,t,"x","y",0,1))}else if("shearx"===t){let t=new s.jx(r,r,h);o.push(y(e,t,0,1))}else if("sheary"===t){let t=new s.eP(r,r,h);o.push(y(e,t,0,1))}else if("inherit"===t){let t=new s.hd(r,l.index);for(let r=0;r<e.length;r++){let s=e[r];t.setFrame(r,b(s,"time",0),p.Aq.enumValue(i.u,b(s,"inherit","Normal")))}o.push(t)}}}if(t.ik)for(let e in t.ik){let i=t.ik[e],a=i[0];if(!a)continue;let l=r.findIkConstraint(e);if(!l)throw new Error("IK Constraint not found: "+e);let h=r.ikConstraints.indexOf(l),c=new s.pA(i.length,i.length<<1,h),u=b(a,"time",0),d=b(a,"mix",1),p=b(a,"softness",0)*n;for(let t=0,e=0;;t++){c.setFrame(t,u,d,p,b(a,"bendPositive",!0)?1:-1,b(a,"compress",!1),b(a,"stretch",!1));let r=i[t+1];if(!r){c.shrink(e);break}let s=b(r,"time",0),o=b(r,"mix",1),l=b(r,"softness",0)*n,h=a.curve;h&&(e=_(h,c,e,t,0,u,s,d,o,1),e=_(h,c,e,t,1,u,s,p,l,n)),u=s,d=o,p=l,a=r}o.push(c)}if(t.transform)for(let e in t.transform){let i=t.transform[e],n=i[0];if(!n)continue;let a=r.findTransformConstraint(e);if(!a)throw new Error("Transform constraint not found: "+e);let l=r.transformConstraints.indexOf(a),h=new s.To(i.length,6*i.length,l),c=b(n,"time",0),u=b(n,"mixRotate",1),d=b(n,"mixX",1),p=b(n,"mixY",d),f=b(n,"mixScaleX",1),m=b(n,"mixScaleY",f),g=b(n,"mixShearY",1);for(let t=0,e=0;;t++){h.setFrame(t,c,u,d,p,f,m,g);let r=i[t+1];if(!r){h.shrink(e);break}let s=b(r,"time",0),a=b(r,"mixRotate",1),o=b(r,"mixX",1),l=b(r,"mixY",o),x=b(r,"mixScaleX",1),y=b(r,"mixScaleY",x),v=b(r,"mixShearY",1),w=n.curve;w&&(e=_(w,h,e,t,0,c,s,u,a,1),e=_(w,h,e,t,1,c,s,d,o,1),e=_(w,h,e,t,2,c,s,p,l,1),e=_(w,h,e,t,3,c,s,f,x,1),e=_(w,h,e,t,4,c,s,m,y,1),e=_(w,h,e,t,5,c,s,g,v,1)),c=s,u=a,d=o,p=l,f=x,m=y,f=x,n=r}o.push(h)}if(t.path)for(let e in t.path){let i=t.path[e],a=r.findPathConstraint(e);if(!a)throw new Error("Path constraint not found: "+e);let h=r.pathConstraints.indexOf(a);for(let t in i){let e=i[t],r=e[0];if(!r)continue;let c=e.length;if("position"===t){let t=new s.vz(c,c,h);o.push(y(e,t,0,a.positionMode==l.pw.Fixed?n:1))}else if("spacing"===t){let t=new s.vl(c,c,h);o.push(y(e,t,0,a.spacingMode==l.r9.Length||a.spacingMode==l.r9.Fixed?n:1))}else if("mix"===t){let t=new s.I6(c,3*c,h),i=b(r,"time",0),n=b(r,"mixRotate",1),a=b(r,"mixX",1),l=b(r,"mixY",a);for(let s=0,o=0;;s++){t.setFrame(s,i,n,a,l);let h=e[s+1];if(!h){t.shrink(o);break}let c=b(h,"time",0),u=b(h,"mixRotate",1),d=b(h,"mixX",1),p=b(h,"mixY",d),f=r.curve;f&&(o=_(f,t,o,s,0,i,c,n,u,1),o=_(f,t,o,s,1,i,c,a,d,1),o=_(f,t,o,s,2,i,c,l,p,1)),i=c,n=u,a=d,l=p,r=h}o.push(t)}}}if(t.physics)for(let e in t.physics){let i=t.physics[e],n=-1;if(e.length>0){let t=r.findPhysicsConstraint(e);if(!t)throw new Error("Physics constraint not found: "+e);n=r.physicsConstraints.indexOf(t)}for(let t in i){let e=i[t],r=e[0];if(!r)continue;let a,l=e.length;if("reset"==t){const t=new s.lJ(l,n);for(let s=0;null!=r;r=e[s+1],s++)t.setFrame(s,b(r,"time",0));o.push(t);continue}if("inertia"==t)a=new s.oc(l,l,n);else if("strength"==t)a=new s.$4(l,l,n);else if("damping"==t)a=new s.yz(l,l,n);else if("mass"==t)a=new s.Ms(l,l,n);else if("wind"==t)a=new s.UJ(l,l,n);else if("gravity"==t)a=new s.g(l,l,n);else{if("mix"!=t)continue;a=new s.yJ(l,l,n)}o.push(y(e,a,0,1))}}if(t.attachments)for(let e in t.attachments){let i=t.attachments[e],a=r.findSkin(e);if(!a)throw new Error("Skin not found: "+e);for(let t in i){let e=i[t],l=r.findSlot(t);if(!l)throw new Error("Slot not found: "+t);let h=l.index;for(let t in e){let r=e[t],i=a.getAttachment(h,t);for(let t in r){let e=r[t],a=e[0];if(a)if("deform"==t){let t=i.bones,r=i.vertices,l=t?r.length/3*2:r.length,c=new s.jQ(e.length,e.length,h,i),u=b(a,"time",0);for(let s=0,i=0;;s++){let o,h=b(a,"vertices",null);if(h){o=p.Aq.newFloatArray(l);let e=b(a,"offset",0);if(p.Aq.arrayCopy(h,0,o,e,h.length),1!=n)for(let t=e,r=t+h.length;t<r;t++)o[t]*=n;if(!t)for(let t=0;t<l;t++)o[t]+=r[t]}else o=t?p.Aq.newFloatArray(l):r;c.setFrame(s,u,o);let d=e[s+1];if(!d){c.shrink(i);break}let f=b(d,"time",0),m=a.curve;m&&(i=_(m,c,i,s,0,u,f,0,1,1)),u=f,a=d}o.push(c)}else if("sequence"==t){let t=new s.lP(e.length,h,i),r=0;for(let s=0;s<e.length;s++){let i=b(a,"delay",r),n=b(a,"time",0),o=f.zu[b(a,"mode","hold")],l=b(a,"index",0);t.setFrame(s,n,o,l,i),r=i,a=e[s+1]}o.push(t)}}}}}if(t.drawOrder){let e=new s.Kn(t.drawOrder.length),i=r.slots.length,n=0;for(let s=0;s<t.drawOrder.length;s++,n++){let a=t.drawOrder[s],o=null,l=b(a,"offsets",null);if(l){o=p.Aq.newArray(i,-1);let t=p.Aq.newArray(i-l.length,0),e=0,s=0;for(let i=0;i<l.length;i++){let n=l[i],a=r.findSlot(n.slot);if(!a)throw new Error("Slot not found: "+a);let h=a.index;for(;e!=h;)t[s++]=e++;o[e+n.offset]=e++}for(;e<i;)t[s++]=e++;for(let e=i-1;e>=0;e--)-1==o[e]&&(o[e]=t[--s])}e.setFrame(n,b(a,"time",0),o)}o.push(e)}if(t.events){let e=new s.qs(t.events.length),i=0;for(let s=0;s<t.events.length;s++,i++){let n=t.events[s],o=r.findEvent(n.name);if(!o)throw new Error("Event not found: "+n.name);let l=new a.J(p.Aq.toSinglePrecision(b(n,"time",0)),o);l.intValue=b(n,"int",o.intValue),l.floatValue=b(n,"float",o.floatValue),l.stringValue=b(n,"string",o.stringValue),l.data.audioPath&&(l.volume=b(n,"volume",1),l.balance=b(n,"balance",0)),e.setFrame(i,l)}o.push(e)}let h=0;for(let t=0,e=o.length;t<e;t++)h=Math.max(h,o[t].getDuration());r.animations.push(new s.X5(e,o,h))}}class x{parent;skin;slotIndex;mesh;inheritTimeline;constructor(t,e,r,s,i){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=s,this.inheritTimeline=i}}function y(t,e,r,s){let i=t[0],n=b(i,"time",0),a=b(i,"value",r)*s,o=0;for(let l=0;;l++){e.setFrame(l,n,a);let h=t[l+1];if(!h)return e.shrink(o),e;let c=b(h,"time",0),u=b(h,"value",r)*s;i.curve&&(o=_(i.curve,e,o,l,0,n,c,a,u,s)),n=c,a=u,i=h}}function v(t,e,r,s,i,n){let a=t[0],o=b(a,"time",0),l=b(a,r,i)*n,h=b(a,s,i)*n,c=0;for(let u=0;;u++){e.setFrame(u,o,l,h);let d=t[u+1];if(!d)return e.shrink(c),e;let p=b(d,"time",0),f=b(d,r,i)*n,m=b(d,s,i)*n,g=a.curve;g&&(c=_(g,e,c,u,0,o,p,l,f,n),c=_(g,e,c,u,1,o,p,h,m,n)),o=p,l=f,h=m,a=d}}function _(t,e,r,s,i,n,a,o,l,h){if("stepped"==t)return e.setStepped(s),r;let c=i<<2,u=t[c],d=t[c+1]*h,p=t[c+2],f=t[c+3]*h;return e.setBezier(r,s,i,n,o,u,d,p,f,a,l),r+1}function b(t,e,r){return void 0!==t[e]?t[e]:r}},6307:(t,e,r)=>{"use strict";r.d(e,{u:()=>a});var s=r(1065),i=r(2027),n=r(3798);const a={extension:{type:s.Ag.ResolveParser,priority:-2,name:"resolveJson"},test:t=>i.x.RETINA_PREFIX.test(t)&&t.endsWith(".json"),parse:n.j.parse}},6364:(t,e,r)=>{"use strict";r.d(e,{GH:()=>ct});var s=r(1065),i=r(2791),n=r(4404),a=r(4582),o=r(4696),l=r(761),h=r(5199),c=r(9390);function u(t,e,r,s,i){const n=e.a,a=e.b,o=e.c,l=e.d,h=e.tx,c=e.ty;r||(r=0),s||(s=2),i||(i=t.length/s-r);let u=r*s;for(let e=0;e<i;e++){const e=t[u],r=t[u+1];t[u]=n*e+o*r+h,t[u+1]=a*e+l*r+c,u+=s}}var d=r(9739),p=r(5008);const f={extension:{type:s.Ag.ShapeBuilder,name:"circle"},build(t,e){let r,s,i,n,a,o;if("circle"===t.type){const e=t;if(a=o=e.radius,a<=0)return!1;r=e.x,s=e.y,i=n=0}else if("ellipse"===t.type){const e=t;if(a=e.halfWidth,o=e.halfHeight,a<=0||o<=0)return!1;r=e.x,s=e.y,i=n=0}else{const e=t,l=e.width/2,h=e.height/2;r=e.x+l,s=e.y+h,a=o=Math.max(0,Math.min(e.radius,Math.min(l,h))),i=l-a,n=h-o}if(i<0||n<0)return!1;const l=Math.ceil(2.3*Math.sqrt(a+o)),h=8*l+(i?4:0)+(n?4:0);if(0===h)return!1;if(0===l)return e[0]=e[6]=r+i,e[1]=e[3]=s+n,e[2]=e[4]=r-i,e[5]=e[7]=s-n,!0;let c=0,u=4*l+(i?2:0)+2,d=u,p=h,f=i+a,m=n,g=r+f,x=r-f,y=s+m;if(e[c++]=g,e[c++]=y,e[--u]=y,e[--u]=x,n){const t=s-m;e[d++]=x,e[d++]=t,e[--p]=t,e[--p]=g}for(let t=1;t<l;t++){const h=Math.PI/2*(t/l),f=i+Math.cos(h)*a,m=n+Math.sin(h)*o,g=r+f,x=r-f,y=s+m,v=s-m;e[c++]=g,e[c++]=y,e[--u]=y,e[--u]=x,e[d++]=x,e[d++]=v,e[--p]=v,e[--p]=g}f=i,m=n+o,g=r+f,x=r-f,y=s+m;const v=s-m;return e[c++]=g,e[c++]=y,e[--p]=v,e[--p]=g,i&&(e[c++]=x,e[c++]=y,e[--p]=v,e[--p]=x),!0},triangulate(t,e,r,s,i,n){if(0===t.length)return;let a=0,o=0;for(let e=0;e<t.length;e+=2)a+=t[e],o+=t[e+1];a/=t.length/2,o/=t.length/2;let l=s;e[l*r]=a,e[l*r+1]=o;const h=l++;for(let s=0;s<t.length;s+=2)e[l*r]=t[s],e[l*r+1]=t[s+1],s>0&&(i[n++]=l,i[n++]=h,i[n++]=l-1),l++;i[n++]=h+1,i[n++]=h,i[n++]=l-1}},m={...f,extension:{...f.extension,name:"ellipse"}},g={...f,extension:{...f.extension,name:"roundedRectangle"}};var x=r(59);const y=1e-4;function v(t,e,r,s,i,n,a,o){let l,h;a?(l=s,h=-r):(l=-s,h=r);const c=t-r*i+l,u=e-s*i+h,d=t+r*n+l,p=e+s*n+h;return o.push(c,u),o.push(d,p),2}function _(t,e,r,s,i,n,a,o){const l=r-t,h=s-e;let c=Math.atan2(l,h),u=Math.atan2(i-t,n-e);o&&c<u?c+=2*Math.PI:!o&&c>u&&(u+=2*Math.PI);let d=c;const p=u-c,f=Math.abs(p),m=Math.sqrt(l*l+h*h),g=1+(15*f*Math.sqrt(m)/Math.PI|0),x=p/g;if(d+=x,o){a.push(t,e),a.push(r,s);for(let r=1,s=d;r<g;r++,s+=x)a.push(t,e),a.push(t+Math.sin(s)*m,e+Math.cos(s)*m);a.push(t,e),a.push(i,n)}else{a.push(r,s),a.push(t,e);for(let r=1,s=d;r<g;r++,s+=x)a.push(t+Math.sin(s)*m,e+Math.cos(s)*m),a.push(t,e);a.push(i,n),a.push(t,e)}return 2*g}function b(t,e,r=2){const s=e&&e.length,i=s?e[0]*r:t.length;let n=w(t,0,i,r,!0);const a=[];if(!n||n.next===n.prev)return a;let o,l,h;if(s&&(n=function(t,e,r,s){const i=[];for(let r=0,n=e.length;r<n;r++){const a=w(t,e[r]*s,r<n-1?e[r+1]*s:t.length,s,!1);a===a.next&&(a.steiner=!0),i.push(I(a))}i.sort(M);for(let t=0;t<i.length;t++)r=k(i[t],r);return r}(t,e,n,r)),t.length>80*r){o=t[0],l=t[1];let e=o,s=l;for(let n=r;n<i;n+=r){const r=t[n],i=t[n+1];r<o&&(o=r),i<l&&(l=i),r>e&&(e=r),i>s&&(s=i)}h=Math.max(e-o,s-l),h=0!==h?32767/h:0}return S(n,a,r,o,l,h,0),a}function w(t,e,r,s,i){let n;if(i===function(t,e,r,s){let i=0;for(let n=e,a=r-s;n<r;n+=s)i+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return i}(t,e,r,s)>0)for(let i=e;i<r;i+=s)n=z(i/s|0,t[i],t[i+1],n);else for(let i=r-s;i>=e;i-=s)n=z(i/s|0,t[i],t[i+1],n);return n&&U(n,n.next)&&(W(n),n=n.next),n}function T(t,e){if(!t)return t;e||(e=t);let r,s=t;do{if(r=!1,s.steiner||!U(s,s.next)&&0!==D(s.prev,s,s.next))s=s.next;else{if(W(s),s=e=s.prev,s===s.next)break;r=!0}}while(r||s!==e);return e}function S(t,e,r,s,i,n,a){if(!t)return;!a&&n&&function(t,e,r,s){let i=t;do{0===i.z&&(i.z=B(i.x,i.y,e,r,s)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let s,i=t;t=null;let n=null;for(e=0;i;){e++;let a=i,o=0;for(let t=0;t<r&&(o++,a=a.nextZ,a);t++);let l=r;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||i.z<=a.z)?(s=i,i=i.nextZ,o--):(s=a,a=a.nextZ,l--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;i=a}n.nextZ=null,r*=2}while(e>1)}(i)}(t,s,i,n);let o=t;for(;t.prev!==t.next;){const l=t.prev,h=t.next;if(n?C(t,s,i,n):A(t))e.push(l.i,t.i,h.i),W(t),t=h.next,o=h.next;else if((t=h)===o){a?1===a?S(t=P(T(t),e),e,r,s,i,n,2):2===a&&E(t,e,r,s,i,n):S(T(t),e,r,s,i,n,1);break}}}function A(t){const e=t.prev,r=t,s=t.next;if(D(e,r,s)>=0)return!1;const i=e.x,n=r.x,a=s.x,o=e.y,l=r.y,h=s.y,c=Math.min(i,n,a),u=Math.min(o,l,h),d=Math.max(i,n,a),p=Math.max(o,l,h);let f=s.next;for(;f!==e;){if(f.x>=c&&f.x<=d&&f.y>=u&&f.y<=p&&O(i,o,n,l,a,h,f.x,f.y)&&D(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function C(t,e,r,s){const i=t.prev,n=t,a=t.next;if(D(i,n,a)>=0)return!1;const o=i.x,l=n.x,h=a.x,c=i.y,u=n.y,d=a.y,p=Math.min(o,l,h),f=Math.min(c,u,d),m=Math.max(o,l,h),g=Math.max(c,u,d),x=B(p,f,e,r,s),y=B(m,g,e,r,s);let v=t.prevZ,_=t.nextZ;for(;v&&v.z>=x&&_&&_.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==a&&O(o,c,l,u,h,d,v.x,v.y)&&D(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==a&&O(o,c,l,u,h,d,_.x,_.y)&&D(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==a&&O(o,c,l,u,h,d,v.x,v.y)&&D(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=y;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==a&&O(o,c,l,u,h,d,_.x,_.y)&&D(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function P(t,e){let r=t;do{const s=r.prev,i=r.next.next;!U(s,i)&&L(s,r,r.next,i)&&V(s,i)&&V(i,s)&&(e.push(s.i,r.i,i.i),W(r),W(r.next),r=t=i),r=r.next}while(r!==t);return T(r)}function E(t,e,r,s,i,n){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&G(a,t)){let o=Y(a,t);return a=T(a,a.next),o=T(o,o.next),S(a,e,r,s,i,n,0),void S(o,e,r,s,i,n,0)}t=t.next}a=a.next}while(a!==t)}function M(t,e){let r=t.x-e.x;return 0===r&&(r=t.y-e.y,0===r)&&(r=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),r}function k(t,e){const r=function(t,e){let r=e;const s=t.x,i=t.y;let n,a=-1/0;if(U(t,r))return r;do{if(U(t,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=s&&t>a&&(a=t,n=r.x<r.next.x?r:r.next,t===s))return n}r=r.next}while(r!==e);if(!n)return null;const o=n,l=n.x,h=n.y;let c=1/0;r=n;do{if(s>=r.x&&r.x>=l&&s!==r.x&&F(i<h?s:a,i,l,h,i<h?a:s,i,r.x,r.y)){const e=Math.abs(i-r.y)/(s-r.x);V(r,t)&&(e<c||e===c&&(r.x>n.x||r.x===n.x&&R(n,r)))&&(n=r,c=e)}r=r.next}while(r!==o);return n}(t,e);if(!r)return e;const s=Y(r,t);return T(s,s.next),T(r,r.next)}function R(t,e){return D(t.prev,t,e.prev)<0&&D(e.next,t,t.next)<0}function B(t,e,r,s,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function I(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function F(t,e,r,s,i,n,a,o){return(i-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(s-o)>=(r-a)*(e-o)&&(r-a)*(n-o)>=(i-a)*(s-o)}function O(t,e,r,s,i,n,a,o){return!(t===a&&e===o)&&F(t,e,r,s,i,n,a,o)}function G(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&L(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(V(t,e)&&V(e,t)&&function(t,e){let r=t,s=!1;const i=(t.x+e.x)/2,n=(t.y+e.y)/2;do{r.y>n!=r.next.y>n&&r.next.y!==r.y&&i<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(s=!s),r=r.next}while(r!==t);return s}(t,e)&&(D(t.prev,t,e.prev)||D(t,e.prev,e))||U(t,e)&&D(t.prev,t,t.next)>0&&D(e.prev,e,e.next)>0)}function D(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function U(t,e){return t.x===e.x&&t.y===e.y}function L(t,e,r,s){const i=X(D(t,e,r)),n=X(D(t,e,s)),a=X(D(r,s,t)),o=X(D(r,s,e));return i!==n&&a!==o||!(0!==i||!N(t,r,e))||!(0!==n||!N(t,s,e))||!(0!==a||!N(r,t,s))||!(0!==o||!N(r,e,s))}function N(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function X(t){return t>0?1:t<0?-1:0}function V(t,e){return D(t.prev,t,t.next)<0?D(t,e,t.next)>=0&&D(t,t.prev,e)>=0:D(t,e,t.prev)<0||D(t,t.next,e)<0}function Y(t,e){const r=H(t.i,t.x,t.y),s=H(e.i,e.x,e.y),i=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,s.next=r,r.prev=s,n.next=s,s.prev=n,s}function z(t,e,r,s){const i=H(t,e,r);return s?(i.next=s.next,i.prev=s,s.next.prev=i,s.next=i):(i.prev=i,i.next=i),i}function W(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 H(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}r(4872);const j=b.default||b;function q(t,e,r,s,i,n,a){const o=j(t,e,2);if(!o)return;for(let t=0;t<o.length;t+=3)n[a++]=o[t]+i,n[a++]=o[t+1]+i,n[a++]=o[t+2]+i;let l=i*s;for(let e=0;e<t.length;e+=2)r[l]=t[e],r[l+1]=t[e+1],l+=s}const $=[],K={extension:{type:s.Ag.ShapeBuilder,name:"polygon"},build(t,e){for(let r=0;r<t.points.length;r++)e[r]=t.points[r];return!0},triangulate(t,e,r,s,i,n){q(t,$,e,r,s,i,n)}},Q={extension:{type:s.Ag.ShapeBuilder,name:"rectangle"},build(t,e){const r=t,s=r.x,i=r.y,n=r.width,a=r.height;return n>0&&a>0&&(e[0]=s,e[1]=i,e[2]=s+n,e[3]=i,e[4]=s+n,e[5]=i+a,e[6]=s,e[7]=i+a,!0)},triangulate(t,e,r,s,i,n){let a=0;e[(s*=r)+a]=t[0],e[s+a+1]=t[1],a+=r,e[s+a]=t[2],e[s+a+1]=t[3],a+=r,e[s+a]=t[6],e[s+a+1]=t[7],a+=r,e[s+a]=t[4],e[s+a+1]=t[5],a+=r;const o=s/r;i[n++]=o,i[n++]=o+1,i[n++]=o+2,i[n++]=o+1,i[n++]=o+3,i[n++]=o+2}},Z={extension:{type:s.Ag.ShapeBuilder,name:"triangle"},build:(t,e)=>(e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0),triangulate(t,e,r,s,i,n){let a=0;e[(s*=r)+a]=t[0],e[s+a+1]=t[1],a+=r,e[s+a]=t[2],e[s+a+1]=t[3],a+=r,e[s+a]=t[4],e[s+a+1]=t[5];const o=s/r;i[n++]=o,i[n++]=o+1,i[n++]=o+2}};var J=r(6406);const tt=new h.u,et=new c.M,rt={};s.XO.handleByMap(s.Ag.ShapeBuilder,rt),s.XO.add(Q,K,Z,f,m,g);const st=new c.M,it=new h.u;function nt(t,e,r){const s=[],i=rt.rectangle,n=st;n.x=t.dx,n.y=t.dy,n.width=t.dw,n.height=t.dh;const a=t.transform;if(!i.build(n,s))return;const{vertices:o,uvs:h,indices:c}=r,d=c.length,f=o.length/2;a&&u(s,a),i.triangulate(s,o,2,f,c,d);const m=t.image,g=m.uvs;h.push(g.x0,g.y0,g.x1,g.y1,g.x3,g.y3,g.x2,g.y2);const x=l.Z.get(p.G);x.indexOffset=d,x.indexSize=c.length-d,x.attributeOffset=f,x.attributeSize=o.length/2-f,x.baseColor=t.style,x.alpha=t.alpha,x.texture=m,x.geometryData=r,e.push(x)}function at(t,e,r,s,i){const{vertices:n,uvs:a,indices:o}=i;t.shapePrimitives.forEach(({shape:t,transform:h,holes:c})=>{const f=[],m=rt[t.type];if(!m.build(t,f))return;const g=o.length,b=n.length/2;let w="triangle-list";if(h&&u(f,h),r){const r=t.closePath??!0,s=e;s.pixelLine?(function(t,e,r,s){const i=y;if(0===t.length)return;const n=t[0],a=t[1],o=t[t.length-2],l=t[t.length-1],h=e||Math.abs(n-o)<i&&Math.abs(a-l)<i,c=r,u=t.length/2,d=c.length/2;for(let e=0;e<u;e++)c.push(t[2*e]),c.push(t[2*e+1]);for(let t=0;t<u-1;t++)s.push(d+t,d+t+1);h&&s.push(d+u-1,d)}(f,r,n,o),w="line-list"):function(t,e,r,s,i,n){const a=y;if(0===t.length)return;const o=e;let l=o.alignment;if(.5!==e.alignment){let e=function(t){const e=t.length;if(e<6)return 1;let r=0;for(let s=0,i=t[e-2],n=t[e-1];s<e;s+=2){const e=t[s],a=t[s+1];r+=(e-i)*(a+n),i=e,n=a}return r<0?-1:1}(t);l=(l-.5)*e+.5}const h=new x.b(t[0],t[1]),c=new x.b(t[t.length-2],t[t.length-1]),u=s,d=Math.abs(h.x-c.x)<a&&Math.abs(h.y-c.y)<a;if(u){t=t.slice(),d&&(t.pop(),t.pop(),c.set(t[t.length-2],t[t.length-1]));const e=.5*(h.x+c.x),r=.5*(c.y+h.y);t.unshift(e,r),t.push(e,r)}const p=i,f=t.length/2;let m=t.length;const g=p.length/2,b=o.width/2,w=b*b,T=o.miterLimit*o.miterLimit;let S=t[0],A=t[1],C=t[2],P=t[3],E=0,M=0,k=-(A-P),R=S-C,B=0,I=0,F=Math.sqrt(k*k+R*R);k/=F,R/=F,k*=b,R*=b;const O=2*(1-l),G=2*l;u||("round"===o.cap?m+=_(S-k*(O-G)*.5,A-R*(O-G)*.5,S-k*O,A-R*O,S+k*G,A+R*G,p,!0)+2:"square"===o.cap&&(m+=v(S,A,k,R,O,G,!0,p))),p.push(S-k*O,A-R*O),p.push(S+k*G,A+R*G);for(let e=1;e<f-1;++e){S=t[2*(e-1)],A=t[2*(e-1)+1],C=t[2*e],P=t[2*e+1],E=t[2*(e+1)],M=t[2*(e+1)+1],k=-(A-P),R=S-C,F=Math.sqrt(k*k+R*R),k/=F,R/=F,k*=b,R*=b,B=-(P-M),I=C-E,F=Math.sqrt(B*B+I*I),B/=F,I/=F,B*=b,I*=b;const r=C-S,s=A-P,i=C-E,n=M-P,a=r*i+s*n,l=s*i-n*r,h=l<0;if(Math.abs(l)<.001*Math.abs(a)){p.push(C-k*O,P-R*O),p.push(C+k*G,P+R*G),a>=0&&("round"===o.join?m+=_(C,P,C-k*O,P-R*O,C-B*O,P-I*O,p,!1)+4:m+=2,p.push(C-B*G,P-I*G),p.push(C+B*O,P+I*O));continue}const c=(-k+S)*(-R+P)-(-k+C)*(-R+A),u=(-B+E)*(-I+P)-(-B+C)*(-I+M),d=(r*u-i*c)/l,f=(n*c-s*u)/l,g=(d-C)*(d-C)+(f-P)*(f-P),x=C+(d-C)*O,y=P+(f-P)*O,v=C-(d-C)*G,D=P-(f-P)*G,U=h?O:G;g<=Math.min(r*r+s*s,i*i+n*n)+U*U*w?"bevel"===o.join||g/w>T?(h?(p.push(x,y),p.push(C+k*G,P+R*G),p.push(x,y),p.push(C+B*G,P+I*G)):(p.push(C-k*O,P-R*O),p.push(v,D),p.push(C-B*O,P-I*O),p.push(v,D)),m+=2):"round"===o.join?h?(p.push(x,y),p.push(C+k*G,P+R*G),m+=_(C,P,C+k*G,P+R*G,C+B*G,P+I*G,p,!0)+4,p.push(x,y),p.push(C+B*G,P+I*G)):(p.push(C-k*O,P-R*O),p.push(v,D),m+=_(C,P,C-k*O,P-R*O,C-B*O,P-I*O,p,!1)+4,p.push(C-B*O,P-I*O),p.push(v,D)):(p.push(x,y),p.push(v,D)):(p.push(C-k*O,P-R*O),p.push(C+k*G,P+R*G),"round"===o.join?m+=h?_(C,P,C+k*G,P+R*G,C+B*G,P+I*G,p,!0)+2:_(C,P,C-k*O,P-R*O,C-B*O,P-I*O,p,!1)+2:"miter"===o.join&&g/w<=T&&(h?(p.push(v,D),p.push(v,D)):(p.push(x,y),p.push(x,y)),m+=2),p.push(C-B*O,P-I*O),p.push(C+B*G,P+I*G),m+=2)}S=t[2*(f-2)],A=t[2*(f-2)+1],C=t[2*(f-1)],P=t[2*(f-1)+1],k=-(A-P),R=S-C,F=Math.sqrt(k*k+R*R),k/=F,R/=F,k*=b,R*=b,p.push(C-k*O,P-R*O),p.push(C+k*G,P+R*G),u||("round"===o.cap?m+=_(C-k*(O-G)*.5,P-R*(O-G)*.5,C-k*O,P-R*O,C+k*G,P+R*G,p,!1)+2:"square"===o.cap&&(m+=v(C,P,k,R,O,G,!1,p)));for(let t=g;t<m+g-2;++t)S=p[2*t],A=p[2*t+1],C=p[2*(t+1)],P=p[2*(t+1)+1],E=p[2*(t+2)],M=p[2*(t+2)+1],Math.abs(S*(P-M)+C*(M-A)+E*(A-P))<1e-8||n.push(t,t+1,t+2)}(f,s,0,r,n,o)}else if(c){const t=[],e=f.slice();(function(t){const e=[];for(let r=0;r<t.length;r++){const s=t[r].shape,i=[];rt[s.type].build(s,i)&&e.push(i)}return e})(c).forEach(r=>{t.push(e.length/2),e.push(...r)}),q(e,t,n,2,b,o,g)}else m.triangulate(f,n,2,b,o,g);const T=a.length/2,S=e.texture;if(S!==d.g.WHITE){const r=function(t,e,r,s){const i=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if("local"===e.textureSpace){const t=r.getBounds(et);e.width&&t.pad(e.width);const{x:s,y:n}=t,a=1/t.width,o=1/t.height,l=-s*a,h=-n*o,c=i.a,u=i.b,d=i.c,p=i.d;i.a*=a,i.b*=a,i.c*=o,i.d*=o,i.tx=l*c+h*d+i.tx,i.ty=l*u+h*p+i.ty}else i.translate(e.texture.frame.x,e.texture.frame.y),i.scale(1/e.texture.source.width,1/e.texture.source.height);const n=e.texture.source.style;return e.fill instanceof J._||"clamp-to-edge"!==n.addressMode||(n.addressMode="repeat",n.update()),s&&i.append(tt.copyFrom(s).invert()),i}(it,e,t,h);!function(t,e,r,s,i,n,a,o=null){let l=0;r*=e,i*=n;const h=o.a,c=o.b,u=o.c,d=o.d,p=o.tx,f=o.ty;for(;l<a;){const a=t[r],o=t[r+1];s[i]=h*a+u*o+p,s[i+1]=c*a+d*o+f,i+=n,r+=e,l++}}(n,2,b,a,T,2,n.length/2-b,r)}else!function(t,e,r,s){let i=0;for(e*=2;i<s;)t[e]=0,t[e+1]=0,e+=2,i++}(a,T,0,n.length/2-b);const A=l.Z.get(p.G);A.indexOffset=g,A.indexSize=o.length-g,A.attributeOffset=b,A.attributeSize=n.length/2-b,A.baseColor=e.color,A.alpha=e.alpha,A.texture=S,A.geometryData=i,A.topology=w,s.push(A)})}class ot{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}}class lt{constructor(){this.instructions=new a.L}init(t){this.batcher=new n.J({maxTextures:t}),this.instructions.reset()}get geometry(){return(0,o.t6)(o.Ek,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const ht=class t{constructor(t){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=t,t.renderableGC.addManagedHash(this,"_gpuContextHash"),t.renderableGC.addManagedHash(this,"_graphicsDataContextHash")}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return this._graphicsDataContextHash[t.uid]||this._initContextRenderData(t)}updateGpuContext(t){let e=this._gpuContextHash[t.uid]||this._initContext(t);if(t.dirty){e?this._cleanGraphicsContextData(t):e=this._initContext(t),function(t,e){const{geometryData:r,batches:s}=e;s.length=0,r.indices.length=0,r.vertices.length=0,r.uvs.length=0;for(let e=0;e<t.instructions.length;e++){const i=t.instructions[e];if("texture"===i.action)nt(i.data,s,r);else if("fill"===i.action||"stroke"===i.action){const t="stroke"===i.action,e=i.data.path.shapePath,n=i.data.style,a=i.data.hole;t&&a&&at(a.shapePath,n,!0,s,r),a&&(e.shapePrimitives[e.shapePrimitives.length-1].holes=a.shapePath.shapePrimitives),at(e,n,t,s,r)}}}(t,e);const r=t.batchMode;t.customShader||"no-batch"===r?e.isBatchable=!1:e.isBatchable="auto"!==r||e.geometryData.vertices.length<400,t.dirty=!1}return e}getGpuContext(t){return this._gpuContextHash[t.uid]||this._initContext(t)}_initContextRenderData(t){const e=l.Z.get(lt,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:r,geometryData:s}=this._gpuContextHash[t.uid],n=s.vertices.length,a=s.indices.length;for(let t=0;t<r.length;t++)r[t].applyTransform=!1;const o=e.batcher;o.ensureAttributeBuffer(n),o.ensureIndexBuffer(a),o.begin();for(let t=0;t<r.length;t++){const e=r[t];o.add(e)}o.finish(e.instructions);const h=o.geometry;h.indexBuffer.setDataWithSize(o.indexBuffer,o.indexSize,!0),h.buffers[0].setDataWithSize(o.attributeBuffer.float32View,o.attributeSize,!0);const c=o.batches;for(let t=0;t<c.length;t++){const e=c[t];e.bindGroup=(0,i.w)(e.textures.textures,e.textures.count,this._renderer.limits.maxBatchableTextures)}return this._graphicsDataContextHash[t.uid]=e,e}_initContext(t){const e=new ot;return e.context=t,this._gpuContextHash[t.uid]=e,t.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]}onGraphicsContextDestroy(t){this._cleanGraphicsContextData(t),t.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]=null}_cleanGraphicsContextData(t){const e=this._gpuContextHash[t.uid];e.isBatchable||this._graphicsDataContextHash[t.uid]&&(l.Z.return(this.getContextRenderData(t)),this._graphicsDataContextHash[t.uid]=null),e.batches&&e.batches.forEach(t=>{l.Z.return(t)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};ht.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"graphicsContext"},ht.defaultOptions={bezierSmoothness:.5};let ct=ht},6406:(t,e,r)=>{"use strict";r.d(e,{_:()=>p});var s=r(6675),i=r(5423),n=r(5199),a=r(5947),o=r(9739),l=r(9375),h=r(4696),c=r(7604);const u=[{offset:0,color:"white"},{offset:1,color:"black"}],d=class t{constructor(...e){this.uid=(0,l.L)("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let r=function(t){let e=t[0]??{};return("number"==typeof e||t[1])&&((0,h.t6)("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??p.defaultLinearOptions.textureSize}),e}(e);r={..."radial"===r.type?t.defaultRadialOptions:t.defaultLinearOptions,...(0,c.S)(r)},this._textureSize=r.textureSize,this._wrapMode=r.wrapMode,"radial"===r.type?(this.center=r.center,this.outerCenter=r.outerCenter??this.center,this.innerRadius=r.innerRadius,this.outerRadius=r.outerRadius,this.scale=r.scale,this.rotation=r.rotation):(this.start=r.start,this.end=r.end),this.textureSpace=r.textureSpace,this.type=r.type,r.colorStops.forEach(t=>{this.addColorStop(t.offset,t.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:s.Q.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:r,y:s}=this.end,i=r-t,l=s-e;const h=i<0||l<0;if("clamp-to-edge"===this._wrapMode){if(i<0){const e=t;t=r,r=e,i*=-1}if(l<0){const t=e;e=s,s=t,l*=-1}}const c=this.colorStops.length?this.colorStops:u,d=this._textureSize,{canvas:p,context:g}=m(d,1),x=h?g.createLinearGradient(this._textureSize,0,0,0):g.createLinearGradient(0,0,this._textureSize,0);f(x,c),g.fillStyle=x,g.fillRect(0,0,d,1),this.texture=new o.g({source:new a.b({resource:p,addressMode:this._wrapMode})});const y=Math.sqrt(i*i+l*l),v=Math.atan2(l,i),_=new n.u;_.scale(y/d,1),_.rotate(v),_.translate(t,e),"local"===this.textureSpace&&_.scale(d,d),this.transform=_}buildGradient(){this.texture||this._tick++,"linear"===this.type?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:u,e=this._textureSize,{canvas:r,context:s}=m(e,e),{x:i,y:l}=this.center,{x:h,y:c}=this.outerCenter,d=this.innerRadius,p=this.outerRadius,g=h-p,x=c-p,y=e/(2*p),v=(i-g)*y,_=(l-x)*y,b=s.createRadialGradient(v,_,d*y,(h-g)*y,(c-x)*y,p*y);f(b,t),s.fillStyle=t[t.length-1].color,s.fillRect(0,0,e,e),s.fillStyle=b,s.translate(v,_),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-v,-_),s.fillRect(0,0,e,e),this.texture=new o.g({source:new a.b({resource:r,addressMode:this._wrapMode})});const w=new n.u;w.scale(1/y,1/y),w.translate(g,x),"local"===this.textureSpace&&w.scale(e,e),this.transform=w}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};d.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},d.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let p=d;function f(t,e){for(let r=0;r<e.length;r++){const s=e[r];t.addColorStop(s.offset,s.color)}}function m(t,e){const r=i.e.get().createCanvas(t,e),s=r.getContext("2d");return{canvas:r,context:s}}},6499:(t,e,r)=>{"use strict";r.d(e,{W:()=>n});var s=r(2432),i=r(8147);class n extends s.b{#X;#V;#Y=new i.w(0);#z=new i.w(0);constructor(t){super(),this.#X=t,this.#V=new ResizeObserver(this.#W.bind(this)),this.#V.observe(t)}#W(){const t=this.#X.getBoundingClientRect();this.#Y.v=t.width,this.#z.v=t.height,(this.#Y.dirty||this.#z.dirty)&&(this.emit("resize",this.#Y.v,this.#z.v),this.#Y.resetDirty(),this.#z.resetDirty())}remove(){this.#V.disconnect(),super.remove()}}},6516:(t,e,r)=>{"use strict";r.r(e),r(3046),r(2517),r(2542),r(3050),r(8427),r(6131),r(6934),r(966),r(6841),r(9797),r(4550),r(8122)},6552:(t,e,r)=>{"use strict";r.d(e,{K:()=>n});var s=r(1347),i=r(4382);class n extends i.e{endSlot=null;color=new s.Q1(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new n(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}},6571:(t,e,r)=>{"use strict";r.d(e,{Y:()=>s});class s{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.name==t)return s}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.name==t)return s}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.name==t)return s}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.name==t)return s}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let r=0,s=e.length;r<s;r++){const s=e[r];if(s.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let r=0,s=e.length;r<s;r++){const s=e[r];if(s.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let r=0,s=e.length;r<s;r++){const s=e[r];if(s.name==t)return s}return null}findPhysicsConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.physicsConstraints;for(let r=0,s=e.length;r<s;r++){const s=e[r];if(s.name==t)return s}return null}}},6643:(t,e,r)=>{"use strict";r.d(e,{g:()=>i});class s{constructor(t=0,e=0,r=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=r,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){return t.map(t=>[t,this.get(t)])}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],0===--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){const e=this.items[t];if(void 0!==e)return this.ttl>0&&e.expiry<=Date.now()?void this.delete(t):(this.moveToEnd(e),e.value)}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(null!==t.prev&&(t.prev.next=t.next),null!==t.next&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,null!==this.last&&(this.last.next=t),this.last=t,null===this.first&&(this.first=t))}keys(){const t=[];let e=this.first;for(;null!==e;)t.push(e.key),e=e.next;return t}setWithEvicted(t,e,r=this.resetTtl){let s=null;if(this.has(t))this.set(t,e,!0,r);else{this.max>0&&this.size===this.max&&(s={...this.first},this.evict(!0));let r=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};1===++this.size?this.first=r:this.last.next=r,this.last=r}return s}set(t,e,r=!1,s=this.resetTtl){let i=this.items[t];return r||void 0!==i?(i.value=e,!1===r&&s&&(i.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(i)):(this.max>0&&this.size===this.max&&this.evict(!0),i=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1===++this.size?this.first=i:this.last.next=i,this.last=i),this}values(t=this.keys()){return t.map(t=>this.get(t))}}function i(t=1e3,e=0,r=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof r)throw new TypeError("Invalid resetTtl value");return new s(t,e,r)}},6675:(t,e,r)=>{"use strict";r.d(e,{Q:()=>R});var s={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},n=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},a=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},o=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},l=function(t){return{r:a(t.r,0,255),g:a(t.g,0,255),b:a(t.b,0,255),a:a(t.a)}},h=function(t){return{r:n(t.r),g:n(t.g),b:n(t.b),a:n(t.a,3)}},c=/^#([0-9a-f]{3,8})$/i,u=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,r=t.g,s=t.b,i=t.a,n=Math.max(e,r,s),a=n-Math.min(e,r,s),o=a?n===e?(r-s)/a:n===r?2+(s-e)/a:4+(e-r)/a:0;return{h:60*(o<0?o+6:o),s:n?a/n*100:0,v:n/255*100,a:i}},p=function(t){var e=t.h,r=t.s,s=t.v,i=t.a;e=e/360*6,r/=100,s/=100;var n=Math.floor(e),a=s*(1-r),o=s*(1-(e-n)*r),l=s*(1-(1-e+n)*r),h=n%6;return{r:255*[s,o,a,a,l,s][h],g:255*[l,s,s,o,a,a][h],b:255*[a,a,l,s,s,o][h],a:i}},f=function(t){return{h:o(t.h),s:a(t.s,0,100),l:a(t.l,0,100),a:a(t.a)}},m=function(t){return{h:n(t.h),s:n(t.s),l:n(t.l),a:n(t.a,3)}},g=function(t){return p((r=(e=t).s,{h:e.h,s:(r*=((s=e.l)<50?s:100-s)/100)>0?2*r/(s+r)*100:0,v:s+r,a:e.a}));var e,r,s},x=function(t){return{h:(e=d(t)).h,s:(i=(200-(r=e.s))*(s=e.v)/100)>0&&i<200?r*s/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,s,i},y=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w={string:[[function(t){var e=c.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?n(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?n(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=_.exec(t)||b.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:l({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=y.exec(t)||v.exec(t);if(!e)return null;var r,i,n=f({h:(r=e[1],i=e[2],void 0===i&&(i="deg"),Number(r)*(s[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return g(n)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,s=t.b,n=t.a,a=void 0===n?1:n;return i(e)&&i(r)&&i(s)?l({r:Number(e),g:Number(r),b:Number(s),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,r=t.s,s=t.l,n=t.a,a=void 0===n?1:n;if(!i(e)||!i(r)||!i(s))return null;var o=f({h:Number(e),s:Number(r),l:Number(s),a:Number(a)});return g(o)},"hsl"],[function(t){var e=t.h,r=t.s,s=t.v,n=t.a,l=void 0===n?1:n;if(!i(e)||!i(r)||!i(s))return null;var h=function(t){return{h:o(t.h),s:a(t.s,0,100),v:a(t.v,0,100),a:a(t.a)}}({h:Number(e),s:Number(r),v:Number(s),a:Number(l)});return p(h)},"hsv"]]},T=function(t,e){for(var r=0;r<e.length;r++){var s=e[r][0](t);if(s)return[s,e[r][1]]}return[null,void 0]},S=function(t,e){var r=x(t);return{h:r.h,s:a(r.s+100*e,0,100),l:r.l,a:r.a}},A=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},C=function(t,e){var r=x(t);return{h:r.h,s:r.s,l:a(r.l+100*e,0,100),a:r.a}},P=function(){function t(t){this.parsed=function(t){return"string"==typeof t?T(t.trim(),w.string):"object"==typeof t&&null!==t?T(t,w.object):[null,void 0]}(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return n(A(this.rgba),2)},t.prototype.isDark=function(){return A(this.rgba)<.5},t.prototype.isLight=function(){return A(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=h(this.rgba)).r,r=t.g,s=t.b,a=(i=t.a)<1?u(n(255*i)):"","#"+u(e)+u(r)+u(s)+a;var t,e,r,s,i,a},t.prototype.toRgb=function(){return h(this.rgba)},t.prototype.toRgbString=function(){return e=(t=h(this.rgba)).r,r=t.g,s=t.b,(i=t.a)<1?"rgba("+e+", "+r+", "+s+", "+i+")":"rgb("+e+", "+r+", "+s+")";var t,e,r,s,i},t.prototype.toHsl=function(){return m(x(this.rgba))},t.prototype.toHslString=function(){return e=(t=m(x(this.rgba))).h,r=t.s,s=t.l,(i=t.a)<1?"hsla("+e+", "+r+"%, "+s+"%, "+i+")":"hsl("+e+", "+r+"%, "+s+"%)";var t,e,r,s,i},t.prototype.toHsv=function(){return t=d(this.rgba),{h:n(t.h),s:n(t.s),v:n(t.v),a:n(t.a,3)};var t},t.prototype.invert=function(){return E({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),E(S(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),E(S(this.rgba,-t))},t.prototype.grayscale=function(){return E(S(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),E(C(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),E(C(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?E({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):n(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=x(this.rgba);return"number"==typeof t?E({h:t,s:e.s,l:e.l,a:e.a}):n(e.h)},t.prototype.isEqual=function(t){return this.toHex()===E(t).toHex()},t}(),E=function(t){return t instanceof P?t:new P(t)},M=[];!function(t){t.forEach(function(t){M.indexOf(t)<0&&(t(P,w),M.push(t))})}([function(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var i in r)s[r[i]]=i;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,a,o=s[this.toHex()];if(o)return o;if(null==e?void 0:e.closest){var l=this.toRgb(),h=1/0,c="black";if(!n.length)for(var u in r)n[u]=new t(r[u]).toRgb();for(var d in r){var p=(i=l,a=n[d],Math.pow(i.r-a.r,2)+Math.pow(i.g-a.g,2)+Math.pow(i.b-a.b,2));p<h&&(h=p,c=d)}return c}},e.string.push([function(e){var s=e.toLowerCase(),i="transparent"===s?"#0000":r[s];return i?new t(i).toRgb():null},"name"])}]);const k=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set Color#value to null");null!==this._value&&this._isSourceEqual(this._value,e)||(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}_isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every((t,r)=>t===e[r]);if(null!==t&&null!==e){const r=Object.keys(t),s=Object.keys(e);return r.length===s.length&&r.every(r=>t[r]===e[r])}return t===e}toRgba(){const[t,e,r,s]=this._components;return{r:t,g:e,b:r,a:s}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*s),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,r,s,i]=this._components;return t[0]=e,t[1]=r,t[2]=s,t[3]=i,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,r,s]=this._components;return t[0]=e,t[1]=r,t[2]=s,t}toNumber(){return this._int}toBgrNumber(){const[t,e,r]=this.toUint8RgbArray();return(r<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,s,i,n]=t._temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=s,this._components[2]*=i,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,s=this._int>>8&255,i=255&this._int;return e&&(r=r*t+.5|0,s=s*t+.5|0,i=i*t+.5|0),(255*t<<24)+(r<<16)+(s<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(e){let r,s,i,n;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215)r=(e>>16&255)/255,s=(e>>8&255)/255,i=(255&e)/255,n=1;else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,s,i,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,s,i,n=255]=e,r/=255,s/=255,i/=255,n/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}`)}const a=E(e);a.isValid()&&(({r,g:s,b:i,a:n}=a.rgba),r/=255,s/=255,i/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=s,this._components[2]=i,this._components[3]=n,this._refreshInt()}_refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach((s,i)=>{t[i]=Math.min(Math.max(s,e),r)}),t)}static isColorLike(e){return"number"==typeof e||"string"==typeof e||e instanceof Number||e instanceof t||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||void 0!==e.r&&void 0!==e.g&&void 0!==e.b||void 0!==e.r&&void 0!==e.g&&void 0!==e.b&&void 0!==e.a||void 0!==e.h&&void 0!==e.s&&void 0!==e.l||void 0!==e.h&&void 0!==e.s&&void 0!==e.l&&void 0!==e.a||void 0!==e.h&&void 0!==e.s&&void 0!==e.v||void 0!==e.h&&void 0!==e.s&&void 0!==e.v&&void 0!==e.a}};k.shared=new k,k._temp=new k,k.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let R=k},6679:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var s=r(166);const i=new Float32Array(1),n=new Uint32Array(1);class a extends s.V23{constructor(){const t=new s.hpe({data:i,label:"attribute-batch-buffer",usage:s.Sdw.VERTEX|s.Sdw.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:28,offset:0},aUV:{buffer:t,format:"float32x2",stride:28,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:28,offset:16},aDarkColor:{buffer:t,format:"unorm8x4",stride:28,offset:20},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:28,offset:24}},indexBuffer:new s.hpe({data:n,label:"index-batch-buffer",usage:s.Sdw.INDEX|s.Sdw.COPY_DST,shrinkToFit:!1})})}}},6694:(t,e,r)=>{"use strict";r.d(e,{d:()=>n});var s=r(1065),i=r(5031);const n={extension:{type:s.Ag.DetectionParser,priority:0},test:async()=>(0,i.b)("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter(t=>"webm"!==t)}},6763:(t,e,r)=>{"use strict";r.d(e,{y:()=>o});var s=r(8714),i=r.n(s),n=r(166),a=r(2437);class o extends a.N{#H=i().Engine.create();constructor(t){super(new n.mcf({sortableChildren:!0})),this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty(),this.gravity=t?.gravity??0}set gravity(t){this.#H.gravity.y=t}get gravity(){return this.#H.gravity.y}addBody(t){i().World.add(this.#H.world,t)}removeBody(t){i().World.remove(this.#H.world,t)}update(t){super.update(t);const e=1e3*t;i().Engine.update(this.#H,e>16.666?16.666:e)}remove(){i().Engine.clear(this.#H),super.remove()}}},6793:(t,e,r)=>{"use strict";r.d(e,{a:()=>s});class s{cachedAssets=new Map;loadingPromises=new Map;#j=new Map;#q(t){this.#j.set(t,(this.#j.get(t)||0)+1)}hasActiveRef(t){return this.#j.get(t)>0}cleanup(t,e){}checkCached(t){return this.cachedAssets.has(t)}getCached(t){if(!this.checkCached(t))throw new Error(`Asset not found: ${t}`);return this.#q(t),this.cachedAssets.get(t)}async load(t,...e){return this.#q(t),this.checkCached(t)?this.cachedAssets.get(t):this.loadingPromises.has(t)?await this.loadingPromises.get(t):await this.doLoad(t,...e)}release(t){const e=this.#j.get(t);if(void 0===e)throw new Error(`Asset not found: ${t}`);if(1===e){this.#j.delete(t);const e=this.cachedAssets.get(t);e&&(this.cleanup(t,e),this.cachedAssets.delete(t))}else this.#j.set(t,e-1)}}},6836:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});var s=r(166),i=r(8034);class n extends i.gP{static textureMap=new Map;static from(t){return n.textureMap.has(t)?n.textureMap.get(t):new n(t)}texture;constructor(t){super(t.resource),this.texture=s.gPd.from(t)}setFilters(t,e){const r=this.texture.source.style;r.minFilter=n.toPixiTextureFilter(t),r.magFilter=n.toPixiTextureFilter(e),this.texture.source.autoGenerateMipmaps=n.toPixiMipMap(t),this.texture.source.updateMipmaps()}setWraps(t,e){const r=this.texture.source.style;r.addressModeU=n.toPixiTextureWrap(t),r.addressModeV=n.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiMipMap(t){switch(t){case i.O$.Nearest:case i.O$.Linear:return!1;case i.O$.MipMapNearestLinear:case i.O$.MipMapNearestNearest:case i.O$.MipMapLinearLinear:case i.O$.MipMapLinearNearest:return!0;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureFilter(t){switch(t){case i.O$.Nearest:case i.O$.MipMapNearestLinear:case i.O$.MipMapNearestNearest:return"nearest";case i.O$.Linear:case i.O$.MipMapLinearLinear:case i.O$.MipMapLinearNearest:return"linear";default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case i.w3.ClampToEdge:return"clamp-to-edge";case i.w3.MirroredRepeat:return"mirror-repeat";case i.w3.Repeat:return"repeat";default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case i.Nx.Normal:return"normal";case i.Nx.Additive:return"add";case i.Nx.Multiply:return"multiply";case i.Nx.Screen:return"screen";default:throw new Error(`Unknown blendMode: ${String(t)}`)}}}},6841:(t,e,r)=>{"use strict";var s=r(1065),i=r(9739),n=r(8956),a=r(3412);class o extends a.K{constructor(t){super(),this.generatingTexture=!1,this.currentKey="--",this._renderer=t,t.runners.resolutionChange.add(this)}resolutionChange(){const t=this.renderable;t._autoResolution&&t.onViewUpdate()}destroy(){const{htmlText:t}=this._renderer;null===t.getReferenceCount(this.currentKey)?t.returnTexturePromise(this.texturePromise):t.decreaseReferenceCount(this.currentKey),this._renderer.runners.resolutionChange.remove(this),this.texturePromise=null,this._renderer=null}}class l{constructor(t){this._renderer=t}validateRenderable(t){const e=this._getGpuText(t),r=t.styleKey;return e.currentKey!==r}addRenderable(t,e){const r=this._getGpuText(t);if(t._didTextUpdate){const e=t._autoResolution?this._renderer.resolution:t.resolution;r.currentKey===t.styleKey&&t.resolution===e||this._updateGpuText(t).catch(t=>{console.error(t)}),t._didTextUpdate=!1,(0,n.s)(r,t)}this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._getGpuText(t);e._batcher.updateElement(e)}async _updateGpuText(t){t._didTextUpdate=!1;const e=this._getGpuText(t);if(e.generatingTexture)return;const r=e.texturePromise;e.texturePromise=null,e.generatingTexture=!0,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;let s=this._renderer.htmlText.getTexturePromise(t);r&&(s=s.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(e.currentKey),this._renderer.htmlText.returnTexturePromise(r)})),e.texturePromise=s,e.currentKey=t.styleKey,e.texture=await s;const i=t.renderGroup||t.parentRenderGroup;i&&(i.structureDidChange=!0),e.generatingTexture=!1,(0,n.s)(e,t)}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new o(this._renderer);return e.renderable=t,e.transform=t.groupTransform,e.texture=i.g.EMPTY,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}}l.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"htmlText"};var h=r(1566),c=r(8851),u=r(5153),d=r(5423),p=r(7694),f=r(761),m=r(1268);const g="http://www.w3.org/2000/svg",x="http://www.w3.org/1999/xhtml";class y{constructor(){this.svgRoot=document.createElementNS(g,"svg"),this.foreignObject=document.createElementNS(g,"foreignObject"),this.domElement=document.createElementNS(x,"div"),this.styleElement=document.createElementNS(x,"style");const{foreignObject:t,svgRoot:e,styleElement:r,domElement:s}=this;t.setAttribute("width","10000"),t.setAttribute("height","10000"),t.style.overflow="hidden",e.appendChild(t),t.appendChild(r),t.appendChild(s),this.image=d.e.get().createImage()}destroy(){this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null}}var v=r(2445);const _=new Map;let b;class w{constructor(t){this._activeTextures={},this._renderer=t,this._createCanvas=t.type===u.W.WEBGPU}getTexture(t){return this.getTexturePromise(t)}getManagedTexture(t){const e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].promise;const r=this._buildTexturePromise(t).then(t=>(this._activeTextures[e].texture=t,t));return this._activeTextures[e]={texture:null,promise:r,usageCount:1},r}getReferenceCount(t){return this._activeTextures[t]?.usageCount??null}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}decreaseReferenceCount(t){const e=this._activeTextures[t];e&&(e.usageCount--,0===e.usageCount&&(e.texture?this._cleanUp(e.texture):e.promise.then(t=>{e.texture=t,this._cleanUp(e.texture)}).catch(()=>{(0,p.R)("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[t]=null))}getTexturePromise(t){return this._buildTexturePromise(t)}async _buildTexturePromise(t){const{text:e,style:r,resolution:s,textureStyle:i}=t,n=f.Z.get(y),a=function(t,e){const r=e.fontFamily,s=[],i={},n=t.match(/font-family:([^;"\s]+)/g);function a(t){i[t]||(s.push(t),i[t]=!0)}if(Array.isArray(r))for(let t=0;t<r.length;t++)a(r[t]);else a(r);n&&n.forEach(t=>{a(t.split(":")[1].trim())});for(const t in e.tagStyles)a(e.tagStyles[t].fontFamily);return s}(e,r),o=await async function(t){const e=t.filter(t=>v.l.has(`${t}-and-url`)).map(t=>{if(!_.has(t)){const{entries:e}=v.l.get(`${t}-and-url`),r=[];e.forEach(e=>{const s=e.url,i=e.faces.map(t=>({weight:t.weight,style:t.style}));r.push(...i.map(e=>async function(t,e){const r=await async function(t){const e=await d.e.get().fetch(t),r=await e.blob(),s=new FileReader;return await new Promise((t,e)=>{s.onloadend=()=>t(s.result),s.onerror=e,s.readAsDataURL(r)})}(e);return`@font-face {\n font-family: "${t.fontFamily}";\n font-weight: ${t.fontWeight};\n font-style: ${t.fontStyle};\n src: url('${r}');\n }`}({fontWeight:e.weight,fontStyle:e.style,fontFamily:t},s)))}),_.set(t,Promise.all(r).then(t=>t.join("\n")))}return _.get(t)});return(await Promise.all(e)).join("\n")}(a),l=function(t,e,r,s){s||(s=b||(b=new y));const{domElement:i,styleElement:n,svgRoot:a}=s;i.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${t}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),r&&(n.textContent=r),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const l=2*e.padding;return{width:o.width-l,height:o.height-l}}(e,r,o,n),c=Math.ceil(Math.ceil(Math.max(1,l.width)+2*r.padding)*s),u=Math.ceil(Math.ceil(Math.max(1,l.height)+2*r.padding)*s),p=n.image;p.width=2+(0|c),p.height=2+(0|u);const g=function(t,e,r,s,i){const{domElement:n,styleElement:a,svgRoot:o}=i;n.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${t}</div>`,n.setAttribute("style",`transform: scale(${r});transform-origin: top left; display: inline-block`),a.textContent=s;const{width:l,height:h}=i.image;return o.setAttribute("width",l.toString()),o.setAttribute("height",h.toString()),(new XMLSerializer).serializeToString(o)}(e,r,s,o,n);await function(t,e,r){return new Promise(async s=>{r&&await new Promise(t=>setTimeout(t,100)),t.onload=()=>{s()},t.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,t.crossOrigin="anonymous"})}(p,g,function(){const{userAgent:t}=d.e.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}()&&a.length>0);const x=p;let w;this._createCanvas&&(w=function(t,e){const r=h.N.getOptimalCanvasAndContext(t.width,t.height,e),{context:s}=r;return s.clearRect(0,0,t.width,t.height),s.drawImage(t,0,0),r}(p,s));const T=(0,m.M)(w?w.canvas:x,p.width-2,p.height-2,s);return i&&(T.source.style=i),this._createCanvas&&(this._renderer.texture.initSource(T.source),h.N.returnCanvasAndContext(w)),f.Z.return(n),T}returnTexturePromise(t){t.then(t=>{this._cleanUp(t)}).catch(()=>{(0,p.R)("HTMLTextSystem: Failed to clean texture")})}_cleanUp(t){c.W.returnTexture(t,!0),t.source.resource=null,t.source.uploadMethodId="unknown"}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexturePromise(this._activeTextures[t].promise);this._activeTextures=null}}w.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"htmlText"},s.XO.add(w),s.XO.add(l)},6851:(t,e,r)=>{"use strict";r.d(e,{j:()=>n});var s=r(5946);const i=16777215;function n(t,e){return t===i?e:e===i?t:(0,s.u)(t,e)}},6861:(t,e,r)=>{"use strict";r.d(e,{H:()=>n});var s=r(1347),i=r(4382);class n extends i.e{lengths=[];closed=!1;constantSpeed=!1;color=new s.Q1(1,1,1,1);constructor(t){super(t)}copy(){let t=new n(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),s.Aq.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}},6863:(t,e,r)=>{"use strict";r.d(e,{q:()=>o});var s=r(6976),i=r(903),n=r(6114);const a=["webgl","webgpu","canvas"];async function o(t){let e,o=[];t.preference?(o.push(t.preference),a.forEach(e=>{e!==t.preference&&o.push(e)})):o=a.slice();let l={};for(let a=0;a<o.length;a++){const h=o[a];if("webgpu"===h&&await(0,i.V)()){const{WebGPURenderer:s}=await Promise.resolve().then(r.bind(r,8628));e=s,l={...t,...t.webgpu};break}if("webgl"===h&&(0,s.M)(t.failIfMajorPerformanceCaveat??n.k.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:s}=await Promise.resolve().then(r.bind(r,7722));e=s,l={...t,...t.webgl};break}if("canvas"===h)throw l={...t},new Error("CanvasRenderer is not yet implemented")}if(delete l.webgpu,delete l.webgl,!e)throw new Error("No available renderer for the current environment");const h=new e;return await h.init(l),h}},6890:(t,e,r)=>{"use strict";r.d(e,{u:()=>n});const s=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function i(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function n(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const n=s.replace(/%forloop%/gi,i(t));if(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}}finally{e.deleteShader(r)}return t}},6929:t=>{t.exports=function(t){var i=[];return t.replace(r,function(t,r,n){var a=r.toLowerCase();for(n=function(t){var e=t.match(s);return e?e.map(Number):[]}(n),"m"==a&&n.length>2&&(i.push([r].concat(n.splice(0,2))),a="l",r="m"==r?"l":"L");;){if(n.length==e[a])return n.unshift(r),i.push(n);if(n.length<e[a])throw new Error("malformed path data");i.push([r].concat(n.splice(0,e[a])))}}),i};var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi,s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},6934:(t,e,r)=>{"use strict";var s=r(1065),i=r(8956),n=r(3412);class a extends n.K{constructor(t){super(),this._renderer=t,t.runners.resolutionChange.add(this)}resolutionChange(){const t=this.renderable;t._autoResolution&&t.onViewUpdate()}destroy(){const{canvasText:t}=this._renderer;null===t.getReferenceCount(this.currentKey)?t.returnTexture(this.texture):t.decreaseReferenceCount(this.currentKey),this._renderer.runners.resolutionChange.remove(this),this._renderer=null}}class o{constructor(t){this._renderer=t}validateRenderable(t){const e=this._getGpuText(t),r=t.styleKey;return e.currentKey!==r||t._didTextUpdate}addRenderable(t,e){const r=this._getGpuText(t);if(t._didTextUpdate){const e=t._autoResolution?this._renderer.resolution:t.resolution;r.currentKey===t.styleKey&&t.resolution===e||this._updateGpuText(t),t._didTextUpdate=!1}this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._getGpuText(t);e._batcher.updateElement(e)}_updateGpuText(t){const e=this._getGpuText(t);e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,e.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t.styleKey,(0,i.s)(e,t)}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new a(this._renderer);return e.currentKey="--",e.renderable=t,e.transform=t.groupTransform,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}}o.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"text"};var l=r(8851),h=r(8896),c=r(4696),u=r(5105),d=r(1268),p=r(6675),f=r(9390),m=r(1566),g=r(5423),x=r(9437);let y=null,v=null;function _(t,e,r){for(let s=0,i=4*r*e;s<e;++s,i+=4)if(0!==t[i+3])return!1;return!0}function b(t,e,r,s,i){const n=4*e;for(let e=s,a=s*n+4*r;e<=i;++e,a+=n)if(0!==t[a+3])return!1;return!0}function w(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:r}=e,s=Math.min(e.resolution??1,1),i=e.width??r.width,n=e.height??r.height;let a=e.output;if(function(t,e){y||(y=g.e.get().createCanvas(256,128),v=y.getContext("2d",{willReadFrequently:!0}),v.globalCompositeOperation="copy",v.globalAlpha=1),(y.width<t||y.height<e)&&(y.width=(0,x.U5)(t),y.height=(0,x.U5)(e))}(i,n),!v)throw new TypeError("Failed to get canvas 2D context");v.drawImage(r,0,0,i,n,0,0,i*s,n*s);const o=v.getImageData(0,0,i,n).data;let l=0,h=0,c=i-1,u=n-1;for(;h<n&&_(o,i,h);)++h;if(h===n)return f.M.EMPTY;for(;_(o,i,u);)--u;for(;b(o,i,l,h,u);)++l;for(;b(o,i,c,h,u);)--c;return++c,++u,v.globalCompositeOperation="source-over",v.strokeRect(l,h,c-l,u-h),v.globalCompositeOperation="copy",a??(a=new f.M),a.set(l/s,h/s,(c-l)/s,(u-h)/s),a}var T=r(7926),S=r(2288),A=r(1990);const C=new f.M,P=new class{getCanvasAndContext(t){const{text:e,style:r,resolution:s=1}=t,i=r._getFinalPadding(),n=T.P.measureText(e||" ",r),a=Math.ceil(Math.ceil(Math.max(1,n.width)+2*i)*s),o=Math.ceil(Math.ceil(Math.max(1,n.height)+2*i)*s),l=m.N.getOptimalCanvasAndContext(a,o);return this._renderTextToCanvas(e,r,i,s,l),{canvasAndContext:l,frame:r.trim?w({canvas:l.canvas,width:a,height:o,resolution:1,output:C}):C.set(0,0,a,o)}}returnCanvasAndContext(t){m.N.returnCanvasAndContext(t)}_renderTextToCanvas(t,e,r,s,i){const{canvas:n,context:a}=i,o=(0,S.Z)(e),l=T.P.measureText(t||" ",e),h=l.lines,c=l.lineHeight,u=l.lineWidths,d=l.maxLineWidth,f=l.fontProperties,m=n.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=e.textBaseline,e._stroke?.width){const t=e._stroke;a.lineWidth=t.width,a.miterLimit=t.miterLimit,a.lineJoin=t.join,a.lineCap=t.cap}let g,x;a.font=o;const y=e.dropShadow?2:1;for(let t=0;t<y;++t){const n=e.dropShadow&&0===t,o=n?Math.ceil(Math.max(1,m)+2*r):0,y=o*s;if(n){a.fillStyle="black",a.strokeStyle="black";const t=e.dropShadow,r=t.color,i=t.alpha;a.shadowColor=p.Q.shared.setValue(r).setAlpha(i).toRgbaString();const n=t.blur*s,o=t.distance*s;a.shadowBlur=n,a.shadowOffsetX=Math.cos(t.angle)*o,a.shadowOffsetY=Math.sin(t.angle)*o+y}else{if(a.fillStyle=e._fill?(0,A.r)(e._fill,a,l,2*r):null,e._stroke?.width){const t=.5*e._stroke.width+2*r;a.strokeStyle=(0,A.r)(e._stroke,a,l,t)}a.shadowColor="black"}let v=(c-f.fontSize)/2;c-f.fontSize<0&&(v=0);const _=e._stroke?.width??0;for(let t=0;t<h.length;t++)g=_/2,x=_/2+t*c+f.ascent+v,"right"===e.align?g+=d-u[t]:"center"===e.align&&(g+=(d-u[t])/2),e._stroke?.width&&this._drawLetterSpacing(h[t],e,i,g+r,x+r-o,!0),void 0!==e._fill&&this._drawLetterSpacing(h[t],e,i,g+r,x+r-o)}}_drawLetterSpacing(t,e,r,s,i,n=!1){const{context:a}=r,o=e.letterSpacing;let l=!1;if(T.P.experimentalLetterSpacingSupported&&(T.P.experimentalLetterSpacing?(a.letterSpacing=`${o}px`,a.textLetterSpacing=`${o}px`,l=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px")),0===o||l)return void(n?a.strokeText(t,s,i):a.fillText(t,s,i));let h=s;const c=T.P.graphemeSegmenter(t);let u=a.measureText(t).width,d=0;for(let t=0;t<c.length;++t){const e=c[t];n?a.strokeText(e,h,i):a.fillText(e,h,i);let r="";for(let e=t+1;e<c.length;++e)r+=c[e];d=a.measureText(r).width,h+=u-d+o,u=d}}};class E{constructor(t){this._activeTextures={},this._renderer=t}getTexture(t,e,r,s){"string"==typeof t&&((0,c.t6)("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:r,resolution:e}),t.style instanceof u.x||(t.style=new u.x(t.style)),t.textureStyle instanceof h.n||(t.textureStyle=new h.n(t.textureStyle)),"string"!=typeof t.text&&(t.text=t.text.toString());const{text:i,style:n,textureStyle:a}=t,o=t.resolution??this._renderer.resolution,{frame:l,canvasAndContext:p}=P.getCanvasAndContext({text:i,style:n,resolution:o}),f=(0,d.M)(p.canvas,l.width,l.height,o);if(a&&(f.source.style=a),n.trim&&(l.pad(n.padding),f.frame.copyFrom(l),f.frame.scale(1/o),f.updateUvs()),n.filters){const t=this._applyFilters(f,n.filters);return this.returnTexture(f),P.returnCanvasAndContext(p),t}return this._renderer.texture.initSource(f._source),P.returnCanvasAndContext(p),f}returnTexture(t){const e=t.source;e.resource=null,e.uploadMethodId="unknown",e.alphaMode="no-premultiply-alpha",l.W.returnTexture(t,!0)}renderTextToCanvas(){(0,c.t6)("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].texture;const r=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle});return this._activeTextures[e]={texture:r,usageCount:1},r}decreaseReferenceCount(t){const e=this._activeTextures[t];e.usageCount--,0===e.usageCount&&(this.returnTexture(e.texture),this._activeTextures[t]=null)}getReferenceCount(t){return this._activeTextures[t]?.usageCount??null}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,e){const r=this._renderer.renderTarget.renderTarget,s=this._renderer.filter.generateFilteredTexture({texture:t,filters:e});return this._renderer.renderTarget.bind(r,!1),s}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}E.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem,s.Ag.CanvasSystem],name:"canvasText"},s.XO.add(E),s.XO.add(o)},6976:(t,e,r)=>{"use strict";r.d(e,{M:()=>a});var s=r(5423),i=r(6114);let n;function a(t){return void 0!==n||(n=(()=>{const e={stencil:!0,failIfMajorPerformanceCaveat:t??i.k.defaultOptions.failIfMajorPerformanceCaveat};try{if(!s.e.get().getWebGLRenderingContext())return!1;let t=s.e.get().createCanvas().getContext("webgl",e);const r=!!t?.getContextAttributes()?.stencil;if(t){const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}return t=null,r}catch(t){return!1}})()),n}},7249:(t,e,r)=>{"use strict";r.d(e,{X:()=>n});var s=r(2437),i=r(6121);class n extends s.N{localTransform=new i.U;alpha=1;#$;#r=!1;constructor(t,e){super(t),void 0!==e.x&&(this.x=e.x),void 0!==e.y&&(this.y=e.y),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.scaleX&&(this.scaleX=e.scaleX),void 0!==e.scaleY&&(this.scaleY=e.scaleY),void 0!==e.pivotX&&(this.pivotX=e.pivotX),void 0!==e.pivotY&&(this.pivotY=e.pivotY),void 0!==e.rotation&&(this.rotation=e.rotation),void 0!==e.alpha&&(this.alpha=e.alpha),this.#$=e.layer,this.#r=e.useYSort??!1}set renderer(t){super.renderer=t,this.#$&&t&&t._addToLayer(this,this.#$)}get renderer(){return super.renderer}_updateWorldTransform(){const t=this.parent;t&&(0,s.l)(t)&&(this.worldTransform.update(t.worldTransform,this.localTransform),this.worldAlpha.v=t.worldAlpha.v*this.alpha);const e=this._pixiContainer,r=this.renderer;if(this.#$&&r){const t=this.worldTransform;e.position.set(t.x.v,t.y.v),e.scale.set(t.scaleX.v,t.scaleY.v),e.rotation=t.rotation.v,e.alpha=this.worldAlpha.v}else{const t=this.localTransform;e.position.set(t.x,t.y),this.#r&&(e.zIndex=t.y),e.pivot.set(t.pivotX,t.pivotY),e.scale.set(t.scaleX,t.scaleY),e.rotation=t.rotation,e.alpha=this.alpha}super._updateWorldTransform()}set x(t){this.localTransform.x=t}get x(){return this.localTransform.x}set y(t){this.localTransform.y=t}get y(){return this.localTransform.y}set scale(t){this.localTransform.scaleX=t,this.localTransform.scaleY=t}get scale(){return this.localTransform.scaleX}set scaleX(t){this.localTransform.scaleX=t}get scaleX(){return this.localTransform.scaleX}set scaleY(t){this.localTransform.scaleY=t}get scaleY(){return this.localTransform.scaleY}set pivotX(t){this.localTransform.pivotX=t}get pivotX(){return this.localTransform.pivotX}set pivotY(t){this.localTransform.pivotY=t}get pivotY(){return this.localTransform.pivotY}set rotation(t){this.localTransform.rotation=t}get rotation(){return this.localTransform.rotation}}},7285:(t,e,r)=>{"use strict";r.d(e,{_:()=>i});var s=r(159);class i extends s.q{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(t){super(t,0,!1)}}},7335:(t,e,r)=>{"use strict";r.d(e,{b:()=>s,m:()=>i});const s={name:"round-pixels-bit",vertex:{header:"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}},i={name:"round-pixels-bit",vertex:{header:"\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}}},7399:(t,e,r)=>{"use strict";r.d(e,{f:()=>a});var s=r(5242),i=r(1347),n=r(4382);class a extends n.e{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new i.Q1(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new i.Q1(0,0,0,0);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=i.Aq.newFloatArray(t.length));let e=this.uvs,r=this.uvs.length,n=this.region.u,a=this.region.v,o=0,l=0;if(this.region instanceof s.TE){let s=this.region,i=s.page,h=i.width,c=i.height;switch(s.degrees){case 90:n-=(s.originalHeight-s.offsetY-s.height)/h,a-=(s.originalWidth-s.offsetX-s.width)/c,o=s.originalHeight/h,l=s.originalWidth/c;for(let s=0;s<r;s+=2)e[s]=n+t[s+1]*o,e[s+1]=a+(1-t[s])*l;return;case 180:n-=(s.originalWidth-s.offsetX-s.width)/h,a-=s.offsetY/c,o=s.originalWidth/h,l=s.originalHeight/c;for(let s=0;s<r;s+=2)e[s]=n+(1-t[s])*o,e[s+1]=a+(1-t[s+1])*l;return;case 270:n-=s.offsetY/h,a-=s.offsetX/c,o=s.originalHeight/h,l=s.originalWidth/c;for(let s=0;s<r;s+=2)e[s]=n+(1-t[s+1])*o,e[s+1]=a+t[s]*l;return}n-=s.offsetX/h,a-=(s.originalHeight-s.offsetY-s.height)/c,o=s.originalWidth/h,l=s.originalHeight/c}else this.region?(o=this.region.u2-n,l=this.region.v2-a):(n=a=0,o=l=1);for(let s=0;s<r;s+=2)e[s]=n+t[s]*o,e[s+1]=a+t[s+1]*l}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new a(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),i.Aq.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=this.uvs instanceof Float32Array?i.Aq.newFloatArray(this.uvs.length):new Array(this.uvs.length),i.Aq.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),i.Aq.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),i.Aq.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,r,s,i,n){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,r,s,i,n)}newLinkedMesh(){let t=new a(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t}}},7433:(t,e,r)=>{"use strict";r.d(e,{U:()=>n});const s={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},i=class t{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}set cullMode(t){"none"!==t?(this.culling=!0,this.clockwiseFrontFace="front"===t):this.culling=!1}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend="none"!==t,this._blendMode=t,this._blendModeId=s[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new t;return e.depthTest=!1,e.blend=!0,e}};i.default2d=i.for2d();let n=i},7448:(t,e,r)=>{"use strict";r(166),r(7635),r(2839)._},7455:(t,e,r)=>{"use strict";r.d(e,{s:()=>P});var s=r(1065),i=r(7630),n=r(7694),a=r(7717),o=r(2445),l=r(6212),h=r(5809),c=r(1351),u=r(4102),d=r(5671),p=r(6694),f=r(3051),m=r(3385),g=r(9097),x=r(3289),y=r(796),v=r(4336),_=r(9586),b=r(4219),w=r(6307),T=r(3798),S=r(2027),A=r(8064),C=r(2843);const P=new class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new S.x,this.loader=new m.a,this.cache=o.l,this._backgroundLoader=new a.o(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized)return void(0,n.R)("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const e=t.texturePreference?.resolution??1,r="number"==typeof e?[e]:e,s=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:r}}),t.preferences&&this.setPreferences(t.preferences)}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();const r=(0,C.a)(t),s=(0,A.z)(t).map(t=>{if("string"!=typeof t){const e=this.resolver.getAlias(t);return e.some(t=>!this.resolver.hasKey(t))&&this.add(t),Array.isArray(e)?e[0]:e}return this.resolver.hasKey(t)||this.add({alias:t,src:t}),t}),i=this.resolver.resolve(s),n=await this._mapLoadToResolve(i,e);return r?n[s[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let r=!1;"string"==typeof t&&(r=!0,t=[t]);const s=this.resolver.resolveBundle(t),i={},n=Object.keys(s);let a=0,o=0;const l=()=>{e?.(++a/o)},h=n.map(t=>{const e=s[t],r=Object.values(e),n=[...new Set(r.flat())];return o+=n.length,this._mapLoadToResolve(e,l).then(e=>{i[t]=e})});return await Promise.all(h),r?i[t[0]]:i}async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(t=>{this._backgroundLoader.add(Object.values(t))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return o.l.get(t);const e={};for(let r=0;r<t.length;r++)e[r]=o.l.get(t[r]);return e}async _mapLoadToResolve(t,e){const r=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;const s=await this.loader.load(r,e);this._backgroundLoader.active=!0;const i={};return r.forEach(t=>{const e=s[t.src],r=[t.src];t.alias&&r.push(...t.alias),r.forEach(t=>{i[t]=e}),o.l.set(r,e)}),i}async unload(t){this._initialized||await this.init();const e=(0,A.z)(t).map(t=>"string"!=typeof t?t.src:t),r=this.resolver.resolve(e);await this._unloadFromResolved(r)}async unloadBundle(t){this._initialized||await this.init(),t=(0,A.z)(t);const e=this.resolver.resolveBundle(t),r=Object.keys(e).map(t=>this._unloadFromResolved(e[t]));await Promise.all(r)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(t=>{o.l.remove(t.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const r of t.detections)t.skipDetections||await r.test()?e=await r.add(e):t.skipDetections||(e=await r.remove(e));return e=e.filter((t,r)=>e.indexOf(t)===r),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(e=>e in t).forEach(r=>{e.config[r]=t[r]})})}};s.XO.handleByList(s.Ag.LoadParser,P.loader.parsers).handleByList(s.Ag.ResolveParser,P.resolver.parsers).handleByList(s.Ag.CacheParser,P.cache.parsers).handleByList(s.Ag.DetectionParser,P.detections),s.XO.add(l.P,c.M,h.Q,f.Y,u.p,d.G,p.d,g.F,x.f,y.e,v.Z,_.P,b.Qj,i.R,i.w,T.j,w.u);const E={loader:s.Ag.LoadParser,resolver:s.Ag.ResolveParser,cache:s.Ag.CacheParser,detection:s.Ag.DetectionParser};s.XO.handle(s.Ag.Asset,t=>{const e=t.ref;Object.entries(E).filter(([t])=>!!e[t]).forEach(([t,r])=>s.XO.add(Object.assign(e[t],{extension:e[t].extension??r})))},t=>{const e=t.ref;Object.keys(E).filter(t=>!!e[t]).forEach(t=>s.XO.remove(e[t]))})},7604:(t,e,r)=>{"use strict";function s(t){const e={};for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}r.d(e,{S:()=>s})},7630:(t,e,r)=>{"use strict";r.d(e,{R:()=>p,w:()=>d});var s=r(3463),i=r(9279),n=r(5423),a=r(1065),o=r(8869),l=r(3809),h=r(4566),c=r(1143);const u=[".xml",".fnt"],d={extension:{type:a.Ag.CacheParser,name:"cacheBitmapFont"},test:t=>t instanceof l.B,getCacheableAssets(t,e){const r={};return t.forEach(t=>{r[t]=e,r[`${t}-bitmap`]=e}),r[`${e.fontFamily}-bitmap`]=e,r}},p={extension:{type:a.Ag.LoadParser,priority:s.T.Normal},name:"loadBitmapFont",id:"bitmap-font",test:t=>u.includes(o.A.extname(t).toLowerCase()),testParse:async t=>h.D.test(t)||c.s.test(t),async parse(t,e,r){const s=h.D.test(t)?h.D.parse(t):c.s.parse(t),{src:n}=e,{pages:a}=s,u=[],d=s.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1}:{};for(let t=0;t<a.length;++t){const e=a[t].file;let r=o.A.join(o.A.dirname(n),e);r=(0,i.Y)(r,n),u.push({src:r,data:d})}const p=await r.load(u),f=u.map(t=>p[t.src]);return new l.B({data:s,textures:f},n)},async load(t,e){const r=await n.e.get().fetch(t);return await r.text()},async unload(t,e,r){await Promise.all(t.pages.map(t=>r.unload(t.texture.source._sourceOrigin))),t.destroy()}}},7635:(t,e,r)=>{"use strict";r.d(e,{V:()=>a});var s=r(166),i=r(6793);class n extends i.a{async doLoad(t){const e=new Promise(e=>{const r=new Image;r.crossOrigin="anonymous",r.src=t,r.onload=()=>{if(this.loadingPromises.delete(t),!this.hasActiveRef(t))return void e(void 0);if(this.cachedAssets.has(t))return console.error(`Texture already loaded: ${t}`),void e(void 0);const i=s.gPd.from(r);i.source.scaleMode="nearest",this.cachedAssets.set(t,i),e(i)},r.onerror=r=>{this.loadingPromises.delete(t),console.error(`Failed to load texture: ${t}`,r),e(void 0)}});return this.loadingPromises.set(t,e),await e}cleanup(t,e){e.destroy(!0)}}const a=new n},7694:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});let s=0;const i=500;function n(...t){s!==i&&(s++,s===i?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}},7717:(t,e,r)=>{"use strict";r.d(e,{o:()=>s});class s{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let r=0;r<e;r++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}},7722:(t,e,r)=>{"use strict";r.d(e,{WebGLRenderer:()=>Kt});var s=r(1065),i=r(5199),n=r(9677),a=r(2305),o=r(1570),l=r(4405),h=r(7335),c=r(2478),u=r(1657),d=r(4449);class p{contextChange(t){const e=new d.k({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new i.u,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),r=t.limits.maxBatchableTextures,s=(0,n.I)({name:"graphics",bits:[a.a,(0,o.P)(r),l.mA,h.m]});this.shader=new u.M({glProgram:s,resources:{localUniforms:e,batchSamplers:(0,c.n)(r)}})}execute(t,e){const r=e.context,s=r.customShader||this.shader,i=t.renderer,n=i.graphicsContext,{batcher:a,instructions:o}=n.getContextRenderData(r);s.groups[0]=i.globalUniforms.bindGroup,i.state.set(t.state),i.shader.bind(s),i.geometry.bind(a.geometry,s.glProgram);const l=o.instructions;for(let t=0;t<o.instructionSize;t++){const e=l[t];if(e.size){for(let t=0;t<e.textures.count;t++)i.texture.bind(e.textures.textures[t],t);i.geometry.draw(e.topology,e.size,e.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}p.extension={type:[s.Ag.WebGLPipesAdaptor],name:"graphics"};var f=r(2577),m=r(9739),g=r(7694);class x{init(){const t=(0,n.I)({name:"mesh",bits:[l.mA,f.m,h.m]});this._shader=new u.M({glProgram:t,resources:{uTexture:m.g.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new i.u}}}})}execute(t,e){const r=t.renderer;let s=e._shader;if(s){if(!s.glProgram)return void(0,g.R)("Mesh shader has no glProgram",e.shader)}else{s=this._shader;const t=e.texture,r=t.source;s.resources.uTexture=r,s.resources.uSampler=r.style,s.resources.textureUniforms.uniforms.uTextureMatrix=t.textureMatrix.mapCoord}s.groups[100]=r.globalUniforms.bindGroup,s.groups[101]=t.localUniformsBindGroup,r.encoder.draw({geometry:e._geometry,shader:s,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}x.extension={type:[s.Ag.WebGLPipesAdaptor],name:"mesh"};var y=r(7433);class v{constructor(){this._tempState=y.U.for2d(),this._didUploadHash={}}init(t){t.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(t,e,r){const s=t.renderer,i=this._didUploadHash[r.uid];s.shader.bind(r,i),i||(this._didUploadHash[r.uid]=!0),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(e,r.glProgram)}execute(t,e){const r=t.renderer;this._tempState.blendMode=e.blendMode,r.state.set(this._tempState);const s=e.textures.textures;for(let t=0;t<e.textures.count;t++)r.texture.bind(s[t],t);r.geometry.draw(e.topology,e.size,e.start)}}v.extension={type:[s.Ag.WebGLPipesAdaptor],name:"batch"};var _=r(6114),b=r(1673),w=r(5153),T=r(9798),S=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(S||{});class A{constructor(t,e){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.type=e}}class C{constructor(t){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(t){return this._gpuBuffers[t.uid]||this.createGLBuffer(t)}bind(t){const{_gl:e}=this,r=this.getGlBuffer(t);e.bindBuffer(r.type,r.buffer)}bindBufferBase(t,e){const{_gl:r}=this;this._boundBufferBases[e]!==t&&(this._boundBufferBases[e]=t,t._lastBindBaseLocation=e,r.bindBufferBase(r.UNIFORM_BUFFER,e,t.buffer))}nextBindBase(t){this._bindCallId++,this._minBaseLocation=0,t&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(t){let e=this.getLastBindBaseLocation(t);if(e>=this._minBaseLocation)return t._lastBindCallId=this._bindCallId,e;let r=0,s=this._nextBindBaseIndex;for(;r<2;){s>=this._maxBindings&&(s=this._minBaseLocation,r++);const t=this._boundBufferBases[s];if(!t||t._lastBindCallId!==this._bindCallId)break;s++}return e=s,this._nextBindBaseIndex=s+1,r>=2?-1:(t._lastBindCallId=this._bindCallId,this._boundBufferBases[e]=null,e)}getLastBindBaseLocation(t){const e=t._lastBindBaseLocation;return this._boundBufferBases[e]===t?e:-1}bindBufferRange(t,e,r,s){const{_gl:i}=this;r||(r=0),e||(e=0),this._boundBufferBases[e]=null,i.bindBufferRange(i.UNIFORM_BUFFER,e||0,t.buffer,256*r,s||256)}updateBuffer(t){const{_gl:e}=this,r=this.getGlBuffer(t);if(t._updateID===r.updateID)return r;r.updateID=t._updateID,e.bindBuffer(r.type,r.buffer);const s=t.data,i=t.descriptor.usage&T.S.STATIC?e.STATIC_DRAW:e.DYNAMIC_DRAW;return s?r.byteLength>=s.byteLength?e.bufferSubData(r.type,0,s,0,t._updateSize/s.BYTES_PER_ELEMENT):(r.byteLength=s.byteLength,e.bufferData(r.type,s,i)):(r.byteLength=t.descriptor.size,e.bufferData(r.type,r.byteLength,i)),r}destroyAll(){const t=this._gl;for(const e in this._gpuBuffers)t.deleteBuffer(this._gpuBuffers[e].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(t,e){const r=this._gpuBuffers[t.uid],s=this._gl;e||s.deleteBuffer(r.buffer),this._gpuBuffers[t.uid]=null}createGLBuffer(t){const{_gl:e}=this;let r=S.ARRAY_BUFFER;t.descriptor.usage&T.S.INDEX?r=S.ELEMENT_ARRAY_BUFFER:t.descriptor.usage&T.S.UNIFORM&&(r=S.UNIFORM_BUFFER);const s=new A(e.createBuffer(),r);return this._gpuBuffers[t.uid]=s,t.on("destroy",this.onBufferDestroy,this),s}resetState(){this._boundBufferBases=Object.create(null)}}C.extension={type:[s.Ag.WebGLSystem],name:"buffer"};var P=r(5423);const E=class t{constructor(t){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=t,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this._renderer.gl=t}init(e){e={...t.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&((0,g.R)("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),this.canvas=r?P.e.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const t=this._renderer.background.alpha<1,r=e.premultipliedAlpha??!0,s=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:t,premultipliedAlpha:r,antialias:s,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(t){if(!this.multiView)return void(t!==this.canvas&&(0,g.R)("multiView is disabled, but targetCanvas is not the main canvas"));const{canvas:e}=this;(e.width<t.width||e.height<t.height)&&(e.width=Math.max(t.width,t.width),e.height=Math.max(t.height,t.height))}initFromContext(t){this.gl=t,this.webGLVersion=t instanceof P.e.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(t),this._renderer.runners.contextChange.emit(t);const e=this._renderer.view.canvas;e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(t,e){let r;const s=this.canvas;if(2===t&&(r=s.getContext("webgl2",e)),!r&&(r=s.getContext("webgl",e),!r))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=r,this.initFromContext(this.gl)}getExtensions(){const{gl:t}=this,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc"),rgtc:t.getExtension("EXT_texture_compression_rgtc"),loseContext:t.getExtension("WEBGL_lose_context")};if(1===this.webGLVersion)this.extensions={...e,drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:t.getExtension("ANGLE_instanced_arrays"),srgb:t.getExtension("EXT_sRGB")};else{this.extensions={...e,colorBufferFloat:t.getExtension("EXT_color_buffer_float")};const r=t.getExtension("WEBGL_provoking_vertex");r&&r.provokingVertexWEBGL(r.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(t){t.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this._renderer.view.canvas;this._renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(t){const e=t.getContextAttributes();e&&!e.stencil&&(0,g.R)("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=this.supports,s=2===this.webGLVersion,i=this.extensions;r.uint32Indices=s||!!i.uint32ElementIndex,r.uniformBufferObject=s,r.vertexArrayObject=s||!!i.vertexArrayObject,r.srgbTextures=s||!!i.srgb,r.nonPowOf2wrapping=s,r.nonPowOf2mipmaps=s,r.msaa=s,r.uint32Indices||(0,g.R)("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};E.extension={type:[s.Ag.WebGLSystem],name:"context"},E.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let M=E;var k=r(4988),R=r(498),B=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(B||{}),I=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(I||{}),F=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(F||{});const O={uint8x2:F.UNSIGNED_BYTE,uint8x4:F.UNSIGNED_BYTE,sint8x2:F.BYTE,sint8x4:F.BYTE,unorm8x2:F.UNSIGNED_BYTE,unorm8x4:F.UNSIGNED_BYTE,snorm8x2:F.BYTE,snorm8x4:F.BYTE,uint16x2:F.UNSIGNED_SHORT,uint16x4:F.UNSIGNED_SHORT,sint16x2:F.SHORT,sint16x4:F.SHORT,unorm16x2:F.UNSIGNED_SHORT,unorm16x4:F.UNSIGNED_SHORT,snorm16x2:F.SHORT,snorm16x4:F.SHORT,float16x2:F.HALF_FLOAT,float16x4:F.HALF_FLOAT,float32:F.FLOAT,float32x2:F.FLOAT,float32x3:F.FLOAT,float32x4:F.FLOAT,uint32:F.UNSIGNED_INT,uint32x2:F.UNSIGNED_INT,uint32x3:F.UNSIGNED_INT,uint32x4:F.UNSIGNED_INT,sint32:F.INT,sint32x2:F.INT,sint32x3:F.INT,sint32x4:F.INT};function G(t){return O[t]??O.float32}const D={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class U{constructor(t){this._geometryVaoHash=Object.create(null),this._renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const t=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const e=this._renderer.context.extensions.vertexArrayObject;e&&(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t));const r=this._renderer.context.extensions.vertexAttribDivisorANGLE;r&&(t.drawArraysInstanced=(t,e,s,i)=>{r.drawArraysInstancedANGLE(t,e,s,i)},t.drawElementsInstanced=(t,e,s,i,n)=>{r.drawElementsInstancedANGLE(t,e,s,i,n)},t.vertexAttribDivisor=(t,e)=>r.vertexAttribDivisorANGLE(t,e)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(t,e){const r=this.gl;this._activeGeometry=t;const s=this.getVao(t,e);this._activeVao!==s&&(this._activeVao=s,r.bindVertexArray(s)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this._renderer.buffer;for(let r=0;r<t.buffers.length;r++){const s=t.buffers[r];e.updateBuffer(s)}}checkCompatibility(t,e){const r=t.attributes,s=e._attributeData;for(const t in s)if(!r[t])throw new Error(`shader and geometry incompatible, geometry missing the "${t}" attribute`)}getSignature(t,e){const r=t.attributes,s=e._attributeData,i=["g",t.uid];for(const t in r)s[t]&&i.push(t,s[t].location);return i.join("-")}getVao(t,e){return this._geometryVaoHash[t.uid]?.[e._key]||this.initGeometryVao(t,e)}initGeometryVao(t,e,r=!0){const s=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(e),this.checkCompatibility(t,e);const n=this.getSignature(t,e);this._geometryVaoHash[t.uid]||(this._geometryVaoHash[t.uid]=Object.create(null),t.on("destroy",this.onGeometryDestroy,this));const a=this._geometryVaoHash[t.uid];let o=a[n];if(o)return a[e._key]=o,o;(0,R.q)(t,e._attributeData);const l=t.buffers;o=s.createVertexArray(),s.bindVertexArray(o);for(let t=0;t<l.length;t++){const e=l[t];i.bind(e)}return this.activateVao(t,e),a[e._key]=o,a[n]=o,s.bindVertexArray(null),o}onGeometryDestroy(t,e){const r=this._geometryVaoHash[t.uid],s=this.gl;if(r){if(e)for(const t in r)this._activeVao!==r[t]&&this.unbind(),s.deleteVertexArray(r[t]);this._geometryVaoHash[t.uid]=null}}destroyAll(t=!1){const e=this.gl;for(const r in this._geometryVaoHash){if(t)for(const t in this._geometryVaoHash[r]){const s=this._geometryVaoHash[r];this._activeVao!==s&&this.unbind(),e.deleteVertexArray(s[t])}this._geometryVaoHash[r]=null}}activateVao(t,e){const r=this._renderer.gl,s=this._renderer.buffer,i=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let n=null;for(const t in i){const a=i[t],o=a.buffer,l=s.getGlBuffer(o),h=e._attributeData[t];if(h){n!==l&&(s.bind(o),n=l);const t=h.location;r.enableVertexAttribArray(t);const e=(0,k.m)(a.format),i=G(a.format);if("int"===h.format?.substring(1,4)?r.vertexAttribIPointer(t,e.size,i,a.stride,a.offset):r.vertexAttribPointer(t,e.size,i,e.normalised,a.stride,a.offset),a.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");{const e=a.divisor??1;r.vertexAttribDivisor(t,e)}}}}}draw(t,e,r,s){const{gl:i}=this._renderer,n=this._activeGeometry,a=D[t||n.topology];if(s??(s=n.instanceCount),n.indexBuffer){const t=n.indexBuffer.data.BYTES_PER_ELEMENT,o=2===t?i.UNSIGNED_SHORT:i.UNSIGNED_INT;s>1?i.drawElementsInstanced(a,e||n.indexBuffer.data.length,o,(r||0)*t,s):i.drawElements(a,e||n.indexBuffer.data.length,o,(r||0)*t)}else s>1?i.drawArraysInstanced(a,r||0,e||n.getSize(),s):i.drawArrays(a,r||0,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null,this._geometryVaoHash=null}}U.extension={type:[s.Ag.WebGLSystem],name:"geometry"};var L=r(8337),N=r(4269),X=r(5007);const V=new L.V({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),Y=class t{constructor(t){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=t}init(e={}){const{useBackBuffer:r,antialias:s}={...t.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||((0,g.R)("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=y.U.for2d();const i=new X.M({vertex:"\n attribute vec2 aPosition;\n out vec2 vUv;\n\n void main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n\n vUv = (aPosition + 1.0) / 2.0;\n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y;\n }",fragment:"\n in vec2 vUv;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n void main() {\n finalColor = texture(uTexture, vUv);\n }",name:"big-triangle"});this._bigTriangleShader=new u.M({glProgram:i,resources:{uTexture:m.g.WHITE.source}})}renderStart(t){const e=this._renderer.renderTarget.getRenderTarget(t.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!e.isRoot,this._useBackBufferThisRender){const e=this._renderer.renderTarget.getRenderTarget(t.target);this._targetTexture=e.colorTexture,t.target=this._getBackBufferTexture(e.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const t=this._renderer;t.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(t.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,t.encoder.draw({geometry:V,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(t){return this._backBufferTexture=this._backBufferTexture||new m.g({source:new N.v({width:t.width,height:t.height,resolution:t._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(t.width,t.height,t._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};Y.extension={type:[s.Ag.WebGLSystem],name:"backBuffer",priority:1},Y.defaultOptions={useBackBuffer:!1};let z=Y;class W{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.gl.colorMask(!!(8&t),!!(4&t),!!(2&t),!!(1&t)))}}W.extension={type:[s.Ag.WebGLSystem],name:"colorMask"};class H{constructor(t){this.commandFinished=Promise.resolve(),this._renderer=t}setGeometry(t,e){this._renderer.geometry.bind(t,e.glProgram)}finishRenderPass(){}draw(t){const e=this._renderer,{geometry:r,shader:s,state:i,skipSync:n,topology:a,size:o,start:l,instanceCount:h}=t;e.shader.bind(s,n),e.geometry.bind(r,e.shader._activeProgram),i&&e.state.set(i),e.geometry.draw(a,o,l,h??r.instanceCount)}destroy(){this._renderer=null}}H.extension={type:[s.Ag.WebGLSystem],name:"encoder"};var j=r(6890);class q{constructor(t){this._renderer=t}contextChange(){const t=this._renderer.gl;this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=(0,j.u)(this.maxTextures,t);const e=2===this._renderer.context.webGLVersion;this.maxUniformBindings=e?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0}destroy(){}}q.extension={type:[s.Ag.WebGLSystem],name:"limits"};var $=r(9250),K=r(8271);class Q{constructor(t){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:K.K.NONE},this._renderTargetStencilState=Object.create(null),t.renderTarget.onRenderTargetChange.add(this)}contextChange(t){this._gl=t,this._comparisonFuncMapping={always:t.ALWAYS,never:t.NEVER,equal:t.EQUAL,"not-equal":t.NOTEQUAL,less:t.LESS,"less-equal":t.LEQUAL,greater:t.GREATER,"greater-equal":t.GEQUAL},this._stencilOpsMapping={keep:t.KEEP,zero:t.ZERO,replace:t.REPLACE,invert:t.INVERT,"increment-clamp":t.INCR,"decrement-clamp":t.DECR,"increment-wrap":t.INCR_WRAP,"decrement-wrap":t.DECR_WRAP},this.resetState()}onRenderTargetChange(t){if(this._activeRenderTarget===t)return;this._activeRenderTarget=t;let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:K.K.DISABLED,stencilReference:0}),this.setStencilMode(e.stencilMode,e.stencilReference)}resetState(){this._stencilCache.enabled=!1,this._stencilCache.stencilMode=K.K.NONE,this._stencilCache.stencilReference=0}setStencilMode(t,e){const r=this._renderTargetStencilState[this._activeRenderTarget.uid],s=this._gl,i=$.g[t],n=this._stencilCache;r.stencilMode=t,r.stencilReference=e,t!==K.K.DISABLED?(this._stencilCache.enabled||(this._stencilCache.enabled=!0,s.enable(s.STENCIL_TEST)),t===n.stencilMode&&n.stencilReference===e||(n.stencilMode=t,n.stencilReference=e,s.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],e,255),s.stencilOp(s.KEEP,s.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))):this._stencilCache.enabled&&(this._stencilCache.enabled=!1,s.disable(s.STENCIL_TEST))}}Q.extension={type:[s.Ag.WebGLSystem],name:"stencil"};var Z=r(1009);const J={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};function tt(t){const e=t.map(t=>({data:t,offset:0,size:0}));let r=0,s=0;for(let t=0;t<e.length;t++){const i=e[t];if(r=J[i.data.type],!r)throw new Error(`Unknown type ${i.data.type}`);i.data.size>1&&(r=Math.max(r,16)*i.data.size);const n=12===r?16:r;i.size=r;const a=s%16;s+=a>0&&16-a<n?(16-a)%16:(r-a%r)%r,i.offset=s,s+=r}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}var et=r(2337),rt=r(4364);function st(t,e){const r=Math.max(J[t.data.type]/16,1),s=t.data.value.length/t.data.size,i=(4-s%4)%4,n=t.data.type.indexOf("i32")>=0?"dataInt32":"data";return`\n v = uv.${t.data.name};\n offset += ${e};\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${t.data.size*r}; i++)\n {\n for(var j = 0; j < ${s}; j++)\n {\n ${n}[arrayOffset++] = v[t++];\n }\n ${0!==i?`arrayOffset += ${i};`:""}\n }\n `}function it(t){return(0,et.E)(t,"uboStd40",st,rt.g)}class nt extends Z.W{constructor(){super({createUboElements:tt,generateUboSync:it})}}nt.extension={type:[s.Ag.WebGLSystem],name:"ubo"};var at=r(8900),ot=r(9390),lt=r(1386),ht=r(1711);class ct{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}class ut{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new ot.M}init(t,e){this._renderer=t,this._renderTargetSystem=e,t.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new ot.M}copyToTexture(t,e,r,s,i){const n=this._renderTargetSystem,a=this._renderer,o=n.getGpuRenderTarget(t),l=a.gl;return this.finishRenderPass(t),l.bindFramebuffer(l.FRAMEBUFFER,o.resolveTargetFramebuffer),a.texture.bind(e,0),l.copyTexSubImage2D(l.TEXTURE_2D,0,i.x,i.y,r.x,r.y,s.width,s.height),e}startRenderPass(t,e=!0,r,s){const i=this._renderTargetSystem,n=t.colorTexture,a=i.getGpuRenderTarget(t);let o=s.y;t.isRoot&&(o=n.pixelHeight-s.height),t.colorTextures.forEach(t=>{this._renderer.texture.unbind(t)});const l=this._renderer.gl;l.bindFramebuffer(l.FRAMEBUFFER,a.framebuffer);const h=this._viewPortCache;h.x===s.x&&h.y===o&&h.width===s.width&&h.height===s.height||(h.x=s.x,h.y=o,h.width=s.width,h.height=s.height,l.viewport(s.x,o,s.width,s.height)),a.depthStencilRenderBuffer||!t.stencil&&!t.depth||this._initStencil(a),this.clear(t,e,r)}finishRenderPass(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);if(!e.msaa)return;const r=this._renderer.gl;r.bindFramebuffer(r.FRAMEBUFFER,e.resolveTargetFramebuffer),r.bindFramebuffer(r.READ_FRAMEBUFFER,e.framebuffer),r.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,r.COLOR_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer)}initGpuRenderTarget(t){const e=this._renderer.gl,r=new ct;return t.colorTexture instanceof lt.q?(this._renderer.context.ensureCanvasSize(t.colorTexture.resource),r.framebuffer=null,r):(this._initColor(t,r),e.bindFramebuffer(e.FRAMEBUFFER,null),r)}destroyGpuRenderTarget(t){const e=this._renderer.gl;t.framebuffer&&(e.deleteFramebuffer(t.framebuffer),t.framebuffer=null),t.resolveTargetFramebuffer&&(e.deleteFramebuffer(t.resolveTargetFramebuffer),t.resolveTargetFramebuffer=null),t.depthStencilRenderBuffer&&(e.deleteRenderbuffer(t.depthStencilRenderBuffer),t.depthStencilRenderBuffer=null),t.msaaRenderBuffer.forEach(t=>{e.deleteRenderbuffer(t)}),t.msaaRenderBuffer=null}clear(t,e,r){if(!e)return;const s=this._renderTargetSystem;"boolean"==typeof e&&(e=e?ht.u.ALL:ht.u.NONE);const i=this._renderer.gl;if(e&ht.u.COLOR){r??(r=s.defaultClearColor);const t=this._clearColorCache,e=r;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]||(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],i.clearColor(e[0],e[1],e[2],e[3]))}i.clear(e)}resizeGpuRenderTarget(t){if(t.isRoot)return;const e=this._renderTargetSystem.getGpuRenderTarget(t);this._resizeColor(t,e),(t.stencil||t.depth)&&this._resizeStencil(e)}_initColor(t,e){const r=this._renderer,s=r.gl,i=s.createFramebuffer();if(e.resolveTargetFramebuffer=i,s.bindFramebuffer(s.FRAMEBUFFER,i),e.width=t.colorTexture.source.pixelWidth,e.height=t.colorTexture.source.pixelHeight,t.colorTextures.forEach((t,i)=>{const n=t.source;n.antialias&&(r.context.supports.msaa?e.msaa=!0:(0,g.R)("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),r.texture.bindSource(n,0);const a=r.texture.getGlSource(n).texture;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+i,3553,a,0)}),e.msaa){const r=s.createFramebuffer();e.framebuffer=r,s.bindFramebuffer(s.FRAMEBUFFER,r),t.colorTextures.forEach((t,r)=>{const i=s.createRenderbuffer();e.msaaRenderBuffer[r]=i})}else e.framebuffer=i;this._resizeColor(t,e)}_resizeColor(t,e){const r=t.colorTexture.source;if(e.width=r.pixelWidth,e.height=r.pixelHeight,t.colorTextures.forEach((t,e)=>{0!==e&&t.source.resize(r.width,r.height,r._resolution)}),e.msaa){const r=this._renderer,s=r.gl,i=e.framebuffer;s.bindFramebuffer(s.FRAMEBUFFER,i),t.colorTextures.forEach((t,i)=>{const n=t.source;r.texture.bindSource(n,0);const a=r.texture.getGlSource(n).internalFormat,o=e.msaaRenderBuffer[i];s.bindRenderbuffer(s.RENDERBUFFER,o),s.renderbufferStorageMultisample(s.RENDERBUFFER,4,a,n.pixelWidth,n.pixelHeight),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+i,s.RENDERBUFFER,o)})}}_initStencil(t){if(null===t.framebuffer)return;const e=this._renderer.gl,r=e.createRenderbuffer();t.depthStencilRenderBuffer=r,e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r),this._resizeStencil(t)}_resizeStencil(t){const e=this._renderer.gl;e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilRenderBuffer),t.msaa?e.renderbufferStorageMultisample(e.RENDERBUFFER,4,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,2===this._renderer.context.webGLVersion?e.DEPTH24_STENCIL8:e.DEPTH_STENCIL,t.width,t.height)}prerender(t){const e=t.colorTexture.resource;this._renderer.context.multiView&<.q.test(e)&&this._renderer.context.ensureCanvasSize(e)}postrender(t){if(this._renderer.context.multiView&<.q.test(t.colorTexture.resource)){const e=this._renderer.context.canvas,r=t.colorTexture;r.context2D.drawImage(e,0,r.pixelHeight-e.height)}}}class dt extends at.l{constructor(t){super(t),this.adaptor=new ut,this.adaptor.init(t,this)}}dt.extension={type:[s.Ag.WebGLSystem],name:"renderTarget"};var pt=r(2015);class ft{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function mt(t,e,r){const s=t.createShader(e);return t.shaderSource(s,r),t.compileShader(s),s}function gt(t){const e=new Array(t);for(let t=0;t<e.length;t++)e[t]=!1;return e}function xt(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return gt(2*e);case"bvec3":return gt(3*e);case"bvec4":return gt(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let yt=null;const vt={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},_t={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function bt(t,e){if(!yt){const e=Object.keys(vt);yt={};for(let r=0;r<e.length;++r){const s=e[r];yt[t[s]]=vt[s]}}return yt[e]}function wt(t,e){const r=bt(t,e);return _t[r]||"float32"}function Tt(t,e){const r=t.getShaderSource(e).split("\n").map((t,e)=>`${e}: ${t}`),s=t.getShaderInfoLog(e),i=s.split("\n"),n={},a=i.map(t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(t=>!(!t||n[t]||(n[t]=!0,0))),o=[""];a.forEach(t=>{r[t-1]=`%c${r[t-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=r.join("\n");o[0]=l,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}const St={textureCount:0,blockIndex:0};class At{constructor(t){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_programDataHash")}contextChange(t){this._gl=t,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(t,e){if(this._setProgram(t.glProgram),e)return;St.textureCount=0,St.blockIndex=0;let r=this._shaderSyncFunctions[t.glProgram._key];r||(r=this._shaderSyncFunctions[t.glProgram._key]=this._generateShaderSync(t,this)),this._renderer.buffer.nextBindBase(!!t.glProgram.transformFeedbackVaryings),r(this._renderer,t,St)}updateUniformGroup(t){this._renderer.uniformGroup.updateUniformGroup(t,this._activeProgram,St)}bindUniformBlock(t,e,r=0){const s=this._renderer.buffer,i=this._getProgramData(this._activeProgram),n=t._bufferResource;n||this._renderer.ubo.updateUniformGroup(t);const a=t.buffer,o=s.updateBuffer(a),l=s.freeLocationForBufferBase(o);if(n){const{offset:e,size:r}=t;0===e&&r===a.data.byteLength?s.bindBufferBase(o,l):s.bindBufferRange(o,l,e)}else s.getLastBindBaseLocation(o)!==l&&s.bindBufferBase(o,l);const h=this._activeProgram._uniformBlockData[e].index;i.uniformBlockBindings[r]!==l&&(i.uniformBlockBindings[r]=l,this._renderer.gl.uniformBlockBinding(i.program,h,l))}_setProgram(t){if(this._activeProgram===t)return;this._activeProgram=t;const e=this._getProgramData(t);this._gl.useProgram(e.program)}_getProgramData(t){return this._programDataHash[t._key]||this._createProgramData(t)}_createProgramData(t){const e=t._key;return this._programDataHash[e]=function(t,e){const r=mt(t,t.VERTEX_SHADER,e.vertex),s=mt(t,t.FRAGMENT_SHADER,e.fragment),i=t.createProgram();t.attachShader(i,r),t.attachShader(i,s);const n=e.transformFeedbackVaryings;n&&("function"!=typeof t.transformFeedbackVaryings?(0,g.R)("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(i,n.names,"separate"===n.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||function(t,e,r,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Tt(t,r),t.getShaderParameter(s,t.COMPILE_STATUS)||Tt(t,s),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,i,r,s),e._attributeData=function(t,e,r=!1){const s={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=e.getActiveAttrib(t,r);if(i.name.startsWith("gl_"))continue;const n=wt(e,i.type);s[i.name]={location:0,format:n,stride:(0,k.m)(n).stride,offset:0,instance:!1,start:0}}const n=Object.keys(s);if(r){n.sort((t,e)=>t>e?1:-1);for(let r=0;r<n.length;r++)s[n[r]].location=r,e.bindAttribLocation(t,r,n[r]);e.linkProgram(t)}else for(let r=0;r<n.length;r++)s[n[r]].location=e.getAttribLocation(t,n[r]);return s}(i,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=function(t,e){const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<s;i++){const s=e.getActiveUniform(t,i),n=s.name.replace(/\[.*?\]$/,""),a=!!s.name.match(/\[.*?\]$/),o=bt(e,s.type);r[n]={name:n,index:i,type:o,size:s.size,isArray:a,value:xt(o,s.size)}}return r}(i,t),e._uniformBlockData=function(t,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(let i=0;i<s;i++){const s=e.getActiveUniformBlockName(t,i),n=e.getUniformBlockIndex(t,s),a=e.getActiveUniformBlockParameter(t,i,e.UNIFORM_BLOCK_DATA_SIZE);r[s]={name:s,index:n,size:a}}return r}(i,t),t.deleteShader(r),t.deleteShader(s);const a={};for(const r in e._uniformData){const s=e._uniformData[r];a[r]={location:t.getUniformLocation(i,r),value:xt(s.type,s.size)}}return new ft(i,a)}(this._gl,t),this._programDataHash[e]}destroy(){for(const t of Object.keys(this._programDataHash))this._programDataHash[t].destroy(),this._programDataHash[t]=null;this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null}_generateShaderSync(t,e){return function(t,e){const r=[],s=["\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n "];let i=!1,n=0;const a=e._getProgramData(t.glProgram);for(const o in t.groups){const l=t.groups[o];r.push(`\n resources = g[${o}].resources;\n `);for(const h in l.resources){const c=l.resources[h];if(c instanceof d.k)if(c.ubo){const e=t._uniformBindMap[o][Number(h)];r.push(`\n sS.bindUniformBlock(\n resources[${h}],\n '${e}',\n ${t.glProgram._uniformBlockData[e].index}\n );\n `)}else r.push(`\n ugS.updateUniformGroup(resources[${h}], p, sD);\n `);else if(c instanceof pt.d){const e=t._uniformBindMap[o][Number(h)];r.push(`\n sS.bindUniformBlock(\n resources[${h}],\n '${e}',\n ${t.glProgram._uniformBlockData[e].index}\n );\n `)}else if(c instanceof N.v){const l=t._uniformBindMap[o][h],c=a.uniformData[l];c&&(i||(i=!0,s.push("\n var tS = r.texture;\n ")),e._gl.uniform1i(c.location,n),r.push(`\n tS.bind(resources[${h}], ${n});\n `),n++)}}}const o=[...s,...r].join("\n");return new Function("r","s","sD",o)}(t,e)}resetState(){this._activeProgram=null}}At.extension={type:[s.Ag.WebGLSystem],name:"shader"};var Ct=r(2276);const Pt={f32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1f(location, v);\n }","vec2<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }","vec3<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }","vec4<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",i32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }","vec2<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }","vec3<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }","vec4<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",u32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }","vec2<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }","vec3<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }","vec4<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }","vec2<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }","vec3<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }","vec4<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},Et={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};class Mt{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,r){const s=this._renderer.shader._getProgramData(e);t.isStatic&&t._dirtyId===s.uniformDirtyGroups[t.uid]||(s.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(s.uniformData,t.uniforms,this._renderer,r))}_getUniformSyncFunction(t,e){return this._uniformGroupSyncHash[t._signature]?.[e._key]||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){const r=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),s=this._getSignature(t,e._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(t,e._uniformData)),r[e._key]=this._cache[s],r[e._key]}_generateUniformsSync(t,e){return function(t,e){const r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n "];for(const s in t.uniforms){if(!e[s]){t.uniforms[s]instanceof d.k?t.uniforms[s].ubo?r.push(`\n renderer.shader.bindUniformBlock(uv.${s}, "${s}");\n `):r.push(`\n renderer.shader.updateUniformGroup(uv.${s});\n `):t.uniforms[s]instanceof pt.d&&r.push(`\n renderer.shader.bindBufferResource(uv.${s}, "${s}");\n `);continue}const i=t.uniformStructures[s];let n=!1;for(let t=0;t<Ct.$.length;t++){const e=Ct.$[t];if(i.type===e.type&&e.test(i)){r.push(`name = "${s}";`,Ct.$[t].uniform),n=!0;break}}if(!n){const t=(1===i.size?Pt:Et)[i.type].replace("location",`ud["${s}"].location`);r.push(`\n cu = ud["${s}"];\n cv = cu.value;\n v = uv["${s}"];\n ${t};`)}}return new Function("ud","uv","renderer","syncData",r.join("\n"))}(t,e)}_getSignature(t,e,r){const s=t.uniforms,i=[`${r}-`];for(const t in s)i.push(t),e[t]&&i.push(e[t].type);return i.join("-")}destroy(){this._renderer=null,this._cache=null}}Mt.extension={type:[s.Ag.WebGLSystem],name:"uniformGroup"};const kt=class t{constructor(t){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=y.U.for2d(),t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){this._invertFrontFace=!t.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(t){this.gl=t,this.blendModesMap=function(t){const e={};if(e.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e.add=[t.ONE,t.ONE],e.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],t instanceof P.e.get().getWebGLRenderingContext()){const r=t.getExtension("EXT_blend_minmax");r&&(e.min=[t.ONE,t.ONE,t.ONE,t.ONE,r.MIN_EXT,r.MIN_EXT],e.max=[t.ONE,t.ONE,t.ONE,t.ONE,r.MAX_EXT,r.MAX_EXT])}else e.min=[t.ONE,t.ONE,t.ONE,t.ONE,t.MIN,t.MIN],e.max=[t.ONE,t.ONE,t.ONE,t.ONE,t.MAX,t.MAX];return e}(t),this.resetState()}set(t){if(t||(t=this.defaultState),this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t||(t=this.defaultState);for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(e){this._updateCheck(t._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(t._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this._cullFace=t,this.gl[t?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(t){this._frontFace=t,this._frontFaceDirty=!1;const e=this._invertFrontFace?!t:t;this._glFrontFace!==e&&(this._glFrontFace=e,this.gl.frontFace(this.gl[e?"CW":"CCW"]))}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};kt.extension={type:[s.Ag.WebGLSystem],name:"state"};let Rt=kt;class Bt{constructor(t){this.target=I.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=F.UNSIGNED_BYTE,this.internalFormat=B.RGBA,this.format=B.RGBA,this.samplerType=0}}const It={id:"buffer",upload(t,e,r){e.width===t.width||e.height===t.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,t.width,t.height,0,e.format,e.type,t.resource),e.width=t.width,e.height=t.height}},Ft={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},Ot={id:"compressed",upload(t,e,r){r.pixelStorei(r.UNPACK_ALIGNMENT,4);let s=t.pixelWidth,i=t.pixelHeight;const n=!!Ft[t.format];for(let a=0;a<t.resource.length;a++){const o=t.resource[a];n?r.compressedTexImage2D(r.TEXTURE_2D,a,e.internalFormat,s,i,0,o):r.texImage2D(r.TEXTURE_2D,a,e.internalFormat,s,i,0,e.format,e.type,o),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},Gt={id:"image",upload(t,e,r,s){const i=e.width,n=e.height,a=t.pixelWidth,o=t.pixelHeight,l=t.resourceWidth,h=t.resourceHeight;l<a||h<o?(i===a&&n===o||r.texImage2D(e.target,0,e.internalFormat,a,o,0,e.format,e.type,null),2===s?r.texSubImage2D(r.TEXTURE_2D,0,0,0,l,h,e.format,e.type,t.resource):r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource)):i===a&&n===o?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource):2===s?r.texImage2D(e.target,0,e.internalFormat,a,o,0,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,e.format,e.type,t.resource),e.width=a,e.height=o}},Dt={id:"video",upload(t,e,r,s){t.isValid?Gt.upload(t,e,r,s):r.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null)}},Ut={linear:9729,nearest:9728},Lt={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Nt={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},Xt={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function Vt(t,e,r,s,i,n,a,o){const l=n;if(!o||"repeat"!==t.addressModeU||"repeat"!==t.addressModeV||"repeat"!==t.addressModeW){const r=Nt[a?"clamp-to-edge":t.addressModeU],s=Nt[a?"clamp-to-edge":t.addressModeV],n=Nt[a?"clamp-to-edge":t.addressModeW];e[i](l,e.TEXTURE_WRAP_S,r),e[i](l,e.TEXTURE_WRAP_T,s),e.TEXTURE_WRAP_R&&e[i](l,e.TEXTURE_WRAP_R,n)}if(o&&"linear"===t.magFilter||e[i](l,e.TEXTURE_MAG_FILTER,Ut[t.magFilter]),r){if(!o||"linear"!==t.mipmapFilter){const r=Lt[t.minFilter][t.mipmapFilter];e[i](l,e.TEXTURE_MIN_FILTER,r)}}else e[i](l,e.TEXTURE_MIN_FILTER,Ut[t.minFilter]);if(s&&t.maxAnisotropy>1){const r=Math.min(t.maxAnisotropy,e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[i](l,s.TEXTURE_MAX_ANISOTROPY_EXT,r)}t.compare&&e[i](l,e.TEXTURE_COMPARE_FUNC,Xt[t.compare])}class Yt{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Gt,buffer:It,video:Dt,compressed:Ot},this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers")}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=function(t,e){let r={},s=t.RGBA;return t instanceof P.e.get().getWebGLRenderingContext()?e.srgb&&(r={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},s=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...r,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:s,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}(t,this._renderer.context.extensions),this._mapFormatToType=function(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}(t),this._mapFormatToFormat=function(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let t=0;t<16;t++)this.bind(m.g.EMPTY,t)}initSource(t){this.bind(t)}bind(t,e=0){const r=t.source;t?(this.bindSource(r,e),this._useSeparateSamplers&&this._bindSampler(r.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const r=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t||(t=m.g.EMPTY.source);const s=this.getGlSource(t);r.bindTexture(s.target,s.texture)}}_bindSampler(t,e=0){const r=this._gl;if(!t)return this._boundSamplers[e]=null,void r.bindSampler(e,null);const s=this._getGlSampler(t);this._boundSamplers[e]!==s&&(this._boundSamplers[e]=s,r.bindSampler(e,s))}unbind(t){const e=t.source,r=this._boundTextures,s=this._gl;for(let t=0;t<r.length;t++)if(r[t]===e){this._activateLocation(t);const i=this.getGlSource(e);s.bindTexture(i.target,null),r[t]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,r=new Bt(e.createTexture());if(r.type=this._mapFormatToType[t.format],r.internalFormat=this._mapFormatToInternalFormat[t.format],r.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const e=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(e))+1}return this._glTextures[t.uid]=r,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),r}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const r=this._gl,s=this.getGlSource(t);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,Vt(t.style,r,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",r.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,r=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,r.texture),this._boundTextures[this._activeTextureLocation]=t;const s="premultiply-alpha-on-upload"===t.alphaMode;this._premultiplyAlpha!==s&&(this._premultiplyAlpha=s,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s)),this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,r,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const r=this.getGlSource(t);this._gl.generateMipmap(r.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,r=this._gl.createSampler();return this._glSamplers[t._resourceId]=r,Vt(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",r,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:r,height:s}=this.getPixels(t),i=P.e.get().createCanvas();i.width=r,i.height=s;const n=i.getContext("2d");if(n){const t=n.createImageData(r,s);t.data.set(e),n.putImageData(t,0,0)}return i}getPixels(t){const e=t.source.resolution,r=t.frame,s=Math.max(Math.round(r.width*e),1),i=Math.max(Math.round(r.height*e),1),n=new Uint8Array(4*s*i),a=this._renderer,o=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(o),h=a.gl;return h.bindFramebuffer(h.FRAMEBUFFER,l.resolveTargetFramebuffer),h.readPixels(Math.round(r.x*e),Math.round(r.y*e),s,i,h.RGBA,h.UNSIGNED_BYTE,n),{pixels:new Uint8ClampedArray(n.buffer),width:s,height:i}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._glTextures=null,this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(m.g.EMPTY.source),this._boundSamplers=Object.create(null);const t=this._gl;this._premultiplyAlpha=!1,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}}Yt.extension={type:[s.Ag.WebGLSystem],name:"texture"};const zt=[...b.i,nt,z,M,q,C,Yt,dt,U,Mt,At,H,Rt,Q,W],Wt=[...b.f],Ht=[v,x,p],jt=[],qt=[],$t=[];s.XO.handleByNamedList(s.Ag.WebGLSystem,jt),s.XO.handleByNamedList(s.Ag.WebGLPipes,qt),s.XO.handleByNamedList(s.Ag.WebGLPipesAdaptor,$t),s.XO.add(...zt,...Wt,...Ht);class Kt extends _.k{constructor(){super({name:"webgl",type:w.W.WEBGL,systems:jt,renderPipes:qt,renderPipeAdaptors:$t})}}},7761:(t,e,r)=>{"use strict";r.d(e,{es:()=>n});var s=r(2454),i=r(1886);const n=new(window.AudioContext||window.webkitAudioContext);window.addEventListener("mousedown",()=>n.resume()),window.addEventListener("touchend",()=>n.resume());let a=!document.hidden;window.addEventListener("visibilitychange",()=>a=!document.hidden);const o=function(){const t=(()=>{const t=new Map;return{persistent:!1,getItem:e=>t.has(e)?t.get(e):null,setItem:(e,r)=>{t.set(e,String(r))},removeItem:e=>{t.delete(e)}}})();if("undefined"==typeof window)return t;try{const t=window.localStorage,e="__safe_ls_probe__"+Math.random().toString(36).slice(2);return t.setItem(e,"1"),t.removeItem(e),{persistent:!0,getItem:e=>t.getItem(e),setItem:(e,r)=>t.setItem(e,r),removeItem:e=>t.removeItem(e)}}catch{return t}}();class l{src;#K;#Q;#Z;#J;#tt;#et;#rt=!1;#st=!1;#it=0;#nt=0;#at=0;constructor(t,e,r){this.src=t,this.#K=e,this.#Q=r,this.play()}get volume(){return this.#K}set volume(t){this.#K=t,this.#tt&&(this.#tt.gain.value=Math.max(0,Math.min(1,t)))}async play(){s.F&&!a||(this.#Z||(i.K.checkCached(this.src)?this.#Z=i.K.getCached(this.src):(console.info(`Audio not preloaded. Loading now: ${this.src}`),this.#Z=await i.K.load(this.src))),this.#Z&&(this.#rt&&this.stop(),this.#st||(this.#at=0),this.#rt=!0,this.#st=!1,this.#J||(this.#J=await async function(){return"suspended"===n.state&&await n.resume(),n}()),this.#rt&&(this.#tt||(this.#tt=this.#J.createGain(),this.#tt.gain.value=this.#K,this.#tt.connect(this.#J.destination)),this.#et=this.#J.createBufferSource(),this.#et.buffer=this.#Z,this.#et.loop=this.#Q,this.#et.connect(this.#tt),this.#et.start(0,this.#at),this.#it=this.#J.currentTime,this.#et.onended=()=>{this.#st||this.#Q||this.stop()})))}#ot(){this.#et&&(this.#et.stop(),this.#et.disconnect(),this.#et=void 0)}pause(){this.#rt&&!this.#st&&(this.#J&&(this.#nt=this.#J.currentTime,this.#at+=this.#nt-this.#it),this.#st=!0,this.#rt=!1,this.#ot())}stop(){this.#rt=!1,this.#st=!1,this.#at=0,this.#ot()}}new class{#K=.7;#lt;constructor(){const t=parseFloat(o.getItem("musicVolume")||"");this.#K=Number.isNaN(t)?this.#K:t,s.F&&document.addEventListener("visibilitychange",()=>{document.hidden?this.pause():(a=!0,this.#lt?.play())})}get volume(){return this.#K}set volume(t){this.#K=t,o.setItem("musicVolume",t.toString()),this.#lt&&(this.#lt.volume=t)}play(t){this.#lt?.src!==t&&(this.#lt?.stop(),this.#lt=new l(t,this.#K,!0))}pause(){this.#lt?.pause()}stop(){this.#lt?.stop(),this.#lt=void 0}},new class{#K=1;constructor(){const t=parseFloat(o.getItem("sfxVolume")||"");this.#K=Number.isNaN(t)?this.#K:t}get volume(){return this.#K}set volume(t){this.#K=t,o.setItem("sfxVolume",t.toString())}play(t){new l(t,this.#K,!1)}playRandom(...t){this.play(t[Math.floor(Math.random()*t.length)])}}},7786:(t,e,r)=>{"use strict";r.d(e,{Q:()=>n});var s=r(1347),i=r(4382);class n extends i.o{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new s.Q1(1,1,1,1);path;region=null;sequence=null;offset=s.Aq.newFloatArray(8);uvs=s.Aq.newFloatArray(8);tempColor=new s.Q1(1,1,1,1);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);let r=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*r,a=-this.height/2*this.scaleY+this.region.offsetY*i,o=n+this.region.width*r,l=a+this.region.height*i,h=this.rotation*s.cj.degRad,c=Math.cos(h),u=Math.sin(h),d=this.x,p=this.y,f=n*c+d,m=n*u,g=a*c+p,x=a*u,y=o*c+d,v=o*u,_=l*c+p,b=l*u,w=this.offset;w[0]=f-x,w[1]=g+m,w[2]=f-b,w[3]=_+m,w[4]=y-b,w[5]=_+v,w[6]=y-x,w[7]=g+v,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,r,s){null!=this.sequence&&this.sequence.apply(t,this);let i=t.bone,n=this.offset,a=i.worldX,o=i.worldY,l=i.a,h=i.b,c=i.c,u=i.d,d=0,p=0;d=n[0],p=n[1],e[r]=d*l+p*h+a,e[r+1]=d*c+p*u+o,r+=s,d=n[2],p=n[3],e[r]=d*l+p*h+a,e[r+1]=d*c+p*u+o,r+=s,d=n[4],p=n[5],e[r]=d*l+p*h+a,e[r+1]=d*c+p*u+o,r+=s,d=n[6],p=n[7],e[r]=d*l+p*h+a,e[r+1]=d*c+p*u+o}copy(){let t=new n(this.name,this.path);return t.region=this.region,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,s.Aq.arrayCopy(this.uvs,0,t.uvs,0,8),s.Aq.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31}},7879:(t,e,r)=>{"use strict";var s=r(592);r(9317),r(275),s.U},7882:(t,e,r)=>{"use strict";r.d(e,{o:()=>o,u:()=>a});var s=r(5199),i=r(761),n=r(6170);const a=i.Z.getPool(s.u),o=i.Z.getPool(n.c)},7898:(t,e,r)=>{"use strict";r.d(e,{o:()=>s});class s{constructor(t,e,r){this._x=e||0,this._y=r||0,this._observer=t}clone(t){return new s(t??this._observer,this._x,this._y)}set(t=0,e=t){return this._x===t&&this._y===e||(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}},7903:(t,e,r)=>{"use strict";r.d(e,{D:()=>o});var s=r(9739),i=r(3880),n=r(3651),a=r(4242);class o extends a.k{constructor(...t){let e=t[0];Array.isArray(t[0])&&(e={textures:t[0],autoUpdate:t[1]});const{animationSpeed:r=1,autoPlay:i=!1,autoUpdate:n=!0,loop:a=!0,onComplete:o=null,onFrameChange:l=null,onLoop:h=null,textures:c,updateAnchor:u=!1,...d}=e,[p]=c;super({...d,texture:p instanceof s.g?p:p.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=!1,this.animationSpeed=r,this.loop=a,this.updateAnchor=u,this.onComplete=o,this.onFrameChange=l,this.onLoop=h,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,i&&this.play()}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(n.R.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(n.R.shared.add(this.update,this,i.d.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;const e=t.deltaTime,r=this.animationSpeed*e,s=this.currentFrame;if(null!==this._durations){let t=this._currentTime%1*this._durations[this.currentFrame];for(t+=r/60*1e3;t<0;)this._currentTime--,t+=this._durations[this.currentFrame];const s=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);t>=this._durations[this.currentFrame];)t-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=t/this._durations[this.currentFrame]}else this._currentTime+=r;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture())}_updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t=!1){if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._textures.forEach(t=>{this.texture!==t&&t.destroy(e)})}this._textures=[],this._durations=null,this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const e=[];for(let r=0;r<t.length;++r)e.push(s.g.from(t[r]));return new o(e)}static fromImages(t){const e=[];for(let r=0;r<t.length;++r)e.push(s.g.from(t[r]));return new o(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof s.g)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this._updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(n.R.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(n.R.shared.add(this.update,this),this._isConnectedToTicker=!0))}}},7926:(t,e,r)=>{"use strict";r.d(e,{P:()=>l});var s=r(6643),i=r(5423),n=r(2288);const a={willReadFrequently:!0},o=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0===e){const r=i.e.get().getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(t,e,r,s,i,n,a,o,l){this.text=t,this.style=e,this.width=r,this.height=s,this.lines=i,this.lineWidths=n,this.lineHeight=a,this.maxLineWidth=o,this.fontProperties=l}static measureText(e=" ",r,s=t._canvas,i=r.wordWrap){const a=`${e}-${r.styleKey}-wordWrap-${i}`;if(t._measurementCache.has(a))return t._measurementCache.get(a);const o=(0,n.Z)(r),l=t.measureFont(o);0===l.fontSize&&(l.fontSize=r.fontSize,l.ascent=r.fontSize);const h=t.__context;h.font=o;const c=(i?t._wordWrap(e,r,s):e).split(/(?:\r\n|\r|\n)/),u=new Array(c.length);let d=0;for(let e=0;e<c.length;e++){const s=t._measureText(c[e],r.letterSpacing,h);u[e]=s,d=Math.max(d,s)}const p=r._stroke?.width||0;let f=d+p;r.dropShadow&&(f+=r.dropShadow.distance);const m=r.lineHeight||l.fontSize;let g=Math.max(m,l.fontSize+p)+(c.length-1)*(m+r.leading);r.dropShadow&&(g+=r.dropShadow.distance);const x=new t(e,r,f,g,c,u,m+r.leading,d,l);return t._measurementCache.set(a,x),x}static _measureText(e,r,s){let i=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(s.letterSpacing=`${r}px`,s.textLetterSpacing=`${r}px`,i=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));const n=s.measureText(e);let a=n.width;const o=-n.actualBoundingBoxLeft;let l=n.actualBoundingBoxRight-o;if(a>0)if(i)a-=r,l-=r;else{const s=(t.graphemeSegmenter(e).length-1)*r;a+=s,l+=s}return Math.max(a,l)}static _wordWrap(e,r,s=t._canvas){const i=s.getContext("2d",a);let n=0,o="",l="";const h=Object.create(null),{letterSpacing:c,whiteSpace:u}=r,d=t._collapseSpaces(u),p=t._collapseNewlines(u);let f=!d;const m=r.wordWrapWidth+c,g=t._tokenize(e);for(let e=0;e<g.length;e++){let s=g[e];if(t._isNewline(s)){if(!p){l+=t._addLine(o),f=!d,o="",n=0;continue}s=" "}if(d){const e=t.isBreakingSpace(s),r=t.isBreakingSpace(o[o.length-1]);if(e&&r)continue}const a=t._getFromCache(s,c,h,i);if(a>m)if(""!==o&&(l+=t._addLine(o),o="",n=0),t.canBreakWords(s,r.breakWords)){const e=t.wordWrapSplit(s);for(let a=0;a<e.length;a++){let u=e[a],d=u,p=1;for(;e[a+p];){const i=e[a+p];if(t.canBreakChars(d,i,s,a,r.breakWords))break;u+=i,d=i,p++}a+=p-1;const g=t._getFromCache(u,c,h,i);g+n>m&&(l+=t._addLine(o),f=!1,o="",n=0),o+=u,n+=g}}else{o.length>0&&(l+=t._addLine(o),o="",n=0);const r=e===g.length-1;l+=t._addLine(s,!r),f=!1,o="",n=0}else a+n>m&&(f=!1,l+=t._addLine(o),o="",n=0),(o.length>0||!t.isBreakingSpace(s)||f)&&(o+=s,n+=a)}return l+=t._addLine(o,!1),l}static _addLine(e,r=!0){return e=t._trimRight(e),r?`${e}\n`:e}static _getFromCache(e,r,s,i){let n=s[e];return"number"!=typeof n&&(n=t._measureText(e,r,i)+r,s[e]=n),n}static _collapseSpaces(t){return"normal"===t||"pre-line"===t}static _collapseNewlines(t){return"normal"===t}static _trimRight(e){if("string"!=typeof e)return"";for(let r=e.length-1;r>=0;r--){const s=e[r];if(!t.isBreakingSpace(s))break;e=e.slice(0,-1)}return e}static _isNewline(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,r){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const r=[];let s="";if("string"!=typeof e)return r;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];t.isBreakingSpace(n,a)||t._isNewline(n)?(""!==s&&(r.push(s),s=""),"\r"===n&&"\n"===a?(r.push("\r\n"),i++):r.push(n)):s+=n}return""!==s&&r.push(s),r}static canBreakWords(t,e){return e}static canBreakChars(t,e,r,s,i){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const r=t._context;r.font=e;const s=r.measureText(t.METRICS_STRING+t.BASELINE_SYMBOL),i={ascent:s.actualBoundingBoxAscent,descent:s.actualBoundingBoxDescent,fontSize:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent};return t._fonts[e]=i,i}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const r=new OffscreenCanvas(0,0),s=r.getContext("2d",a);if(s?.measureText)return t.__canvas=r,r;e=i.e.get().createCanvas()}catch(t){e=i.e.get().createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",a)),t.__context}};o.METRICS_STRING="|ÉqÅ",o.BASELINE_SYMBOL="M",o.BASELINE_MULTIPLIER=1.4,o.HEIGHT_MULTIPLIER=2,o.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>{const r=t.segment(e),s=[];let i=0;for(const t of r)s[i++]=t.segment;return s}}return t=>[...t]})(),o.experimentalLetterSpacing=!1,o._fonts={},o._newlines=[10,13],o._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],o._measurementCache=(0,s.g)(1e3);let l=o},7935:(t,e,r)=>{"use strict";var s=r(2445),i=r(1065),n=r(4269),a=r(9739);const o=[];function l(t={}){const e=t&&t.resource,r=e?t.resource:t,s=e?t:{resource:t};for(let t=0;t<o.length;t++){const e=o[t];if(e.test(r))return new e(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}i.XO.handleByList(i.Ag.TextureSource,o),a.g.from=function(t,e=!1){return"string"==typeof t?s.l.get(t):t instanceof n.v?new a.g({source:t}):function(t={},e=!1){const r=t&&t.resource,i=r?t.resource:t,n=r?t:{resource:t};if(!e&&s.l.has(i))return s.l.get(i);const o=new a.g({source:l(n)});return o.on("destroy",()=>{s.l.has(i)&&s.l.remove(i)}),e||s.l.set(i,o),o}(t,e)},n.v.from=l},7955:(t,e,r)=>{"use strict";r.d(e,{i:()=>i});var s=r(2432);class i extends s.b{#ht=0;#ct=0;#M=1;get x(){return this.#ht}get y(){return this.#ct}get scale(){return this.#M}setPosition(t,e){this.#ht=t,this.#ct=e,this.emit("positionChanged")}setScale(t){this.#M=t,this.emit("scaleChanged")}}},7957:(t,e,r)=>{"use strict";r.d(e,{U:()=>i});var s=r(1347);class i{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new s.I9;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0;r<t.bones.length;r++){let s=e.findBone(t.bones[r].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[r].name}.`);this.bones.push(s)}let r=e.findBone(t.target.name);if(!r)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=r,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}update(t){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,r=this.mixY,i=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=0!=e||0!=r,l=this.target,h=l.a,c=l.b,u=l.c,d=l.d,p=h*d-c*u>0?s.cj.degRad:-s.cj.degRad,f=this.data.offsetRotation*p,m=this.data.offsetShearY*p,g=this.bones;for(let p=0,x=g.length;p<x;p++){let x=g[p];if(0!=t){let e=x.a,r=x.b,i=x.c,n=x.d,a=Math.atan2(u,h)-Math.atan2(i,e)+f;a>s.cj.PI?a-=s.cj.PI2:a<-s.cj.PI&&(a+=s.cj.PI2),a*=t;let o=Math.cos(a),l=Math.sin(a);x.a=o*e-l*i,x.b=o*r-l*n,x.c=l*e+o*i,x.d=l*r+o*n}if(o){let t=this.temp;l.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*r}if(0!=i){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*i)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(c*c+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(a>0){let t=x.b,e=x.d,r=Math.atan2(e,t),i=Math.atan2(d,c)-Math.atan2(u,h)-(r-Math.atan2(x.c,x.a));i>s.cj.PI?i-=s.cj.PI2:i<-s.cj.PI&&(i+=s.cj.PI2),i=r+(i+m)*a;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(i)*n,x.d=Math.sin(i)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,r=this.mixY,i=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=0!=e||0!=r,l=this.target,h=l.a,c=l.b,u=l.c,d=l.d,p=h*d-c*u>0?s.cj.degRad:-s.cj.degRad,f=this.data.offsetRotation*p,m=this.data.offsetShearY*p,g=this.bones;for(let p=0,x=g.length;p<x;p++){let x=g[p];if(0!=t){let e=x.a,r=x.b,i=x.c,n=x.d,a=Math.atan2(u,h)+f;a>s.cj.PI?a-=s.cj.PI2:a<-s.cj.PI&&(a+=s.cj.PI2),a*=t;let o=Math.cos(a),l=Math.sin(a);x.a=o*e-l*i,x.b=o*r-l*n,x.c=l*e+o*i,x.d=l*r+o*n}if(o){let t=this.temp;l.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*r}if(0!=i){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*i+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(c*c+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(a>0){let t=Math.atan2(d,c)-Math.atan2(u,h);t>s.cj.PI?t-=s.cj.PI2:t<-s.cj.PI&&(t+=s.cj.PI2);let e=x.b,r=x.d;t=Math.atan2(r,e)+(t-s.cj.PI/2+m)*a;let i=Math.sqrt(e*e+r*r);x.b=Math.cos(t)*i,x.d=Math.sin(t)*i}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,r=this.mixY,s=this.mixScaleX,i=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let l=0,h=o.length;l<h;l++){let h=o[l],c=h.arotation;0!=t&&(c+=(a.arotation-c+this.data.offsetRotation)*t);let u=h.ax,d=h.ay;u+=(a.ax-u+this.data.offsetX)*e,d+=(a.ay-d+this.data.offsetY)*r;let p=h.ascaleX,f=h.ascaleY;0!=s&&0!=p&&(p=(p+(a.ascaleX-p+this.data.offsetScaleX)*s)/p),0!=i&&0!=f&&(f=(f+(a.ascaleY-f+this.data.offsetScaleY)*i)/f);let m=h.ashearY;0!=n&&(m+=(a.ashearY-m+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,d,c,p,f,h.ashearX,m)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,r=this.mixY,s=this.mixScaleX,i=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let l=0,h=o.length;l<h;l++){let h=o[l],c=h.arotation+(a.arotation+this.data.offsetRotation)*t,u=h.ax+(a.ax+this.data.offsetX)*e,d=h.ay+(a.ay+this.data.offsetY)*r,p=h.ascaleX*((a.ascaleX-1+this.data.offsetScaleX)*s+1),f=h.ascaleY*((a.ascaleY-1+this.data.offsetScaleY)*i+1),m=h.ashearY+(a.ashearY+this.data.offsetShearY)*n;h.updateWorldTransformWith(u,d,c,p,f,h.ashearX,m)}}}},8016:(t,e,r)=>{"use strict";r(192).R},8034:(t,e,r)=>{"use strict";r.d(e,{AQ:()=>a.A,EA:()=>a.E,I9:()=>g.I9,K$:()=>x.K,Lw:()=>m.Lw,MR:()=>d.M,Nx:()=>p.N,O$:()=>f.O$,Q1:()=>g.Q1,Qb:()=>v.Q,Qq:()=>i.Q,VT:()=>l.V,Ym:()=>c.Y,bC:()=>g.bC,fj:()=>y.f,gP:()=>f.gP,mI:()=>u.m,oA:()=>s.oA,qd:()=>n.q,qy:()=>h.q,t7:()=>o.t,w3:()=>f.w3}),r(1984);var s=r(4419),i=r(3643),n=r(6147),a=(r(2866),r(946),r(1274),r(528),r(2155),r(6184),r(3648),r(9107)),o=r(8058),l=r(8894),h=r(9133),c=r(6571),u=r(6297),d=r(5229),p=(r(6068),r(9212)),f=r(2101),m=r(5242),g=(r(7957),r(7285),r(2414),r(1347)),x=(r(2806),r(4382),r(5331),r(6552)),y=r(7399),v=(r(6861),r(9064),r(7786))},8058:(t,e,r)=>{"use strict";r.d(e,{t:()=>x});var s,i=r(1984),n=r(646),a=r(946),o=r(3450),l=r(826),h=r(2155),c=r(3648),u=r(5556),d=r(6571),p=r(5229),f=r(9212),m=r(7285),g=r(1347);class x{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,r=new d.Y;r.name="";let s=new y(t),i=s.readInt32(),n=s.readInt32();r.hash=0==n&&0==i?null:n.toString(16)+i.toString(16),r.version=s.readString(),r.x=s.readFloat(),r.y=s.readFloat(),r.width=s.readFloat(),r.height=s.readFloat(),r.referenceScale=s.readFloat()*e;let o=s.readBoolean();o&&(r.fps=s.readFloat(),r.imagesPath=s.readString(),r.audioPath=s.readString());let p=0;p=s.readInt(!0);for(let t=0;t<p;t++){let t=s.readString();if(!t)throw new Error("String in string table must not be null.");s.strings.push(t)}p=s.readInt(!0);for(let t=0;t<p;t++){let i=s.readString();if(!i)throw new Error("Bone name must not be null.");let n=0==t?null:r.bones[s.readInt(!0)],l=new a.h(t,i,n);l.rotation=s.readFloat(),l.x=s.readFloat()*e,l.y=s.readFloat()*e,l.scaleX=s.readFloat(),l.scaleY=s.readFloat(),l.shearX=s.readFloat(),l.shearY=s.readFloat(),l.length=s.readFloat()*e,l.inherit=s.readByte(),l.skinRequired=s.readBoolean(),o&&(g.Q1.rgba8888ToColor(l.color,s.readInt32()),l.icon=s.readString()??void 0,l.visible=s.readBoolean()),r.bones.push(l)}p=s.readInt(!0);for(let t=0;t<p;t++){let e=s.readString();if(!e)throw new Error("Slot name must not be null.");let i=r.bones[s.readInt(!0)],n=new f.P(t,e,i);g.Q1.rgba8888ToColor(n.color,s.readInt32());let a=s.readInt32();-1!=a&&g.Q1.rgb888ToColor(n.darkColor=new g.Q1,a),n.attachmentName=s.readStringRef(),n.blendMode=s.readInt(!0),o&&(n.visible=s.readBoolean()),r.slots.push(n)}p=s.readInt(!0);for(let t,i=0;i<p;i++){let i=s.readString();if(!i)throw new Error("IK constraint data name must not be null.");let n=new h.Q(i);n.order=s.readInt(!0),t=s.readInt(!0);for(let e=0;e<t;e++)n.bones.push(r.bones[s.readInt(!0)]);n.target=r.bones[s.readInt(!0)];let a=s.readByte();n.skinRequired=!!(1&a),n.bendDirection=2&a?1:-1,n.compress=!!(4&a),n.stretch=!!(8&a),n.uniform=!!(16&a),32&a&&(n.mix=64&a?s.readFloat():1),128&a&&(n.softness=s.readFloat()*e),r.ikConstraints.push(n)}p=s.readInt(!0);for(let t,i=0;i<p;i++){let i=s.readString();if(!i)throw new Error("Transform constraint data name must not be null.");let n=new m._(i);n.order=s.readInt(!0),t=s.readInt(!0);for(let e=0;e<t;e++)n.bones.push(r.bones[s.readInt(!0)]);n.target=r.bones[s.readInt(!0)];let a=s.readByte();n.skinRequired=!!(1&a),n.local=!!(2&a),n.relative=!!(4&a),8&a&&(n.offsetRotation=s.readFloat()),16&a&&(n.offsetX=s.readFloat()*e),32&a&&(n.offsetY=s.readFloat()*e),64&a&&(n.offsetScaleX=s.readFloat()),128&a&&(n.offsetScaleY=s.readFloat()),a=s.readByte(),1&a&&(n.offsetShearY=s.readFloat()),2&a&&(n.mixRotate=s.readFloat()),4&a&&(n.mixX=s.readFloat()),8&a&&(n.mixY=s.readFloat()),16&a&&(n.mixScaleX=s.readFloat()),32&a&&(n.mixScaleY=s.readFloat()),64&a&&(n.mixShearY=s.readFloat()),r.transformConstraints.push(n)}p=s.readInt(!0);for(let t,i=0;i<p;i++){let i=s.readString();if(!i)throw new Error("Path constraint data name must not be null.");let n=new c.rX(i);n.order=s.readInt(!0),n.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)n.bones.push(r.bones[s.readInt(!0)]);n.target=r.slots[s.readInt(!0)];const a=s.readByte();n.positionMode=1&a,n.spacingMode=a>>1&3,n.rotateMode=a>>3&3,128&a&&(n.offsetRotation=s.readFloat()),n.position=s.readFloat(),n.positionMode==c.pw.Fixed&&(n.position*=e),n.spacing=s.readFloat(),n.spacingMode!=c.r9.Length&&n.spacingMode!=c.r9.Fixed||(n.spacing*=e),n.mixRotate=s.readFloat(),n.mixX=s.readFloat(),n.mixY=s.readFloat(),r.pathConstraints.push(n)}p=s.readInt(!0);for(let t=0;t<p;t++){const t=s.readString();if(!t)throw new Error("Physics constraint data name must not be null.");const i=new u.P(t);i.order=s.readInt(!0),i.bone=r.bones[s.readInt(!0)];let n=s.readByte();i.skinRequired=!!(1&n),2&n&&(i.x=s.readFloat()),4&n&&(i.y=s.readFloat()),8&n&&(i.rotate=s.readFloat()),16&n&&(i.scaleX=s.readFloat()),32&n&&(i.shearX=s.readFloat()),i.limit=(64&n?s.readFloat():5e3)*e,i.step=1/s.readUnsignedByte(),i.inertia=s.readFloat(),i.strength=s.readFloat(),i.damping=s.readFloat(),i.massInverse=128&n?s.readFloat():1,i.wind=s.readFloat(),i.gravity=s.readFloat(),n=s.readByte(),1&n&&(i.inertiaGlobal=!0),2&n&&(i.strengthGlobal=!0),4&n&&(i.dampingGlobal=!0),8&n&&(i.massGlobal=!0),16&n&&(i.windGlobal=!0),32&n&&(i.gravityGlobal=!0),64&n&&(i.mixGlobal=!0),i.mix=128&n?s.readFloat():1,r.physicsConstraints.push(i)}let x=this.readSkin(s,r,!0,o);x&&(r.defaultSkin=x,r.skins.push(x));{let t=r.skins.length;for(g.Aq.setArraySize(r.skins,p=t+s.readInt(!0));t<p;t++){let e=this.readSkin(s,r,!1,o);if(!e)throw new Error("readSkin() should not have returned null.");r.skins[t]=e}}p=this.linkedMeshes.length;for(let t=0;t<p;t++){let e=this.linkedMeshes[t];const s=r.skins[e.skinIndex];if(!e.parent)throw new Error("Linked mesh parent must not be null");let i=s.getAttachment(e.slotIndex,e.parent);if(!i)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?i:e.mesh,e.mesh.setParentMesh(i),null!=e.mesh.region&&e.mesh.updateRegion()}this.linkedMeshes.length=0,p=s.readInt(!0);for(let t=0;t<p;t++){let t=s.readString();if(!t)throw new Error("Event data name must not be null");let e=new l.R(t);e.intValue=s.readInt(!1),e.floatValue=s.readFloat(),e.stringValue=s.readString(),e.audioPath=s.readString(),e.audioPath&&(e.volume=s.readFloat(),e.balance=s.readFloat()),r.events.push(e)}p=s.readInt(!0);for(let t=0;t<p;t++){let t=s.readString();if(!t)throw new Error("Animatio name must not be null.");r.animations.push(this.readAnimation(s,t,r))}return r}readSkin(t,e,r,s){let i=null,n=0;if(r){if(n=t.readInt(!0),0==n)return null;i=new p.M("default")}else{let r=t.readString();if(!r)throw new Error("Skin name must not be null.");i=new p.M(r),s&&g.Q1.rgba8888ToColor(i.color,t.readInt32()),i.bones.length=t.readInt(!0);for(let r=0,s=i.bones.length;r<s;r++)i.bones[r]=e.bones[t.readInt(!0)];for(let r=0,s=t.readInt(!0);r<s;r++)i.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let r=0,s=t.readInt(!0);r<s;r++)i.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let r=0,s=t.readInt(!0);r<s;r++)i.constraints.push(e.pathConstraints[t.readInt(!0)]);for(let r=0,s=t.readInt(!0);r<s;r++)i.constraints.push(e.physicsConstraints[t.readInt(!0)]);n=t.readInt(!0)}for(let r=0;r<n;r++){let r=t.readInt(!0);for(let n=0,a=t.readInt(!0);n<a;n++){let n=t.readStringRef();if(!n)throw new Error("Attachment name must not be null");let a=this.readAttachment(t,e,i,r,n,s);a&&i.setAttachment(r,n,a)}}return i}readAttachment(t,e,r,i,n,a){let o=this.scale,l=t.readByte();const h=8&l?t.readStringRef():n;if(!h)throw new Error("Attachment name must not be null");switch(7&l){case s.Region:{let e=16&l?t.readStringRef():null;const s=32&l?t.readInt32():4294967295,i=64&l?this.readSequence(t):null;let n=128&l?t.readFloat():0,a=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),p=t.readFloat(),f=t.readFloat();e||(e=h);let m=this.attachmentLoader.newRegionAttachment(r,h,e,i);return m?(m.path=e,m.x=a*o,m.y=c*o,m.scaleX=u,m.scaleY=d,m.rotation=n,m.width=p*o,m.height=f*o,g.Q1.rgba8888ToColor(m.color,s),m.sequence=i,null==i&&m.updateRegion(),m):null}case s.BoundingBox:{let e=this.readVertices(t,!!(16&l)),s=a?t.readInt32():0,i=this.attachmentLoader.newBoundingBoxAttachment(r,h);return i?(i.worldVerticesLength=e.length,i.vertices=e.vertices,i.bones=e.bones,a&&g.Q1.rgba8888ToColor(i.color,s),i):null}case s.Mesh:{let e=16&l?t.readStringRef():h;const s=32&l?t.readInt32():4294967295,i=64&l?this.readSequence(t):null,n=t.readInt(!0),c=this.readVertices(t,!!(128&l)),u=this.readFloatArray(t,c.length,1),d=this.readShortArray(t,3*(c.length-n-2));let p=[],f=0,m=0;a&&(p=this.readShortArray(t,t.readInt(!0)),f=t.readFloat(),m=t.readFloat()),e||(e=h);let x=this.attachmentLoader.newMeshAttachment(r,h,e,i);return x?(x.path=e,g.Q1.rgba8888ToColor(x.color,s),x.bones=c.bones,x.vertices=c.vertices,x.worldVerticesLength=c.length,x.triangles=d,x.regionUVs=u,null==i&&x.updateRegion(),x.hullLength=n<<1,x.sequence=i,a&&(x.edges=p,x.width=f*o,x.height=m*o),x):null}case s.LinkedMesh:{const e=16&l?t.readStringRef():h;if(null==e)throw new Error("Path of linked mesh must not be null");const s=32&l?t.readInt32():4294967295,n=64&l?this.readSequence(t):null,c=!!(128&l),u=t.readInt(!0),d=t.readStringRef();let p=0,f=0;a&&(p=t.readFloat(),f=t.readFloat());let m=this.attachmentLoader.newMeshAttachment(r,h,e,n);return m?(m.path=e,g.Q1.rgba8888ToColor(m.color,s),m.sequence=n,a&&(m.width=p*o,m.height=f*o),this.linkedMeshes.push(new v(m,u,i,d,c)),m):null}case s.Path:{const e=!!(16&l),s=!!(32&l),i=this.readVertices(t,!!(64&l)),n=g.Aq.newArray(i.length/6,0);for(let e=0,r=n.length;e<r;e++)n[e]=t.readFloat()*o;const c=a?t.readInt32():0,u=this.attachmentLoader.newPathAttachment(r,h);return u?(u.closed=e,u.constantSpeed=s,u.worldVerticesLength=i.length,u.vertices=i.vertices,u.bones=i.bones,u.lengths=n,a&&g.Q1.rgba8888ToColor(u.color,c),u):null}case s.Point:{const e=t.readFloat(),s=t.readFloat(),i=t.readFloat(),n=a?t.readInt32():0,l=this.attachmentLoader.newPointAttachment(r,h);return l?(l.x=s*o,l.y=i*o,l.rotation=e,a&&g.Q1.rgba8888ToColor(l.color,n),l):null}case s.Clipping:{const s=t.readInt(!0),i=this.readVertices(t,!!(16&l));let n=a?t.readInt32():0,o=this.attachmentLoader.newClippingAttachment(r,h);return o?(o.endSlot=e.slots[s],o.worldVerticesLength=i.length,o.vertices=i.vertices,o.bones=i.bones,a&&g.Q1.rgba8888ToColor(o.color,n),o):null}}return null}readSequence(t){let e=new n.gd(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){const r=this.scale,s=t.readInt(!0),i=new _;if(i.length=s<<1,!e)return i.vertices=this.readFloatArray(t,i.length,r),i;let n=new Array,a=new Array;for(let e=0;e<s;e++){let e=t.readInt(!0);a.push(e);for(let s=0;s<e;s++)a.push(t.readInt(!0)),n.push(t.readFloat()*r),n.push(t.readFloat()*r),n.push(t.readFloat())}return i.vertices=g.Aq.toFloatArray(n),i.bones=a,i}readFloatArray(t,e,r){let s=new Array(e);if(1==r)for(let r=0;r<e;r++)s[r]=t.readFloat();else for(let i=0;i<e;i++)s[i]=t.readFloat()*r;return s}readShortArray(t,e){let r=new Array(e);for(let s=0;s<e;s++)r[s]=t.readInt(!0);return r}readAnimation(t,e,r){t.readInt(!0);let s=new Array,a=this.scale;for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0);for(let r=0,n=t.readInt(!0);r<n;r++){let r=t.readByte(),n=t.readInt(!0),a=n-1;switch(r){case O:{let r=new i.zK(n,e);for(let e=0;e<n;e++)r.setFrame(e,t.readFloat(),t.readStringRef());s.push(r);break}case G:{let r=t.readInt(!0),o=new i.EP(n,r,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255;for(let e=0,r=0;o.setFrame(e,l,h,c,u,d),e!=a;e++){let s=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,r++,e,0,l,s,h,i,1),T(t,o,r++,e,1,l,s,c,n,1),T(t,o,r++,e,2,l,s,u,a,1),T(t,o,r++,e,3,l,s,d,p,1)}l=s,h=i,c=n,u=a,d=p}s.push(o);break}case D:{let r=t.readInt(!0),o=new i.Di(n,r,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;for(let e=0,r=0;o.setFrame(e,l,h,c,u),e!=a;e++){let s=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,r++,e,0,l,s,h,i,1),T(t,o,r++,e,1,l,s,c,n,1),T(t,o,r++,e,2,l,s,u,a,1)}l=s,h=i,c=n,u=a}s.push(o);break}case U:{let r=t.readInt(!0),o=new i.Ev(n,r,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255;for(let e=0,r=0;o.setFrame(e,l,h,c,u,d,p,f,m),e!=a;e++){let s=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255,y=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,r++,e,0,l,s,h,i,1),T(t,o,r++,e,1,l,s,c,n,1),T(t,o,r++,e,2,l,s,u,a,1),T(t,o,r++,e,3,l,s,d,g,1),T(t,o,r++,e,4,l,s,p,x,1),T(t,o,r++,e,5,l,s,f,y,1),T(t,o,r++,e,6,l,s,m,v,1)}l=s,h=i,c=n,u=a,d=g,p=x,f=y,m=v}s.push(o);break}case L:{let r=t.readInt(!0),o=new i.fT(n,r,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;for(let e=0,r=0;o.setFrame(e,l,h,c,u,d,p,f),e!=a;e++){let s=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,r++,e,0,l,s,h,i,1),T(t,o,r++,e,1,l,s,c,n,1),T(t,o,r++,e,2,l,s,u,a,1),T(t,o,r++,e,3,l,s,d,m,1),T(t,o,r++,e,4,l,s,p,g,1),T(t,o,r++,e,5,l,s,f,x,1)}l=s,h=i,c=n,u=a,d=m,p=g,f=x}s.push(o);break}case N:{let r=new i._Y(n,t.readInt(!0),e),o=t.readFloat(),l=t.readUnsignedByte()/255;for(let e=0,s=0;r.setFrame(e,o,l),e!=a;e++){let i=t.readFloat(),n=t.readUnsignedByte()/255;switch(t.readByte()){case tt:r.setStepped(e);break;case et:T(t,r,s++,e,0,o,i,l,n,1)}o=i,l=n}s.push(r)}}}}for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0);for(let r=0,n=t.readInt(!0);r<n;r++){let r=t.readByte(),n=t.readInt(!0);if(r==F){let r=new i.hd(n,e);for(let e=0;e<n;e++)r.setFrame(e,t.readFloat(),t.readByte());s.push(r);continue}let o=t.readInt(!0);switch(r){case S:s.push(b(t,new i.NQ(n,o,e),1));break;case A:s.push(w(t,new i.Sr(n,o,e),a));break;case C:s.push(b(t,new i.GU(n,o,e),a));break;case P:s.push(b(t,new i.nS(n,o,e),a));break;case E:s.push(w(t,new i.i9(n,o,e),1));break;case M:s.push(b(t,new i.So(n,o,e),1));break;case k:s.push(b(t,new i.pR(n,o,e),1));break;case R:s.push(w(t,new i.$l(n,o,e),1));break;case B:s.push(b(t,new i.jx(n,o,e),1));break;case I:s.push(b(t,new i.eP(n,o,e),1))}}}for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0),r=t.readInt(!0),n=r-1,o=new i.pA(r,t.readInt(!0),e),l=t.readByte(),h=t.readFloat(),c=1&l?2&l?t.readFloat():1:0,u=4&l?t.readFloat()*a:0;for(let e=0,r=0;o.setFrame(e,h,c,u,8&l?1:-1,!!(16&l),!!(32&l)),e!=n;e++){l=t.readByte();const s=t.readFloat(),i=1&l?2&l?t.readFloat():1:0,n=4&l?t.readFloat()*a:0;64&l?o.setStepped(e):128&l&&(T(t,o,r++,e,0,h,s,c,i,1),T(t,o,r++,e,1,h,s,u,n,a)),h=s,c=i,u=n}s.push(o)}for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0),r=t.readInt(!0),n=r-1,a=new i.To(r,t.readInt(!0),e),o=t.readFloat(),l=t.readFloat(),h=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),p=t.readFloat();for(let e=0,r=0;a.setFrame(e,o,l,h,c,u,d,p),e!=n;e++){let s=t.readFloat(),i=t.readFloat(),n=t.readFloat(),f=t.readFloat(),m=t.readFloat(),g=t.readFloat(),x=t.readFloat();switch(t.readByte()){case tt:a.setStepped(e);break;case et:T(t,a,r++,e,0,o,s,l,i,1),T(t,a,r++,e,1,o,s,h,n,1),T(t,a,r++,e,2,o,s,c,f,1),T(t,a,r++,e,3,o,s,u,m,1),T(t,a,r++,e,4,o,s,d,g,1),T(t,a,r++,e,5,o,s,p,x,1)}o=s,l=i,h=n,c=f,u=m,d=g,p=x}s.push(a)}for(let e=0,n=t.readInt(!0);e<n;e++){let e=t.readInt(!0),n=r.pathConstraints[e];for(let r=0,o=t.readInt(!0);r<o;r++){const r=t.readByte(),o=t.readInt(!0),l=t.readInt(!0);switch(r){case Y:s.push(b(t,new i.vz(o,l,e),n.positionMode==c.pw.Fixed?a:1));break;case z:s.push(b(t,new i.vl(o,l,e),n.spacingMode==c.r9.Length||n.spacingMode==c.r9.Fixed?a:1));break;case W:let r=new i.I6(o,l,e),h=t.readFloat(),u=t.readFloat(),d=t.readFloat(),p=t.readFloat();for(let e=0,s=0,i=r.getFrameCount()-1;r.setFrame(e,h,u,d,p),e!=i;e++){let i=t.readFloat(),n=t.readFloat(),a=t.readFloat(),o=t.readFloat();switch(t.readByte()){case tt:r.setStepped(e);break;case et:T(t,r,s++,e,0,h,i,u,n,1),T(t,r,s++,e,1,h,i,d,a,1),T(t,r,s++,e,2,h,i,p,o,1)}h=i,u=n,d=a,p=o}s.push(r)}}}for(let e=0,r=t.readInt(!0);e<r;e++){const e=t.readInt(!0)-1;for(let r=0,n=t.readInt(!0);r<n;r++){const r=t.readByte(),n=t.readInt(!0);if(r==J){const r=new i.lJ(n,e);for(let e=0;e<n;e++)r.setFrame(e,t.readFloat());s.push(r);continue}const a=t.readInt(!0);switch(r){case H:s.push(b(t,new i.oc(n,a,e),1));break;case j:s.push(b(t,new i.$4(n,a,e),1));break;case q:s.push(b(t,new i.yz(n,a,e),1));break;case $:s.push(b(t,new i.Ms(n,a,e),1));break;case K:s.push(b(t,new i.UJ(n,a,e),1));break;case Q:s.push(b(t,new i.g(n,a,e),1));break;case Z:s.push(b(t,new i.yJ(n,a,e),1))}}}for(let e=0,o=t.readInt(!0);e<o;e++){let e=r.skins[t.readInt(!0)];for(let r=0,o=t.readInt(!0);r<o;r++){let r=t.readInt(!0);for(let o=0,l=t.readInt(!0);o<l;o++){let o=t.readStringRef();if(!o)throw new Error("attachmentName must not be null.");let l=e.getAttachment(r,o),h=t.readByte(),c=t.readInt(!0),u=c-1;switch(h){case X:{let e=l,n=e.bones,o=e.vertices,h=n?o.length/3*2:o.length,d=t.readInt(!0),p=new i.jQ(c,d,r,e),f=t.readFloat();for(let e=0,r=0;;e++){let s,i=t.readInt(!0);if(0==i)s=n?g.Aq.newFloatArray(h):o;else{s=g.Aq.newFloatArray(h);let e=t.readInt(!0);if(i+=e,1==a)for(let r=e;r<i;r++)s[r]=t.readFloat();else for(let r=e;r<i;r++)s[r]=t.readFloat()*a;if(!n)for(let t=0,e=s.length;t<e;t++)s[t]+=o[t]}if(p.setFrame(e,f,s),e==u)break;let l=t.readFloat();switch(t.readByte()){case tt:p.setStepped(e);break;case et:T(t,p,r++,e,0,f,l,0,1,1)}f=l}s.push(p);break}case V:{let e=new i.lP(c,r,l);for(let r=0;r<c;r++){let s=t.readFloat(),i=t.readInt32();e.setFrame(r,s,n.l8[15&i],i>>4,t.readFloat())}s.push(e);break}}}}}let l=t.readInt(!0);if(l>0){let e=new i.Kn(l),n=r.slots.length;for(let r=0;r<l;r++){let s=t.readFloat(),i=t.readInt(!0),a=g.Aq.newArray(n,0);for(let t=n-1;t>=0;t--)a[t]=-1;let o=g.Aq.newArray(n-i,0),l=0,h=0;for(let e=0;e<i;e++){let e=t.readInt(!0);for(;l!=e;)o[h++]=l++;a[l+t.readInt(!0)]=l++}for(;l<n;)o[h++]=l++;for(let t=n-1;t>=0;t--)-1==a[t]&&(a[t]=o[--h]);e.setFrame(r,s,a)}s.push(e)}let h=t.readInt(!0);if(h>0){let e=new i.qs(h);for(let s=0;s<h;s++){let i=t.readFloat(),n=r.events[t.readInt(!0)],a=new o.J(i,n);a.intValue=t.readInt(!1),a.floatValue=t.readFloat(),a.stringValue=t.readString(),null==a.stringValue&&(a.stringValue=n.stringValue),a.data.audioPath&&(a.volume=t.readFloat(),a.balance=t.readFloat()),e.setFrame(s,a)}s.push(e)}let u=0;for(let t=0,e=s.length;t<e;t++)u=Math.max(u,s[t].getDuration());return new i.X5(e,s,u)}}class y{strings;index;buffer;constructor(t,e=new Array,r=0,s=new DataView(t instanceof ArrayBuffer?t:t.buffer)){this.strings=e,this.index=r,this.buffer=s}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),r=127&e;return 128&e&&(e=this.readByte(),r|=(127&e)<<7,128&e&&(e=this.readByte(),r|=(127&e)<<14,128&e&&(e=this.readByte(),r|=(127&e)<<21,128&e&&(e=this.readByte(),r|=(127&e)<<28)))),t?r:r>>>1^-(1&r)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let r=0;r<t;){let t=this.readUnsignedByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),r+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),r+=3;break;default:e+=String.fromCharCode(t),r++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}}class v{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(t,e,r,s,i){this.mesh=t,this.skinIndex=e,this.slotIndex=r,this.parent=s,this.inheritTimeline=i}}class _{bones;vertices;length;constructor(t=null,e=null,r=0){this.bones=t,this.vertices=e,this.length=r}}function b(t,e,r){let s=t.readFloat(),i=t.readFloat()*r;for(let n=0,a=0,o=e.getFrameCount()-1;e.setFrame(n,s,i),n!=o;n++){let o=t.readFloat(),l=t.readFloat()*r;switch(t.readByte()){case tt:e.setStepped(n);break;case et:T(t,e,a++,n,0,s,o,i,l,r)}s=o,i=l}return e}function w(t,e,r){let s=t.readFloat(),i=t.readFloat()*r,n=t.readFloat()*r;for(let a=0,o=0,l=e.getFrameCount()-1;e.setFrame(a,s,i,n),a!=l;a++){let l=t.readFloat(),h=t.readFloat()*r,c=t.readFloat()*r;switch(t.readByte()){case tt:e.setStepped(a);break;case et:T(t,e,o++,a,0,s,l,i,h,r),T(t,e,o++,a,1,s,l,n,c,r)}s=l,i=h,n=c}return e}function T(t,e,r,s,i,n,a,o,l,h){e.setBezier(r,s,i,n,o,t.readFloat(),t.readFloat()*h,t.readFloat(),t.readFloat()*h,a,l)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(s||(s={}));const S=0,A=1,C=2,P=3,E=4,M=5,k=6,R=7,B=8,I=9,F=10,O=0,G=1,D=2,U=3,L=4,N=5,X=0,V=1,Y=0,z=1,W=2,H=0,j=1,q=2,$=4,K=5,Q=6,Z=7,J=8,tt=1,et=2},8064:(t,e,r)=>{"use strict";r.d(e,{z:()=>s});const s=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(t=>"string"==typeof t||r?e(t):t):t)},8099:(t,e,r)=>{"use strict";var s=r(1886),i=r(2619);r(9317).l,s.K,i.n},8122:(t,e,r)=>{"use strict";var s=r(1065);class i{constructor(t){this._renderer=t}push(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:e,filterEffect:t})}pop(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(t){"pushFilter"===t.action?this._renderer.filter.push(t):"popFilter"===t.action&&this._renderer.filter.pop()}destroy(){this._renderer=null}}i.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"filter"};var n=r(5199),a=r(3655),o=r(8337),l=r(4449),h=r(9739),c=r(8851),u=r(5153),d=r(6170);const p=new n.u;var f=r(7694);const m=new o.V({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class g{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new d.c,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0}}}class x{constructor(t){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new l.k({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new a.T({}),this.renderer=t}get activeBackTexture(){return this._activeFilterData?.backTexture}push(t){const e=this.renderer,r=t.filterEffect.filters,s=this._pushFilterData();s.skip=!1,s.filters=r,s.container=t.container,s.outputRenderSurface=e.renderTarget.renderSurface;const i=e.renderTarget.renderTarget.colorTexture.source,n=i.resolution,a=i.antialias;if(0===r.length)return void(s.skip=!0);const o=s.bounds;if(this._calculateFilterArea(t,o),this._calculateFilterBounds(s,e.renderTarget.rootViewPort,a,n,1),s.skip)return;const l=this._getPreviousFilterData(),h=this._findFilterResolution(n);let c=0,u=0;l&&(c=l.bounds.minX,u=l.bounds.minY),this._calculateGlobalFrame(s,c,u,h,i.width,i.height),this._setupFilterTextures(s,o,e,l)}generateFilteredTexture({texture:t,filters:e}){const r=this._pushFilterData();this._activeFilterData=r,r.skip=!1,r.filters=e;const s=t.source,i=s.resolution,n=s.antialias;if(0===e.length)return r.skip=!0,t;const a=r.bounds;if(a.addRect(t.frame),this._calculateFilterBounds(r,a.rectangle,n,i,0),r.skip)return t;const o=i;this._calculateGlobalFrame(r,0,0,o,s.width,s.height),r.outputRenderSurface=c.W.getOptimalTexture(a.width,a.height,r.resolution,r.antialias),r.backTexture=h.g.EMPTY,r.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(r,!0);const l=r.outputRenderSurface;return l.source.alphaMode="premultiplied-alpha",l}pop(){const t=this.renderer,e=this._popFilterData();e.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=e,this._applyFiltersToTexture(e,!1),e.blendRequired&&c.W.returnTexture(e.backTexture),c.W.returnTexture(e.inputTexture))}getBackTexture(t,e,r){const s=t.colorTexture.source._resolution,i=c.W.getOptimalTexture(e.width,e.height,s,!1);let n=e.minX,a=e.minY;r&&(n-=r.minX,a-=r.minY),n=Math.floor(n*s),a=Math.floor(a*s);const o=Math.ceil(e.width*s),l=Math.ceil(e.height*s);return this.renderer.renderTarget.copyToTexture(t,i,{x:n,y:a},{width:o,height:l},{x:0,y:0}),i}applyFilter(t,e,r,s){const i=this.renderer,n=this._activeFilterData,a=n.outputRenderSurface===r,o=i.renderTarget.rootRenderTarget.colorTexture.source._resolution,l=this._findFilterResolution(o);let h=0,c=0;if(a){const t=this._findPreviousFilterOffset();h=t.x,c=t.y}this._updateFilterUniforms(e,r,n,h,c,l,a,s),this._setupBindGroupsAndRender(t,e,i)}calculateSpriteMatrix(t,e){const r=this._activeFilterData,s=t.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),i=e.worldTransform.copyTo(n.u.shared),a=e.renderGroup||e.parentRenderGroup;return a&&a.cacheToLocalTransform&&i.prepend(a.cacheToLocalTransform),i.invert(),s.prepend(i),s.scale(1/e.texture.orig.width,1/e.texture.orig.height),s.translate(e.anchor.x,e.anchor.y),s}destroy(){}_setupBindGroupsAndRender(t,e,r){if(r.renderPipes.uniformBatch){const t=r.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(t,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,r.encoder.draw({geometry:m,shader:t,state:t._state,topology:"triangle-list"}),r.type===u.W.WEBGL&&r.renderTarget.finishRenderPass()}_setupFilterTextures(t,e,r,s){if(t.backTexture=h.g.EMPTY,t.inputTexture=c.W.getOptimalTexture(e.width,e.height,t.resolution,t.antialias),t.blendRequired){r.renderTarget.finishRenderPass();const i=r.renderTarget.getRenderTarget(t.outputRenderSurface);t.backTexture=this.getBackTexture(i,e,s?.bounds)}r.renderTarget.bind(t.inputTexture,!0),r.globalUniforms.push({offset:e})}_calculateGlobalFrame(t,e,r,s,i,n){const a=t.globalFrame;a.x=e*s,a.y=r*s,a.width=i*s,a.height=n*s}_updateFilterUniforms(t,e,r,s,i,n,a,o){const l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,u=l.uInputSize,d=l.uInputPixel,p=l.uInputClamp,f=l.uGlobalFrame,m=l.uOutputTexture;a?(c[0]=r.bounds.minX-s,c[1]=r.bounds.minY-i):(c[0]=0,c[1]=0),c[2]=t.frame.width,c[3]=t.frame.height,u[0]=t.source.width,u[1]=t.source.height,u[2]=1/u[0],u[3]=1/u[1],d[0]=t.source.pixelWidth,d[1]=t.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],p[0]=.5*d[2],p[1]=.5*d[3],p[2]=t.frame.width*u[2]-.5*d[2],p[3]=t.frame.height*u[3]-.5*d[3];const g=this.renderer.renderTarget.rootRenderTarget.colorTexture;f[0]=s*n,f[1]=i*n,f[2]=g.source.width*n,f[3]=g.source.height*n,e instanceof h.g&&(e.source.resource=null);const x=this.renderer.renderTarget.getRenderTarget(e);this.renderer.renderTarget.bind(e,!!o),e instanceof h.g?(m[0]=e.frame.width,m[1]=e.frame.height):(m[0]=x.width,m[1]=x.height),m[2]=x.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(t){let e=this._filterStackIndex-1;for(;e>0&&this._filterStack[e].skip;)--e;return e>0&&this._filterStack[e].inputTexture?this._filterStack[e].inputTexture.source._resolution:t}_findPreviousFilterOffset(){let t=0,e=0,r=this._filterStackIndex;for(;r>0;){r--;const s=this._filterStack[r];if(!s.skip){t=s.bounds.minX,e=s.bounds.minY;break}}return{x:t,y:e}}_calculateFilterArea(t,e){if(t.renderables?function(t,e){e.clear();const r=e.matrix;for(let r=0;r<t.length;r++){const s=t[r];if(s.globalDisplayStatus<7)continue;const i=s.renderGroup??s.parentRenderGroup;e.matrix=i?.isCachedAsTexture?p.copyFrom(i.textureOffsetInverseTransform).append(s.worldTransform):i?._parentCacheAsTextureRenderGroup?p.copyFrom(i._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(s.groupTransform):s.worldTransform,e.addBounds(s.bounds)}e.matrix=r}(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,e),t.container){const r=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;r&&e.applyMatrix(r)}}_applyFiltersToTexture(t,e){const r=t.inputTexture,s=t.bounds,i=t.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),1===i.length)i[0].apply(this,r,t.outputRenderSurface,e);else{let r=t.inputTexture;const n=c.W.getOptimalTexture(s.width,s.height,r.source._resolution,!1);let a=n,o=0;for(o=0;o<i.length-1;++o){i[o].apply(this,r,a,!0);const t=r;r=a,a=t}i[o].apply(this,r,t.outputRenderSurface,e),c.W.returnTexture(n)}}_calculateFilterBounds(t,e,r,s,i){const n=this.renderer,a=t.bounds,o=t.filters;let l=1/0,h=0,c=!0,u=!1,d=!1,p=!0;for(let t=0;t<o.length;t++){const e=o[t];if(l=Math.min(l,"inherit"===e.resolution?s:e.resolution),h+=e.padding,"off"===e.antialias?c=!1:"inherit"===e.antialias&&c&&(c=r),e.clipToViewport||(p=!1),!(e.compatibleRenderers&n.type)){d=!1;break}if(e.blendRequired&&!(n.backBuffer?.useBackBuffer??1)){(0,f.R)("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=!1;break}d=e.enabled||d,u||(u=e.blendRequired)}d?(p&&a.fitBounds(0,e.width/s,0,e.height/s),a.scale(l).ceil().scale(1/l).pad((0|h)*i),a.isPositive?(t.antialias=c,t.resolution=l,t.blendRequired=u):t.skip=!0):t.skip=!0}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let t,e=this._filterStackIndex-1;for(;e>0&&(e--,t=this._filterStack[e],t.skip););return t}_pushFilterData(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new g),this._filterStackIndex++,t}}x.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"filter"},s.XO.add(x),s.XO.add(i)},8147:(t,e,r)=>{"use strict";r.d(e,{m:()=>i,w:()=>s});class s{#ut;#dt;constructor(t){this.#ut=t,this.#dt=!1}get dirty(){return this.#dt}get v(){return this.#ut}set v(t){this.#ut!==t&&(this.#dt=!0),this.#ut=t}resetDirty(){this.#dt=!1}}class i extends s{#L;#N;constructor(t){super(t),this.#L=Math.cos(t),this.#N=Math.sin(t)}get cos(){return this.#L}get sin(){return this.#N}set v(t){super.v!==t&&(this.#L=Math.cos(t),this.#N=Math.sin(t)),super.v=t}get v(){return super.v}}},8271:(t,e,r)=>{"use strict";r.d(e,{K:()=>i,Q:()=>s});const s={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var i=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(i||{})},8337:(t,e,r)=>{"use strict";r.d(e,{V:()=>h});var s=r(4872),i=r(6170),n=r(9375),a=r(1579),o=r(9798);function l(t,e){if(!(t instanceof a.h)){let r=e?o.S.INDEX:o.S.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),r=o.S.INDEX|o.S.COPY_DST):(t=new Float32Array(t),r=o.S.VERTEX|o.S.COPY_DST)),t=new a.h({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:r})}return t}class h extends s.A{constructor(t={}){super(),this.uid=(0,n.L)("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new i.c,this._boundsDirty=!0;const{attributes:e,indexBuffer:r,topology:s}=t;if(this.buffers=[],this.attributes={},e)for(const t in e)this.addAttribute(t,e[t]);this.instanceCount=t.instanceCount??1,r&&this.addIndex(r),this.topology=s||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const r=function(t){return(t instanceof a.h||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=l(t.buffer,!1),t}(e);-1===this.buffers.indexOf(r.buffer)&&(this.buffers.push(r.buffer),r.buffer.on("update",this.onBufferUpdate,this),r.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=r}addIndex(t){this.indexBuffer=l(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,function(t,e,r){const s=t.getAttribute("aPosition");if(!s)return r.minX=0,r.minY=0,r.maxX=0,r.maxY=0,r;const i=s.buffer.data;let n=1/0,a=1/0,o=-1/0,l=-1/0;const h=i.BYTES_PER_ELEMENT,c=(s.offset||0)/h,u=(s.stride||8)/h;for(let t=c;t<i.length;t+=u){const e=i[t],r=i[t+1];e>o&&(o=e),r>l&&(l=r),e<n&&(n=e),r<a&&(a=r)}return r.minX=n,r.minY=a,r.maxX=o,r.maxY=l,r}(this,0,this._bounds)):this._bounds}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}},8427:(t,e,r)=>{"use strict";var s=r(1065),i=r(5199),n=r(3655),a=r(4449),o=r(3769),l=r(9482),h=r(1228);class c{destroy(){}}class u{constructor(t,e){this.localUniforms=new a.k({uTransformMatrix:{value:new i.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new n.T({0:this.localUniforms}),this.renderer=t,this._adaptor=e,this._adaptor.init()}validateRenderable(t){const e=this._getMeshData(t),r=e.batched,s=t.batched;if(e.batched=s,r!==s)return!0;if(s){const r=t._geometry;if(r.indices.length!==e.indexSize||r.positions.length!==e.vertexSize)return e.indexSize=r.indices.length,e.vertexSize=r.positions.length,!0;const s=this._getBatchableMesh(t);return s.texture.uid!==t._texture.uid&&(s._textureMatrixUpdateId=-1),!s._batcher.checkAndUpdateTexture(s,t._texture)}return!1}addRenderable(t,e){const r=this.renderer.renderPipes.batch,s=this._getMeshData(t);if(t.didViewUpdate&&(s.indexSize=t._geometry.indices?.length,s.vertexSize=t._geometry.positions?.length),s.batched){const s=this._getBatchableMesh(t);s.setTexture(t._texture),s.geometry=t._geometry,r.addToBatch(s,e)}else r.break(e),e.add(t)}updateRenderable(t){if(t.batched){const e=this._getBatchableMesh(t);e.setTexture(t._texture),e.geometry=t._geometry,e._batcher.updateElement(e)}}execute(t){if(!t.isRenderable)return;t.state.blendMode=(0,o.i)(t.groupBlendMode,t.texture._source);const e=this.localUniforms;e.uniforms.uTransformMatrix=t.groupTransform,e.uniforms.uRound=this.renderer._roundPixels|t._roundPixels,e.update(),(0,l.V)(t.groupColorAlpha,e.uniforms.uColor,0),this._adaptor.execute(this,t)}_getMeshData(t){var e,r;return(e=t._gpuData)[r=this.renderer.uid]||(e[r]=new c),t._gpuData[this.renderer.uid].meshData||this._initMeshData(t)}_initMeshData(t){return t._gpuData[this.renderer.uid].meshData={batched:t.batched,indexSize:0,vertexSize:0},t._gpuData[this.renderer.uid].meshData}_getBatchableMesh(t){var e,r;return(e=t._gpuData)[r=this.renderer.uid]||(e[r]=new c),t._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(t)}_initBatchableMesh(t){const e=new h.U;return e.renderable=t,e.setTexture(t._texture),e.transform=t.groupTransform,e.roundPixels=this.renderer._roundPixels|t._roundPixels,t._gpuData[this.renderer.uid].batchableMesh=e,e}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}u.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"mesh"},s.XO.add(u)},8533:(t,e,r)=>{"use strict";r(275);var s=r(2839);new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),s._},8574:(t,e,r)=>{"use strict";r.d(e,{W:()=>n});var s=r(5423);let i;function n(){if(!i||i?.isContextLost()){const t=s.e.get().createCanvas();i=t.getContext("webgl",{})}return i}},8598:(t,e,r)=>{"use strict";r.d(e,{c:()=>w});var s=r(6643),i=r(2445),n=r(4696),a=r(7694),o=r(7926),l=r(5105),h=r(6675),c=r(9390),u=r(1566),d=r(5947),p=r(9739),f=r(8896),m=r(2288),g=r(1990),x=r(9359);const y=class t extends x.v{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;const r={...t.defaultOptions,...e};this._textureSize=r.textureSize,this._mipmap=r.mipmap;const s=r.style.clone();r.overrideFill&&(s._fill.color=16777215,s._fill.alpha=1,s._fill.texture=p.g.WHITE,s._fill.fill=null),this.applyFillAsTint=r.overrideFill;const i=s.fontSize;s.fontSize=this.baseMeasurementFontSize;const n=(0,m.Z)(s);r.overrideSize?s._stroke&&(s._stroke.width*=this.baseRenderedFontSize/i):s.fontSize=this.baseRenderedFontSize=i,this._style=s,this._skipKerning=r.skipKerning??!1,this.resolution=r.resolution??1,this._padding=r.padding??4,r.textureStyle&&(this._textureStyle=r.textureStyle instanceof f.n?r.textureStyle:new f.n(r.textureStyle)),this.fontMetrics=o.P.measureFont(n),this.lineHeight=s.lineHeight||this.fontMetrics.fontSize||s.fontSize}ensureCharacters(t){const e=o.P.graphemeSegmenter(t).filter(t=>!this._currentChars.includes(t)).filter((t,e,r)=>r.indexOf(t)===e);if(!e.length)return;let r;this._currentChars=[...this._currentChars,...e],r=-1===this._currentPageIndex?this._nextPage():this.pages[this._currentPageIndex];let{canvas:s,context:i}=r.canvasAndContext,n=r.texture.source;const a=this._style;let l=this._currentX,h=this._currentY,u=this._currentMaxCharHeight;const d=this.baseRenderedFontSize/this.baseMeasurementFontSize,f=this._padding*d;let m=!1;const g=s.width/this.resolution,x=s.height/this.resolution;for(let t=0;t<e.length;t++){const r=e[t],y=o.P.measureText(r,a,s,!1);y.lineHeight=y.height;const v=y.width*d,_=Math.ceil(("italic"===a.fontStyle?2:1)*v)+2*f,b=y.height*d+2*f;if(m=!1,"\n"!==r&&"\r"!==r&&"\t"!==r&&" "!==r&&(m=!0,u=Math.ceil(Math.max(b,u))),l+_>g&&(h+=u,u=b,l=0,h+u>x)){n.update();const t=this._nextPage();s=t.canvasAndContext.canvas,i=t.canvasAndContext.context,n=t.texture.source,l=0,h=0,u=0}const w=v/d-(a.dropShadow?.distance??0)-(a._stroke?.width??0);if(this.chars[r]={id:r.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:w,kerning:{}},m){this._drawGlyph(i,y,l+f,h+f,d,a);const t=n.width*d,e=n.height*d,s=new c.M(l/t*n.width,h/e*n.height,_/t*n.width,b/e*n.height);this.chars[r].texture=new p.g({source:n,frame:s}),l+=Math.ceil(_)}}n.update(),this._currentX=l,this._currentY=h,this._currentMaxCharHeight=u,this._skipKerning&&this._applyKerning(e,i)}get pageTextures(){return(0,n.t6)(n.lj,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(t,e){const r=this._measureCache;for(let s=0;s<t.length;s++){const i=t[s];for(let t=0;t<this._currentChars.length;t++){const s=this._currentChars[t];let n=r[i];n||(n=r[i]=e.measureText(i).width);let a=r[s];a||(a=r[s]=e.measureText(s).width);let o=e.measureText(i+s).width,l=o-(n+a);l&&(this.chars[i].kerning[s]=l),o=e.measureText(i+s).width,l=o-(n+a),l&&(this.chars[s].kerning[i]=l)}}}_nextPage(){this._currentPageIndex++;const t=this.resolution,e=u.N.getOptimalCanvasAndContext(this._textureSize,this._textureSize,t);this._setupContext(e.context,this._style,t);const r=t*(this.baseRenderedFontSize/this.baseMeasurementFontSize),s=new p.g({source:new d.b({resource:e.canvas,resolution:r,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(s.source.style=this._textureStyle);const i={canvasAndContext:e,texture:s};return this.pages[this._currentPageIndex]=i,i}_setupContext(t,e,r){e.fontSize=this.baseRenderedFontSize,t.scale(r,r),t.font=(0,m.Z)(e),e.fontSize=this.baseMeasurementFontSize,t.textBaseline=e.textBaseline;const s=e._stroke,i=s?.width??0;if(s&&(t.lineWidth=i,t.lineJoin=s.join,t.miterLimit=s.miterLimit,t.strokeStyle=(0,g.r)(s,t)),e._fill&&(t.fillStyle=(0,g.r)(e._fill,t)),e.dropShadow){const s=e.dropShadow,i=h.Q.shared.setValue(s.color).toArray(),n=s.blur*r,a=s.distance*r;t.shadowColor=`rgba(${255*i[0]},${255*i[1]},${255*i[2]},${s.alpha})`,t.shadowBlur=n,t.shadowOffsetX=Math.cos(s.angle)*a,t.shadowOffsetY=Math.sin(s.angle)*a}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0}_drawGlyph(t,e,r,s,i,n){const a=e.text,o=e.fontProperties,l=n._stroke,h=(l?.width??0)*i,c=r+h/2,u=s-h/2,d=o.descent*i,p=e.lineHeight*i;let f=!1;n.stroke&&h&&(f=!0,t.strokeText(a,c,u+p-d));const{shadowBlur:m,shadowOffsetX:g,shadowOffsetY:x}=t;n._fill&&(f&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.fillText(a,c,u+p-d)),f&&(t.shadowBlur=m,t.shadowOffsetX=g,t.shadowOffsetY=x)}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){const{canvasAndContext:e,texture:r}=this.pages[t];u.N.returnCanvasAndContext(e),r.destroy(!0)}this.pages=null}};y.defaultOptions={textureSize:512,style:new l.x,mipmap:!0};let v=y;var _=r(5353);let b=0;const w=new class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null},this.measureCache=(0,s.g)(1e3)}getFont(t,e){let r=`${e.fontFamily}-bitmap`,s=!0;if(e._fill.fill&&!e._stroke?(r+=e._fill.fill.styleKey,s=!1):(e._stroke||e.dropShadow)&&(r=`${e.styleKey}-bitmap`,s=!1),!i.l.has(r)){const t=Object.create(e);t.lineHeight=0;const n=new v({style:t,overrideFill:s,overrideSize:!0,...this.defaultOptions});b++,b>50&&(0,a.R)("BitmapText",`You have dynamically created ${b} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),n.once("destroy",()=>{b--,i.l.remove(r)}),i.l.set(r,n)}const n=i.l.get(r);return n.ensureCharacters?.(t),n}getLayout(t,e,r=!0){const s=this.getFont(t,e),i=`${t}-${e.styleKey}-${r}`;if(this.measureCache.has(i))return this.measureCache.get(i);const n=o.P.graphemeSegmenter(t),a=(0,_.Z)(n,e,s,r);return this.measureCache.set(i,a),a}measureText(t,e,r=!0){return this.getLayout(t,e,r)}install(...t){let e=t[0];"string"==typeof e&&(e={name:e,style:t[1],chars:t[2]?.chars,resolution:t[2]?.resolution,padding:t[2]?.padding,skipKerning:t[2]?.skipKerning},(0,n.t6)(n.lj,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=e?.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");e={...this.defaultOptions,...e};const s=e.style,a=s instanceof l.x?s:new l.x(s),o=e.dynamicFill??this._canUseTintForStyle(a),h=new v({style:a,overrideFill:o,skipKerning:e.skipKerning,padding:e.padding,resolution:e.resolution,overrideSize:!1,textureStyle:e.textureStyle}),c=function(t){if(""===t)return[];"string"==typeof t&&(t=[t]);const e=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];if(Array.isArray(s)){if(2!==s.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(0===s[0].length||0===s[1].length)throw new Error("[BitmapFont]: Invalid character delimiter.");const t=s[0].charCodeAt(0),r=s[1].charCodeAt(0);if(r<t)throw new Error("[BitmapFont]: Invalid character range.");for(let s=t,i=r;s<=i;s++)e.push(String.fromCharCode(s))}else e.push(...Array.from(s))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(e.chars);return h.ensureCharacters(c.join("")),i.l.set(`${r}-bitmap`,h),h.once("destroy",()=>i.l.remove(`${r}-bitmap`)),h}uninstall(t){const e=`${t}-bitmap`,r=i.l.get(e);r&&r.destroy()}_canUseTintForStyle(t){return!(t._stroke||t.dropShadow&&0!==t.dropShadow.color||t._fill.fill||16777215!==t._fill.color)}}},8628:(t,e,r)=>{"use strict";r.d(e,{WebGPURenderer:()=>At});var s=r(1065),i=r(5199),n=r(2791),a=r(9677),o=r(2305),l=r(1570),h=r(4405),c=r(7335),u=r(1657),d=r(4449);class p{constructor(){this._maxTextures=0}contextChange(t){const e=new d.k({uTransformMatrix:{value:new i.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=t.limits.maxBatchableTextures;const r=(0,a.v)({name:"graphics",bits:[o.F,(0,l._)(this._maxTextures),h._Q,c.b]});this.shader=new u.M({gpuProgram:r,resources:{localUniforms:e}})}execute(t,e){const r=e.context,s=r.customShader||this.shader,i=t.renderer,a=i.graphicsContext,{batcher:o,instructions:l}=a.getContextRenderData(r),h=i.encoder;h.setGeometry(o.geometry,s.gpuProgram);const c=i.globalUniforms.bindGroup;h.setBindGroup(0,c,s.gpuProgram);const u=i.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,!0);h.setBindGroup(2,u,s.gpuProgram);const d=l.instructions;let p=null;for(let e=0;e<l.instructionSize;e++){const r=d[e];if(r.topology!==p&&(p=r.topology,h.setPipelineFromGeometryProgramAndState(o.geometry,s.gpuProgram,t.state,r.topology)),s.groups[1]=r.bindGroup,!r.gpuBindGroup){const t=r.textures;r.bindGroup=(0,n.w)(t.textures,t.count,this._maxTextures),r.gpuBindGroup=i.bindGroup.getBindGroup(r.bindGroup,s.gpuProgram,1)}h.setBindGroup(1,r.bindGroup,s.gpuProgram),h.renderPassEncoder.drawIndexed(r.size,1,r.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}p.extension={type:[s.Ag.WebGPUPipesAdaptor],name:"graphics"};var f=r(2577),m=r(9739),g=r(7694);class x{init(){const t=(0,a.v)({name:"mesh",bits:[h.Ls,f.R,c.b]});this._shader=new u.M({gpuProgram:t,resources:{uTexture:m.g.EMPTY._source,uSampler:m.g.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new i.u}}}})}execute(t,e){const r=t.renderer;let s=e._shader;if(s){if(!s.gpuProgram)return void(0,g.R)("Mesh shader has no gpuProgram",e.shader)}else s=this._shader,s.groups[2]=r.texture.getTextureBindGroup(e.texture);const i=s.gpuProgram;if(i.autoAssignGlobalUniforms&&(s.groups[0]=r.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const e=t.localUniforms;s.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(e,!0)}r.encoder.draw({geometry:e._geometry,shader:s,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}x.extension={type:[s.Ag.WebGPUPipesAdaptor],name:"mesh"};var y=r(7433);const v=y.U.for2d();class _{start(t,e,r){const s=t.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=e,i.setGeometry(e,n),v.blendMode="normal",s.pipeline.getPipeline(e,n,v);const a=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,a,n)}execute(t,e){const r=this._shader.gpuProgram,s=t.renderer,i=s.encoder;if(!e.bindGroup){const t=e.textures;e.bindGroup=(0,n.w)(t.textures,t.count,s.limits.maxBatchableTextures)}v.blendMode=e.blendMode;const a=s.bindGroup.getBindGroup(e.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,v,e.topology);e.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,a),i.renderPassEncoder.drawIndexed(e.size,1,e.start)}}_.extension={type:[s.Ag.WebGPUPipesAdaptor],name:"batch"};var b=r(6114),w=r(1673),T=r(5153);class S{constructor(t){this._hash=Object.create(null),this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(t){this._gpu=t}getBindGroup(t,e,r){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,r)}_createBindGroup(t,e,r){const s=this._gpu.device,i=e.layout[r],n=[],a=this._renderer;for(const e in i){const r=t.resources[e]??t.resources[i[e]];let s;if("uniformGroup"===r._resourceType){const t=r;a.ubo.updateUniformGroup(t);const e=t.buffer;s={buffer:a.buffer.getGPUBuffer(e),offset:0,size:e.descriptor.size}}else if("buffer"===r._resourceType){const t=r;s={buffer:a.buffer.getGPUBuffer(t),offset:0,size:t.descriptor.size}}else if("bufferResource"===r._resourceType){const t=r;s={buffer:a.buffer.getGPUBuffer(t.buffer),offset:t.offset,size:t.size}}else if("textureSampler"===r._resourceType){const t=r;s=a.texture.getGpuSampler(t)}else if("textureSource"===r._resourceType){const t=r;s=a.texture.getGpuSource(t).createView({})}n.push({binding:i[e],resource:s})}const o=a.shader.getProgramData(e).bindGroups[r],l=s.createBindGroup({layout:o,entries:n});return this._hash[t._key]=l,l}destroy(){for(const t of Object.keys(this._hash))this._hash[t]=null;this._hash=null,this._renderer=null}}S.extension={type:[s.Ag.WebGPUSystem],name:"bindGroup"};var A=r(9062);class C{constructor(t){this._gpuBuffers=Object.create(null),this._managedBuffers=[],t.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(t){this._gpu=t}getGPUBuffer(t){return this._gpuBuffers[t.uid]||this.createGPUBuffer(t)}updateBuffer(t){const e=this._gpuBuffers[t.uid]||this.createGPUBuffer(t),r=t.data;return t._updateID&&r&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,r.buffer,0,(t._updateSize||r.byteLength)+3&-4)),e}destroyAll(){for(const t in this._gpuBuffers)this._gpuBuffers[t].destroy();this._gpuBuffers={}}createGPUBuffer(t){this._gpuBuffers[t.uid]||(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this),t.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(t));const e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t.data&&((0,A.W)(t.data.buffer,e.getMappedRange()),e.unmap()),this._gpuBuffers[t.uid]=e,e}onBufferChange(t){this._gpuBuffers[t.uid].destroy(),t._updateID=0,this._gpuBuffers[t.uid]=this.createGPUBuffer(t)}onBufferDestroy(t){this._managedBuffers.splice(this._managedBuffers.indexOf(t),1),this._destroyBuffer(t)}destroy(){this._managedBuffers.forEach(t=>this._destroyBuffer(t)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(t){this._gpuBuffers[t.uid].destroy(),t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this),t.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[t.uid]=null}}C.extension={type:[s.Ag.WebGPUSystem],name:"buffer"};class P{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}}P.extension={type:[s.Ag.WebGPUSystem],name:"colorMask"};var E=r(5423);class M{constructor(t){this._renderer=t}async init(t){return this._initPromise||(this._initPromise=(t.gpu?Promise.resolve(t.gpu):this._createDeviceAndAdaptor(t)).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)})),this._initPromise}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){const e=await E.e.get().getNavigator().gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(t=>e.features.has(t)),s=await e.requestDevice({requiredFeatures:r});return{adapter:e,device:s}}destroy(){this.gpu=null,this._renderer=null}}M.extension={type:[s.Ag.WebGPUSystem],name:"device"},M.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class k{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,r,s){const i=this._renderer.pipeline.getPipeline(t,e,r,s);this.setPipeline(i)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;const e=2===t.data.BYTES_PER_ELEMENT?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,r){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(e,r,t);this.renderPassEncoder.setBindGroup(t,s)}setGeometry(t,e){const r=this._renderer.pipeline.getBufferNamesToBind(t,e);for(const e in r)this._setVertexBuffer(parseInt(e,10),t.attributes[r[e]].buffer);t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(const r in t.groups){const s=t.groups[r];e||this._syncBindGroup(s),this.setBindGroup(r,s,t.gpuProgram)}}_syncBindGroup(t){for(const e in t.resources){const r=t.resources[e];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(t){const{geometry:e,shader:r,state:s,topology:i,size:n,start:a,instanceCount:o,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,r.gpuProgram,s,i),this.setGeometry(e,r.gpuProgram),this._setShaderBindGroups(r,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(n||e.indexBuffer.data.length,o??e.instanceCount,a||0):this.renderPassEncoder.draw(n||e.getSize(),o??e.instanceCount,a||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);const e=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(e);for(const t in r)this._setVertexBuffer(t,r[t]);for(const t in i)this.setBindGroup(t,i[t],null);this._setIndexBuffer(s)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(t){this._gpu=t}}k.extension={type:[s.Ag.WebGPUSystem],name:"encoder",priority:1};class R{constructor(t){this._renderer=t}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}R.extension={type:[s.Ag.WebGPUSystem],name:"limits"};var B=r(8271);class I{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:B.K.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=t,r.stencilReference=e;const s=this._renderer;s.pipeline.setStencilMode(t),s.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}I.extension={type:[s.Ag.WebGPUSystem],name:"stencil"};var F=r(1009);const O={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function G(t){const e=t.map(t=>({data:t,offset:0,size:0}));let r=0;for(let t=0;t<e.length;t++){const s=e[t];let i=O[s.data.type].size;const n=O[s.data.type].align;if(!O[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),r=Math.ceil(r/n)*n,s.size=i,s.offset=r,r+=i}return r=16*Math.ceil(r/16),{uboElements:e,size:r}}var D=r(2337),U=r(4364);function L(t,e){const{size:r,align:s}=O[t.data.type],i=(s-r)/4,n=t.data.type.indexOf("i32")>=0?"dataInt32":"data";return`\n v = uv.${t.data.name};\n ${0!==e?`offset += ${e};`:""}\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${t.data.size*(r/4)}; i++)\n {\n for(var j = 0; j < ${r/4}; j++)\n {\n ${n}[arrayOffset++] = v[t++];\n }\n ${0!==i?`arrayOffset += ${i};`:""}\n }\n `}function N(t){return(0,D.E)(t,"uboWgsl",L,U._)}class X extends F.W{constructor(){super({createUboElements:G,generateUboSync:N})}}X.extension={type:[s.Ag.WebGPUSystem],name:"ubo"};var V=r(1579),Y=r(2015),z=r(9798);class W{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error("UniformBufferBatch: array is too large: "+4*t);const e=this.byteIndex;let r=e+4*t;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>4*this.data.length)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,e}addGroup(t){const e=this.addEmptyGroup(t.length);for(let r=0;r<t.length;r++)this.data[e/4+r]=t[r];return e}destroy(){this.data=null}}var H=r(3655);const j=128;class q{constructor(t){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new W({minUniformOffsetAlignment:j});for(let t=0;t<2;t++){let e=z.S.UNIFORM|z.S.COPY_DST;0===t&&(e|=z.S.COPY_SRC),this._buffers.push(new V.h({data:this._batchBuffer.data,usage:e}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const t in this._bindGroupHash)this._bindGroupHash[t]=null;this._batchBuffer.clear()}getUniformBindGroup(t,e){if(!e&&this._bindGroupHash[t.uid])return this._bindGroupHash[t.uid];this._renderer.ubo.ensureUniformGroup(t);const r=t.buffer.data,s=this._batchBuffer.addEmptyGroup(r.length);return this._renderer.ubo.syncUniformGroup(t,this._batchBuffer.data,s/4),this._bindGroupHash[t.uid]=this._getBindGroup(s/j),this._bindGroupHash[t.uid]}getUboResource(t){this._renderer.ubo.updateUniformGroup(t);const e=t.buffer.data,r=this._batchBuffer.addGroup(e);return this._getBufferResource(r/j)}getArrayBindGroup(t){const e=this._batchBuffer.addGroup(t);return this._getBindGroup(e/j)}getArrayBufferResource(t){const e=this._batchBuffer.addGroup(t)/j;return this._getBufferResource(e)}_getBufferResource(t){if(!this._bufferResources[t]){const e=this._buffers[t%2];this._bufferResources[t]=new Y.d({buffer:e,offset:256*(t/2|0),size:j})}return this._bufferResources[t]}_getBindGroup(t){if(!this._bindGroups[t]){const e=new H.T({0:this._getBufferResource(t)});this._bindGroups[t]=e}return this._bindGroups[t]}_uploadBindGroups(){const t=this._renderer.buffer,e=this._buffers[0];e.update(this._batchBuffer.byteIndex),t.updateBuffer(e);const r=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){const i=this._buffers[s];r.copyBufferToBuffer(t.getGPUBuffer(e),j,t.getGPUBuffer(i),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([r.finish()])}destroy(){for(let t=0;t<this._bindGroups.length;t++)this._bindGroups[t]?.destroy();this._bindGroups=null,this._bindGroupHash=null;for(let t=0;t<this._buffers.length;t++)this._buffers[t].destroy();this._buffers=null;for(let t=0;t<this._bufferResources.length;t++)this._bufferResources[t].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}q.extension={type:[s.Ag.WebGPUPipes],name:"uniformBatch"};var $=r(498),K=r(8642),Q=r(9250);const Z={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};class J{constructor(t){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=t}contextChange(t){this._gpu=t,this.setStencilMode(B.K.DISABLED),this._updatePipeHash()}setMultisampleCount(t){this._multisampleCount!==t&&(this._multisampleCount=t,this._updatePipeHash())}setRenderTarget(t){this._multisampleCount=t.msaaSamples,this._depthStencilAttachment=t.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(t){this._colorMask!==t&&(this._colorMask=t,this._updatePipeHash())}setStencilMode(t){this._stencilMode!==t&&(this._stencilMode=t,this._stencilState=Q.g[t],this._updatePipeHash())}setPipeline(t,e,r,s){const i=this.getPipeline(t,e,r);s.setPipeline(i)}getPipeline(t,e,r,s){t._layoutKey||((0,$.q)(t,e.attributeData),this._generateBufferKey(t)),s||(s=t.topology);const i=function(t,e,r,s,i){return t<<24|e<<16|r<<10|s<<5|i}(t._layoutKey,e._layoutKey,r.data,r._blendModeId,Z[s]);return this._pipeCache[i]||(this._pipeCache[i]=this._createPipeline(t,e,r,s)),this._pipeCache[i]}_createPipeline(t,e,r,s){const i=this._gpu.device,n=this._createVertexBufferLayouts(t,e),a=this._renderer.state.getColorTargets(r);a[0].writeMask=this._stencilMode===B.K.RENDERING_MASK_ADD?0:this._colorMask;const o=this._renderer.shader.getProgramData(e).pipeline,l={vertex:{module:this._getModule(e.vertex.source),entryPoint:e.vertex.entryPoint,buffers:n},fragment:{module:this._getModule(e.fragment.source),entryPoint:e.fragment.entryPoint,targets:a},primitive:{topology:s,cullMode:r.cullMode},layout:o,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(l.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:r.depthTest,depthCompare:r.depthTest?"less":"always"}),i.createRenderPipeline(l)}_getModule(t){return this._moduleCache[t]||this._createModule(t)}_createModule(t){const e=this._gpu.device;return this._moduleCache[t]=e.createShaderModule({code:t}),this._moduleCache[t]}_generateBufferKey(t){const e=[];let r=0;const s=Object.keys(t.attributes).sort();for(let i=0;i<s.length;i++){const n=t.attributes[s[i]];e[r++]=n.offset,e[r++]=n.format,e[r++]=n.stride,e[r++]=n.instance}const i=e.join("|");return t._layoutKey=(0,K.X)(i,"geometry"),t._layoutKey}_generateAttributeLocationsKey(t){const e=[];let r=0;const s=Object.keys(t.attributeData).sort();for(let i=0;i<s.length;i++){const n=t.attributeData[s[i]];e[r++]=n.location}const i=e.join("|");return t._attributeLocationsKey=(0,K.X)(i,"programAttributes"),t._attributeLocationsKey}getBufferNamesToBind(t,e){const r=t._layoutKey<<16|e._attributeLocationsKey;if(this._bindingNamesCache[r])return this._bindingNamesCache[r];const s=this._createVertexBufferLayouts(t,e),i=Object.create(null),n=e.attributeData;for(let t=0;t<s.length;t++){const e=Object.values(s[t].attributes)[0].shaderLocation;for(const r in n)if(n[r].location===e){i[t]=r;break}}return this._bindingNamesCache[r]=i,i}_createVertexBufferLayouts(t,e){e._attributeLocationsKey||this._generateAttributeLocationsKey(e);const r=t._layoutKey<<16|e._attributeLocationsKey;if(this._bufferLayoutsCache[r])return this._bufferLayoutsCache[r];const s=[];return t.buffers.forEach(r=>{const i={arrayStride:0,stepMode:"vertex",attributes:[]},n=i.attributes;for(const s in e.attributeData){const a=t.attributes[s];1!==(a.divisor??1)&&(0,g.R)(`Attribute ${s} has an invalid divisor value of '${a.divisor}'. WebGPU only supports a divisor value of 1`),a.buffer===r&&(i.arrayStride=a.stride,i.stepMode=a.instance?"instance":"vertex",n.push({shaderLocation:e.attributeData[s].location,offset:a.offset,format:a.format}))}n.length&&s.push(i)}),this._bufferLayoutsCache[r]=s,s}_updatePipeHash(){const t=(e=this._stencilMode,r=this._multisampleCount,this._colorMask<<6|e<<3|this._depthStencilAttachment<<1|r);var e,r;this._pipeStateCaches[t]||(this._pipeStateCaches[t]=Object.create(null)),this._pipeCache=this._pipeStateCaches[t]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}J.extension={type:[s.Ag.WebGPUSystem],name:"pipeline"};var tt=r(8900),et=r(1711),rt=r(1386),st=r(4269);class it{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class nt{init(t,e){this._renderer=t,this._renderTargetSystem=e}copyToTexture(t,e,r,s,i){const n=this._renderer,a=this._getGpuColorTexture(t),o=n.texture.getGpuSource(e.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:r},{texture:o,origin:i},s),e}startRenderPass(t,e=!0,r,s){const i=this._renderTargetSystem.getGpuRenderTarget(t),n=this.getDescriptor(t,e,r);i.descriptor=n,this._renderer.pipeline.setRenderTarget(i),this._renderer.encoder.beginRenderPass(i),this._renderer.encoder.setViewport(s)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);return e.contexts[0]?e.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(t.colorTextures[0].source)}getDescriptor(t,e,r){"boolean"==typeof e&&(e=e?et.u.ALL:et.u.NONE);const s=this._renderTargetSystem,i=s.getGpuRenderTarget(t),n=t.colorTextures.map((t,n)=>{const a=i.contexts[n];let o,l;o=a?a.getCurrentTexture().createView():this._renderer.texture.getGpuSource(t).createView({mipLevelCount:1}),i.msaaTextures[n]&&(l=o,o=this._renderer.texture.getTextureView(i.msaaTextures[n]));const h=e&et.u.COLOR?"clear":"load";return r??(r=s.defaultClearColor),{view:o,resolveTarget:l,clearValue:r,storeOp:"store",loadOp:h}});let a;if(!t.stencil&&!t.depth||t.depthStencilTexture||(t.ensureDepthStencilTexture(),t.depthStencilTexture.source.sampleCount=i.msaa?4:1),t.depthStencilTexture){const r=e&et.u.STENCIL?"clear":"load",s=e&et.u.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(t.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:r,depthClearValue:1,depthLoadOp:s,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:a}}clear(t,e=!0,r,s){if(!e)return;const{gpu:i,encoder:n}=this._renderer,a=i.device;if(null===n.commandEncoder){const i=a.createCommandEncoder(),n=this.getDescriptor(t,e,r),o=i.beginRenderPass(n);o.setViewport(s.x,s.y,s.width,s.height,0,1),o.end();const l=i.finish();a.queue.submit([l])}else this.startRenderPass(t,e,r,s)}initGpuRenderTarget(t){t.isRoot=!0;const e=new it;return t.colorTextures.forEach((t,r)=>{if(t instanceof rt.q){const s=t.resource.getContext("webgpu"),i=t.transparent?"premultiplied":"opaque";try{s.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:i})}catch(t){console.error(t)}e.contexts[r]=s}if(e.msaa=t.source.antialias,t.source.antialias){const t=new st.v({width:0,height:0,sampleCount:4});e.msaaTextures[r]=t}}),e.msaa&&(e.msaaSamples=4,t.depthStencilTexture&&(t.depthStencilTexture.source.sampleCount=4)),e}destroyGpuRenderTarget(t){t.contexts.forEach(t=>{t.unconfigure()}),t.msaaTextures.forEach(t=>{t.destroy()}),t.msaaTextures.length=0,t.contexts.length=0}ensureDepthStencilTexture(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);t.depthStencilTexture&&e.msaa&&(t.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);e.width=t.width,e.height=t.height,e.msaa&&t.colorTextures.forEach((t,r)=>{const s=e.msaaTextures[r];s?.resize(t.source.width,t.source.height,t.source._resolution)})}}class at extends tt.l{constructor(t){super(t),this.adaptor=new nt,this.adaptor.init(t,this)}}at.extension={type:[s.Ag.WebGPUSystem],name:"renderTarget"};class ot{constructor(){this._gpuProgramData=Object.create(null)}contextChange(t){this._gpu=t}getProgramData(t){return this._gpuProgramData[t._layoutKey]||this._createGPUProgramData(t)}_createGPUProgramData(t){const e=this._gpu.device,r=t.gpuLayout.map(t=>e.createBindGroupLayout({entries:t})),s={bindGroupLayouts:r};return this._gpuProgramData[t._layoutKey]={bindGroups:r,pipeline:e.createPipelineLayout(s)},this._gpuProgramData[t._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}ot.extension={type:[s.Ag.WebGPUSystem],name:"shader"};const lt={normal:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}},add:{alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}},multiply:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}},screen:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},overlay:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},none:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}},"normal-npm":{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}},"add-npm":{alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}},"screen-npm":{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}},erase:{alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}},min:{alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}},max:{alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}}};class ht{constructor(){this.defaultState=new y.U,this.defaultState.blend=!0}contextChange(t){this.gpu=t}getColorTargets(t){return[{format:"bgra8unorm",writeMask:0,blend:lt[t.blendMode]||lt.normal}]}destroy(){this.gpu=null}}ht.extension={type:[s.Ag.WebGPUSystem],name:"state"};var ct=r(1566);const ut={type:"image",upload(t,e,r){const s=t.resource,i=(0|t.pixelWidth)*(0|t.pixelHeight),n=s.byteLength/i;r.device.queue.writeTexture({texture:e},s,{offset:0,rowsPerImage:t.pixelHeight,bytesPerRow:t.pixelHeight*n},{width:t.pixelWidth,height:t.pixelHeight,depthOrArrayLayers:1})}},dt={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},pt={blockBytes:4,blockWidth:1,blockHeight:1},ft={type:"compressed",upload(t,e,r){let s=t.pixelWidth,i=t.pixelHeight;const n=dt[t.format]||pt;for(let a=0;a<t.resource.length;a++){const o=t.resource[a],l=Math.ceil(s/n.blockWidth)*n.blockBytes;r.device.queue.writeTexture({texture:e,mipLevel:a},o,{offset:0,bytesPerRow:l},{width:Math.ceil(s/n.blockWidth)*n.blockWidth,height:Math.ceil(i/n.blockHeight)*n.blockHeight,depthOrArrayLayers:1}),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},mt={type:"image",upload(t,e,r){const s=t.resource;if(!s)return;if(globalThis.HTMLImageElement&&s instanceof HTMLImageElement){const e=E.e.get().createCanvas(s.width,s.height);e.getContext("2d").drawImage(s,0,0,s.width,s.height),t.resource=e,(0,g.R)("ImageSource: Image element passed, converting to canvas and replacing resource.")}const i=Math.min(e.width,t.resourceWidth||t.pixelWidth),n=Math.min(e.height,t.resourceHeight||t.pixelHeight),a="premultiply-alpha-on-upload"===t.alphaMode;r.device.queue.copyExternalImageToTexture({source:s},{texture:e,premultipliedAlpha:a},{width:i,height:n})}},gt={type:"video",upload(t,e,r){mt.upload(t,e,r)}};class xt{constructor(t){this.device=t,this.sampler=t.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(t){let e=this.pipelines[t];return e||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:"\n var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));\n\n struct VertexOutput {\n @builtin(position) position : vec4<f32>,\n @location(0) texCoord : vec2<f32>,\n };\n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {\n var output : VertexOutput;\n output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);\n output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);\n return output;\n }\n\n @group(0) @binding(0) var imgSampler : sampler;\n @group(0) @binding(1) var img : texture_2d<f32>;\n\n @fragment\n fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {\n return textureSample(img, imgSampler, texCoord);\n }\n "})),e=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:t}]}}),this.pipelines[t]=e),e}generateMipmap(t){const e=this._getMipmapPipeline(t.format);if("3d"===t.dimension||"1d"===t.dimension)throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=t;const s=t.depthOrArrayLayers||1,i=t.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const e={size:{width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:s},format:t.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:t.mipLevelCount-1};r=this.device.createTexture(e)}const n=this.device.createCommandEncoder({}),a=e.getBindGroupLayout(0);for(let o=0;o<s;++o){let s=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:o,arrayLayerCount:1}),l=i?1:0;for(let i=1;i<t.mipLevelCount;++i){const t=r.createView({baseMipLevel:l++,mipLevelCount:1,dimension:"2d",baseArrayLayer:o,arrayLayerCount:1}),i=n.beginRenderPass({colorAttachments:[{view:t,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),h=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:s}]});i.setPipeline(e),i.setBindGroup(0,h),i.draw(3,1,0,0),i.end(),s=t}}if(!i){const e={width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:s};for(let s=1;s<t.mipLevelCount;++s)n.copyTextureToTexture({texture:r,mipLevel:s-1},{texture:t,mipLevel:s},e),e.width=Math.ceil(e.width/2),e.height=Math.ceil(e.height/2)}return this.device.queue.submit([n.finish()]),i||r.destroy(),t}}class yt{constructor(t){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:mt,buffer:ut,video:gt,compressed:ft},this._renderer=t,t.renderableGC.addManagedHash(this,"_gpuSources"),t.renderableGC.addManagedHash(this,"_gpuSamplers"),t.renderableGC.addManagedHash(this,"_bindGroupHash"),t.renderableGC.addManagedHash(this,"_textureViewHash")}contextChange(t){this._gpu=t}initSource(t){return this._gpuSources[t.uid]?this._gpuSources[t.uid]:this._initSource(t)}_initSource(t){if(t.autoGenerateMipmaps){const e=Math.max(t.pixelWidth,t.pixelHeight);t.mipLevelCount=Math.floor(Math.log2(e))+1}let e=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;"compressed"!==t.uploadMethodId&&(e|=GPUTextureUsage.RENDER_ATTACHMENT,e|=GPUTextureUsage.COPY_SRC);const r=dt[t.format]||{blockBytes:4,blockWidth:1,blockHeight:1},s=Math.ceil(t.pixelWidth/r.blockWidth)*r.blockWidth,i=Math.ceil(t.pixelHeight/r.blockHeight)*r.blockHeight,n={label:t.label,size:{width:s,height:i},format:t.format,sampleCount:t.sampleCount,mipLevelCount:t.mipLevelCount,dimension:t.dimension,usage:e},a=this._gpuSources[t.uid]=this._gpu.device.createTexture(n);return this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceResize,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),a}onSourceUpdate(t){const e=this.getGpuSource(t);e&&(this._uploads[t.uploadMethodId]&&this._uploads[t.uploadMethodId].upload(t,e,this._gpu),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t))}onSourceUnload(t){const e=this._gpuSources[t.uid];e&&(this._gpuSources[t.uid]=null,e.destroy())}onUpdateMipmaps(t){this._mipmapGenerator||(this._mipmapGenerator=new xt(this._gpu.device));const e=this.getGpuSource(t);this._mipmapGenerator.generateMipmap(e)}onSourceDestroy(t){t.off("update",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("destroy",this.onSourceDestroy,this),t.off("resize",this.onSourceResize,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}onSourceResize(t){const e=this._gpuSources[t.uid];e?e.width===t.pixelWidth&&e.height===t.pixelHeight||(this._textureViewHash[t.uid]=null,this._bindGroupHash[t.uid]=null,this.onSourceUnload(t),this.initSource(t)):this.initSource(t)}_initSampler(t){return this._gpuSamplers[t._resourceId]=this._gpu.device.createSampler(t),this._gpuSamplers[t._resourceId]}getGpuSampler(t){return this._gpuSamplers[t._resourceId]||this._initSampler(t)}getGpuSource(t){return this._gpuSources[t.uid]||this.initSource(t)}getTextureBindGroup(t){return this._bindGroupHash[t.uid]??this._createTextureBindGroup(t)}_createTextureBindGroup(t){const e=t.source;return this._bindGroupHash[t.uid]=new H.T({0:e,1:e.style,2:new d.k({uTextureMatrix:{type:"mat3x3<f32>",value:t.textureMatrix.mapCoord}})}),this._bindGroupHash[t.uid]}getTextureView(t){const e=t.source;return this._textureViewHash[e.uid]??this._createTextureView(e)}_createTextureView(t){return this._textureViewHash[t.uid]=this.getGpuSource(t).createView(),this._textureViewHash[t.uid]}generateCanvas(t){const e=this._renderer,r=e.gpu.device.createCommandEncoder(),s=E.e.get().createCanvas();s.width=t.source.pixelWidth,s.height=t.source.pixelHeight;const i=s.getContext("webgpu");return i.configure({device:e.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:E.e.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:e.texture.getGpuSource(t.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:s.width,height:s.height}),e.gpu.device.queue.submit([r.finish()]),s}getPixels(t){const e=this.generateCanvas(t),r=ct.N.getOptimalCanvasAndContext(e.width,e.height),s=r.context;s.drawImage(e,0,0);const{width:i,height:n}=e,a=s.getImageData(0,0,i,n),o=new Uint8ClampedArray(a.data.buffer);return ct.N.returnCanvasAndContext(r),{pixels:o,width:i,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null;for(const t of Object.keys(this._bindGroupHash)){const e=Number(t),r=this._bindGroupHash[e];r?.destroy(),this._bindGroupHash[e]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}yt.extension={type:[s.Ag.WebGPUSystem],name:"texture"};const vt=[...w.i,X,k,M,R,C,yt,at,ot,ht,J,P,I,S],_t=[...w.f,q],bt=[_,x,p],wt=[],Tt=[],St=[];s.XO.handleByNamedList(s.Ag.WebGPUSystem,wt),s.XO.handleByNamedList(s.Ag.WebGPUPipes,Tt),s.XO.handleByNamedList(s.Ag.WebGPUPipesAdaptor,St),s.XO.add(...vt,..._t,...bt);class At extends b.k{constructor(){super({name:"webgpu",type:T.W.WEBGPU,systems:wt,renderPipes:Tt,renderPipeAdaptors:St})}}},8630:(t,e,r)=>{"use strict";var s;r.d(e,{H:()=>s}),function(t){t[t.Rectangle=0]="Rectangle",t[t.Circle=1]="Circle",t[t.Ellipse=2]="Ellipse",t[t.Polygon=3]="Polygon"}(s||(s={}))},8642:(t,e,r)=>{"use strict";r.d(e,{X:()=>n});const s=Object.create(null),i=Object.create(null);function n(t,e){let r=i[t];return void 0===r&&(void 0===s[e]&&(s[e]=1),i[t]=r=s[e]++),r}},8675:(t,e,r)=>{"use strict";var s=r(1065),i=r(4687),n=r(3880),a=r(3651);class o{constructor(t){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),e=this._canvas.width,r=this._canvas.height,s=t.width/e*this._renderer.resolution,i=t.height/r*this._renderer.resolution,n=`translate(${t.left}px, ${t.top}px) scale(${s}, ${i})`;n!==this._lastTransform&&(this._domElement.style.transform=n,this._lastTransform=n)},this._domElement=t.domElement,this._renderer=t.renderer,globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas||(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(t=>{for(const e of t){if(e.target!==this._canvas)continue;const t=this.canvas.width,r=this.canvas.height,s=e.contentRect.width/t*this._renderer.resolution,i=e.contentRect.height/r*this._renderer.resolution;(this._lastScaleX!==s||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=s,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||a.R.shared.add(this.updateTranslation,this,n.d.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&a.R.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}var l=r(59);class h{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=h.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new l.b,this.page=new l.b,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,r){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,r,s,i){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var c=/iPhone/i,u=/iPod/i,d=/iPad/i,p=/\biOS-universal(?:.+)Mac\b/i,f=/\bAndroid(?:.+)Mobile\b/i,m=/Android/i,g=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,x=/Silk/i,y=/Windows Phone/i,v=/\bWindows(?:.+)ARM\b/i,_=/BlackBerry/i,b=/BB10/i,w=/Opera Mini/i,T=/\b(CriOS|Chrome)(?:.+)Mobile/i,S=/Mobile(?:.+)Firefox\b/i,A=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function C(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,s=r.split("[FBAN");void 0!==s[1]&&(r=s[0]),void 0!==(s=r.split("Twitter"))[1]&&(r=s[0]);var i=function(t){return function(e){return e.test(t)}}(r),n={apple:{phone:i(c)&&!i(y),ipod:i(u),tablet:!i(c)&&(i(d)||A(e))&&!i(y),universal:i(p),device:(i(c)||i(u)||i(d)||i(p)||A(e))&&!i(y)},amazon:{phone:i(g),tablet:!i(g)&&i(x),device:i(g)||i(x)},android:{phone:!i(y)&&i(g)||!i(y)&&i(f),tablet:!i(y)&&!i(g)&&!i(f)&&(i(x)||i(m)),device:!i(y)&&(i(g)||i(x)||i(f)||i(m))||i(/\bokhttp\b/i)},windows:{phone:i(y),tablet:i(v),device:i(y)||i(v)},other:{blackberry:i(_),blackberry10:i(b),opera:i(w),firefox:i(S),chrome:i(T),device:i(_)||i(b)||i(w)||i(S)||i(T)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const P=(C.default??C)(globalThis.navigator);var E=r(4025);const M=class t{constructor(t,e=P){this._mobileInfo=e,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(e.tablet||e.phone)&&this._createTouchHook(),this._renderer=t}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top="0px",this._div.style.left="0px",this._div.style.pointerEvents="none",this._div.style.zIndex=2..toString(),this._canvasObserver=new o({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,!0));const t=this._renderer.view.canvas;if(t.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const e=new MutationObserver(()=>{t.parentNode&&(e.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});e.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(this._isActive&&!this._isMobileAccessibility){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const t of this._children)t._accessibleDiv&&t._accessibleDiv.parentNode&&(t._accessibleDiv.parentNode.removeChild(t._accessibleDiv),t._accessibleDiv=null),t._accessibleActive=!1;this._pool.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[]}}_updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&(t._accessibleActive||this._addChild(t),t._renderId=this._renderId);const e=t.children;if(e)for(let t=0;t<e.length;t++)this._updateAccessibleObjects(e[t])}init(e){const r={accessibilityOptions:{...t.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=r.accessibilityOptions.debug,this._activateOnTab=r.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=r.accessibilityOptions.deactivateOnMouseMove,r.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._renderer.runners.postrender.remove(this)}postrender(){const t=performance.now();if(this._mobileInfo.android.device&&t<this._androidUpdateCount)return;if(this._androidUpdateCount=t+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas)return;const e=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const t of this._children)t._renderId===this._renderId&&e.add(this._children.indexOf(t))}for(let t=this._children.length-1;t>=0;t--){const r=this._children[t];e.has(t)||(r._accessibleDiv&&r._accessibleDiv.parentNode&&(r._accessibleDiv.parentNode.removeChild(r._accessibleDiv),this._pool.push(r._accessibleDiv),r._accessibleDiv=null),r._accessibleActive=!1,(0,E.d)(this._children,t,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let t=0;t<this._children.length;t++){const e=this._children[t];if(!e._accessibleActive||!e._accessibleDiv)continue;const r=e._accessibleDiv,s=e.hitArea||e.getBounds().rectangle;if(e.hitArea){const t=e.worldTransform;r.style.left=`${t.tx+s.x*t.a}px`,r.style.top=`${t.ty+s.y*t.d}px`,r.style.width=s.width*t.a+"px",r.style.height=s.height*t.d+"px"}else this._capHitArea(s),r.style.left=`${s.x}px`,r.style.top=`${s.y}px`,r.style.width=`${s.width}px`,r.style.height=`${s.height}px`}this._renderId++}_updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}_capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:r}=this._renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>r&&(t.height=r-t.y)}_addChild(t){let e=this._pool.pop();e||("button"===t.accessibleType?e=document.createElement("button"):(e=document.createElement(t.accessibleType),e.style.cssText="\n color: transparent;\n pointer-events: none;\n padding: 0;\n margin: 0;\n border: 0;\n outline: 0;\n background: transparent;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n ",t.accessibleText&&(e.innerText=t.accessibleText)),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title=`container ${t.tabIndex}`),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t.interactive?e.tabIndex=t.tabIndex:e.tabIndex=0,this.debug&&this._updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.container=t,this._children.push(t),this._div.appendChild(t._accessibleDiv)}_dispatchEvent(t,e){const{container:r}=t.target,s=this._renderer.events.rootBoundary,i=Object.assign(new h(s),{target:r});s.rootTarget=this._renderer.lastObjectRendered,e.forEach(t=>s.dispatchEvent(i,t))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this._activateOnTab&&this._activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown)}setAccessibilityEnabled(t){t?this._activate():this._deactivate()}};M.extension={type:[s.Ag.WebGLSystem,s.Ag.WebGPUSystem],name:"accessibility"},M.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};let k=M;s.XO.add(k),s.XO.mixin(i.mc,{accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1}),r(3046);var R=r(4872),B=r(7694);const I=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){!this._tickerAdded&&this.domElement&&(a.R.system.add(this._tickerUpdate,this,n.d.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(a.R.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}):new MouseEvent("mousemove",{clientX:t.clientX,clientY:t.clientY}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}};class F extends h{constructor(){super(...arguments),this.client=new l.b,this.movement=new l.b,this.offset=new l.b,this.global=new l.b,this.screen=new l.b}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,r,s,i,n,a,o,l,h,c,u,d,p,f){throw new Error("Method not implemented.")}}class O extends F{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class G extends F{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}G.DOM_DELTA_PIXEL=0,G.DOM_DELTA_LINE=1,G.DOM_DELTA_PAGE=2;const D=new l.b,U=new l.b;class L{constructor(t){this.dispatch=new R.A,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((t,e)=>t.priority-e.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let r=0,s=e.length;r<s;r++)e[r].fn(t);else(0,B.R)(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){I.pauseUpdate=!0;const r=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,D.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let s=0,i=r.length-1;s<i;s++)if(t.currentTarget=r[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let s=r.length-2;s>=0;s--)if(t.currentTarget=r[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,r=this._allInteractiveElements){if(0===r.length)return;t.eventPhase=t.BUBBLING_PHASE;const s=Array.isArray(e)?e:[e];for(let e=r.length-1;e>=0;e--)s.forEach(s=>{t.currentTarget=r[e],this.notifyTarget(t,s)})}propagationPath(t){const e=[t];for(let r=0;r<2048&&t!==this.rootTarget&&t.parent;r++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,r,s,i,n=!1){let a=!1;if(this._interactivePrune(t))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(I.pauseUpdate=!1),t.interactiveChildren&&t.children){const o=t.children;for(let l=o.length-1;l>=0;l--){const h=o[l],c=this.hitTestMoveRecursive(h,this._isInteractive(e)?e:h.eventMode,r,s,i,n||i(t,r));if(c){if(c.length>0&&!c[c.length-1].parent)continue;const e=t.isInteractive();(c.length>0||e)&&(e&&this._allInteractiveElements.push(t),c.push(t)),0===this._hitElements.length&&(this._hitElements=c),a=!0}}}const o=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),n||this._hitElements.length>0?null:a?this._hitElements:o&&!i(t,r)&&s(t,r)?l?[t]:[]:null}hitTestRecursive(t,e,r,s,i){if(this._interactivePrune(t)||i(t,r))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(I.pauseUpdate=!1),t.interactiveChildren&&t.children){const n=t.children,a=r;for(let r=n.length-1;r>=0;r--){const o=n[r],l=this.hitTestRecursive(o,this._isInteractive(e)?e:o.eventMode,a,s,i);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const e=t.isInteractive();return(l.length>0||e)&&l.push(t),l}}}const n=this._isInteractive(e),a=t.isInteractive();return n&&s(t,r)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&t.visible&&t.renderable&&t.measurable)||"none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,U),!t.hitArea.contains(U.x,U.y)))return!0;if(t.effects&&t.effects.length)for(let r=0;r<t.effects.length;r++){const s=t.effects[r];if(s.containsPoint&&!s.containsPoint(e,this.hitTestFn))return!0}return!1}hitTestFn(t,e){return!!t.hitArea||!!t?.containsPoint&&(t.worldTransform.applyInverse(e,U),t.containsPoint(U))}notifyTarget(t,e){if(!t.currentTarget.isInteractive())return;e??(e=t.type);const r=`on${e}`;t.currentTarget[r]?.(t);const s=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,s),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const r="mouse"===e.pointerType||"pen"===e.pointerType,s=this.trackingData(t.pointerId),i=this.findMountedTarget(s.overTargets);if(s.overTargets?.length>0&&i!==e.target){const s="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,s,i);if(this.dispatchEvent(n,"pointerout"),r&&this.dispatchEvent(n,"mouseout"),!e.composedPath().includes(i)){const s=this.createPointerEvent(t,"pointerleave",i);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;this.freeEvent(s)}this.freeEvent(n)}if(i!==e.target){const s="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(e,s);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover");let a=i?.parent;for(;a&&a!==this.rootTarget.parent&&a!==e.target;)a=a.parent;if(!a||a===this.rootTarget.parent){const t=this.clonePointerEvent(e,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==i&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const n=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?n.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&n.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?n.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&n.push("globaltouchmove")),r&&(this.moveOnAll?n.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&n.push("globalmousemove"),this.cursor=e.target?.cursor),n.length>0&&this.all(e,n),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.createPointerEvent(t),s="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),s&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=r.target?.cursor);const i=this.clonePointerEvent(r,"pointerenter");for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),s&&this.notifyTarget(i,"mouseenter"),i.target=i.target.parent;e.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(i)}mapPointerOut(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const r="mouse"===t.pointerType||"pen"===t.pointerType,s=this.findMountedTarget(e.overTargets),i=this.createPointerEvent(t,"pointerout",s);this.dispatchEvent(i),r&&this.dispatchEvent(i,"mouseout");const n=this.createPointerEvent(t,"pointerleave",s);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(i),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),r=this.createPointerEvent(t);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const s=this.trackingData(t.pointerId),i=this.findMountedTarget(s.pressTargetsByButton[t.button]);let n=i;if(i&&!r.composedPath().includes(i)){let e=i;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete s.pressTargetsByButton[t.button],n=e}if(n){const i=this.clonePointerEvent(r,"click");i.target=n,i.path=null,s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e});const a=s.clicksByButton[t.button];if(a.target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,"mouse"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightclick":"click")}else"touch"===i.pointerType&&this.dispatchEvent(i,"tap");this.dispatchEvent(i,"pointertap"),this.freeEvent(i)}this.freeEvent(r)}mapPointerUpOutside(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),s=this.createPointerEvent(t);if(r){let i=r;for(;i;)s.currentTarget=i,this.notifyTarget(s,"pointerupoutside"),"touch"===s.pointerType?this.notifyTarget(s,"touchendoutside"):"mouse"!==s.pointerType&&"pen"!==s.pointerType||this.notifyTarget(s,2===s.button?"rightupoutside":"mouseupoutside"),i=i.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(s)}mapWheel(t){if(!(t instanceof G))return void(0,B.R)("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let r=1;r<t.length&&t[r].parent===e;r++)e=t[r];return e}createPointerEvent(t,e,r){const s=this.allocateEvent(O);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=r??this.hitTest(s.global.x,s.global.y)??this._hitElements[0],"string"==typeof e&&(s.type=e),s}createWheelEvent(t){const e=this.allocateEvent(G);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const r=this.allocateEvent(O);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=e??r.type,r}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof O&&e instanceof O&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof F&&e instanceof F&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){const r=t.currentTarget._events[e];if(r)if("fn"in r)r.once&&t.currentTarget.removeListener(e,r.fn,void 0,!0),r.fn.call(r.context,t);else for(let s=0,i=r.length;s<i&&!t.propagationImmediatelyStopped;s++)r[s].once&&t.currentTarget.removeListener(e,r[s].fn,void 0,!0),r[s].fn.call(r[s].context,t)}}const N={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},X=class t{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new L(null),I.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new O(null),this._rootWheelEvent=new G(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...t.defaultEventFeatures},{set:(t,e,r)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=r),t[e]=r,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:r,resolution:s}=this.renderer;this.setTargetElement(r),this.resolution=s,t._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){I.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;const r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.domElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.domElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,r=e.length;t<r;t++){const r=e[t],s=this._bootstrapEvent(this._rootPointerEvent,r);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,I.pointerMoved();const e=this._normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const r=e!==this.domElement?"outside":"",s=this._normalizeToPointerData(t);for(let t=0,e=s.length;t<e;t++){const e=this._bootstrapEvent(this._rootPointerEvent,s[t]);e.type+=r,this.rootBoundary.mapEvent(e)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,I.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;I.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;I.removeTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,r){const s=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;t.x=(e-s.left)*(this.domElement.width/s.width)*i,t.y=(r-s.top)*(this.domElement.height/s.height)*i}_normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let r=0,s=t.changedTouches.length;r<s;r++){const s=t.changedTouches[r];void 0===s.button&&(s.button=0),void 0===s.buttons&&(s.buttons=1),void 0===s.isPrimary&&(s.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===s.width&&(s.width=s.radiusX||1),void 0===s.height&&(s.height=s.radiusY||1),void 0===s.tiltX&&(s.tiltX=0),void 0===s.tiltY&&(s.tiltY=0),void 0===s.pointerType&&(s.pointerType="touch"),void 0===s.pointerId&&(s.pointerId=s.identifier||0),void 0===s.pressure&&(s.pressure=s.force||.5),void 0===s.twist&&(s.twist=0),void 0===s.tangentialPressure&&(s.tangentialPressure=0),void 0===s.layerX&&(s.layerX=s.offsetX=s.clientX),void 0===s.layerY&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=t.type,e.push(s)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof globalThis.PointerEvent)){const r=t;void 0===r.isPrimary&&(r.isPrimary=!0),void 0===r.width&&(r.width=1),void 0===r.height&&(r.height=1),void 0===r.tiltX&&(r.tiltX=0),void 0===r.tiltY&&(r.tiltY=0),void 0===r.pointerType&&(r.pointerType="mouse"),void 0===r.pointerId&&(r.pointerId=1),void 0===r.pressure&&(r.pressure=.5),void 0===r.twist&&(r.twist=0),void 0===r.tangentialPressure&&(r.tangentialPressure=0),r.isNormalized=!0,e.push(r)}else e.push(t);return e}normalizeWheelEvent(t){const e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=N[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};X.extension={name:"events",type:[s.Ag.WebGLSystem,s.Ag.CanvasSystem,s.Ag.WebGPUSystem],priority:-1},X.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let V=X;const Y={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return"dynamic"===this.eventMode||"static"===this.eventMode},set interactive(t){this.eventMode=t?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??V.defaultEventMode},set eventMode(t){this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,r){const s="boolean"==typeof r&&r||"object"==typeof r&&r.capture,i="object"==typeof r?r.signal:void 0,n="object"==typeof r&&!0===r.once,a="function"==typeof e?void 0:e;t=s?`${t}capture`:t;const o="function"==typeof e?e:e.handleEvent,l=this;i&&i.addEventListener("abort",()=>{l.off(t,o,a)}),n?l.once(t,o,a):l.on(t,o,a)},removeEventListener(t,e,r){const s="function"==typeof e?void 0:e;t="boolean"==typeof r&&r||"object"==typeof r&&r.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,s)},dispatchEvent(t){if(!(t instanceof h))throw new Error("Container cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};s.XO.add(V),s.XO.mixin(i.mc,Y);class z{constructor(t){this._attachedDomElements=[],this._renderer=t,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new o({domElement:this._domElement,renderer:this._renderer})}addRenderable(t,e){this._attachedDomElements.includes(t)||this._attachedDomElements.push(t)}updateRenderable(t){}validateRenderable(t){return!0}postrender(){const t=this._attachedDomElements;if(0!==t.length){this._canvasObserver.ensureAttached();for(let e=0;e<t.length;e++){const r=t[e],s=r.element;if(!r.parent||r.globalDisplayStatus<7)s?.remove(),t.splice(e,1),e--;else{this._domElement.contains(s)||(s.style.position="absolute",s.style.pointerEvents="auto",this._domElement.appendChild(s));const t=r.worldTransform,e=r._anchor,i=r.width*e.x,n=r.height*e.y;s.style.transformOrigin=`${i}px ${n}px`,s.style.transform=`matrix(${t.a}, ${t.b}, ${t.c}, ${t.d}, ${t.tx-i}, ${t.ty-n})`,s.style.opacity=r.groupAlpha.toString()}}}else this._domElement.remove()}destroy(){this._renderer.runners.postrender.remove(this);for(let t=0;t<this._attachedDomElements.length;t++){const e=this._attachedDomElements[t];e.element?.remove()}this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null}}z.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"dom"},s.XO.add(z),r(2517),r(2542),r(3050),r(8427),r(6131),r(6934),r(966),r(6841),r(9797),r(4550),r(8122)},8714:function(t,e,r){var s;s=function(){return function(t){var e={};function r(s){if(e[s])return e[s].exports;var i=e[s]={i:s,l:!1,exports:{}};return t[s].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,s){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(s,i,function(e){return t[e]}.bind(null,i));return s},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=20)}([function(t,e){var s={};t.exports=s,function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var r,i;"boolean"==typeof e?(r=2,i=e):(r=1,i=!0);for(var n=r;n<arguments.length;n++){var a=arguments[n];if(a)for(var o in a)i&&a[o]&&a[o].constructor===Object?t[o]&&t[o].constructor!==Object?t[o]=a[o]:(t[o]=t[o]||{},s.extend(t[o],i,a[o])):t[o]=a[o]}return t},s.clone=function(t,e){return s.extend({},e,t)},s.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)e.push(r);return e},s.values=function(t){var e=[];if(Object.keys){for(var r=Object.keys(t),s=0;s<r.length;s++)e.push(t[r[s]]);return e}for(var i in t)e.push(t[i]);return e},s.get=function(t,e,r,s){e=e.split(".").slice(r,s);for(var i=0;i<e.length;i+=1)t=t[e[i]];return t},s.set=function(t,e,r,i,n){var a=e.split(".").slice(i,n);return s.get(t,e,0,-1)[a[a.length-1]]=r,r},s.shuffle=function(t){for(var e=t.length-1;e>0;e--){var r=Math.floor(s.random()*(e+1)),i=t[e];t[e]=t[r],t[r]=i}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,r){return t<e?e:t>r?r:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,r){return r=void 0!==r?r:1,(e=void 0!==e?e:0)+t()*(r-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,r){t[e]=s.chain(function(){s.warnOnce("🔅 deprecated 🔅",r)},t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1},s.map=function(t,e){if(t.map)return t.map(e);for(var r=[],s=0;s<t.length;s+=1)r.push(e(t[s]));return r},s.topologicalSort=function(t){var e=[],r=[],i=[];for(var n in t)r[n]||i[n]||s._topologicalSort(n,r,i,t,e);return e},s._topologicalSort=function(t,e,r,i,n){var a=i[t]||[];r[t]=!0;for(var o=0;o<a.length;o+=1){var l=a[o];r[l]||e[l]||s._topologicalSort(l,e,r,i,n)}r[t]=!1,e[t]=!0,n.push(t)},s.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var r=arguments[e];r._chained?t.push.apply(t,r._chained):t.push(r)}var s=function(){for(var e,r=new Array(arguments.length),s=0,i=arguments.length;s<i;s++)r[s]=arguments[s];for(s=0;s<t.length;s+=1){var n=t[s].apply(e,r);void 0!==n&&(e=n)}return e};return s._chained=t,s},s.chainPathBefore=function(t,e,r){return s.set(t,e,s.chain(r,s.get(t,e)))},s.chainPathAfter=function(t,e,r){return s.set(t,e,s.chain(s.get(t,e),r))},s.setDecomp=function(t){s._decomp=t},s.getDecomp=function(){var t=s._decomp;try{t||"undefined"==typeof window||(t=window.decomp),t||void 0===r.g||(t=r.g.decomp)}catch(e){t=null}return t}}()},function(t,e){var r={};t.exports=r,r.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&r.update(e,t),e},r.update=function(t,e,r){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;s<e.length;s++){var i=e[s];i.x>t.max.x&&(t.max.x=i.x),i.x<t.min.x&&(t.min.x=i.x),i.y>t.max.y&&(t.max.y=i.y),i.y<t.min.y&&(t.min.y=i.y)}r&&(r.x>0?t.max.x+=r.x:t.min.x+=r.x,r.y>0?t.max.y+=r.y:t.min.y+=r.y)},r.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},r.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},r.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},r.shift=function(t,e){var r=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+r,t.min.y=e.y,t.max.y=e.y+s}},function(t,e){var r={};t.exports=r,r.create=function(t,e){return{x:t||0,y:e||0}},r.clone=function(t){return{x:t.x,y:t.y}},r.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},r.rotate=function(t,e,r){var s=Math.cos(e),i=Math.sin(e);r||(r={});var n=t.x*s-t.y*i;return r.y=t.x*i+t.y*s,r.x=n,r},r.rotateAbout=function(t,e,r,s){var i=Math.cos(e),n=Math.sin(e);s||(s={});var a=r.x+((t.x-r.x)*i-(t.y-r.y)*n);return s.y=r.y+((t.x-r.x)*n+(t.y-r.y)*i),s.x=a,s},r.normalise=function(t){var e=r.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.cross=function(t,e){return t.x*e.y-t.y*e.x},r.cross3=function(t,e,r){return(e.x-t.x)*(r.y-t.y)-(e.y-t.y)*(r.x-t.x)},r.add=function(t,e,r){return r||(r={}),r.x=t.x+e.x,r.y=t.y+e.y,r},r.sub=function(t,e,r){return r||(r={}),r.x=t.x-e.x,r.y=t.y-e.y,r},r.mult=function(t,e){return{x:t.x*e,y:t.y*e}},r.div=function(t,e){return{x:t.x/e,y:t.y/e}},r.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},r.neg=function(t){return{x:-t.x,y:-t.y}},r.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},r._temp=[r.create(),r.create(),r.create(),r.create(),r.create(),r.create()]},function(t,e,r){var s={};t.exports=s;var i=r(2),n=r(0);s.create=function(t,e){for(var r=[],s=0;s<t.length;s++){var i=t[s],n={x:i.x,y:i.y,index:s,body:e,isInternal:!1};r.push(n)}return r},s.fromPath=function(t,e){var r=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,function(t,e,s){r.push({x:parseFloat(e),y:parseFloat(s)})}),s.create(r,e)},s.centre=function(t){for(var e,r,n,a=s.area(t,!0),o={x:0,y:0},l=0;l<t.length;l++)n=(l+1)%t.length,e=i.cross(t[l],t[n]),r=i.mult(i.add(t[l],t[n]),e),o=i.add(o,r);return i.div(o,6*a)},s.mean=function(t){for(var e={x:0,y:0},r=0;r<t.length;r++)e.x+=t[r].x,e.y+=t[r].y;return i.div(e,t.length)},s.area=function(t,e){for(var r=0,s=t.length-1,i=0;i<t.length;i++)r+=(t[s].x-t[i].x)*(t[s].y+t[i].y),s=i;return e?r/2:Math.abs(r)/2},s.inertia=function(t,e){for(var r,s,n=0,a=0,o=t,l=0;l<o.length;l++)s=(l+1)%o.length,n+=(r=Math.abs(i.cross(o[s],o[l])))*(i.dot(o[s],o[s])+i.dot(o[s],o[l])+i.dot(o[l],o[l])),a+=r;return e/6*(n/a)},s.translate=function(t,e,r){r=void 0!==r?r:1;var s,i=t.length,n=e.x*r,a=e.y*r;for(s=0;s<i;s++)t[s].x+=n,t[s].y+=a;return t},s.rotate=function(t,e,r){if(0!==e){var s,i,n,a,o=Math.cos(e),l=Math.sin(e),h=r.x,c=r.y,u=t.length;for(a=0;a<u;a++)i=(s=t[a]).x-h,n=s.y-c,s.x=h+(i*o-n*l),s.y=c+(i*l+n*o);return t}},s.contains=function(t,e){for(var r,s=e.x,i=e.y,n=t.length,a=t[n-1],o=0;o<n;o++){if(r=t[o],(s-a.x)*(r.y-a.y)+(i-a.y)*(a.x-r.x)>0)return!1;a=r}return!0},s.scale=function(t,e,r,n){if(1===e&&1===r)return t;var a,o;n=n||s.centre(t);for(var l=0;l<t.length;l++)a=t[l],o=i.sub(a,n),t[l].x=n.x+o.x*e,t[l].y=n.y+o.y*r;return t},s.chamfer=function(t,e,r,s,a){e="number"==typeof e?[e]:e||[8],r=void 0!==r?r:-1,s=s||2,a=a||14;for(var o=[],l=0;l<t.length;l++){var h=t[l-1>=0?l-1:t.length-1],c=t[l],u=t[(l+1)%t.length],d=e[l<e.length?l:e.length-1];if(0!==d){var p=i.normalise({x:c.y-h.y,y:h.x-c.x}),f=i.normalise({x:u.y-c.y,y:c.x-u.x}),m=Math.sqrt(2*Math.pow(d,2)),g=i.mult(n.clone(p),d),x=i.normalise(i.mult(i.add(p,f),.5)),y=i.sub(c,i.mult(x,m)),v=r;-1===r&&(v=1.75*Math.pow(d,.32)),(v=n.clamp(v,s,a))%2==1&&(v+=1);for(var _=Math.acos(i.dot(p,f))/v,b=0;b<v;b++)o.push(i.add(i.rotate(g,_*b),y))}else o.push(c)}return o},s.clockwiseSort=function(t){var e=s.mean(t);return t.sort(function(t,r){return i.angle(e,t)-i.angle(e,r)}),t},s.isConvex=function(t){var e,r,s,i,n=0,a=t.length;if(a<3)return null;for(e=0;e<a;e++)if(s=(e+2)%a,i=(t[r=(e+1)%a].x-t[e].x)*(t[s].y-t[r].y),(i-=(t[r].y-t[e].y)*(t[s].x-t[r].x))<0?n|=1:i>0&&(n|=2),3===n)return!1;return 0!==n||null},s.hull=function(t){var e,r,s=[],n=[];for((t=t.slice(0)).sort(function(t,e){var r=t.x-e.x;return 0!==r?r:t.y-e.y}),r=0;r<t.length;r+=1){for(e=t[r];n.length>=2&&i.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(r=t.length-1;r>=0;r-=1){for(e=t[r];s.length>=2&&i.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),n.pop(),s.concat(n)}},function(t,e,r){var s={};t.exports=s;var i=r(3),n=r(2),a=r(7),o=r(0),l=r(1),h=r(11);!function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(e){var r={id:o.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:i.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),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,render:{visible:!0,opacity:1,strokeStyle:null,fillStyle:null,lineWidth:null,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0}},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:1e3/60,_original:null},s=o.extend(r,e);return t(s,e),s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){e=e||{},s.set(t,{bounds:t.bounds||l.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}),i.rotate(t.vertices,t.angle,t.position),h.rotate(t.axes,t.angle),l.update(t.bounds,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var r=t.isStatic?"#14151f":o.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),a=t.isStatic?"#555":"#ccc",c=t.isStatic&&null===t.render.fillStyle?1:0;t.render.fillStyle=t.render.fillStyle||r,t.render.strokeStyle=t.render.strokeStyle||a,t.render.lineWidth=t.render.lineWidth||c,t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};s.set=function(t,e,r){var i;for(i in"string"==typeof e&&(i=e,(e={})[i]=r),e)if(Object.prototype.hasOwnProperty.call(e,i))switch(r=e[i],i){case"isStatic":s.setStatic(t,r);break;case"isSleeping":a.set(t,r);break;case"mass":s.setMass(t,r);break;case"density":s.setDensity(t,r);break;case"inertia":s.setInertia(t,r);break;case"vertices":s.setVertices(t,r);break;case"position":s.setPosition(t,r);break;case"angle":s.setAngle(t,r);break;case"velocity":s.setVelocity(t,r);break;case"angularVelocity":s.setAngularVelocity(t,r);break;case"speed":s.setSpeed(t,r);break;case"angularSpeed":s.setAngularSpeed(t,r);break;case"parts":s.setParts(t,r);break;case"centre":s.setCentre(t,r);break;default:t[i]=r}},s.setStatic=function(t,e){for(var r=0;r<t.parts.length;r++){var s=t.parts[r];e?(s.isStatic||(s._original={restitution:s.restitution,friction:s.friction,mass:s.mass,inertia:s.inertia,density:s.density,inverseMass:s.inverseMass,inverseInertia:s.inverseInertia}),s.restitution=0,s.friction=1,s.mass=s.inertia=s.density=1/0,s.inverseMass=s.inverseInertia=0,s.positionPrev.x=s.position.x,s.positionPrev.y=s.position.y,s.anglePrev=s.angle,s.angularVelocity=0,s.speed=0,s.angularSpeed=0,s.motion=0):s._original&&(s.restitution=s._original.restitution,s.friction=s._original.friction,s.mass=s._original.mass,s.inertia=s._original.inertia,s.density=s._original.density,s.inverseMass=s._original.inverseMass,s.inverseInertia=s._original.inverseInertia,s._original=null),s.isStatic=e}},s.setMass=function(t,e){var r=t.inertia/(t.mass/6);t.inertia=r*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},s.setDensity=function(t,e){s.setMass(t,e*t.area),t.density=e},s.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},s.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=i.create(e,t),t.axes=h.fromVertices(t.vertices),t.area=i.area(t.vertices),s.setMass(t,t.density*t.area);var r=i.centre(t.vertices);i.translate(t.vertices,r,-1),s.setInertia(t,s._inertiaScale*i.inertia(t.vertices,t.mass)),i.translate(t.vertices,t.position),l.update(t.bounds,t.vertices,t.velocity)},s.setParts=function(t,e,r){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(r=void 0===r||r){var o=[];for(n=0;n<e.length;n++)o=o.concat(e[n].vertices);i.clockwiseSort(o);var l=i.hull(o),h=i.centre(l);s.setVertices(t,l),i.translate(t.vertices,h)}var c=s._totalProperties(t);t.area=c.area,t.parent=t,t.position.x=c.centre.x,t.position.y=c.centre.y,t.positionPrev.x=c.centre.x,t.positionPrev.y=c.centre.y,s.setMass(t,c.mass),s.setInertia(t,c.inertia),s.setPosition(t,c.centre)}},s.setCentre=function(t,e,r){r?(t.positionPrev.x+=e.x,t.positionPrev.y+=e.y,t.position.x+=e.x,t.position.y+=e.y):(t.positionPrev.x=e.x-(t.position.x-t.positionPrev.x),t.positionPrev.y=e.y-(t.position.y-t.positionPrev.y),t.position.x=e.x,t.position.y=e.y)},s.setPosition=function(t,e,r){var s=n.sub(e,t.position);r?(t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.velocity.x=s.x,t.velocity.y=s.y,t.speed=n.magnitude(s)):(t.positionPrev.x+=s.x,t.positionPrev.y+=s.y);for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.position.x+=s.x,o.position.y+=s.y,i.translate(o.vertices,s),l.update(o.bounds,o.vertices,t.velocity)}},s.setAngle=function(t,e,r){var s=e-t.angle;r?(t.anglePrev=t.angle,t.angularVelocity=s,t.angularSpeed=Math.abs(s)):t.anglePrev+=s;for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.angle+=s,i.rotate(o.vertices,s,t.position),h.rotate(o.axes,s),l.update(o.bounds,o.vertices,t.velocity),a>0&&n.rotateAbout(o.position,s,t.position,o.position)}},s.setVelocity=function(t,e){var r=t.deltaTime/s._baseDelta;t.positionPrev.x=t.position.x-e.x*r,t.positionPrev.y=t.position.y-e.y*r,t.velocity.x=(t.position.x-t.positionPrev.x)/r,t.velocity.y=(t.position.y-t.positionPrev.y)/r,t.speed=n.magnitude(t.velocity)},s.getVelocity=function(t){var e=s._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},s.getSpeed=function(t){return n.magnitude(s.getVelocity(t))},s.setSpeed=function(t,e){s.setVelocity(t,n.mult(n.normalise(s.getVelocity(t)),e))},s.setAngularVelocity=function(t,e){var r=t.deltaTime/s._baseDelta;t.anglePrev=t.angle-e*r,t.angularVelocity=(t.angle-t.anglePrev)/r,t.angularSpeed=Math.abs(t.angularVelocity)},s.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*s._baseDelta/t.deltaTime},s.getAngularSpeed=function(t){return Math.abs(s.getAngularVelocity(t))},s.setAngularSpeed=function(t,e){s.setAngularVelocity(t,o.sign(s.getAngularVelocity(t))*e)},s.translate=function(t,e,r){s.setPosition(t,n.add(t.position,e),r)},s.rotate=function(t,e,r,i){if(r){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-r.x,l=t.position.y-r.y;s.setPosition(t,{x:r.x+(o*n-l*a),y:r.y+(o*a+l*n)},i),s.setAngle(t,t.angle+e,i)}else s.setAngle(t,t.angle+e,i)},s.scale=function(t,e,r,n){var a=0,o=0;n=n||t.position;for(var c=0;c<t.parts.length;c++){var u=t.parts[c];i.scale(u.vertices,e,r,n),u.axes=h.fromVertices(u.vertices),u.area=i.area(u.vertices),s.setMass(u,t.density*u.area),i.translate(u.vertices,{x:-u.position.x,y:-u.position.y}),s.setInertia(u,s._inertiaScale*i.inertia(u.vertices,u.mass)),i.translate(u.vertices,{x:u.position.x,y:u.position.y}),c>0&&(a+=u.area,o+=u.inertia),u.position.x=n.x+(u.position.x-n.x)*e,u.position.y=n.y+(u.position.y-n.y)*r,l.update(u.bounds,u.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(s.setMass(t,t.density*a),s.setInertia(t,o))),t.circleRadius&&(e===r?t.circleRadius*=e:t.circleRadius=null)},s.update=function(t,e){var r=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=s._timeCorrection?e/(t.deltaTime||e):1,c=1-t.frictionAir*(e/o._baseDelta),u=(t.position.x-t.positionPrev.x)*a,d=(t.position.y-t.positionPrev.y)*a;t.velocity.x=u*c+t.force.x/t.mass*r,t.velocity.y=d*c+t.force.y/t.mass*r,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)*c*a+t.torque/t.inertia*r,t.anglePrev=t.angle,t.angle+=t.angularVelocity;for(var p=0;p<t.parts.length;p++){var f=t.parts[p];i.translate(f.vertices,t.velocity),p>0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(i.rotate(f.vertices,t.angularVelocity,t.position),h.rotate(f.axes,t.angularVelocity),p>0&&n.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),l.update(f.bounds,f.vertices,t.velocity)}},s.updateVelocities=function(t){var e=s._baseDelta/t.deltaTime,r=t.velocity;r.x=(t.position.x-t.positionPrev.x)*e,r.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(r.x*r.x+r.y*r.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},s.applyForce=function(t,e,r){var s=e.x-t.position.x,i=e.y-t.position.y;t.force.x+=r.x,t.force.y+=r.y,t.torque+=s*r.y-i*r.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},r=1===t.parts.length?0:1;r<t.parts.length;r++){var s=t.parts[r],i=s.mass!==1/0?s.mass:1;e.mass+=i,e.area+=s.area,e.inertia+=s.inertia,e.centre=n.add(e.centre,n.mult(s.position,i))}return e.centre=n.div(e.centre,e.mass),e}}()},function(t,e,r){var s={};t.exports=s;var i=r(0);s.on=function(t,e,r){for(var s,i=e.split(" "),n=0;n<i.length;n++)s=i[n],t.events=t.events||{},t.events[s]=t.events[s]||[],t.events[s].push(r);return r},s.off=function(t,e,r){if(e){"function"==typeof e&&(r=e,e=i.keys(t.events).join(" "));for(var s=e.split(" "),n=0;n<s.length;n++){var a=t.events[s[n]],o=[];if(r&&a)for(var l=0;l<a.length;l++)a[l]!==r&&o.push(a[l]);t.events[s[n]]=o}}else t.events={}},s.trigger=function(t,e,r){var s,n,a,o,l=t.events;if(l&&i.keys(l).length>0){r||(r={}),s=e.split(" ");for(var h=0;h<s.length;h++)if(a=l[n=s[h]]){(o=i.clone(r,!1)).name=n,o.source=t;for(var c=0;c<a.length;c++)a[c].apply(t,[o])}}}},function(t,e,r){var s={};t.exports=s;var i=r(5),n=r(0),a=r(1),o=r(4);s.create=function(t){return n.extend({id:n.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},t)},s.setModified=function(t,e,r,i){if(t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),r&&t.parent&&s.setModified(t.parent,e,r,i),i)for(var n=0;n<t.composites.length;n++){var a=t.composites[n];s.setModified(a,e,r,i)}},s.add=function(t,e){var r=[].concat(e);i.trigger(t,"beforeAdd",{object:e});for(var a=0;a<r.length;a++){var o=r[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}s.addBody(t,o);break;case"constraint":s.addConstraint(t,o);break;case"composite":s.addComposite(t,o);break;case"mouseConstraint":s.addConstraint(t,o.constraint)}}return i.trigger(t,"afterAdd",{object:e}),t},s.remove=function(t,e,r){var n=[].concat(e);i.trigger(t,"beforeRemove",{object:e});for(var a=0;a<n.length;a++){var o=n[a];switch(o.type){case"body":s.removeBody(t,o,r);break;case"constraint":s.removeConstraint(t,o,r);break;case"composite":s.removeComposite(t,o,r);break;case"mouseConstraint":s.removeConstraint(t,o.constraint)}}return i.trigger(t,"afterRemove",{object:e}),t},s.addComposite=function(t,e){return t.composites.push(e),e.parent=t,s.setModified(t,!0,!0,!1),t},s.removeComposite=function(t,e,r){var i=n.indexOf(t.composites,e);if(-1!==i){var a=s.allBodies(e);s.removeCompositeAt(t,i);for(var o=0;o<a.length;o++)a[o].sleepCounter=0}if(r)for(o=0;o<t.composites.length;o++)s.removeComposite(t.composites[o],e,!0);return t},s.removeCompositeAt=function(t,e){return t.composites.splice(e,1),s.setModified(t,!0,!0,!1),t},s.addBody=function(t,e){return t.bodies.push(e),s.setModified(t,!0,!0,!1),t},s.removeBody=function(t,e,r){var i=n.indexOf(t.bodies,e);if(-1!==i&&(s.removeBodyAt(t,i),e.sleepCounter=0),r)for(var a=0;a<t.composites.length;a++)s.removeBody(t.composites[a],e,!0);return t},s.removeBodyAt=function(t,e){return t.bodies.splice(e,1),s.setModified(t,!0,!0,!1),t},s.addConstraint=function(t,e){return t.constraints.push(e),s.setModified(t,!0,!0,!1),t},s.removeConstraint=function(t,e,r){var i=n.indexOf(t.constraints,e);if(-1!==i&&s.removeConstraintAt(t,i),r)for(var a=0;a<t.composites.length;a++)s.removeConstraint(t.composites[a],e,!0);return t},s.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),s.setModified(t,!0,!0,!1),t},s.clear=function(t,e,r){if(r)for(var i=0;i<t.composites.length;i++)s.clear(t.composites[i],e,!0);return e?t.bodies=t.bodies.filter(function(t){return t.isStatic}):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,s.setModified(t,!0,!0,!1),t},s.allBodies=function(t){if(t.cache&&t.cache.allBodies)return t.cache.allBodies;for(var e=[].concat(t.bodies),r=0;r<t.composites.length;r++)e=e.concat(s.allBodies(t.composites[r]));return t.cache&&(t.cache.allBodies=e),e},s.allConstraints=function(t){if(t.cache&&t.cache.allConstraints)return t.cache.allConstraints;for(var e=[].concat(t.constraints),r=0;r<t.composites.length;r++)e=e.concat(s.allConstraints(t.composites[r]));return t.cache&&(t.cache.allConstraints=e),e},s.allComposites=function(t){if(t.cache&&t.cache.allComposites)return t.cache.allComposites;for(var e=[].concat(t.composites),r=0;r<t.composites.length;r++)e=e.concat(s.allComposites(t.composites[r]));return t.cache&&(t.cache.allComposites=e),e},s.get=function(t,e,r){var i,n;switch(r){case"body":i=s.allBodies(t);break;case"constraint":i=s.allConstraints(t);break;case"composite":i=s.allComposites(t).concat(t)}return i?0===(n=i.filter(function(t){return t.id.toString()===e.toString()})).length?null:n[0]:null},s.move=function(t,e,r){return s.remove(t,e),s.add(r,e),t},s.rebase=function(t){for(var e=s.allBodies(t).concat(s.allConstraints(t)).concat(s.allComposites(t)),r=0;r<e.length;r++)e[r].id=n.nextId();return t},s.translate=function(t,e,r){for(var i=r?s.allBodies(t):t.bodies,n=0;n<i.length;n++)o.translate(i[n],e);return t},s.rotate=function(t,e,r,i){for(var n=Math.cos(e),a=Math.sin(e),l=i?s.allBodies(t):t.bodies,h=0;h<l.length;h++){var c=l[h],u=c.position.x-r.x,d=c.position.y-r.y;o.setPosition(c,{x:r.x+(u*n-d*a),y:r.y+(u*a+d*n)}),o.rotate(c,e)}return t},s.scale=function(t,e,r,i,n){for(var a=n?s.allBodies(t):t.bodies,l=0;l<a.length;l++){var h=a[l],c=h.position.x-i.x,u=h.position.y-i.y;o.setPosition(h,{x:i.x+c*e,y:i.y+u*r}),o.scale(h,e,r)}return t},s.bounds=function(t){for(var e=s.allBodies(t),r=[],i=0;i<e.length;i+=1){var n=e[i];r.push(n.bounds.min,n.bounds.max)}return a.create(r)}},function(t,e,r){var s={};t.exports=s;var i=r(4),n=r(5),a=r(0);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var r=e/a._baseDelta,n=s._motionSleepThreshold,o=0;o<t.length;o++){var l=t[o],h=i.getSpeed(l),c=i.getAngularSpeed(l),u=h*h+c*c;if(0===l.force.x&&0===l.force.y){var d=Math.min(l.motion,u),p=Math.max(l.motion,u);l.motion=s._minBias*d+(1-s._minBias)*p,l.sleepThreshold>0&&l.motion<n?(l.sleepCounter+=1,l.sleepCounter>=l.sleepThreshold/r&&s.set(l,!0)):l.sleepCounter>0&&(l.sleepCounter-=1)}else s.set(l,!1)}},s.afterCollisions=function(t){for(var e=s._motionSleepThreshold,r=0;r<t.length;r++){var i=t[r];if(i.isActive){var n=i.collision,a=n.bodyA.parent,o=n.bodyB.parent;if(!(a.isSleeping&&o.isSleeping||a.isStatic||o.isStatic)&&(a.isSleeping||o.isSleeping)){var l=a.isSleeping&&!a.isStatic?a:o,h=l===a?o:a;!l.isStatic&&h.motion>e&&s.set(l,!1)}}}},s.set=function(t,e){var r=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,r||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,r&&n.trigger(t,"sleepEnd"))}},function(t,e,r){var s={};t.exports=s;var i,n,a,o=r(3),l=r(9);i=[],n={overlap:0,axis:null},a={overlap:0,axis:null},s.create=function(t,e){return{pair:null,collided:!1,bodyA:t,bodyB:e,parentA:t.parent,parentB:e.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[null,null],supportCount:0}},s.collides=function(t,e,r){if(s._overlapAxes(n,t.vertices,e.vertices,t.axes),n.overlap<=0)return null;if(s._overlapAxes(a,e.vertices,t.vertices,e.axes),a.overlap<=0)return null;var i,h,c=r&&r.table[l.id(t,e)];c?i=c.collision:((i=s.create(t,e)).collided=!0,i.bodyA=t.id<e.id?t:e,i.bodyB=t.id<e.id?e:t,i.parentA=i.bodyA.parent,i.parentB=i.bodyB.parent),t=i.bodyA,e=i.bodyB,h=n.overlap<a.overlap?n:a;var u=i.normal,d=i.tangent,p=i.penetration,f=i.supports,m=h.overlap,g=h.axis,x=g.x,y=g.y;x*(e.position.x-t.position.x)+y*(e.position.y-t.position.y)>=0&&(x=-x,y=-y),u.x=x,u.y=y,d.x=-y,d.y=x,p.x=x*m,p.y=y*m,i.depth=m;var v=s._findSupports(t,e,u,1),_=0;if(o.contains(t.vertices,v[0])&&(f[_++]=v[0]),o.contains(t.vertices,v[1])&&(f[_++]=v[1]),_<2){var b=s._findSupports(e,t,u,-1);o.contains(e.vertices,b[0])&&(f[_++]=b[0]),_<2&&o.contains(e.vertices,b[1])&&(f[_++]=b[1])}return 0===_&&(f[_++]=v[0]),i.supportCount=_,i},s._overlapAxes=function(t,e,r,s){var i,n,a,o,l,h,c=e.length,u=r.length,d=e[0].x,p=e[0].y,f=r[0].x,m=r[0].y,g=s.length,x=Number.MAX_VALUE,y=0;for(l=0;l<g;l++){var v=s[l],_=v.x,b=v.y,w=d*_+p*b,T=f*_+m*b,S=w,A=T;for(h=1;h<c;h+=1)(o=e[h].x*_+e[h].y*b)>S?S=o:o<w&&(w=o);for(h=1;h<u;h+=1)(o=r[h].x*_+r[h].y*b)>A?A=o:o<T&&(T=o);if((i=(n=S-T)<(a=A-w)?n:a)<x&&(x=i,y=l,i<=0))break}t.axis=s[y],t.overlap=x},s._findSupports=function(t,e,r,s){var n,a,o,l=e.vertices,h=l.length,c=t.position.x,u=t.position.y,d=r.x*s,p=r.y*s,f=l[0],m=f,g=d*(c-m.x)+p*(u-m.y);for(o=1;o<h;o+=1)(a=d*(c-(m=l[o]).x)+p*(u-m.y))<g&&(g=a,f=m);return g=d*(c-(n=l[(h+f.index-1)%h]).x)+p*(u-n.y),d*(c-(m=l[(f.index+1)%h]).x)+p*(u-m.y)<g?(i[0]=f,i[1]=m,i):(i[0]=f,i[1]=n,i)}},function(t,e,r){var s={};t.exports=s;var i=r(16);s.create=function(t,e){var r=t.bodyA,n=t.bodyB,a={id:s.id(r,n),bodyA:r,bodyB:n,collision:t,contacts:[i.create(),i.create()],contactCount:0,separation:0,isActive:!0,isSensor:r.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(a,t,e),a},s.update=function(t,e,r){var s=e.supports,i=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=r,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=i,e.pair=t;var l=s[0],h=n[0],c=s[1],u=n[1];u.vertex!==l&&h.vertex!==c||(n[1]=h,n[0]=h=u,u=n[1]),h.vertex=l,u.vertex=c},s.setActive=function(t,e,r){e?(t.isActive=!0,t.timeUpdated=r):(t.isActive=!1,t.contactCount=0)},s.id=function(t,e){return t.id<e.id?t.id.toString(36)+":"+e.id.toString(36):e.id.toString(36)+":"+t.id.toString(36)}},function(t,e,r){var s={};t.exports=s;var i=r(3),n=r(2),a=r(7),o=r(1),l=r(11),h=r(0);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var r=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,i=n.magnitude(n.sub(r,s));e.length=void 0!==e.length?e.length:i,e.id=e.id||h.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,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=h.extend(a,e.render),e},s.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var r=t[e],s=r.constraintImpulse;r.isStatic||0===s.x&&0===s.y&&0===s.angle||(r.position.x+=s.x,r.position.y+=s.y,r.angle+=s.angle)}},s.solveAll=function(t,e){for(var r=h.clamp(e/h._baseDelta,0,1),i=0;i<t.length;i+=1){var n=t[i],a=!n.bodyA||n.bodyA&&n.bodyA.isStatic,o=!n.bodyB||n.bodyB&&n.bodyB.isStatic;(a||o)&&s.solve(t[i],r)}for(i=0;i<t.length;i+=1)a=!(n=t[i]).bodyA||n.bodyA&&n.bodyA.isStatic,o=!n.bodyB||n.bodyB&&n.bodyB.isStatic,a||o||s.solve(t[i],r)},s.solve=function(t,e){var r=t.bodyA,i=t.bodyB,a=t.pointA,o=t.pointB;if(r||i){r&&!r.isStatic&&(n.rotate(a,r.angle-t.angleA,a),t.angleA=r.angle),i&&!i.isStatic&&(n.rotate(o,i.angle-t.angleB,o),t.angleB=i.angle);var l=a,h=o;if(r&&(l=n.add(r.position,a)),i&&(h=n.add(i.position,o)),l&&h){var c=n.sub(l,h),u=n.magnitude(c);u<s._minLength&&(u=s._minLength);var d,p,f,m,g,x=(u-t.length)/u,y=t.stiffness>=1||0===t.length?t.stiffness*e:t.stiffness*e*e,v=t.damping*e,_=n.mult(c,x*y),b=(r?r.inverseMass:0)+(i?i.inverseMass:0),w=b+((r?r.inverseInertia:0)+(i?i.inverseInertia:0));if(v>0){var T=n.create();f=n.div(c,u),g=n.sub(i&&n.sub(i.position,i.positionPrev)||T,r&&n.sub(r.position,r.positionPrev)||T),m=n.dot(f,g)}r&&!r.isStatic&&(p=r.inverseMass/b,r.constraintImpulse.x-=_.x*p,r.constraintImpulse.y-=_.y*p,r.position.x-=_.x*p,r.position.y-=_.y*p,v>0&&(r.positionPrev.x-=v*f.x*m*p,r.positionPrev.y-=v*f.y*m*p),d=n.cross(a,_)/w*s._torqueDampen*r.inverseInertia*(1-t.angularStiffness),r.constraintImpulse.angle-=d,r.angle-=d),i&&!i.isStatic&&(p=i.inverseMass/b,i.constraintImpulse.x+=_.x*p,i.constraintImpulse.y+=_.y*p,i.position.x+=_.x*p,i.position.y+=_.y*p,v>0&&(i.positionPrev.x+=v*f.x*m*p,i.positionPrev.y+=v*f.y*m*p),d=n.cross(o,_)/w*s._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle+=d,i.angle+=d)}}},s.postSolveAll=function(t){for(var e=0;e<t.length;e++){var r=t[e],h=r.constraintImpulse;if(!(r.isStatic||0===h.x&&0===h.y&&0===h.angle)){a.set(r,!1);for(var c=0;c<r.parts.length;c++){var u=r.parts[c];i.translate(u.vertices,h),c>0&&(u.position.x+=h.x,u.position.y+=h.y),0!==h.angle&&(i.rotate(u.vertices,h.angle,r.position),l.rotate(u.axes,h.angle),c>0&&n.rotateAbout(u.position,h.angle,r.position,u.position)),o.update(u.bounds,u.vertices,r.velocity)}h.angle*=s._warming,h.x*=s._warming,h.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},s.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),r=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),s=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),i=r-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(s*s+i*i)}},function(t,e,r){var s={};t.exports=s;var i=r(2),n=r(0);s.fromVertices=function(t){for(var e={},r=0;r<t.length;r++){var s=(r+1)%t.length,a=i.normalise({x:t[s].y-t[r].y,y:t[r].x-t[s].x}),o=0===a.y?1/0:a.x/a.y;e[o=o.toFixed(3).toString()]=a}return n.values(e)},s.rotate=function(t,e){if(0!==e)for(var r=Math.cos(e),s=Math.sin(e),i=0;i<t.length;i++){var n,a=t[i];n=a.x*r-a.y*s,a.y=a.x*s+a.y*r,a.x=n}}},function(t,e,r){var s={};t.exports=s;var i=r(3),n=r(0),a=r(4),o=r(1),l=r(2);s.rectangle=function(t,e,r,s,o){o=o||{};var l={label:"Rectangle Body",position:{x:t,y:e},vertices:i.fromPath("L 0 0 L "+r+" 0 L "+r+" "+s+" L 0 "+s)};if(o.chamfer){var h=o.chamfer;l.vertices=i.chamfer(l.vertices,h.radius,h.quality,h.qualityMin,h.qualityMax),delete o.chamfer}return a.create(n.extend({},l,o))},s.trapezoid=function(t,e,r,s,o,l){l=l||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var h,c=r*(o*=.5),u=c+(1-2*o)*r,d=u+c;h=o<.5?"L 0 0 L "+c+" "+-s+" L "+u+" "+-s+" L "+d+" 0":"L 0 0 L "+u+" "+-s+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:i.fromPath(h)};if(l.chamfer){var f=l.chamfer;p.vertices=i.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete l.chamfer}return a.create(n.extend({},p,l))},s.circle=function(t,e,r,i,a){i=i||{};var o={label:"Circle Body",circleRadius:r};a=a||25;var l=Math.ceil(Math.max(10,Math.min(a,r)));return l%2==1&&(l+=1),s.polygon(t,e,l,r,n.extend({},o,i))},s.polygon=function(t,e,r,o,l){if(l=l||{},r<3)return s.circle(t,e,o,l);for(var h=2*Math.PI/r,c="",u=.5*h,d=0;d<r;d+=1){var p=u+d*h,f=Math.cos(p)*o,m=Math.sin(p)*o;c+="L "+f.toFixed(3)+" "+m.toFixed(3)+" "}var g={label:"Polygon Body",position:{x:t,y:e},vertices:i.fromPath(c)};if(l.chamfer){var x=l.chamfer;g.vertices=i.chamfer(g.vertices,x.radius,x.quality,x.qualityMin,x.qualityMax),delete l.chamfer}return a.create(n.extend({},g,l))},s.fromVertices=function(t,e,r,s,h,c,u,d){var p,f,m,g,x,y,v,_,b,w,T=n.getDecomp();for(p=Boolean(T&&T.quickDecomp),s=s||{},m=[],h=void 0!==h&&h,c=void 0!==c?c:.01,u=void 0!==u?u:10,d=void 0!==d?d:.01,n.isArray(r[0])||(r=[r]),b=0;b<r.length;b+=1)if(x=r[b],!(g=i.isConvex(x))&&!p&&n.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),g||!p)x=g?i.clockwiseSort(x):i.hull(x),m.push({position:{x:t,y:e},vertices:x});else{var S=x.map(function(t){return[t.x,t.y]});T.makeCCW(S),!1!==c&&T.removeCollinearPoints(S,c),!1!==d&&T.removeDuplicatePoints&&T.removeDuplicatePoints(S,d);var A=T.quickDecomp(S);for(y=0;y<A.length;y++){var C=A[y].map(function(t){return{x:t[0],y:t[1]}});u>0&&i.area(C)<u||m.push({position:i.centre(C),vertices:C})}}for(y=0;y<m.length;y++)m[y]=a.create(n.extend(m[y],s));if(h)for(y=0;y<m.length;y++){var P=m[y];for(v=y+1;v<m.length;v++){var E=m[v];if(o.overlaps(P.bounds,E.bounds)){var M=P.vertices,k=E.vertices;for(_=0;_<P.vertices.length;_++)for(w=0;w<E.vertices.length;w++){var R=l.magnitudeSquared(l.sub(M[(_+1)%M.length],k[w])),B=l.magnitudeSquared(l.sub(M[_],k[(w+1)%k.length]));R<5&&B<5&&(M[_].isInternal=!0,k[w].isInternal=!0)}}}}return m.length>1?(f=a.create(n.extend({parts:m.slice(0)},s)),a.setPosition(f,{x:t,y:e}),f):m[0]}},function(t,e,r){var s={};t.exports=s;var i=r(0),n=r(8);s.create=function(t){return i.extend({bodies:[],collisions:[],pairs:null},t)},s.setBodies=function(t,e){t.bodies=e.slice(0)},s.clear=function(t){t.bodies=[],t.collisions=[]},s.collisions=function(t){var e,r,i=t.pairs,a=t.bodies,o=a.length,l=s.canCollide,h=n.collides,c=t.collisions,u=0;for(a.sort(s._compareBoundsX),e=0;e<o;e++){var d=a[e],p=d.bounds,f=d.bounds.max.x,m=d.bounds.max.y,g=d.bounds.min.y,x=d.isStatic||d.isSleeping,y=d.parts.length,v=1===y;for(r=e+1;r<o;r++){var _=a[r];if((E=_.bounds).min.x>f)break;if(!(m<E.min.y||g>E.max.y)&&(!x||!_.isStatic&&!_.isSleeping)&&l(d.collisionFilter,_.collisionFilter)){var b=_.parts.length;if(v&&1===b)(C=h(d,_,i))&&(c[u++]=C);else for(var w=b>1?1:0,T=y>1?1:0;T<y;T++)for(var S=d.parts[T],A=(p=S.bounds,w);A<b;A++){var C,P=_.parts[A],E=P.bounds;p.min.x>E.max.x||p.max.x<E.min.x||p.max.y<E.min.y||p.min.y>E.max.y||(C=h(S,P,i))&&(c[u++]=C)}}}}return c.length!==u&&(c.length=u),c},s.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},s._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},function(t,e,r){var s={};t.exports=s;var i=r(0);s.create=function(t){var e={};return t||i.log("Mouse.create: element was undefined, defaulting to document.body","warn"),e.element=t||document.body,e.absolute={x:0,y:0},e.position={x:0,y:0},e.mousedownPosition={x:0,y:0},e.mouseupPosition={x:0,y:0},e.offset={x:0,y:0},e.scale={x:1,y:1},e.wheelDelta=0,e.button=-1,e.pixelRatio=parseInt(e.element.getAttribute("data-pixel-ratio"),10)||1,e.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},e.mousemove=function(t){var r=s._getRelativeMousePosition(t,e.element,e.pixelRatio);t.changedTouches&&(e.button=0,t.preventDefault()),e.absolute.x=r.x,e.absolute.y=r.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y,e.sourceEvents.mousemove=t},e.mousedown=function(t){var r=s._getRelativeMousePosition(t,e.element,e.pixelRatio);t.changedTouches?(e.button=0,t.preventDefault()):e.button=t.button,e.absolute.x=r.x,e.absolute.y=r.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y,e.mousedownPosition.x=e.position.x,e.mousedownPosition.y=e.position.y,e.sourceEvents.mousedown=t},e.mouseup=function(t){var r=s._getRelativeMousePosition(t,e.element,e.pixelRatio);t.changedTouches&&t.preventDefault(),e.button=-1,e.absolute.x=r.x,e.absolute.y=r.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y,e.mouseupPosition.x=e.position.x,e.mouseupPosition.y=e.position.y,e.sourceEvents.mouseup=t},e.mousewheel=function(t){e.wheelDelta=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail)),t.preventDefault(),e.sourceEvents.mousewheel=t},s.setElement(e,e.element),e},s.setElement=function(t,e){t.element=e,e.addEventListener("mousemove",t.mousemove,{passive:!0}),e.addEventListener("mousedown",t.mousedown,{passive:!0}),e.addEventListener("mouseup",t.mouseup,{passive:!0}),e.addEventListener("wheel",t.mousewheel,{passive:!1}),e.addEventListener("touchmove",t.mousemove,{passive:!1}),e.addEventListener("touchstart",t.mousedown,{passive:!1}),e.addEventListener("touchend",t.mouseup,{passive:!1})},s.clearSourceEvents=function(t){t.sourceEvents.mousemove=null,t.sourceEvents.mousedown=null,t.sourceEvents.mouseup=null,t.sourceEvents.mousewheel=null,t.wheelDelta=0},s.setOffset=function(t,e){t.offset.x=e.x,t.offset.y=e.y,t.position.x=t.absolute.x*t.scale.x+t.offset.x,t.position.y=t.absolute.y*t.scale.y+t.offset.y},s.setScale=function(t,e){t.scale.x=e.x,t.scale.y=e.y,t.position.x=t.absolute.x*t.scale.x+t.offset.x,t.position.y=t.absolute.y*t.scale.y+t.offset.y},s._getRelativeMousePosition=function(t,e,r){var s,i,n=e.getBoundingClientRect(),a=document.documentElement||document.body.parentNode||document.body,o=void 0!==window.pageXOffset?window.pageXOffset:a.scrollLeft,l=void 0!==window.pageYOffset?window.pageYOffset:a.scrollTop,h=t.changedTouches;return h?(s=h[0].pageX-n.left-o,i=h[0].pageY-n.top-l):(s=t.pageX-n.left-o,i=t.pageY-n.top-l),{x:s/(e.clientWidth/(e.width||e.clientWidth)*r),y:i/(e.clientHeight/(e.height||e.clientHeight)*r)}}},function(t,e,r){var s={};t.exports=s;var i=r(0);s._registry={},s.register=function(t){if(s.isPlugin(t)||i.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],r=s.versionParse(t.version).number,n=s.versionParse(e.version).number;r>n?(i.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):r<n?i.warn("Plugin.register:",s.toString(e),"can not be downgraded to",s.toString(t)):t!==e&&i.warn("Plugin.register:",s.toString(t),"is already registered to different plugin object")}else s._registry[t.name]=t;return t},s.resolve=function(t){return s._registry[s.dependencyParse(t).name]},s.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},s.isPlugin=function(t){return t&&t.name&&t.version&&t.install},s.isUsed=function(t,e){return t.used.indexOf(e)>-1},s.isFor=function(t,e){var r=t.for&&s.dependencyParse(t.for);return!t.for||e.name===r.name&&s.versionSatisfies(e.version,r.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var r=s.dependencies(t),n=i.topologicalSort(r),a=[],o=0;o<n.length;o+=1)if(n[o]!==t.name){var l=s.resolve(n[o]);l?s.isUsed(t,l.name)||(s.isFor(l,t)||(i.warn("Plugin.use:",s.toString(l),"is for",l.for,"but installed on",s.toString(t)+"."),l._warned=!0),l.install?l.install(t):(i.warn("Plugin.use:",s.toString(l),"does not specify an install function."),l._warned=!0),l._warned?(a.push("🔶 "+s.toString(l)),delete l._warned):a.push("✅ "+s.toString(l)),t.used.push(l.name)):a.push("❌ "+n[o])}a.length>0&&i.info(a.join(" "))}else i.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var r=s.dependencyParse(t),n=r.name;if(!(n in(e=e||{}))){t=s.resolve(t)||t,e[n]=i.map(t.uses||[],function(e){s.isPlugin(e)&&s.register(e);var n=s.dependencyParse(e),a=s.resolve(e);return a&&!s.versionSatisfies(a.version,n.range)?(i.warn("Plugin.dependencies:",s.toString(a),"does not satisfy",s.toString(n),"used by",s.toString(r)+"."),a._warned=!0,t._warned=!0):a||(i.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(r),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a<e[n].length;a+=1)s.dependencies(e[n][a],e);return e}},s.dependencyParse=function(t){return i.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/.test(t)||i.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},s.versionParse=function(t){var e=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||i.warn("Plugin.versionParse:",t,"is not a valid version or range.");var r=e.exec(t),s=Number(r[4]),n=Number(r[5]),a=Number(r[6]);return{isRange:Boolean(r[1]||r[2]),version:r[3],range:t,operator:r[1]||r[2]||"",major:s,minor:n,patch:a,parts:[s,n,a],prerelease:r[7],number:1e8*s+1e4*n+a}},s.versionSatisfies=function(t,e){e=e||"*";var r=s.versionParse(e),i=s.versionParse(t);if(r.isRange){if("*"===r.operator||"*"===t)return!0;if(">"===r.operator)return i.number>r.number;if(">="===r.operator)return i.number>=r.number;if("~"===r.operator)return i.major===r.major&&i.minor===r.minor&&i.patch>=r.patch;if("^"===r.operator)return r.major>0?i.major===r.major&&i.number>=r.number:r.minor>0?i.minor===r.minor&&i.patch>=r.patch:i.patch===r.patch}return t===e||"*"===t}},function(t,e){var r={};t.exports=r,r.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},function(t,e,r){var s={};t.exports=s;var i=r(7),n=r(18),a=r(13),o=r(19),l=r(5),h=r(6),c=r(10),u=r(0),d=r(4);s._deltaMax=1e3/60,s.create=function(t){t=t||{};var e=u.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||h.create({label:"World"}),e.pairs=t.pairs||o.create(),e.detector=t.detector||a.create(),e.detector.pairs=e.pairs,e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},s.update=function(t,e){var r,d=u.now(),p=t.world,f=t.detector,m=t.pairs,g=t.timing,x=g.timestamp;e>s._deltaMax&&u.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",s._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:u._baseDelta,e*=g.timeScale,g.timestamp+=e,g.lastDelta=e;var y={timestamp:g.timestamp,delta:e};l.trigger(t,"beforeUpdate",y);var v=h.allBodies(p),_=h.allConstraints(p);for(p.isModified&&(a.setBodies(f,v),h.setModified(p,!1,!1,!0)),t.enableSleeping&&i.update(v,e),s._bodiesApplyGravity(v,t.gravity),e>0&&s._bodiesUpdate(v,e),l.trigger(t,"beforeSolve",y),c.preSolveAll(v),r=0;r<t.constraintIterations;r++)c.solveAll(_,e);c.postSolveAll(v);var b=a.collisions(f);o.update(m,b,x),t.enableSleeping&&i.afterCollisions(m.list),m.collisionStart.length>0&&l.trigger(t,"collisionStart",{pairs:m.collisionStart,timestamp:g.timestamp,delta:e});var w=u.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(m.list),r=0;r<t.positionIterations;r++)n.solvePosition(m.list,e,w);for(n.postSolvePosition(v),c.preSolveAll(v),r=0;r<t.constraintIterations;r++)c.solveAll(_,e);for(c.postSolveAll(v),n.preSolveVelocity(m.list),r=0;r<t.velocityIterations;r++)n.solveVelocity(m.list,e);return s._bodiesUpdateVelocities(v),m.collisionActive.length>0&&l.trigger(t,"collisionActive",{pairs:m.collisionActive,timestamp:g.timestamp,delta:e}),m.collisionEnd.length>0&&l.trigger(t,"collisionEnd",{pairs:m.collisionEnd,timestamp:g.timestamp,delta:e}),s._bodiesClearForces(v),l.trigger(t,"afterUpdate",y),t.timing.lastElapsed=u.now()-d,t},s.merge=function(t,e){if(u.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var r=h.allBodies(t.world),n=0;n<r.length;n++){var a=r[n];i.set(a,!1),a.id=u.nextId()}}},s.clear=function(t){o.clear(t.pairs),a.clear(t.detector)},s._bodiesClearForces=function(t){for(var e=t.length,r=0;r<e;r++){var s=t[r];s.force.x=0,s.force.y=0,s.torque=0}},s._bodiesApplyGravity=function(t,e){var r=void 0!==e.scale?e.scale:.001,s=t.length;if((0!==e.x||0!==e.y)&&0!==r)for(var i=0;i<s;i++){var n=t[i];n.isStatic||n.isSleeping||(n.force.y+=n.mass*e.y*r,n.force.x+=n.mass*e.x*r)}},s._bodiesUpdate=function(t,e){for(var r=t.length,s=0;s<r;s++){var i=t[s];i.isStatic||i.isSleeping||d.update(i,e)}},s._bodiesUpdateVelocities=function(t){for(var e=t.length,r=0;r<e;r++)d.updateVelocities(t[r])}},function(t,e,r){var s={};t.exports=s;var i=r(3),n=r(0),a=r(1);s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(t){var e,r,s,i=t.length;for(e=0;e<i;e++)(r=t[e]).isActive&&(s=r.contactCount,r.collision.parentA.totalContacts+=s,r.collision.parentB.totalContacts+=s)},s.solvePosition=function(t,e,r){var i,a,o,l,h,c,u,d,p=s._positionDampen*(r||1),f=n.clamp(e/n._baseDelta,0,1),m=t.length;for(i=0;i<m;i++)(a=t[i]).isActive&&!a.isSensor&&(l=(o=a.collision).parentA,h=o.parentB,c=o.normal,a.separation=o.depth+c.x*(h.positionImpulse.x-l.positionImpulse.x)+c.y*(h.positionImpulse.y-l.positionImpulse.y));for(i=0;i<m;i++)(a=t[i]).isActive&&!a.isSensor&&(l=(o=a.collision).parentA,h=o.parentB,c=o.normal,d=a.separation-a.slop*f,(l.isStatic||h.isStatic)&&(d*=2),l.isStatic||l.isSleeping||(u=p/l.totalContacts,l.positionImpulse.x+=c.x*d*u,l.positionImpulse.y+=c.y*d*u),h.isStatic||h.isSleeping||(u=p/h.totalContacts,h.positionImpulse.x-=c.x*d*u,h.positionImpulse.y-=c.y*d*u))},s.postSolvePosition=function(t){for(var e=s._positionWarming,r=t.length,n=i.translate,o=a.update,l=0;l<r;l++){var h=t[l],c=h.positionImpulse,u=c.x,d=c.y,p=h.velocity;if(h.totalContacts=0,0!==u||0!==d){for(var f=0;f<h.parts.length;f++){var m=h.parts[f];n(m.vertices,c),o(m.bounds,m.vertices,p),m.position.x+=u,m.position.y+=d}h.positionPrev.x+=u,h.positionPrev.y+=d,u*p.x+d*p.y<0?(c.x=0,c.y=0):(c.x*=e,c.y*=e)}}},s.preSolveVelocity=function(t){var e,r,s=t.length;for(e=0;e<s;e++){var i=t[e];if(i.isActive&&!i.isSensor){var n=i.contacts,a=i.contactCount,o=i.collision,l=o.parentA,h=o.parentB,c=o.normal,u=o.tangent;for(r=0;r<a;r++){var d=n[r],p=d.vertex,f=d.normalImpulse,m=d.tangentImpulse;if(0!==f||0!==m){var g=c.x*f+u.x*m,x=c.y*f+u.y*m;l.isStatic||l.isSleeping||(l.positionPrev.x+=g*l.inverseMass,l.positionPrev.y+=x*l.inverseMass,l.anglePrev+=l.inverseInertia*((p.x-l.position.x)*x-(p.y-l.position.y)*g)),h.isStatic||h.isSleeping||(h.positionPrev.x-=g*h.inverseMass,h.positionPrev.y-=x*h.inverseMass,h.anglePrev-=h.inverseInertia*((p.x-h.position.x)*x-(p.y-h.position.y)*g))}}}}},s.solveVelocity=function(t,e){var r,i,a,o,l=e/n._baseDelta,h=l*l*l,c=-s._restingThresh*l,u=s._restingThreshTangent,d=s._frictionNormalMultiplier*l,p=s._frictionMaxStatic,f=t.length;for(a=0;a<f;a++){var m=t[a];if(m.isActive&&!m.isSensor){var g=m.collision,x=g.parentA,y=g.parentB,v=g.normal.x,_=g.normal.y,b=g.tangent.x,w=g.tangent.y,T=m.inverseMass,S=m.friction*m.frictionStatic*d,A=m.contacts,C=m.contactCount,P=1/C,E=x.position.x-x.positionPrev.x,M=x.position.y-x.positionPrev.y,k=x.angle-x.anglePrev,R=y.position.x-y.positionPrev.x,B=y.position.y-y.positionPrev.y,I=y.angle-y.anglePrev;for(o=0;o<C;o++){var F=A[o],O=F.vertex,G=O.x-x.position.x,D=O.y-x.position.y,U=O.x-y.position.x,L=O.y-y.position.y,N=E-D*k-(R-L*I),X=M+G*k-(B+U*I),V=v*N+_*X,Y=b*N+w*X,z=m.separation+V,W=Math.min(z,1),H=(W=z<0?0:W)*S;Y<-H||Y>H?(i=Y>0?Y:-Y,(r=m.friction*(Y>0?1:-1)*h)<-i?r=-i:r>i&&(r=i)):(r=Y,i=p);var j=G*_-D*v,q=U*_-L*v,$=P/(T+x.inverseInertia*j*j+y.inverseInertia*q*q),K=(1+m.restitution)*V*$;if(r*=$,V<c)F.normalImpulse=0;else{var Q=F.normalImpulse;F.normalImpulse+=K,F.normalImpulse>0&&(F.normalImpulse=0),K=F.normalImpulse-Q}if(Y<-u||Y>u)F.tangentImpulse=0;else{var Z=F.tangentImpulse;F.tangentImpulse+=r,F.tangentImpulse<-i&&(F.tangentImpulse=-i),F.tangentImpulse>i&&(F.tangentImpulse=i),r=F.tangentImpulse-Z}var J=v*K+b*r,tt=_*K+w*r;x.isStatic||x.isSleeping||(x.positionPrev.x+=J*x.inverseMass,x.positionPrev.y+=tt*x.inverseMass,x.anglePrev+=(G*tt-D*J)*x.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=J*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(U*tt-L*J)*y.inverseInertia)}}}}},function(t,e,r){var s={};t.exports=s;var i=r(9),n=r(0);s.create=function(t){return n.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,r){var s,n,a,o=i.update,l=i.create,h=i.setActive,c=t.table,u=t.list,d=u.length,p=d,f=t.collisionStart,m=t.collisionEnd,g=t.collisionActive,x=e.length,y=0,v=0,_=0;for(a=0;a<x;a++)(n=(s=e[a]).pair)?(n.isActive&&(g[_++]=n),o(n,s,r)):(c[(n=l(s,r)).id]=n,f[y++]=n,u[p++]=n);for(p=0,d=u.length,a=0;a<d;a++)(n=u[a]).timeUpdated>=r?u[p++]=n:(h(n,!1,r),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?u[p++]=n:(m[v++]=n,delete c[n.id]));u.length!==p&&(u.length=p),f.length!==y&&(f.length=y),m.length!==v&&(m.length=v),g.length!==_&&(g.length=_)},s.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,r){var s=t.exports=r(21);s.Axes=r(11),s.Bodies=r(12),s.Body=r(4),s.Bounds=r(1),s.Collision=r(8),s.Common=r(0),s.Composite=r(6),s.Composites=r(22),s.Constraint=r(10),s.Contact=r(16),s.Detector=r(13),s.Engine=r(17),s.Events=r(5),s.Grid=r(23),s.Mouse=r(14),s.MouseConstraint=r(24),s.Pair=r(9),s.Pairs=r(19),s.Plugin=r(15),s.Query=r(25),s.Render=r(26),s.Resolver=r(18),s.Runner=r(27),s.SAT=r(28),s.Sleeping=r(7),s.Svg=r(29),s.Vector=r(2),s.Vertices=r(3),s.World=r(30),s.Engine.run=s.Runner.run,s.Common.deprecated(s.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")},function(t,e,r){var s={};t.exports=s;var i=r(15),n=r(0);s.name="matter-js",s.version="0.20.0",s.uses=[],s.used=[],s.use=function(){i.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),n.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),n.chainPathAfter(s,t,e)}},function(t,e,r){var s={};t.exports=s;var i=r(6),n=r(10),a=r(0),o=r(4),l=r(12),h=a.deprecated;s.stack=function(t,e,r,s,n,a,l){for(var h,c=i.create({label:"Stack"}),u=t,d=e,p=0,f=0;f<s;f++){for(var m=0,g=0;g<r;g++){var x=l(u,d,g,f,h,p);if(x){var y=x.bounds.max.y-x.bounds.min.y,v=x.bounds.max.x-x.bounds.min.x;y>m&&(m=y),o.translate(x,{x:.5*v,y:.5*y}),u=x.bounds.max.x+n,i.addBody(c,x),h=x,p+=1}else u+=n}d+=m+a,u=t}return c},s.chain=function(t,e,r,s,o,l){for(var h=t.bodies,c=1;c<h.length;c++){var u=h[c-1],d=h[c],p=u.bounds.max.y-u.bounds.min.y,f=u.bounds.max.x-u.bounds.min.x,m=d.bounds.max.y-d.bounds.min.y,g={bodyA:u,pointA:{x:f*e,y:p*r},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*s,y:m*o}},x=a.extend(g,l);i.addConstraint(t,n.create(x))}return t.label+=" Chain",t},s.mesh=function(t,e,r,s,o){var l,h,c,u,d,p=t.bodies;for(l=0;l<r;l++){for(h=1;h<e;h++)c=p[h-1+l*e],u=p[h+l*e],i.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:u},o)));if(l>0)for(h=0;h<e;h++)c=p[h+(l-1)*e],u=p[h+l*e],i.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:u},o))),s&&h>0&&(d=p[h-1+(l-1)*e],i.addConstraint(t,n.create(a.extend({bodyA:d,bodyB:u},o)))),s&&h<e-1&&(d=p[h+1+(l-1)*e],i.addConstraint(t,n.create(a.extend({bodyA:d,bodyB:u},o))))}return t.label+=" Mesh",t},s.pyramid=function(t,e,r,i,n,a,l){return s.stack(t,e,r,i,n,a,function(e,s,a,h,c,u){var d=Math.min(i,Math.ceil(r/2)),p=c?c.bounds.max.x-c.bounds.min.x:0;if(!(h>d||a<(h=d-h)||a>r-1-h))return 1===u&&o.translate(c,{x:(a+(r%2==1?1:-1))*p,y:0}),l(t+(c?a*p:0)+a*n,s,a,h,c,u)})},s.newtonsCradle=function(t,e,r,s,a){for(var o=i.create({label:"Newtons Cradle"}),h=0;h<r;h++){var c=l.circle(t+h*(1.9*s),e+a,s,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),u=n.create({pointA:{x:t+h*(1.9*s),y:e},bodyB:c});i.addBody(o,c),i.addConstraint(o,u)}return o},h(s,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),s.car=function(t,e,r,s,a){var h=o.nextGroup(!0),c=.5*-r+20,u=.5*r-20,d=i.create({label:"Car"}),p=l.rectangle(t,e,r,s,{collisionFilter:{group:h},chamfer:{radius:.5*s},density:2e-4}),f=l.circle(t+c,e+0,a,{collisionFilter:{group:h},friction:.8}),m=l.circle(t+u,e+0,a,{collisionFilter:{group:h},friction:.8}),g=n.create({bodyB:p,pointB:{x:c,y:0},bodyA:f,stiffness:1,length:0}),x=n.create({bodyB:p,pointB:{x:u,y:0},bodyA:m,stiffness:1,length:0});return i.addBody(d,p),i.addBody(d,f),i.addBody(d,m),i.addConstraint(d,g),i.addConstraint(d,x),d},h(s,"car","Composites.car ➤ moved to car example"),s.softBody=function(t,e,r,i,n,o,h,c,u,d){u=a.extend({inertia:1/0},u),d=a.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var p=s.stack(t,e,r,i,n,o,function(t,e){return l.circle(t,e,c,u)});return s.mesh(p,r,i,h,d),p.label="Soft Body",p},h(s,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")},function(t,e,r){var s={};t.exports=s;var i=r(9),n=r(0),a=n.deprecated;s.create=function(t){return n.extend({buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48},t)},s.update=function(t,e,r,i){var n,a,o,l,h,c=r.world,u=t.buckets,d=!1;for(n=0;n<e.length;n++){var p=e[n];if((!p.isSleeping||i)&&(!c.bounds||!(p.bounds.max.x<c.bounds.min.x||p.bounds.min.x>c.bounds.max.x||p.bounds.max.y<c.bounds.min.y||p.bounds.min.y>c.bounds.max.y))){var f=s._getRegion(t,p);if(!p.region||f.id!==p.region.id||i){p.region&&!i||(p.region=f);var m=s._regionUnion(f,p.region);for(a=m.startCol;a<=m.endCol;a++)for(o=m.startRow;o<=m.endRow;o++){l=u[h=s._getBucketId(a,o)];var g=a>=f.startCol&&a<=f.endCol&&o>=f.startRow&&o<=f.endRow,x=a>=p.region.startCol&&a<=p.region.endCol&&o>=p.region.startRow&&o<=p.region.endRow;!g&&x&&x&&l&&s._bucketRemoveBody(t,l,p),(p.region===f||g&&!x||i)&&(l||(l=s._createBucket(u,h)),s._bucketAddBody(t,l,p))}p.region=f,d=!0}}}d&&(t.pairsList=s._createActivePairsList(t))},a(s,"update","Grid.update ➤ replaced by Matter.Detector"),s.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},a(s,"clear","Grid.clear ➤ replaced by Matter.Detector"),s._regionUnion=function(t,e){var r=Math.min(t.startCol,e.startCol),i=Math.max(t.endCol,e.endCol),n=Math.min(t.startRow,e.startRow),a=Math.max(t.endRow,e.endRow);return s._createRegion(r,i,n,a)},s._getRegion=function(t,e){var r=e.bounds,i=Math.floor(r.min.x/t.bucketWidth),n=Math.floor(r.max.x/t.bucketWidth),a=Math.floor(r.min.y/t.bucketHeight),o=Math.floor(r.max.y/t.bucketHeight);return s._createRegion(i,n,a,o)},s._createRegion=function(t,e,r,s){return{id:t+","+e+","+r+","+s,startCol:t,endCol:e,startRow:r,endRow:s}},s._getBucketId=function(t,e){return"C"+t+"R"+e},s._createBucket=function(t,e){return t[e]=[]},s._bucketAddBody=function(t,e,r){var s,n=t.pairs,a=i.id,o=e.length;for(s=0;s<o;s++){var l=e[s];if(!(r.id===l.id||r.isStatic&&l.isStatic)){var h=a(r,l),c=n[h];c?c[2]+=1:n[h]=[r,l,1]}}e.push(r)},s._bucketRemoveBody=function(t,e,r){var s,a=t.pairs,o=i.id;e.splice(n.indexOf(e,r),1);var l=e.length;for(s=0;s<l;s++){var h=a[o(r,e[s])];h&&(h[2]-=1)}},s._createActivePairsList=function(t){var e,r,s=t.pairs,i=n.keys(s),a=i.length,o=[];for(r=0;r<a;r++)(e=s[i[r]])[2]>0?o.push(e):delete s[i[r]];return o}},function(t,e,r){var s={};t.exports=s;var i=r(3),n=r(7),a=r(14),o=r(5),l=r(13),h=r(10),c=r(6),u=r(0),d=r(1);s.create=function(t,e){var r=(t?t.mouse:null)||(e?e.mouse:null);r||(t&&t.render&&t.render.canvas?r=a.create(t.render.canvas):e&&e.element?r=a.create(e.element):(r=a.create(),u.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var i={type:"mouseConstraint",mouse:r,element:null,body:null,constraint:h.create({label:"Mouse Constraint",pointA:r.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),collisionFilter:{category:1,mask:4294967295,group:0}},n=u.extend(i,e);return o.on(t,"beforeUpdate",function(){var e=c.allBodies(t.world);s.update(n,e),s._triggerEvents(n)}),n},s.update=function(t,e){var r=t.mouse,s=t.constraint,a=t.body;if(0===r.button){if(s.bodyB)n.set(s.bodyB,!1),s.pointA=r.position;else for(var h=0;h<e.length;h++)if(a=e[h],d.contains(a.bounds,r.position)&&l.canCollide(a.collisionFilter,t.collisionFilter))for(var c=a.parts.length>1?1:0;c<a.parts.length;c++){var u=a.parts[c];if(i.contains(u.vertices,r.position)){s.pointA=r.position,s.bodyB=t.body=a,s.pointB={x:r.position.x-a.position.x,y:r.position.y-a.position.y},s.angleB=a.angle,n.set(a,!1),o.trigger(t,"startdrag",{mouse:r,body:a});break}}}else s.bodyB=t.body=null,s.pointB=null,a&&o.trigger(t,"enddrag",{mouse:r,body:a})},s._triggerEvents=function(t){var e=t.mouse,r=e.sourceEvents;r.mousemove&&o.trigger(t,"mousemove",{mouse:e}),r.mousedown&&o.trigger(t,"mousedown",{mouse:e}),r.mouseup&&o.trigger(t,"mouseup",{mouse:e}),a.clearSourceEvents(e)}},function(t,e,r){var s={};t.exports=s;var i=r(2),n=r(8),a=r(1),o=r(12),l=r(3);s.collides=function(t,e){for(var r=[],s=e.length,i=t.bounds,o=n.collides,l=a.overlaps,h=0;h<s;h++){var c=e[h],u=c.parts.length,d=1===u?0:1;if(l(c.bounds,i))for(var p=d;p<u;p++){var f=c.parts[p];if(l(f.bounds,i)){var m=o(f,t);if(m){r.push(m);break}}}}return r},s.ray=function(t,e,r,n){n=n||1e-100;for(var a=i.angle(e,r),l=i.magnitude(i.sub(e,r)),h=.5*(r.x+e.x),c=.5*(r.y+e.y),u=o.rectangle(h,c,l,n,{angle:a}),d=s.collides(u,t),p=0;p<d.length;p+=1){var f=d[p];f.body=f.bodyB=f.bodyA}return d},s.region=function(t,e,r){for(var s=[],i=0;i<t.length;i++){var n=t[i],o=a.overlaps(n.bounds,e);(o&&!r||!o&&r)&&s.push(n)}return s},s.point=function(t,e){for(var r=[],s=0;s<t.length;s++){var i=t[s];if(a.contains(i.bounds,e))for(var n=1===i.parts.length?0:1;n<i.parts.length;n++){var o=i.parts[n];if(a.contains(o.bounds,e)&&l.contains(o.vertices,e)){r.push(i);break}}}return r}},function(t,e,r){var s={};t.exports=s;var i=r(4),n=r(0),a=r(6),o=r(1),l=r(5),h=r(2),c=r(14);!function(){var t,e;"undefined"!=typeof window&&(t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(function(){t(n.now())},1e3/60)},e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),s._goodFps=30,s._goodDelta=1e3/60,s.create=function(t){var e={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],engineUpdatesHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",wireframeStrokeStyle:"#bbb",hasBounds:!!t.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},r=n.extend(e,t);return r.canvas&&(r.canvas.width=r.options.width||r.canvas.width,r.canvas.height=r.options.height||r.canvas.height),r.mouse=t.mouse,r.engine=t.engine,r.canvas=r.canvas||d(r.options.width,r.options.height),r.context=r.canvas.getContext("2d"),r.textures={},r.bounds=r.bounds||{min:{x:0,y:0},max:{x:r.canvas.width,y:r.canvas.height}},r.controller=s,r.options.showBroadphase=!1,1!==r.options.pixelRatio&&s.setPixelRatio(r,r.options.pixelRatio),n.isElement(r.element)&&r.element.appendChild(r.canvas),r},s.run=function(e){!function i(n){e.frameRequestId=t(i),r(e,n),s.world(e,n),e.context.setTransform(e.options.pixelRatio,0,0,e.options.pixelRatio,0,0),(e.options.showStats||e.options.showDebug)&&s.stats(e,e.context,n),(e.options.showPerformance||e.options.showDebug)&&s.performance(e,e.context,n),e.context.setTransform(1,0,0,1,0,0)}()},s.stop=function(t){e(t.frameRequestId)},s.setPixelRatio=function(t,e){var r=t.options,s=t.canvas;"auto"===e&&(e=p(s)),r.pixelRatio=e,s.setAttribute("data-pixel-ratio",e),s.width=r.width*e,s.height=r.height*e,s.style.width=r.width+"px",s.style.height=r.height+"px"},s.setSize=function(t,e,r){t.options.width=e,t.options.height=r,t.bounds.max.x=t.bounds.min.x+e,t.bounds.max.y=t.bounds.min.y+r,1!==t.options.pixelRatio?s.setPixelRatio(t,t.options.pixelRatio):(t.canvas.width=e,t.canvas.height=r)},s.lookAt=function(t,e,r,s){s=void 0===s||s,e=n.isArray(e)?e:[e],r=r||{x:0,y:0};for(var i={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},a=0;a<e.length;a+=1){var o=e[a],l=o.bounds?o.bounds.min:o.min||o.position||o,h=o.bounds?o.bounds.max:o.max||o.position||o;l&&h&&(l.x<i.min.x&&(i.min.x=l.x),h.x>i.max.x&&(i.max.x=h.x),l.y<i.min.y&&(i.min.y=l.y),h.y>i.max.y&&(i.max.y=h.y))}var u=i.max.x-i.min.x+2*r.x,d=i.max.y-i.min.y+2*r.y,p=t.canvas.height,f=t.canvas.width/p,m=u/d,g=1,x=1;m>f?x=m/f:g=f/m,t.options.hasBounds=!0,t.bounds.min.x=i.min.x,t.bounds.max.x=i.min.x+u*g,t.bounds.min.y=i.min.y,t.bounds.max.y=i.min.y+d*x,s&&(t.bounds.min.x+=.5*u-u*g*.5,t.bounds.max.x+=.5*u-u*g*.5,t.bounds.min.y+=.5*d-d*x*.5,t.bounds.max.y+=.5*d-d*x*.5),t.bounds.min.x-=r.x,t.bounds.max.x-=r.x,t.bounds.min.y-=r.y,t.bounds.max.y-=r.y,t.mouse&&(c.setScale(t.mouse,{x:(t.bounds.max.x-t.bounds.min.x)/t.canvas.width,y:(t.bounds.max.y-t.bounds.min.y)/t.canvas.height}),c.setOffset(t.mouse,t.bounds.min))},s.startViewTransform=function(t){var e=t.bounds.max.x-t.bounds.min.x,r=t.bounds.max.y-t.bounds.min.y,s=e/t.options.width,i=r/t.options.height;t.context.setTransform(t.options.pixelRatio/s,0,0,t.options.pixelRatio/i,0,0),t.context.translate(-t.bounds.min.x,-t.bounds.min.y)},s.endViewTransform=function(t){t.context.setTransform(t.options.pixelRatio,0,0,t.options.pixelRatio,0,0)},s.world=function(t,e){var r,i=n.now(),u=t.engine,d=u.world,p=t.canvas,f=t.context,g=t.options,x=t.timing,y=a.allBodies(d),v=a.allConstraints(d),_=g.wireframes?g.wireframeBackground:g.background,b=[],w=[],T={timestamp:u.timing.timestamp};if(l.trigger(t,"beforeRender",T),t.currentBackground!==_&&m(t,_),f.globalCompositeOperation="source-in",f.fillStyle="transparent",f.fillRect(0,0,p.width,p.height),f.globalCompositeOperation="source-over",g.hasBounds){for(r=0;r<y.length;r++){var S=y[r];o.overlaps(S.bounds,t.bounds)&&b.push(S)}for(r=0;r<v.length;r++){var A=v[r],C=A.bodyA,P=A.bodyB,E=A.pointA,M=A.pointB;C&&(E=h.add(C.position,A.pointA)),P&&(M=h.add(P.position,A.pointB)),E&&M&&(o.contains(t.bounds,E)||o.contains(t.bounds,M))&&w.push(A)}s.startViewTransform(t),t.mouse&&(c.setScale(t.mouse,{x:(t.bounds.max.x-t.bounds.min.x)/t.options.width,y:(t.bounds.max.y-t.bounds.min.y)/t.options.height}),c.setOffset(t.mouse,t.bounds.min))}else w=v,b=y,1!==t.options.pixelRatio&&t.context.setTransform(t.options.pixelRatio,0,0,t.options.pixelRatio,0,0);!g.wireframes||u.enableSleeping&&g.showSleeping?s.bodies(t,b,f):(g.showConvexHulls&&s.bodyConvexHulls(t,b,f),s.bodyWireframes(t,b,f)),g.showBounds&&s.bodyBounds(t,b,f),(g.showAxes||g.showAngleIndicator)&&s.bodyAxes(t,b,f),g.showPositions&&s.bodyPositions(t,b,f),g.showVelocity&&s.bodyVelocity(t,b,f),g.showIds&&s.bodyIds(t,b,f),g.showSeparations&&s.separations(t,u.pairs.list,f),g.showCollisions&&s.collisions(t,u.pairs.list,f),g.showVertexNumbers&&s.vertexNumbers(t,b,f),g.showMousePosition&&s.mousePosition(t,t.mouse,f),s.constraints(w,f),g.hasBounds&&s.endViewTransform(t),l.trigger(t,"afterRender",T),x.lastElapsed=n.now()-i},s.stats=function(t,e,r){for(var s=t.engine,i=s.world,n=a.allBodies(i),o=0,l=0,h=0;h<n.length;h+=1)o+=n[h].parts.length;var c={Part:o,Body:n.length,Cons:a.allConstraints(i).length,Comp:a.allComposites(i).length,Pair:s.pairs.list.length};for(var u in e.fillStyle="#0e0f19",e.fillRect(l,0,302.5,44),e.font="12px Arial",e.textBaseline="top",e.textAlign="right",c){var d=c[u];e.fillStyle="#aaa",e.fillText(u,l+55,8),e.fillStyle="#eee",e.fillText(d,l+55,26),l+=55}},s.performance=function(t,e){var r=t.engine,i=t.timing,a=i.deltaHistory,o=i.elapsedHistory,l=i.timestampElapsedHistory,h=i.engineDeltaHistory,c=i.engineUpdatesHistory,d=i.engineElapsedHistory,p=r.timing.lastUpdatesPerFrame,f=r.timing.lastDelta,m=u(a),g=u(o),x=u(h),y=u(c),v=u(d),_=u(l)/m||0,b=Math.round(m/f),w=1e3/m||0,T=60,S=69;e.fillStyle="#0e0f19",e.fillRect(0,50,442,34),s.status(e,10,S,T,4,a.length,Math.round(w)+" fps",w/s._goodFps,function(t){return a[t]/m-1}),s.status(e,82,S,T,4,h.length,f.toFixed(2)+" dt",s._goodDelta/f,function(t){return h[t]/x-1}),s.status(e,154,S,T,4,c.length,p+" upf",Math.pow(n.clamp(y/b||1,0,1),4),function(t){return c[t]/y-1}),s.status(e,226,S,T,4,d.length,v.toFixed(2)+" ut",1-p*v/s._goodFps,function(t){return d[t]/v-1}),s.status(e,298,S,T,4,o.length,g.toFixed(2)+" rt",1-g/s._goodFps,function(t){return o[t]/g-1}),s.status(e,370,S,T,4,l.length,_.toFixed(2)+" x",_*_*_,function(t){return(l[t]/a[t]/_||0)-1})},s.status=function(t,e,r,s,i,a,o,l,h){t.strokeStyle="#888",t.fillStyle="#444",t.lineWidth=1,t.fillRect(e,r+7,s,1),t.beginPath(),t.moveTo(e,r+7-i*n.clamp(.4*h(0),-2,2));for(var c=0;c<s;c+=1)t.lineTo(e+c,r+7-(c<a?i*n.clamp(.4*h(c),-2,2):0));t.stroke(),t.fillStyle="hsl("+n.clamp(25+95*l,0,120)+",100%,60%)",t.fillRect(e,r-7,4,4),t.font="12px Arial",t.textBaseline="middle",t.textAlign="right",t.fillStyle="#eee",t.fillText(o,e+s,r-5)},s.constraints=function(t,e){for(var r=e,s=0;s<t.length;s++){var i=t[s];if(i.render.visible&&i.pointA&&i.pointB){var a,o,l=i.bodyA,c=i.bodyB;if(a=l?h.add(l.position,i.pointA):i.pointA,"pin"===i.render.type)r.beginPath(),r.arc(a.x,a.y,3,0,2*Math.PI),r.closePath();else{if(o=c?h.add(c.position,i.pointB):i.pointB,r.beginPath(),r.moveTo(a.x,a.y),"spring"===i.render.type)for(var u,d=h.sub(o,a),p=h.perp(h.normalise(d)),f=Math.ceil(n.clamp(i.length/5,12,20)),m=1;m<f;m+=1)u=m%2==0?1:-1,r.lineTo(a.x+d.x*(m/f)+p.x*u*4,a.y+d.y*(m/f)+p.y*u*4);r.lineTo(o.x,o.y)}i.render.lineWidth&&(r.lineWidth=i.render.lineWidth,r.strokeStyle=i.render.strokeStyle,r.stroke()),i.render.anchors&&(r.fillStyle=i.render.strokeStyle,r.beginPath(),r.arc(a.x,a.y,3,0,2*Math.PI),r.arc(o.x,o.y,3,0,2*Math.PI),r.closePath(),r.fill())}}},s.bodies=function(t,e,r){var s,i,n,a,o=r,l=(t.engine,t.options),h=l.showInternalEdges||!l.wireframes;for(n=0;n<e.length;n++)if((s=e[n]).render.visible)for(a=s.parts.length>1?1:0;a<s.parts.length;a++)if((i=s.parts[a]).render.visible){if(l.showSleeping&&s.isSleeping?o.globalAlpha=.5*i.render.opacity:1!==i.render.opacity&&(o.globalAlpha=i.render.opacity),i.render.sprite&&i.render.sprite.texture&&!l.wireframes){var c=i.render.sprite,u=f(t,c.texture);o.translate(i.position.x,i.position.y),o.rotate(i.angle),o.drawImage(u,u.width*-c.xOffset*c.xScale,u.height*-c.yOffset*c.yScale,u.width*c.xScale,u.height*c.yScale),o.rotate(-i.angle),o.translate(-i.position.x,-i.position.y)}else{if(i.circleRadius)o.beginPath(),o.arc(i.position.x,i.position.y,i.circleRadius,0,2*Math.PI);else{o.beginPath(),o.moveTo(i.vertices[0].x,i.vertices[0].y);for(var d=1;d<i.vertices.length;d++)!i.vertices[d-1].isInternal||h?o.lineTo(i.vertices[d].x,i.vertices[d].y):o.moveTo(i.vertices[d].x,i.vertices[d].y),i.vertices[d].isInternal&&!h&&o.moveTo(i.vertices[(d+1)%i.vertices.length].x,i.vertices[(d+1)%i.vertices.length].y);o.lineTo(i.vertices[0].x,i.vertices[0].y),o.closePath()}l.wireframes?(o.lineWidth=1,o.strokeStyle=t.options.wireframeStrokeStyle,o.stroke()):(o.fillStyle=i.render.fillStyle,i.render.lineWidth&&(o.lineWidth=i.render.lineWidth,o.strokeStyle=i.render.strokeStyle,o.stroke()),o.fill())}o.globalAlpha=1}},s.bodyWireframes=function(t,e,r){var s,i,n,a,o,l=r,h=t.options.showInternalEdges;for(l.beginPath(),n=0;n<e.length;n++)if((s=e[n]).render.visible)for(o=s.parts.length>1?1:0;o<s.parts.length;o++){for(i=s.parts[o],l.moveTo(i.vertices[0].x,i.vertices[0].y),a=1;a<i.vertices.length;a++)!i.vertices[a-1].isInternal||h?l.lineTo(i.vertices[a].x,i.vertices[a].y):l.moveTo(i.vertices[a].x,i.vertices[a].y),i.vertices[a].isInternal&&!h&&l.moveTo(i.vertices[(a+1)%i.vertices.length].x,i.vertices[(a+1)%i.vertices.length].y);l.lineTo(i.vertices[0].x,i.vertices[0].y)}l.lineWidth=1,l.strokeStyle=t.options.wireframeStrokeStyle,l.stroke()},s.bodyConvexHulls=function(t,e,r){var s,i,n,a=r;for(a.beginPath(),i=0;i<e.length;i++)if((s=e[i]).render.visible&&1!==s.parts.length){for(a.moveTo(s.vertices[0].x,s.vertices[0].y),n=1;n<s.vertices.length;n++)a.lineTo(s.vertices[n].x,s.vertices[n].y);a.lineTo(s.vertices[0].x,s.vertices[0].y)}a.lineWidth=1,a.strokeStyle="rgba(255,255,255,0.2)",a.stroke()},s.vertexNumbers=function(t,e,r){var s,i,n,a=r;for(s=0;s<e.length;s++){var o=e[s].parts;for(n=o.length>1?1:0;n<o.length;n++){var l=o[n];for(i=0;i<l.vertices.length;i++)a.fillStyle="rgba(255,255,255,0.2)",a.fillText(s+"_"+i,l.position.x+.8*(l.vertices[i].x-l.position.x),l.position.y+.8*(l.vertices[i].y-l.position.y))}}},s.mousePosition=function(t,e,r){var s=r;s.fillStyle="rgba(255,255,255,0.8)",s.fillText(e.position.x+" "+e.position.y,e.position.x+5,e.position.y-5)},s.bodyBounds=function(t,e,r){var s=r,i=(t.engine,t.options);s.beginPath();for(var n=0;n<e.length;n++)if(e[n].render.visible)for(var a=e[n].parts,o=a.length>1?1:0;o<a.length;o++){var l=a[o];s.rect(l.bounds.min.x,l.bounds.min.y,l.bounds.max.x-l.bounds.min.x,l.bounds.max.y-l.bounds.min.y)}i.wireframes?s.strokeStyle="rgba(255,255,255,0.08)":s.strokeStyle="rgba(0,0,0,0.1)",s.lineWidth=1,s.stroke()},s.bodyAxes=function(t,e,r){var s,i,n,a,o=r,l=(t.engine,t.options);for(o.beginPath(),i=0;i<e.length;i++){var h=e[i],c=h.parts;if(h.render.visible)if(l.showAxes)for(n=c.length>1?1:0;n<c.length;n++)for(s=c[n],a=0;a<s.axes.length;a++){var u=s.axes[a];o.moveTo(s.position.x,s.position.y),o.lineTo(s.position.x+20*u.x,s.position.y+20*u.y)}else for(n=c.length>1?1:0;n<c.length;n++)for(s=c[n],a=0;a<s.axes.length;a++)o.moveTo(s.position.x,s.position.y),o.lineTo((s.vertices[0].x+s.vertices[s.vertices.length-1].x)/2,(s.vertices[0].y+s.vertices[s.vertices.length-1].y)/2)}l.wireframes?(o.strokeStyle="indianred",o.lineWidth=1):(o.strokeStyle="rgba(255, 255, 255, 0.4)",o.globalCompositeOperation="overlay",o.lineWidth=2),o.stroke(),o.globalCompositeOperation="source-over"},s.bodyPositions=function(t,e,r){var s,i,n,a,o=r,l=(t.engine,t.options);for(o.beginPath(),n=0;n<e.length;n++)if((s=e[n]).render.visible)for(a=0;a<s.parts.length;a++)i=s.parts[a],o.arc(i.position.x,i.position.y,3,0,2*Math.PI,!1),o.closePath();for(l.wireframes?o.fillStyle="indianred":o.fillStyle="rgba(0,0,0,0.5)",o.fill(),o.beginPath(),n=0;n<e.length;n++)(s=e[n]).render.visible&&(o.arc(s.positionPrev.x,s.positionPrev.y,2,0,2*Math.PI,!1),o.closePath());o.fillStyle="rgba(255,165,0,0.8)",o.fill()},s.bodyVelocity=function(t,e,r){var s=r;s.beginPath();for(var n=0;n<e.length;n++){var a=e[n];if(a.render.visible){var o=i.getVelocity(a);s.moveTo(a.position.x,a.position.y),s.lineTo(a.position.x+o.x,a.position.y+o.y)}}s.lineWidth=3,s.strokeStyle="cornflowerblue",s.stroke()},s.bodyIds=function(t,e,r){var s,i,n=r;for(s=0;s<e.length;s++)if(e[s].render.visible){var a=e[s].parts;for(i=a.length>1?1:0;i<a.length;i++){var o=a[i];n.font="12px Arial",n.fillStyle="rgba(255,255,255,0.5)",n.fillText(o.id,o.position.x+10,o.position.y-10)}}},s.collisions=function(t,e,r){var s,i,n,a,o=r,l=t.options;for(o.beginPath(),n=0;n<e.length;n++)if((s=e[n]).isActive)for(i=s.collision,a=0;a<s.contactCount;a++){var h=s.contacts[a].vertex;o.rect(h.x-1.5,h.y-1.5,3.5,3.5)}for(l.wireframes?o.fillStyle="rgba(255,255,255,0.7)":o.fillStyle="orange",o.fill(),o.beginPath(),n=0;n<e.length;n++)if((s=e[n]).isActive&&(i=s.collision,s.contactCount>0)){var c=s.contacts[0].vertex.x,u=s.contacts[0].vertex.y;2===s.contactCount&&(c=(s.contacts[0].vertex.x+s.contacts[1].vertex.x)/2,u=(s.contacts[0].vertex.y+s.contacts[1].vertex.y)/2),i.bodyB===i.supports[0].body||!0===i.bodyA.isStatic?o.moveTo(c-8*i.normal.x,u-8*i.normal.y):o.moveTo(c+8*i.normal.x,u+8*i.normal.y),o.lineTo(c,u)}l.wireframes?o.strokeStyle="rgba(255,165,0,0.7)":o.strokeStyle="orange",o.lineWidth=1,o.stroke()},s.separations=function(t,e,r){var s,i,n,a,o,l=r,h=t.options;for(l.beginPath(),o=0;o<e.length;o++)if((s=e[o]).isActive){n=(i=s.collision).bodyA;var c=1;(a=i.bodyB).isStatic||n.isStatic||(c=.5),a.isStatic&&(c=0),l.moveTo(a.position.x,a.position.y),l.lineTo(a.position.x-i.penetration.x*c,a.position.y-i.penetration.y*c),c=1,a.isStatic||n.isStatic||(c=.5),n.isStatic&&(c=0),l.moveTo(n.position.x,n.position.y),l.lineTo(n.position.x+i.penetration.x*c,n.position.y+i.penetration.y*c)}h.wireframes?l.strokeStyle="rgba(255,165,0,0.5)":l.strokeStyle="orange",l.stroke()},s.inspector=function(t,e){t.engine;var r,s=t.selected,i=t.render,n=i.options;if(n.hasBounds){var a=i.bounds.max.x-i.bounds.min.x,o=i.bounds.max.y-i.bounds.min.y,l=a/i.options.width,h=o/i.options.height;e.scale(1/l,1/h),e.translate(-i.bounds.min.x,-i.bounds.min.y)}for(var c=0;c<s.length;c++){var u=s[c].data;switch(e.translate(.5,.5),e.lineWidth=1,e.strokeStyle="rgba(255,165,0,0.9)",e.setLineDash([1,2]),u.type){case"body":r=u.bounds,e.beginPath(),e.rect(Math.floor(r.min.x-3),Math.floor(r.min.y-3),Math.floor(r.max.x-r.min.x+6),Math.floor(r.max.y-r.min.y+6)),e.closePath(),e.stroke();break;case"constraint":var d=u.pointA;u.bodyA&&(d=u.pointB),e.beginPath(),e.arc(d.x,d.y,10,0,2*Math.PI),e.closePath(),e.stroke()}e.setLineDash([]),e.translate(-.5,-.5)}null!==t.selectStart&&(e.translate(.5,.5),e.lineWidth=1,e.strokeStyle="rgba(255,165,0,0.6)",e.fillStyle="rgba(255,165,0,0.1)",r=t.selectBounds,e.beginPath(),e.rect(Math.floor(r.min.x),Math.floor(r.min.y),Math.floor(r.max.x-r.min.x),Math.floor(r.max.y-r.min.y)),e.closePath(),e.stroke(),e.fill(),e.translate(-.5,-.5)),n.hasBounds&&e.setTransform(1,0,0,1,0,0)};var r=function(t,e){var r=t.engine,i=t.timing,n=i.historySize,a=r.timing.timestamp;i.delta=e-i.lastTime||s._goodDelta,i.lastTime=e,i.timestampElapsed=a-i.lastTimestamp||0,i.lastTimestamp=a,i.deltaHistory.unshift(i.delta),i.deltaHistory.length=Math.min(i.deltaHistory.length,n),i.engineDeltaHistory.unshift(r.timing.lastDelta),i.engineDeltaHistory.length=Math.min(i.engineDeltaHistory.length,n),i.timestampElapsedHistory.unshift(i.timestampElapsed),i.timestampElapsedHistory.length=Math.min(i.timestampElapsedHistory.length,n),i.engineUpdatesHistory.unshift(r.timing.lastUpdatesPerFrame),i.engineUpdatesHistory.length=Math.min(i.engineUpdatesHistory.length,n),i.engineElapsedHistory.unshift(r.timing.lastElapsed),i.engineElapsedHistory.length=Math.min(i.engineElapsedHistory.length,n),i.elapsedHistory.unshift(i.lastElapsed),i.elapsedHistory.length=Math.min(i.elapsedHistory.length,n)},u=function(t){for(var e=0,r=0;r<t.length;r+=1)e+=t[r];return e/t.length||0},d=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},r},p=function(t){var e=t.getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},f=function(t,e){var r=t.textures[e];return r||((r=t.textures[e]=new Image).src=e,r)},m=function(t,e){var r=e;/(jpg|gif|png)$/.test(e)&&(r="url("+e+")"),t.canvas.style.background=r,t.canvas.style.backgroundSize="contain",t.currentBackground=e}}()},function(t,e,r){var s={};t.exports=s;var i=r(5),n=r(17),a=r(0);!function(){s._maxFrameDelta=1e3/15,s._frameDeltaFallback=1e3/60,s._timeBufferMargin=1.5,s._elapsedNextEstimate=1,s._smoothingLowerBound=.1,s._smoothingUpperBound=.9,s.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},s.run=function(t,e){return t.timeBuffer=s._frameDeltaFallback,function r(i){t.frameRequestId=s._onNextFrame(t,r),i&&t.enabled&&s.tick(t,e,i)}(),t},s.tick=function(e,r,o){var l=a.now(),h=e.delta,c=0,u=o-e.timeLastTick;if((!u||!e.timeLastTick||u>Math.max(s._maxFrameDelta,e.maxFrameTime))&&(u=e.frameDelta||s._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(u),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var d=e.frameDeltaHistory.slice(0).sort(),p=e.frameDeltaHistory.slice(d.length*s._smoothingLowerBound,d.length*s._smoothingUpperBound);u=t(p)||u}e.frameDeltaSnapping&&(u=1e3/Math.round(1e3/u)),e.frameDelta=u,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+h*s._timeBufferMargin),e.lastUpdatesDeferred=0;var f=e.maxUpdates||Math.ceil(e.maxFrameTime/h),m={timestamp:r.timing.timestamp};i.trigger(e,"beforeTick",m),i.trigger(e,"tick",m);for(var g=a.now();h>0&&e.timeBuffer>=h*s._timeBufferMargin;){i.trigger(e,"beforeUpdate",m),n.update(r,h),i.trigger(e,"afterUpdate",m),e.timeBuffer-=h,c+=1;var x=a.now()-l,y=a.now()-g,v=x+s._elapsedNextEstimate*y/c;if(c>=f||v>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/h-s._timeBufferMargin));break}}r.timing.lastUpdatesPerFrame=c,i.trigger(e,"afterTick",m),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/h)>f?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},s.stop=function(t){s._cancelNextFrame(t)},s._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},s._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,r=t.length,s=0;s<r;s+=1)e+=t[s];return e/r||0}}()},function(t,e,r){var s={};t.exports=s;var i=r(8),n=r(0).deprecated;s.collides=function(t,e){return i.collides(t,e)},n(s,"collides","SAT.collides ➤ replaced by Collision.collides")},function(t,e,r){var s={};t.exports=s,r(1);var i=r(0);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||i.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var r,n,a,o,l,h,c,u,d,p,f,m=[],g=0,x=0,y=0;e=e||15;var v=function(t,e,r){var s=r%2==1&&r>1;if(!d||t!=d.x||e!=d.y){d&&s?(p=d.x,f=d.y):(p=0,f=0);var i={x:p+t,y:f+e};!s&&d||(d=i),m.push(i),x=p+t,y=f+e}},_=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":x=t.x,y=t.y;break;case"H":x=t.x;break;case"V":y=t.y}v(x,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),a=t.getTotalLength(),h=[],r=0;r<t.pathSegList.numberOfItems;r+=1)h.push(t.pathSegList.getItem(r));for(c=h.concat();g<a;){if((l=h[t.getPathSegAtLength(g)])!=u){for(;c.length&&c[0]!=l;)_(c.shift());u=l}switch(l.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":o=t.getPointAtLength(g),v(o.x,o.y,0)}g+=e}for(r=0,n=c.length;r<n;++r)_(c[r]);return m},s._svgPathToAbsolute=function(t){for(var e,r,s,i,n,a,o=t.pathSegList,l=0,h=0,c=o.numberOfItems,u=0;u<c;++u){var d=o.getItem(u),p=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(p))"x"in d&&(l=d.x),"y"in d&&(h=d.y);else switch("x1"in d&&(s=l+d.x1),"x2"in d&&(n=l+d.x2),"y1"in d&&(i=h+d.y1),"y2"in d&&(a=h+d.y2),"x"in d&&(l+=d.x),"y"in d&&(h+=d.y),p){case"m":o.replaceItem(t.createSVGPathSegMovetoAbs(l,h),u);break;case"l":o.replaceItem(t.createSVGPathSegLinetoAbs(l,h),u);break;case"h":o.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(l),u);break;case"v":o.replaceItem(t.createSVGPathSegLinetoVerticalAbs(h),u);break;case"c":o.replaceItem(t.createSVGPathSegCurvetoCubicAbs(l,h,s,i,n,a),u);break;case"s":o.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(l,h,n,a),u);break;case"q":o.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(l,h,s,i),u);break;case"t":o.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(l,h),u);break;case"a":o.replaceItem(t.createSVGPathSegArcAbs(l,h,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),u);break;case"z":case"Z":l=e,h=r}"M"!=p&&"m"!=p||(e=l,r=h)}}},function(t,e,r){var s={};t.exports=s;var i=r(6);r(0),s.create=i.create,s.add=i.add,s.remove=i.remove,s.clear=i.clear,s.addComposite=i.addComposite,s.addBody=i.addBody,s.addConstraint=i.addConstraint}])},t.exports=s()},8725:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});let s=null;class i{constructor(){s||(s=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap !== "function")\n return false;\n const response = await fetch(WHITE_PNG);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch (_e) {\n return false;\n }\n }\n void checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(s)}}i.revokeObjectURL=function(){s&&(URL.revokeObjectURL(s),s=null)}},8742:(t,e,r)=>{"use strict";r(432),r(8847),r(3645),r(7635),r(2839)._},8826:(t,e,r)=>{"use strict";r.d(e,{f:()=>n});var s=r(166),i=r(992);class n extends s.Mtr{constructor(t){super({glProgram:(0,s.Ivi)({name:"dark-tint-batch",bits:[s.a4b,i.i,(0,s.PDq)(t),s.mx8]}),gpuProgram:(0,s.vfs)({name:"dark-tint-batch",bits:[s.FFI,i.R,(0,s._1d)(t),s.b3l]}),resources:{batchSamplers:(0,s.n2X)(t)}})}}},8840:(t,e,r)=>{"use strict";r(192).R},8847:(t,e,r)=>{"use strict";r.d(e,{j:()=>n});var s=r(6793);class i extends s.a{async doLoad(t){const e=(async()=>{const e=await fetch(t);if(!e.ok)return void console.error(`Failed to load binary data: ${t}`);const r=await e.arrayBuffer(),s=new Uint8Array(r);if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,s),s;console.error(`Binary data already exists: ${t}`)}})();return this.loadingPromises.set(t,e),await e}}const n=new i},8851:(t,e,r)=>{"use strict";r.d(e,{W:()=>h});var s=r(9437),i=r(1753),n=r(4269),a=r(9739),o=r(8896);let l=0;const h=new class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new o.n(this.textureOptions)}createTexture(t,e,r){const s=new n.v({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!1});return new a.g({source:s,label:"texturePool_"+l++})}getOptimalTexture(t,e,r=1,i){let n=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);n=(0,s.U5)(n),a=(0,s.U5)(a);const o=(n<<17)+(a<<1)+(i?1:0);this._texturePool[o]||(this._texturePool[o]=[]);let l=this._texturePool[o].pop();return l||(l=this.createTexture(n,a,i)),l.source._resolution=r,l.source.width=n/r,l.source.height=a/r,l.source.pixelWidth=n,l.source.pixelHeight=a,l.frame.x=0,l.frame.y=0,l.frame.width=t,l.frame.height=e,l.updateUvs(),this._poolKeyHash[l.uid]=o,l}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t,e=!1){const r=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[r].push(t)}clear(t){if(t=!1!==t)for(const t in this._texturePool){const e=this._texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this._texturePool={}}};i.L.register(h)},8869:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var s=r(5423);function i(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function n(t){return t.split("?")[0].split("#")[0]}const a={toPosix:t=>t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/"),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){i(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(i(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const o=n(this.toPosix(e??s.e.get().getBaseUrl())),l=n(this.toPosix(r??this.rootname(o)));return(t=this.toPosix(t)).startsWith("/")?a.join(l,t.slice(1)):this.isAbsolute(t)?t:this.join(o,t)},normalize(t){if(i(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const s=t.endsWith("/");return(t=function(t){let e="",r=0,s=-1,i=0,n=-1;for(let a=0;a<=t.length;++a){if(a<t.length)n=t.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(s===a-1||1===i);else if(s!==a-1&&2===i){if(e.length<2||2!==r||46!==e.charCodeAt(e.length-1)||46!==e.charCodeAt(e.length-2))if(e.length>2){const t=e.lastIndexOf("/");if(t!==e.length-1){-1===t?(e="",r=0):(e=e.slice(0,t),r=e.length-1-e.lastIndexOf("/")),s=a,i=0;continue}}else if(2===e.length||1===e.length){e="",r=0,s=a,i=0;continue}}else e.length>0?e+=`/${t.slice(s+1,a)}`:e=t.slice(s+1,a),r=a-s-1;s=a,i=0}else 46===n&&-1!==i?++i:i=-1}return e}(t)).length>0&&s&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return i(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const s=t[r];if(i(s),s.length>0)if(void 0===e)e=s;else{const i=t[r-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?e+=`/../${s}`:e+=`/${s}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(i(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let s=-1,n=!0;const a=this.getProtocol(t),o=t;for(let r=(t=t.slice(a.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!n){s=r;break}}else n=!1;return-1===s?r?"/":this.isUrl(o)?a+t:a:r&&1===s?"//":a+t.slice(0,s)},rootname(t){i(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){i(t),e&&i(e),t=n(this.toPosix(t));let r,s=0,a=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let i=e.length-1,n=-1;for(r=t.length-1;r>=0;--r){const l=t.charCodeAt(r);if(47===l){if(!o){s=r+1;break}}else-1===n&&(o=!1,n=r+1),i>=0&&(l===e.charCodeAt(i)?-1===--i&&(a=r):(i=-1,a=n))}return s===a?a=n:-1===a&&(a=t.length),t.slice(s,a)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!o){s=r+1;break}}else-1===a&&(o=!1,a=r+1);return-1===a?"":t.slice(s,a)},extname(t){i(t);let e=-1,r=0,s=-1,a=!0,o=0;for(let i=(t=n(this.toPosix(t))).length-1;i>=0;--i){const n=t.charCodeAt(i);if(47!==n)-1===s&&(a=!1,s=i+1),46===n?-1===e?e=i:1!==o&&(o=1):-1!==e&&(o=-1);else if(!a){r=i+1;break}}return-1===e||-1===s||0===o||1===o&&e===s-1&&e===r+1?"":t.slice(e,s)},parse(t){i(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=n(this.toPosix(t))).charCodeAt(0);const s=this.isAbsolute(t);let a;e.root=this.rootname(t),a=s||this.hasProtocol(t)?1:0;let o=-1,l=0,h=-1,c=!0,u=t.length-1,d=0;for(;u>=a;--u)if(r=t.charCodeAt(u),47!==r)-1===h&&(c=!1,h=u+1),46===r?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!c){l=u+1;break}return-1===o||-1===h||0===d||1===d&&o===h-1&&o===l+1?-1!==h&&(e.base=e.name=0===l&&s?t.slice(1,h):t.slice(l,h)):(0===l&&s?(e.name=t.slice(1,o),e.base=t.slice(1,h)):(e.name=t.slice(l,o),e.base=t.slice(l,h)),e.ext=t.slice(o,h)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]}},8883:(t,e,r)=>{"use strict";let s;function i(){if("boolean"==typeof s)return s;try{const t=new Function("param1","param2","param3","return param1[param2] === param3;");s=!0===t({a:"b"},"a","b")}catch(t){s=!1}return s}r.d(e,{f:()=>i})},8894:(t,e,r)=>{"use strict";r.d(e,{V:()=>n});var s=r(5331),i=r(1347);class n{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new i.bC(()=>i.Aq.newFloatArray(16));update(t,e){if(!t)throw new Error("skeleton cannot be null.");let r=this.boundingBoxes,n=this.polygons,a=this.polygonPool,o=t.slots,l=o.length;r.length=0,a.freeAll(n),n.length=0;for(let t=0;t<l;t++){let e=o[t];if(!e.bone.active)continue;let l=e.getAttachment();if(l instanceof s.b){let t=l;r.push(t);let s=a.obtain();s.length!=t.worldVerticesLength&&(s=i.Aq.newFloatArray(t.worldVerticesLength)),n.push(s),t.computeWorldVertices(e,0,t.worldVerticesLength,s,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.polygons;for(let n=0,a=i.length;n<a;n++){let a=i[n],o=a;for(let i=0,n=a.length;i<n;i+=2){let n=o[i],a=o[i+1];t=Math.min(t,n),e=Math.min(e,a),r=Math.max(r,n),s=Math.max(s,a)}}this.minX=t,this.minY=e,this.maxX=r,this.maxY=s}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,r,s){let i=this.minX,n=this.minY,a=this.maxX,o=this.maxY;if(t<=i&&r<=i||e<=n&&s<=n||t>=a&&r>=a||e>=o&&s>=o)return!1;let l=(s-e)/(r-t),h=l*(i-t)+e;if(h>n&&h<o)return!0;if(h=l*(a-t)+e,h>n&&h<o)return!0;let c=(n-e)/l+t;return c>i&&c<a||(c=(o-e)/l+t,c>i&&c<a)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let r=this.polygons;for(let s=0,i=r.length;s<i;s++)if(this.containsPointPolygon(r[s],t,e))return this.boundingBoxes[s];return null}containsPointPolygon(t,e,r){let s=t,i=t.length,n=i-2,a=!1;for(let t=0;t<i;t+=2){let i=s[t+1],o=s[n+1];if(i<r&&o>=r||o<r&&i>=r){let l=s[t];l+(r-i)/(o-i)*(s[n]-l)<e&&(a=!a)}n=t}return a}intersectsSegment(t,e,r,s){let i=this.polygons;for(let n=0,a=i.length;n<a;n++)if(this.intersectsSegmentPolygon(i[n],t,e,r,s))return this.boundingBoxes[n];return null}intersectsSegmentPolygon(t,e,r,s,i){let n=t,a=t.length,o=e-s,l=r-i,h=e*i-r*s,c=n[a-2],u=n[a-1];for(let t=0;t<a;t+=2){let a=n[t],d=n[t+1],p=c*d-u*a,f=c-a,m=u-d,g=o*m-l*f,x=(h*f-o*p)/g;if((x>=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(h*m-l*p)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=r&&t<=i||t>=i&&t<=r))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}},8896:(t,e,r)=>{"use strict";r.d(e,{n:()=>l});var s=r(4872),i=r(9375),n=r(4696);const a=Object.create(null),o=class t extends s.A{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...t.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){(0,n.t6)(n.lj,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=function(t){const e=a[t];return void 0===e&&(a[t]=(0,i.L)("resource")),e}(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};o.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let l=o},8900:(t,e,r)=>{"use strict";r.d(e,{l:()=>d});var s=r(5199),i=r(9390),n=r(1711),a=r(2255),o=r(1386),l=r(4269),h=r(9739),c=r(8955),u=r(2277);class d{constructor(t){this.rootViewPort=new i.M,this.viewport=new i.M,this.onRenderTargetChange=new a.C("onRenderTargetChange"),this.projectionMatrix=new s.u,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=t,t.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:t,clear:e,clearColor:r,frame:s}){this._renderTargetStack.length=0,this.push(t,e,r,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=function(t){const e=t.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(t,e=!0,r,s){const i=this.getRenderTarget(t),n=this.renderTarget!==i;this.renderTarget=i,this.renderSurface=t;const a=this.getGpuRenderTarget(i);i.pixelWidth===a.width&&i.pixelHeight===a.height||(this.adaptor.resizeGpuRenderTarget(i),a.width=i.pixelWidth,a.height=i.pixelHeight);const o=i.colorTexture,l=this.viewport,c=o.pixelWidth,u=o.pixelHeight;if(!s&&t instanceof h.g&&(s=t.frame),s){const t=o._resolution;l.x=s.x*t+.5|0,l.y=s.y*t+.5|0,l.width=s.width*t+.5|0,l.height=s.height*t+.5|0}else l.x=0,l.y=0,l.width=c,l.height=u;return function(t,e,r,s,i,n){const a=n?1:-1;t.identity(),t.a=1/s*2,t.d=a*(1/i*2),t.tx=-1-0*t.a,t.ty=-a-0*t.d}(this.projectionMatrix,0,0,l.width/o.resolution,l.height/o.resolution,!i.isRoot),this.adaptor.startRenderPass(i,e,r,l),n&&this.onRenderTargetChange.emit(i),i}clear(t,e=n.u.ALL,r){e&&(t&&(t=this.getRenderTarget(t)),this.adaptor.clear(t||this.renderTarget,e,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(t,e=n.u.ALL,r,s){const i=this.bind(t,e,r,s);return this._renderTargetStack.push({renderTarget:i,frame:s}),i}pop(){this._renderTargetStack.pop();const t=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(t.renderTarget,!1,null,t.frame)}getRenderTarget(t){return t.isTexture&&(t=t.source),this._renderSurfaceToRenderTargetHash.get(t)??this._initRenderTarget(t)}copyToTexture(t,e,r,s,i){r.x<0&&(s.width+=r.x,i.x-=r.x,r.x=0),r.y<0&&(s.height+=r.y,i.y-=r.y,r.y=0);const{pixelWidth:n,pixelHeight:a}=t;return s.width=Math.min(s.width,n-r.x),s.height=Math.min(s.height,a-r.y),this.adaptor.copyToTexture(t,e,r,s,i)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((t,e)=>{t!==e&&t.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(t){let e=null;return o.q.test(t)&&(t=(0,c.c)(t).source),t instanceof u.O?e=t:t instanceof l.v&&(e=new u.O({colorTextures:[t]}),t.source instanceof o.q&&(e.isRoot=!0),t.once("destroy",()=>{e.destroy(),this._renderSurfaceToRenderTargetHash.delete(t);const r=this._gpuRenderTargetHash[e.uid];r&&(this._gpuRenderTargetHash[e.uid]=null,this.adaptor.destroyGpuRenderTarget(r))})),this._renderSurfaceToRenderTargetHash.set(t,e),e}getGpuRenderTarget(t){return this._gpuRenderTargetHash[t.uid]||(this._gpuRenderTargetHash[t.uid]=this.adaptor.initGpuRenderTarget(t))}resetState(){this.renderTarget=null,this.renderSurface=null}}},8955:(t,e,r)=>{"use strict";r.d(e,{c:()=>o});var s=r(1753),i=r(1386),n=r(9739);const a=new Map;function o(t,e){if(!a.has(t)){const r=new n.g({source:new i.q({resource:t,...e})}),s=()=>{a.get(t)===r&&a.delete(t)};r.once("destroy",s),r.source.once("destroy",s),a.set(t,r)}return a.get(t)}s.L.register(a)},8956:(t,e,r)=>{"use strict";r.d(e,{s:()=>i});var s=r(3590);function i(t,e){const{texture:r,bounds:i}=t,n=e._style._getFinalPadding();(0,s.y)(i,e._anchor,r);const a=e._anchor._x*n*2,o=e._anchor._y*n*2;i.minX-=n-a,i.minY-=n-o,i.maxX-=n-a,i.maxY-=n-o}},8979:(t,e,r)=>{"use strict";r.d(e,{O:()=>o});var s=r(8725),i=r(1055);let n,a=0;const o=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise(t=>{const{worker:e}=new s.A;e.addEventListener("message",r=>{e.terminate(),s.A.revokeObjectURL(),t(r.data)})})),this._isImageBitmapSupported}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){void 0===n&&(n=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<n&&(this._createdWorkers++,t=(new i.A).worker,t.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){void 0!==t.error?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),this._resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const r=new Promise((r,s)=>{this._queue.push({id:t,arguments:e,resolve:r,reject:s})});return this._next(),r}_next(){if(!this._queue.length)return;const t=this._getWorker();if(!t)return;const e=this._queue.pop(),r=e.id;this._resolveHash[a]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:a++,id:r})}reset(){this._workerPool.forEach(t=>t.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:t})=>{t?.(new Error("WorkerManager destroyed"))}),this._resolveHash={},this._queue.length=0,this._initialized=!1,this._createdWorkers=0}}},9031:(t,e,r)=>{"use strict";var s=r(166),i=r(2585),n=r(8034);const a={0:"normal",1:"add",2:"multiply",3:"screen"};class o{static extension={type:[s.AgS.WebGLPipes,s.AgS.WebGPUPipes,s.AgS.CanvasPipes],name:"spine"};renderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(t){this.renderer=t}validateRenderable(t){if(t._validateAndTransformAttachments(),t.spineAttachmentsDirty)return!0;if(t.spineTexturesDirty){const e=t.skeleton.drawOrder,r=this.gpuSpineData[t.uid];for(let s=0,i=e.length;s<i;s++){const i=e[s],a=i.getAttachment();if(a instanceof n.Qb||a instanceof n.fj){const e=t._getCachedData(i,a),s=r.slotBatches[e.id],n=e.texture;if(n!==s.texture&&!s._batcher.checkAndUpdateTexture(s,n))return!0}}}return!1}addRenderable(t,e){const r=this._getSpineData(t),s=this.renderer.renderPipes.batch,o=t.skeleton.drawOrder,l=this.renderer._roundPixels|t._roundPixels;t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1;for(let h=0,c=o.length;h<c;h++){const c=o[h],u=c.getAttachment(),d=a[c.data.blendMode];if(u instanceof n.Qb||u instanceof n.fj){const n=t._getCachedData(c,u),a=r.slotBatches[n.id]||=new i.a;a.setData(t,n,d,l),n.skipRender||s.addToBatch(a,e)}const p=t._slotsObject[c.data.name];if(p){const t=p.container;t.includeInBuild=!0,t.collectRenderables(e,this.renderer,null),t.includeInBuild=!1}}}updateRenderable(t){const e=this.gpuSpineData[t.uid];t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1;const r=t.skeleton.drawOrder;for(let s=0,i=r.length;s<i;s++){const i=r[s],a=i.getAttachment();if((a instanceof n.Qb||a instanceof n.fj)&&!t._getCachedData(i,a).skipRender){const r=e.slotBatches[t._getCachedData(i,a).id];r._batcher?.updateElement(r)}}}destroyRenderable(t){this.gpuSpineData[t.uid]=null,t.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null}_getSpineData(t){return this.gpuSpineData[t.uid]||this._initMeshData(t)}_initMeshData(t){return this.gpuSpineData[t.uid]={slotBatches:{}},t.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[t.uid]}}s.XOh.add(o)},9062:(t,e,r)=>{"use strict";function s(t,e){const r=t.byteLength/8|0,s=new Float64Array(t,0,r);new Float64Array(e,0,r).set(s);const i=t.byteLength-8*r;if(i>0){const s=new Uint8Array(t,8*r,i);new Uint8Array(e,8*r,i).set(s)}}r.d(e,{W:()=>s})},9064:(t,e,r)=>{"use strict";r.d(e,{Y:()=>n});var s=r(1347),i=r(4382);class n extends i.e{x=0;y=0;rotation=0;color=new s.Q1(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){const e=this.rotation*s.cj.degRad,r=Math.cos(e),i=Math.sin(e),n=r*t.a+i*t.b,a=r*t.c+i*t.d;return s.cj.atan2Deg(a,n)}copy(){let t=new n(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}},9067:(t,e,r)=>{"use strict";r.d(e,{N:()=>i,p:()=>s});let s=!1;function i(){s=!0}},9087:function(t){var e;t.exports=((e=function(){function t(t){return i.appendChild(t.dom),t}function r(t){for(var e=0;e<i.children.length;e++)i.children[e].style.display=e===t?"block":"none";s=t}var s=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(t){t.preventDefault(),r(++s%i.children.length)},!1);var n=(performance||Date).now(),a=n,o=0,l=t(new e.Panel("FPS","#0ff","#002")),h=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new e.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:i,addPanel:t,showPanel:r,begin:function(){n=(performance||Date).now()},end:function(){o++;var t=(performance||Date).now();if(h.update(t-n,200),t>a+1e3&&(l.update(1e3*o/(t-a),100),a=t,o=0,c)){var e=performance.memory;c.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){n=this.end()},domElement:i,setMode:r}}).Panel=function(t,e,r){var s=1/0,i=0,n=Math.round,a=n(window.devicePixelRatio||1),o=80*a,l=48*a,h=3*a,c=2*a,u=3*a,d=15*a,p=74*a,f=30*a,m=document.createElement("canvas");m.width=o,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,o,l),g.fillStyle=e,g.fillText(t,h,c),g.fillRect(u,d,p,f),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(u,d,p,f),{dom:m,update:function(l,x){s=Math.min(s,l),i=Math.max(i,l),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,o,d),g.fillStyle=e,g.fillText(n(l)+" "+t+" ("+n(s)+"-"+n(i)+")",h,c),g.drawImage(m,u+a,d,p-a,f,u,d,p-a,f),g.fillRect(u+p-a,d,a,f),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(u+p-a,d,a,n((1-l/x)*f))}}},e)},9097:(t,e,r)=>{"use strict";r.d(e,{F:()=>l});var s=r(5423),i=r(1065),n=r(3761),a=r(4173),o=r(3463);const l={extension:{type:i.Ag.LoadParser,priority:o.T.Low},name:"loadJson",id:"json",test:t=>(0,n.s)(t,"application/json")||(0,a.W)(t,".json"),async load(t){const e=await s.e.get().fetch(t);return await e.json()}}},9107:(t,e,r)=>{"use strict";r.d(e,{A:()=>s,E:()=>m});var s,i=r(6552),n=r(7399),a=r(6861),o=r(7786),l=r(2866),h=r(528),c=r(6184),u=r(6108),d=r(6068),p=r(7957),f=r(1347);class m{static quadTriangles=[0,1,2,2,3,0];static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return m.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;time=0;constructor(t){if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let r,s=t.bones[e];if(s.parent){let t=this.bones[s.parent.index];r=new l.$(s,this,t),t.children.push(r)}else r=new l.$(s,this,null);this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let r=t.slots[e],s=this.bones[r.boneData.index],i=new d.D(r,s);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let r=t.ikConstraints[e];this.ikConstraints.push(new h.c(r,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let r=t.transformConstraints[e];this.transformConstraints.push(new p.U(r,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let r=t.pathConstraints[e];this.pathConstraints.push(new c.v(r,this))}this.physicsConstraints=new Array;for(let e=0;e<t.physicsConstraints.length;e++){let r=t.physicsConstraints[e];this.physicsConstraints.push(new u.N(r,this))}this.color=new f.Q1(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,r=t.length;e<r;e++){let r=t[e];r.sorted=r.data.skinRequired,r.active=!r.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,r=this.skin.bones.length;e<r;e++){let r=this.bones[t[e].index];do{r.sorted=!1,r.active=!0,r=r.parent}while(r)}}let e=this.ikConstraints,r=this.transformConstraints,s=this.pathConstraints,i=this.physicsConstraints,n=e.length,a=r.length,o=s.length,l=this.physicsConstraints.length,h=n+a+o+l;t:for(let t=0;t<h;t++){for(let r=0;r<n;r++){let s=e[r];if(s.data.order==t){this.sortIkConstraint(s);continue t}}for(let e=0;e<a;e++){let s=r[e];if(s.data.order==t){this.sortTransformConstraint(s);continue t}}for(let e=0;e<o;e++){let r=s[e];if(r.data.order==t){this.sortPathConstraint(r);continue t}}for(let e=0;e<l;e++){const r=i[e];if(r.data.order==t){this.sortPhysicsConstraint(r);continue t}}}for(let e=0,r=t.length;e<r;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let r=t.bones,s=r[0];if(this.sortBone(s),1==r.length)this._updateCache.push(t),this.sortReset(s.children);else{let e=r[r.length-1];this.sortBone(e),this._updateCache.push(t),this.sortReset(s.children),e.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,r=e.data.index,s=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,r,s),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,s);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],r,s);let i=e.getAttachment();i instanceof a.H&&this.sortPathConstraintAttachmentWith(i,s);let n=t.bones,o=n.length;for(let t=0;t<o;t++)this.sortBone(n[t]);this._updateCache.push(t);for(let t=0;t<o;t++)this.sortReset(n[t].children);for(let t=0;t<o;t++)n[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,r=e.length;if(t.data.local)for(let t=0;t<r;t++){let r=e[t];this.sortBone(r.parent),this.sortBone(r)}else for(let t=0;t<r;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<r;t++)this.sortReset(e[t].children);for(let t=0;t<r;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,r){let s=t.attachments[e];if(s)for(let t in s)this.sortPathConstraintAttachmentWith(s[t],r)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof a.H))return;let r=t.bones;if(r){let t=this.bones;for(let e=0,s=r.length;e<s;){let s=r[e++];for(s+=e;e<s;)this.sortBone(t[r[e++]])}}else this.sortBone(e)}sortPhysicsConstraint(t){const e=t.bone;t.active=e.active&&(!t.data.skinRequired||null!=this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)}sortBone(t){if(!t)return;if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,r=t.length;e<r;e++){let r=t[e];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}}updateWorldTransform(t){if(null==t)throw new Error("physics is undefined");let e=this.bones;for(let t=0,r=e.length;t<r;t++){let r=e[t];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let r=this._updateCache;for(let e=0,s=r.length;e<s;e++)r[e].update(t)}updateWorldTransformWith(t,e){if(!e)throw new Error("parent cannot be null.");let r=this.bones;for(let t=1,e=r.length;t<e;t++){let e=r[t];e.ax=e.x,e.ay=e.y,e.arotation=e.rotation,e.ascaleX=e.scaleX,e.ascaleY=e.scaleY,e.ashearX=e.shearX,e.ashearY=e.shearY}let s=this.getRootBone();if(!s)throw new Error("Root bone must not be null.");let i=e.a,n=e.b,a=e.c,o=e.d;s.worldX=i*this.x+n*this.y+e.worldX,s.worldY=a*this.x+o*this.y+e.worldY;const l=(s.rotation+s.shearX)*f.cj.degRad,h=(s.rotation+90+s.shearY)*f.cj.degRad,c=Math.cos(l)*s.scaleX,u=Math.cos(h)*s.scaleY,d=Math.sin(l)*s.scaleX,p=Math.sin(h)*s.scaleY;s.a=(i*c+n*d)*this.scaleX,s.b=(i*u+n*p)*this.scaleX,s.c=(a*c+o*d)*this.scaleY,s.d=(a*u+o*p)*this.scaleY;let m=this._updateCache;for(let e=0,r=m.length;e<r;e++){let r=m[e];r!=s&&r.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;f.Aq.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,r=t.length;e<r;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.data.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let r=0,s=e.length;r<s;r++){let s=e[r];if(s.data.name==t)return s}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let r=0,s=e.length;r<s;r++){let s=e[r],i=s.data.attachmentName;if(i){let e=t.getAttachment(r,i);e&&s.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let r=this.data.findSlot(t);if(!r)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(r.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let r=this.skin.getAttachment(t,e);if(r)return r}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let r=this.slots;for(let s=0,i=r.length;s<i;s++){let i=r[s];if(i.data.name==t){let r=null;if(e&&(r=this.getAttachment(s,e),!r))throw new Error("Attachment not found: "+e+", for slot: "+t);return void i.setAttachment(r)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(e=>e.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(e=>e.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(e=>e.data.name==t)??null}findPhysicsConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(e=>e.data.name==t)??null}getBoundsRect(t){let e=new f.I9,r=new f.I9;return this.getBounds(e,r,void 0,t),{x:e.x,y:e.y,width:r.x,height:r.y}}getBounds(t,e,r=new Array(2),s=null){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let a=this.drawOrder,l=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let t=0,e=a.length;t<e;t++){let e=a[t];if(!e.bone.active)continue;let d=0,p=null,g=null,x=e.getAttachment();if(x instanceof o.Q)d=8,p=f.Aq.setArraySize(r,d,0),x.computeWorldVertices(e,p,0,2),g=m.quadTriangles;else if(x instanceof n.f){let t=x;d=t.worldVerticesLength,p=f.Aq.setArraySize(r,d,0),t.computeWorldVertices(e,0,d,p,0,2),g=t.triangles}else if(x instanceof i.K&&null!=s){s.clipStart(e,x);continue}if(p&&g){null!=s&&s.isClipping()&&(s.clipTriangles(p,g,g.length),p=s.clippedVertices,d=s.clippedVertices.length);for(let t=0,e=p.length;t<e;t+=2){let e=p[t],r=p[t+1];l=Math.min(l,e),h=Math.min(h,r),c=Math.max(c,e),u=Math.max(u,r)}}null!=s&&s.clipEndWithSlot(e)}null!=s&&s.clipEnd(),t.set(l,h),e.set(c-l,u-h)}update(t){this.time+=t}physicsTranslate(t,e){const r=this.physicsConstraints;for(let s=0,i=r.length;s<i;s++)r[s].translate(t,e)}physicsRotate(t,e,r){const s=this.physicsConstraints;for(let i=0,n=s.length;i<n;i++)s[i].rotate(t,e,r)}}!function(t){t[t.none=0]="none",t[t.reset=1]="reset",t[t.update=2]="update",t[t.pose=3]="pose"}(s||(s={}))},9133:(t,e,r)=>{"use strict";r.d(e,{q:()=>n});var s=r(2414),i=r(1347);class n{triangulator=new s.R;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let r=e.worldVerticesLength,s=i.Aq.setArraySize(this.clippingPolygon,r);e.computeWorldVertices(t,0,r,s,0,2);let a=this.clippingPolygon;n.makeClockwise(a);let o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a));for(let t=0,e=o.length;t<e;t++){let e=o[t];n.makeClockwise(e),e.push(e[0]),e.push(e[1])}return o.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return null!=this.clipAttachment}clipTriangles(t,e,r,s,i,n,a,o){let l,h,c,u,d,p;"number"==typeof e?(l=r,h=s,c=i,u=n,d=a,p=o):(l=e,h=r,c=s,u=i,d=n,p=a),c&&u&&d&&"boolean"==typeof p?this.clipTrianglesRender(t,l,h,c,u,d,p):this.clipTrianglesNoRender(t,l,h)}clipTrianglesNoRender(t,e,r){let s=this.clipOutput,n=this.clippedVertices,a=this.clippedTriangles,o=this.clippingPolygons,l=o.length,h=0;n.length=0,a.length=0;for(let c=0;c<r;c+=3){let r=e[c]<<1,u=t[r],d=t[r+1];r=e[c+1]<<1;let p=t[r],f=t[r+1];r=e[c+2]<<1;let m=t[r],g=t[r+1];for(let t=0;t<l;t++){let e=n.length;if(!this.clip(u,d,p,f,m,g,o[t],s)){let t=i.Aq.setArraySize(n,e+6);t[e]=u,t[e+1]=d,t[e+2]=p,t[e+3]=f,t[e+4]=m,t[e+5]=g,e=a.length;let r=i.Aq.setArraySize(a,e+3);r[e]=h,r[e+1]=h+1,r[e+2]=h+2,h+=3;break}{let t=s.length;if(0==t)continue;let r=t>>1,o=this.clipOutput,l=i.Aq.setArraySize(n,e+2*r);for(let r=0;r<t;r+=2,e+=2){let t=o[r],s=o[r+1];l[e]=t,l[e+1]=s}e=a.length;let c=i.Aq.setArraySize(a,e+3*(r-2));r--;for(let t=1;t<r;t++,e+=3)c[e]=h,c[e+1]=h+t,c[e+2]=h+t+1;h+=r+1}}}}clipTrianglesRender(t,e,r,s,n,a,o){let l=this.clipOutput,h=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,p=o?12:8,f=0;h.length=0,c.length=0;for(let m=0;m<r;m+=3){let r=e[m]<<1,g=t[r],x=t[r+1],y=s[r],v=s[r+1];r=e[m+1]<<1;let _=t[r],b=t[r+1],w=s[r],T=s[r+1];r=e[m+2]<<1;let S=t[r],A=t[r+1],C=s[r],P=s[r+1];for(let t=0;t<d;t++){let e=h.length;if(!this.clip(g,x,_,b,S,A,u[t],l)){let t=i.Aq.setArraySize(h,e+3*p);t[e]=g,t[e+1]=x,t[e+2]=n.r,t[e+3]=n.g,t[e+4]=n.b,t[e+5]=n.a,o?(t[e+6]=y,t[e+7]=v,t[e+8]=a.r,t[e+9]=a.g,t[e+10]=a.b,t[e+11]=a.a,t[e+12]=_,t[e+13]=b,t[e+14]=n.r,t[e+15]=n.g,t[e+16]=n.b,t[e+17]=n.a,t[e+18]=w,t[e+19]=T,t[e+20]=a.r,t[e+21]=a.g,t[e+22]=a.b,t[e+23]=a.a,t[e+24]=S,t[e+25]=A,t[e+26]=n.r,t[e+27]=n.g,t[e+28]=n.b,t[e+29]=n.a,t[e+30]=C,t[e+31]=P,t[e+32]=a.r,t[e+33]=a.g,t[e+34]=a.b,t[e+35]=a.a):(t[e+6]=y,t[e+7]=v,t[e+8]=_,t[e+9]=b,t[e+10]=n.r,t[e+11]=n.g,t[e+12]=n.b,t[e+13]=n.a,t[e+14]=w,t[e+15]=T,t[e+16]=S,t[e+17]=A,t[e+18]=n.r,t[e+19]=n.g,t[e+20]=n.b,t[e+21]=n.a,t[e+22]=C,t[e+23]=P),e=c.length;let r=i.Aq.setArraySize(c,e+3);r[e]=f,r[e+1]=f+1,r[e+2]=f+2,f+=3;break}{let t=l.length;if(0==t)continue;let r=b-A,s=S-_,u=g-S,d=A-x,m=1/(r*u+s*(x-A)),E=t>>1,M=this.clipOutput,k=i.Aq.setArraySize(h,e+E*p);for(let i=0;i<t;i+=2,e+=p){let t=M[i],l=M[i+1];k[e]=t,k[e+1]=l,k[e+2]=n.r,k[e+3]=n.g,k[e+4]=n.b,k[e+5]=n.a;let h=t-S,c=l-A,p=(r*h+s*c)*m,f=(d*h+u*c)*m,g=1-p-f;k[e+6]=y*p+w*f+C*g,k[e+7]=v*p+T*f+P*g,o&&(k[e+8]=a.r,k[e+9]=a.g,k[e+10]=a.b,k[e+11]=a.a)}e=c.length;let R=i.Aq.setArraySize(c,e+3*(E-2));E--;for(let t=1;t<E;t++,e+=3)R[e]=f,R[e+1]=f+t,R[e+2]=f+t+1;f+=E+1}}}}clipTrianglesUnpacked(t,e,r,s){let n=this.clipOutput,a=this.clippedVertices,o=this.clippedUVs,l=this.clippedTriangles,h=this.clippingPolygons,c=h.length,u=0;a.length=0,o.length=0,l.length=0;for(let d=0;d<r;d+=3){let r=e[d]<<1,p=t[r],f=t[r+1],m=s[r],g=s[r+1];r=e[d+1]<<1;let x=t[r],y=t[r+1],v=s[r],_=s[r+1];r=e[d+2]<<1;let b=t[r],w=t[r+1],T=s[r],S=s[r+1];for(let t=0;t<c;t++){let e=a.length;if(!this.clip(p,f,x,y,b,w,h[t],n)){let t=i.Aq.setArraySize(a,e+6);t[e]=p,t[e+1]=f,t[e+2]=x,t[e+3]=y,t[e+4]=b,t[e+5]=w;let r=i.Aq.setArraySize(o,e+6);r[e]=m,r[e+1]=g,r[e+2]=v,r[e+3]=_,r[e+4]=T,r[e+5]=S,e=l.length;let s=i.Aq.setArraySize(l,e+3);s[e]=u,s[e+1]=u+1,s[e+2]=u+2,u+=3;break}{let t=n.length;if(0==t)continue;let r=y-w,s=b-x,h=p-b,c=w-f,d=1/(r*h+s*(f-w)),A=t>>1,C=this.clipOutput,P=i.Aq.setArraySize(a,e+2*A),E=i.Aq.setArraySize(o,e+2*A);for(let i=0;i<t;i+=2,e+=2){let t=C[i],n=C[i+1];P[e]=t,P[e+1]=n;let a=t-b,o=n-w,l=(r*a+s*o)*d,u=(c*a+h*o)*d,p=1-l-u;E[e]=m*l+v*u+T*p,E[e+1]=g*l+_*u+S*p}e=l.length;let M=i.Aq.setArraySize(l,e+3*(A-2));A--;for(let t=1;t<A;t++,e+=3)M[e]=u,M[e+1]=u+t,M[e+2]=u+t+1;u+=A+1}}}}clip(t,e,r,s,i,n,a,o){let l,h=o,c=!1;a.length%4>=2?(l=o,o=this.scratch):l=this.scratch,l.length=0,l.push(t),l.push(e),l.push(r),l.push(s),l.push(i),l.push(n),l.push(t),l.push(e),o.length=0;let u=a.length-4,d=a;for(let t=0;;t+=2){let e=d[t],r=d[t+1],s=e-d[t+2],i=r-d[t+3],n=o.length,a=l;for(let t=0,n=l.length-2;t<n;){let n=a[t],l=a[t+1];t+=2;let h=a[t],u=a[t+1],d=i*(e-h)>s*(r-u),p=i*(e-n)-s*(r-l);if(p>0){if(d){o.push(h),o.push(u);continue}let t=h-n,e=u-l,r=p/(t*i-e*s);if(!(r>=0&&r<=1)){o.push(h),o.push(u);continue}o.push(n+t*r),o.push(l+e*r)}else if(d){let t=h-n,e=u-l,r=p/(t*i-e*s);if(!(r>=0&&r<=1)){o.push(h),o.push(u);continue}o.push(n+t*r),o.push(l+e*r),o.push(h),o.push(u)}c=!0}if(n==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==u)break;let p=o;(o=l).length=0,l=p}if(h!=o){h.length=0;for(let t=0,e=o.length-2;t<e;t++)h[t]=o[t]}else h.length=h.length-2;return c}static makeClockwise(t){let e=t,r=t.length,s=e[r-2]*e[1]-e[0]*e[r-1],i=0,n=0,a=0,o=0;for(let t=0,l=r-3;t<l;t+=2)i=e[t],n=e[t+1],a=e[t+2],o=e[t+3],s+=i*o-a*n;if(!(s<0))for(let t=0,s=r-2,i=r>>1;t<i;t+=2){let r=e[t],i=e[t+1],n=s-t;e[t]=e[n],e[t+1]=e[n+1],e[n]=r,e[n+1]=i}}}},9155:(t,e,r)=>{"use strict";r.d(e,{yE:()=>l});var s=r(166),i=r(8034);const n=new i.I9;i.EA.yDown=!0;const a=new i.qy,o=new i.bC(()=>new s.A1g);class l extends s.lZB{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(t){let e;if(e="number"==typeof t?this.skeleton.slots[t]:"string"==typeof t?this.skeleton.findSlot(t):t,!e)throw new Error(`No slot found with the given slot reference: ${t}`);return e}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}_autoUpdate=!1;get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?s.RvI.shared.add(this.internalUpdate,this):!t&&this._autoUpdate&&s.RvI.shared.remove(this.internalUpdate,this),this._autoUpdate=t}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(t){t instanceof i.Ym&&(t={skeletonData:t}),super({}),this.allowChildren=!0;const e=t instanceof i.Ym?t:t.skeletonData;this.skeleton=new i.EA(e),this.state=new i.oA(new i.Qq(e)),this.autoUpdate=t?.autoUpdate??!0,this.darkTint=void 0===t?.darkTint?this.skeleton.slots.some(t=>!!t.data.darkColor):t?.darkTint;const r=this.skeleton.slots;for(let t=0;t<r.length;t++)this.attachmentCacheData[t]=Object.create(null);this._boundsProvider=t.boundsProvider}update(t){this.internalUpdate(0,t)}internalUpdate(t,e){this._updateAndApplyState(e??s.RvI.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(t,e){const r=t;if("string"==typeof t&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${String(r)} not found`);if(n.set(e.x,e.y),t.parent){const e=t.parent.worldToLocal(n);t.x=e.x,t.y=-e.y}else t.x=n.x,t.y=n.y}getBonePosition(t,e){const r=t;return"string"==typeof t&&(t=this.skeleton.findBone(t)),t?(e||(e={x:0,y:0}),e.x=t.worldX,e.y=t.worldY,e):(console.error(`Cant set bone position! Bone ${String(r)} not found`),e)}_updateAndApplyState(t){this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t);const{skeleton:e}=this;this.state.apply(e),this.beforeUpdateWorldTransforms(this),e.updateWorldTransform(i.AQ.update),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const t=this.skeleton.drawOrder,e=this._lastAttachments;let r=0,s=!1;for(let i=0;i<t.length;i++){const n=t[i].getAttachment();n&&(n!==e[r]&&(s=!0,e[r]=n),r++)}r!==e.length&&(s=!0,e.length=r),this.spineAttachmentsDirty||=s}currentClippingSlot;updateAndSetPixiMask(t,e){const r=t.attachment;if(r&&r instanceof i.K$){const e=this.clippingSlotToPixiMasks[t.data.name]||={slot:t,vertices:new Array};return e.maskComputed=!1,void(this.currentClippingSlot=e)}let s=this.currentClippingSlot,n=this._slotsObject[t.data.name];if(s&&n){let t=s.mask;if(t||(t=o.obtain(),s.mask=t,this.addChild(t)),!s.maskComputed){let e=s.slot,r=e.attachment;s.maskComputed=!0;const i=r.worldVerticesLength,n=s.vertices;r.computeWorldVertices(e,0,i,n,0,2),t.clear().poly(n).stroke({width:0}).fill({alpha:.25})}n.container.mask=t}else n?.container.mask&&(n.container.mask=null);if(s&&s.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),e){for(const t in this.clippingSlotToPixiMasks){const e=this.clippingSlotToPixiMasks[t];e.slot.attachment instanceof i.K$&&e.maskComputed||!e.mask||(this.removeChild(e.mask),o.free(e.mask),e.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const t=this.skeleton.drawOrder;for(let e=0;e<t.length;e++){const r=t[e];this.updateAndSetPixiMask(r,e===t.length-1);const n=r.getAttachment();if(n)if(n instanceof i.fj||n instanceof i.Qb){const t=this._getCachedData(r,n);n instanceof i.Qb?n.computeWorldVertices(r,t.vertices,0,2):n.computeWorldVertices(r,0,n.worldVerticesLength,t.vertices,0,2),t.uvs.length<n.uvs.length&&(t.uvs=new Float32Array(n.uvs.length)),(0,s.Whu)(n.uvs.buffer,t.uvs.buffer);const e=r.bone.skeleton.color,o=r.color,l=n.color,h=e.a*o.a*l.a;if(t.color.set(e.r*o.r*l.r,e.g*o.g*l.g,e.b*o.b*l.b,h),0===this.alpha||0===h)t.skipRender=!0;else{r.darkColor&&t.darkColor.setFromColor(r.darkColor),t.skipRender=t.clipped=!1;const e=n.region?.texture.texture||s.gPd.EMPTY;t.texture!==e&&(t.texture=e,this.spineTexturesDirty=!0),a.isClipping()&&this.updateClippingData(t)}}else if(n instanceof i.K$){a.clipStart(r,n);continue}a.clipEndWithSlot(r)}a.clipEnd()}updateClippingData(t){t.clipped=!0,a.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs);const{clippedVertices:e,clippedUVs:r,clippedTriangles:s}=a,i=e.length/2,n=s.length;t.clippedData||(t.clippedData={vertices:new Float32Array(2*i),uvs:new Float32Array(2*i),vertexCount:i,indices:new Uint16Array(n),indicesCount:n},this.spineAttachmentsDirty=!0);const o=t.clippedData,l=o.vertexCount!==i||n!==o.indicesCount;t.skipRender=0===i,l&&(this.spineAttachmentsDirty=!0,o.vertexCount<i&&(o.vertices=new Float32Array(2*i),o.uvs=new Float32Array(2*i)),o.indices.length<n&&(o.indices=new Uint16Array(n)));const{vertices:h,uvs:c,indices:u}=o;for(let t=0;t<i;t++)h[2*t]=e[2*t],h[2*t+1]=e[2*t+1],c[2*t]=r[2*t],c[2*t+1]=r[2*t+1];o.vertexCount=i;for(let t=0;t<n;t++)u[t]!==s[t]&&(this.spineAttachmentsDirty=!0,u[t]=s[t]);o.indicesCount=n}updateSlotObjects(){for(const t in this._slotsObject){const e=this._slotsObject[t];e&&this.updateSlotObject(e)}}updateSlotObject(t){const{slot:e,container:r}=t,s=!t.followAttachmentTimeline||Boolean(e.attachment);if(r.visible=this.skeleton.drawOrder.includes(e)&&s,r.visible){let t=e.bone;r.position.set(t.worldX,t.worldY),r.angle=t.getWorldRotationX();let s=1,i=1;for(;t;)s*=t.scaleX,i*=t.scaleY,t=t.parent;s<0&&(r.angle-=180),r.scale.set(e.bone.getWorldScaleX()*Math.sign(s),e.bone.getWorldScaleY()*Math.sign(i)),r.alpha=this.skeleton.color.a*e.color.a}}_getCachedData(t,e){return this.attachmentCacheData[t.data.index][e.name]||this.initCachedData(t,e)}initCachedData(t,e){let r;return e instanceof i.Qb?(r=new Float32Array(8),this.attachmentCacheData[t.data.index][e.name]={id:`${t.data.index}-${e.name}`,vertices:r,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(e.uvs.length),color:new i.Q1(1,1,1,1),darkColor:new i.Q1(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:e.region?.texture.texture}):(r=new Float32Array(e.worldVerticesLength),this.attachmentCacheData[t.data.index][e.name]={id:`${t.data.index}-${e.name}`,vertices:r,clipped:!1,indices:e.triangles,uvs:new Float32Array(e.uvs.length),color:new i.Q1(1,1,1,1),darkColor:new i.Q1(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:e.region?.texture.texture}),this.attachmentCacheData[t.data.index][e.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(t,e,r){t=this.getSlotFromRef(t);for(const t in this._slotsObject)this._slotsObject[t]?.container===e&&this.removeSlotObject(this._slotsObject[t].slot);this.removeSlotObject(t),e.includeInBuild=!1,this.addChild(e);const s={container:e,slot:t,followAttachmentTimeline:r?.followAttachmentTimeline||!1};this._slotsObject[t.data.name]=s,this.updateSlotObject(s)}removeSlotObject(t){let e;if(t instanceof s.mcf){for(const r in this._slotsObject)if(this._slotsObject[r]?.container===t){this._slotsObject[r]=null,e=t;break}}else{const r=this.getSlotFromRef(t);e=this._slotsObject[r.data.name]?.container,this._slotsObject[r.data.name]=null}e&&(this.removeChild(e),e.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([t,e])=>{e&&e.container.removeFromParent(),delete this._slotsObject[t]})}getSlotObject(t){return t=this.getSlotFromRef(t),this._slotsObject[t.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new i.VT;const t=this.skeletonBounds;if(t.update(this.skeleton,!0),this._boundsProvider){const t=this._boundsProvider.calculateBounds(this),e=this._bounds;e.clear(),e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height}else if(t.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments();const t=this.skeleton.drawOrder,e=this._bounds;e.clear();for(let r=0;r<t.length;r++){const s=t[r],n=s.getAttachment();if(n&&(n instanceof i.Qb||n instanceof i.fj)){const t=this._getCachedData(s,n);e.addVertexData(t.vertices,0,t.vertices.length)}}}else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY}addBounds(t){t.addBounds(this.bounds)}destroy(t=!1){super.destroy(t),s.RvI.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,e){this.pixiWorldCoordinatesToSkeleton(t),e.parent?e.parent.worldToLocal(t):e.worldToLocal(t)}static from({skeleton:t,atlas:e,scale:r=1,darkTint:n,autoUpdate:a=!0,boundsProvider:o}){const h=`${t}-${e}-${r}`;if(s.l2R.has(h))return new l({skeletonData:s.l2R.get(h),darkTint:n,autoUpdate:a,boundsProvider:o});const c=s.sP.get(t),u=s.sP.get(e),d=new i.qd(u),p=c instanceof Uint8Array?new i.t7(d):new i.mI(d);p.scale=r;const f=p.readSkeletonData(c);return s.l2R.set(h,f),new l({skeletonData:f,darkTint:n,autoUpdate:a,boundsProvider:o})}}},9212:(t,e,r)=>{"use strict";r.d(e,{N:()=>s,P:()=>n});var s,i=r(1347);class n{index=0;name;boneData;color=new i.Q1(1,1,1,1);darkColor=null;attachmentName=null;blendMode=s.Normal;visible=!0;constructor(t,e,r){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!r)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=r}}!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(s||(s={}))},9250:(t,e,r)=>{"use strict";r.d(e,{g:()=>i});var s=r(8271);const i=[];i[s.K.NONE]=void 0,i[s.K.DISABLED]={stencilWriteMask:0,stencilReadMask:0},i[s.K.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}},i[s.K.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}},i[s.K.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}},i[s.K.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}}},9279:(t,e,r)=>{"use strict";r.d(e,{Y:()=>s});const s=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t}},9317:(t,e,r)=>{"use strict";r.d(e,{l:()=>n});var s=r(6793);class i extends s.a{async doLoad(t){const e=new Promise(e=>{const r=new Image;r.crossOrigin="anonymous",r.src=t,r.onload=()=>{if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(this.cachedAssets.has(t))return console.error(`Dom texture already loaded: ${t}`),void e(void 0);this.cachedAssets.set(t,r),e(r)}else e(void 0)},r.onerror=r=>{this.loadingPromises.delete(t),console.error(`Failed to load dom texture: ${t}`,r),e(void 0)}});return this.loadingPromises.set(t,e),await e}cleanup(t,e){e.remove()}}const n=new i},9359:(t,e,r)=>{"use strict";r.d(e,{v:()=>n});var s=r(4872),i=r(4696);class n extends s.A{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return(0,i.t6)(i.lj,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return(0,i.t6)(i.lj,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return(0,i.t6)(i.lj,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return(0,i.t6)(i.lj,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return(0,i.t6)(i.lj,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners();for(const t in this.chars)this.chars[t].texture?.destroy();this.chars=null,t&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)}}},9375:(t,e,r)=>{"use strict";r.d(e,{L:()=>i});const s={default:-1};function i(t="default"){return void 0===s[t]&&(s[t]=-1),++s[t]}},9390:(t,e,r)=>{"use strict";r.d(e,{M:()=>n});var s=r(59);const i=[new s.b,new s.b,new s.b,new s.b];class n{constructor(t=0,e=0,r=0,s=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(s)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new n(0,0,0,0)}clone(){return new n(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,r,s=.5){const{width:i,height:n}=this;if(i<=0||n<=0)return!1;const a=this.x,o=this.y,l=r*(1-s),h=r-l;return t>=a-l&&t<=a+i+l&&e>=o-l&&e<=o+n+l&&!(t>a+h&&t<a+i-h&&e>o+h&&e<o+n-h)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,s=this.right,n=this.top,a=this.bottom;if(s<=r||a<=n)return!1;const o=i[0].set(t.left,t.top),l=i[1].set(t.left,t.bottom),h=i[2].set(t.right,t.top),c=i[3].set(t.right,t.bottom);if(h.x<=o.x||l.y<=o.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(0===u)return!1;if(e.apply(o,o),e.apply(l,l),e.apply(h,h),e.apply(c,c),Math.max(o.x,l.x,h.x,c.x)<=r||Math.min(o.x,l.x,h.x,c.x)>=s||Math.max(o.y,l.y,h.y,c.y)<=n||Math.min(o.y,l.y,h.y,c.y)>=a)return!1;const d=u*(l.y-o.y),p=u*(o.x-l.x),f=d*r+p*n,m=d*s+p*n,g=d*r+p*a,x=d*s+p*a;if(Math.max(f,m,g,x)<=d*o.x+p*o.y||Math.min(f,m,g,x)>=d*c.x+p*c.y)return!1;const y=u*(o.y-h.y),v=u*(h.x-o.x),_=y*r+v*n,b=y*s+v*n,w=y*r+v*a,T=y*s+v*a;return!(Math.max(_,b,w,T)<=y*o.x+v*o.y||Math.min(_,b,w,T)>=y*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),i=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=s,this.height=Math.max(i-s,0),this}ceil(t=1,e=.001){const r=Math.ceil((this.x+this.width-e)*t)/t,s=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=s-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=s,this.height=i-s,this}getBounds(t){return t||(t=new n),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,r=t.y,s=t.x+t.width,i=t.y+t.height;return e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height&&s>=this.x&&s<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(t,e,r,s){return this.x=t,this.y=e,this.width=r,this.height=s,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}},9437:(t,e,r)=>{"use strict";function s(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function i(t){return!(t&t-1||!t)}r.d(e,{U5:()=>s,f3:()=>i})},9482:(t,e,r)=>{"use strict";function s(t,e,r){const s=(t>>24&255)/255;e[r++]=(255&t)/255*s,e[r++]=(t>>8&255)/255*s,e[r++]=(t>>16&255)/255*s,e[r++]=s}r.d(e,{V:()=>s})},9521:(t,e,r)=>{"use strict";r.d(e,{s:()=>a});var s=r(9739),i=r(7694),n=r(2445);function a(t,e,r){t.label=r,t._sourceOrigin=r;const a=new s.g({source:t,label:r}),o=()=>{delete e.promiseCache[r],n.l.has(r)&&n.l.remove(r)};return a.source.once("destroy",()=>{e.promiseCache[r]&&((0,i.R)("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),o())}),a.once("destroy",()=>{t.destroyed||((0,i.R)("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),o())}),a}},9565:(t,e,r)=>{"use strict";r.d(e,{E:()=>o,f:()=>n});var s=r(5199),i=r(7882);function n(t,e,r){let n,l;return r.clear(),t.parent?e?n=t.parent.worldTransform:(l=i.u.get().identity(),n=o(t,l)):n=s.u.IDENTITY,a(t,r,n,e),l&&i.u.return(l),r.isValid||r.set(0,0,0,0),r}function a(t,e,r,n){if(!t.visible||!t.measurable)return;let o;n?o=t.worldTransform:(t.updateLocalTransform(),o=i.u.get(),o.appendFrom(t.localTransform,r));const l=e,h=!!t.effects.length;if(h&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,o);else{const r=t.bounds;r&&!r.isEmpty()&&(e.matrix=o,e.addBounds(r));for(let r=0;r<t.children.length;r++)a(t.children[r],e,o,n)}if(h){for(let r=0;r<t.effects.length;r++)t.effects[r].addBounds?.(e);l.addBounds(e,s.u.IDENTITY),i.o.return(e)}n||i.u.return(o)}function o(t,e){const r=t.parent;return r&&(o(r,e),r.updateLocalTransform(),e.append(r.localTransform)),e}},9586:(t,e,r)=>{"use strict";r.d(e,{P:()=>f});var s=r(5423),i=r(1065),n=r(5947),a=r(2885),o=r(3761),l=r(4173),h=r(8979),c=r(3463),u=r(9521);const d=[".jpeg",".jpg",".png",".webp",".avif"],p=["image/jpeg","image/png","image/webp","image/avif"],f={name:"loadTextures",id:"texture",extension:{type:i.Ag.LoadParser,priority:c.T.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>(0,o.s)(t,p)||(0,l.W)(t,d),async load(t,e,r){let i=null;i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await h.O.isImageBitmapSupported()?await h.O.loadImageBitmap(t,e):await async function(t,e){const r=await s.e.get().fetch(t);if(!r.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${r.status} ${r.statusText}`);const i=await r.blob();return"premultiplied-alpha"===e?.data?.alphaMode?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}(t,e):await new Promise((e,r)=>{i=s.e.get().createImage(),i.crossOrigin=this.config.crossOrigin,i.src=t,i.complete?e(i):(i.onload=()=>{e(i)},i.onerror=r)});const o=new n.b({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||(0,a.v)(t),...e.data});return(0,u.s)(o,r,t)},unload(t){t.destroy(!0)}}},9677:(t,e,r)=>{"use strict";r.d(e,{I:()=>C,v:()=>A});var s=r(5007),i=r(1790),n=r(7694);function a(t,e,r){if(t)for(const s in t){const i=e[s.toLocaleLowerCase()];if(i){let e=t[s];"header"===s&&(e=e.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),r&&i.push(`//----${r}----//`),i.push(e)}else(0,n.R)(`${s} placement hook does not exist in shader`)}}const o=/\{\{(.*?)\}\}/g;function l(t){const e={};return(t.match(o)?.map(t=>t.replace(/[{()}]/g,""))??[]).forEach(t=>{e[t]=[]}),e}function h(t,e){let r;const s=/@in\s+([^;]+);/g;for(;null!==(r=s.exec(t));)e.push(r[1])}function c(t,e,r=!1){const s=[];h(e,s),t.forEach(t=>{t.header&&h(t.header,s)});const i=s;r&&i.sort();const n=i.map((t,e)=>` @location(${e}) ${t},`).join("\n");let a=e.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",`\n${n}\n`),a}function u(t,e){let r;const s=/@out\s+([^;]+);/g;for(;null!==(r=s.exec(t));)e.push(r[1])}function d(t,e){let r=t;for(const t in e){const s=e[t];r=s.join("\n").length?r.replace(`{{${t}}}`,`//-----${t} START-----//\n${s.join("\n")}\n//----${t} FINISH----//`):r.replace(`{{${t}}}`,"")}return r}const p=Object.create(null),f=new Map;let m=0;function g({template:t,bits:e}){const r=x(t,e);return p[r]||(p[r]=y(t.vertex,t.fragment,e)),p[r]}function x(t,e){return e.map(t=>(f.has(t)||f.set(t,m++),f.get(t))).sort((t,e)=>t-e).join("-")+t.vertex+t.fragment}function y(t,e,r){const s=l(t),i=l(e);return r.forEach(t=>{a(t.vertex,s,t.name),a(t.fragment,i,t.name)}),{vertex:d(t,s),fragment:d(e,i)}}const v="\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n",_="\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n",b="\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n",w="\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n",T={name:"global-uniforms-bit",vertex:{header:"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n "}},S={name:"global-uniforms-bit",vertex:{header:"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n "}};function A({bits:t,name:e}){const r=function({template:t,bits:e}){const r=x(t,e);if(p[r])return p[r];const{vertex:s,fragment:i}=function(t,e){const r=e.map(t=>t.vertex).filter(t=>!!t),s=e.map(t=>t.fragment).filter(t=>!!t);let i=c(r,t.vertex,!0);return i=function(t,e){const r=[];u(e,r),t.forEach(t=>{t.header&&u(t.header,r)});let s=0;const i=r.sort().map(t=>t.indexOf("builtin")>-1?t:`@location(${s++}) ${t}`).join(",\n"),n=r.sort().map(t=>{return` var ${e=t,e.replace(/@.*?\s+/g,"")};`;var e}).join("\n"),a=`return VSOutput(\n ${r.sort().map(t=>` ${function(t){const e=/\b(\w+)\s*:/g.exec(t);return e?e[1]:""}(t)}`).join(",\n")});`;let o=e.replace(/@out\s+[^;]+;\s*/g,"");return o=o.replace("{{struct}}",`\n${i}\n`),o=o.replace("{{start}}",`\n${n}\n`),o=o.replace("{{return}}",`\n${a}\n`),o}(r,i),{vertex:i,fragment:c(s,t.fragment,!0)}}(t,e);return p[r]=y(s,i,e),p[r]}({template:{fragment:_,vertex:v},bits:[T,...t]});return i.B.from({name:e,vertex:{source:r.vertex,entryPoint:"main"},fragment:{source:r.fragment,entryPoint:"main"}})}function C({bits:t,name:e}){return new s.M({name:e,...g({template:{vertex:b,fragment:w},bits:[S,...t]})})}},9739:(t,e,r)=>{"use strict";r.d(e,{g:()=>d});var s=r(4872),i=r(769),n=r(9390),a=r(9375),o=r(4696);const l=()=>{};var h=r(6185),c=r(4269),u=r(1734);class d extends s.A{constructor({source:t,label:e,frame:r,orig:s,trim:i,defaultAnchor:o,defaultBorders:l,rotate:h,dynamic:u}={}){if(super(),this.uid=(0,a.L)("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new n.M,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new c.v,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:t,height:e}=this._source;this.frame.width=t,this.frame.height=e}this.orig=s||this.frame,this.trim=i,this.rotate=h??0,this.defaultAnchor=o,this.defaultBorders=l,this.destroyed=!1,this.dynamic=u||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new u.N(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:r,height:s}=this._source,n=e.x/r,a=e.y/s,o=e.width/r,l=e.height/s;let h=this.rotate;if(h){const e=o/2,r=l/2,s=n+e,c=a+r;h=i.E.add(h,i.E.NW),t.x0=s+e*i.E.uX(h),t.y0=c+r*i.E.uY(h),h=i.E.add(h,2),t.x1=s+e*i.E.uX(h),t.y1=c+r*i.E.uY(h),h=i.E.add(h,2),t.x2=s+e*i.E.uX(h),t.y2=c+r*i.E.uY(h),h=i.E.add(h,2),t.x3=s+e*i.E.uX(h),t.y3=c+r*i.E.uY(h)}else t.x0=n,t.y0=a,t.x1=n+o,t.y1=a,t.x2=n+o,t.y2=a+l,t.x3=n,t.y3=a+l}destroy(t=!1){this._source&&t&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return(0,o.t6)(o.lj,"Texture.baseTexture is now Texture.source"),this._source}}d.EMPTY=new d({label:"EMPTY",source:new c.v({label:"EMPTY"})}),d.EMPTY.destroy=l,d.WHITE=new d({source:new h.P({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),d.WHITE.destroy=l},9776:(t,e,r)=>{"use strict";r.d(e,{m:()=>a});var s=r(5199),i=r(9375);const n={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class a{constructor(t,e){this.uid=(0,i.L)("fillPattern"),this._tick=0,this.transform=new s.u,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=n[e].addressModeU,t.source.style.addressModeV=n[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}},9797:(t,e,r)=>{"use strict";var s=r(1065),i=r(3769),n=r(7433),a=r(5153),o=r(9482),l=r(1228),h=r(1174),c=r(5199),u=r(9677),d=r(4405),p=r(7335),f=r(1657),m=r(4449),g=r(9739);const x={name:"tiling-bit",vertex:{header:"\n struct TilingUniforms {\n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n };\n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d<f32>;\n @group(2) @binding(2) var uSampler: sampler;\n ",main:"\n uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;\n\n position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;\n "},fragment:{header:"\n struct TilingUniforms {\n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n };\n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d<f32>;\n @group(2) @binding(2) var uSampler: sampler;\n ",main:"\n\n var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);\n coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;\n var unclamped = coord;\n coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);\n\n var bias = 0.;\n\n if(unclamped.x == coord.x && unclamped.y == coord.y)\n {\n bias = -32.;\n }\n\n outColor = textureSampleBias(uTexture, uSampler, coord, bias);\n "}},y={name:"tiling-bit",vertex:{header:"\n uniform mat3 uTextureTransform;\n uniform vec4 uSizeAnchor;\n\n ",main:"\n uv = (uTextureTransform * vec3(aUV, 1.0)).xy;\n\n position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;\n "},fragment:{header:"\n uniform sampler2D uTexture;\n uniform mat3 uMapCoord;\n uniform vec4 uClampFrame;\n uniform vec2 uClampOffset;\n ",main:"\n\n vec2 coord = vUV + ceil(uClampOffset - vUV);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0\n\n "}};let v,_;class b extends f.M{constructor(){v??(v=(0,u.v)({name:"tiling-sprite-shader",bits:[d.Ls,x,p.b]})),_??(_=(0,u.I)({name:"tiling-sprite-shader",bits:[d.mA,y,p.m]}));const t=new m.k({uMapCoord:{value:new c.u,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new c.u,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:_,gpuProgram:v,resources:{localUniforms:new m.k({uTransformMatrix:{value:new c.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:g.g.EMPTY.source,uSampler:g.g.EMPTY.source.style}})}updateUniforms(t,e,r,s,i,n){const a=this.resources.tilingUniforms,o=n.width,l=n.height,h=n.textureMatrix,c=a.uniforms.uTextureTransform;c.set(r.a*o/t,r.b*o/e,r.c*l/t,r.d*l/e,r.tx/t,r.ty/e),c.invert(),a.uniforms.uMapCoord=h.mapCoord,a.uniforms.uClampFrame=h.uClampFrame,a.uniforms.uClampOffset=h.uClampOffset,a.uniforms.uTextureTransform=c,a.uniforms.uSizeAnchor[0]=t,a.uniforms.uSizeAnchor[1]=e,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=i,n&&(this.resources.uTexture=n.source,this.resources.uSampler=n.source.style)}}class w extends h.u{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}const T=new w;class S{constructor(){this.canBatch=!0,this.geometry=new h.u({indices:T.indices.slice(),positions:T.positions.slice(),uvs:T.uvs.slice()})}destroy(){this.geometry.destroy(),this.shader?.destroy()}}class A{constructor(t){this._state=n.U.default2d,this._renderer=t}validateRenderable(t){const e=this._getTilingSpriteData(t),r=e.canBatch;this._updateCanBatch(t);const s=e.canBatch;if(s&&s===r){const{batchableMesh:r}=e;return!r._batcher.checkAndUpdateTexture(r,t.texture)}return r!==s}addRenderable(t,e){const r=this._renderer.renderPipes.batch;this._updateCanBatch(t);const s=this._getTilingSpriteData(t),{geometry:i,canBatch:n}=s;if(n){s.batchableMesh||(s.batchableMesh=new l.U);const n=s.batchableMesh;t.didViewUpdate&&(this._updateBatchableMesh(t),n.geometry=i,n.renderable=t,n.transform=t.groupTransform,n.setTexture(t._texture)),n.roundPixels=this._renderer._roundPixels|t._roundPixels,r.addToBatch(n,e)}else r.break(e),s.shader||(s.shader=new b),this.updateRenderable(t),e.add(t)}execute(t){const{shader:e}=this._getTilingSpriteData(t);e.groups[0]=this._renderer.globalUniforms.bindGroup;const r=e.resources.localUniforms.uniforms;r.uTransformMatrix=t.groupTransform,r.uRound=this._renderer._roundPixels|t._roundPixels,(0,o.V)(t.groupColorAlpha,r.uColor,0),this._state.blendMode=(0,i.i)(t.groupBlendMode,t.texture._source),this._renderer.encoder.draw({geometry:T,shader:e,state:this._state})}updateRenderable(t){const e=this._getTilingSpriteData(t),{canBatch:r}=e;if(r){const{batchableMesh:r}=e;t.didViewUpdate&&this._updateBatchableMesh(t),r._batcher.updateElement(r)}else if(t.didViewUpdate){const{shader:r}=e;r.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture)}}_getTilingSpriteData(t){return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)}_initTilingSpriteData(t){const e=new S;return e.renderable=t,t._gpuData[this._renderer.uid]=e,e}_updateBatchableMesh(t){const e=this._getTilingSpriteData(t),{geometry:r}=e,s=t.texture.source.style;"repeat"!==s.addressMode&&(s.addressMode="repeat",s.update()),function(t,e){const r=t.texture,s=r.frame.width,i=r.frame.height;let n=0,a=0;t.applyAnchorToTexture&&(n=t.anchor.x,a=t.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-a,e[5]=e[7]=1-a;const o=c.u.shared;o.copyFrom(t._tileTransform.matrix),o.tx/=t.width,o.ty/=t.height,o.invert(),o.scale(t.width/s,t.height/i),function(t,e,r,s){let i=0;const n=t.length/2,a=s.a,o=s.b,l=s.c,h=s.d,c=s.tx,u=s.ty;for(r*=2;i<n;){const e=t[r],s=t[r+1];t[r]=a*e+l*s+c,t[r+1]=o*e+h*s+u,r+=2,i++}}(e,0,0,o)}(t,r.uvs),function(t,e){const r=t.anchor.x,s=t.anchor.y;e[0]=-r*t.width,e[1]=-s*t.height,e[2]=(1-r)*t.width,e[3]=-s*t.height,e[4]=(1-r)*t.width,e[5]=(1-s)*t.height,e[6]=-r*t.width,e[7]=(1-s)*t.height}(t,r.positions)}destroy(){this._renderer=null}_updateCanBatch(t){const e=this._getTilingSpriteData(t),r=t.texture;let s=!0;return this._renderer.type===a.W.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),e.canBatch=r.textureMatrix.isSimple&&(s||r.source.isPowerOfTwo),e.canBatch}}A.extension={type:[s.Ag.WebGLPipes,s.Ag.WebGPUPipes,s.Ag.CanvasPipes],name:"tilingSprite"},s.XO.add(A)},9798:(t,e,r)=>{"use strict";r.d(e,{S:()=>s});var s=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(s||{})},9836:(t,e,r)=>{"use strict";r.d(e,{S:()=>s});const s={extension:{type:r(1065).Ag.Environment,name:"webworker",priority:0},test:()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,load:async()=>{await Promise.resolve().then(r.bind(r,6516))}}},9935:(t,e,r)=>{"use strict";r(2839)._}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={exports:{}};return n[t].call(r.exports,r,r.exports,o),r.exports}t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",r=t?Symbol("webpack exports"):"__webpack_exports__",s=t?Symbol("webpack error"):"__webpack_error__",i=t=>{t&&t.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))},o.a=(t,n,a)=>{var o;a&&((o=[]).d=-1);var l,h,c,u=new Set,d=t.exports,p=new Promise((t,e)=>{c=e,h=t});p[r]=d,p[e]=t=>(o&&t(o),u.forEach(t),p.catch(t=>{})),t.exports=p,n(t=>{var n;l=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){var n=[];n.d=0,t.then(t=>{a[r]=t,i(n)},t=>{a[s]=t,i(n)});var a={};return a[e]=t=>t(n),a}}var o={};return o[e]=t=>{},o[r]=t,o}))(t);var a=()=>l.map(t=>{if(t[s])throw t[s];return t[r]}),h=new Promise(t=>{(n=()=>t(a)).r=0;var r=t=>t!==o&&!u.has(t)&&(u.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map(t=>t[e](r))});return n.r?h:a()},t=>(t?c(p[s]=t):h(d),i(o))),o&&o.d<0&&(o.d=0)},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(743)})();
|